Video signal coding method, and processing apparatus and readable storage medium

By multiplexing the deviation set of the reference frame in video signal encoding to determine the optimal motion vector with multi-pixel accuracy, the problem of large processing overhead and high cost in AMVR technology is solved, and more efficient video signal encoding is achieved.

WO2024222441A1PCT designated stage expired Publication Date: 2024-10-31SHANGHAI CAMBRICON INFORMATION TECH CO LTD

Patent Information

Application Number
PCT/CN2024/086653
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-24
Filing Date
2024-04-08
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

Existing video interframe coding using adaptive motion vector precision (AMVR) technology has large processing overhead and high implementation cost.

Method used

By determining the optimal motion vector in one pixel-accurate reference frame and multiplexing the intermediate results to determine the starting motion vector for the next pixel-accuracy, processing overhead and implementation complexity are reduced.

Benefits of technology

The processing overhead and implementation cost are significantly reduced, and the efficiency of video signal encoding is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024086653_31102024_PF_FP_ABST
    Figure CN2024086653_31102024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a video signal coding method, and a processing apparatus and a readable storage medium. The processing device comprises: a processor and a memory, wherein the memory stores a computer execution instruction, and the processor executes the computer execution instruction which is stored in the memory, to enable the processing device to execute a video signal coding method. By means of the embodiments of the present application, processing overheads can be reduced, the implementation complexity can be reduced, and the implementation cost of a processing apparatus can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Video signal encoding method, processing device and readable storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application No. 202310453707.7, filed on April 24, 2023, the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of video coding, and in particular to a video signal coding method, a processing device, and a readable storage medium. Background Art

[0004] Inter-frame coding in video coding uses the temporal correlation of video to remove temporal information redundancy. Specifically, it searches for the best matching block of the block to be encoded in the current image frame in the reference frame, obtains the motion vector (MV) and the residual value of the brightness (or chroma) between the co-located pixels of the block to be encoded and the best matching block, and encodes the residual value of the MV and the residual value of the brightness (or chroma), which can improve the video compression efficiency.

[0005] Motion in videos is usually continuous, and integer pixel accuracy sometimes cannot well represent the motion of objects. Therefore, Adaptive Motion Vector Resolution (AMVR) technology has been proposed. Video encoding devices perform motion estimation on reference frames with integer pixel accuracy, half pixel accuracy, 1 / 4 pixel accuracy, and four times pixel accuracy, determine the optimal matching block corresponding to the optimal accuracy, and implement AMVR inter-frame coding.

[0006] However, the current inter-frame coding using AMVR technology still has problems such as large processing overhead and high implementation cost.

[0007] Summary of the Invention

[0008] The present application provides a video signal encoding method, processing device and readable storage medium to solve the problems of large processing overhead and high implementation cost in the current inter-frame encoding using AMVR technology.

[0009] In a first aspect, a method for encoding a video signal is provided, comprising:

[0010] Determining, based on a deviation set corresponding to each reference unit in a plurality of reference units included in a reference frame of first pixel precision, a first rate-distortion cost and a second rate-distortion cost corresponding to the corresponding reference unit, wherein the deviation set is a set of scaled deviations of co-located pixels between the corresponding reference unit and the unit to be encoded, the first rate-distortion cost is a rate-distortion cost corresponding to the first pixel precision, and the second rate-distortion cost is a rate-distortion cost corresponding to the second pixel precision;

[0011] Determining an optimal motion vector corresponding to the first pixel precision and a starting motion vector corresponding to the second pixel precision, where the optimal motion vector corresponding to the first pixel precision is a motion vector between a reference unit with the smallest first rate-distortion cost among the multiple reference units and the unit to be coded, and the starting motion vector corresponding to the second pixel precision is a motion vector between a reference unit with the smallest second rate-distortion cost among the multiple reference units and the unit to be coded, and the starting motion vector corresponding to the second pixel precision is used to determine the optimal motion vector corresponding to the second pixel precision;

[0012] Inter-frame encoding is performed on the unit to be encoded according to a first optimal motion vector, and an encoding sequence is output, wherein the first optimal motion vector is a motion vector with the smallest rate-distortion cost among optimal motion vectors corresponding to multiple pixel precisions, and the multiple pixel precisions include the first pixel precision and the second pixel precision.

[0013] In a second aspect, a processing device is provided, comprising:

[0014] A first ME module is configured to determine, based on a deviation set corresponding to each reference unit in a plurality of reference units included in a reference frame of first pixel precision, a first rate-distortion cost and a second rate-distortion cost corresponding to the corresponding reference unit, where the deviation set is a set of scaled deviations of co-located pixels between the corresponding reference unit and the unit to be encoded, the first rate-distortion cost is a rate-distortion cost corresponding to the first pixel precision, and the second rate-distortion cost is a rate-distortion cost corresponding to the second pixel precision;

[0015] The first ME module is further configured to output an optimal motion vector corresponding to the first pixel precision and a starting motion vector corresponding to the second pixel precision, wherein the optimal motion vector corresponding to the first pixel precision is a motion vector between a reference unit having the smallest first rate-distortion cost among the multiple reference units and the unit to be encoded, and the starting motion vector corresponding to the second pixel precision is a motion vector between a reference unit having the smallest second rate-distortion cost among the multiple reference units and the unit to be encoded, and the starting motion vector corresponding to the second pixel precision is used to determine the optimal motion vector corresponding to the second pixel precision;

[0016] The encoding module is configured to perform inter-frame encoding on the unit to be encoded according to a first optimal motion vector and output a coding sequence, wherein the first optimal motion vector is a motion vector with the smallest rate-distortion cost among optimal motion vectors corresponding to multiple pixel precisions, and the multiple pixel precisions include the first pixel precision and the second pixel precision.

[0017] In a third aspect, a chip is provided, comprising: a logic circuit and an input / output interface, wherein the logic circuit is used to control the input / output interface and execute the method of the first aspect.

[0018] In a fourth aspect, a processing device is provided, comprising a processor and a memory, wherein the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the processing device performs the method of the first aspect.

[0019] In a fifth aspect, a computer program product is provided, which includes: a computer program (also referred to as code, or instructions), which, when executed, enables a computer to execute the method of the first aspect.

[0020] In a sixth aspect, a computer-readable medium is provided, which stores a computer program (also referred to as code or instruction) which, when executed on a computer, enables the computer to execute the method of the first aspect.

[0021] The present application provides a video signal encoding method, a processing device, and a readable storage medium. During the inter-frame encoding process of the video signal, when the processing device performs motion estimation in a reference frame with pixel precision, it determines the optimal motion vector corresponding to the pixel precision based on the set of deviations corresponding to the searched reference unit, and determines the starting motion vector corresponding to the next pixel precision. This allows for the reuse of a large number of intermediate results in the process, greatly reducing processing overhead, lowering implementation complexity, and reducing the implementation cost of the processing device. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0023] FIG1 is a schematic diagram of an application scenario applicable to the image processing method provided in this application;

[0024] FIG2 is a schematic diagram of AMVR motion estimation provided by the present application;

[0025] FIG3 is a schematic flow chart of a method for encoding a video signal provided by the present application;

[0026] FIG4 is another schematic flow chart of the video signal encoding method provided by the present application;

[0027] FIG5 is a schematic structural diagram of a processing device provided by the present application;

[0028] FIG6 is another schematic structural diagram of the processing device provided in this application.

[0029] The above drawings illustrate specific embodiments of the present application, which will be described in more detail below. These drawings and the textual description are not intended to limit the scope of the present application in any way, but rather to illustrate the concepts of the present application to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION

[0030] In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.

[0031] It should be clear that the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0032] When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0033] In the description of this application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to the specific circumstances. In addition, in the description of this application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.

[0034] The technical solutions involved in the embodiments of the present application are applied to video coding systems, such as video coding systems that apply standards such as H.264 / Advanced Video Coding (AVC), H.265 / High Efficiency Video Coding (HEVC), and H.266 / Versatile Video Coding (VVC), as well as other video coding systems and future evolved video coding systems.

