Iteration method and device for enhancing affine motion estimation in video coding

By calculating the absolute difference SAD and relative gradient of each coding block, affine iteration is performed, which improves the efficiency and accuracy of affine motion estimation in video coding, solves the problem of low iteration efficiency in the existing technology, and achieves high throughput and Low resource consumption video encoding.

CN118694960APending Publication Date: 2024-09-24BEIJING INSTITUTE OF GRAPHIC COMMUNICATION
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410748028.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2024-09-24

AI Technical Summary

Technical Problem

The iteration efficiency of affine motion estimation in existing video coding technology is low and cannot effectively describe complex motions, resulting in increased computational complexity and difficulty in meeting the hardware design requirements for real-time processing of video data.

Method used

By calculating the absolute difference SAD of each coding block, determine the minimum absolute difference SAD, decompose the initial motion vector into initial motion vector components, and perform affine iteration based on the relative gradient and coding block position information to obtain the optimal motion vector and simplify the image gradient calculation. , improve iteration efficiency.

Benefits of technology

It improves the iteration efficiency and accuracy of affine motion estimation, reduces resource consumption, realizes high-throughput video encoding, and meets the needs of real-time 4K video encoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118694960A
    Figure CN118694960A
Patent Text Reader

Abstract

The invention provides an iteration method and device for enhancing affine motion estimation in video coding, and the method comprises the steps: obtaining video stream data corresponding to a multi-purpose video, and caching block pixel data corresponding to a reference frame and block pixel data corresponding to a current frame; loading the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, calculating the absolute difference SAD of each coding block based on the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, determining the minimum absolute difference SAD, determining an initial motion vector based on the minimum absolute difference SAD, and sending the initial motion vector to the current frame; calculating a relative gradient based on pixel data of a coding block corresponding to the SAD, and decomposing the initial motion vector into initial motion vector components; and performing affine iteration based on the initial motion vector component, the relative gradient and the position information of the coding block to obtain an optimal motion vector. According to the method, the iteration efficiency of enhancing affine motion estimation in video coding can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of video processing, and in particular to an iterative method and device for enhancing affine motion estimation in video coding. Background Art

[0002] The increasing growth of video data is driving the continuous advancement of video coding technology. Versatile Video Coding (VVC), the successor of High Efficiency Video Coding (HEVC), aims to further improve compression performance, especially for ultra-high-definition (UHD) content. In the VVC standard, inter-frame prediction is the key to compression efficiency. It reduces the amount of data required to be transmitted by exploiting the temporal redundancy between frames in a video sequence. Motion estimation (ME) is the most computationally intensive and memory-intensive part of inter-frame prediction because it needs to find the motion changes between the reference frame and the current frame. In the face of high-definition video content, translation motion cannot effectively describe complex motions such as rotation and scaling. Affine motion estimation (AME), as a novel inter-frame prediction technology, provides an improved means for accurate modeling of complex motions such as rotation, scaling, and distortion. However, this enhanced prediction capability comes at the cost of increased computational complexity, which poses new challenges to the hardware design of real-time processing of video image data, especially in terms of power consumption and processing speed.

[0003] At present, the existing technology generally adopts a model based on affine motion estimation iteration to implement affine motion estimation. This model uses the method of advanced affine motion vector prediction candidate (AAMVP) list to achieve the purpose of determining affine motion vectors. This method has been adopted by the VVC standard. Although the model based on affine motion estimation iteration can accurately predict motion vectors, it ignores the computing power of the model, resulting in low efficiency of affine motion estimation during the iteration process. Therefore, how to improve the iteration efficiency of enhanced affine motion estimation in video coding is a technical problem that needs to be solved urgently. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides an iterative method and apparatus for enhancing affine motion estimation in video coding, so as to eliminate or improve one or more defects existing in the prior art.

[0005] One aspect of the present invention provides an iterative method for enhancing affine motion estimation in video coding, the method comprising the following steps:

[0006] Obtaining video stream data corresponding to the multi-purpose video, and buffering block pixel data corresponding to the reference frame and block pixel data corresponding to the current frame;

[0007] Loading the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, calculating the absolute difference SAD of each coding block based on the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, and determining the minimum absolute difference SAD, determining an initial motion vector based on the minimum absolute difference SAD, and calculating a relative gradient based on the pixel data of the coding block corresponding to the minimum absolute difference SAD, and decomposing the initial motion vector into initial motion vector components;

[0008] Affine iteration is performed based on the initial motion vector component, the relative gradient and the position information of the coding block to obtain an optimal motion vector.

[0009] In some embodiments of the present invention, performing affine iteration based on the initial motion vector component, the relative gradient and the position information of the coding block to obtain the optimal motion vector includes:

[0010] Determine a parameter matrix based on the position information of the coding block, and calculate a current motion vector component based on the initial motion vector component, the parameter matrix and the current relative gradient;

