The embodiment of the invention provides a dual-loop adaptive CTU division prediction method and device based on coding cost
perception, and is applied to the technical field of video coding. The method comprises the following steps: acquiring image data of a current video frame, preprocessing the image data to obtain a feature
tensor of each CTU of the current video frame, acquiring an actual coding cost of each CTU of a historical video
frame based on an outer loop mechanism to generate a
time domain attention map, weighting the feature
tensor of each CTU to obtain a corresponding weighted feature
tensor, and obtaining a
time domain attention map of each CTU of the historical video
frame based on an
inner loop mechanism. And inputting the weighted feature tensor of each CTU into a recursive function, performing evaluation and correction based on coding cost
perception to obtain a division decision corresponding to each CTU, generating a division decision diagram, inputting the division decision diagram into a video
encoder to obtain a compressed video code
stream, and updating a
time domain attention diagram according to the actual coding cost, so that the coding time is shortened, the coding complexity is reduced, and the coding efficiency is improved. Real-time video coding is realized, the prediction accuracy is improved, the misjudgment rate is reduced, and the coding stability is guaranteed.