[0035] Figure 1 is a schematic diagram of an application scenario of the encoding method for video signals provided in this application. The processing device 101 can process the video signal and implement encoding of the image frames of the video signal for transmission, storage, etc. For example, the processing device 101 can perform inter-frame prediction, motion estimation and motion compensation on the image frames of the video signal, and obtain an encoding sequence of the image frames through encoding. The processing device 101 can perform image acquisition to obtain a video signal, or the processing device 101 can obtain a video signal from other devices, which is not limited in this application. The processing device 101 can be a smart phone, a tablet computer, a computer, a camera device, etc., and this application does not limit the specific form of the processing device.

[0036] When implementing AMVR motion estimation, video encoding devices typically perform motion estimation for integer pixel precision, half pixel precision, quarter pixel precision, and quad pixel precision. As shown in Figure 2, when performing integer pixel precision motion estimation (IME) in (a), the video encoding device searches for a matching reference unit in the image to be encoded within the integer pixel precision reference frame. The encoding length (i.e., code length) of the MVD corresponding to the reference unit is determined using the integer pixel precision motion vector residual (MVD). The rate-distortion cost corresponding to the reference unit is then determined based on the code length corresponding to the integer pixel precision and the luminance (or chrominance) deviation (i.e., residual value) between the reference unit and the unit to be encoded. Based on the rate-distortion cost corresponding to each reference unit, the optimal MV corresponding to integer pixel precision is searched for. The MVD is the deviation between the MV corresponding to the reference unit and the predicted MV (PMV). The optimal MV corresponding to integer pixel precision is the MV between the searched matching reference unit and the unit to be encoded, also with integer pixel precision.

[0037] When the video encoding device performs half-pixel precision motion estimation (Half pixel precision ME, HME) in (b), it is necessary to first determine the code length of the MVD in the reference frame with full pixel precision using the half-pixel precision MVD of the searched reference unit, and then determine the rate-distortion cost corresponding to the reference unit. Based on the rate-distortion cost corresponding to each reference unit obtained by the search, the starting reference unit for searching in the reference frame with half pixel precision is determined, thereby searching for the optimal MV corresponding to half pixel precision in the reference frame with half pixel precision.

[0038] The video encoding device performs the 1 / 4 pixel precision motion estimation (Quarter pixel precision ME, QME) in (c) similarly, determining the code length of the MVD with the 1 / 4 pixel precision MVD of the searched reference unit, searching and determining the search starting reference unit with half pixel precision in the reference frame with integer pixel precision, and then determining the code length of the MVD with the 1 / 4 pixel precision MVD of the reference unit, searching and determining the search starting reference unit with 1 / 4 pixel precision in the reference frame with half pixel precision, and searching in the reference frame with 1 / 4 pixel precision to obtain the optimal MV corresponding to 1 / 4 pixel precision.

[0039] When the video encoding device performs the 4x pixel precision motion estimation (FME) in (d), the code length of the MVD is determined using the 4x pixel precision MVD of each reference unit in the reference frame with 4x pixel precision, and the rate-distortion cost corresponding to each reference unit is obtained, thereby determining the optimal MV corresponding to the 4x pixel precision.

[0040] Based on the above, to determine the optimal MV for integer, half, and quarter pixel precision, motion estimation is required at integer pixel precision. However, when obtaining the rate-distortion cost of the reference unit, the code length is determined using different pixel precisions of the MVD. Furthermore, to determine the optimal MV for half and quarter pixel precision, motion estimation is required at half pixel precision. However, when obtaining the rate-distortion cost of the reference unit, the code length is determined using the MVD at half and quarter pixel precision, respectively. This approach is easy to implement in software, but is more complex and costly to implement in hardware.

[0041] The present application provides a method for encoding a video signal. During the inter-frame encoding process of the video signal, when the processing device performs motion estimation in a reference frame with pixel precision, it determines the optimal motion vector corresponding to the pixel precision based on the set of deviation amounts corresponding to the searched reference unit, and determines the starting motion vector corresponding to the next pixel precision. Reusing a large number of intermediate results can greatly reduce processing overhead, reduce implementation complexity, and reduce the implementation cost of the processing device.

[0042] Figure 3 is a schematic flowchart of a video signal encoding method 300 provided in this application. This method can be performed by a processing device, which can be a processing device, or configured within a processing device, such as a chip or chip system configured within the processing device. However, this application is not limited thereto. The method includes but is not limited to steps S301 to S303.

[0043] When the processing device needs to perform inter-frame coding on a current frame in a video signal, the processing device determines a reference frame. For example, the reference frame may be a reconstructed frame of an adjacent frame of the current frame.

[0044] For a unit to be encoded in the current frame, the processing device applies the AMVR technology, performing motion estimation in reference frames of multiple pixel precisions, searching for a matching reference unit corresponding to the unit to be encoded at each pixel precision based on a matching criterion and a search algorithm, thereby determining the optimal matching reference unit for the unit to be encoded from the matching reference units corresponding to the unit to be encoded at multiple pixel precisions. The multiple pixel precisions include at least a first pixel precision and a second pixel precision.

[0045] The following is a detailed introduction to the coding method for determining the optimal matching reference unit and performing inter-frame coding on the coding unit provided in an embodiment of the present application.

[0046] S301. Determine a first rate-distortion cost and a second rate-distortion cost corresponding to a corresponding reference unit based on a set of deviations corresponding to each reference unit in a reference frame of first pixel precision. The set of deviations is a set of scaled deviations of co-located pixels between the corresponding reference unit and the unit to be encoded. The first rate-distortion cost is the rate-distortion cost corresponding to the first pixel precision, and the second rate-distortion cost is the rate-distortion cost corresponding to the second pixel precision.

[0047] The scale can be brightness or chromaticity.

[0048] To determine a matching reference unit for a unit to be encoded in a reference frame at each of multiple pixel precisions, the processing device may first determine, for each reference unit found in the reference frame at a first pixel precision, a set of offsets of co-located pixels between the reference unit and the unit to be encoded, i.e., an offset set. A reference unit and the unit to be encoded contain the same number of pixels and are the same size, and two pixels located at the same position in the reference unit and the unit to be encoded are called co-located pixels.

[0049] After determining the deviation set corresponding to a reference unit, the processing device may determine the first rate-distortion cost and the second rate-distortion cost corresponding to the reference unit according to the deviation set corresponding to the reference unit.

[0050] The following description uses as an example an example where a processing device determines a first rate-distortion cost and a second rate-distortion cost corresponding to a first reference unit based on a set of deviations corresponding to the first reference unit. The first reference unit may be any reference unit searched for by the processing device in a reference frame corresponding to the first pixel precision. In other words, the first rate-distortion cost and the second rate-distortion cost corresponding to any reference unit searched for by the processing device in a reference frame corresponding to the first pixel precision can be determined using the method for determining the rate-distortion cost and the second rate-distortion cost corresponding to the first reference unit described below.

[0051] The processing device determines a first rate-distortion cost corresponding to the first reference unit based on a set of deviations corresponding to the first reference unit, including: the processing device determines a first code length based on a motion vector difference (MVD) between a first motion vector and a predicted motion vector (PMV), the first code length being a coding length of the MVD at a first pixel precision. The first motion vector is a motion vector between the first reference unit and the unit to be coded. The processing device then determines a first rate-distortion cost for the reference unit based on the set of deviations corresponding to the first reference unit and the first code length.

[0052] Exemplarily, the first rate-distortion cost C of the first reference unit determined by the processing device is RD1 Satisfies the following formula: C RD1 =d+λR1

[0053] Where d is the degree of matching between the scales of the first reference unit and the unit to be encoded, determined using a matching criterion based on the set of deviations. λ is a predefined Lagrangian constant. R1 is the first code length.

[0054] The matching criterion used by the processing device may be Mean Absolute Differences (MAD), Sum of Squared Difference (SSD), Mean Squared Error (MSE), Sum of Absolute Difference (SAD), or Sum of Absolute Transformed Difference (SATD). This application does not limit this.