[0011] The optimal motion vector is determined based on a current motion vector component corresponding to when the current relative gradient is zero.

[0012] In some embodiments of the present invention, the calculation formula of the current motion vector is:

[0013]

[0014] Among them, (x, y) represents the position coordinates of the control point of the coding block corresponding to the minimum absolute difference SAD, represents the motion vector at the i-th iteration, A(x,y) represents the parameter matrix, represents the motion vector at the i-1th iteration, Δd i Relative gradient refers to the change of motion vector, and W refers to the width of coding block.

[0015] In some embodiments of the present invention, calculating the relative gradient based on the pixel data of the coding block corresponding to the minimum absolute difference SAD includes:

[0016] Obtain pixel data of the coding block corresponding to the minimum absolute difference SAD and pixel data of the surrounding coding blocks;

[0017] Construct a 3X3 pixel matrix based on the pixel data of the coding block corresponding to the minimum absolute difference SAD and the pixel data of the surrounding coding blocks;

[0018] Calculating the gradient component in the horizontal direction and the gradient component in the vertical direction respectively based on the pixel matrix;

[0019] A relative gradient is determined based on the gradient component in the horizontal direction and the gradient component in the vertical direction.

[0020] According to another aspect of the present invention, an iterative system for enhancing affine motion estimation in video coding is also disclosed, the system comprising a storage unit, a control unit, a calculation unit and an affine iteration unit;

[0021] The storage unit receives video stream data corresponding to the multi-purpose video, and caches block pixel data corresponding to the reference frame and block pixel data corresponding to the current frame;

[0022] The control unit loads the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, and sends the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame to the calculation unit;

[0023] The calculation unit calculates the absolute difference SAD of each coding block based on the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, and determines the minimum absolute difference SAD, determines the initial motion vector based on the minimum absolute difference SAD, and calculates the relative gradient based on the pixel data of the coding block corresponding to the minimum absolute difference SAD, and decomposes the initial motion vector into initial motion vector components;

[0024] The affine iteration unit performs affine iteration based on the initial motion vector component, the relative gradient and the position information of the coding block to obtain an optimal motion vector.

[0025] In some embodiments of the present invention, the calculation unit includes multiple SAD calculation modules, and the multiple SAD calculation modules calculate in parallel the absolute difference SAD between each row of block pixel data corresponding to the current frame and the block pixel data corresponding to the reference frame.

[0026] In some embodiments of the present invention, the calculation unit includes a comparison module, which is connected to the output ends of multiple SAD calculation modules, and the comparison module is used to compare multiple absolute differences SAD output by multiple SAD calculation modules and determine the minimum absolute difference SAD.

[0027] In some embodiments of the present invention, the storage unit includes a reference pixel array buffer and a current pixel array buffer, the reference pixel array buffer is used to cache block pixel data corresponding to a reference frame, and the current pixel array buffer is used to cache block pixel data corresponding to the current frame.

[0028] In some embodiments of the present invention, the control unit comprises a finite state machine FSM.

[0029] According to another aspect of the present invention, a computer-readable storage medium is disclosed, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in any of the above embodiments are implemented.

[0030] The iterative method and device for enhancing affine motion estimation in video coding of the present invention first calculates the absolute difference SAD of each coding block and determines the minimum absolute difference SAD, and finally performs affine iteration based on the initial motion vector component, relative gradient and position information of the coding block to obtain the optimal motion vector. The method and device not only ensure that the motion vector finally obtained has high precision and accuracy, but also improves the efficiency of affine motion estimation in the iterative process. In addition, the iterative system for enhancing affine motion estimation in video coding of the present invention also improves throughput and reduces resource consumption.

[0031] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically indicated in the specification and the accompanying drawings.

[0032] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention. The components in the drawings are not drawn to scale, but are only for illustrating the principles of the present invention. In order to facilitate the illustration and description of some parts of the present invention, the corresponding parts in the drawings may be enlarged, that is, they may become larger relative to other components in the exemplary device actually manufactured according to the present invention. In the drawings:

[0034] Figure 1 4 is a flow chart of an iterative method for enhancing affine motion estimation in video coding according to an embodiment of the present invention.

[0035] Figure 2a Schematic diagram of the four-parameter affine motion estimation model.

[0036] Figure 2b Schematic diagram of the six-parameter affine motion estimation model.

[0037] Figure 3 FIG. 4 is a schematic diagram of the architecture of an iterative system for enhancing affine motion estimation in video coding according to an embodiment of the present invention.

[0038] Figure 4aFIG. 4 is a schematic diagram of a data buffer array according to an embodiment of the present invention.

[0039] Figure 4b FIG. 4 is a schematic diagram of a data multiplexing array according to an embodiment of the present invention.

[0040] Figure 5 FIG. 4 is a schematic diagram of the architecture of a computing unit according to an embodiment of the present invention.

[0041] Figure 6 FIG. 4 is a schematic diagram of the architecture of a SAD calculation module according to an embodiment of the present invention. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0043] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

[0044] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0045] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.

[0046] Affine motion estimation (AME) is a key technology for inter-frame prediction in video coding. It can describe the complex motion information between video frames in detail. Compared with traditional motion estimation methods, AME not only retains translation, but also considers more complex geometric transformations such as rotation and scaling. This high-level motion model is introduced in the VVC standard to achieve more accurate inter-frame prediction. Two affine motion models are introduced: a four-parameter affine model (such as Figure 2a ) and the six-parameter affine model (as shown in Figure 2b The four-parameter model uses two motion vectors to perform affine transformation on the coding block, which is suitable for simple geometric changes such as translation and uniform scaling. The six-parameter model introduces more complex transformation capabilities such as tilt and non-uniform scaling by adding a third motion vector, allowing the model to more accurately track the movement of objects in the video content. It is particularly suitable for complex video scenes where objects not only move on a two-dimensional plane but also may change their shape.

[0047] exist Figure 2a In the figure, the points in the upper left and upper right corners represent the control points of the four-parameter model, and the motion vectors of the corresponding sub-blocks can be defined as: in, and Indicates the motion vector of the control point (x, y) corresponding to the coding sub-block in the horizontal and vertical directions, W is the width of the current block, (W-1) represents the distance between the two control points, h, v represent the horizontal and vertical components of mv respectively. In addition, the calculation method of the six-parameter model is similar to that of the four-parameter model, which will not be repeated here.

[0048] Currently, in VVC's affine motion estimation algorithm, a set of optimal affine motion vector combinations is required, usually two for four parameters and three for six parameters. In VVC's official test software anchor VTM, the mean square error (MSE) is used as the matching criterion to find the best matching block, where the calculation of MSE is It is concluded that H and W represent the height and width of the current block respectively, pix cur (x,y) and pix ref (x, y) represent the pixel values ​​of the current block and the reference frame, respectively. MSE calculation involves the square of each pixel difference, which means that more multiplication operations are required; in hardware, multiplication operations require more logical resources and higher processing time than addition and subtraction; in addition, MSE usually produces a wider range of values ​​when accumulating the square of the difference, which requires that the hardware implementation must process a higher data bit width, which in turn increases resource consumption and reduces processing efficiency; at the same time, the design of the hardware architecture is not similar to the development of software algorithms, and is not as flexible as software. In contrast, SAD only involves absolute value and addition operations, which makes it easier to implement in hardware; the hardware friendliness of SAD is mainly reflected in its simplicity of operation and low resource requirements. Since only the absolute value of the difference needs to be calculated and accumulated, SAD reduces computational complexity and implementation cost; more importantly, the parallelization of SAD operations is more direct, allowing more data to be processed at the same time, thereby increasing processing speed. Therefore, the iterative method and device for enhancing affine motion estimation in video encoding disclosed in the present application take the minimum absolute difference SAD as the goal, and obtain the optimal motion vector through affine iteration, so as to improve the iteration efficiency and reduce resource consumption while ensuring that a more accurate motion vector is obtained.

[0049] The high-throughput iterative method for hardware implementation disclosed in this application significantly improves the efficiency of affine motion prediction in VVC; the algorithm uses absolute difference and SAD as matching criteria to calculate the optimal combination of affine motion vectors. The vector is then adjusted to minimize SAD to ensure accurate alignment between the current coding block and the reference frame. In addition, the method introduces the Sobel operator to simplify the calculation of image gradients; experimental results show that the hardware-based method can efficiently process 4K video at 60fps, and use hardware parallelism to meet strict real-time video coding standards without affecting coding efficiency.

[0050] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the accompanying drawings, the same reference numerals represent the same or similar components, or the same or similar steps.

[0051] Figure 1 FIG. 1 is a flow chart of an iterative method for enhancing affine motion estimation in video coding in one embodiment of the present invention. Figure 1 As shown, the iterative method at least includes steps S10 to S30. Figure 3 This is a schematic diagram of the architecture of an iterative system for enhancing affine motion estimation in video coding in one embodiment of the present invention, corresponding to the iterative method for enhancing affine motion estimation in video coding, the system at least includes a storage unit, a control unit, a computing unit and an affine iteration unit.

[0052] Step S10: acquiring video stream data corresponding to the multi-purpose video, and buffering block pixel data corresponding to the reference frame and block pixel data corresponding to the current frame.

[0053] In this step, the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame for SAD calculation are first cached. In the corresponding iterative system, this step is implemented by a storage unit. In one embodiment, the storage unit is specifically a register unit, which is mainly responsible for processing input data to ensure that the data is used by the calculation unit in a suitable format and timing.

[0054] In the iterative system, the storage unit 100 may specifically include a reference pixel array buffer, a current pixel array buffer, and a plurality of I / O interfaces, wherein the reference pixel array buffer is used to buffer the block pixel data corresponding to the reference frame, and the current pixel array buffer is used to buffer the block pixel data corresponding to the current frame. In order to realize the caching of the storage unit, a cache control module may be specifically provided, which is responsible for managing the data flow to the above two buffers and processing the data flow from the video input to ensure the stability and reliability of the data before entering the processing flow.

[0055] In one embodiment, if Figure 4aAs shown in the figure, the coding block can be set to a size of 8×8, and the search box can be set to cover a range of 64×64. At this time, in the storage unit, the input of the reference frame data occupies 64 input and output ports (IO ports), and 8 pixel values ​​are read each time. In order to process data more efficiently, the input of 23 rows of pixels is set as a row of the reference pixel array. After storage, it is compared and calculated with the data in the current pixel array. In addition, the current frame data reads data based on 32 IO interfaces, and reads four pixels each time; the reading order is from top to bottom, and each row is from left to right; each 8×8 pixel block needs to be read through two cycles; at this time, an 8-bit buffer is created, and the complete 8×8 pixel block is transferred to MEMO through a 16-cycle loop; at the beginning of each row, the first 8×8 pixel block is stored in MEMO1; the calculation module transfers the next 8×8 pixel block in the first 16 cycles of every 25T cycle, and MEMO can store two 8×8 pixel blocks. In the first 8 cycles of the current cycle, MEMO1 transmits 8 pixel data to the calculation unit per cycle.

[0056] When the processing hardware corresponding to the iterative method processes a large amount of data, if it re-reads and caches it every time, it will waste a lot of time and computing costs; therefore, the data of the current pixel array and the data of the reference pixel array are stored in a set of register arrays. Currently, there are three common levels of data multiplexing: no multiplexing, one-dimensional multiplexing, and two-dimensional multiplexing; no multiplexing will result in a linear relationship between the search time and the number of search points, one-dimensional multiplexing means that data multiplexing can use multiplexing data in the horizontal and vertical directions, and two-dimensional multiplexing means that the data between any two adjacent points can be reused, but there are some limitations to two-dimensional multiplexing. In this application, one-dimensional multiplexing is used, such as Figure 4b As shown, the dotted frame represents the current pixel, the solid frame represents the pixel selected in the next cycle, and in the current cycle and the next cycle, the coding block in the middle part (overlapping part) is the part multiplexed by the two cycles.

[0057] Step S20: Load the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, calculate the absolute difference SAD of each coding block based on the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, and determine the minimum absolute difference SAD, determine the initial motion vector based on the minimum absolute difference SAD, and calculate the relative gradient based on the pixel data of the coding block corresponding to the minimum absolute difference SAD, and decompose the initial motion vector into initial motion vector components.

[0058] In this step, the loading of block pixel data, the calculation of the absolute difference SAD of each coding block, the determination of the minimum absolute difference SAD and the calculation of the relative gradient are completed. Exemplarily, the absolute difference SAD can be calculated by the following formula: Wherein B1 and B2 represent two image blocks to be compared, respectively, and i and j represent pixel indexes within the image blocks.

[0059] Taking the four-parameter affine motion estimation in VVC as an example, Δd i Represents the change of motion vector, which can also be understood as relative gradient, mv (x,y) =A(x,y)MV T , h,v represent the components in the horizontal and vertical directions respectively; therefore, in the iterative process, the motion vector mv is defined as and Among them, (x, y) represents the position coordinates of the control point of the coding block corresponding to the minimum absolute difference SAD, represents the motion vector at the i-th iteration, A(x,y) represents the parameter matrix, represents the motion vector at the i-1th iteration, and W represents the width of the coding block.

[0060] In addition, when calculating the relative gradient based on the pixel data of the coding block corresponding to the minimum absolute difference SAD, specifically first obtain the pixel data of the coding block corresponding to the minimum absolute difference SAD and the pixel data of the coding blocks around it; construct a 3X3 pixel matrix based on the pixel data of the coding block corresponding to the minimum absolute difference SAD and the pixel data of the coding blocks around it; calculate the gradient component in the horizontal direction and the gradient component in the vertical direction based on the pixel matrix; determine the relative gradient based on the gradient component in the horizontal direction and the gradient component in the vertical direction. That is, the coding blocks around the coding block corresponding to the minimum absolute difference SAD include eight coding blocks directly above, directly below, directly left, directly right, upper left, upper right, lower left and lower right. At this time, the pixel data of the 9 coding blocks form 3X3 pixel data.

[0061] In the iterative system for enhancing affine motion estimation in the corresponding video coding, this step is completed by the control unit 200 and the calculation unit 300. The control unit loads the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, and sends the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame to the calculation unit; the calculation unit calculates the absolute difference SAD of each coding block based on the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, and determines the minimum absolute difference SAD, determines the initial motion vector based on the minimum absolute difference SAD, and calculates the relative gradient based on the pixel data of the coding block corresponding to the minimum absolute difference SAD, and decomposes the initial motion vector into initial motion vector components.

[0062] The control unit is the core of the entire system architecture and is responsible for coordinating the workflow of each part. It receives data from the storage unit and controls the data flow to the computing unit according to the predetermined processing logic; in addition, the control unit is also responsible for generating parameters for affine transformation and adjusting these parameters to optimize the effect of SAD operation. The control unit may include a finite state machine FSM, which is driven by system clock and reset, start processing, processing completion and other control signals. Exemplarily, the FSM contains six different states, each state represents a specific stage of the data processing workflow; the six states are static state, data loading state, processing state, data transfer state, row conversion state, and idle state.

[0063] In the static state, the control unit waits for an activation signal to start the processing sequence; at this time, the control unit is in an idle state until it receives an enable signal and an instruction to start processing. After the control unit receives the start processing signal, it enters the data loading state; in addition, before processing the data, the control unit also checks the readiness of the current frame and reference frame buffers; the cache architecture of the present application meets the size of 8×8 to 128×128. Assuming that the size of the current coding block is 8×8, when the data loading part signal meets 8 8-bit wide signals, the current buffer state signal is pulled high, indicating that the data of the current frame has been loaded, and the reference buffer state signal of the reference pixel array is also the same. When both signals are high, it is considered that the current data is ready, and the control unit jumps to the next state. After jumping to the processing state, wait for the calculation unit to complete the comparison calculation. When the control unit receives the completion signal of the calculation unit, it means that the data acquired in the current cycle has been processed. At this time, the cache enable signal in the previous state is cleared when the control unit receives the completion signal.

[0064] After processing the data of the previous cycle, the control unit enters the data transfer state, where the control unit tracks the number of pixels processed and switches to the next state after reaching a predetermined threshold; this is mainly data shifting to meet the subsequent use of 3×3 matrix signals to calculate image gradients. In the row conversion state, the conversion between pixel rows within the image frame is managed; after processing a row, the number of rows is increased and preparation is made for the next row of data. After processing all rows of data, it is checked whether the processing of all data is completed. After confirmation, the control unit resets to the idle state and prepares to receive the next processing command. In addition to managing state transitions, the control unit also controls the buffer mechanism and pixel count; ensures that data is loaded and processed in a synchronized manner, thereby minimizing resource contention and optimizing processing efficiency; in addition, the control unit also maintains the buffer ready signal to coordinate the data flow between different processing modules to prevent data corruption or loss. In essence, the control unit is the backbone of the system, providing the necessary coordination and synchronization to achieve seamless operation and efficient use of resources.

[0065] The calculation unit is the execution core of the system, mainly including the SAD calculation module and the comparison module. The SAD calculation module is used to perform the absolute difference SAD calculation and is the key module for determining the optimal motion vector. This module receives the affine transformation parameters from the control unit, processes the input reference block pixel data and the current block pixel data, and calculates the difference between each coding block. The comparison module can also be called the comparison / selection PE module, which is responsible for selecting the smallest value from multiple SAD results.

[0066] Furthermore, the calculation unit includes a plurality of SAD calculation modules, and the plurality of SAD calculation modules calculate in parallel the absolute difference SAD between each row of block pixel data corresponding to the current frame and the block pixel data corresponding to the reference frame. In addition, the calculation unit includes a comparison module, the comparison module is connected to the output ends of the plurality of SAD calculation modules, and the comparison module is used to compare the plurality of absolute differences SAD output by the plurality of SAD calculation modules and determine the minimum absolute difference SAD.

[0067] The calculation unit receives pixel data of the current frame and pixel data of the reference frame. In one embodiment, the current frame and the reference frame are divided into 16 64-pixel blocks. At this time, the calculation module includes 16 SAD calculation modules (such as Figure 5 As shown), that is, the data processing and transmission are completed under the scheduling of the control unit, and the parallel calculation is completed through 16 SAD calculation modules. Further, refer to Figure 6 The schematic diagram of the architecture of the SAD module, the SAD calculation module is composed of 64 PE units, the PE units form an 8×8 array, and the selection of the coding block is completed under the control of the control signal of the control unit.

[0068] After the SAD calculation is completed, a 6-bit counter can be used to track the processing cycle. The counter is reset at the end of each cycle and increments the value in clock cycles to achieve precise control of the processing stage. The SAD calculation module calculates the SAD value of each block pair in parallel and generates 16-bit SAD data for comparison. The comparison module compares the SAD values ​​of all blocks and determines the minimum SAD value. In addition, the calculation module also determines the motion vector component corresponding to the block with the minimum SAD, and tracks and records the changes of the minimum SAD value and its corresponding motion vector during the processing cycle.

[0069] In order to further decompose the initial motion vector into motion vector components, the calculation unit may further include a motion vector adjustment module, which determines the components of the motion vector based on the motion vector corresponding to the determined minimum absolute difference SAD as parameter values ​​required by the four-parameter affine motion estimation module.

[0070] In order to enable the calculation unit to complete the calculation of the relative gradient, the storage unit can also be designed with two RAM memories to store the pixel data of the first two rows of the row to which the current coding block belongs, that is, the currently input image data is regarded as the third row of pixel data. When the third row of pixel data arrives, a 3×3 pixel matrix is ​​generated by shift register. It can also be understood that the data in the 3×3 pixel matrix is ​​composed of the pixel data corresponding to the current coding block and the pixel data corresponding to the coding blocks around the current coding block. In this step, timing control is very important, that is, the data valid signal and the clock enable signal need to be delayed by two cycles for synchronization. After obtaining the 3×3 pixel matrix, it is necessary to calculate the gradients in the horizontal and vertical directions respectively. Here, it is still necessary to delay two clock cycles for synchronization, so as to achieve the purpose of data alignment.

[0071] Step S30: performing affine iteration based on the initial motion vector component, relative gradient and position information of the coding block to obtain an optimal motion vector.

[0072] This step is to implement affine iteration of motion vectors to obtain the optimal motion vector. In order to obtain the position information of the coding block, the position and size of the current sub-block can be determined by parsing and processing the input sub-block identifier. Exemplarily, the received sub-block identifier input signal is a signal composed of 2-bit binary numbers, and each bit in the signal represents the position of a sub-block (specifically a coding block) in the video frame. For example, sub_block_id = 0, 1, 2, 3, respectively represents the upper left, upper right, lower left, and lower right sub-blocks. In some implementations, the video frame is divided into different sub-blocks according to different values ​​of the sub-block identifier; for example, 4 sub-blocks can represent the upper left corner, upper right corner, lower left corner, and lower right corner of the video frame respectively; this step ensures that each sub-block has its specific position and range.

[0073] In one embodiment, affine iteration is performed based on the initial motion vector component, relative gradient and position information of the coding block to obtain the optimal motion vector, which may specifically include: determining a parameter matrix based on the position information of the coding block, calculating the current motion vector component based on the initial motion vector component, the parameter matrix and the current relative gradient; and determining the optimal motion vector based on the current motion vector component corresponding to when the current relative gradient is zero. To obtain the best affine motion vector through iteration is actually a process of minimizing the MSE. In the iterative process, the transformation amount Δd of mv is reduced. i Set to 0, then during the iteration if Δd i =0, it means that the best affine motion purpose is achieved, and the currently obtained mv is the best motion vector.

[0074] Accordingly, step S30 can be specifically implemented based on the affine iteration unit 400 in the iterative system of enhanced affine motion estimation in video coding, that is, the affine iteration unit performs affine iteration based on the initial motion vector component, relative gradient and position information of the coding block to obtain the optimal motion vector.

[0075] In the affine iteration unit, the position information of the coding block can be determined based on the sub-block identification processing module. The sub-block identification processing module usually uses a state machine to control the switching of the sub-block position and the operation order; according to the change of the sub-block identifier, the state machine will update the position information of the sub-block in different states and trigger the corresponding operation. The affine iteration unit uses a counter to track the change of the sub-block position and determines the position of the current sub-block through logical operations. For example, for the division of 4 sub-blocks, two bits can be used to represent the horizontal and vertical positions, and then the position of each sub-block can be determined according to different numerical combinations.

[0076] In a specific embodiment, the iteration parameter matrix A(x, y) of the affine motion iteration is first calculated, and A(x, y) includes four parameters ax1, ax2, ay1, and ay2, which are specifically stored in four registers. The four coefficients in the iteration parameter matrix A(x, y) represent the change of the sub-block under the affine transformation. The coefficient depends on the position and size of the sub-block and the width of the video frame. Exemplarily, the calculation formula of each parameter is: Wherein W represents the width of the video frame, and the value of W depends on the specific width of the video frame. In this embodiment, W is set to 8.

[0077] The calculation of the change of the motion vector is to subtract the current motion vector from the previous iteration motion vector and calculate the change of each component. According to the affine transformation matrix and the change of the motion vector, the new position of the sub-block under the affine transformation can be further calculated. For example, the change calculation formula is Where mv represents the current input motion vector, and prev_mv represents the motion vector calculated in the previous iteration.

[0078] In addition to the above, during the affine iteration process, the change Δd of the relative gradient information is also calculated. Here, the change of the motion vector and the change of the relative gradient need to be temporarily stored in corresponding registers so as to be iteratively compared with the value calculated next time.

[0079] During the affine iteration process, prev_mv1h, prev_mv2h, prev_mv1v, and prev_mv2v are stored in four registers with a bit width of 4. At the same time, the motion vector changes dmv1_h, dmv2_h, dmv1_v, and dmv2_v are also stored in registers with a bit width of 4. During the affine iteration process, the relative gradient value is updated until the iteration stops when the relative gradient value is 0. At this time, it is judged that the current pixel is closest to the reference pixel.

[0080] In addition, the unit also includes a counter with a bit width of 5, which is used to record the number of processed blocks and to determine whether all sub-blocks have been processed. After the iteration is completed, the final affine iterative motion vector is obtained. If the relative gradient is 0 at this time, the calculation is completed, otherwise the iteration continues.

[0081] In the iterative method and device for enhancing affine motion estimation in video coding disclosed in the above embodiment, the register module first receives the processed video stream data through the IO interface, and caches the block pixels corresponding to the reference frame and the block pixels corresponding to the current frame. Then the control unit controls the reading of the current frame and the reference frame data through the state machine. When the data loading in the control module meets the conditions, the data cached in the register will be loaded into the calculation unit to calculate the absolute difference SAD. In addition, the main purpose of the calculation unit is to calculate the minimum SAD and the corresponding motion vector, and then the calculation result of each SAD is transmitted to the comparison module in the calculation unit. In the calculation unit, 16 SAD operation units are externally connected to the comparison tree (comparison module), and the 16 SAD values ​​calculated in each cycle are compared to obtain the minimum value. After the comparison is completed, it is compared with the previous minimum value to obtain the minimum value and the corresponding motion vector so far. After completing the calculation of all candidate blocks, the minimum SAD and motion vector are output. At this time, the reference block and current block data corresponding to the minimum SAD are marked, their address information is recorded, and their pixel information is converted into a 3×3 matrix to calculate the relative gradient. Finally, the obtained motion vector information, relative gradient, and address information of the reference block and the current block are input into the affine iteration array, and an affine iteration process is performed to obtain the final affine iterative motion vector.

[0082] For the iterative method and device for enhancing affine motion estimation in video encoding disclosed in this application, the VTM23.0 test model newly released in 2024 is used as the anchor model. In order to match the search algorithm in the hardware architecture, the full search algorithm is used as the anchor algorithm for motion estimation. At the same time, the video sequence requirements configured by the JVET common test conditions (CTC) are used to test the method of this application. The software compilation environment is visual stdio 2022, the hardware compilation environment is vivado2017.4, the hardware platform is Intel (R) Core (TM) i5-7300HQ CPU @ 2.50GHz, 16.0GB RAM, and Microsoft Windows 10 64-bit operating system is used. The configuration file in the experiment selects the lowdelay_p configuration as shown in Table 1 and the randomaccess configuration as shown in Table 2.

[0083] Table 1 shows the experimental results of the latest versions of the test software VTM and ECM under the low-latency P frame configuration, where ΔPSNR (ΔY, ΔU and ΔY) simply records its change, that is, ΔY = ORG-PROP, and bitrate is the relative change of the bit rate, and the calculation formula is Δbitrate = (ORG-PROP) / ORG × 100%. The selected video sequences are all high-frame rate video sequences. It can be seen that the image quality has been improved and the bit rate has also decreased, but FourPeople did not show the expected results. This is because 90% of its video content is static background, without a lot of affine motion, so the effect is poor. At the same time, it can be seen in Table 2 that under the randomaccess configuration, the performance shown is still effective.

[0084] Table 3 shows the resource configuration required for the proposed hardware architecture for 64×64 coding blocks. The motion vector preparation stage, that is, the SAD calculation stage, is the most time-consuming, accounting for about 84% of the total LUTs, and the register usage is also the largest, accounting for about 80% of the total.

[0085] Table 1 Low-latency P frames

[0086]

[0087] Table 2 Random storage configuration

[0088]

[0089] Table 3 Resource usage corresponding to 64X64 encoding size

[0090] Lookup Table trigger Logical Unit Affine Iteration Unit 29 24 65 Current pixel array buffer 21 2053 2076 Reference pixel array buffer 21 2053 2076 Control unit 21 17 41 SAD calculation module 15120 16643 48618 all 17980 20790 52876

[0091] Through the above embodiments, it can be found that the iterative method of the present application not only improves the accuracy of motion vector estimation, but also significantly reduces the computational complexity, as well as improves throughput and reduces resource consumption. In addition, the iterative system of the present application implements the iterative method in hardware by effectively utilizing parallel processing and pipeline technology, thereby achieving efficient data processing. The comparative experimental results show that the hardware proposed in the present application meets the requirements of real-time 4k 60fps video encoding by adopting the characteristics of hardware parallelism while maintaining coding efficiency.

[0092] In summary, existing traditional affine motion estimation methods focus on improving prediction accuracy, but they usually ignore the optimization of real-time processing capabilities and hardware resources; in the face of resource-constrained and power-sensitive application scenarios, especially in high-resolution video coding scenarios, such as mobile video communications and real-time video analysis, efficient hardware implementation becomes crucial. In order to solve this problem, the present application proposes an iterative method and device for enhancing affine motion estimation in video coding, which simplifies the calculation process and improves the performance of affine prediction. The iterative method of the present application reduces the number of iterations by decomposing complex prediction models into simpler sub-problems, and utilizes a local optimization strategy to increase the convergence speed; in addition, the iterative system of the present application optimizes the proposed iterative method and demonstrates the possibility of reducing hardware resource consumption and power consumption while maintaining coding efficiency.

[0093] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method.

[0094] The computer readable storage medium may be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0095] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.