[0055] Furthermore, the processing device determines a second rate-distortion cost corresponding to the first reference unit based on the deviation set corresponding to the first reference unit, including: the processing device determines a second code length based on the MVD corresponding to the first reference unit, the second code length being an encoding length of the MVD at the second pixel precision; and the processing device further determines the second rate-distortion cost corresponding to the first reference unit based on the deviation set corresponding to the first reference unit and the second code length.

[0056] Exemplarily, the second rate-distortion cost C of the first reference unit determined by the processing device is RD2 Satisfies the following formula: C RD2 =d+λR2

[0057] Wherein, d and λ are the same as d and λ used by the processing device to determine the first rate-distortion cost. R2 is the second code length. Exemplarily, R1 and R2 may be the first-order Golomb code lengths of the MVD of the first pixel precision and the MVD of the second pixel precision corresponding to the first reference unit, respectively.

[0058] According to the above solution, when the processing device performs motion estimation in a reference frame with first pixel precision, it determines a set of deviations for the searched reference unit. Based on this set of deviations, it determines both the rate-distortion cost of the first pixel precision corresponding to the reference unit (i.e., the first rate-distortion cost) and the rate-distortion cost of the second pixel precision corresponding to the reference unit (i.e., the second rate-distortion cost). The first rate-distortion cost is used to determine the matching reference unit of the first pixel precision corresponding to the unit to be encoded, and the second rate-distortion cost is used to determine the starting reference unit for the processing device to search for a matching reference unit in the reference frame with second pixel precision. This allows for the reuse of reference unit deviation sets, reducing processing overhead, implementation complexity, and implementation costs.

[0059] For example, the first pixel precision and the second pixel precision may be two different pixel precisions, namely, integer pixel precision, half pixel precision, 1 / 4 pixel precision, and 4 times pixel precision.

[0060] In one embodiment, a processing device obtains a starting motion vector corresponding to a first pixel precision. Based on the starting motion vector corresponding to the first pixel precision, the processing device searches for a matching reference unit of a unit to be encoded corresponding to the first pixel precision in a reference frame of the first pixel precision, and determines an optimal motion vector corresponding to the first pixel precision and a starting motion vector corresponding to the second pixel precision.

[0061] In one example, if the first pixel precision is integer pixel precision, the processing device may begin searching for a matching reference unit by using a preset reference unit in a reference frame with integer pixel precision as a starting reference unit. For example, the preset reference unit may be a co-located reference unit of the unit to be encoded in the reference frame. Alternatively, the processing device may obtain a PMV and use a reference unit whose motion vector with the unit to be encoded is the PMV as the starting reference unit to begin searching for a matching reference unit.

[0062] In another example, if the first pixel precision is not integer pixel precision, the processing device may search for a matching reference unit in a reference frame of fourth pixel precision, determine the optimal motion vector of the fourth pixel precision, and also determine a starting motion vector corresponding to the first pixel precision. The processing device determines, based on the starting motion vector corresponding to the first pixel precision, a starting reference unit for searching for a matching reference unit in the reference frame of the first pixel precision, and starts searching from the starting reference unit. Specifically, the processing device may determine a set of deviation amounts for each reference unit searched, and determine a corresponding first rate-distortion cost and a second rate-distortion cost.

[0063] Exemplarily, the fourth pixel precision may be integer pixel precision, the first pixel precision may be half pixel precision, and the second pixel precision may be quarter pixel precision.

[0064] S302, determining an optimal motion vector corresponding to the first pixel precision and a starting motion vector corresponding to the second pixel precision, where the optimal motion vector corresponding to the first pixel precision is a motion vector between a reference unit with the smallest first rate-distortion cost among multiple reference units and the unit to be encoded, and the starting motion vector corresponding to the second pixel precision is a motion vector between a reference unit with the smallest second rate-distortion cost among multiple reference units and the unit to be encoded. The starting motion vector corresponding to the second pixel precision is used to determine the optimal motion vector corresponding to the second pixel precision.

[0065] After the processing device determines the first rate-distortion cost and the second rate-distortion cost of each reference unit searched in the reference frame of the first pixel precision in S301, the processing device determines a reference unit with the smallest corresponding first rate-distortion cost among the searched reference units, that is, a matching reference unit of the unit to be encoded in the reference frame of the first pixel precision, which can be called the matching reference unit of the unit to be encoded corresponding to the first pixel precision, and the motion vector between the matching reference unit and the unit to be encoded is the optimal motion vector corresponding to the first pixel precision.

[0066] The processing device further determines a reference unit having the minimum second rate-distortion cost among the searched reference units. This reference unit is the starting reference unit for the processing device to search for a matching reference unit in the reference frame of the second pixel precision. The motion vector between this reference unit and the unit to be encoded is the starting motion vector corresponding to the second pixel precision.

[0067] In one embodiment, the processing device further searches for a matching reference unit of the unit to be encoded corresponding to the second pixel precision in a reference frame of the second pixel precision based on the starting motion vector corresponding to the second pixel precision, and determines the optimal motion vector corresponding to the second pixel precision.

[0068] In these embodiments, the processing device may determine a starting reference unit for searching for a matching reference unit in the reference frame of the second pixel precision based on the starting motion vector corresponding to the second pixel precision, and then the processing device may start the search from the starting reference unit. The processing device may then determine a set of deviations for each reference unit searched. Similar to the first pixel precision, after obtaining a set of deviations for a reference unit, the processing device may determine a rate-distortion cost corresponding to the reference unit. The rate-distortion cost here may, for example, include a third rate-distortion cost and a fourth rate-distortion cost. The third rate-distortion cost is the rate-distortion cost corresponding to the second pixel precision. The fourth rate-distortion cost may be the rate-distortion cost corresponding to the third pixel precision. The third pixel precision here may be a pixel precision other than the first pixel precision and the second pixel precision.

[0069] Then, among the multiple reference units corresponding to the second pixel precision, the processing device may compare the reference unit with the smallest second rate-distortion cost with the motion vector between the units to be encoded as the optimal motion vector corresponding to the second pixel precision.

[0070] In some embodiments, the method further includes: determining a starting motion vector corresponding to a third pixel precision, where the plurality of pixel precisions include the third pixel precision.

[0071] For example, the third pixel precision is other pixel precision among the plurality of pixel precisions except the first pixel precision and the second pixel precision.

[0072] The processing device further determines a reference unit having the lowest fourth rate-distortion cost among the searched reference units. This reference unit is the starting reference unit for the processing device to search for a matching reference unit in the reference frame of the third pixel precision. The motion vector between this reference unit and the unit to be encoded is the starting motion vector corresponding to the third pixel precision.

[0073] S303: Inter-frame encoding is performed on the unit to be encoded based on the first optimal motion vector, and an encoded sequence is output. The first optimal motion vector is a motion vector with the lowest rate-distortion cost among optimal motion vectors corresponding to a plurality of pixel precisions, where the plurality of pixel precisions include a first pixel precision and a second pixel precision.

[0074] The processing device determines, from among the optimal motion vectors corresponding to multiple pixel accuracies, the motion vector with the lowest rate-distortion cost, as the first optimal motion vector. That is, the processing device searches for matching reference units corresponding to each pixel precision in the reference frame at the multiple pixel accuracies and determines the reference unit with the lowest rate-distortion cost. The motion vector between the reference unit and the unit to be encoded is the first optimal motion vector. The processing device performs inter-frame encoding on the unit to be encoded based on the first optimal motion vector and outputs an encoded sequence for the unit to be encoded. Specifically, the processing device may perform inter-frame encoding on the unit to be encoded based on the deviation set corresponding to the first optimal motion vector and the first optimal motion vector, and outputs an encoded sequence. The deviation set corresponding to the first optimal motion vector is a set of scaled deviations between the reference unit corresponding to the first optimal motion vector and the unit to be encoded.

[0075] In one embodiment, a processing device performs inter-frame coding on a unit to be coded based on a first optimal motion vector. Before outputting a coded sequence, the processing device determines a second optimal motion vector, where the second optimal motion vector is a motion vector having the lowest rate-distortion cost among the optimal motion vectors corresponding to multiple pixel precisions. If the rate-distortion cost corresponding to the second optimal motion vector is greater than or equal to a threshold, the processing device uses a second reference unit in a reference frame of target pixel precision as a search starting point and searches a preset number of reference units using a target step size to obtain rate-distortion costs corresponding to the preset number of reference units. The second reference unit is the reference unit corresponding to the second optimal motion vector, and the target pixel precision is the pixel precision corresponding to the second reference unit.

[0076] A probability model is preset for the rate-distortion cost of each pixel precision among multiple pixel precisions. Based on the probability model, a minimum threshold value of the rate-distortion cost corresponding to the matching reference unit corresponding to each pixel precision can be determined. If the processing device determines that the rate-distortion cost corresponding to the second optimal motion vector (i.e., the rate-distortion cost corresponding to the second reference unit) among the optimal motion vectors corresponding to the multiple pixel precisions obtained through the search is greater than or equal to the minimum threshold value, then the second optimal motion vector is considered to have an error. The processing module can use the second reference unit as the starting reference unit for the search in the reference frame with the target pixel precision in which the second reference unit is found, and continue searching a preset number of reference units near the second reference unit at a target step size to obtain the rate-distortion costs corresponding to the target number of reference units.

[0077] If the minimum rate-distortion cost among the rate-distortion costs corresponding to the preset number of reference units is less than the rate-distortion cost corresponding to the second reference unit, the processing device determines to update the optimal motion vector corresponding to the target pixel precision to a first optimal motion vector. The first optimal motion vector is the motion vector between the reference unit corresponding to the minimum rate-distortion cost among the rate-distortion costs corresponding to the preset number of reference units and the unit to be encoded. After the optimal motion vector corresponding to the target pixel precision is updated to the first optimal motion vector, the motion vector with the minimum rate-distortion cost among the optimal motion vectors corresponding to the plurality of pixel precisions is changed to the first optimal motion vector. The processing device then performs inter-frame encoding on the unit to be encoded based on the first optimal motion vector to obtain an encoded sequence of the unit to be encoded.

[0078] If the minimum rate-distortion cost among the rate-distortion costs corresponding to the preset number of reference units is greater than or equal to the rate-distortion cost corresponding to the second reference unit, the first optimal motion vector is determined to be the second optimal motion vector. In other words, if the rate-distortion costs corresponding to the preset number of reference units are all greater than or equal to the rate-distortion cost corresponding to the second reference unit, the processing device may determine that the matching reference unit corresponding to the target pixel accuracy determined by it (i.e., the second reference unit) has no error, and the processing device then performs inter-frame coding on the unit to be coded based on the second optimal motion vector corresponding to the second reference unit (in this case, the first optimal motion vector is the second optimal motion vector) to obtain a coded sequence.

[0079] According to the above solution, the processing device can verify the optimal motion vector corresponding to the unit to be encoded, determined by the processing device, to verify whether the determined optimal motion vector is actually the optimal motion vector. If the verification determines that it is not the optimal motion vector, the processing device updates the optimal motion vector corresponding to the unit to be encoded. This can further improve the coding efficiency of inter-frame coding.

[0080] The solution provided by the present application is that, during the inter-frame encoding process of a video signal, when the processing device performs motion estimation in a reference frame with pixel precision, it determines the optimal motion vector corresponding to the pixel precision based on the deviation set corresponding to the searched reference unit, and determines the starting motion vector corresponding to the next pixel precision to be searched, wherein the deviation set corresponding to each reference unit is reused. Compared with the method of obtaining the starting motion vector from low pixel precision to high pixel precision for each pixel precision in sequence to determine the optimal motion vector corresponding to the pixel precision, the processing overhead can be greatly reduced, the implementation complexity can be reduced, and the implementation cost of the processing device can be reduced.

[0081] In a specific example, the processing device applies AMVR to perform motion estimation in integer pixel precision, 4x pixel precision, half pixel precision, and 1 / 4 pixel precision to obtain the optimal motion vector of the unit to be encoded, thereby performing inter-frame coding. As shown in Figure 4, the processing device may include an IME module, an HME module, a QME module, an FME module, and a processing module. The processing module may also be called a refinement (REFINE) module, but the present application is not limited thereto. In addition, the processing device may also include other modules not shown in Figure 4. After the processing device obtains the video signal and determines the reference frame, the IME module performs integer pixel motion estimation for the unit to be encoded in the current frame. The IME module searches for matching reference units with integer pixel precision in the reference frame with integer pixel precision, determines the deviation set corresponding to each reference unit searched, and determines the rate-distortion cost corresponding to the integer pixel precision, the rate-distortion cost corresponding to the half pixel precision, and the rate-distortion cost corresponding to the 4x pixel precision of the reference unit based on the deviation set corresponding to the reference unit. The rate-distortion cost C corresponding to pixel precision i RD-i satisfy:

[0082] C RD-i =d+λR i

[0083] When the IME module determines the rate-distortion cost corresponding to the three pixel accuracies of the reference unit, the scale (such as brightness or chrominance) matching degree d and the Lagrangian constant λ are the same, where the scale matching degree d is determined based on the set of scale (brightness or chrominance) deviations between the reference unit and the unit to be encoded using a matching criterion, and the Lagrangian constant λ is predefined. i Different, both are based on the MVD corresponding to the unit to be encoded converted to the corresponding pixel precision to obtain the code length corresponding to the corresponding pixel precision. If the code length can be a first-order Golomb code length, for integer pixel precision, the IME module determines the first-order Golomb code length R corresponding to the integer pixel precision based on the MVD of the integer pixel precision. INT If the default precision of the processing device is 1 / 4 pixel precision, the MVD calculated by the IME module based on the motion vector and PMV corresponding to the reference unit is an MVD with 1 / 4 pixel precision. The IME module can convert the MVD with 1 / 4 pixel precision to integer pixel precision, such as shifting the MVD with 1 / 4 pixel precision right by 2 bits to align it to integer pixel precision, to obtain the MVD with integer pixel precision, thereby determining the first-order Golomb code length R corresponding to the MVD with integer pixel precision. INT The IME module then determines the rate-distortion cost C corresponding to the integer pixel accuracy. RD-INT .

[0084] For half-pixel precision, the IME module determines the first-order Golomb code length R corresponding to half-pixel precision using the MVD of half-pixel precision.HALF For example, the IME module can right-shift the calculated 1 / 4 pixel precision MVD by 1 bit to align it to half pixel precision, and obtain the half pixel precision MVD, thereby determining the first-order Golomb code length R of the half pixel precision MVD. HALF The IME module then determines the rate-distortion cost C corresponding to half-pixel accuracy. RD-HALF .

[0085] For 4 times pixel precision, the IME module determines the first-order Golomb code length R corresponding to 4 times pixel precision using the MVD of 4 times pixel precision. 4PEL For example, the IME module can right-shift the calculated MVD of 1 / 4 pixel precision by 4 bits to align it to 4 times pixel precision, thereby obtaining the MVD of 4 times pixel precision, thereby determining the first-order Golomb code length R of the MVD of 4 times pixel precision. 4PEL The IME module then determines the rate-distortion cost C corresponding to 4 times the pixel accuracy. RD-4PEL .

[0086] The IME module calculates the rate-distortion cost corresponding to the three pixel accuracies corresponding to each reference unit, reusing the scale matching degree d of the reference unit. This eliminates the need to repeatedly obtain the deviation set corresponding to the reference unit with integer pixel precision for different pixel accuracies, reducing implementation complexity, processing overhead, and cost.

[0087] After the IME module determines the rate-distortion cost corresponding to integer pixel precision, the rate-distortion cost corresponding to half pixel precision, and the rate-distortion cost corresponding to 4x pixel precision for each reference unit searched, the IME module determines the minimum rate-distortion cost corresponding to integer pixel precision. The reference unit corresponding to the minimum rate-distortion cost is the matching reference unit of the unit to be encoded in the reference frame with integer pixel precision. The IME module outputs the motion vector between the matching reference unit and the unit to be encoded, i.e., the optimal motion vector corresponding to integer pixel precision, to the processing module.