[0096] It should be clear that the present invention is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.

[0097] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.

[0098] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An iterative method for enhancing affine motion estimation in video coding, characterized in that The method comprises: Obtaining video stream data corresponding to the multi-purpose video, and buffering block pixel data corresponding to the reference frame and block pixel data corresponding to the current frame; Loading the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, calculating the absolute difference SAD of each coding block based on the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, and determining the minimum absolute difference SAD, determining an initial motion vector based on the minimum absolute difference SAD, and calculating a relative gradient based on the pixel data of the coding block corresponding to the minimum absolute difference SAD, and decomposing the initial motion vector into initial motion vector components; Affine iteration is performed based on the initial motion vector component, the relative gradient and the position information of the coding block to obtain an optimal motion vector.

2. The iterative method for enhancing affine motion estimation in video coding according to claim 1, characterized in that Performing affine iteration based on the initial motion vector component, the relative gradient and the position information of the coding block to obtain the optimal motion vector includes: Determine a parameter matrix based on the position information of the coding block, and calculate a current motion vector component based on the initial motion vector component, the parameter matrix and the current relative gradient; The optimal motion vector is determined based on a current motion vector component corresponding to when the current relative gradient is zero.

3. The iterative method for enhancing affine motion estimation in video coding according to claim 2, characterized in that: The calculation formula of the current motion vector is: Among them, (x, y) represents the position coordinates of the control point of the coding block corresponding to the minimum absolute difference SAD, represents the motion vector at the i-th iteration, A(x,y) represents the parameter matrix, represents the motion vector at the i-1th iteration, Δd i represents the relative gradient, and W represents the width of the coding block.