[0088] The IME module also determines a search starting reference unit with 4 times the pixel precision. The IME module determines a corresponding minimum rate-distortion cost with 4 times the pixel precision. The reference unit corresponding to the minimum rate-distortion cost is the search starting reference unit with 4 times the pixel precision. The motion vector between the reference unit and the unit to be encoded is the starting motion vector corresponding to 4 times the pixel precision. The IME module can output the starting motion vector corresponding to 4 times the pixel precision to the FME module, so that the FME module searches for a matching reference unit corresponding to 4 times the pixel precision based on the starting motion vector.

[0089] The IME module also determines a half-pixel precision search starting reference unit and, based on the minimum rate-distortion cost corresponding to the half-pixel precision, determines a starting motion vector corresponding to the half-pixel precision. The IME module may output the starting motion vector corresponding to the half-pixel precision to the HME module, so that the HME module searches for a matching reference unit corresponding to the half-pixel precision based on the starting motion vector.

[0090] After the HME module in the processing device obtains the starting motion vector corresponding to the half-pixel precision from the IME module, it determines the starting reference unit for searching for a matching reference unit with half-pixel precision, and searches for a matching reference unit of the unit to be encoded with half-pixel precision in the reference frame with half-pixel precision.

[0091] Similarly, the HME module searches for matching reference units with half-pixel precision within a half-pixel precision reference frame, determines a set of deviations corresponding to each reference unit found, and then determines the rate-distortion cost and quarter-pixel cost corresponding to each reference unit based on the deviation set. The HME module then determines the optimal motion vector corresponding to half-pixel precision based on the rate-distortion cost corresponding to the half-pixel precision of the found reference unit. It also determines the starting motion vector corresponding to quarter-pixel precision based on the rate-distortion cost corresponding to the quarter-pixel precision of the found reference unit. The HME module determines the first-order Golomb code length corresponding to half-pixel precision and quarter-pixel precision based on the half-pixel precision MVD and quarter-pixel precision MVD, respectively, while reusing the scale matching degree d for each reference unit, reducing implementation complexity, processing overhead, and cost.

[0092] The QME module in the processing device obtains a starting motion vector corresponding to 1 / 4 pixel accuracy from the HME module, performs a matching reference unit search at 1 / 4 pixel accuracy in a reference frame with 1 / 4 pixel accuracy, and determines a matching reference unit for the unit to be encoded corresponding to 1 / 4 pixel accuracy. Furthermore, the FME module obtains a starting motion vector corresponding to 4x pixel accuracy from the IME module, performs a matching reference unit search at 4x pixel accuracy in a reference frame with 4x pixel accuracy, and determines a matching reference unit for the unit to be encoded corresponding to 4x pixel accuracy.

[0093] The processing module in the processing device can obtain the optimal motion vectors corresponding to integer pixel accuracy, half pixel accuracy, 1 / 4 pixel accuracy and 4 times pixel accuracy respectively, and determine the motion vector with the minimum rate-distortion cost as the matching motion vector.

[0094] In one implementation, the processing device may perform inter-frame coding on the unit to be coded based on the matching motion vector and the offset set corresponding to the matching motion vector to obtain a coding sequence.

[0095] In another embodiment, the processing module determines the relationship between the rate-distortion cost corresponding to the matching motion vector and a threshold. If the rate-distortion cost corresponding to the matching motion vector is greater than or equal to the threshold, the processing module uses the matching reference unit corresponding to the matching motion vector as the starting search unit, and searches a preset number of reference units in the reference frame with the target pixel accuracy using a target step size to obtain rate-distortion costs corresponding to the preset number of reference units, wherein the target pixel accuracy is the pixel accuracy of the reference unit corresponding to the matching motion vector, and the target step size is the step size used when searching for the reference unit.

[0096] If the processing module determines a minimum threshold of the rate-distortion cost corresponding to the target pixel accuracy based on the probability model corresponding to the motion vector of the target pixel accuracy, and the rate-distortion cost corresponding to the matching motion vector is greater than or equal to the threshold, the processing module searches for the rate-distortion costs corresponding to a preset number of reference units.

[0097] If the minimum rate-distortion cost among the rate-distortion costs corresponding to the preset number of reference units is less than the rate-distortion cost corresponding to the matching motion vector, the processing module updates the matching motion vector. The updated matching motion vector is the motion vector between the reference unit corresponding to the minimum rate-distortion cost among the rate-distortion costs corresponding to the preset number of reference units and the unit to be encoded. The processing device performs inter-frame encoding on the unit to be encoded based on the updated matching motion vector and the set of offsets corresponding to the updated matching motion vector to obtain a coding sequence.

[0098] If the rate-distortion costs corresponding to a preset number of reference units are not less than the rate-distortion costs corresponding to the matching motion vector, the processing module can determine that the matching motion vector is the optimal motion vector in each pixel precision, and there is no need to update the optimal motion vector. The processing device performs inter-frame encoding on the unit to be encoded based on the matching motion vector and the set of deviations corresponding to the matching motion vector to obtain a coding sequence.

[0099] According to the solution provided in the present application, during the inter-frame encoding process of a video signal, when the processing device performs motion estimation in a reference frame with pixel precision, it determines the scale matching degree based on the set of deviation amounts corresponding to the searched reference units. By reusing the scale matching degrees corresponding to the various reference units, it not only determines the optimal motion vector corresponding to the pixel precision, but also determines the starting motion vector for searching for the next pixel precision. Compared with independently obtaining the optimal motion vector for each pixel precision, it can greatly reduce the processing overhead, reduce the implementation complexity, and reduce the implementation cost of the processing device.

[0100] The above describes the video signal encoding method provided by the present application in conjunction with the accompanying drawings. The following describes the processing device provided by the present application. Figures 5 and 6 are schematic diagrams of the structures of possible processing devices provided in embodiments of the present application. These processing devices can be used to implement the functions of the processing devices in the above method embodiments, and thus can also achieve the beneficial effects of the above method embodiments. In the embodiments of the present application, the processing device can be the processing device shown in Figure 1, or it can be a device configured in the processing device.

[0101] FIG5 is a schematic diagram of the structure of a processing device 500 provided in this application. The processing device can be implemented as a processing device itself or configured in a processing device through software, hardware, or a combination of both. The processing device 500 includes a first ME module 501 and an encoding module 502. The processing device 500 may also include a bus 503 for implementing communication connections between modules and components. Optionally, the processing device 500 also includes a second ME module 504 and a processing module 505.

[0102] The first ME module 501 is configured to determine a first rate-distortion cost and a second rate-distortion cost corresponding to a corresponding reference unit based on a set of deviations corresponding to each reference unit in a reference frame of first pixel precision. The set of deviations is a set of scaled deviations of co-located pixels between the corresponding reference unit and the unit to be encoded, and the scale can be luminance or chrominance. The first rate-distortion cost is the rate-distortion cost corresponding to the first pixel precision, and the second rate-distortion cost is the rate-distortion cost corresponding to the second pixel precision.

[0103] The first ME module 501 is also configured to output the optimal motion vector corresponding to the first pixel precision and the starting motion vector corresponding to the second pixel precision. The optimal motion vector corresponding to the first pixel precision is the motion vector between the reference unit with the smallest first rate-distortion cost among the multiple reference units and the unit to be encoded. The starting motion vector corresponding to the second pixel precision is the motion vector between the reference unit with the smallest second rate-distortion cost among the multiple reference units and the unit to be encoded. The starting motion vector corresponding to the second pixel precision is used to determine the optimal motion vector corresponding to the second pixel precision.

[0104] The encoding module 502 is configured to perform inter-frame encoding on the unit to be encoded according to a first optimal motion vector and output a coding sequence, wherein the first optimal motion vector is a motion vector with the lowest rate-distortion cost among the optimal motion vectors corresponding to multiple pixel precisions, and the multiple pixel precisions include the first pixel precision and the second pixel precision.

[0105] Optionally, the first ME module 501 is further configured to determine a first code length based on a motion vector deviation between the first motion vector and the predicted motion vector, the first code length being the encoding length of the motion vector deviation corresponding to the first pixel precision, the first motion vector being the motion vector between the first reference unit and the unit to be encoded, the first rate-distortion cost corresponding to the first reference unit being determined based on the deviation set corresponding to the first reference unit and the first code length, wherein the first reference unit is any reference unit among the multiple reference units. Furthermore, the first ME module 501 is further configured to determine a second code length based on the motion vector deviation, the second code length being the encoding length of the motion vector deviation corresponding to the second pixel precision, the second rate-distortion cost corresponding to the first reference unit being determined based on the deviation set corresponding to the first reference unit and the second code length.

[0106] Optionally, the first ME module 501 is further configured to obtain a starting motion vector corresponding to the first pixel precision. Furthermore, the first ME module 501 is specifically configured to search for a matching reference unit of the unit to be encoded corresponding to the first pixel precision in the reference frame of the first pixel precision based on the starting motion vector corresponding to the first pixel precision, and determine the optimal motion vector corresponding to the first pixel precision and the starting motion vector corresponding to the second pixel precision.

[0107] Optionally, the second ME module 504 is configured to obtain a starting motion vector corresponding to the second pixel precision. Furthermore, the second ME module 504 is specifically configured to search, in the reference frame of the second pixel precision, for a matching reference unit of the unit to be encoded corresponding to the second pixel precision based on the starting motion vector corresponding to the second pixel precision, and determine an optimal motion vector corresponding to the second pixel precision.

[0108] Optionally, the second ME module 504 is further configured to determine a starting motion vector corresponding to a third pixel precision, and the multiple pixel precisions include the third pixel precision.

[0109] Optionally, the processing module 505 is configured to determine a second optimal motion vector, the second optimal motion vector being the motion vector with the minimum rate-distortion cost among the optimal motion vectors corresponding to the multiple pixel precisions. The processing module 505 is further configured to, if the rate-distortion cost corresponding to the second optimal motion vector is greater than or equal to a threshold, search a preset number of reference units using a target step size starting from a second reference unit in the reference frame of target pixel precision to obtain rate-distortion costs corresponding to the preset number of reference units, the second reference unit being the reference unit corresponding to the second optimal motion vector, and the target pixel precision being the pixel precision corresponding to the second reference unit. Furthermore, if the minimum rate-distortion cost among the rate-distortion costs corresponding to the preset number of reference units is less than the rate-distortion cost corresponding to the second reference unit, determine the updated optimal motion vector corresponding to the target pixel precision as the first optimal motion vector, the first optimal motion vector being the motion vector between the reference unit corresponding to the minimum rate-distortion cost and the unit to be encoded. Alternatively, the processing module 505 is further configured to, when the minimum rate-distortion cost is greater than or equal to the rate-distortion cost corresponding to the second reference unit, determine the first optimal motion vector as the second optimal motion vector.

[0110] As shown in Figure 6, the processing device 600 includes a processor 601 and an interface circuit 602. The processor 601 and the interface circuit 602 are coupled to each other. It will be understood that the interface circuit 602 can be a transceiver or an input / output interface. Optionally, the processing device 600 may also include a memory 603 for storing instructions executed by the processor 601 or storing input data required by the processor 601 to run instructions or storing data generated after the processor 601 runs instructions. In specific implementations, the memory 603 may also be integrated into the processor 601 or independent of the processor 601. In one embodiment, the interface circuit 602 includes an input interface and an output interface.

[0111] When the processing device 600 is used to implement the method shown in FIG3 , the processor 601 is used to implement the functions of the above-mentioned processing module, and the interface circuit 602 is used to implement the functions of the transceiver unit.

[0112] When the processing device is a chip used in a processing device, the chip can implement the functions of the processing device in the above method embodiments. The chip can obtain information / signals from other modules in the processing device; or the chip can output information / signals to other modules in the processing device.

[0113] It should be understood that the processing device provided in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present application may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0114] This embodiment further provides a readable storage medium, in which execution instructions are stored. When at least one processor of an electronic device executes the execution instruction, when the computer execution instruction is executed by the processor, the image processing method in the above embodiment is implemented.

[0115] This embodiment further provides a computer program product, including execution instructions stored in a readable storage medium. At least one processor of an electronic device can read the execution instructions from the readable storage medium, and the at least one processor can execute the execution instructions to cause the electronic device to implement the image processing methods provided in the various embodiments described above.

[0116] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is merely a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0117] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected to achieve the purpose of the present embodiment according to actual needs.

[0118] In addition, the functional modules in the various embodiments of the present application may be integrated into a single processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or in the form of hardware plus software functional modules.

[0119] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor (English: processor) to execute some steps of the method of each embodiment of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (English: Read-Only Memory, abbreviated: ROM), a random access memory (English: Random Access Memory, abbreviated: RAM), a magnetic disk or an optical disk, and other media that can store program code.

[0120] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of the present application and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered merely as exemplary, and the true scope and spirit of the present application are indicated by the claims.

[0121] The foregoing may be better understood in light of the following terms:

[0122] Clause 1. A method for encoding a video signal, comprising:

[0123] Determining, according to a deviation set corresponding to each reference unit in a plurality of reference units included in a reference frame of first pixel precision, a first rate-distortion cost and a second rate-distortion cost corresponding to the corresponding reference unit, where the deviation set is a set of scaled deviations of co-located pixels between the corresponding reference unit and the unit to be encoded, the first rate-distortion cost is the rate-distortion cost corresponding to the first pixel precision, and the second rate-distortion cost is the rate-distortion cost corresponding to the second pixel precision;

[0124] Determine an optimal motion vector corresponding to a first pixel precision and a starting motion vector corresponding to a second pixel precision, where the optimal motion vector corresponding to the first pixel precision is a motion vector between a reference unit having a minimum first rate-distortion cost among multiple reference units and the unit to be coded, and the starting motion vector corresponding to the second pixel precision is a motion vector between a reference unit having a minimum second rate-distortion cost among multiple reference units and the unit to be coded. The starting motion vector corresponding to the second pixel precision is used to determine the optimal motion vector corresponding to the second pixel precision;

[0125] According to the first optimal motion vector, inter-frame encoding is performed on the coding unit to output a coding sequence, wherein the first optimal motion vector is a motion vector with the smallest rate-distortion cost among the optimal motion vectors corresponding to multiple pixel precisions, and the multiple pixel precisions include a first pixel precision and a second pixel precision.

[0126] Clause 2. Determining a first rate-distortion cost and a second rate-distortion cost according to the method of clause 1, comprising:

[0127] Determining a first code length based on a motion vector deviation between a first motion vector and a predicted motion vector, where the first code length is a coding length of the motion vector deviation corresponding to a first pixel precision, the first motion vector being a motion vector between a first reference unit and a unit to be encoded, and a first rate-distortion cost corresponding to the first reference unit being determined based on a deviation set corresponding to the first reference unit and the first code length;

[0128] According to the motion vector deviation, a second code length is determined, where the second code length is the encoding length of the motion vector deviation corresponding to the second pixel precision. The second rate-distortion cost corresponding to the first reference unit is determined according to the deviation set corresponding to the first reference unit and the second code length.

[0129] Clause 3. The method according to clause 1 or 2, further comprising:

[0130] Obtaining a starting motion vector corresponding to the first pixel precision;

[0131] Determining an optimal motion vector corresponding to the first pixel precision and a starting motion vector corresponding to the second pixel precision includes:

[0132] According to the starting motion vector corresponding to the first pixel precision, a matching reference unit of the unit to be encoded corresponding to the first pixel precision is searched in the reference frame of the first pixel precision to determine the optimal motion vector corresponding to the first pixel precision and the starting motion vector corresponding to the second pixel precision.

[0133] Clause 4. The method according to clause 1 or 2, further comprising:

[0134] According to the starting motion vector corresponding to the second pixel precision, a matching reference unit of the unit to be encoded corresponding to the second pixel precision is searched in the reference frame of the second pixel precision to determine the optimal motion vector corresponding to the second pixel precision.

[0135] Clause 5. The method according to clause 4, further comprising:

[0136] A starting motion vector corresponding to a third pixel precision is determined, where the plurality of pixel precisions include the third pixel precision.