4. The iterative method for enhancing affine motion estimation in video coding according to claim 1, characterized in that: Calculating a relative gradient based on pixel data of a coding block corresponding to the minimum absolute difference SAD includes: Obtain pixel data of the coding block corresponding to the minimum absolute difference SAD and pixel data of the surrounding coding blocks; Construct a 3X3 pixel matrix based on the pixel data of the coding block corresponding to the minimum absolute difference SAD and the pixel data of the surrounding coding blocks; Calculating the gradient component in the horizontal direction and the gradient component in the vertical direction respectively based on the pixel matrix; A relative gradient is determined based on the gradient component in the horizontal direction and the gradient component in the vertical direction.

5. An iterative system for enhancing affine motion estimation in video coding, characterized in that The system includes a storage unit, a control unit, a calculation unit and an affine iteration unit; The storage unit receives video stream data corresponding to the multi-purpose video, and caches block pixel data corresponding to the reference frame and block pixel data corresponding to the current frame; The control unit loads the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, and sends the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame to the calculation unit; The calculation unit calculates the absolute difference SAD of each coding block based on the block pixel data corresponding to the reference frame and the block pixel data corresponding to the current frame, and determines the minimum absolute difference SAD, determines the initial motion vector based on the minimum absolute difference SAD, and calculates the relative gradient based on the pixel data of the coding block corresponding to the minimum absolute difference SAD, and decomposes the initial motion vector into initial motion vector components; The affine iteration unit performs affine iteration based on the initial motion vector component, the relative gradient and the position information of the coding block to obtain an optimal motion vector.

6. The iterative system for enhancing affine motion estimation in video coding according to claim 5, characterized in that The calculation unit includes a plurality of SAD calculation modules, and the plurality of SAD calculation modules calculate in parallel the absolute difference SAD between each row of block pixel data corresponding to the current frame and the block pixel data corresponding to the reference frame.

7. The iterative system for enhancing affine motion estimation in video coding according to claim 6, characterized in that The calculation unit comprises a comparison module, which is connected to the output ends of the plurality of SAD calculation modules. The comparison module is used to compare the plurality of absolute differences SAD output by the plurality of SAD calculation modules and determine the minimum absolute difference SAD.

8. The iterative system for enhancing affine motion estimation in video coding according to claim 5, characterized in that The storage unit includes a reference pixel array buffer and a current pixel array buffer. The reference pixel array buffer is used to buffer block pixel data corresponding to a reference frame, and the current pixel array buffer is used to buffer block pixel data corresponding to the current frame.

9. The iterative device for enhancing affine motion estimation in video coding according to claim 5, characterized in that: The control unit comprises a finite state machine FSM.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.