[0137] Clause 6. The method according to clause 1 or 2, wherein, based on the first optimal motion vector, inter-coding is performed on the coding unit, and before outputting the coded sequence, the method further comprises:

[0138] Determine a second optimal motion vector, where the second optimal motion vector is a motion vector having the smallest rate-distortion cost among the optimal motion vectors corresponding to the multiple pixel accuracies;

[0139] When the rate-distortion cost corresponding to the second optimal motion vector is greater than or equal to the threshold, using the second reference unit in the reference frame of the target pixel precision as the search start reference unit, searching a preset number of reference units with a target step size to obtain rate-distortion costs corresponding to the preset number of reference units, where the second reference unit is the reference unit corresponding to the second optimal motion vector, and the target pixel precision is the pixel precision corresponding to the second reference unit;

[0140] as well as,

[0141] When the minimum rate-distortion cost among the rate-distortion costs corresponding to the preset number of reference units is less than the rate-distortion cost corresponding to the second reference unit, determining that the optimal motion vector corresponding to the updated target pixel precision is the first optimal motion vector, where the first optimal motion vector is the motion vector between the reference unit corresponding to the minimum rate-distortion cost and the unit to be encoded; or

[0142] When the minimum rate-distortion cost is greater than or equal to the rate-distortion cost corresponding to the second reference unit, it is determined not to update the optimal motion vector corresponding to the target accuracy, and the first optimal motion vector becomes the second optimal motion vector.

[0143] Clause 7. A processing device comprising:

[0144] A first motion estimation ME module is configured to determine, based on a deviation set corresponding to each reference unit in a plurality of reference units included in a reference frame of first pixel precision, a first rate-distortion cost and a second rate-distortion cost corresponding to the corresponding reference unit, where the deviation set is a set of scaled deviations of co-located pixels between the corresponding reference unit and the unit to be encoded, the first rate-distortion cost is the rate-distortion cost corresponding to the first pixel precision, and the second rate-distortion cost is the rate-distortion cost corresponding to the second pixel precision;

[0145] The first ME module is further configured to output an optimal motion vector corresponding to the first pixel precision and a starting motion vector corresponding to the second pixel precision, where the optimal motion vector corresponding to the first pixel precision is a motion vector between a reference unit with a minimum first rate-distortion cost among multiple reference units and the unit to be encoded, and the starting motion vector corresponding to the second pixel precision is a motion vector between a reference unit with a minimum second rate-distortion cost among multiple reference units and the unit to be encoded, and the starting motion vector corresponding to the second pixel precision is used to determine the optimal motion vector corresponding to the second pixel precision;

[0146] The encoding module is configured to perform inter-frame encoding on the encoding unit according to a first optimal motion vector and output an encoding sequence, wherein the first optimal motion vector is a motion vector with the smallest rate-distortion cost among the optimal motion vectors corresponding to multiple pixel precisions, and the multiple pixel precisions include a first pixel precision and a second pixel precision.

[0147] Clause 8. A device according to clause 7,

[0148] The first ME module is further configured to determine a first code length based on a motion vector deviation between the first motion vector and the predicted motion vector, where the first code length is a coding length of the motion vector deviation corresponding to the first pixel precision, the first motion vector is a motion vector between a first reference unit and a unit to be encoded, and a first rate-distortion cost corresponding to the first reference unit is determined based on a deviation set corresponding to the first reference unit and the first code length;

[0149] The first ME module is also configured to determine a second code length based on the motion vector deviation, where the second code length is the encoding length of the motion vector deviation corresponding to the second pixel precision, and the second rate-distortion cost corresponding to the first reference unit is determined based on the deviation set corresponding to the first reference unit and the second code length.

[0150] Clause 9. A device according to clause 7 or 8,

[0151] The first ME module is further configured to obtain a starting motion vector corresponding to the first pixel precision;

[0152] The first ME module is specifically configured to search for a matching reference unit of the unit to be encoded corresponding to the first pixel precision in the reference frame of the first pixel precision according to the starting motion vector corresponding to the first pixel precision, and determine the optimal motion vector corresponding to the first pixel precision and the starting motion vector corresponding to the second pixel precision.

[0153] Clause 10. The apparatus according to clause 7 or 8, comprising:

[0154] The second ME module is configured to obtain a starting motion vector corresponding to a second pixel precision;

[0155] The second ME module is further configured to search for a matching reference unit of the unit to be encoded corresponding to the second pixel precision in the reference frame of the second pixel precision according to the starting motion vector corresponding to the second pixel precision, and determine the optimal motion vector corresponding to the second pixel precision.

[0156] Clause 11. The apparatus according to clause 10,

[0157] The second ME module is further configured to determine a starting motion vector corresponding to a third pixel precision, where the multiple pixel precisions include the third pixel precision.

[0158] Clause 12. The apparatus according to clause 7 or 8, comprising:

[0159] a processing module configured to determine a second optimal motion vector, where the second optimal motion vector is a motion vector having the smallest rate-distortion cost among optimal motion vectors corresponding to a plurality of pixel accuracies;

[0160] a processing module configured to, when a rate-distortion cost corresponding to the second optimal motion vector is greater than or equal to a threshold, use a second reference unit in the reference frame of the target pixel precision as a starting reference unit, search a preset number of reference units using a target step size, and obtain rate-distortion costs corresponding to the preset number of reference units, where the second reference unit is a reference unit corresponding to the second optimal motion vector, and the target pixel precision is a pixel precision corresponding to the second reference unit;

[0161] The processing module is further configured to:

[0162] When the minimum rate-distortion cost among the rate-distortion costs corresponding to the preset number of reference units is less than the rate-distortion cost corresponding to the second reference unit, determining that the optimal motion vector corresponding to the updated target pixel precision is the first optimal motion vector, where the first optimal motion vector is the motion vector between the reference unit corresponding to the minimum rate-distortion cost and the unit to be encoded; or

[0163] When the minimum rate-distortion cost is greater than or equal to the rate-distortion cost corresponding to the second reference unit, it is determined not to update the optimal motion vector corresponding to the target accuracy, and the first optimal motion vector is the second optimal motion vector.

[0164] Clause 13. A processing device comprising: a processor and a memory;

[0165] Memory stores computer-executable instructions;

[0166] The processor executes the computer-executable instructions stored in the memory, causing the processing device to perform the method of any one of clauses 1 to 6.

[0167] Clause 14. A chip comprising a logic circuit and an input / output interface;

[0168] The logic circuit is used to control the input and output interface and execute the method according to any one of claims 1 to 6.

[0169] Clause 15. A computer-readable storage medium having computer-executable instructions stored therein, wherein the computer-executable instructions are used to implement the method of any one of Clauses 1 to 6 when executed by a processor.

[0170] It should be understood that the present application is not limited to the exact structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for encoding a video signal, characterized in that: include: Determine, according to a deviation set corresponding to each reference unit in a plurality of reference units included in a reference frame of first pixel precision, a first rate-distortion cost and a second rate-distortion cost corresponding to the corresponding reference unit, wherein the deviation set is a set of scaled deviations of co-located pixels between the corresponding reference unit and the unit to be encoded, the first rate-distortion cost is a rate-distortion cost corresponding to the first pixel precision, and the second rate-distortion cost is a rate-distortion cost corresponding to the second pixel precision; Determine an optimal motion vector corresponding to the first pixel precision and a starting motion vector corresponding to the second pixel precision, wherein the optimal motion vector corresponding to the first pixel precision is a motion vector between a reference unit with the smallest first rate-distortion cost among the multiple reference units and the unit to be encoded, and the starting motion vector corresponding to the second pixel precision is a motion vector between a reference unit with the smallest second rate-distortion cost among the multiple reference units and the unit to be encoded, and the starting motion vector corresponding to the second pixel precision is used to determine the optimal motion vector corresponding to the second pixel precision; According to a first optimal motion vector, inter-frame encoding is performed on the unit to be encoded, and a coding sequence is output, wherein the first optimal motion vector is a motion vector with the smallest rate-distortion cost among optimal motion vectors corresponding to multiple pixel precisions, and the multiple pixel precisions include the first pixel precision and the second pixel precision.

2. The method according to claim 1, characterized in that Determining the first rate-distortion cost and the second rate-distortion cost includes: Determine a first code length according to a motion vector deviation between a first motion vector and a predicted motion vector, wherein the first code length is a coding length of the motion vector deviation corresponding to the first pixel precision, the first motion vector is a motion vector between a first reference unit and the unit to be encoded, and the first rate-distortion cost corresponding to the first reference unit is determined according to the deviation set corresponding to the first reference unit and the first code length; According to the motion vector deviation, a second code length is determined, where the second code length is the encoding length of the motion vector deviation corresponding to the second pixel precision, and the second rate-distortion cost corresponding to the first reference unit is determined based on the deviation set corresponding to the first reference unit and the second code length.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: Obtaining a starting motion vector corresponding to the first pixel precision; The determining the optimal motion vector corresponding to the first pixel precision and the starting motion vector corresponding to the second pixel precision includes: According to the starting motion vector corresponding to the first pixel precision, The reference frame is searched for a matching reference unit of the unit to be encoded corresponding to the first pixel precision, and an optimal motion vector corresponding to the first pixel precision and a starting motion vector corresponding to the second pixel precision are determined.

4. The method according to claim 1 or 2, characterized in that: The method further comprises: According to the starting motion vector corresponding to the second pixel precision, a matching reference unit of the unit to be encoded corresponding to the second pixel precision is searched in the reference frame of the second pixel precision to determine the optimal motion vector corresponding to the second pixel precision.

5. The method according to claim 4, characterized in that The method further comprises: A starting motion vector corresponding to a third pixel precision is determined, wherein the plurality of pixel precisions include the third pixel precision.

6. The method according to claim 1 or 2, characterized in that: Before performing inter-frame coding on the unit to be coded according to the first optimal motion vector and outputting the coded sequence, the method further includes: Determine a second optimal motion vector, where the second optimal motion vector is a motion vector having the smallest rate-distortion cost among the optimal motion vectors corresponding to the multiple pixel accuracies; When the rate-distortion cost corresponding to the second optimal motion vector is greater than or equal to a threshold, taking a second reference unit in the reference frame of target pixel precision as a search start reference unit, searching a preset number of reference units with a target step size to obtain rate-distortion costs corresponding to the preset number of reference units, the second reference unit is a reference unit corresponding to the second optimal motion vector, and the target pixel precision is a pixel precision corresponding to the second reference unit; as well as, When the minimum rate-distortion cost among the rate-distortion costs corresponding to the preset number of reference units is less than the rate-distortion cost corresponding to the second reference unit, determining that the optimal motion vector corresponding to the updated target pixel accuracy is the first optimal motion vector, and the first optimal motion vector is the motion vector between the reference unit corresponding to the minimum rate-distortion cost and the unit to be encoded; or When the minimum rate-distortion cost is greater than or equal to the rate-distortion cost corresponding to the second reference unit, it is determined not to update the optimal motion vector corresponding to the target accuracy, and the first optimal motion vector is the second optimal motion vector.

7. A processing device, characterized in that: include: The first motion estimation ME module is configured to determine a first rate-distortion cost and a second rate-distortion cost corresponding to a corresponding reference unit according to a deviation set corresponding to each reference unit in a plurality of reference units included in a reference frame of a first pixel precision, wherein the deviation set is a set of scaled deviations of co-located pixels between the corresponding reference unit and the unit to be encoded, the first rate-distortion cost is a rate-distortion cost corresponding to the first pixel precision, and the second rate-distortion cost is a rate-distortion cost corresponding to the second pixel precision. True price; The first ME module is further configured to output an optimal motion vector corresponding to the first pixel precision and a starting motion vector corresponding to the second pixel precision, wherein the optimal motion vector corresponding to the first pixel precision is a motion vector between a reference unit with the smallest first rate-distortion cost among the multiple reference units and the unit to be encoded, and the starting motion vector corresponding to the second pixel precision is a motion vector between a reference unit with the smallest second rate-distortion cost among the multiple reference units and the unit to be encoded, and the starting motion vector corresponding to the second pixel precision is used to determine the optimal motion vector corresponding to the second pixel precision; The encoding module is configured to perform inter-frame encoding on the unit to be encoded according to a first optimal motion vector, and output a coding sequence, wherein the first optimal motion vector is a motion vector with the smallest corresponding rate-distortion cost among optimal motion vectors corresponding to multiple pixel precisions, and the multiple pixel precisions include the first pixel precision and the second pixel precision.

8. The device according to claim 7, characterized in that The first ME module is further configured to determine a first code length according to a motion vector deviation between a first motion vector and a predicted motion vector, the first code length being a coding length of the motion vector deviation corresponding to the first pixel precision, the first motion vector being a motion vector between a first reference unit and the unit to be encoded, and the first rate-distortion cost corresponding to the first reference unit being determined according to the deviation set corresponding to the first reference unit and the first code length; The first ME module is also configured to determine a second code length based on the motion vector deviation, where the second code length is the encoding length of the motion vector deviation corresponding to the second pixel precision, and the second rate-distortion cost corresponding to the first reference unit is determined based on the deviation set corresponding to the first reference unit and the second code length.

9. The device according to claim 7 or 8, characterized in that The first ME module is further configured to obtain a starting motion vector corresponding to the first pixel precision; The first ME module is specifically configured to search for a matching reference unit of the unit to be encoded corresponding to the first pixel precision in the reference frame of the first pixel precision according to the starting motion vector corresponding to the first pixel precision, and determine the optimal motion vector corresponding to the first pixel precision and the starting motion vector corresponding to the second pixel precision.

10. The device according to claim 7 or 8, characterized in that include: A second ME module is configured to obtain a starting motion vector corresponding to the second pixel precision; The second ME module is also configured to search for a matching reference unit of the unit to be encoded corresponding to the second pixel precision in the reference frame of the second pixel precision according to a starting motion vector corresponding to the second pixel precision, and determine an optimal motion vector corresponding to the second pixel precision.

11. The device according to claim 10, characterized in that The second ME module is further configured to determine a starting motion vector corresponding to a third pixel precision, and the multiple pixel precisions include the third pixel precision.

12. The device according to claim 7 or 8, characterized in that include: A processing module is configured to determine a second optimal motion vector, where the second optimal motion vector is a motion vector with the smallest rate-distortion cost among the optimal motion vectors corresponding to the multiple pixel accuracies; The processing module is configured to, when the rate-distortion cost corresponding to the second optimal motion vector is greater than or equal to a threshold, use a second reference unit in the reference frame of target pixel precision as a starting reference unit, use a target step size to search for a preset number of reference units, and obtain rate-distortion costs corresponding to the preset number of reference units, wherein the second reference unit is a reference unit corresponding to the second optimal motion vector, and the target pixel precision is a pixel precision corresponding to the second reference unit; The processing module is further configured to: When the minimum rate-distortion cost among the rate-distortion costs corresponding to the preset number of reference units is less than the rate-distortion cost corresponding to the second reference unit, determining that the optimal motion vector corresponding to the updated target pixel precision is the first optimal motion vector, and the first optimal motion vector is a motion vector between the reference unit corresponding to the minimum rate-distortion cost and the unit to be encoded; or, When the minimum rate-distortion cost is greater than or equal to the rate-distortion cost corresponding to the second reference unit, it is determined not to update the optimal motion vector corresponding to the target accuracy, and the first optimal motion vector is the second optimal motion vector.

13. A processing device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processing device performs the method according to any one of claims 1 to 6.

14. A chip, characterized in that: Including logic circuits and input and output interfaces; The logic circuit is used to control the input-output interface and execute the method according to any one of claims 1 to 6.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

Citation Information

Patent Citations

  • Inter-frame motion estimation method and device, electronic equipment and readable storage medium

    CN110392265A

  • Data processing method and device, computer equipment and storage medium

    CN114501022A

  • Video coding method and device, electronic equipment and storage medium

    CN115037947A

  • Motion estimating method

    KR101356821B1

  • Encoding method and apparatus, computing processing device, computer program, and storage medium

    WO2022021310A1

Cited By

  • Image motion estimation method and related device

    CN119071503A