WO2020182161A1 - 编解码方法与装置、编码端设备和解码端设备 - Google Patents

编解码方法与装置、编码端设备和解码端设备 Download PDF

Info

Publication number
WO2020182161A1
WO2020182161A1 PCT/CN2020/078849 CN2020078849W WO2020182161A1 WO 2020182161 A1 WO2020182161 A1 WO 2020182161A1 CN 2020078849 W CN2020078849 W CN 2020078849W WO 2020182161 A1 WO2020182161 A1 WO 2020182161A1
Authority
WO
WIPO (PCT)
Prior art keywords
motion vector
block
value
pixel
sub
Prior art date
Application number
PCT/CN2020/078849
Other languages
English (en)
French (fr)
Inventor
陈方栋
Original Assignee
杭州海康威视数字技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority to CA3131447A priority Critical patent/CA3131447C/en
Application filed by 杭州海康威视数字技术股份有限公司 filed Critical 杭州海康威视数字技术股份有限公司
Priority to EP20770308.3A priority patent/EP3941056A4/en
Priority to KR1020217031720A priority patent/KR102619925B1/ko
Priority to KR1020237043887A priority patent/KR102664248B1/ko
Priority to AU2020236452A priority patent/AU2020236452B2/en
Priority to MX2021010608A priority patent/MX2021010608A/es
Priority to US17/433,953 priority patent/US11902563B2/en
Priority to SG11202109366VA priority patent/SG11202109366VA/en
Priority to BR112021017777A priority patent/BR112021017777A2/pt
Priority to JP2021552234A priority patent/JP7311619B2/ja
Publication of WO2020182161A1 publication Critical patent/WO2020182161A1/zh
Priority to ZA2021/06161A priority patent/ZA202106161B/en
Priority to JP2023111468A priority patent/JP2023126940A/ja

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • H04N19/517Processing of motion vectors by encoding
    • H04N19/52Processing of motion vectors by encoding by predictive encoding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/513Processing of motion vectors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/132Sampling, masking or truncation of coding units, e.g. adaptive resampling, frame skipping, frame interpolation or high-frequency transform coefficient masking
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/137Motion inside a coding unit, e.g. average field, frame or block difference
    • H04N19/139Analysis of motion vectors, e.g. their magnitude, direction, variance or reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/182Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a pixel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/533Motion estimation using multistep search, e.g. 2D-log search or one-at-a-time search [OTS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/557Motion estimation characterised by stopping computation or iteration based on certain criteria, e.g. error magnitude being too large or early exit
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/56Motion estimation with initialisation of the vector search, e.g. estimating a good candidate to initiate a search
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • H04N19/51Motion estimation or motion compensation
    • H04N19/577Motion compensation with bidirectional frame interpolation, i.e. using B-pictures

Definitions

  • This application relates to coding and decoding technologies, and in particular to a coding and decoding method and device, coding end equipment and decoding end equipment.
  • a complete video encoding method can include processes such as prediction, transformation, quantization, entropy encoding, and filtering.
  • predictive coding includes intra-frame coding and inter-frame coding.
  • Inter-frame coding uses the correlation of the video time domain to predict the pixels of the current image by using pixels adjacent to the coded image to effectively remove the video time domain redundancy.
  • a motion vector may be used to represent the relative displacement between the current image block of the video image of the current frame and the reference image block of the video image of the reference frame. For example, if the video image A of the current frame and the video image B of the reference frame have a strong time-domain correlation, when the image block A1 (current image block) of the video image A needs to be transmitted, it can be performed in the video image B
  • the motion search finds the image block B1 that best matches the image block A1 (ie, the reference image block), and determines the relative displacement between the image block A1 and the image block B1, and the relative displacement is the motion vector of the image block A1.
  • the encoding end may send the motion vector to the decoding end, instead of sending the image block A1 to the decoding end.
  • the decoding end can obtain the image block A1 according to the motion vector and the image block B1. Obviously, since the number of bits occupied by the motion vector is smaller than the number of bits occupied by the image block A1, the foregoing method can save a large number of bits.
  • the original motion vector when the current block is a one-way block, after obtaining the motion vector of the current block (hereinafter referred to as the original motion vector), the original motion vector can be adjusted, and encoding/decoding is performed based on the adjusted motion vector. Thereby improving coding performance.
  • the current block when the current block is a bidirectional block, after obtaining the first original motion vector and the second original motion vector of the current block, how to adjust the first original motion vector and the second original motion vector, there is currently no reasonable solution . In other words, for scenarios with bidirectional blocks, there may be problems such as poor prediction quality and prediction errors, resulting in poor coding performance.
  • This application provides an encoding and decoding method, device and equipment, which can improve encoding performance.
  • This application provides an encoding and decoding method, the method includes: if the characteristic information of the current block meets a specific condition, determining the first reference block corresponding to the current block according to the first original motion vector of the current block, and The second original motion vector of the current block determines the second reference block corresponding to the current block; according to the first pixel value of the first reference block and the second pixel value of the second reference block, the An original motion vector and the second original motion vector are adjusted to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector; A target motion vector and the second target motion vector encode or decode the current block.
  • the present application provides an encoding and decoding device, the device includes: a determining module, configured to determine the first corresponding to the current block according to the first original motion vector of the current block if the characteristic information of the current block meets a specific condition Reference block, determining a second reference block corresponding to the current block according to the second original motion vector of the current block; a processing module, configured to determine the second reference block corresponding to the first reference block according to the first pixel value of the first reference block and the second reference block Adjust the first original motion vector and the second original motion vector to obtain the first target motion vector corresponding to the first original motion vector and the second original motion vector corresponding to the A second target motion vector; an encoding and decoding module for encoding or decoding the current block according to the first target motion vector and the second target motion vector.
  • the present application provides an encoding terminal device.
  • the encoding terminal device includes a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine executable instructions that can be executed by the processor;
  • the processor is used to execute machine executable instructions to implement the following steps: if the characteristic information of the current block meets a specific condition, determine the first reference block corresponding to the current block according to the first original motion vector of the current block, and The second original motion vector of the current block determines the second reference block corresponding to the current block; according to the first pixel value of the first reference block and the second pixel value of the second reference block, the An original motion vector and the second original motion vector are adjusted to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector; A target motion vector and the second target motion vector encode the current block.
  • the present application provides a decoding end device, the decoding end device includes a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine executable instructions that can be executed by the processor;
  • the processor is used to execute machine executable instructions to implement the following steps: if the characteristic information of the current block meets a specific condition, determine the first reference block corresponding to the current block according to the first original motion vector of the current block, and The second original motion vector of the current block determines the second reference block corresponding to the current block; according to the first pixel value of the first reference block and the second pixel value of the second reference block, the An original motion vector and the second original motion vector are adjusted to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector; A target motion vector and the second target motion vector decode the current block.
  • the first target motion vector and the second target motion vector of the current block can be determined according to the first original motion vector and the second original motion vector, and according to the first target motion vector and the second target motion vector
  • the second target motion vector encodes or decodes the current block, instead of directly encoding or decoding the current block according to the first original motion vector and the second original motion vector, so as to solve the problems of poor prediction quality and prediction errors, and improve coding Performance and coding efficiency.
  • FIG. 1A is a schematic diagram of interpolation in an embodiment of the present application.
  • FIG. 1B is a schematic diagram of a video coding framework in an implementation manner of the present application.
  • FIG. 2 is a flowchart of an encoding and decoding method in an embodiment of the present application
  • FIG. 3 is a flowchart of an encoding and decoding method in an embodiment of the present application.
  • FIG. 4 is a flowchart of an encoding and decoding method in an embodiment of the present application.
  • FIG. 5 is a schematic diagram of reference pixels in an embodiment of the present application.
  • Fig. 6 is a schematic diagram of motion vector iteration in an embodiment of the present application.
  • FIGS. 7A-7E are schematic diagrams of the sequence of candidate points in an embodiment of the present application.
  • FIG. 8 is a schematic diagram of the spatial reference of the current block in an embodiment of the present application.
  • FIG. 9 is a structural diagram of a coding and decoding device in an embodiment of the present application.
  • FIG. 10 is a hardware structure diagram of a decoding end device in an embodiment of the present application.
  • FIG. 11 is a hardware structure diagram of an encoding terminal device in an embodiment of the present application.
  • first, second, third, etc. may be used in the embodiments of the present application to describe various information, the information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information, and similarly, the second information may also be referred to as first information.
  • word “if” used can be interpreted as "when” or "when” or "in response to certainty”.
  • Intra prediction and inter prediction refers to the use of the correlation of the video space to predict the current pixel using the pixels of the coded block of the current image to achieve the purpose of removing video space redundancy .
  • a variety of prediction modes are specified in intra prediction, and each prediction mode corresponds to a texture direction (except for DC mode).
  • the current block prediction pixel is generated from the boundary reconstruction pixel value of the neighboring block in its prediction direction. For example, if the texture of the image is arranged horizontally, then selecting the horizontal prediction mode can better predict the image information.
  • Inter-frame prediction refers to the use of video temporal correlation.
  • the main video coding standard inter-frame prediction part adopts block-based motion compensation technology.
  • the main principle is to find a best matching block in the previously encoded image for each pixel block of the current image. This process is called motion estimation. (Motion Estimation, ME).
  • Motion Vector In inter-frame coding, a motion vector is used to represent the relative displacement between the current coding block and the best matching block in the reference image. Each divided block has a corresponding motion vector transmitted to the decoding end. If the motion vector of each block is independently coded and transmitted, especially when divided into small-sized blocks, a considerable amount of bits will be consumed. In order to reduce the number of bits used to code the motion vector, the spatial correlation between adjacent image blocks is used to predict the motion vector of the current block to be coded according to the motion vector of the adjacent coded block, and then the prediction difference is coded . In this way, the number of bits representing the motion vector can be effectively reduced.
  • the motion vector of the adjacent encoded block is first used to predict the motion vector of the current block, and then the motion vector prediction value (MVP, Motion Vector Prediction) and the true estimation of the motion vector
  • MVP Motion Vector Prediction
  • the difference between (MVD, Motion Vector Difference) is encoded, thereby effectively reducing the number of MV encoding bits.
  • Motion Information Since the motion vector represents the position offset between the current image block and a reference image block, in order to accurately obtain the information pointing to the image block, in addition to the motion vector, the index information of the reference frame image is also needed to indicate which one to use Reference frame image.
  • a reference frame image list can usually be established, and the reference frame image index information indicates which reference frame image in the reference frame image list is used by the current image block.
  • many coding technologies also support multiple reference image lists. Therefore, an index value can also be used to indicate which reference image list is used, and this index value can be called a reference direction.
  • motion-related information such as motion vector, reference frame index, and reference direction can be collectively referred to as motion information.
  • Prediction pixel refers to the pixel value derived from the pixel that has been coded and decoded.
  • the residual is obtained from the difference between the original pixel and the predicted pixel, and then the residual transformation quantization and coefficient coding are performed.
  • the inter-frame predicted pixels refer to the pixel values derived from the reference frame (reconstructed pixel frame) of the current block. Due to the discrete pixel positions, interpolation operations are required to obtain the final predicted pixels. The closer the predicted pixel is to the original pixel, the smaller the residual energy obtained by subtracting the two, and the higher the coding compression performance.
  • Interpolation If the current MV is non-integer pixel accuracy, the existing pixel value cannot be directly copied from the corresponding reference frame, and the required pixel value can only be obtained by interpolation. As shown in FIG. 1A, if you want to obtain the pixel value Y 1/2 with an offset of 1/2 pixel, it needs to be obtained by interpolation of the surrounding pixel value X. If an interpolation filter with N taps is used, it needs to be obtained by interpolation of N whole pixels around it.
  • Motion compensation is the process of obtaining all pixel values of the current block through interpolation or copying.
  • Video encoding framework As shown in Figure 1B, the video encoding framework can be used to implement the encoding end processing flow of the embodiment of the present application.
  • the schematic diagram of the video decoding framework is similar to that of Figure 1B, and will not be repeated here.
  • video decoding can be used
  • the framework implements the decoding end processing flow of the embodiment of the present application.
  • the video coding framework and the video decoding framework it includes modules such as intra prediction, motion estimation/motion compensation, reference image buffer, in-loop filtering, reconstruction, transformation, quantization, inverse transformation, inverse quantization, entropy encoder, etc. .
  • the encoding end processing flow can be realized, and at the decoding end, through the cooperation between these modules, the decoding end processing flow can be realized.
  • the current block when the current block is a bidirectional block, after obtaining the first original motion vector and the second original motion vector of the current block, how to adjust the first original motion vector and the second original motion vector is not reasonable. solution.
  • the current block when the current block is a bidirectional block, it is first judged whether the characteristic information of the current block meets a specific condition, and if so, the first reference block corresponding to the current block is determined according to the first original motion vector, and according to the current block
  • the second original motion vector determines the second reference block, and according to the first pixel value of the first reference block and the second pixel value of the second reference block, the first original motion vector and the second original motion vector are adjusted to obtain the first A target motion vector and a second target motion vector.
  • the first target motion vector and the second target motion vector are obtained, so that the current block can be coded according to the first target motion vector and the second target motion vector Or decoding can improve coding performance and coding efficiency.
  • Embodiment 1 As shown in FIG. 2, which is a schematic flowchart of the encoding and decoding method proposed in the embodiment of this application, the method can be applied to the decoding end or the encoding end, and the method may include the following steps:
  • Step 201 If the characteristic information of the current block meets a specific condition, determine the first reference block corresponding to the current block according to the first original motion vector of the current block, and determine the second reference block corresponding to the current block according to the second original motion vector of the current block Piece.
  • the characteristic information includes, but is not limited to, one or more of the following: a motion information prediction mode corresponding to the current block; motion information attributes corresponding to the current block; size information of the current block.
  • the feature information of the current block satisfies certain conditions, including but not limited to: if the motion information prediction mode corresponding to the current block is the normal fusion mode, then It can be determined that the motion information prediction mode corresponding to the current block satisfies certain conditions; or, if the motion information prediction mode corresponding to the current block is a fusion mode used to jointly generate a new prediction value from the inter-frame prediction value and the intra-frame prediction value, it can be determined that the current The motion information prediction mode corresponding to the block satisfies certain conditions.
  • the feature information of the current block meets certain conditions, including but not limited to: if the motion information attribute corresponding to the current block is the motion information of the current block, the motion information includes two different directions If the motion information attribute corresponding to the current block meets certain conditions; or, if the motion information attribute corresponding to the current block is that the motion information of the current block includes motion information in two different directions, the motion information in two different directions corresponds to If the distance between the two reference frames and the current frame is the same, it is determined that the motion information attribute corresponding to the current block meets certain conditions; or, if the motion information attribute corresponding to the current block is multiplexed with the motion information of the surrounding blocks, the current block is determined The corresponding motion information attribute meets a specific condition; or, if the motion information attribute corresponding to the current block is that the motion information of each sub-block of the current block is the same, it is determined that the motion information attribute corresponding to the current block meets the specific condition.
  • the size information of the current block may include the width value of the current block and the height value of the current block, and the characteristic information of the current block satisfies certain conditions, including but not limited to : If the width value of the current block is within the range of the first interval [first threshold, second threshold], it can be determined that the size information of the current block satisfies a specific condition; or, if the height value of the current block is within the second interval [section Within the range of the third threshold and the fourth threshold], it can be determined that the size information of the current block meets certain conditions; or, if the area obtained according to the width value of the current block and the height value of the current block is in the third interval [fifth threshold, Within the range of the sixth threshold], it can be determined that the size information of the current block satisfies a specific condition; or, if the width value is within the range of the first interval [first threshold, second threshold], and the height value is located at the Within the range
  • the first threshold may be smaller than the second threshold, and neither the first threshold nor the second threshold is limited.
  • the first threshold may be 4 and the second threshold may be 128.
  • the third threshold may be smaller than the fourth threshold, and neither the fourth threshold nor the fourth threshold is limited.
  • the third threshold may be 8, and the fourth threshold may be 128.
  • the fifth threshold can be smaller than the sixth threshold, and there is no restriction on the fifth and sixth thresholds.
  • the fifth threshold can be 64, and the sixth threshold can be 128*128.
  • determining the first reference block corresponding to the current block according to the first original motion vector of the current block, and determining the second reference block corresponding to the current block according to the second original motion vector of the current block may include but is not limited to: Determine the first reference block corresponding to the current block from the first reference frame for the first original motion vector of the current block; determine the second reference block corresponding to the current block from the second reference frame based on the second original motion vector of the current block .
  • the first pixel value of each pixel in the first reference block is obtained by interpolating the pixel values of adjacent pixels in the first reference block, or by interpolating the pixel values of adjacent pixels in the first reference block.
  • the pixel value is copied; the second pixel value of each pixel in the second reference block is obtained by interpolating the pixel values of adjacent pixels in the second reference block, or by interpolating the pixel values in the second reference block
  • the pixel values of adjacent pixels are copied.
  • the size of the first reference block is the same as the size of the second reference block, the width value of the first reference block is determined based on the width value of the current block and the search range, and the height value of the first reference block is determined based on the height value of the current block and the search range .
  • Step 202 Adjust the first original motion vector and the second original motion vector according to the first pixel value of the first reference block and the second pixel value of the second reference block to obtain the first target corresponding to the first original motion vector The second target motion vector corresponding to the motion vector and the second original motion vector.
  • the first original motion vector and the second original motion vector can be adjusted according to the first pixel value and the second pixel value, Obtain the first target motion vector and the second target motion vector of the sub-block.
  • adjusting the first original motion vector and the second original motion vector according to the first pixel value and the second pixel value to obtain the first target motion vector and the second target motion vector of the sub-block may include: According to the first pixel value and the second pixel value, determine the first integer pixel motion vector adjustment value and the second integer pixel motion vector adjustment value of the sub-block, and/or, the first sub-pixel motion vector adjustment value and the second pixel motion vector adjustment value of the sub-block The adjustment value of the binary pixel motion vector. Then, the first original motion vector can be adjusted according to the first full-pixel motion vector adjustment value and/or the first sub-pixel motion vector adjustment value to obtain the first target motion vector of the sub-block. The second original motion vector is adjusted according to the second integer-pixel motion vector adjustment value and/or the second sub-pixel motion vector adjustment value to obtain the second target motion vector of the sub-block.
  • the first integer pixel motion vector adjustment value and the second integer pixel motion vector adjustment value of the sub-block are determined.
  • the second sub-pixel motion vector adjustment value may include: determining the first original motion vector or the second original motion vector as the center motion vector; determining the edge motion vector corresponding to the center motion vector; according to the first pixel value and the second pixel Value, get the first generation value corresponding to the center motion vector and the second generation value corresponding to the edge motion vector; then, according to the first generation value and the second generation value, select a motion vector from the center motion vector and the edge motion vector as Optimal motion vector, and determine whether the end condition is met; if not, determine the optimal motion vector as the center motion vector, and return to the execution to determine the edge motion vector corresponding to the center motion vector; if it is, determine it according to the optimal motion vector
  • the first integer pixel motion vector adjustment value and the second integer pixel motion vector adjustment value of the sub-block; the first sub-pixel motion vector adjustment value and the second sub-pixel motion vector adjustment value of the sub-block are determined according to the optimal motion vector.
  • determining the edge motion vector corresponding to the center motion vector includes: shifting the center motion vector (x, y) to different directions by S, and sequentially obtain the edge motion vectors (x, y+S), Edge motion vector (x, yS), edge motion vector (x+S, y), edge motion vector (xS, y), edge motion vector (x+right, y+down); or, change the center motion vector (x , Y) offset S in different directions, and sequentially get the edge motion vector (x, yS), edge motion vector (x, y+S), edge motion vector (xS, y), edge motion vector (x+ S, y), edge motion vector (x+right, y+down).
  • the default value of the edge motion vector (x+right, y+down) is (xS, yS); if the cost value of the edge motion vector (x+S, y) is less than the cost value of the edge motion vector (xS, y), then right is S; if the cost value of the edge motion vector (x, y+S) is less than the cost value of the edge motion vector (x, yS), then down is S; or if the cost of the edge motion vector (x+S, y) The cost value is less than or equal to the cost value of the edge motion vector (xS, y), then right is S; if the cost value of the edge motion vector (x, y+S) is less than or equal to the cost value of the edge motion vector (x, yS) , Then down is S.
  • the first generation value corresponding to the center motion vector and the second generation value corresponding to the edge motion vector can be obtained, including but not limited to: according to the first generation value that is not downsampled From the pixel value and the second pixel value that is not downsampled, the first generation value corresponding to the center motion vector and the second generation value corresponding to the edge motion vector are obtained.
  • the first pixel value corresponding to the center motion vector is obtained First-generation value and second-generation value corresponding to edge motion vector.
  • the first integer pixel motion vector adjustment value and the second integer pixel motion vector adjustment value of the sub-block are determined.
  • the second sub-pixel motion vector adjustment value may include: taking the first original motion vector or the second original motion vector as the center, selecting part or all of the surrounding motion vectors, and using the selected motion vector as the candidate motion vector; According to the first pixel value and the second pixel value, obtain the third generation value corresponding to the first original motion vector or the second original motion vector, and the fourth generation value corresponding to the candidate motion vector; according to the third generation value and the fourth generation value , Select a motion vector from the first original motion vector, the second original motion vector, and the candidate motion vector as the optimal motion vector; determine the first integer pixel motion vector adjustment value and the second integer pixel of the sub-block according to the optimal motion vector Motion vector adjustment value; the first sub-pixel motion vector adjustment value and the second sub-pixel motion vector adjustment value of the sub-block are determined according to the optimal motion vector.
  • Determining the first integer-pixel motion vector adjustment value and the second integer-pixel motion vector adjustment value of the sub-block according to the optimal motion vector may include but is not limited to: determining the first integer-pixel motion vector adjustment value of the sub-block according to the optimal motion vector and the first original motion vector An integer pixel motion vector adjustment value, and a second integer pixel motion vector adjustment value of the sub-block is determined according to the first integer pixel motion vector adjustment value.
  • Step 203 Encode or decode the current block according to the first target motion vector and the second target motion vector.
  • the encoding end can encode the current block according to the first target motion vector and the second target motion vector;
  • the decoding end can encode the current block according to the first target motion vector and the second target motion vector.
  • the vector decodes the current block.
  • the third reference block corresponding to the sub-block is determined according to the first target motion vector of the sub-block
  • the fourth reference corresponding to the sub-block is determined according to the second target motion vector of the sub-block Block
  • weighting is performed according to the third pixel value of the third reference block and the fourth pixel value of the fourth reference block to obtain the predicted value of the sub-block
  • the predicted value of the current block is determined according to the predicted value of each sub-block.
  • determining the third reference block corresponding to the sub-block according to the first target motion vector of the sub-block, and determining the fourth reference block corresponding to the sub-block according to the second target motion vector of the sub-block may include:
  • Manner 1 Based on the first target motion vector of the sub-block, a fifth reference block corresponding to the sub-block is determined from the first reference frame, and pixel values in the fifth reference block are interpolated to obtain the third reference block. And, based on the second target motion vector of the sub-block, a sixth reference block corresponding to the sub-block is determined from the second reference frame, and pixel values in the sixth reference block are interpolated to obtain a fourth reference block.
  • Manner 2 Based on the first target motion vector of the sub-block, the seventh reference block corresponding to the sub-block is determined from the first reference frame, the pixel values in the seventh reference block are used to construct the eighth reference block, and the eighth reference block Interpolate the pixel values in the sub-block to obtain the third reference block; based on the second target motion vector of the sub-block, determine the ninth reference block corresponding to the sub-block from the second reference frame, and use the pixel values in the ninth reference block to construct the Ten reference blocks, and the pixel values in the tenth reference block are interpolated to obtain the fourth reference block.
  • the first target motion vector and the second target motion vector may also be stored for the current block.
  • the first target motion vector and the second target motion vector are used for loop filtering of the current frame
  • the first target motion vector and the second target motion vector are used for the time domain reference of subsequent frames
  • the first target motion vector and the second target motion vector are used for spatial reference of the current frame.
  • the first target motion vector and the second target motion vector of the current block can be determined according to the first original motion vector and the second original motion vector, and according to the first target motion vector and the second target motion vector
  • the second target motion vector encodes or decodes the current block, instead of directly encoding or decoding the current block according to the first original motion vector and the second original motion vector, so as to solve the problems of poor prediction quality and prediction errors, and improve coding Performance and coding efficiency.
  • Embodiment 2 As shown in FIG. 3, which is a schematic flowchart of the encoding and decoding method proposed in the embodiment of this application, the encoding and decoding method may be applied to the encoding end, and the encoding and decoding method may include the following steps:
  • Step 301 The encoding terminal judges whether the characteristic information of the current block meets a specific condition. If yes, go to step 302, if no, there is no need to adopt the motion vector adjustment method proposed in this application, and there is no restriction on this processing method.
  • the encoding terminal may determine whether the characteristic information of the current block meets a specific condition based on the encoded information. If the feature information of the current block meets the specific condition, it means that the motion information of the current block is not accurate enough. Therefore, the motion vector adjustment mode is enabled, and step 302 is executed.
  • the motion vector adjustment mode may not be activated, and the motion vector adjustment method proposed in this application does not need to be adopted.
  • the characteristic information of the current block includes but is not limited to one or more of the following: a motion information prediction mode corresponding to the current block; motion information attributes corresponding to the current block; size information of the current block.
  • Step 302 the encoder determines the first reference block corresponding to the current block from the first reference frame based on the first original motion vector of the current block; determines the current block from the second reference frame based on the second original motion vector of the current block The corresponding second reference block.
  • the pixel value of each pixel in the first reference block is called the first pixel value
  • the pixel value of each pixel in the second reference block is called the second pixel value.
  • the current block is a block using bidirectional prediction
  • this bidirectional motion information includes two reference frames and two original motion vectors.
  • the encoding end can obtain the bidirectional motion information in a traditional way, and there is no restriction on this way of obtaining it.
  • the bidirectional motion information includes a first reference frame and a first original motion vector, a second reference frame and a second original motion vector.
  • the encoder can determine the first reference block corresponding to the current block from the first reference frame, and the pixel value of each pixel in the first reference block can be called the first pixel value.
  • the encoder can determine the second reference block corresponding to the current block from the second reference frame, and the pixel value of each pixel in the second reference block can be called the second pixel value.
  • the distance between the current frame where the current block is located and the first reference frame and the distance between the second reference frame and the current frame where the current block is located may be the same.
  • the first reference frame is the first frame
  • the current frame is the fifth frame
  • the second reference frame is the ninth frame.
  • the above is only an example, and the distance between the two can also be different.
  • the first original motion vector and the second original motion vector may have a mirror symmetry relationship, for example, the first original motion vector is (4, 4), the second original motion vector is (-4, -4); the first original motion vector Is (2.5, 3.5), and the second original motion vector is (-2.5, -3.5).
  • the first original motion vector and the second original motion vector may not have a mirror symmetry relationship.
  • Step 303 For each sub-block of the current block: the encoding end adjusts the first original motion vector according to the first pixel value of the first reference block and the second pixel value of the second reference block to obtain the first Target motion vector; the encoding end adjusts the second original motion vector according to the first pixel value of the first reference block and the second pixel value of the second reference block to obtain the second target motion vector of the sub-block.
  • the encoder can fine-tune the first original motion vector and the second original motion vector through a local search method based on the first pixel value and the second pixel value , To obtain a better first target motion vector and second target motion vector, and then use the first target motion vector and the second target motion vector to generate a predicted value with less distortion.
  • the current block may include at least one sub-block. If only one sub-block is included, the sub-block is the current block itself. For the sub-block, the sub-block corresponds to the first original motion vector and the second original motion vector. After adjustment, the sub-block corresponds to the first target motion vector and the second target motion vector.
  • sub-block A corresponds to the first original motion vector A1 and the second original motion vector A2. After adjustment, sub-block A corresponds to the first target motion vector A3 and the first target motion vector A3. Two target motion vector A4.
  • the sub-block B corresponds to the first original motion vector B1 and the second original motion vector B2. After adjustment, the sub-block B corresponds to the first target motion vector B3 and the second target motion vector B4.
  • the first original motion vector A1 corresponding to sub-block A and the first original motion vector B1 corresponding to sub-block B may be the same, and both are the first original motion vector of the current block;
  • the second original motion vector A2 corresponding to sub-block A is the same as
  • the second original motion vector B2 corresponding to the block B may be the same, and both are the second original motion vector of the current block.
  • the first target motion vector A3 corresponding to the sub-block A and the first target motion vector B3 corresponding to the sub-block B may be the same or different.
  • the second target motion vector A4 corresponding to the sub-block A and the second target motion vector B4 corresponding to the sub-block B may be the same or different.
  • Step 304 The encoder performs motion compensation on each sub-block of the current block according to the first target motion vector and the second target motion vector. For example, if the current block includes sub-block A and sub-block B, the first target motion vector and second target motion vector of sub-block A can be used for motion compensation of sub-block A, and the first target motion vector of sub-block B can be used. And the second target motion vector to perform motion compensation on sub-block B.
  • Step 305 The encoding end saves the first target motion vector and the second target motion vector of each sub-block of the current block, and the first target motion vector and the second target motion vector are used for encoding reference of subsequent blocks.
  • Embodiment 3 Refer to FIG. 4, which is a schematic flowchart of the encoding and decoding method proposed in the embodiment of this application.
  • the encoding and decoding method can be applied to the decoding end, and the encoding and decoding method can include the following steps:
  • Step 401 The decoding terminal judges whether the characteristic information of the current block meets a specific condition. If yes, then step 402 is executed, if no, there is no need to adopt the motion vector adjustment method proposed in this application, and there is no restriction on this processing method.
  • the decoding end may receive the encoded bit stream sent by the encoding end, and determine whether the characteristic information of the current block meets a specific condition based on the decoded information. If the feature information of the current block meets the specific condition, it indicates that the motion information of the current block is not accurate enough. Therefore, the motion vector adjustment mode is enabled, and step 402 is executed. If the feature information of the current block does not meet the specific conditions, it means that the motion information of the current block is sufficiently accurate. Therefore, the motion vector adjustment mode is not enabled, and the motion vector adjustment method proposed in this application does not need to be adopted.
  • Step 402 The decoder determines the first reference block corresponding to the current block from the first reference frame based on the first original motion vector of the current block; determines the current block from the second reference frame based on the second original motion vector of the current block The corresponding second reference block.
  • the pixel value of each pixel in the first reference block is called the first pixel value
  • the pixel value of each pixel in the second reference block is called the second pixel value.
  • Step 403 For each sub-block of the current block, the decoding end adjusts the first original motion vector according to the first pixel value of the first reference block and the second pixel value of the second reference block to obtain the first pixel value of the sub-block.
  • Target motion vector the decoding end adjusts the second original motion vector according to the first pixel value of the first reference block and the second pixel value of the second reference block to obtain the second target motion vector of the sub-block.
  • Step 404 For each sub-block of the current block, the decoding end performs motion compensation on the sub-block according to the first target motion vector of the sub-block and the second target motion vector of the sub-block.
  • Step 405 The decoding end saves the first target motion vector and the second target motion vector of each sub-block of the current block, and the first target motion vector and the second target motion vector are used for decoding reference of subsequent blocks.
  • Embodiment 4 In step 301 and step 401, it involves judging whether the feature information of the current block meets a specific condition. In this embodiment, when the feature information satisfies all the following conditions, it is determined that the feature information of the current block meets a specific condition, and the motion vector adjustment mode is activated. Otherwise, the motion vector adjustment mode is not activated.
  • the motion information attributes corresponding to the current block include: the current block directly multiplexes the motion information of the surrounding blocks without encoding the motion information difference.
  • the motion information attributes corresponding to the current block include: the motion information of each sub-block of the current block is the same, that is, the sub-block motion information prediction mode is not adopted.
  • the motion information attributes corresponding to the current block include: the motion information of the current block includes motion information in two different directions.
  • the size information of the current block includes: the size of the current block is within a limited range, and the size is within the limited range, which will be described in subsequent embodiments.
  • Embodiment 5 In step 301 and step 401, it involves judging whether the feature information of the current block meets a specific condition. In this embodiment, when the feature information satisfies all the following conditions, it is determined that the feature information of the current block meets a specific condition, and the motion vector adjustment mode is activated. Otherwise, the motion vector adjustment mode is not activated.
  • the motion information prediction mode corresponding to the current block adopts the Normal Merge mode (that is, the normal fusion mode) or the CIIP mode (that is, the fusion mode used to jointly generate new prediction values from inter-frame prediction values and intra-frame prediction values); or, the current block corresponds to
  • the motion information prediction mode does not use MMVD mode (that is, the fusion mode used to encode the difference of motion information), SB Merge mode (that is, the fusion mode that uses sub-block motion information), or the TPM mode (that is, the fusion mode used for triangular prediction) .
  • the motion information attributes corresponding to the current block include: the motion information of the current block includes motion information in two different directions, and the two reference frames corresponding to the motion information in the two different directions have the same distance from the current frame.
  • the size information of the current block includes: the size of the current block is within a limited range.
  • the fusion mode includes but is not limited to the following types of fusion modes: normal fusion mode (called Normal Merge mode); fusion mode used for triangular prediction (called TPM mode); used for coding The fusion mode with poor motion information (called MMVD mode); the fusion mode with sub-block motion information (called SB Merge mode); the fusion mode used to jointly generate new prediction values with inter-frame prediction values and intra-frame prediction values (called For CIIP mode).
  • the Normal Merge mode includes a normal fusion mode without coding residuals (ie, skip mode) and a normal fusion mode with coding residuals.
  • the MMVD mode includes the MMVD mode that does not encode residuals.
  • Embodiment 6 In step 301 and step 401, it involves determining whether the characteristic information of the current block meets a specific condition. In this embodiment, when the feature information satisfies all the following conditions, it is determined that the feature information of the current block meets a specific condition, and the motion vector adjustment mode is activated. Otherwise, the motion vector adjustment mode is not activated.
  • the motion information prediction mode corresponding to the current block adopts the Normal Merge mode (i.e. normal fusion mode), CIIP mode (i.e. the fusion mode used to jointly generate new prediction values from inter-frame prediction values and intra-frame prediction values), or TPM mode (i.e. use In the fusion mode of triangular prediction); or, the motion information prediction mode corresponding to the current block does not use the MMVD mode (that is, the fusion mode used to encode the difference of motion information), or the SB Merge mode (that is, the fusion mode that uses the sub-block motion information ).
  • the Normal Merge mode i.e. normal fusion mode
  • CIIP mode i.e. the fusion mode used to jointly generate new prediction values from inter-frame prediction values and intra-frame prediction values
  • TPM mode i.e. use In the fusion mode of triangular prediction
  • the motion information prediction mode corresponding to the current block does not use the MMVD mode (that is, the fusion mode used to encode the difference of motion information), or
  • the motion information attributes corresponding to the current block include: the motion information of the current block includes motion information in two different directions, and the two reference frames corresponding to the motion information in the two different directions have the same distance from the current frame.
  • the size information of the current block includes: the size of the current block is within a limited range.
  • Embodiment 7 In step 301 and step 401, it involves determining whether the characteristic information of the current block meets a specific condition. In this embodiment, when the feature information satisfies all the following conditions, it is determined that the feature information of the current block meets a specific condition, and the motion vector adjustment mode is activated. Otherwise, the motion vector adjustment mode is not activated.
  • the motion information prediction mode corresponding to the current block adopts Normal Merge mode (i.e. normal fusion mode), CIIP mode (i.e. fusion mode used for inter-frame prediction value and intra-frame prediction value to jointly generate new prediction values), TPM mode (i.e. used for Triangular prediction fusion mode), or MMVD mode (that is, the fusion mode used to encode the difference of motion information); or, the motion information prediction mode corresponding to the current block does not use the SB Merge mode (that is, the fusion mode that uses sub-block motion information) .
  • Normal Merge mode i.e. normal fusion mode
  • CIIP mode i.e. fusion mode used for inter-frame prediction value and intra-frame prediction value to jointly generate new prediction values
  • TPM mode i.e. used for Triangular prediction fusion mode
  • MMVD mode that is, the fusion mode used to encode the difference of motion information
  • SB Merge mode that is, the fusion mode that uses sub-block motion information
  • the motion information attributes corresponding to the current block include: the motion information of the current block includes motion information in two different directions, and the two reference frames corresponding to the motion information in the two different directions have the same distance from the current frame.
  • the size information of the current block includes: the size of the current block is within a limited range.
  • Embodiment 8 In step 301 and step 401, it involves judging whether the feature information of the current block meets a specific condition. In this embodiment, when the feature information satisfies all the following conditions, it is determined that the feature information of the current block meets a specific condition, and the motion vector adjustment mode is activated. Otherwise, the motion vector adjustment mode is not activated.
  • the motion information prediction mode corresponding to the current block uses Normal Merge mode or CIIP mode; the motion information prediction mode corresponding to the current block does not use MMVD mode, SB Merge mode, or TPM mode; or, the motion information prediction mode corresponding to the current block uses Normal Merge Mode, CIIP mode, or TPM mode; the motion information prediction mode corresponding to the current block does not use MMVD mode, or SB Merge mode; or, the motion information prediction mode corresponding to the current block uses Normal Merge mode, CIIP mode, TPM mode, or MMVD Mode: The motion information prediction mode corresponding to the current block does not use the SB Merge mode.
  • the motion information attributes corresponding to the current block include: the motion information of the current block includes motion information in two different directions, and there is no need to restrict the two reference frames corresponding to the motion information in two different directions to the same distance from the current frame, that is, this restriction Condition removal.
  • the size information of the current block includes: the size of the current block is within a limited range.
  • Embodiment 9 Regarding the "the size of the current block is within the limited range" in the foregoing Embodiment 4 to Embodiment 8, if the size of the current block meets the following conditions, it is determined that the size of the current block is within the limited range.
  • the width of the current block is within the range of [first threshold, second threshold], the first threshold may be 4, and the second threshold may be 128.
  • the height of the current block is within the range of [third threshold, fourth threshold], the third threshold may be 8, and the fourth threshold may be 128.
  • the first threshold, the second threshold, the third threshold, and the fourth threshold may all be 2 to the n-th power, and n is an integer greater than or equal to 1.
  • the fifth threshold and the sixth threshold may both be 4 to the power of m, and m is an integer greater than or equal to 1.
  • the expression [a, b] can mean greater than or equal to a and less than or equal to b.
  • Embodiment 10 In step 302 and step 402, based on the first original motion vector, the first reference block corresponding to the current block is determined from the first reference frame. The pixel value of each pixel in the first reference block is called the first Pixel value; based on the second original motion vector, determine the second reference block corresponding to the current block from the second reference frame. The pixel value of each pixel in the second reference block is called the second pixel value, which is described below .
  • the first pixel value of each pixel in the first reference block is obtained by interpolating the pixel values of adjacent pixels in the first reference block, or by interpolating the pixel values of adjacent pixels in the first reference block.
  • the pixel value is copied;
  • the second pixel value of each pixel in the second reference block is obtained by interpolating the pixel values of adjacent pixels in the second reference block, or by interpolating the pixel values in the second reference block
  • the pixel values of adjacent pixels are copied.
  • the size of the first reference block is the same as the size of the second reference block, the width value of the first reference block/second reference block is determined based on the width value of the current block and the search range, and the height value of the first reference block/second reference block Determine based on the height value of the current block and the search range.
  • the first original motion vector is denoted as MV0
  • the second original motion vector is denoted as MV1.
  • an entire pixel block with an area of (W+FS-1)*(H+FS-1) is obtained, and this entire pixel block is marked as the entire pixel block A .
  • an entire pixel block with an area of (W+FS-1)*(H+FS-1) is obtained, and this entire pixel block is recorded as the entire pixel block B .
  • this initial reference pixel block can be recorded as the first reference block.
  • the size of (W+2*SR)*(H+2*SR can be obtained through bilinear interpolation ), this initial reference pixel block can be marked as the second reference block.
  • the size is (W+2*SR) by direct copying (without interpolation) *(H+2*SR) initial reference pixel block, this initial reference pixel block is recorded as the first reference block.
  • the entire pixel block B with an area of (W+FS-1)*(H+FS-1) you can directly copy to obtain the size (W+2*SR)*(H+2*SR)
  • the initial reference pixel block, and this initial reference pixel block is marked as the second reference block.
  • the subsequent search process only uses the brightness component to calculate the cost value to reduce the complexity
  • based on the whole pixel with an area of (W+FS-1)*(H+FS-1) Block (such as whole pixel block A and whole pixel block B)
  • obtain the initial reference pixel block of size (W+2*SR)*(H+2*SR) namely the first reference block (such as Pred_Inter0) and the second Reference block (such as Pred_Inter1).
  • FS can be the number of taps of the interpolation filter, for example, it can be 8, etc.
  • Obtaining the first reference block/second reference block through bilinear interpolation refers to: the pixel value of each pixel in the first reference block/second reference block, by comparing the phases in the first reference block/second reference block The pixel values of adjacent pixels are obtained by interpolation, and there is no restriction on this.
  • Obtaining the first reference block/second reference block by copying refers to: the pixel value of each pixel in the first reference block/second reference block, by comparing adjacent pixels in the first reference block/second reference block The pixel value of is copied, and there is no restriction on this.
  • the area of the first reference block is (W+2*SR)*(H+2*SR), and the area of the second reference block is (W+2*SR)*(H+2*SR) That is, the width value of the first reference block/second reference block is W+2*SR, and the height value of the first reference block/second reference block is H+2*SR.
  • W is the width of the current block
  • H is the height of the current block
  • SR is the search range, that is, the number of iterations in the subsequent embodiment
  • SR is the maximum horizontal/vertical component interpolation between the target motion vector and the original motion vector, for example, SR can be 2, etc. .
  • the first reference block and the second reference block it is used for the motion vector adjustment in the subsequent process.
  • Embodiment 11 In step 303 and step 403, for each sub-block of the current block, the first original motion vector is adjusted according to the first pixel value of the first reference block and the second pixel value of the second reference block to obtain The first target motion vector of the sub-block; according to the first pixel value of the first reference block and the second pixel value of the second reference block, the second original motion vector is adjusted to obtain the second target motion vector of the sub-block.
  • Step a1 Determine the first original motion vector or the second original motion vector as the central motion vector.
  • the first original motion vector is (4, 4) and the second original motion vector is (-4, -4)
  • the first original motion vector (4, 4) or the second original motion vector (-4 , -4) is determined as the central motion vector.
  • the process of determining the second original motion vector (-4, -4) as the center motion vector is similar.
  • Step a2 Determine the edge motion vector corresponding to the center motion vector.
  • the center motion vector (x, y) can be shifted by S in different directions to obtain edge motion vectors (x, y+S), edge motion vectors (x, yS), edge motion vectors (x+S) in different directions.
  • Y edge motion vector (xS, y), edge motion vector (x+right, y+down).
  • right can be S or -S
  • down can be S or -S
  • the method of determining right and down is described in the subsequent embodiments.
  • the center motion vector (x, y) is taken as the center, that is, the center motion vector is (0, 0). Taking S as 1, right and down are both 1, then the center motion vector (0, 0)
  • the corresponding edge motion vector includes: edge motion vector (0, 1), edge motion vector (0, -1), edge motion vector (1, 0), edge motion vector (-1, 0), edge motion vector (1, 1).
  • Step a3 Obtain the first generation value corresponding to the center motion vector and the second generation value corresponding to each edge motion vector according to the first pixel value of the first reference block and the second pixel value of the second reference block.
  • the sub-reference block A1 corresponding to the center motion vector (0, 0) is copied from the first reference block, and the sub-reference block A1 is the sub-reference block of the center motion vector (0, 0) in the first reference block.
  • the size of the sub-reference block A1 is the size of the current block, and the sub-reference block A1 is the most central W*H block in the first reference block.
  • the sub-reference block B1 corresponding to the central motion vector (0, 0) is obtained by copying from the second reference block.
  • the sub-reference block B1 is the sub-reference block of the central motion vector (0, 0) in the second reference block.
  • the size of the sub-reference block B1 is the size of the current block, and the sub-reference block B1 is the most central W*H block in the second reference block.
  • the cost value 1 corresponding to the center motion vector (0, 0) is obtained by using the first pixel value of the sub-reference block A1 and the second pixel value of the sub-reference block B1. Refer to the subsequent embodiments for the method of determining the cost value.
  • the sub-reference block A2 corresponding to the edge motion vector (0, 1) is obtained by copying from the first reference block.
  • the sub-reference block A2 is the sub-reference block of the edge motion vector (0, 1) in the first reference block.
  • the size of the sub-reference block A2 is the size of the current block, and the sub-reference block A2 is a W*H block in the first reference block.
  • the sub-reference block B2 corresponding to the symmetric motion vector (0, -1) of the edge motion vector (0, 1) is copied from the second reference block, and the sub-reference block B2 is the symmetric motion vector (0, -1) in the second The sub-reference block in the reference block.
  • the size of the sub-reference block B2 is the size of the current block, which is a W*H block in the second reference block.
  • the cost value 2 corresponding to the edge motion vector (0, 1) is obtained by using the first pixel value of the sub-reference block A2 and the second pixel value of the sub-reference block B2. Refer to the subsequent embodiments for the method of determining the cost value.
  • the cost value 3 corresponding to the edge motion vector (0, -1) can be determined, the cost value corresponding to the edge motion vector (1, 0) 4, the edge The cost value of motion vector (-1, 0) is 5, and the cost value of edge motion vector (1, 1) is 6.
  • Step a4 According to the first-generation value and the second-generation value, a motion vector is selected from the center motion vector and the edge motion vector as the optimal motion vector. For example, the motion vector with the smallest cost value can be used as the optimal motion vector. For example, assuming that the cost value 2 corresponding to the edge motion vector (0, 1) is the smallest, the edge motion vector (0, 1) corresponding to the cost value 2 can be used as the optimal motion vector.
  • Step a5 Determine whether the end condition is met. If not, the optimal motion vector can be determined as the center motion vector and return to step a2. If yes, then step a6 can be performed.
  • the end condition is met; if the number of iterations/search range does not reach the threshold, the end condition is not met. For example, assuming that SR is 2, that is, the threshold is 2, that is, two iterations are allowed. If the number of iterations/search range has reached 2 times, that is, step a2-step a4 has been executed twice, the end condition is satisfied; otherwise, the end condition is not satisfied.
  • Step a6 Determine the first integer pixel motion vector adjustment value (used to adjust the first original motion vector) and the second integer pixel motion vector adjustment value (used to adjust the second original motion vector) according to the optimal motion vector.
  • the first integer pixel motion vector adjustment value may be determined according to the optimal motion vector and the first original motion vector
  • the second integer pixel motion vector adjustment value may be determined according to the first integer pixel motion vector adjustment value
  • the second integer pixel The motion vector adjustment value is symmetrical to the first integer pixel motion vector adjustment value.
  • the optimal motion vector is the edge motion vector (0, 1)
  • the second iteration takes the edge motion vector (0, 1) as the center.
  • the optimal motion vector is Edge motion vector (0, 1).
  • the first integer pixel motion vector adjustment value is (0, 2), that is, the edge motion vector (0, 1) and the edge motion vector (0, 1) with.
  • the optimal motion vector is the edge motion vector (0, 1), that is, the optimal motion vector can correspond to the optimal motion vector (4, 5).
  • the second iteration takes the edge motion vector (0, 1) as the center.
  • the optimal motion vector is the edge motion vector (0, 1), that is, the optimal motion vector can correspond to the optimal motion vector (4 , 6).
  • the first integer-pixel motion vector adjustment value is determined according to the optimal motion vector (4, 6) and the first original motion vector (4, 4), and the first integer-pixel motion vector adjustment value is the optimal motion vector ( The difference between 4, 6) and the first original motion vector (4, 4), that is, the adjustment value of the first integer-pixel motion vector is (0, 2).
  • the second integer pixel motion vector adjustment value is determined according to the first integer pixel motion vector adjustment value (0, 2).
  • the second integer pixel motion vector adjustment value can be (0, -2), that is, (0, 2) Symmetrical value.
  • Step a7 Determine the first sub-pixel motion vector adjustment value (used to adjust the first original motion vector) and the second sub-pixel motion vector adjustment value (used to adjust the second original motion vector) according to the optimal motion vector.
  • the first sub-pixel motion vector adjustment value may be determined according to the cost value corresponding to the optimal motion vector and the cost value corresponding to the edge motion vector corresponding to the optimal motion vector, and then, according to the first sub-pixel The motion vector adjustment value determines the second sub-pixel motion vector adjustment value.
  • x 0 N*(E(-1,0)–E(1,0))/(E(-1,0)+E(1,0)–2*E(0,0))
  • y 0 N*(E(0,-1)–E(0,1))/(E(0,-1)+E(0,1)–2*E(0,0))
  • N 1, 2, 4, and 8.
  • SPMV deltaMv/2N, if the current pixel accuracy of the motion vector is 1/16, then SPMV is (x 0 /16, y 0 /16).
  • SPMV is the first sub-pixel motion vector adjustment value
  • N is related to the pixel accuracy of the motion vector.
  • the pixel accuracy of the motion vector is 1/2
  • N is 1
  • the pixel accuracy of the motion vector is 1/4
  • N is 2.
  • the pixel precision of the motion vector is 1/8
  • N is 4
  • the pixel precision of the motion vector is 1/16
  • N is 8.
  • E(0,0) represents the cost value of the optimal motion vector
  • E(-1,0) is the edge motion vector of the optimal motion vector (0,0) centered on the optimal motion vector ( -1,0);
  • E(1,0) is the cost value of the edge motion vector (1,0) of the optimal motion vector (0,0) centered on the optimal motion vector;
  • E(0, -1) is centered on the optimal motion vector, and the cost value of the edge motion vector (0,-1) of the optimal motion vector (0,0);
  • E(0,1) is centered on the optimal motion vector,
  • the determination method can be referred to the foregoing embodiment, which will not be repeated here.
  • the second sub-pixel motion vector adjustment value can be determined according to the first sub-pixel motion vector adjustment value, and the second sub-pixel motion vector adjustment value is the first sub-pixel motion vector The symmetric value of the adjustment value. For example, if the first sub-pixel motion vector adjustment value is (1, 0), the second sub-pixel motion vector adjustment value is (-1, 0), that is, the symmetric value of (1, 0).
  • Step a8 Adjust the first original motion vector according to the first full-pixel motion vector adjustment value and/or the first sub-pixel motion vector adjustment value to obtain the first target motion vector.
  • the first target motion vector the first original motion vector+the first integer-pixel motion vector adjustment value+the first sub-pixel motion vector adjustment value.
  • the above is only an example, and there is no restriction on this.
  • Step a9 Adjust the second original motion vector according to the second integer-pixel motion vector adjustment value and/or the second sub-pixel motion vector adjustment value to obtain a second target motion vector.
  • the second target motion vector the second original motion vector+the second integer-pixel motion vector adjustment value+the second sub-pixel motion vector adjustment value.
  • the above is only an example, and there is no restriction on this.
  • Embodiment 12 In step 303 and step 403, for each sub-block of the current block, the first original motion vector is adjusted according to the first pixel value of the first reference block and the second pixel value of the second reference block to obtain The first target motion vector of the sub-block; according to the first pixel value of the first reference block and the second pixel value of the second reference block, the second original motion vector is adjusted to obtain the second target motion vector of the sub-block.
  • Step b1. Perform SR iterations to obtain the optimal integer pixel offset of the integer pixel MV point, and record it as IntegerDeltaMV, which is the first integer pixel motion vector adjustment value in the foregoing embodiment. For example, first initialize IntegerDeltaMV to (0, 0), and perform the following process for each iteration:
  • Step b11 Set deltaMV to (0, 0). If it is the first iteration, based on the reference pixels of the first original motion vector in the first reference block, copy the predicted value block A1 (that is, the W*H block in the center of the first reference block); based on the second original motion vector in the The reference pixels in the second reference block are copied to obtain the predicted value block B1 (that is, the W*H block in the center of the second reference block). Obtain the initial cost value cost based on the predicted value block A1 and the predicted value block B1 (the initial cost value is the SAD (sum of abstract distance) based on the predicted value block A1 and the predicted value block B1, see the subsequent embodiments for the determination method ). If the initial cost cost is less than 4*dx*dy/2, and dx and dy are the width and height of the current sub-block, skip the subsequent search process directly, execute step b2, and set notZeroCost to false.
  • Step b12 As shown in Figure 6, centering on the above initial point, follow ⁇ Mv(0,1),Mv(0,-1),Mv(1,0),Mv(-1,0),Mv( Right, down) ⁇ order to obtain five offset MVs (the five offset MVs are called MVOffset), and the cost value of these five offset MV calculation and comparison process.
  • MVOffset such as Mv(0,1), etc.
  • two blocks of predicted values are obtained through this MVOffset (such as the center position offset in the first reference block)
  • the W*H block of MVOffset and the W*H block with center position offset in the second reference block-MVOffset (the opposite of MVOffset) are calculated, and the down-sampled SAD of the two predicted value blocks is calculated as the proxy value of MVOffset.
  • Step b13 After iteration, if the optimal MV is still the initial MV (that is, not MVOffset) or the minimum cost is 0, then the next iteration search process is not performed, step b2 is executed, and notZeroCost is set to false. Otherwise, if the number of iterations reaches SR, step b2 is executed. If the number of iterations does not reach SR, the optimal MV is taken as the center to perform the next iteration search process, that is, return to step b11.
  • IntegerDeltaMV is obtained, that is, the final value of IntegerDeltaMV, which is the first integer pixel motion vector adjustment value, and is subsequently recorded as IntegerDeltaMV.
  • step b2 it is possible to obtain the optimal sub-pixel offset MV by taking the optimal integer pixel MV point of step b1 as the center, which is recorded as SPMV, and SPMV is the first sub-pixel motion vector adjustment value in the foregoing embodiment. For example, you can initialize SPMV to (0, 0) first, and then perform the following process:
  • Step b21 Only when notZeroCost is not false and deltaMV is (0, 0), can subsequent processing be performed (that is, SPMV needs to be obtained), otherwise, use IntegerDeltaMV to adjust the original motion vector directly, instead of using IntegerDeltaMV and SPMV to adjust the original motion vector. The motion vector is adjusted.
  • the value of SPMV that is, the first sub-pixel motion vector adjustment value can be obtained.
  • BestMVoffset IntegerDeltaMV+SPMV, that is, the sum of the first integer pixel motion vector adjustment value and the first sub-pixel motion vector adjustment value.
  • -IntegerDeltaMV is the symmetric value of IntegerDeltaMV, that is, the second integer pixel motion vector adjustment value
  • -SPMV is the symmetric value of SPMV, that is, the second sub-pixel motion vector adjustment value
  • -BestMVoffset (-IntegerDeltaMV)+(- SPMV), that is, the sum of the second full-pixel motion vector adjustment value and the second sub-pixel motion vector adjustment value.
  • Embodiment 13 For step 303 and step 403, in order to adjust the first original motion vector Org_MV0 and the second original motion vector Org_MV1 to the first target motion vector Refined_MV0 and the second target motion vector Refined_MV1, the implementation method is similar to that of the embodiment 12. The difference is:
  • step b12 Remove “If the initial cost is less than 4*dx*dy/2, skip the subsequent search process" in step b11, that is, even if the initial cost is less than 4*dx*dy/2, It will not "directly skip the subsequent search process", but continue the subsequent search process, that is, step b12 needs to be performed.
  • Embodiment 14 For step 303 and step 403, in order to adjust the first original motion vector Org_MV0 and the second original motion vector Org_MV1 to the first target motion vector Refined_MV0 and the second target motion vector Refined_MV1, the implementation method is similar to that of the embodiment 12. The difference is:
  • step b12 Remove “If the initial cost is less than 4*dx*dy/2, skip the subsequent search process" in step b11, that is, even if the initial cost is less than 4*dx*dy/2, It will not "directly skip the subsequent search process", but continue the subsequent search process, that is, step b12 needs to be performed.
  • step b13 Remove "If the optimal MV is still the initial MV (that is, not MVOffset) or the minimum cost is 0, then the next iteration of the search process" in step b13 is removed, that is, even if the optimal MV is still the initial MV Or the minimum cost is 0, and the next iterative search process can also be performed.
  • Embodiment 15 For step 303 and step 403, in order to adjust the first original motion vector Org_MV0 and the second original motion vector Org_MV1 to the first target motion vector Refined_MV0 and the second target motion vector Refined_MV1, the implementation method is similar to that of the embodiment 12. The difference is:
  • step b21 Remove the "notZeroCost" related process, that is, in step b11 and step b13, the value of notZeroCost is not set and saved.
  • step b21 as long as deltaMV is (0, 0), the sub-pixel offset calculation process (ie, step b22) can be performed, not only when notZeroCost is not false and deltaMV is (0, 0). Perform the sub-pixel offset calculation process.
  • Embodiment 16 For step 303 and step 403, in order to adjust the first original motion vector Org_MV0 and the second original motion vector Org_MV1 to the first target motion vector Refined_MV0 and the second target motion vector Refined_MV1, the implementation method is similar to that of the embodiment 12. The difference is:
  • step b21 "Only when notZeroCost is not false and deltaMV is (0, 0), can the subsequent processing be performed, otherwise, use IntegerDeltaMV to adjust the original motion vector", and amended to "Only notZeroCost is not false, and When the cost value of the four points separated by 1 full pixel from the top, bottom, left and right of the current optimal integer pixel has been calculated in step b1, subsequent processing is performed, otherwise, the original motion vector is directly adjusted by IntegerDeltaMV.”
  • “subsequent processing” refers to the sub-pixel offset calculation process in step b22.
  • the sub-pixel offset calculation process in step b22 needs to use the cost value of four points separated by 1 full pixel from the top, bottom, left, and right of the optimal integer pixel. Therefore, the "optimal integer pixel" has been calculated in step b1. "The cost value of four dots separated by 1 full pixel" is a necessary condition.
  • Embodiment 17 For step 303 and step 403, in order to adjust the first original motion vector Org_MV0 and the second original motion vector Org_MV1 to the first target motion vector Refined_MV0 and the second target motion vector Refined_MV1, the implementation method is similar to that of the embodiment 12. The difference is:
  • step b21 "Only when notZeroCost is not false and deltaMV is (0, 0), can subsequent processing be performed, otherwise, use IntegerDeltaMV to adjust the original motion vector", and modify it to "As long as the current optimal integer pixel
  • the subsequent processing that is, the sub-pixel offset calculation process
  • the original motion vector is directly adjusted by IntegerDeltaMV.
  • Embodiment 18 For step 303 and step 403, in order to adjust the first original motion vector Org_MV0 and the second original motion vector Org_MV1 to the first target motion vector Refined_MV0 and the second target motion vector Refined_MV1, the implementation method is similar to that of the embodiment 12. The difference is:
  • step b21 "Only when notZeroCost is not false and deltaMV is (0, 0), can subsequent processing be performed, otherwise, use IntegerDeltaMV to adjust the original motion vector", and modify it to "If the current optimal integer pixel When the cost value of the four points separated by 1 full pixel has been calculated in step b1, subsequent processing (the sub-pixel offset calculation process in step b22) is performed, otherwise, step b23 is used for processing".
  • Step b23 Set the current optimal integer pixel point MV_inter_org to the nearest one, and the cost value of the surrounding four points separated by 1 integer pixel from the top, bottom, left, and right has been calculated in step b1 to obtain the integer pixel point MV_inter_nearest. Then, the sub-pixel offset calculation process of step b22 is performed with MV_inter_nearest as the center, that is, SPMV is obtained with MV_inter_nearest as the center.
  • step b1 For example, if the current optimal integer pixel point MV_inter_org has four points separated by 1 full pixel from the top, bottom, left, and right, not all of them are calculated in step b1, then select an integer pixel point MV_inter_nearest from around the optimal integer pixel point MV_inter_org , And the cost values of the four points separated by 1 full pixel from the top, bottom, left, and right of the whole pixel point MV_inter_nearest have been calculated in step b1.
  • the whole pixel point MV_inter_nearest is taken as the current optimal whole pixel point, and the SPMV is obtained with the whole pixel point MV_inter_nearest as the center.
  • step b22 for the specific obtaining method.
  • Embodiment 19 In the above embodiment, it is necessary to determine the edge motion vector corresponding to the center motion vector, such as 5 edge motion vectors. For example, the center motion vector (x, y) can be shifted to different directions by S, and the edge motion vector (x, y+S), edge motion vector (x, yS), edge motion vector (x+ S, y), edge motion vector (xS, y), edge motion vector (x+right, y+down).
  • the center motion vector (x, y) can be shifted to different directions by S, and the edge motion vector (x, yS), edge motion vector (x, y+S), edge motion vector (xS, y), edge motion vector (x+S, y), edge motion vector (x+right, y+down).
  • Embodiment 20 In the above embodiment, the default value of the edge motion vector (x+right, y+down) is (x-S, y-S). If the cost value of the edge motion vector (x+S, y) is less than the cost value of the edge motion vector (xS, y), then right is S (modified from -S to S); if the edge motion vector (x, y+S) The cost value of) is less than the cost value of the edge motion vector (x, yS), then down is S (modified from -S to S).
  • the cost value of the edge motion vector (x+S, y) is less than or equal to the cost value of the edge motion vector (xS, y), then right is S (modified from -S to S); if the edge motion vector (x , Y+S) is less than or equal to the cost value of the edge motion vector (x, yS), then down is S (modified from -S to S).
  • edge motion vectors are obtained, (right, down)
  • the default value is (-1, -1). If the cost value of the edge motion vector (1,0) is less than the cost value of the edge motion vector (-1,0), then right is 1; if the cost value of the edge motion vector (0,1) is less than the cost value of the edge motion vector (0, The cost value of -1), then down is 1.
  • the cost value of the edge motion vector (1,0) is less than or equal to the cost value of the edge motion vector (-1,0), then right is 1; if the cost value of the edge motion vector (0,1) is less than or equal to The cost value of the edge motion vector (0, -1), then down is 1.
  • the cost value of the edge motion vector (1,0) is less than or equal to the cost value of the edge motion vector (-1,0), then right is 1; if the cost value of the edge motion vector (0,1) is less than or equal to The cost value of the edge motion vector (0, -1), then down is 1.
  • Embodiment 21 In step 303 and step 403, for each sub-block of the current block, the first original motion vector is adjusted according to the first pixel value of the first reference block and the second pixel value of the second reference block to obtain the sub-block The first target motion vector of the block; the second original motion vector is adjusted according to the first pixel value of the first reference block and the second pixel value of the second reference block to obtain the second target motion vector of the sub-block.
  • Step c1 with the first original motion vector or the second original motion vector as the center, select part or all of the motion vectors from the surrounding motion vectors, and use the selected motion vector as a candidate motion vector.
  • the first original motion vector as the center, and select part or all of the motion vectors from the surrounding motion vectors as candidate motion vectors.
  • this selection method refer to the subsequent embodiments.
  • the first original motion vector is taken as an example.
  • Step c2 Obtain the third-generation value corresponding to the first original motion vector and the fourth-generation value corresponding to each candidate motion vector according to the first pixel value of the first reference block and the second pixel value of the second reference block.
  • the sub-reference block A1 corresponding to the first original motion vector is copied from the first reference block.
  • the sub-reference block A1 is the sub-reference block of the first original motion vector in the first reference block
  • the size of the sub-reference block A1 is The size of the current block.
  • the sub-reference block B1 is the sub-reference block of the second original motion vector in the second reference block.
  • the size of the sub-reference block B1 is the current block. the size of.
  • the first pixel value of the sub-reference block A1 and the second pixel value of the sub-reference block B1 are used to obtain the third generation value corresponding to the first original motion vector.
  • Sub-reference block A2 is the sub-reference block of the candidate motion vector in the first reference block.
  • the size of the sub-reference block A2 Is the size of the current block.
  • the sub-reference block B2 corresponding to the symmetric motion vector of the candidate motion vector is copied from the second reference block.
  • the sub-reference block B2 is the sub-reference block of the symmetric motion vector in the second reference block.
  • the size of the sub-reference block B2 is the current block. the size of.
  • Step c3 According to the third-generation value and the fourth-generation value, a motion vector is selected from the first original motion vector and the candidate motion vector as the optimal motion vector. For example, the motion vector with the smallest cost value (such as the first original motion vector or any candidate motion vector) is used as the optimal motion vector.
  • Step c4 Determine the first integer pixel motion vector adjustment value (used to adjust the first original motion vector) and the second integer pixel motion vector adjustment value (used to adjust the second original motion vector) according to the optimal motion vector.
  • the first integer-pixel motion vector adjustment value may be determined according to the optimal motion vector and the first original motion vector
  • the second integer-pixel motion vector adjustment value may be determined according to the first integer-pixel motion vector adjustment value
  • the second integer The pixel motion vector adjustment value is symmetrical to the first integer pixel motion vector adjustment value.
  • the first integer pixel motion vector adjustment value is the difference between the optimal motion vector (4, 6) and the first original motion vector (4, 4), that is, the first integer pixel motion vector adjustment value (0, 2).
  • the second integer pixel motion vector adjustment value is determined according to the first integer pixel motion vector adjustment value (0, 2).
  • the second integer pixel motion vector adjustment value can be (0, -2), that is, (0, 2) Symmetrical value.
  • Step c5 Determine the first sub-pixel motion vector adjustment value (used to adjust the first original motion vector) and the second sub-pixel motion vector adjustment value (used to adjust the second original motion vector) according to the optimal motion vector.
  • the first sub-pixel motion vector adjustment value may be determined according to the cost value corresponding to the optimal motion vector and the cost value corresponding to the edge motion vector corresponding to the optimal motion vector, and then, according to the first sub-pixel The motion vector adjustment value determines the second sub-pixel motion vector adjustment value.
  • x 0 N*(E(-1,0)–E(1,0))/(E(-1,0)+E(1,0)–2*E(0,0))
  • y 0 N*(E(0,-1)–E(0,1))/(E(0,-1)+E(0,1)–2*E(0,0))
  • N 1, 2, 4, and 8.
  • SPMV deltaMv/2N, if the current pixel accuracy of the motion vector is 1/16, then SPMV is (x 0 /16, y 0 /16).
  • SPMV is the first sub-pixel motion vector adjustment value.
  • E(0,0) represents the cost value of the optimal motion vector;
  • E(-1,0) is the center of the optimal motion vector, and the edge motion vector (-1,0) of the optimal motion vector (0,0)
  • E(1,0) is the cost value of the edge motion vector (1,0) of the optimal motion vector (0,0) centered on the optimal motion vector;
  • E(0,-1) is The optimal motion vector is the center, and the cost value of the edge motion vector (0,-1) of the optimal motion vector (0,0);
  • E(0,1) is the center of the optimal motion vector, and the optimal motion vector ( The cost value of the edge motion vector (0,1) of 0,0).
  • For the cost value of each motion vector refer to the foregoing embodiment for the determination method.
  • the second sub-pixel motion vector adjustment value can be determined according to the first sub-pixel motion vector adjustment value, and the second sub-pixel motion vector adjustment value is the first sub-pixel motion vector The symmetric value of the adjustment value. For example, if the first sub-pixel motion vector adjustment value is (1, 0), the second sub-pixel motion vector adjustment value is (-1, 0), that is, the symmetric value of (1, 0).
  • Step c6 Adjust the first original motion vector according to the first full-pixel motion vector adjustment value and/or the first sub-pixel motion vector adjustment value to obtain the first target motion vector.
  • the first target motion vector the first original motion vector+the first integer-pixel motion vector adjustment value+the first sub-pixel motion vector adjustment value.
  • the above is only an example, and there is no restriction on this.
  • Step c7 Adjust the second original motion vector according to the second full-pixel motion vector adjustment value and/or the second sub-pixel motion vector adjustment value to obtain a second target motion vector.
  • the second target motion vector the second original motion vector+the second integer-pixel motion vector adjustment value+the second sub-pixel motion vector adjustment value.
  • the above is only an example, and there is no restriction on this.
  • Embodiment 22 In step 303 and step 403, for each sub-block of the current block, the first original motion vector is adjusted according to the first pixel value of the first reference block and the second pixel value of the second reference block to obtain the sub-block The first target motion vector of the block; the second original motion vector is adjusted according to the first pixel value of the first reference block and the second pixel value of the second reference block to obtain the second target motion vector of the sub-block.
  • step d1 there is no need to perform an iterative process, that is, all candidate motion vectors to be processed can be selected at one time, instead of the iterative process, the first iteration selects some motion vectors, and the second Partial motion vectors are selected for the second iteration. Based on this, since all candidate motion vectors to be processed are selected at one time, these candidate motion vectors can be processed in parallel to obtain the cost value of each candidate motion vector, thereby reducing computational complexity and improving coding performance.
  • Step d2 Determine the value of IntegerDeltaMV according to the optimal motion vector.
  • the final value of IntegerDeltaMV is the first integer pixel motion vector adjustment value, and the determination method will not be repeated.
  • Step d3 Obtain the optimal sub-pixel offset MV with the optimal motion vector as the center, and record it as SPMV, and the value of SPMV is the first sub-pixel motion vector adjustment value.
  • step d3 For the implementation process of step d3, refer to the above step b2, which will not be repeated here.
  • Embodiment 23 For step 303 and step 403, in order to adjust the first original motion vector Org_MV0 and the second original motion vector Org_MV1 to the first target motion vector Refined_MV0 and the second target motion vector Refined_MV1, the implementation method is the same as that of embodiment 21. Example 22 is similar.
  • Embodiment 24 For step 303 and step 403, in order to adjust the first original motion vector Org_MV0 and the second original motion vector Org_MV1 to the first target motion vector Refined_MV0 and the second target motion vector Refined_MV1, the implementation method is the same as that of embodiment 21.
  • Implementation Example 22 is similar.
  • this embodiment since all candidate motion vectors to be processed are selected at one time, these candidate motion vectors can be processed in parallel to obtain the cost value of each candidate motion vector, thereby reducing computational complexity and improving coding performance.
  • the sequence of these candidate points can be: ⁇ Mv(-2,-2), Mv(-1,-2), Mv(0,-2), Mv(1,-2), Mv (2,-2), Mv(-2,-1), Mv(-1,-1), Mv(0,-1), Mv(1,-1), Mv(2,-1), Mv (-2,0), Mv(-1,0), Mv(0,0), Mv(1,0), Mv(2,0), Mv(-2,1), Mv(-1,1 ), Mv(0,1), Mv(1,1), Mv(2,1), Mv(-2,2), Mv(-1,2), Mv(0,2), Mv(1, 2), Mv(2,2) ⁇ .
  • the optimal offset MV can be used to determine the adjustment value and score of the entire pixel motion vector. For the determination method of the pixel motion vector adjustment value, refer to the foregoing embodiment.
  • the order of these candidate points is: ⁇ Mv(-1,-2), Mv(0,-2), Mv(1,-2), Mv(-2,-1), Mv( -1,-1), Mv(0,-1), Mv(1,-1), Mv(2,-1), Mv(-2,0), Mv(-1,0), Mv(0 ,0), Mv(1,0), Mv(2,0), Mv(-2,1), Mv(-1,1), Mv(0,1), Mv(1,1), Mv( 2,1), Mv(-1,2), Mv(0,2), Mv(1,2) ⁇ .
  • the optimal offset MV can be used to determine the adjustment value and score of the entire pixel motion vector. For the determination method of the pixel motion vector adjustment value, refer to the foregoing embodiment.
  • the number of candidate points may be 25.
  • the motion vector (0, 0) is used as the center, and the distance from the center is in the order from near to far.
  • the order of these candidate points can be: ⁇ Mv(0,0), Mv(-1,0), Mv(0,-1), Mv(1,0), Mv(0,1 ), Mv(-1,1), Mv(-1,-1), Mv(1,-1), Mv(1,1), Mv(0,2), Mv(-2,0), Mv (0,-2), Mv(2,0), Mv(1,2), Mv(-1,2), Mv(-2,1), Mv(-2,-1), Mv(-1 ,-2), Mv(1,-2), Mv(2,-1), Mv(2,1), Mv(2,1), Mv(-2,2), Mv(-2,-2), Mv(2,- 2), Mv(2,2) ⁇ .
  • the optimal offset MV can be used to determine the adjustment value and score of the entire pixel motion vector. For the determination method of the pixel motion vector adjustment value, refer to the foregoing embodiment.
  • the number of candidate points may be 21.
  • the motion vector (0, 0) is taken as the center, and the order from near to far from the center is adopted.
  • the order of these candidate points is: ⁇ Mv(0,0), Mv(-1,0), Mv(0,-1), Mv(1,0), Mv(0,1) , Mv(-1,1), Mv(-1,-1), Mv(1,-1), Mv(1,1), Mv(0,2), Mv(-2,0), Mv( 0,-2), Mv(2,0), Mv(1,2), Mv(-1,2), Mv(-2,1), Mv(-2,-1), Mv(-1, -2), Mv(1,-2), Mv(2,-1), Mv(2,1) ⁇ .
  • the optimal offset MV can be used to determine the adjustment value and score of the entire pixel motion vector. For the determination method of the pixel motion vector adjustment value, refer to the foregoing embodiment.
  • the motion vector (0, 0) is used as the center, and the order from near to far from the center is adopted.
  • the order of these candidate points is: ⁇ Mv(0,0), Mv(-1,0), Mv(0,-1), Mv(1,0), Mv(0,1) , Mv(-1,1), Mv(-1,-1), Mv(1,-1), Mv(1,1), Mv(0,2), Mv(-2,0), Mv( 0,-2), Mv(2,0) ⁇ .
  • the optimal offset MV can be used to determine the adjustment value and score of the entire pixel motion vector. For the determination method of the pixel motion vector adjustment value, refer to the foregoing embodiment.
  • Embodiment 25 For step 303 and step 403, in order to adjust the first original motion vector Org_MV0 and the second original motion vector Org_MV1 to the first target motion vector Refined_MV0 and the second target motion vector Refined_MV1, the implementation method is the same as that of embodiment 21.
  • Implementation Example 22 is similar.
  • this embodiment since all candidate motion vectors to be processed are selected at one time, these candidate motion vectors can be processed in parallel to obtain the cost value of each candidate motion vector, thereby reducing computational complexity and improving coding performance.
  • Embodiment 25 The difference between Embodiment 25 and Embodiment 24 is that the positions of candidate points in Embodiment 24 are fixed, that is, have nothing to do with the original motion vector, while the positions of candidate points in Embodiment 25 are related to the original motion vector. A specific example will be described.
  • the motion vector (0, 0) is used as the center, and the distance from the center is in the order from near to far.
  • the order of the candidate points in the first layer from the center has nothing to do with the size of the original motion vector, while the order of the candidate points in the second layer from the center is related to the size of the original motion vector.
  • the order of these candidate points is: ⁇ Mv(0,0), Mv(-1,0), Mv(0,-1), Mv(1,0), Mv(0,1), Mv(-1, 1), Mv(-1,-1), Mv(1,-1), Mv(1,1), Mv(sign_H*2,0), Mv(sign_H*2,sign_V*1), Mv(0 ,sign_V*2), Mv(0,sign_V*2) ⁇ .
  • the optimal offset MV can be used to determine the adjustment value and score of the entire pixel motion vector. For the determination method of the pixel motion vector adjustment value, refer to the foregoing embodiment.
  • the motion vector (0, 0) is used as the center, and the distance from the center is in the order from near to far.
  • the order has nothing to do with the size of the original motion vector
  • the order of these candidate points is: ⁇ Mv( 0,0), Mv(-1,0), Mv(0,-1), Mv(1,0), Mv(0,1), Mv(-1,1), Mv(-1,-1 ), Mv(1,-1), Mv(1,1), Mv(sign_H*2,0), Mv(sign_H*2,sign_V*1), Mv(0,sign_V*2), Mv(0, sign_V*2) ⁇ .
  • the optimal offset MV can be used to determine the adjustment value and score of the entire pixel motion vector. For the determination method of the pixel motion vector adjustment value, refer to the foregoing embodiment.
  • Embodiment 26 In the above embodiment, according to the first pixel value of the first reference block and the second pixel value of the second reference block, the first generation value corresponding to the center motion vector and the second generation value corresponding to the edge motion vector are obtained value. According to the first pixel value of the first reference block and the second pixel value of the second reference block, the third generation value corresponding to the first original motion vector and the fourth generation value corresponding to the candidate motion vector are obtained.
  • the first generation value corresponding to the center motion vector, the second generation value corresponding to the edge motion vector, and the first original motion can be obtained according to the first pixel value that is not downsampled and the second pixel value that is not downsampled.
  • the third-generation value corresponding to the vector and the fourth-generation value corresponding to the candidate motion vector can be obtained according to the first pixel value that is not downsampled and the second pixel value that is not downsampled.
  • the first pixel value can be down-sampled, and the second pixel value can be down-sampled; then, the center is obtained based on the down-sampled first pixel value and the down-sampled second pixel value.
  • the first pixel value can be shifted and down-sampled, and the second pixel value can be shifted and down-sampled; then, according to the operated first pixel value and the operated second pixel Value, the first generation value corresponding to the center motion vector, the second generation value corresponding to the edge motion vector, the third generation value corresponding to the first original motion vector, and the fourth generation value corresponding to the candidate motion vector are obtained.
  • the way to determine the cost value is similar.
  • the sub-reference block A1 corresponding to the central motion vector can be copied from the first reference block, and the sub-reference corresponding to the symmetrical motion vector of the central motion vector can be copied from the second reference block.
  • Block B1 uses the first pixel value of the sub-reference block A1 and the second pixel value of the sub-reference block B1 to obtain the cost value corresponding to the center motion vector.
  • the sub-reference block A2 corresponding to the edge motion vector can be copied from the first reference block, and the sub-reference block B2 corresponding to the symmetric motion vector of the edge motion vector can be copied from the second reference block.
  • the first pixel value of the sub-reference block A2 and the second pixel value of the sub-reference block B2 can be copied from the cost value corresponding to the edge motion vector, and so on.
  • the sub-reference block corresponding to the motion vector is obtained from the first reference block, and the sub-reference block corresponding to the symmetrical motion vector of the motion vector is obtained from the second reference block. Then use the pixel values of the two sub-reference blocks to obtain the cost value corresponding to the motion vector.
  • Embodiment 27 On the basis of Embodiment 26, according to the undownsampled first pixel value (that is, the undownsampled pixel value of the sub-reference block in the first reference block) and the undownsampled second pixel value ( That is, the un-downsampled pixel values of the sub-reference block in the second reference block), and the cost value corresponding to the motion vector is obtained.
  • the undownsampled first pixel value that is, the undownsampled pixel value of the sub-reference block in the first reference block
  • the undownsampled second pixel value That is, the un-downsampled pixel values of the sub-reference block in the second reference block
  • the sub-reference block in the first reference block is pred 0
  • the sub-reference block in the second reference block is pred 1
  • the SAD of all pixel values of the sub-reference block pred 0 and sub-reference block pred 1 To determine the cost value, there is no need to vertically downsample the pixels of the sub-reference block pred 0 and sub-reference block pred 1 .
  • the cost value calculation formula is:
  • cost represents the cost value
  • W is the width value of the sub-reference block
  • H is the height value of the sub-reference block
  • pred 0 (i, j) represents the pixel in the i-th column and j-th row of the sub-reference block pred 0 Value
  • pred 1 (i, j) represents the pixel value of the i-th column and j-th row of the sub-reference block pred 1
  • abs(x) represents the absolute value of x.
  • Embodiment 28 On the basis of Embodiment 26, the first pixel value can be down-sampled, and the second pixel value can be down-sampled; it can be based on the down-sampled first pixel value (that is, in the first reference block). The down-sampled pixel value of the sub-reference block) and the down-sampled second pixel value (that is, the down-sampled pixel value of the sub-reference block in the second reference block) to obtain the cost value corresponding to the motion vector.
  • the sub-reference block in the first reference block is pred 0
  • the sub-reference block in the second reference block is pred 1
  • the SAD of all pixel values of the sub-reference block pred 0 and sub-reference block pred 1 Determine the cost value.
  • the pixel values of the sub-reference block pred 0 and the sub-reference block pred 1 are vertically down-sampled by N times (N is an integer greater than 0, and may be 2).
  • the cost value calculation formula is:
  • cost represents the cost value
  • W is the width value of the sub-reference block
  • H is the height value of the sub-reference block
  • N is the down-sampling parameter, which is an integer greater than 0, which can be 2
  • pred 0 (1+ N(i-1), j) represents the pixel value of the jth row in the 1+N(i-1) column of the sub-reference block pred 0
  • pred 1 (1+N(i-1), j) represents the sub-reference
  • abs(x) represents the absolute value of x.
  • Embodiment 29 On the basis of Embodiment 26, the first pixel value is shifted and down-sampled, and the second pixel value is shifted and down-sampled; according to the operated first pixel value (first reference Shift and downsampled pixel values of the sub-reference block in the block) and the second pixel value after operation (shifted and down-sampled pixel value of the sub-reference block in the second reference block) to obtain the motion vector The corresponding cost value.
  • pred 0 the sub-reference block in the first reference block
  • pred 1 the sub-reference block in the second reference block
  • D-bit storage that is, pred 0
  • Each pixel value of is stored in D bits
  • each pixel value in pred 1 is stored in D bits.
  • the cost value is determined based on the SAD of all pixel values of the sub-reference block pred 0 and sub-reference block pred 1 .
  • the pixel values of the sub-reference block pred 0 and the sub-reference block pred 1 are vertically down-sampled by N times (N is an integer greater than 0, and may be 2). Based on all pixel values of sub-reference block pred 0 and sub-reference block pred 1 , the cost value calculation formula is:
  • cost represents the cost value
  • W is the width value of the sub-reference block
  • H is the height value of the sub-reference block
  • N is the down-sampling parameter, which is an integer greater than 0, which can be 2
  • pred 0 (1+ N(i-1), j) represents the pixel value of the jth row in the 1+N(i-1) column of the sub-reference block pred 0
  • pred 1 (1+N(i-1), j) represents the sub-reference
  • abs(x) represents the absolute value of x, it can be seen from the above that only the first row and the N+1th row are calculated, The sum of the absolute values of the difference in line 2N+1.
  • D is greater than 8
  • the cost value calculation formula can be:
  • Embodiment 30 In step 304 and step 404, for each sub-block of the current block, motion compensation is performed on the sub-block according to the first target motion vector of the sub-block and the second target motion vector of the sub-block. Specifically, the third reference block corresponding to the sub-block is determined according to the first target motion vector of the sub-block, and the fourth reference block corresponding to the sub-block is determined according to the second target motion vector of the sub-block. Weighting is performed according to the third pixel value of the third reference block and the fourth pixel value of the fourth reference block to obtain the predicted value of the sub-block.
  • the reference blocks in two directions are obtained through interpolation (such as 8-tap interpolation), including the predicted values of the three components, due to the target motion
  • the vector may be sub-pixel, so interpolation is required). Weighting is performed according to the third pixel value of the third reference block and the fourth pixel value of the fourth reference block to obtain the final predicted value (three components).
  • the fifth reference block corresponding to the sub-block can be determined from the first reference frame based on the first target motion vector of the sub-block, and the pixel values in the fifth reference block can be interpolated to obtain the third reference Piece.
  • the sixth reference block corresponding to the sub-block may be determined from the second reference frame based on the second target motion vector of the sub-block, and pixel values in the sixth reference block may be interpolated to obtain the fourth reference block.
  • a fifth reference block of size A*B can be determined from the first reference frame based on the first target motion vector.
  • the size of the fifth reference block is A*B and the interpolation method Related, A is greater than W, B is greater than H, there is no restriction on this.
  • a sixth reference block with a size of A*B may be determined from the second reference frame based on the second target motion vector.
  • the size of the sixth reference block A*B is related to the interpolation mode, A is greater than W, and B is greater than H.
  • the seventh reference block corresponding to the sub-block is determined from the first reference frame, the pixel values in the seventh reference block are used to construct the eighth reference block, and the The pixel values in the eighth reference block are interpolated to obtain the third reference block.
  • determine the ninth reference block corresponding to the sub-block from the second reference frame use the pixel values in the ninth reference block to construct the tenth reference block, and compare the values in the tenth reference block The pixel values are interpolated to obtain the fourth reference block.
  • a seventh reference block of size W*H may be determined from the first reference frame based on the first target motion vector.
  • the eighth reference block whose size is A*B is constructed based on the pixel values in the seventh reference block, and there is no restriction on the construction method.
  • the size A*B of the eighth reference block is related to the interpolation mode, A is greater than W, and B is greater than H, and there is no restriction on this.
  • a ninth reference block with a size of W*H may be determined from the second reference frame based on the second target motion vector.
  • the tenth reference block whose size is A*B is constructed based on the pixel values in the ninth reference block, and there is no restriction on the construction method.
  • the size A*B of the tenth reference block is related to the interpolation mode, A is greater than W, B is greater than H, and there is no restriction on this.
  • Embodiment 31 After obtaining the target motion vector, based on the target motion vector of each sub-block, the predicted value in two directions (ie, the three components of YUV, that is the predicted value of the third reference block and the The predicted value of the fourth reference block), and weighted to obtain the final predicted value.
  • the black area and the white area are pixel values obtained from the reference frame.
  • the pixel values of the gray area do not need to be obtained from the reference frame, but can be obtained by copying adjacent pixel values.
  • the W+FS-1 pixel values of the first row of the white area can be copied to the pixel values of the previous SR row of the gray area. Copy the W+FS-1 pixel values of the last row of the white area to the pixel values of the last SR row of the gray area. Then, the H+FS-1 pixel values of the first column of the white area and the pixel values of the upper and lower SR obtained gray areas can be copied to the pixel values of the first SR column of the gray area. Copy the H+FS-1 pixel values of the last column of the white area and the pixel values of the upper and lower SR obtained gray areas to the pixel value of the last SR column of the gray area.
  • the H+FS-1 pixel values of the first column of the white area can be copied to the pixel values of the first SR column of the gray area. Copy the H+FS-1 pixel value of the last column of the white area to the pixel value of the last SR column of the gray area. Then, the W+FS-1 pixel values of the first row of the white area and the obtained pixel values of the gray area on the left and right SR are copied to the pixel values of the previous SR row of the gray area. Copy the W+FS-1 pixel values of the last row of the white area and the obtained pixel values of the left and right SR gray areas to the pixel value of the last SR row of the gray area.
  • Embodiment 32 After obtaining the target motion vector, based on the target motion vector of each sub-block, the predicted values in two directions (ie three components of YUV, namely the predicted value of the third reference block and the first Four reference block prediction values), and weighted to obtain the final prediction value.
  • the black area and white area are pixel values obtained from the reference frame.
  • the pixel values of the gray area are directly copied from the corresponding area of the reference frame instead of being obtained by copying adjacent pixel values. This method is simple and may have better performance, but it increases the amount of access data to the reference frame.
  • Embodiment 33 After obtaining the target motion vector, based on the target motion vector of each sub-block, the predicted value in two directions (ie YUV three) is obtained through a bilinear interpolation filter (here no longer an 8-tap interpolation filter). Components, namely the predicted value of the third reference block and the predicted value of the fourth reference block), and weighted to obtain the final predicted value.
  • the black area and the white area may be pixel values obtained from a reference frame. Since the number of taps is relatively small, the pixel value of the gray area is not required.
  • Embodiment 34 In Embodiment 30 to Embodiment 33, after obtaining the predicted values in the two directions, the final predicted value is obtained by means of weighted average (that is, the weights of the predicted values in the two directions are the same). Or, after obtaining the predicted values in the two directions, the final predicted value is obtained by weighted average, and the weights of the two predicted values may be different. For example, the weight ratio of the two predicted values can be 1:2, 1:3, 2:1, etc.
  • the weight table can include 1:2, 1:3, 2:1 and other weight ratios.
  • the encoding end can determine the cost value of each weight ratio and determine the weight ratio with the smallest cost value. In this way, The encoding end can obtain the final predicted value through weighted average based on the weight ratio with the smallest cost value.
  • the encoded bit stream carries the index value of the weight ratio in the weight table.
  • the decoding end obtains the weight ratio corresponding to the index value from the weight table by analyzing the index value of the encoded bit stream, and obtains the final predicted value through weighted average based on the weight ratio.
  • the weight table may include but is not limited to ⁇ -2, 3, 4, 5, 10 ⁇ .
  • the weight “3” means that the weight ratio is 3:5.
  • the weight "5" means that the weight ratio is 5:3.
  • the weight "4" indicates that the weight ratio is 4:4, that is, the weight "4" indicates the same weight.
  • Embodiment 35 In step 305 and step 405, the first target motion vector and the second target motion vector of each sub-block of the current block need to be saved, and the first target motion vector and the second target motion vector are used for encoding/ Decoding reference.
  • the first target motion vector and the second target motion vector are used for loop filtering of the current frame; the first target motion vector and the second target motion vector are used for time-domain reference of subsequent frames; and/or, the first target motion The vector and the second target motion vector are used for spatial reference of the current frame.
  • the first target motion vector and the second target motion vector of each sub-block of the current block can be used for motion compensation of the current block, and can also be used for time-domain reference of subsequent frames.
  • the first target motion vector and the second target motion vector of each sub-block of the current block can be used for the motion compensation of the current block, can also be used for the loop filtering process of the current block, and can also be used for the subsequent frame Time domain reference.
  • the first target motion vector and the second target motion vector of each sub-block of the current block can be used for the motion compensation of the current block, can also be used for the loop filtering process of the current block, and can also be used for the subsequent frame
  • the time domain reference can also be used for the spatial reference of the current frame, which is described below.
  • the first target motion vector and the second target motion vector of each sub-block of the current block may be used for spatial reference of blocks in certain LCU (Largest Coding Unit) in the spatial domain. Since the coding and decoding order is from top to bottom and from left to right, the motion vector of the current block can be referenced by other blocks in the current LCU, and can also be referenced by blocks in subsequent adjacent LCUs. Since the obtained target motion vector requires a large amount of calculation, if the subsequent block refers to the target motion vector of the current block, it will take a long time to wait. In order to avoid the time delay caused by excessive waiting, only a few spatial neighboring blocks are allowed to refer to the target motion vector of the current block, and other blocks refer to the original motion vector of the current block.
  • LCU Large Coding Unit
  • these few blocks include the sub-blocks in the lower LCU and the lower right LCU located on the lower side of the current LCU, while the sub-blocks located in the right LCU and the lower left LCU cannot refer to the current block.
  • Target motion vector As shown in Figure 8, these few blocks include the sub-blocks in the lower LCU and the lower right LCU located on the lower side of the current LCU, while the sub-blocks located in the right LCU and the lower left LCU cannot refer to the current block.
  • Target motion vector As shown in Figure 8, these few blocks include the sub-blocks in the lower LCU and the lower right LCU located on the lower side of the current LCU, while the sub-blocks located in the right LCU and the lower left LCU cannot refer to the current block.
  • Target motion vector As shown in Figure 8, these few blocks include the sub-blocks in the lower LCU and the lower right LCU located on the lower side of the current LCU, while the sub-blocks located in the right LCU and the lower left LCU cannot refer to the current block.
  • Embodiment 36 The following describes the adjustment process of the motion vector with a specific example.
  • the specific steps of the motion vector adjustment can be as follows.
  • the "copy” below shows that it can be obtained without interpolation. If the MV is an integer pixel offset, it can be directly copied from the reference frame, otherwise it needs to be obtained by interpolation.
  • Step e1 If the current block adopts merge or skip mode, execute the following process.
  • Step e2 Prepare reference pixel values (assuming that the width of the current block is W and the height is H).
  • Step e3 Based on the original motion vector (the original motion vector of list0 is recorded as Org_MV0, the original motion vector of list1 is recorded as Org_MV1), copy two blocks at the corresponding position of the corresponding reference frame as (W+FS -1)*(H+FS-1) an entire pixel block of three components.
  • Step e4 On the basis of the whole pixel block of (W+FS-1)*(H+FS-1) above, add (W+FS-1)*(H+FS-1)
  • the whole pixel block of the three components of) is expanded by SR rows/columns up, down, left and right, and the area is (W+FS-1+2*SR)*(H+FS-1+2*SR) after expansion
  • the whole pixel blocks of the three components are denoted as Pred_Inter0 and Pred_Inter1, as shown in Fig. 5.
  • Pred_Bilinear0 and Pred_Bilinear1 are initial reference prediction values (denoted as Pred_Bilinear0 and Pred_Bilinear1) with the size of (W+2*SR)*(H+2*SR) through bilinear interpolation, FS is the number of filter taps, the default is 8, SR Is the search range, that is, the maximum horizontal/vertical component interpolation between the target motion vector and the original motion vector. The default is 2.
  • Pred_Bilinear0/1 is used in step e3.
  • Step e3 For each dx*dy sub-block (a whole block of 16*16 or smaller) of the current block, a target motion vector is obtained (the two target motion vectors are respectively denoted as Refined_MV0 and Refined_MV1).
  • Step e31 perform SR iterations to obtain the optimal integer pixel offset of the entire pixel MV point, which is recorded as IntegerDeltaMV, initialize IntegerDeltaMV to (0, 0), and perform the following process for each iteration:
  • Step e311 set deltaMV to (0, 0). If it is the first iteration process, based on the original motion vector in the reference pixel Pred_Bilinear0/1, copy two blocks of predicted value (in fact, the most central W*H block of Pred_Bilinear0/1), based on these two predicted value blocks, Obtain the initial cost value, that is, the SAD after the vertical 2 times downsampling of the predicted value blocks in the two directions.
  • step e32 If the initial cost value is less than 4*dx*dy/2, and dx and dy are the width and height of the current sub-block, skip the subsequent search process directly, execute step e32, and set notZeroCost to false.
  • Step e312 as shown in Fig. 6, centered on the above initial point, according to ⁇ Mv(0,1),Mv(0,-1),Mv(1,0),Mv(-1,0),Mv( Right, down) ⁇ order to obtain five offset MVs (the five offset MVs are called MVOffset), and the cost value of these five offset MV calculation and comparison process.
  • MVOffset in the reference pixel Pred_Bilinear0/1, two blocks of predicted values are obtained through MVOffset (in fact, they are the W*H block with the center position offset MVOffset in Pred_Bilinear0, and the center position offset in Pred_Bilinear1- MVOffset (as opposed to the W*H block of list0), calculate the down-sampled SAD of these two blocks as the cost value of MVOffset.
  • the MVOffset (stored in deltaMV) with the smallest cost value is retained as the new center offset point for the next iteration.
  • Mv(right,down) The default value of Mv(right,down) is (-1,-1). If the cost value of Mv(1,0) is less than the cost value of Mv(-1,0), right is 1; if Mv(0,1) The cost value of) is less than the cost value of Mv(0,-1), and down is 1.
  • Step e313 After iteration, if the optimal MV is still the initial MV or the minimum cost is 0, then the next iteration of the search process is not performed, step e32 is executed, and notZeroCost is set to false. Otherwise, if the number of iterations reaches SR, step e32 is executed, and if the number of iterations does not reach SR, the optimal MV is taken as the center to perform the next iteration search process, that is, return to step e311 above.
  • step e32 it is possible to obtain the optimal sub-pixel offset MV with the optimal integer pixel MV point in step e31 as the center, which is recorded as SPMV, initialize SPMV to (0, 0), and then perform the following process:
  • Step e321 Only when notZeroCost is not false and deltaMV is (0, 0), the subsequent processing is performed; otherwise, the original motion vector is directly adjusted by IntegerDeltaMV.
  • Step e4 Based on the target motion vector of each sub-block, perform 8-tap interpolation to obtain predicted values in two directions, and weight to obtain the final predicted values (three components). For example, based on the target motion vectors Refined_MV0 and Refined_MV1 of each sub-block, in Pred_Inter0/1 prepared in step e2, the corresponding prediction block is obtained through interpolation (the motion vector may be sub-pixel, and interpolation is required to obtain the corresponding pixel block).
  • Step e5 The target motion vector is used for motion compensation of the current block and time domain reference for subsequent frames.
  • Embodiment 37 The above embodiments can be implemented separately or in any combination.
  • Embodiment 13 can be implemented separately
  • Embodiment 15 can be implemented separately
  • Embodiment 24 can be implemented separately
  • Embodiment 29 can be implemented separately.
  • Embodiment 13 and embodiment 15 are combined to realize
  • embodiment 13 and embodiment 24 are combined to realize
  • embodiment 13 and embodiment 29 are combined to realize
  • embodiment 15 and embodiment 24 are combined to realize
  • embodiment 15 and embodiment 29 are combined to realize
  • Embodiment 24 and embodiment 29 are combined to realize, embodiment 13, embodiment 15 and embodiment 24 are combined to realize, embodiment 13, embodiment 15 and embodiment 29 are combined to realize, and embodiment 15, embodiment 24 and embodiment 29 are combined.
  • an embodiment of the application also proposes an encoding and decoding device applied to the encoding end or the decoding end.
  • FIG. 9 it is a structural diagram of the device, and the device includes:
  • the determining module 91 is configured to determine the first reference block corresponding to the current block according to the first original motion vector of the current block if the characteristic information of the current block meets a specific condition, and according to the second original motion of the current block The vector determines the second reference block corresponding to the current block;
  • the processing module 92 is configured to calculate the first original motion vector according to the first pixel value of the first reference block and the second pixel value of the second reference block And the second original motion vector are adjusted to obtain the first target motion vector corresponding to the first original motion vector and the second target motion vector corresponding to the second original motion vector;
  • the encoding and decoding module 93 is configured to obtain The first target motion vector and the second target motion vector encode or decode the current block.
  • the characteristic information includes one or more of the following: a motion information prediction mode corresponding to the current block; a motion information attribute corresponding to the current block; and size information of the current block.
  • the determining module 91 is further configured to: if the motion information prediction mode corresponding to the current block is the normal fusion mode, determine the motion information prediction mode corresponding to the current block The motion information prediction mode satisfies a specific condition; or, if the motion information prediction mode corresponding to the current block is a fusion mode that is used to jointly generate a new prediction value from the inter-frame prediction value and the intra-frame prediction value, it is determined that the current block corresponds to the The motion information prediction mode satisfies certain conditions.
  • the determining module 91 is further configured to: if the motion information attribute corresponding to the current block is that the motion information of the current block includes motion in two different directions Information, it is determined that the motion information attribute corresponding to the current block satisfies a specific condition; or, if the motion information attribute corresponding to the current block is that the motion information of the current block includes motion information in two different directions, the two If the distance between the two reference frames corresponding to the motion information in different directions and the current frame is the same, it is determined that the motion information attribute corresponding to the current block meets a specific condition; or, if the motion information attribute corresponding to the current block is the current block Multiplexing the motion information of surrounding blocks to determine that the motion information attribute corresponding to the current block satisfies a specific condition; or, if the motion information attribute corresponding to the current block is that the motion information of each sub-block of the current block is the same, then It is determined that the motion information attribute corresponding to the current block
  • the determining module 91 is further configured to: If the width value of the current block is within the range of the first interval [first threshold, second threshold], it is determined that the size information of the current block meets certain conditions; or, if the height value of the current block is within the second interval [ Within the range of the third threshold and the fourth threshold], it is determined that the size information of the current block satisfies a specific condition; or, if the area obtained according to the width value and height value of the current block is in the third interval [fifth threshold , Within the range of the sixth threshold], it is determined that the size information of the current block meets a specific condition; or, if the width value is within the range of the first interval [first threshold, second threshold], the height value If the area is within the range of the second interval [the third threshold, the fourth threshold] and the area is within the range of the third interval [the fifth threshold, the
  • the determining module 91 determines the first reference block corresponding to the current block according to the first original motion vector of the current block, and determines the second reference block corresponding to the current block according to the second original motion vector of the current block
  • the time is specifically used to: determine the first reference block corresponding to the current block from the first reference frame based on the first original motion vector of the current block; Determine the second reference block corresponding to the current block in the reference frame; wherein, the first pixel value of each pixel in the first reference block is determined by comparing the pixels of adjacent pixels in the first reference block Value is obtained by interpolation, or by copying the pixel value of adjacent pixels in the first reference block; the second pixel value of each pixel in the second reference block is obtained by comparing the second The pixel values of adjacent pixels in the reference block are obtained by interpolation, or obtained by copying the pixel values of adjacent pixels in the second reference block.
  • the processing module 92 adjusts the first original motion vector and the second original motion vector according to the first pixel value of the first reference block and the second pixel value of the second reference block to obtain the first
  • the first target motion vector corresponding to the original motion vector and the second target motion vector corresponding to the second original motion vector are specifically used for:
  • the current block includes at least one sub-block, for each sub-block of the current block, according to the first pixel value and the second pixel value, the first original motion vector and the second The original motion vector is adjusted to obtain the first target motion vector and the second target motion vector of the sub-block.
  • the first integer pixel motion vector adjustment value and the second integer pixel motion vector adjustment value of the sub-block may be determined, and/or the sub-block The first sub-pixel motion vector adjustment value and the second sub-pixel motion vector adjustment value; according to the first integer-pixel motion vector adjustment value and/or the first sub-pixel motion vector adjustment value, the first original motion vector Adjust to obtain the first target motion vector of the sub-block; adjust the second original motion vector according to the second integer-pixel motion vector adjustment value and/or the second sub-pixel motion vector adjustment value to obtain The second target motion vector of the sub-block.
  • the processing module 92 determines, according to the first pixel value and the second pixel value, the first integer pixel motion vector adjustment value and the second integer pixel motion vector adjustment value of the sub-block, and the first pixel value of the sub-block
  • the one-point pixel motion vector adjustment value and the second pixel motion vector adjustment value are specifically used for:
  • the processing module 92 determines the edge motion vector corresponding to the center motion vector, it is specifically used to:
  • the default value of the edge motion vector (x+right, y+down) is (x-S, y-S);
  • the cost value of the edge motion vector (x+S, y) is less than the cost value of the edge motion vector (xS, y), then right is S; if the cost value of the edge motion vector (x, y+S) is less than the edge motion vector The cost value of (x, yS), then down is S; or, if the cost value of the edge motion vector (x+S, y) is less than or equal to the cost value of the edge motion vector (xS, y), then right is S; If the cost value of the edge motion vector (x, y+S) is less than or equal to the cost value of the edge motion vector (x, yS), then down is S.
  • the processing module 92 obtains the first generation value corresponding to the center motion vector and the second generation value corresponding to the edge motion vector according to the first pixel value and the second pixel value, it is specifically used to:
  • the processing module 92 determines, according to the first pixel value and the second pixel value, the first integer pixel motion vector adjustment value and the second integer pixel motion vector adjustment value of the sub-block, and the first pixel value of the sub-block
  • the one-point pixel motion vector adjustment value and the second pixel motion vector adjustment value are specifically used for:
  • the processing module 92 determines the first integer-pixel motion vector adjustment value and the second integer-pixel motion vector adjustment value of the sub-block according to the optimal motion vector, it is specifically configured to: according to the optimal motion vector and the The first original motion vector determines the first integer-pixel motion vector adjustment value of the sub-block, and determines the second integer-pixel motion vector adjustment value of the sub-block according to the first integer-pixel motion vector adjustment value.
  • the processing module 92 determines the first sub-pixel motion vector adjustment value and the second sub-pixel motion vector adjustment value of the sub-block according to the optimal motion vector, it is used to: according to the cost value corresponding to the optimal motion vector , The cost value corresponding to the edge motion vector corresponding to the optimal motion vector is determined, the first sub-pixel motion vector adjustment value of the sub-block is determined, and the second sub-pixel motion vector adjustment value is determined according to the first sub-pixel motion vector adjustment value. Sub-pixel motion vector adjustment value.
  • the encoding and decoding module 93 encodes or decodes the current block according to the first target motion vector and the second target motion vector, it is specifically configured to: if the current block includes at least one sub-block, target the For each sub-block of the current block, the third reference block corresponding to the sub-block is determined according to the first target motion vector of the sub-block, and the third reference block corresponding to the sub-block is determined according to the second target motion vector of the sub-block.
  • Four reference blocks weighted according to the third pixel value of the third reference block and the fourth pixel value of the fourth reference block to obtain the predicted value of the sub-block; determine the current block according to the predicted value of each sub-block Predicted value.
  • the coding and decoding module 93 determines the third reference block corresponding to the sub-block according to the first target motion vector of the sub-block, and determines the fourth reference block corresponding to the sub-block according to the second target motion vector of the sub-block.
  • the reference block is specifically used to: based on the first target motion vector of the sub-block, determine the fifth reference block corresponding to the sub-block from the first reference frame, and interpolate the pixel values in the fifth reference block , To obtain the third reference block;
  • a sixth reference block corresponding to the sub-block is determined from a second reference frame, and pixel values in the sixth reference block are interpolated to obtain the fourth reference Piece.
  • the coding and decoding module 93 determines the third reference block corresponding to the sub-block according to the first target motion vector of the sub-block, and determines the fourth reference block corresponding to the sub-block according to the second target motion vector of the sub-block.
  • the reference block is specifically used to determine the seventh reference block corresponding to the sub-block from the first reference frame based on the first target motion vector of the sub-block, and use the pixel values in the seventh reference block to construct a Eight reference blocks, and interpolating pixel values in the eighth reference block to obtain the third reference block; determine the sub-block from the second reference frame based on the second target motion vector of the sub-block For the corresponding ninth reference block, a tenth reference block is constructed using pixel values in the ninth reference block, and pixel values in the tenth reference block are interpolated to obtain the fourth reference block.
  • the device further includes: a storage module for storing the first target motion vector and the second target motion vector for the current block; wherein the first target motion vector and the second target motion vector are used in the current frame
  • the first target motion vector and the second target motion vector are used for temporal reference of subsequent frames, and/or the first target motion vector and the second target motion vector are used for the spatial domain of the current frame reference.
  • FIG. 10 From the hardware level of the decoding end device provided by the embodiment of the present application, the schematic diagram of its hardware architecture can be specifically referred to as shown in FIG. 10. Including: a processor 101 and a machine-readable storage medium 102, where the machine-readable storage medium 102 stores machine-executable instructions that can be executed by the processor 101; the processor 101 is configured to execute machine-executable instructions, In order to realize the method disclosed in the above examples of this application. For example, the processor is used to execute machine executable instructions to implement the following steps:
  • the first reference block corresponding to the current block is determined according to the first original motion vector of the current block, and the current block is determined according to the second original motion vector of the current block
  • the corresponding second reference block; according to the first pixel value of the first reference block and the second pixel value of the second reference block, the first original motion vector and the second original motion vector are adjusted to obtain the The first target motion vector corresponding to the first original motion vector and the second target motion vector corresponding to the second original motion vector; perform the current block according to the first target motion vector and the second target motion vector decoding.
  • the schematic diagram of its hardware architecture can be specifically referred to as shown in FIG. It includes: a processor 111 and a machine-readable storage medium 112, where the machine-readable storage medium 112 stores machine executable instructions that can be executed by the processor 111; the processor 111 is configured to execute machine executable instructions, In order to realize the method disclosed in the above examples of this application.
  • the processor 111 is configured to execute machine-executable instructions to implement the following steps: if the characteristic information of the current block meets a specific condition, determine the first reference corresponding to the current block according to the first original motion vector of the current block Block, determining the second reference block corresponding to the current block according to the second original motion vector of the current block; according to the first pixel value of the first reference block and the second pixel value of the second reference block, The first original motion vector and the second original motion vector are adjusted to obtain a first target motion vector corresponding to the first original motion vector and a second target motion vector corresponding to the second original motion vector; A target motion vector and the second target motion vector encode the current block.
  • an embodiment of the application also provides a machine-readable storage medium.
  • the machine-readable storage medium stores several computer instructions. When the computer instructions are executed by a processor, the present invention can be realized. Apply for the encoding and decoding method disclosed in the above example.
  • the above-mentioned machine-readable storage medium may be any electronic, magnetic, optical or other physical storage device, and may contain or store information, such as executable instructions, data, and so on.
  • the machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard drive), solid state hard drive, any type of storage disk (Such as CD, DVD, etc.), or similar storage media, or a combination of them.
  • a typical implementation device is a computer.
  • the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email receiving and sending device, and a game control A console, a tablet computer, a wearable device, or a combination of any of these devices.
  • the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • these computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device,
  • the instruction device realizes the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operating steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so that the computer or other programmable equipment is executed
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Reduction Or Emphasis Of Bandwidth Of Signals (AREA)

Abstract

本申请提供一种编解码方法与装置、编码端设备和解码端设备。该方法包括:若当前块的特征信息满足特定条件,则根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块;根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量;根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行编码或者解码。

Description

编解码方法与装置、编码端设备和解码端设备 技术领域
本申请涉及编解码技术,尤其涉及一种编解码方法与装置、编码端设备和解码端设备。
背景技术
为了达到节约空间的目的,视频图像都是经过编码后才传输的,完整的视频编码方法可以包括预测、变换、量化、熵编码、滤波等过程。其中,预测编码包括帧内编码和帧间编码,帧间编码是利用视频时域的相关性,使用邻近已编码图像的像素预测当前图像的像素,以达到有效去除视频时域冗余的目的。
在帧间编码中,可以使用运动矢量(Motion Vector,MV)表示当前帧的视频图像的当前图像块与参考帧的视频图像的参考图像块之间的相对位移。例如,若当前帧的视频图像A与参考帧的视频图像B存在很强的时域相关性,则在需要传输视频图像A的图像块A1(当前图像块)时,可以在视频图像B中进行运动搜索,找到与图像块A1最匹配的图像块B1(即参考图像块),并确定图像块A1与图像块B1之间的相对位移,该相对位移也就是图像块A1的运动矢量。
编码端可以将运动矢量发送给解码端,不是将图像块A1发送给解码端。解码端可以根据运动矢量和图像块B1得到图像块A1。显然,由于运动矢量占用的比特数小于图像块A1占用的比特数,因此,上述方式可以节约大量比特。
在传统方式中,在当前块是单向块时,获得当前块的运动矢量(后续称为原始运动矢量)后,可以对原始运动矢量进行调整,并基于调整后的运动矢量进行编码/解码,从而提高编码性能。但是,在当前块是双向块时,获得当前块的第一原始运动矢量和第二原始运动矢量后,如何对第一原始运动矢量和第二原始运动矢量进行调整,目前并没有合理的解决方案。也就是说,针对双向块的场景,可能存在预测质量不高,预测错误等问题,从而导致编码性能较差。
发明内容
本申请提供了一种编解码方法、装置及其设备,可以提高编码性能。
本申请提供一种编解码方法,所述方法包括:若当前块的特征信息满足特定条件,则根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块;根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量;根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行编码或者解码。
本申请提供一种编解码装置,所述装置包括:确定模块,用于若当前块的特征信息满足特定条件,则根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块;处理模块,用于根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量;编解码模块,用于根据所述第一目标运动矢量和所述第二目 标运动矢量对所述当前块进行编码或者解码。
本申请提供一种编码端设备,所述编码端设备包括处理器和机器可读存储介质,其中,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;所述处理器用于执行机器可执行指令,以实现如下步骤:若当前块的特征信息满足特定条件,则根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块;根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量;根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行编码。
本申请提供一种解码端设备,所述解码端设备包括处理器和机器可读存储介质,其中,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;所述处理器用于执行机器可执行指令,以实现如下步骤:若当前块的特征信息满足特定条件,则根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块;根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量;根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行解码。
由以上技术方案可见,本申请实施例中,可以根据第一原始运动矢量和第二原始运动矢量确定当前块的第一目标运动矢量和第二目标运动矢量,并根据第一目标运动矢量和第二目标运动矢量对当前块进行编码或者解码,而不是直接根据第一原始运动矢量和第二原始运动矢量对当前块进行编码或者解码,从而解决预测质量不高,预测错误等问题,并提高编码性能和编码效率。
附图说明
为了更加清楚地说明本申请实施例或者现有技术中的技术方案,下面将对本申请实施例或者现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据本申请实施例的这些附图获得其他的附图。
图1A是本申请一种实施方式中的插值的示意图;
图1B是本申请一种实施方式中的视频编码框架的示意图;
图2是本申请一种实施方式中的编解码方法的流程图;
图3是本申请一种实施方式中的编解码方法的流程图;
图4是本申请一种实施方式中的编解码方法的流程图;
图5是本申请一种实施方式中的参考像素的示意图;
图6是本申请一种实施方式中的运动矢量迭代的示意图;
图7A-图7E是本申请一种实施方式中的候选点的顺序的示意图;
图8是本申请一种实施方式中的当前块的空域参考的示意图;
图9是本申请一种实施方式中的编解码装置的结构图;
图10是本申请一种实施方式中的解码端设备的硬件结构图;
图11是本申请一种实施方式中的编码端设备的硬件结构图。
具体实施方式
在本申请实施例使用的术语仅仅是出于描述特定实施例的目的,而非限制本申请。本申请和权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括复数形式,除非上下文清楚地表示其它含义。还应当理解,本文中使用的术语“和/或”是指包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本申请实施例可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本申请范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
本申请实施例中提出一种编解码方法,可能涉及如下概念:
帧内预测与帧间预测(intra prediction and inter prediction)技术:帧内预测是指,利用视频空域的相关性,使用当前图像已经编码块的像素预测当前像素,以达到去除视频空域冗余的目的。帧内预测中规定了多种预测模式,每一种预测模式都对应一种纹理方向(DC模式除外),当前块预测像素由其预测方向上相邻块的边界重构像素值生成。举例说明,如果图像的纹理是呈现水平状排布的,那么选择水平预测模式可以更好的预测图像信息。帧间预测是指,利用视频时域的相关性,由于视频序列通常包含有较强的时域相关性,使用邻近已编码图像像素预测当前图像的像素,可以达到有效去除视频时域冗余的目的。主要的视频编码标准帧间预测部分都采用了基于块的运动补偿技术,主要原理是为当前图像的每一个像素块在之前的已编码图像中寻找一个最佳匹配块,该过程称为运动估计(Motion Estimation,ME)。
运动矢量(Motion Vector,MV):在帧间编码中,使用运动矢量表示当前编码块与其参考图像中的最佳匹配块之间的相对位移。每个划分的块都有相应的运动矢量传输到解码端,如果对每个块的运动矢量进行独立编码和传输,特别是划分成小尺寸的块时,需要消耗相当多的比特。为了降低用于编码运动矢量的比特数,则利用相邻图像块之间的空间相关性,根据相邻已编码块的运动矢量对当前待编码块的运动矢量进行预测,然后对预测差进行编码。这样,可以有效地降低表示运动矢量的比特数。在对当前块的运动矢量编码过程中,首先使用相邻已编码块的运动矢量预测当前块的运动矢量,然后对运动矢量的预测值(MVP,Motion Vector Prediction)与运动矢量的真正估值之间的差值(MVD,MotionVector Difference)进行编码,从而有效降低MV的编码比特数。
运动信息(Motion Information):由于运动矢量表示当前图像块与某个参考图像块的位置偏移,为了准确获取指向图像块的信息,除了运动矢量,还需要参考帧图像的索引信息来表示使用哪个参考帧图像。在视频编码技术中,对于当前帧图像,通常可以建立一个参考帧图像列表,参考帧图像索引信息则表示当前图像块采用了参考帧图像列表中的第几个参考帧图像。此外,很多编码技术还支持多个参考图像列表,因此,还可以使用一个索引值来表示使用了哪一个参考图像列表,这个索引值可以称为参考方向。在视频编码技术中,可以将运动矢量、参考帧索引、参考方向等与运动相关的信息统称为运动信息。
预测像素(Prediction Signal):预测像素是指从已经编解码的像素中导出的像素值,通过原始像素与预测像素之差获得残差,进而进行残差变换量化和系数编码。特别的,帧间的预测像素指的是当前块从参考帧(重建像素帧)导出的像素值,由于像素位置离散,需要通过插值运算来获取最终的预测像素。预测像素与原始像素越接近,两者相减得到的残差能量越小,编码压缩性能越高。
插值(Interpolation):若当前MV为非整像素精度,则无法直接从对应参考帧中拷贝已有像素值,所需像素值只能通过插值获得。如图1A所示,若想获得偏移为1/2像素的像素值Y 1/2,则需要通过周围已有像素值X插值获得。若采用抽头数为N的插值滤波器,则需要通过周围N个整像素插值获得。
运动补偿:运动补偿就是通过插值或拷贝获得当前块所有像素值的过程。
视频编码框架:参见图1B所示,可以使用视频编码框架实现本申请实施例的编码端处理流程,此外,视频解码框架的示意图与图1B类似,在此不再赘述,而且,可以使用视频解码框架实现本申请实施例的解码端处理流程。具体的,在视频编码框架和视频解码框架中,包括帧内预测、运动估计/运动补偿、参考图像缓冲器、环内滤波、重建、变换、量化、反变换、反量化、熵编码器等模块。在编码端,通过这些模块之间的配合,可以实现编码端处理流程,在解码端,通过这些模块之间的配合,可以实现解码端处理流程。
在传统方式中,在当前块是双向块时,获得当前块的第一原始运动矢量和第二原始运动矢量后,如何对第一原始运动矢量和第二原始运动矢量进行调整,并没有合理的解决方案。本申请实施例中,在当前块是双向块时,先判断当前块的特征信息是否满足特定条件,如果是,则根据第一原始运动矢量确定当前块对应的第一参考块,根据当前块的第二原始运动矢量确定第二参考块,并根据第一参考块的第一像素值和第二参考块的第二像素值,对第一原始运动矢量和第二原始运动矢量进行调整,得到第一目标运动矢量和第二目标运动矢量。
这样,通过对第一原始运动矢量和第二原始运动矢量进行调整,得到第一目标运动矢量和第二目标运动矢量,从而可以根据第一目标运动矢量和第二目标运动矢量对当前块进行编码或者解码,可以提高编码性能和编码效率。
以下结合几个具体实施例,对本申请的编解码方法进行详细说明。
实施例1:参见图2所示,为本申请实施例中提出的编解码方法的流程示意图,该方法可以应用于解码端或者编码端,该方法可以包括以下步骤:
步骤201,若当前块的特征信息满足特定条件,则根据当前块的第一原始运动矢量确定当前块对应的第一参考块,根据当前块的第二原始运动矢量确定当前块对应的第二参考块。该特征信息包括但不限于以下一种或者多种:当前块对应的运动信息预测模式;当前块对应的运动信息属性;当前块的尺寸信息。
在一个例子中,若该特征信息为当前块对应的运动信息预测模式,则当前块的特征信息满足特定条件,可以包括但不限于:若当前块对应的运动信息预测模式为普通融合模式,则可以确定当前块对应的运动信息预测模式满足特定条件;或者,若当前块对应的运动信息预测模式为用于帧间预测值与帧内预测值联合生成新预测值的融合模式,则可以确定当前块对应的运动信息预测模式满足特定条件。
在一个例子中,若特征信息为当前块对应的运动信息属性,当前块的特征信息满足特定条 件,包括但不限于:若当前块对应的运动信息属性为当前块的运动信息包括两个不同方向的运动信息,则确定当前块对应的运动信息属性满足特定条件;或者,若当前块对应的运动信息属性为当前块的运动信息包括两个不同方向的运动信息,两个不同方向的运动信息对应的两个参考帧与当前帧的距离相同,则确定当前块对应的运动信息属性满足特定条件;或者,若当前块对应的运动信息属性为当前块复用周围块的运动信息,则确定当前块对应的运动信息属性满足特定条件;或者,若当前块对应的运动信息属性为当前块的每个子块的运动信息相同,则确定当前块对应的运动信息属性满足特定条件。
示例性的,当前块的运动信息包括两个不同方向的运动信息是指:当前块的两个不同方向的运动信息分别对应第一参考帧和第二参考帧,第一参考帧位于当前块所处当前帧的前面,第二参考帧位于当前块所处当前帧的后面。
在一个例子中,若该特征信息为当前块的尺寸信息,当前块的尺寸信息可以包括当前块的宽度值和当前块的高度值,则当前块的特征信息满足特定条件,可以包括但不限于:若当前块的宽度值位于第一区间[第一阈值,第二阈值]的范围内,则可以确定当前块的尺寸信息满足特定条件;或者,若当前块的高度值位于第二区间[第三阈值,第四阈值]的范围内,则可以确定当前块的尺寸信息满足特定条件;或者,若根据当前块的宽度值与当前块的高度值得到的面积位于第三区间[第五阈值,第六阈值]的范围内,则可以确定当前块的尺寸信息满足特定条件;或者,若所述宽度值位于第一区间[第一阈值,第二阈值]的范围内、所述高度值位于第二区间[第三阈值,第四阈值]的范围内、且所述面积位于第三区间[第五阈值,第六阈值]的范围内,则可以确定当前块的尺寸信息满足特定条件。
示例性的,第一阈值可以小于第二阈值,对此第一阈值和第二阈值均不做限制,例如,第一阈值可以为4,第二阈值可以为128。第三阈值可以小于第四阈值,对此第四阈值和第四阈值均不做限制,例如,第三阈值可以为8,第四阈值可以为128。第五阈值可以小于第六阈值,对此第五阈值和第六阈值均不做限制,例如,第五阈值可以为64,第六阈值可以为128*128
在一个例子中,根据当前块的第一原始运动矢量确定当前块对应的第一参考块,根据当前块的第二原始运动矢量确定当前块对应的第二参考块,可以包括但不限于:基于当前块的第一原始运动矢量,从第一参考帧中确定当前块对应的第一参考块;基于当前块的第二原始运动矢量,从第二参考帧中确定当前块对应的第二参考块。第一参考块中每个像素点的第一像素值,是通过对第一参考块中的相邻像素点的像素值进行插值得到,或者,通过对第一参考块中的相邻像素点的像素值进行拷贝得到;第二参考块中每个像素点的第二像素值,是通过对第二参考块中的相邻像素点的像素值进行插值得到,或者,通过对第二参考块中的相邻像素点的像素值进行拷贝得到。第一参考块的尺寸与第二参考块的尺寸相同,第一参考块的宽度值基于当前块的宽度值与搜索范围确定,第一参考块的高度值基于当前块的高度值与搜索范围确定。
步骤202,根据第一参考块的第一像素值和第二参考块的第二像素值,对第一原始运动矢量和第二原始运动矢量进行调整,得到第一原始运动矢量对应的第一目标运动矢量和第二原始运动矢量对应的第二目标运动矢量。
在一个例子中,若当前块包括至少一个子块,针对当前块的每个子块,则可以根据第一像素值和第二像素值,对第一原始运动矢量和第二原始运动矢量进行调整,得到子块的第一目标运动矢量和第二目标运动矢量。
在一个例子中,根据第一像素值和第二像素值,对第一原始运动矢量和第二原始运动矢量进行调整,得到子块的第一目标运动矢量和第二目标运动矢量,可以包括:根据第一像素值和第二像素值,确定子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值、和/或,子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值。然后,可以根据第一整像素运动矢量调整值和/或第一分像素运动矢量调整值,对第一原始运动矢量进行调整,得到子块的第一目标运动矢量。根据第二整像素运动矢量调整值和/或第二分像素运动矢量调整值,对第二原始运动矢量进行调整,得到子块的第二目标运动矢量。
在一个例子中,根据第一像素值和第二像素值,确定子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值、子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值,可以包括:将第一原始运动矢量或者第二原始运动矢量确定为中心运动矢量;确定与中心运动矢量对应的边缘运动矢量;根据第一像素值和第二像素值,获取中心运动矢量对应的第一代价值、边缘运动矢量对应的第二代价值;然后,根据第一代价值和第二代价值,从中心运动矢量和边缘运动矢量中选择一个运动矢量作为最优运动矢量,并判断是否满足结束条件;如果否,则将最优运动矢量确定为中心运动矢量,返回执行确定与中心运动矢量对应的边缘运动矢量;如果是,则根据最优运动矢量确定子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值;根据最优运动矢量确定子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值。
在一个例子中,确定与中心运动矢量对应的边缘运动矢量,包括:将中心运动矢量(x,y)向不同方向偏移S,顺序得到不同方向的边缘运动矢量(x,y+S)、边缘运动矢量(x,y-S)、边缘运动矢量(x+S,y)、边缘运动矢量(x-S,y)、边缘运动矢量(x+right,y+down);或者,将中心运动矢量(x,y)向不同方向偏移S,顺序得到不同方向的边缘运动矢量(x,y-S)、边缘运动矢量(x,y+S)、边缘运动矢量(x-S,y)、边缘运动矢量(x+S,y)、边缘运动矢量(x+right,y+down)。边缘运动矢量(x+right,y+down)的默认值为(x-S,y-S);若边缘运动矢量(x+S,y)的代价值小于边缘运动矢量(x-S,y)的代价值,则right为S;若边缘运动矢量(x,y+S)的代价值小于边缘运动矢量(x,y-S)的代价值,则down为S;或者,若边缘运动矢量(x+S,y)的代价值小于或等于边缘运动矢量(x-S,y)的代价值,则right为S;若边缘运动矢量(x,y+S)的代价值小于或等于边缘运动矢量(x,y-S)的代价值,则down为S。
在一个例子中,根据第一像素值和第二像素值,获取中心运动矢量对应的第一代价值、边缘运动矢量对应的第二代价值,可以包括但不限于:根据未下采样的第一像素值和未下采样的第二像素值,获取中心运动矢量对应的第一代价值、边缘运动矢量对应的第二代价值。或者,对第一像素值进行下采样操作,对第二像素值进行下采样操作;然后,根据下采样后的第一像素值和下采样后的第二像素值,获取中心运动矢量对应的第一代价值、边缘运动矢量对应的第二代价值。或者,对第一像素值进行移位和下采样操作,对第二像素值进行移位和下采样操作;然后,根据操作后的第一像素值和操作后的第二像素值,获取中心运动矢量对应的第一代价值、边缘运动矢量对应的第二代价值。
在一个例子中,根据第一像素值和第二像素值,确定子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值、子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值,可以包括:以第一原始运动矢量或者第二原始运动矢量为中心,从周围的运动矢量中选择部分 或全部运动矢量,将选择的运动矢量作为候选运动矢量;根据第一像素值和第二像素值,获取第一原始运动矢量或第二原始运动矢量对应的第三代价值、候选运动矢量对应的第四代价值;根据第三代价值和第四代价值,从第一原始运动矢量或第二原始运动矢量、候选运动矢量中选择一个运动矢量作为最优运动矢量;根据最优运动矢量确定子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值;根据最优运动矢量确定子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值。
根据最优运动矢量确定子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值,可以包括但不限于:根据该最优运动矢量和第一原始运动矢量确定子块的第一整像素运动矢量调整值,根据第一整像素运动矢量调整值确定子块的第二整像素运动矢量调整值。
根据最优运动矢量确定子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值,包括:根据最优运动矢量对应的代价值、与最优运动矢量对应的边缘运动矢量对应的代价值,确定子块的第一分像素运动矢量调整值,并根据第一分像素运动矢量调整值确定子块的第二分像素运动矢量调整值。
步骤203,根据第一目标运动矢量和第二目标运动矢量对当前块进行编码或者解码。例如,对于编码端来说,编码端可以根据第一目标运动矢量和第二目标运动矢量对当前块进行编码处理;对于解码端来说,解码端可以根据第一目标运动矢量和第二目标运动矢量对当前块进行解码处理。
在一个例子中,针对当前块的每个子块,根据子块的第一目标运动矢量确定子块对应的第三参考块,并根据子块的第二目标运动矢量确定子块对应的第四参考块;根据第三参考块的第三像素值和第四参考块的第四像素值进行加权,得到子块的预测值;根据每个子块的预测值确定当前块的预测值。
在一个例子中,根据子块的第一目标运动矢量确定子块对应的第三参考块,并根据子块的第二目标运动矢量确定子块对应的第四参考块,可以包括:
方式一、基于子块的第一目标运动矢量,从第一参考帧中确定子块对应的第五参考块,并对第五参考块中的像素值进行插值,得到第三参考块。以及,基于子块的第二目标运动矢量,从第二参考帧中确定子块对应的第六参考块,并对第六参考块中的像素值进行插值,得到第四参考块。
方式二、基于子块的第一目标运动矢量,从第一参考帧中确定子块对应的第七参考块,利用第七参考块中的像素值构造第八参考块,并对第八参考块中的像素值进行插值,得到第三参考块;基于子块的第二目标运动矢量,从第二参考帧中确定子块对应的第九参考块,利用第九参考块中的像素值构造第十参考块,并对第十参考块中的像素值进行插值,得到第四参考块。
在一个例子中,根据第一目标运动矢量和第二目标运动矢量对当前块进行编码或者解码之后,还可以为当前块存储第一目标运动矢量和第二目标运动矢量。这样,该第一目标运动矢量和该第二目标运动矢量用于当前帧的环路滤波、,该第一目标运动矢量和该第二目标运动矢量用于后续帧的时域参考,和/或,该第一目标运动矢量和该第二目标运动矢量用于当前帧的空域参考。
由以上技术方案可见,本申请实施例中,可以根据第一原始运动矢量和第二原始运动矢量确定当前块的第一目标运动矢量和第二目标运动矢量,并根据第一目标运动矢量和第二目标运 动矢量对当前块进行编码或者解码,而不是直接根据第一原始运动矢量和第二原始运动矢量对当前块进行编码或者解码,从而解决预测质量不高,预测错误等问题,并提高编码性能和编码效率。
实施例2:参见图3所示,为本申请实施例中提出的编解码方法的流程示意图,该编解码方法可以应用于编码端,该编解码方法可以包括以下步骤:
步骤301,编码端判断当前块的特征信息是否满足特定条件。如果是,则执行步骤302,如果否,则不需要采用本申请提出的运动矢量调整方式,对此处理方式不做限制。
在一个例子中,编码端可以基于已编码信息判断当前块的特征信息是否满足特定条件。如果当前块的特征信息满足特定条件,则说明当前块的运动信息不够准确,因此,启用运动矢量调整模式,执行步骤302。
如果当前块的特征信息不满足特定条件,则说明当前块的运动信息已经足够准确,因此,可以不启用运动矢量调整模式,不需要采用本申请提出的运动矢量调整方式。
在一个例子中,当前块的特征信息包括但不限于以下一种或者多种:当前块对应的运动信息预测模式;当前块对应的运动信息属性;当前块的尺寸信息。
针对判断当前块的特征信息是否满足特定条件的方式,参见后续实施例。
步骤302,编码端基于当前块的第一原始运动矢量,从第一参考帧中确定当前块对应的第一参考块;基于当前块的第二原始运动矢量,从第二参考帧中确定当前块对应的第二参考块。为了区分方便,将第一参考块中每个像素点的像素值称为第一像素值,将第二参考块中每个像素点的像素值称为第二像素值。
在一个例子中,若当前块是采用双向预测的块,则当前块存在双向运动信息,这个双向运动信息包括两个参考帧和两个原始运动矢量。例如,编码端可以采用传统方式获取双向运动信息,对此获取方式不做限制。该双向运动信息包括第一参考帧和第一原始运动矢量、第二参考帧和第二原始运动矢量。
基于第一原始运动矢量,编码端可以从第一参考帧中确定当前块对应的第一参考块,可以将第一参考块中每个像素点的像素值称为第一像素值。
基于第二原始运动矢量,编码端可以从第二参考帧中确定当前块对应的第二参考块,可以将第二参考块中每个像素点的像素值称为第二像素值。
在一个例子中,当前块所在当前帧与第一参考帧的距离和第二参考帧与当前块所在当前帧的距离可以相同。例如,第一参考帧为第1帧,当前帧为第5帧,第二参考帧为第9帧。当然,上述只是一个示例,二者的距离也可以不同。
第一原始运动矢量和第二原始运动矢量可以存在镜像对称关系,例如,第一原始运动矢量为(4,4),第二原始运动矢量为(-4,-4);第一原始运动矢量为(2.5,3.5),第二原始运动矢量为(-2.5,-3.5)。当然,上述只是一个示例,第一原始运动矢量和第二原始运动矢量也可以不存在镜像对称关系。
针对确定第一参考块和第二参考块的方式,可以参见后续实施例。
步骤303,针对当前块的每个子块:编码端根据第一参考块的第一像素值和第二参考块的第二像素值,对第一原始运动矢量进行调整,得到该子块的第一目标运动矢量;编码端根据第一参考块的第一像素值和第二参考块的第二像素值,对第二原始运动矢量进行调整,得到该子 块的第二目标运动矢量。
在一个例子中,若针对当前块启用运动矢量调整模式,则编码端可以基于第一像素值和第二像素值,通过局部搜索的方法,对第一原始运动矢量和第二原始运动矢量进行微调,以获得更好的第一目标运动矢量和第二目标运动矢量,继而利用第一目标运动矢量和第二目标运动矢量来生成失真更小的预测值。
在一个例子中,当前块可以包括至少一个子块,若只包括一个子块,则该子块就是当前块本身。针对该子块,该子块对应第一原始运动矢量和第二原始运动矢量,在进行调整后,该子块对应第一目标运动矢量和第二目标运动矢量。
若当前块包括子块A和子块B,针对子块A,子块A对应第一原始运动矢量A1和第二原始运动矢量A2,进行调整后,子块A对应第一目标运动矢量A3和第二目标运动矢量A4。针对子块B,子块B对应第一原始运动矢量B1和第二原始运动矢量B2,进行调整后,子块B对应第一目标运动矢量B3和第二目标运动矢量B4。
子块A对应的第一原始运动矢量A1与子块B对应的第一原始运动矢量B1可以相同,均是当前块的第一原始运动矢量;子块A对应的第二原始运动矢量A2与子块B对应的第二原始运动矢量B2可以相同,均是当前块的第二原始运动矢量。
由于针对每个子块的第一原始运动矢量分别进行调整,因此,子块A对应的第一目标运动矢量A3与子块B对应的第一目标运动矢量B3可以相同或者不同。由于针对每个子块的第二原始运动矢量分别进行调整,因此,子块A对应的第二目标运动矢量A4与子块B对应的第二目标运动矢量B4可以相同或者不同。
针对原始运动矢量的调整方式,可以参见后续实施例,在此不再赘述。
步骤304,编码端根据第一目标运动矢量和第二目标运动矢量对当前块的每个子块进行运动补偿。例如,若当前块包括子块A和子块B,则可以利用子块A的第一目标运动矢量和第二目标运动矢量对子块A进行运动补偿,并利用子块B的第一目标运动矢量和第二目标运动矢量对子块B进行运动补偿。
针对运动补偿的方式,可以参见后续实施例,在此不再赘述。
步骤305,编码端保存当前块的每个子块的第一目标运动矢量和第二目标运动矢量,第一目标运动矢量和第二目标运动矢量用于后续块的编码参考。
针对编码参考的实现方式,可以参见后续实施例,在此不再赘述。
实施例3:参见图4所示,为本申请实施例中提出的编解码方法的流程示意图,该编解码方法可以应用于解码端,该编解码方法可以包括以下步骤:
步骤401,解码端判断当前块的特征信息是否满足特定条件。如果是,则执行步骤402,如果否,则不需要采用本申请提出的运动矢量调整方式,对此处理方式不做限制。
在一个例子中,解码端可以接收编码端发送的编码比特流,并基于已解码信息判断当前块的特征信息是否满足特定条件。如果当前块的特征信息满足特定条件,说明当前块的运动信息不够准确,因此,启用运动矢量调整模式,执行步骤402。如果当前块的特征信息不满足特定条件,则说明当前块的运动信息已经足够准确,因此,不启用运动矢量调整模式,不需要采用本申请提出的运动矢量调整方式。
步骤402,解码端基于当前块的第一原始运动矢量,从第一参考帧中确定当前块对应的第 一参考块;基于当前块的第二原始运动矢量,从第二参考帧中确定当前块对应的第二参考块。为了区分方便,将第一参考块中每个像素点的像素值称为第一像素值,将第二参考块中每个像素点的像素值称为第二像素值。
步骤403,针对当前块的每个子块,解码端根据第一参考块的第一像素值和第二参考块的第二像素值,对第一原始运动矢量进行调整,得到该子块的第一目标运动矢量;解码端根据第一参考块的第一像素值和第二参考块的第二像素值,对第二原始运动矢量进行调整,得到该子块的第二目标运动矢量。
步骤404,针对当前块的每个子块,解码端根据该子块的第一目标运动矢量以及该子块的第二目标运动矢量,对该子块进行运动补偿。
步骤405,解码端保存当前块的每个子块的第一目标运动矢量和第二目标运动矢量,第一目标运动矢量和第二目标运动矢量用于后续块的解码参考。
实施例4:在步骤301和步骤401中,涉及判断当前块的特征信息是否满足特定条件。本实施例中,当特征信息满足如下所有条件时,确定当前块的特征信息满足特定条件,启用运动矢量调整模式。否则,不启用运动矢量调整模式。
当前块对应的运动信息属性包括:当前块直接复用周围块的运动信息,而不编码运动信息差。当前块对应的运动信息属性包括:当前块的每个子块的运动信息相同,即不采用子块运动信息预测模式。当前块对应的运动信息属性包括:当前块的运动信息包括两个不同方向的运动信息。当前块的尺寸信息包括:当前块的尺寸在限定范围内,对此尺寸在限定范围内,在后续实施例介绍。
实施例5:在步骤301和步骤401中,涉及判断当前块的特征信息是否满足特定条件。本实施例中,当特征信息满足如下所有条件时,确定当前块的特征信息满足特定条件,启用运动矢量调整模式。否则,不启用运动矢量调整模式。
当前块对应的运动信息预测模式采用Normal Merge模式(即普通融合模式)或CIIP模式(即用于帧间预测值与帧内预测值联合生成新预测值的融合模式);或者,当前块对应的运动信息预测模式不采用MMVD模式(即用于编码运动信息差值的融合模式)、SB Merge模式(即采用子块运动信息的融合模式)、或TPM模式(即用于三角预测的融合模式)。
当前块对应的运动信息属性包括:当前块的运动信息包括两个不同方向的运动信息,两个不同方向的运动信息对应的两个参考帧与当前帧的距离相同。当前块的尺寸信息包括:当前块的尺寸在限定范围内。
需要说明的是,融合模式(即Merge模式)包括但不限于如下类型的融合模式:普通融合模式(称为Normal Merge模式);用于三角预测的融合模式(称为TPM模式);用于编码运动信息差的融合模式(称为MMVD模式);采用子块运动信息的融合模式(称为SB Merge模式);用于帧间预测值与帧内预测值联合生成新预测值的融合模式(称为CIIP模式)。
在一个例子中,Normal Merge模式包括不编码残差的普通融合模式(即skip模式)和编码残差的普通融合模式。MMVD模式包括不编码残差的MMVD模式。
实施例6:在步骤301和步骤401中,涉及判断当前块的特征信息是否满足特定条件。本实施例中,当特征信息满足如下所有条件时,确定当前块的特征信息满足特定条件,启用运动矢量调整模式。否则,不启用运动矢量调整模式。
当前块对应的运动信息预测模式采用Normal Merge模式(即普通融合模式)、CIIP模式(即用于帧间预测值与帧内预测值联合生成新预测值的融合模式)、或TPM模式(即用于三角预测的融合模式);或者,当前块对应的运动信息预测模式不采用MMVD模式(即用于编码运动信息差值的融合模式)、或SB Merge模式(即采用子块运动信息的融合模式)。
当前块对应的运动信息属性包括:当前块的运动信息包括两个不同方向的运动信息,两个不同方向的运动信息对应的两个参考帧与当前帧的距离相同。当前块的尺寸信息包括:当前块的尺寸在限定范围内。
实施例7:在步骤301和步骤401中,涉及判断当前块的特征信息是否满足特定条件。本实施例中,当特征信息满足如下所有条件时,确定当前块的特征信息满足特定条件,启用运动矢量调整模式。否则,不启用运动矢量调整模式。
当前块对应的运动信息预测模式采用Normal Merge模式(即普通融合模式)、CIIP模式(即用于帧间预测值与帧内预测值联合生成新预测值的融合模式)、TPM模式(即用于三角预测的融合模式)、或MMVD模式(即用于编码运动信息差值的融合模式);或者,当前块对应的运动信息预测模式不采用SB Merge模式(即采用子块运动信息的融合模式)。
当前块对应的运动信息属性包括:当前块的运动信息包括两个不同方向的运动信息,两个不同方向的运动信息对应的两个参考帧与当前帧的距离相同。当前块的尺寸信息包括:当前块的尺寸在限定范围内。
实施例8:在步骤301和步骤401中,涉及判断当前块的特征信息是否满足特定条件。本实施例中,当特征信息满足如下所有条件时,确定当前块的特征信息满足特定条件,启用运动矢量调整模式。否则,不启用运动矢量调整模式。
当前块对应的运动信息预测模式采用Normal Merge模式或CIIP模式;当前块对应的运动信息预测模式不采用MMVD模式、SB Merge模式、或TPM模式;或者,当前块对应的运动信息预测模式采用Normal Merge模式、CIIP模式、或TPM模式;当前块对应的运动信息预测模式不采用MMVD模式、或SB Merge模式;或者,当前块对应的运动信息预测模式采用Normal Merge模式、CIIP模式、TPM模式、或MMVD模式;当前块对应的运动信息预测模式不采用SB Merge模式。
当前块对应的运动信息属性包括:当前块的运动信息包括两个不同方向的运动信息,而不需要限制两个不同方向的运动信息对应的两个参考帧与当前帧的距离相同,即将这个限制条件移除。当前块的尺寸信息包括:当前块的尺寸在限定范围内。
实施例9:针对上述实施例4-实施例8中的“当前块的尺寸在限定范围内”,若当前块的尺寸满足如下条件,则确定当前块的尺寸在限定范围内。
当前块的宽在[第一阈值,第二阈值]范围内,第一阈值可以为4,第二阈值可以为128。当前块的高在[第三阈值,第四阈值]范围内,第三阈值可以为8,第四阈值可以为128。示例性的,第一阈值、第二阈值、第三阈值、第四阈值,均可以为2的n次方,n为大于等于1的整数。当前块的面积在[第五阈值,第六阈值]范围内,第五阈值可以为64,第六阈值可以为128*128=16384。示例性的,第五阈值、第六阈值,均可以为4的m次方,m为大于等于1的整数。在上述例子中,表达式[a,b]可以表示大于等于a,且小于等于b。
实施例10:步骤302和步骤402中,基于第一原始运动矢量,从第一参考帧中确定当 前块对应的第一参考块,第一参考块中每个像素点的像素值称为第一像素值;基于第二原始运动矢量,从第二参考帧中确定当前块对应的第二参考块,第二参考块中每个像素点的像素值称为第二像素值,以下对此进行说明。
第一参考块中每个像素点的第一像素值,是通过对第一参考块中的相邻像素点的像素值进行插值得到,或者,通过对第一参考块中的相邻像素点的像素值进行拷贝得到;第二参考块中每个像素点的第二像素值,是通过对第二参考块中的相邻像素点的像素值进行插值得到,或者,通过对第二参考块中的相邻像素点的像素值进行拷贝得到。第一参考块的尺寸与第二参考块的尺寸相同,第一参考块/第二参考块的宽度值基于当前块的宽度值与搜索范围确定,第一参考块/第二参考块的高度值基于当前块的高度值与搜索范围确定。
参见图5所示,假设当前块的宽为W,高为H,第一原始运动矢量记为MV0,第二原始运动矢量记为MV1。从第一原始运动矢量MV0在第一参考帧的对应位置,得到面积为(W+FS-1)*(H+FS-1)的整像素块,将这个整像素块记为整像素块A。从第二原始运动矢量MV1在第二参考帧的对应位置,得到面积为(W+FS-1)*(H+FS-1)的整像素块,将这个整像素块记为整像素块B。
在一个例子中,基于面积为(W+FS-1)*(H+FS-1)的整像素块A,可以通过双线性插值的方式,获得尺寸为(W+2*SR)*(H+2*SR)的初始参考像素块,可以将这个初始参考像素块记为第一参考块。基于面积为(W+FS-1)*(H+FS-1)的整像素块B,可以通过双线性插值的方式,获得尺寸为(W+2*SR)*(H+2*SR)的初始参考像素块,可以将这个初始参考像素块记为第二参考块。
在另一例子中,基于面积为(W+FS-1)*(H+FS-1)的整像素块A,通过直接拷贝(无需插值)的方式,获得尺寸为(W+2*SR)*(H+2*SR)的初始参考像素块,将这个初始参考像素块记为第一参考块。基于面积为(W+FS-1)*(H+FS-1)的整像素块B,可以通过直接拷贝的方式,获得尺寸为(W+2*SR)*(H+2*SR)的初始参考像素块,将这个初始参考像素块记为第二参考块。
示例性的,可以仅针对亮度分量(因为后续的搜索过程仅用亮度分量计算代价值,以降低复杂度),基于面积为(W+FS-1)*(H+FS-1)的整像素块(如整像素块A和整像素块B),获得尺寸为(W+2*SR)*(H+2*SR)的初始参考像素块,即第一参考块(如Pred_Inter0)和第二参考块(如Pred_Inter1)。
在一个例子中,FS可以为插值滤波器的抽头数,如可以为8等。
通过双线性插值获得第一参考块/第二参考块是指:第一参考块/第二参考块中每个像素点的像素值,通过对第一参考块/第二参考块中的相邻像素点的像素值进行插值得到,对此不做限制。通过拷贝获得第一参考块/第二参考块是指:第一参考块/第二参考块中每个像素点的像素值,通过对第一参考块/第二参考块中的相邻像素点的像素值进行拷贝得到,对此不做限制。
参见上述实施例,第一参考块的面积为(W+2*SR)*(H+2*SR),第二参考块的面积为(W+2*SR)*(H+2*SR),也就是说,第一参考块/第二参考块的宽度值为W+2*SR,第一参考块/第二参考块的高度值为H+2*SR。W为当前块的宽,H为当前块的高,SR为搜索范围,即后续实施例的迭代次数,SR即目标运动矢量与原始运动矢量最大水平/竖直分量插值,如SR可以为2等。
针对第一参考块和第二参考块,用于后续过程中的运动矢量调整。
实施例11:步骤303和步骤403中,针对当前块的每个子块,根据第一参考块的第一像素值和第二参考块的第二像素值,对第一原始运动矢量进行调整,得到子块的第一目标运动矢量;根据第一参考块的第一像素值和第二参考块的第二像素值,对第二原始运动矢量进行调整,得到子块的第二目标运动矢量。
以一个子块(如当前块的每个dx*dy大小的子块,如16*16大小的子块,或更小的一个整块)的处理过程为例,介绍原始运动矢量的调整过程。
步骤a1、将第一原始运动矢量或者第二原始运动矢量确定为中心运动矢量。
例如,假设第一原始运动矢量为(4,4),第二原始运动矢量为(-4,-4),可以将第一原始运动矢量(4,4)或第二原始运动矢量(-4,-4)确定为中心运动矢量。为了方便描述,以将第一原始运动矢量(4,4)确定为中心运动矢量为例,将第二原始运动矢量(-4,-4)确定为中心运动矢量的流程类似。
步骤a2、确定与中心运动矢量对应的边缘运动矢量。
例如,可以将中心运动矢量(x,y)向不同方向偏移S,得到不同方向的边缘运动矢量(x,y+S)、边缘运动矢量(x,y-S)、边缘运动矢量(x+S,y)、边缘运动矢量(x-S,y)、边缘运动矢量(x+right,y+down)。right可以为S或者-S,down可以为S或者-S,right和down的确定方式,参见后续实施例。
参见图6所示,将中心运动矢量(x,y)作为中心,即中心运动矢量为(0,0),以S为1,right和down均为1为例,则中心运动矢量(0,0)对应的边缘运动矢量包括:边缘运动矢量(0,1),边缘运动矢量(0,-1),边缘运动矢量(1,0),边缘运动矢量(-1,0),边缘运动矢量(1,1)。
步骤a3、根据第一参考块的第一像素值和第二参考块的第二像素值,获取中心运动矢量对应的第一代价值、每个边缘运动矢量对应的第二代价值。
例如,从第一参考块中复制获取中心运动矢量(0,0)对应的子参考块A1,子参考块A1是中心运动矢量(0,0)在第一参考块中的子参考块。子参考块A1的大小为当前块的大小,且子参考块A1是第一参考块中最中心的W*H的块。
从第二参考块中复制获取中心运动矢量(0,0)对应的子参考块B1,子参考块B1是中心运动矢量(0,0)在第二参考块中的子参考块。子参考块B1的大小为当前块的大小,且子参考块B1是第二参考块中最中心的W*H的块。
然后,利用子参考块A1的第一像素值和子参考块B1的第二像素值,获取中心运动矢量(0,0)对应的代价值1,代价值的确定方式参见后续实施例。
从第一参考块中复制获取边缘运动矢量(0,1)对应的子参考块A2,子参考块A2是边缘运动矢量(0,1)在第一参考块中的子参考块。子参考块A2的大小为当前块的大小,且子参考块A2是第一参考块中的W*H的块。
从第二参考块中复制获取边缘运动矢量(0,1)的对称运动矢量(0,-1)对应的子参考块B2,子参考块B2是对称运动矢量(0,-1)在第二参考块中的子参考块。子参考块B2的大小为当前块的大小,是第二参考块中的W*H的块。
然后,利用子参考块A2的第一像素值和子参考块B2的第二像素值,获取边缘运动矢 量(0,1)对应的代价值2,代价值的确定方式参见后续实施例。
基于边缘运动矢量(0,1)对应的代价值2的确定方式,可以确定边缘运动矢量(0,-1)对应的代价值3、边缘运动矢量(1,0)对应的代价值4、边缘运动矢量(-1,0)对应的代价值5、边缘运动矢量(1,1)对应的代价值6。
步骤a4、根据第一代价值和第二代价值,从中心运动矢量和边缘运动矢量中选择一个运动矢量,作为最优运动矢量。例如,可以将代价值最小的运动矢量作为最优运动矢量。例如,假设边缘运动矢量(0,1)对应的代价值2最小,则可以将代价值2对应的边缘运动矢量(0,1)作为最优运动矢量。
步骤a5、判断是否满足结束条件。如果否,则可以将该最优运动矢量确定为中心运动矢量,并返回步骤a2。如果是,则可以执行步骤a6。
在一个例子中,若迭代次数/搜索范围达到阈值,则满足结束条件;若迭代次数/搜索范围未达到阈值,则不满足结束条件。例如,假设SR为2,即阈值为2,即允许进行两次迭代过程。若迭代次数/搜索范围已经达到2次,即步骤a2-步骤a4已经执行两次,则满足结束条件;否则,不满足结束条件。
在另一例子中,从中心运动矢量和边缘运动矢量中选择一个运动矢量作为最优运动矢量后,若选择中心运动矢量作为最优运动矢量,则满足结束条件。
步骤a6、根据最优运动矢量确定第一整像素运动矢量调整值(用于调整第一原始运动矢量)和第二整像素运动矢量调整值(用于调整第二原始运动矢量)。
在一个例子中,可以根据最优运动矢量和第一原始运动矢量确定第一整像素运动矢量调整值,根据第一整像素运动矢量调整值确定第二整像素运动矢量调整值,第二整像素运动矢量调整值与第一整像素运动矢量调整值对称。
例如,第一次迭代过程,最优运动矢量为边缘运动矢量(0,1),以边缘运动矢量(0,1)为中心进行第二次迭代,第二次迭代过程,最优运动矢量为边缘运动矢量(0,1),假设至此完成迭代过程,则第一整像素运动矢量调整值为(0,2),即边缘运动矢量(0,1)与边缘运动矢量(0,1)的和。
基于此,假设第一原始运动矢量为(4,4),第一次迭代过程,最优运动矢量为边缘运动矢量(0,1),即最优运动矢量可以对应最优运动矢量(4,5)。以边缘运动矢量(0,1)为中心进行第二次迭代,第二次迭代过程,最优运动矢量为边缘运动矢量(0,1),即最优运动矢量可以对应最优运动矢量(4,6)。
综上所述,根据最优运动矢量(4,6)和第一原始运动矢量(4,4)确定第一整像素运动矢量调整值,第一整像素运动矢量调整值为最优运动矢量(4,6)与第一原始运动矢量(4,4)的差,即第一整像素运动矢量调整值为(0,2)。
然后,根据第一整像素运动矢量调整值(0,2)确定第二整像素运动矢量调整值,第二整像素运动矢量调整值可以为(0,-2),即(0,2)的对称值。
步骤a7、根据最优运动矢量确定第一分像素运动矢量调整值(用于调整第一原始运动矢量)和第二分像素运动矢量调整值(用于调整第二原始运动矢量)。
在一个例子中,可以根据最优运动矢量对应的代价值、与最优运动矢量对应的边缘运动矢量对应的代价值,确定第一分像素运动矢量调整值,然后,根据所述第一分像素运动矢量 调整值确定第二分像素运动矢量调整值。
例如,x 0=N*(E(-1,0)–E(1,0))/(E(-1,0)+E(1,0)–2*E(0,0)),y 0=N*(E(0,-1)–E(0,1))/(E(0,-1)+E(0,1)–2*E(0,0)),对于1/2、1/4、1/8和1/16的运动矢量像素精度,则N=1、2、4和8。然后,将(x0,y0)赋值给deltaMv,SPMV=deltaMv/2N,若当前为1/16的运动矢量像素精度,则SPMV为(x 0/16,y 0/16)。
在上述公式中,SPMV是第一分像素运动矢量调整值,N与运动矢量像素精度有关,如运动矢量像素精度为1/2,N为1,运动矢量像素精度为1/4,N为2,运动矢量像素精度为1/8,N为4,运动矢量像素精度为1/16,N为8。
在上述公式中,E(0,0)表示最优运动矢量的代价值;E(-1,0)是以最优运动矢量为中心,最优运动矢量(0,0)的边缘运动矢量(-1,0)的代价值;E(1,0)是以最优运动矢量为中心,最优运动矢量(0,0)的边缘运动矢量(1,0)的代价值;E(0,-1)是以最优运动矢量为中心,最优运动矢量(0,0)的边缘运动矢量(0,-1)的代价值;E(0,1)是以最优运动矢量为中心,最优运动矢量(0,0)的边缘运动矢量(0,1)的代价值。针对各运动矢量的代价值,其确定方式可以参见上述实施例,在此不再赘述。
在采用上述方式确定第一分像素运动矢量调整值后,可以根据第一分像素运动矢量调整值确定第二分像素运动矢量调整值,第二分像素运动矢量调整值是第一分像素运动矢量调整值的对称值。例如,若第一分像素运动矢量调整值为(1,0),则第二分像素运动矢量调整值为(-1,0),即(1,0)的对称值。
步骤a8、根据第一整像素运动矢量调整值和/或第一分像素运动矢量调整值,对第一原始运动矢量进行调整,得到第一目标运动矢量。
例如,第一目标运动矢量=第一原始运动矢量+第一整像素运动矢量调整值+第一分像素运动矢量调整值。当然,上述只是示例,对此不做限制。
步骤a9、根据第二整像素运动矢量调整值和/或第二分像素运动矢量调整值,对第二原始运动矢量进行调整,得到第二目标运动矢量。
例如,第二目标运动矢量=第二原始运动矢量+第二整像素运动矢量调整值+第二分像素运动矢量调整值。当然,上述只是示例,对此不做限制。
实施例12:步骤303和步骤403中,针对当前块的每个子块,根据第一参考块的第一像素值和第二参考块的第二像素值,对第一原始运动矢量进行调整,得到子块的第一目标运动矢量;根据第一参考块的第一像素值和第二参考块的第二像素值,对第二原始运动矢量进行调整,得到子块的第二目标运动矢量。
以一个子块(如当前块的每个dx*dy大小的子块,如16*16大小的子块或更小的整块)的处理过程为例,介绍原始运动矢量的调整过程。将第一原始运动矢量记为Org_MV0,将第二原始运动矢量记为Org_MV1,对第一原始运动矢量Org_MV0进行调整后,得到的第一目标运动矢量记为Refined_MV0,对第二原始运动矢量Org_MV1进行调整后,得到的第二目标运动矢量记为Refined_MV1。
步骤b1、进行SR次迭代,获得最优的整像素MV点的整像素偏移,将其记为IntegerDeltaMV,IntegerDeltaMV就是上述实施例中的第一整像素运动矢量调整值。例如,先将IntegerDeltaMV初始化为(0,0),每次迭代执行如下过程:
步骤b11、将deltaMV设为(0,0)。若为首次迭代,基于第一原始运动矢量在第一参考块中的参考像素,复制获得预测值块A1(即第一参考块最中心的W*H的块);基于第二原始运动矢量在第二参考块中的参考像素,复制获得预测值块B1(即第二参考块最中心的W*H的块)。基于预测值块A1和预测值块B1获得初始代价值cost(初始代价值为基于预测值块A1和预测值块B1的SAD(绝对值差和,sum of abstract distortion),确定方式参见后续实施例)。若该初始代价值cost小于4*dx*dy/2,dx和dy是当前子块的宽度和高度,则直接跳过后续搜索过程,执行步骤b2,并将notZeroCost设为false。
步骤b12、如图6所示,以上述初始点为中心,按照{Mv(0,1),Mv(0,-1),Mv(1,0),Mv(-1,0),Mv(right,down)}的顺序得到五个偏移MV(这五个偏移MV均称为MVOffset),并进行这五个偏移MV的代价值的计算与比较过程。
例如,基于某个MVOffset(如Mv(0,1)等),在第一参考块和第二参考块中,通过这个MVOffset获得两块预测值块(如第一参考块中进行中心位置偏移MVOffset的W*H块、第二参考块中进行中心位置偏移-MVOffset(与MVOffset相反)的W*H块),计算两个预测值块的下采样SAD作为MVOffset的代价值。
然后,保留代价值最小的MVOffset,将代价值最小的MVOffset更新为deltaMV的值,且代价值最小的MVOffset作为下一次迭代的新中心偏移点。
基于deltaMV更新IntegerDeltaMV的值,更新后的IntegerDeltaMV=更新前的IntegerDeltaMV+deltaMV,即在当前IntegerDeltaMV的基础上加上deltaMV。
步骤b13、经过迭代后,若最优MV仍为初始MV(即不是MVOffset)或者最小代价值为0,则不进行下一次迭代搜索过程,执行步骤b2,并将notZeroCost设为false。否则,若迭代次数达到SR,则执行步骤b2,若迭代次数未达到SR,则将最优MV作为中心,进行下一次迭代搜索过程,即返回步骤b11。
在迭代搜索过程结束后,得到IntegerDeltaMV的取值,即IntegerDeltaMV的最终取值,就是第一整像素运动矢量调整值,后续记为IntegerDeltaMV。
步骤b2、可以以步骤b1的最优整像素MV点为中心,获得最优的分像素偏移MV,记为SPMV,而SPMV就是上述实施例中的第一分像素运动矢量调整值。例如,可以先将SPMV初始化为(0,0),然后执行如下过程:
步骤b21、只有notZeroCost不为false,且deltaMV为(0,0)时,才进行后续处理(即需要获取SPMV),否则,直接利用IntegerDeltaMV对原始运动矢量进行调整,而不是利用IntegerDeltaMV和SPMV对原始运动矢量进行调整。
步骤b22、将E(x,y)表示为步骤b1所得最优MV点偏移(x,y)的MV对应代价值(步骤b1计算的代价值)。基于中心及上下左右五个点的E(x,y),可得E(x,y)最小的点的偏移(x0,y0)为:x 0=N*(E(-1,0)–E(1,0))/(E(-1,0)+E(1,0)–2*E(0,0)),y 0=N*(E(0,-1)–E(0,1))/(E(0,-1)+E(0,1)–2*E(0,0))。
在一个例子中,对于1/2、1/4、1/8和1/16的运动矢量像素精度,则N=1、2、4和8。然后,可以将(x0,y0)赋值给deltaMv,SPMV=deltaMv/2N,若当前为1/16的运动矢量像素精度,则SPMV可以为(x 0/16,y 0/16)。
若E(-1,0)=E(0,0),则水平向左偏移半个像素(deltaMv[0]=-N)。
若E(1,0)=E(0,0),则水平向右偏移半个像素(deltaMv[0]=N)。
若E(0,-1)=E(0,0),则垂直向上偏移半个像素(deltaMv[1]=-N)。
若E(0,1)=E(0,0),则垂直向下偏移半个像素(deltaMv[1]=N)。
基于上述处理,可以得到SPMV的取值,即第一分像素运动矢量调整值。
步骤b3、基于步骤b1的整像素偏移IntegerDeltaMV和步骤b2的分像素偏移SPMV,获得最优偏移MV,可以将这个最优偏移MV记为BestMVoffset。而且,BestMVoffset=IntegerDeltaMV+SPMV。
基于BestMVoffset可以获得两个方向的目标运动矢量:Refined_MV0=Org_MV0+BestMVoffset;Refined_MV1=Org_MV1-BestMVoffset。
显然,BestMVoffset=IntegerDeltaMV+SPMV,即第一整像素运动矢量调整值与第一分像素运动矢量调整值的和。而且,-IntegerDeltaMV是IntegerDeltaMV的对称值,即第二整像素运动矢量调整值,-SPMV是SPMV的对称值,即第二分像素运动矢量调整值,因此,-BestMVoffset=(-IntegerDeltaMV)+(-SPMV)时,即第二整像素运动矢量调整值与第二分像素运动矢量调整值的和。
实施例13:针对步骤303和步骤403,为了将第一原始运动矢量Org_MV0和第二原始运动矢量Org_MV1调整为第一目标运动矢量Refined_MV0和第二目标运动矢量Refined_MV1,实现方式与实施例12类似,不同之处在于:
将步骤b11中的“若该初始代价值cost小于4*dx*dy/2,则直接跳过后续搜索过程”移除,也就是说,即使初始代价值cost小于4*dx*dy/2,也不会“直接跳过后续搜索过程”,而是继续后续搜索过程,即需要执行步骤b12。
实施例14:针对步骤303和步骤403,为了将第一原始运动矢量Org_MV0和第二原始运动矢量Org_MV1调整为第一目标运动矢量Refined_MV0和第二目标运动矢量Refined_MV1,实现方式与实施例12类似,不同之处在于:
将步骤b11中的“若该初始代价值cost小于4*dx*dy/2,则直接跳过后续搜索过程”移除,也就是说,即使初始代价值cost小于4*dx*dy/2,也不会“直接跳过后续搜索过程”,而是继续后续搜索过程,即需要执行步骤b12。
将步骤b13中的“若最优MV仍为初始MV(即不是MVOffset)或者最小代价值为0,则不进行下一次迭代搜索过程”移除,也就是说,即使最优MV仍为初始MV或者最小代价值为0,也可以进行下一次迭代搜索过程。
实施例15:针对步骤303和步骤403,为了将第一原始运动矢量Org_MV0和第二原始运动矢量Org_MV1调整为第一目标运动矢量Refined_MV0和第二目标运动矢量Refined_MV1,实现方式与实施例12类似,不同之处在于:
将“notZeroCost”的相关过程移除,也就是说,在步骤b11和步骤b13中,不设置和保存notZeroCost的值。在步骤b21中,只要deltaMV为(0,0),就可以进行分像素偏移计算过程(即步骤b22),而不是只有当notZeroCost不为false、且deltaMV为(0,0)时,才可以进行分像素偏移计算过程。
实施例16:针对步骤303和步骤403,为了将第一原始运动矢量Org_MV0和第二原始运动矢量Org_MV1调整为第一目标运动矢量Refined_MV0和第二目标运动矢量Refined_MV1, 实现方式与实施例12类似,不同之处在于:
将步骤b21中的“只有notZeroCost不为false,且deltaMV为(0,0)时,才进行后续处理,否则,直接利用IntegerDeltaMV对原始运动矢量进行调整”,修改为“只有notZeroCost不为false,且当前最优整像素的上下左右相隔1个整像素的四个点的代价值已在步骤b1计算获得时,才进行后续处理,否则,直接利用IntegerDeltaMV对原始运动矢量进行调整”。
在一个例子中,“后续处理”是指步骤b22的分像素偏移计算过程。
在一个例子中,步骤b22的分像素偏移计算过程,需要使用最优整像素的上下左右相隔1个整像素的四个点的代价值,因此,步骤b1中已经计算获得“最优整像素的上下左右相隔1个整像素的四个点的代价值”是必要条件。
实施例17:针对步骤303和步骤403,为了将第一原始运动矢量Org_MV0和第二原始运动矢量Org_MV1调整为第一目标运动矢量Refined_MV0和第二目标运动矢量Refined_MV1,实现方式与实施例12类似,不同之处在于:
将步骤b21中的“只有notZeroCost不为false,且deltaMV为(0,0)时,才进行后续处理,否则,直接利用IntegerDeltaMV对原始运动矢量进行调整”,修改为“只要当前最优整像素的上下左右相隔1个整像素的四个点的代价值已在步骤b1计算获得时,才进行后续处理(即分像素偏移计算过程),否则,直接利用IntegerDeltaMV对原始运动矢量进行调整”。
实施例18:针对步骤303和步骤403,为了将第一原始运动矢量Org_MV0和第二原始运动矢量Org_MV1调整为第一目标运动矢量Refined_MV0和第二目标运动矢量Refined_MV1,实现方式与实施例12类似,不同之处在于:
将步骤b21中的“只有notZeroCost不为false,且deltaMV为(0,0)时,才进行后续处理,否则,直接利用IntegerDeltaMV对原始运动矢量进行调整”,修改为“若当前最优整像素的上下左右相隔1个整像素的四个点的代价值已在步骤b1计算获得时,才进行后续处理(步骤b22的分像素偏移计算过程),否则采用步骤b23进行处理”。
步骤b23、将当前最优整像素点MV_inter_org设为距离其最近的,且周围的上下左右相隔1个整像素的四个点的代价值已在步骤b1计算获得的整像素点MV_inter_nearest。然后,以MV_inter_nearest为中心,进行步骤b22的分像素偏移计算过程,也就是说,以MV_inter_nearest为中心获取SPMV。
例如,若当前最优整像素点MV_inter_org的上下左右相隔1个整像素的四个点的代价值,没有全部在步骤b1计算获得,则从最优整像素点MV_inter_org的周围选择一个整像素点MV_inter_nearest,且整像素点MV_inter_nearest的上下左右相隔1个整像素的四个点的代价值,均已经在步骤b1计算获得。
然后,将整像素点MV_inter_nearest作为当前的最优整像素点,并以整像素点MV_inter_nearest为中心获取SPMV,具体获取方式参见步骤b22。
在以整像素点MV_inter_nearest为中心获取SPMV时,参见步骤b22,在计算x 0和y 0时,x 0和y 0可以限制在[-2N,2N]的范围内。若x 0/y 0大于2N,则可以将x 0/y 0赋值为2N;若x 0/y 0小于-2N,则可以将x 0/y 0赋值为-2N。对于1/2、1/4、1/8和1/16的运动矢量像素精度,则N=1、2、4和8。
实施例19:在上述实施例中,需要确定与中心运动矢量对应的边缘运动矢量,如5个 边缘运动矢量。例如,可以将中心运动矢量(x,y)向不同方向偏移S,顺序得到不同方向的边缘运动矢量(x,y+S)、边缘运动矢量(x,y-S)、边缘运动矢量(x+S,y)、边缘运动矢量(x-S,y)、边缘运动矢量(x+right,y+down)。或者,可以将中心运动矢量(x,y)向不同方向偏移S,顺序得到不同方向的边缘运动矢量(x,y-S)、边缘运动矢量(x,y+S)、边缘运动矢量(x-S,y)、边缘运动矢量(x+S,y)、边缘运动矢量(x+right,y+down)。
例如,假设(x,y)为(0,0),S为1,则可以按照(0,1)、(0,-1)、(1,0)、(-1,0)、(right,down)的顺序,得到5个边缘运动矢量。或者,可以按照(0,-1)、(0,1)、(-1,0)、(1,0)、(right,down)的顺序,得到5个边缘运动矢量。
实施例20:在上述实施例中,边缘运动矢量(x+right,y+down)的默认值为(x-S,y-S)。若边缘运动矢量(x+S,y)的代价值小于边缘运动矢量(x-S,y)的代价值,则right为S(从-S修改为S);若边缘运动矢量(x,y+S)的代价值小于边缘运动矢量(x,y-S)的代价值,则down为S(从-S修改为S)。或者,若边缘运动矢量(x+S,y)的代价值小于或等于边缘运动矢量(x-S,y)的代价值,则right为S(从-S修改为S);若边缘运动矢量(x,y+S)的代价值小于或等于边缘运动矢量(x,y-S)的代价值,则down为S(从-S修改为S)。
例如,按照(0,1)、(0,-1)、(1,0)、(-1,0)、(right,down)的顺序,得到5个边缘运动矢量,(right,down)的默认值为(-1,-1)。若边缘运动矢量(1,0)的代价值小于边缘运动矢量(-1,0)的代价值,则right为1;若边缘运动矢量(0,1)的代价值小于边缘运动矢量(0,-1)的代价值,则down为1。或者,若边缘运动矢量(1,0)的代价值小于或等于边缘运动矢量(-1,0)的代价值,则right为1;若边缘运动矢量(0,1)的代价值小于或等于边缘运动矢量(0,-1)的代价值,则down为1。
例如,按照(0,-1)、(0,1)、(-1,0)、(1,0)、(right,down)的顺序,得到5个边缘运动矢量,(right,down)的默认值为(-1,-1)。若边缘运动矢量(1,0)的代价值小于边缘运动矢量(-1,0)的代价值,则right为1;若边缘运动矢量(0,1)的代价值小于边缘运动矢量(0,-1)的代价值,则down为1。或者,若边缘运动矢量(1,0)的代价值小于或等于边缘运动矢量(-1,0)的代价值,则right为1;若边缘运动矢量(0,1)的代价值小于或等于边缘运动矢量(0,-1)的代价值,则down为1。
实施例21:步骤303和步骤403中,针对当前块的每个子块,根据第一参考块的第一像素值和第二参考块的第二像素值对第一原始运动矢量进行调整,得到子块的第一目标运动矢量;根据第一参考块的第一像素值和第二参考块的第二像素值对第二原始运动矢量进行调整,得到子块的第二目标运动矢量。
以一个子块(如当前块的每个dx*dy大小的子块,如16*16大小的子块,或更小的一个整块)的处理过程为例,介绍原始运动矢量的调整过程。
步骤c1、以第一原始运动矢量或者第二原始运动矢量为中心,从周围的运动矢量中选择部分或全部运动矢量,将选择的运动矢量作为候选运动矢量。
例如,可以以第一原始运动矢量为中心,从周围的运动矢量中选择部分或全部运动矢量,作为候选运动矢量,对此选择方式参见后续实施例。
为了方便描述,后续实施例中,以第一原始运动矢量为中心为例。
步骤c2、根据第一参考块的第一像素值和第二参考块的第二像素值,获取第一原始运 动矢量对应的第三代价值、每个候选运动矢量对应的第四代价值。
例如,从第一参考块中复制获取第一原始运动矢量对应的子参考块A1,子参考块A1是第一原始运动矢量在第一参考块中的子参考块,子参考块A1的大小为当前块的大小。从第二参考块中复制获取第二原始运动矢量对应的子参考块B1,子参考块B1是第二原始运动矢量在第二参考块中的子参考块,子参考块B1的大小为当前块的大小。然后,利用子参考块A1的第一像素值和子参考块B1的第二像素值,获取第一原始运动矢量对应的第三代价值。
针对每个候选运动矢量,从第一参考块中复制获取候选运动矢量对应的子参考块A2,子参考块A2是候选运动矢量在第一参考块中的子参考块,子参考块A2的大小为当前块的大小。从第二参考块中复制获取候选运动矢量的对称运动矢量对应的子参考块B2,子参考块B2是对称运动矢量在第二参考块中的子参考块,子参考块B2的大小为当前块的大小。利用子参考块A2的第一像素值和子参考块B2的第二像素值,获取候选运动矢量对应的第四代价值。
步骤c3、根据第三代价值和第四代价值,从第一原始运动矢量和候选运动矢量中选择一个运动矢量,作为最优运动矢量。例如,将代价值最小的运动矢量(如第一原始运动矢量、或任意一个候选运动矢量)作为最优运动矢量。
步骤c4、根据最优运动矢量确定第一整像素运动矢量调整值(用于调整第一原始运动矢量)和第二整像素运动矢量调整值(用于调整第二原始运动矢量)。在一个例子中,可以根据最优运动矢量和第一原始运动矢量确定第一整像素运动矢量调整值,并根据第一整像素运动矢量调整值确定第二整像素运动矢量调整值,第二整像素运动矢量调整值与第一整像素运动矢量调整值对称。
例如,假设最优运动矢量为(4,6),第一原始运动矢量为(4,4),则根据最优运动矢量(4,6)和第一原始运动矢量(4,4)确定第一整像素运动矢量调整值,第一整像素运动矢量调整值为最优运动矢量(4,6)与第一原始运动矢量(4,4)的差,即第一整像素运动矢量调整值为(0,2)。
然后,根据第一整像素运动矢量调整值(0,2)确定第二整像素运动矢量调整值,第二整像素运动矢量调整值可以为(0,-2),即(0,2)的对称值。
步骤c5、根据最优运动矢量确定第一分像素运动矢量调整值(用于调整第一原始运动矢量)和第二分像素运动矢量调整值(用于调整第二原始运动矢量)。
在一个例子中,可以根据最优运动矢量对应的代价值、与最优运动矢量对应的边缘运动矢量对应的代价值,确定第一分像素运动矢量调整值,然后,根据所述第一分像素运动矢量调整值确定第二分像素运动矢量调整值。
例如,x 0=N*(E(-1,0)–E(1,0))/(E(-1,0)+E(1,0)–2*E(0,0)),y 0=N*(E(0,-1)–E(0,1))/(E(0,-1)+E(0,1)–2*E(0,0)),对于1/2、1/4、1/8和1/16的运动矢量像素精度,则N=1、2、4和8。然后,将(x0,y0)赋值给deltaMv,SPMV=deltaMv/2N,若当前为1/16的运动矢量像素精度,则SPMV为(x 0/16,y 0/16)。
SPMV是第一分像素运动矢量调整值。E(0,0)表示最优运动矢量的代价值;E(-1,0)是以最优运动矢量为中心,最优运动矢量(0,0)的边缘运动矢量(-1,0)的代价值;E(1,0)是以最优运动矢量为中心,最优运动矢量(0,0)的边缘运动矢量(1,0)的代价值;E(0,-1)是以最优运动矢量为中心,最优运动矢量(0,0)的边缘运动矢量(0,-1)的代价值;E(0,1)是以最优运动矢量为中心,最优 运动矢量(0,0)的边缘运动矢量(0,1)的代价值。针对各运动矢量的代价值,确定方式参见上述实施例。
在采用上述方式确定第一分像素运动矢量调整值后,可以根据第一分像素运动矢量调整值确定第二分像素运动矢量调整值,第二分像素运动矢量调整值是第一分像素运动矢量调整值的对称值。例如,若第一分像素运动矢量调整值为(1,0),则第二分像素运动矢量调整值为(-1,0),即(1,0)的对称值。
步骤c6、根据第一整像素运动矢量调整值和/或第一分像素运动矢量调整值,对第一原始运动矢量进行调整,得到第一目标运动矢量。
例如,第一目标运动矢量=第一原始运动矢量+第一整像素运动矢量调整值+第一分像素运动矢量调整值。当然,上述只是示例,对此不做限制。
步骤c7、根据第二整像素运动矢量调整值和/或第二分像素运动矢量调整值,对第二原始运动矢量进行调整,得到第二目标运动矢量。
例如,第二目标运动矢量=第二原始运动矢量+第二整像素运动矢量调整值+第二分像素运动矢量调整值。当然,上述只是示例,对此不做限制。
实施例22:步骤303和步骤403中,针对当前块的每个子块,根据第一参考块的第一像素值和第二参考块的第二像素值对第一原始运动矢量进行调整,得到子块的第一目标运动矢量;根据第一参考块的第一像素值和第二参考块的第二像素值对第二原始运动矢量进行调整,得到子块的第二目标运动矢量。
以一个子块(如当前块的每个dx*dy大小的子块,如16*16大小的子块或更小的整块)的处理过程为例,介绍原始运动矢量的调整过程。可以将第一原始运动矢量记为Org_MV0,将第二原始运动矢量记为Org_MV1,将第一目标运动矢量记为Refined_MV0,将第二目标运动矢量记为Refined_MV1。
步骤d1、以第一原始运动矢量为中心,从所述第一原始运动矢量周围的(2*SR+1)*(2*SR+1)个点中,选择部分或者全部运动矢量。例如,若SR=2,则从第一原始运动矢量周围的25个点中选择部分或者全部运动矢量,将其作为候选运动矢量。然后,确定第一原始运动矢量的代价值,并确定每个候选运动矢量的代价值。然后,将代价值最小的运动矢量作为最优运动矢量。
与上述实施例的步骤b1相比,步骤d1中,不需要进行迭代过程,即一次就可以选取所有待处理的候选运动矢量,而不是通过迭代过程,第一次迭代选取部分运动矢量,第二次迭代再选取部分运动矢量。基于此,由于一次性的选取所有待处理的候选运动矢量,因此,可以对这些候选运动矢量进行并行处理,得到每个候选运动矢量的代价值,从而减少计算复杂度,提高编码性能。
步骤d2、根据最优运动矢量确定IntegerDeltaMV的取值,IntegerDeltaMV的最终取值就是第一整像素运动矢量调整值,对此确定方式不再赘述。
步骤d3、以最优运动矢量为中心,获得最优的分像素偏移MV,将其记为SPMV,而SPMV的取值就是第一分像素运动矢量调整值。
步骤d3的实现过程可以参见上述步骤b2,在此不再重复赘述。
步骤d4、基于IntegerDeltaMV和SPMV,获得BestMVoffset。例如,BestMVoffset= IntegerDeltaMV+SPMV。
基于BestMVoffset获得目标运动矢量:Refined_MV0=Org_MV0+BestMVoffset;Refined_MV1=Org_MV1-BestMVoffset。
实施例23:针对步骤303和步骤403,为了将第一原始运动矢量Org_MV0和第二原始运动矢量Org_MV1调整为第一目标运动矢量Refined_MV0和第二目标运动矢量Refined_MV1,实现方式与实施例21、实施例22类似。
本实施例中,以原始运动矢量为中心,从原始运动矢量周围的共(2*SR+1)*(2*SR+1)个点中,选择全部运动矢量。例如,若SR=2,则从原始运动矢量周围的25个点中选择全部运动矢量,确定这些运动矢量的代价值,并确定每个运动矢量的代价值。然后,将代价值最小的运动矢量作为最优运动矢量。
实施例24:针对步骤303和步骤403,为了将第一原始运动矢量Org_MV0和第二原始运动矢量Org_MV1调整为第一目标运动矢量Refined_MV0和第二目标运动矢量Refined_MV1,实现方式与实施例21、实施例22类似。本实施例中,由于一次性的选取所有待处理的候选运动矢量,因此,可以对这些候选运动矢量进行并行处理,得到每个候选运动矢量的代价值,从而减少计算复杂度,提高编码性能。
本实施例中,以原始运动矢量为中心,从原始运动矢量周围的共(2*SR+1)*(2*SR+1)个点中,选择偏移不超过SR范围内的部分运动矢量。例如,从包括原始运动矢量在内的(2*SR+1)*(2*SR+1)个点中,选择N个(N大于等于1,小于等于(2*SR+1)*(2*SR+1))候选点。确定这N个点对应的运动矢量的代价值。按一定顺序扫描这N个点的代价值,选择最小代价值的运动矢量作为最优运动矢量。若代价值相等则优先选取顺序靠前的候选点。
在一个例子中,假设SR=2,则候选点可以为25个,针对这些候选点的顺序,可以采用从左到右,从上到下的顺序。参见图7A所示,这些候选点的顺序可以为:{Mv(-2,-2),Mv(-1,-2),Mv(0,-2),Mv(1,-2),Mv(2,-2),Mv(-2,-1),Mv(-1,-1),Mv(0,-1),Mv(1,-1),Mv(2,-1),Mv(-2,0),Mv(-1,0),Mv(0,0),Mv(1,0),Mv(2,0),Mv(-2,1),Mv(-1,1),Mv(0,1),Mv(1,1),Mv(2,1),Mv(-2,2),Mv(-1,2),Mv(0,2),Mv(1,2),Mv(2,2)}。
确定这25个点的运动矢量对应的代价值,并按照上述顺序进行扫描,获得代价值最小的运动矢量作为最优偏移MV,利用最优偏移MV可以确定整像素运动矢量调整值和分像素运动矢量调整值,确定方式参见上述实施例。
在另一例子中,假设SR=2,候选点可以为21个,针对这些候选点的顺序,可以采用从左到右,从上到下的顺序。参见图7B所示,这些候选点的顺序为:{Mv(-1,-2),Mv(0,-2),Mv(1,-2),Mv(-2,-1),Mv(-1,-1),Mv(0,-1),Mv(1,-1),Mv(2,-1),Mv(-2,0),Mv(-1,0),Mv(0,0),Mv(1,0),Mv(2,0),Mv(-2,1),Mv(-1,1),Mv(0,1),Mv(1,1),Mv(2,1),Mv(-1,2),Mv(0,2),Mv(1,2)}。确定这21个点的运动矢量对应的代价值,并按照上述顺序进行扫描,获得代价值最小的运动矢量作为最优偏移MV,利用最优偏移MV可以确定整像素运动矢量调整值和分像素运动矢量调整值,确定方式参见上述实施例。
在另一个例子中,假设SR=2,则候选点可以为25个,针对这些候选点的顺序,以运动矢量(0,0)为中心,采用距离中心从近到远的顺序。参见图7C所示,这些候选点的顺序可以为:{Mv(0,0),Mv(-1,0),Mv(0,-1),Mv(1,0),Mv(0,1),Mv(-1,1),Mv(-1,-1),Mv(1,-1), Mv(1,1),Mv(0,2),Mv(-2,0),Mv(0,-2),Mv(2,0),Mv(1,2),Mv(-1,2),Mv(-2,1),Mv(-2,-1),Mv(-1,-2),Mv(1,-2),Mv(2,-1),Mv(2,1),Mv(-2,2),Mv(-2,-2),Mv(2,-2),Mv(2,2)}。确定这25个点的运动矢量对应的代价值,并按照上述顺序进行扫描,获得代价值最小的运动矢量作为最优偏移MV,利用最优偏移MV可以确定整像素运动矢量调整值和分像素运动矢量调整值,确定方式参见上述实施例。
在另一例子中,假设SR=2,则候选点可以为21个,针对这些候选点的顺序,以运动矢量(0,0)为中心,采用距离中心从近到远的顺序。参见图7D所示,这些候选点的顺序为:{Mv(0,0),Mv(-1,0),Mv(0,-1),Mv(1,0),Mv(0,1),Mv(-1,1),Mv(-1,-1),Mv(1,-1),Mv(1,1),Mv(0,2),Mv(-2,0),Mv(0,-2),Mv(2,0),Mv(1,2),Mv(-1,2),Mv(-2,1),Mv(-2,-1),Mv(-1,-2),Mv(1,-2),Mv(2,-1),Mv(2,1)}。
确定这21个点的运动矢量对应的代价值,并按照上述顺序进行扫描,获得代价值最小的运动矢量作为最优偏移MV,利用最优偏移MV可以确定整像素运动矢量调整值和分像素运动矢量调整值,确定方式参见上述实施例。
在另一例子中,假设SR=2,则候选点可以为13个,针对这些候选点的顺序,以运动矢量(0,0)为中心,采用距离中心从近到远的顺序。参见图7E所示,这些候选点的顺序为:{Mv(0,0),Mv(-1,0),Mv(0,-1),Mv(1,0),Mv(0,1),Mv(-1,1),Mv(-1,-1),Mv(1,-1),Mv(1,1),Mv(0,2),Mv(-2,0),Mv(0,-2),Mv(2,0)}。确定这13个点的运动矢量对应的代价值,并按照上述顺序进行扫描,获得代价值最小的运动矢量作为最优偏移MV,利用最优偏移MV可以确定整像素运动矢量调整值和分像素运动矢量调整值,确定方式参见上述实施例。
实施例25:针对步骤303和步骤403,为了将第一原始运动矢量Org_MV0和第二原始运动矢量Org_MV1调整为第一目标运动矢量Refined_MV0和第二目标运动矢量Refined_MV1,实现方式与实施例21、实施例22类似。本实施例中,由于一次性的选取所有待处理的候选运动矢量,因此,可以对这些候选运动矢量进行并行处理,得到每个候选运动矢量的代价值,从而减少计算复杂度,提高编码性能。
本实施例中,以原始运动矢量为中心,从原始运动矢量周围的共(2*SR+1)*(2*SR+1)个点中,选择偏移不超过SR范围内的部分运动矢量。例如,从包括原始运动矢量在内的(2*SR+1)*(2*SR+1)个点中,选择N个(N大于等于1,小于等于(2*SR+1)*(2*SR+1))候选点。确定这N个点对应的运动矢量的代价值。按一定顺序扫描这N个点的代价值,选择最小代价值的运动矢量作为最优运动矢量。若代价值相等则优先选取顺序靠前的候选点。
实施例25与实施例24不同之处在于,实施例24的候选点的位置均是固定的,即与原始运动矢量无关,而实施例25的候选点的位置与原始运动矢量相关,以下结合几个具体例子进行说明。
在一个例子中,假设SR=2,则候选点可以为13个,针对这些候选点的顺序,以运动矢量(0,0)为中心,采用距离中心从近到远的顺序。而且,在距离中心的第一层候选点,顺序与原始运动矢量的大小无关,而距离中心的第二层候选点,顺序与原始运动矢量的大小有关。这些候选点的顺序为:{Mv(0,0),Mv(-1,0),Mv(0,-1),Mv(1,0),Mv(0,1),Mv(-1,1),Mv(-1,-1),Mv(1,-1),Mv(1,1),Mv(sign_H*2,0),Mv(sign_H*2,sign_V*1),Mv(0,sign_V*2),Mv(0,sign_V*2)}。第一原始运动矢量记为MV0,水平分量为MV0_Hor,垂直分量为MV0_Ver。若MV0_Hor 大于等于0,则sign_H=1;否则sign_H=-1;若MV0_Ver大于等于0,则sign_V=1;否则sign_V=-1。
确定这13个点的运动矢量对应的代价值,并按照上述顺序进行扫描,获得代价值最小的运动矢量作为最优偏移MV,利用最优偏移MV可以确定整像素运动矢量调整值和分像素运动矢量调整值,确定方式参见上述实施例。
在另一例子中,假设SR=2,则候选点可以为13个,针对这些候选点的顺序,以运动矢量(0,0)为中心,采用距离中心从近到远的顺序。而且,在距离中心的第一层候选点,顺序与原始运动矢量的大小无关,而距离中心的第二层候选点,顺序与原始运动矢量的大小有关,这些候选点的顺序为:{Mv(0,0),Mv(-1,0),Mv(0,-1),Mv(1,0),Mv(0,1),Mv(-1,1),Mv(-1,-1),Mv(1,-1),Mv(1,1),Mv(sign_H*2,0),Mv(sign_H*2,sign_V*1),Mv(0,sign_V*2),Mv(0,sign_V*2)}。第一原始运动矢量记为MV0,水平分量为MV0_Hor,垂直分量为MV0_Ver。若MV0_Hor大于0,则sign_H=1;否则sign_H=-1;若MV0_Ver大于0,则sign_V=1;否则sign_V=-1。
确定这13个点的运动矢量对应的代价值,并按照上述顺序进行扫描,获得代价值最小的运动矢量作为最优偏移MV,利用最优偏移MV可以确定整像素运动矢量调整值和分像素运动矢量调整值,确定方式参见上述实施例。
实施例26:在上述实施例中,根据第一参考块的第一像素值和第二参考块的第二像素值,获取中心运动矢量对应的第一代价值、边缘运动矢量对应的第二代价值。根据第一参考块的第一像素值和第二参考块的第二像素值,获取第一原始运动矢量对应的第三代价值、候选运动矢量对应的第四代价值。
在一个例子中,可以根据未下采样的第一像素值和未下采样的第二像素值,获取中心运动矢量对应的第一代价值、边缘运动矢量对应的第二代价值、第一原始运动矢量对应的第三代价值、候选运动矢量对应的第四代价值。
在另一个例子中,可以对第一像素值进行下采样操作,对第二像素值进行下采样操作;然后,根据下采样后的第一像素值和下采样后的第二像素值,获取中心运动矢量对应的第一代价值、边缘运动矢量对应的第二代价值、第一原始运动矢量对应的第三代价值、候选运动矢量对应的第四代价值。
在另一个例子中,可以对第一像素值进行移位和下采样操作,对第二像素值进行移位和下采样操作;然后,根据操作后的第一像素值和操作后的第二像素值,获取中心运动矢量对应的第一代价值、边缘运动矢量对应的第二代价值、第一原始运动矢量对应的第三代价值、候选运动矢量对应的第四代价值。
针对不同的情况,确定代价值的方式类似。例如,为了获取中心运动矢量对应的代价值,可以从第一参考块中复制获取中心运动矢量对应的子参考块A1,从第二参考块中复制获取中心运动矢量的对称运动矢量对应的子参考块B1,利用子参考块A1的第一像素值和子参考块B1的第二像素值,获取中心运动矢量对应的代价值。为了获取边缘运动矢量对应的代价值,可以从第一参考块中复制获取边缘运动矢量对应的子参考块A2,从第二参考块中复制获取边缘运动矢量的对称运动矢量对应的子参考块B2,利用子参考块A2的第一像素值和子参考块B2的第二像素值,获取边缘运动矢量对应的代价值,以此类推。
综上所述,为了获取运动矢量对应的代价值,从第一参考块中获取该运动矢量对应的 子参考块,从第二参考块中获取该运动矢量的对称运动矢量对应的子参考块,然后利用两个子参考块的像素值获取该运动矢量对应的代价值。
实施例27:在实施例26的基础上,根据未下采样的第一像素值(即第一参考块中的子参考块的未下采样的像素值)和未下采样的第二像素值(即第二参考块中的子参考块的未下采样的像素值),获取运动矢量对应的代价值。
在一个例子中,假设第一参考块中的子参考块为pred 0,第二参考块中的子参考块为pred 1,则根据子参考块pred 0和子参考块pred 1的所有像素值的SAD确定代价值,不需要对子参考块pred 0和子参考块pred 1的像素进行垂直下采样。
基于子参考块pred 0和子参考块pred 1的所有像素值,代价值计算公式为:
Figure PCTCN2020078849-appb-000001
在上述公式中,cost表示代价值,W为子参考块的宽度值,H为子参考块的高度值,pred 0(i,j)表示子参考块pred 0的第i列第j行的像素值,pred 1(i,j)表示子参考块pred 1的第i列第j行的像素值,abs(x)表示x的绝对值。
实施例28:在实施例26的基础上,可以对第一像素值进行下采样操作,对第二像素值进行下采样操作;可以根据下采样后的第一像素值(即第一参考块中的子参考块的下采样后的像素值)和下采样后的第二像素值(即第二参考块中的子参考块的下采样后的像素值),获取运动矢量对应的代价值。
在一个例子中,假设第一参考块中的子参考块为pred 0,第二参考块中的子参考块为pred 1,则根据子参考块pred 0和子参考块pred 1的所有像素值的SAD确定代价值。在利用所有像素值的SAD确定代价值时,对子参考块pred 0和子参考块pred 1的像素值进行垂直N倍(N为大于0的整数,可以为2)下采样。
基于子参考块pred 0和子参考块pred 1的所有像素值,代价值计算公式为:
Figure PCTCN2020078849-appb-000002
在上述公式中,cost表示代价值,W为子参考块的宽度值,H为子参考块的高度值,N表示下采样的参数,为大于0的整数,可以为2,pred 0(1+N(i-1),j)表示子参考块pred 0的第1+N(i-1)列第j行的像素值,pred 1(1+N(i-1),j)表示子参考块pred 1的第1+N(i-1)列第j行的像素值,abs(x)表示x的绝对值。
实施例29:在实施例26的基础上,对第一像素值进行移位和下采样操作,对第二像素值进行移位和下采样操作;根据操作后的第一像素值(第一参考块中的子参考块的移位和下采样后的像素值)和操作后的第二像素值(第二参考块中的子参考块的移位和下采样后的像素值),获取运动矢量对应的代价值。
在一个例子中,假设第一参考块中的子参考块为pred 0,第二参考块中的子参考块为pred 1,pred 0和pred 1均采用D比特的存储方式,即,pred 0中的每个像素值均采用D比特进行存储,pred 1中的每个像素值均采用D比特进行存储。
若D小于等于8,则根据子参考块pred 0和子参考块pred 1的所有像素值的SAD确定代价值。在利用所有像素值的SAD确定代价值时,对子参考块pred 0和子参考块pred 1的像素值 进行垂直N倍(N为大于0的整数,可以为2)下采样。基于子参考块pred 0和子参考块pred 1的所有像素值,代价值计算公式为:
Figure PCTCN2020078849-appb-000003
在上述公式中,cost表示代价值,W为子参考块的宽度值,H为子参考块的高度值,N表示下采样的参数,为大于0的整数,可以为2,pred 0(1+N(i-1),j)表示子参考块pred 0的第1+N(i-1)列第j行的像素值,pred 1(1+N(i-1),j)表示子参考块pred 1的第1+N(i-1)列第j行的像素值,abs(x)表示x的绝对值,综上可以看出,即仅计算第1行,第N+1行,第2N+1行…的差的绝对值和。
若D大于8,先将子参考块pred 0和子参考块pred 1的所有像素值移位到8比特,获得8比特的pred 0和8比特的pred 1,记为pred 0-8bit(i,j)和pred 1-8bit(i,j)。其目的是为了节省SAD计算的存储代价,8位的存储可以实现更高并行度。
pred 0_8bit(i,j)=pred 0(i,j)>>(D-8),pred 1_8bit(i,j)=pred 1(i,j)>>(D-8)
然后,对8比特的pred 0和8比特的pred 1的像素值进行垂直N倍(N为大于0的整数,可以为2)下采样,这样,代价值的计算公式可以为:
Figure PCTCN2020078849-appb-000004
在上述公式中,各个表达式的含义参见上述实施例,在此不再重复赘述。
实施例30:步骤304和步骤404中,针对当前块的每个子块,根据该子块的第一目标运动矢量以及该子块的第二目标运动矢量,对该子块的进行运动补偿。具体的,根据该子块的第一目标运动矢量确定该子块对应的第三参考块,并根据该子块的第二目标运动矢量确定该子块对应的第四参考块。根据第三参考块的第三像素值和第四参考块的第四像素值进行加权,得到该子块的预测值。
例如,基于子块的两个目标运动矢量,通过插值(如8抽头插值)获得两个方向的参考块(即第三参考块和第四参考块,包括三个分量的预测值,由于目标运动矢量可能为分像素,所以需要插值)。根据第三参考块的第三像素值和第四参考块的第四像素值进行加权,得到最终的预测值(三个分量)。
在一个例子中,可以基于子块的第一目标运动矢量,从第一参考帧中确定该子块对应的第五参考块,并对第五参考块中的像素值进行插值,得到第三参考块。可以基于子块的第二目标运动矢量,从第二参考帧中确定该子块对应的第六参考块,并对第六参考块中的像素值进行插值,得到第四参考块。
例如,假设当前块的大小为W*H,则可以基于第一目标运动矢量从第一参考帧中确定大小为A*B的第五参考块,第五参考块的大小A*B与插值方式有关,A大于W,B大于H,对此不做限制。通过对第五参考块中的像素值进行插值,可以得到大小为W*H的第三参考块,对此插值方式不做限制。可以基于第二目标运动矢量从第二参考帧中确定大小为A*B的第六参考块,第六参考块的大小A*B与插值方式有关,A大于W,B大于H。通过对第六参考块中的像素值进行插值,可以得到大小为W*H的第四参考块,对此插值方式不做限制。
在另一个例子中,基于子块的第一目标运动矢量,从第一参考帧中确定该子块对应的 第七参考块,利用第七参考块中的像素值构造第八参考块,并对第八参考块中的像素值进行插值,得到第三参考块。基于子块的第二目标运动矢量,从第二参考帧中确定该子块对应的第九参考块,利用第九参考块中的像素值构造第十参考块,并对第十参考块中的像素值进行插值,得到第四参考块。
例如,假设当前块的大小为W*H,则可以基于第一目标运动矢量从第一参考帧中确定大小为W*H的第七参考块。基于第七参考块中的像素值构造大小为A*B的第八参考块,对此构造方式不做限制。第八参考块的大小A*B与插值方式有关,A大于W,B大于H,对此不做限制。通过对第八参考块中的像素值进行插值,可以得到大小为W*H的第三参考块,对此插值方式不做限制。
又例如,假设当前块的大小为W*H,则可以基于第二目标运动矢量从第二参考帧中确定大小为W*H的第九参考块。基于第九参考块中的像素值构造大小为A*B的第十参考块,对此构造方式不做限制。第十参考块的大小A*B与插值方式有关,A大于W,B大于H,对此不做限制。通过对第十参考块中的像素值进行插值,可以得到大小为W*H的第四参考块,对此插值方式不做限制。
实施例31:在获得目标运动矢量后,基于每个子块的目标运动矢量,通过8抽头插值滤波器获得两个方向的预测值(即YUV三个分量,即上述第三参考块的预测值和第四参考块的预测值),并加权获得最终的预测值。参见图5所示,黑色区域和白色区域,是从参考帧中获取的像素值,针对灰色区域的像素值,不需要从参考帧中获取,而是可以采用拷贝相邻像素值的方式获得。
在一个例子中,首先,可以将白色区域的第一行W+FS-1个像素值,复制给灰色区域的前SR行的像素值。将白色区域的最后一行W+FS-1个像素值,复制给灰色区域的最后SR行的像素值。然后,可以将白色区域第一列的H+FS-1个像素值以及上下各SR个已获得的灰色区域的像素值,复制给灰色区域的前SR列的像素值。将白色区域最后一列的H+FS-1个像素值以及上下各SR个已获得的灰色区域的像素值,复制给灰色区域的最后SR列的像素值。
在另一个例子中,首先,可以将白色区域的第一列H+FS-1个像素值,复制给灰色区域的前SR列的像素值。将白色区域的最后一列H+FS-1个像素值,复制给灰色区域的最后SR列的像素值。然后,将白色区域第一行的W+FS-1个像素值以及左右各SR个已获得的灰色区域的像素值,复制给灰色区域的前SR行的像素值。将白色区域的最后一行的W+FS-1个像素值以及左右各SR个已获得的灰色区域的像素值,复制给灰色区域最后SR行的像素值。
实施例32:在获得目标运动矢量后,基于每个子块的目标运动矢量,通过8抽头插值滤波器获得两个方向的预测值(即YUV三个分量,即第三参考块的预测值和第四参考块的预测值),并加权获得最终的预测值。参见图5所示,黑色区域和白色区域,是从参考帧中获取的像素值,针对灰色区域的像素值,直接从参考帧对应区域拷贝获得,而不是采用拷贝相邻像素值的方式获得。这种方法简单、性能可能更好,但增加了对于参考帧的访问数据量。
实施例33:在获得目标运动矢量后,基于每个子块的目标运动矢量,通过双线性插值滤波器(此处不再是8抽头插值滤波器)获得两个方向的预测值(即YUV三个分量,即上述第三参考块的预测值和第四参考块的预测值),并加权获得最终的预测值。参见图5所示,黑色区域和白色区域,可以是从参考帧中获取的像素值。由于抽头数比较少,因此,不需要灰色 区域的像素值。
实施例34:在实施例30-实施例33中,在获得两个方向的预测值后,通过均值加权平均(即两个方向的预测值的权重相同),获得最终的预测值。或者,在获得两个方向的预测值后,通过加权平均获得最终的预测值,两个预测值的权值可以不同。例如,两个预测值的权值比例可以为1:2,1:3,2:1等。
对于编码端,权重表中可以包括1:2,1:3,2:1等权值比例,编码端可以确定每个权值比例的代价值,并确定代价值最小的权值比例,这样,编码端可以基于代价值最小的权值比例,通过加权平均获得最终的预测值。
编码端向解码端发送编码比特流时,该编码比特流携带权值比例在权重表中的索引值。这样,解码端通过解析编码比特流的索引值,从权重表中获取与该索引值对应的权值比例,基于权值比例通过加权平均获得最终的预测值。
在一个例子中,权重表可以包括但不限于{-2,3,4,5,10}。权重“-2”表示,最终预测值=(预测值1*(-2)+预测值2*(8-(-2))),即(-2*预测值1+10*预测值2)/8。权重“10”表示,权重比为10:-2,即最终预测值=(预测值1*(10)+预测值2*(-2)),即(10*预测值1-2*预测值2)/8。权重“3”表示权重比为3:5。权重“5”表示权重比为5:3。权重“4”表示权重比为4:4,即权重“4”表示权重相同。
实施例35:步骤305和步骤405中,需要保存当前块的每个子块的第一目标运动矢量和第二目标运动矢量,第一目标运动矢量和第二目标运动矢量用于后续块的编码/解码参考。例如,第一目标运动矢量和第二目标运动矢量用于当前帧的环路滤波;第一目标运动矢量和第二目标运动矢量用于后续帧的时域参考;和/或,第一目标运动矢量和第二目标运动矢量用于当前帧的空域参考。
例如,当前块的每个子块的第一目标运动矢量和第二目标运动矢量,可以用于当前块的运动补偿,也可以用于后续帧的时域参考。又例如,当前块的每个子块的第一目标运动矢量和第二目标运动矢量,可以用于当前块的运动补偿,也可以用于当前块的环路滤波过程,还可以用于后续帧的时域参考。
又例如,当前块的每个子块的第一目标运动矢量和第二目标运动矢量,可以用于当前块的运动补偿,也可以用于当前块的环路滤波过程,还可以用于后续帧的时域参考,还可以用于当前帧的空域参考,以下对此进行说明。
当前块的每个子块的第一目标运动矢量和第二目标运动矢量,可以用于空域中某些LCU(Largest Coding Unit,最大编码单元)内的块的空域参考。由于编解码顺序是从上到下,从左到右,因此,当前块的运动矢量可以被当前LCU内的其他块参考,也可以被后续相邻LCU内的块参考。由于获得的目标运动矢量所需要的计算量较大,若后续块参考当前块的目标运动矢量,则需要等待较长时间。为了避免过多等待引起的时延,只允许少数空域相邻块参考当前块的目标运动矢量,其他块则参考当前块的原始运动矢量。参见图8所示,这些少数的块包括位于当前LCU下侧的下侧LCU和右下侧LCU内的子块,而位于右侧LCU和左下侧LCU内的子块,则不可参考当前块的目标运动矢量。
实施例36:以下结合一个具体例子,对运动矢量的调整过程进行说明。运动矢量调整的具体步骤可以如下,下文中的“复制”说明不需要插值即可获得,MV为整像素偏移则可直接 从参考帧中复制,否则需要进行插值获得。
步骤e1、若当前块采用merge或skip模式,则执行下面的过程。
步骤e2、准备参考像素值(假设当前块的宽为W,高为H)。
准备用于步骤e3的整像素块:基于原始运动矢量(list0的原始运动矢量记为Org_MV0,list1的原始运动矢量记为Org_MV1),在对应参考帧的对应位置复制两块面积为(W+FS-1)*(H+FS-1)的三个分量的整像素块。
准备用于步骤e4的整像素块:在上述(W+FS-1)*(H+FS-1)的整像素块的基础上,将(W+FS-1)*(H+FS-1)的三个分量的整像素块,进行上下左右各SR行/列的扩展,扩展后得到面积为(W+FS-1+2*SR)*(H+FS-1+2*SR)的三个分量的整像素块,记为Pred_Inter0和Pred_Inter1,参考图5所示。
基于两个不同方向的运动信息进行第一次运动补偿。例如,对亮度分量(因为后续搜索过程用亮度分量计算代价值,从而降低复杂度),且基于两块面积为(W+FS-1)*(H+FS-1)的整像素参考块,通过双线性插值获得两块尺寸为(W+2*SR)*(H+2*SR)的初始参考预测值(记为Pred_Bilinear0和Pred_Bilinear1),FS为滤波器抽头数,默认为8,SR为搜索范围,即目标运动矢量与原始运动矢量最大水平/竖直分量插值,默认为2。Pred_Bilinear0/1用于步骤e3的使用。
步骤e3、对于当前块的每个dx*dy子块(16*16或更小的整块),分别获得目标运动矢量(两个目标运动矢量分别记为Refined_MV0和Refined_MV1)。
步骤e31,进行SR次迭代,获得最优的整像素MV点的整像素偏移,记为IntegerDeltaMV,将IntegerDeltaMV初始化为(0,0),每次迭代执行如下过程:
步骤e311,将deltaMV设为(0,0)。若为首次迭代过程,则基于原始运动矢量在参考像素Pred_Bilinear0/1中,复制获得两块预测值块(其实就是Pred_Bilinear0/1最中心的W*H的块),基于这两个预测值块,获得初始代价值,也就是两个方向预测值块的垂直2倍下采样后的SAD。
若该初始代价值小于4*dx*dy/2,dx和dy是当前子块的宽度和高度,则直接跳过后续搜索过程,执行步骤步骤e32,并将notZeroCost设为false。
步骤e312,如图6所示,以上述初始点为中心,按照{Mv(0,1),Mv(0,-1),Mv(1,0),Mv(-1,0),Mv(right,down)}的顺序得到五个偏移MV(这五个偏移MV均称为MVOffset),并进行这五个偏移MV的代价值的计算与比较过程。
例如,基于某个MVOffset,在参考像素Pred_Bilinear0/1中,通过MVOffset获得两块预测值块(其实就是Pred_Bilinear0中进行中心位置偏移MVOffset的W*H的块,和Pred_Bilinear1中进行中心位置偏移-MVOffset(与list0相反)的W*H的块),计算这两个块的下采样SAD作为MVOffset的代价值。保留代价值最小的MVOffset(存于deltaMV),作为下一次迭代的新的中心偏移点。
Mv(right,down)的默认值为(-1,-1),若Mv(1,0)的代价值小于Mv(-1,0)的代价值,right为1;若Mv(0,1)的代价值小于Mv(0,-1)的代价值,down为1。
基于deltaMV值更新IntegerDeltaMV:=IntegerDeltaMV+deltaMV。
步骤e313,经过迭代后,若最优MV仍为初始MV或者最小代价值为0,则不进行下 一次迭代搜索过程,执行步骤e32,并将notZeroCost设为false。否则,若迭代次数达到SR,则执行步骤e32,若迭代次数未达到SR,则将最优MV作为中心,进行下一次迭代搜索过程,即返回上述步骤e311。
步骤e32、可以以步骤e31的最优整像素MV点为中心,获得最优的分像素偏移MV,记为SPMV,将SPMV初始化为(0,0),然后执行如下过程:
步骤e321、只有notZeroCost不为false,且deltaMV为(0,0)时,才进行后续处理,否则,直接利用IntegerDeltaMV对原始运动矢量进行调整。
步骤e322、将E(x,y)表示为步骤e31所得最优MV点偏移(x,y)的MV对应代价值(步骤e31计算的代价值)。基于中心及上下左右五个点的E(x,y),可得E(x,y)最小的点的偏移(x0,y0)为:x 0=N*(E(-1,0)–E(1,0))/(E(-1,0)+E(1,0)–2*E(0,0)),y 0=N*(E(0,-1)–E(0,1))/(E(0,-1)+E(0,1)–2*E(0,0))。
在一个例子中,对于1/2、1/4、1/8和1/16的运动矢量像素精度,则N=1、2、4和8。然后,可以将(x0,y0)赋值给deltaMv,SPMV=deltaMv/2N,若当前为1/16的运动矢量像素精度,则SPMV可以为(x 0/16,y 0/16)。
若E(-1,0)=E(0,0),则水平向左偏移半个像素(deltaMv[0]=-N)。
若E(1,0)=E(0,0),则水平向右偏移半个像素(deltaMv[0]=N)。
若E(0,-1)=E(0,0),则垂直向上偏移半个像素(deltaMv[1]=-N)。
若E(0,1)=E(0,0),则垂直向下偏移半个像素(deltaMv[1]=N)。
步骤e33、基于步骤e31的整像素偏移IntegerDeltaMV和步骤e32的分像素偏移SPMV,获得最优偏移MV,记为BestMVoffset。BestMVoffset=IntegerDeltaMV+SPMV。基于BestMVoffset可以获得两个方向的目标运动矢量:Refined_MV0=Org_MV0+BestMVoffset;Refined_MV1=Org_MV1-BestMVoffset。
步骤e4、基于每个子块的目标运动矢量,进行8抽头插值获得两个方向的预测值,并加权获得最终的预测值(三个分量)。例如,基于每个子块的目标运动矢量Refined_MV0和Refined_MV1,在步骤e2准备的Pred_Inter0/1中,通过插值获得对应预测块(运动矢量可能为分像素,需插值才能获得对应像素块)。
步骤e5、目标运动矢量,用于当前块的运动补偿和后续帧的时域参考。
实施例37:上述实施例可以单独实现,也可以任意组合实现。例如,实施例13可以单独实现,实施例15可以单独实现,实施例24可以单独实现,实施例29可以单独实现。实施例13和实施例15组合实现,实施例13和实施例24组合实现,实施例13和实施例29组合实现,实施例15和实施例24组合实现,实施例15和实施例29组合实现,实施例24和实施例29组合实现,实施例13、实施例15和实施例24组合实现,实施例13、实施例15和实施例29组合实现,实施例15、实施例24和实施例29组合实现,实施例13、实施例15、实施例24和实施例29组合实现,等等,当然,上述只是几个示例,对此不做限制,本申请涉及的所有实施例,均可以单独实现或者组合实现。
实施例38:
基于与上述方法同样的申请构思,本申请实施例还提出一种编解码装置,应用于编码端或者解码端,如图9所示,为所述装置的结构图,所述装置包括:
确定模块91,用于若当前块的特征信息满足特定条件,则根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块;处理模块92,用于根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对第一原始运动矢量和第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量;编解码模块93,用于根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行编码或者解码。
所述特征信息包括以下一种或者多种:所述当前块对应的运动信息预测模式;所述当前块对应的运动信息属性;所述当前块的尺寸信息。
若所述特征信息为所述当前块对应的运动信息预测模式,所述确定模块91还用于:若所述当前块对应的运动信息预测模式为普通融合模式,则确定所述当前块对应的运动信息预测模式满足特定条件;或者,若所述当前块对应的运动信息预测模式为用于帧间预测值与帧内预测值联合生成新预测值的融合模式,则确定所述当前块对应的运动信息预测模式满足特定条件。
若所述特征信息为所述当前块对应的运动信息属性,所述确定模块91还用于:若所述当前块对应的运动信息属性为所述当前块的运动信息包括两个不同方向的运动信息,则确定所述当前块对应的运动信息属性满足特定条件;或者,若所述当前块对应的运动信息属性为所述当前块的运动信息包括两个不同方向的运动信息,所述两个不同方向的运动信息对应的两个参考帧与当前帧的距离相同,则确定所述当前块对应的运动信息属性满足特定条件;或者,若所述当前块对应的运动信息属性为所述当前块复用周围块的运动信息,则确定所述当前块对应的运动信息属性满足特定条件;或者,若所述当前块对应的运动信息属性为所述当前块的每个子块的运动信息相同,则确定所述当前块对应的运动信息属性满足特定条件。
若所述特征信息为所述当前块的尺寸信息,所述当前块的尺寸信息包括所述当前块的宽度值和所述当前块的高度值,所述确定模块91还用于:若所述当前块的宽度值位于第一区间[第一阈值,第二阈值]的范围内,则确定所述当前块的尺寸信息满足特定条件;或者,若所述当前块的高度值位于第二区间[第三阈值,第四阈值]的范围内,则确定所述当前块的尺寸信息满足特定条件;或者,若根据所述当前块的宽度值与高度值得到的面积位于第三区间[第五阈值,第六阈值]的范围内,则确定所述当前块的尺寸信息满足特定条件;或者,若所述宽度值位于第一区间[第一阈值,第二阈值]的范围内、所述高度值位于第二区间[第三阈值,第四阈值]的范围内、且所述面积位于第三区间[第五阈值,第六阈值]的范围内,则确定所述当前块的尺寸信息满足特定条件。
所述确定模块91根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块时具体用于:基于所述当前块的第一原始运动矢量,从第一参考帧中确定所述当前块对应的第一参考块;基于所述当前块的第二原始运动矢量,从第二参考帧中确定所述当前块对应的第二参考块;其中,所述第一参考块中每个像素点的第一像素值是通过对所述第一参考块中的相邻像素点的像素值进行插值得到,或者通过对所述第一参考块中的相邻像素点的像素值进行拷贝得到;所述第二参考块中每个像素点的第二像素值是通过对所述第二参考块中的相邻像素点的像素值进行插值得到,或者,通过对所述第二参考块中的相邻像素点的像素值进行拷贝得到。
所述处理模块92根据所述第一参考块的第一像素值和所述第二参考块的第二像素值, 对第一原始运动矢量和第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量时具体用于:
若所述当前块包括至少一个子块,针对所述当前块的每个子块,则根据所述第一像素值和所述第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述子块的第一目标运动矢量和第二目标运动矢量。
例如,可以根据所述第一像素值和所述第二像素值,确定所述子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值、和/或,所述子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值;根据所述第一整像素运动矢量调整值和/或第一分像素运动矢量调整值,对所述第一原始运动矢量进行调整,得到所述子块的第一目标运动矢量;根据所述第二整像素运动矢量调整值和/或第二分像素运动矢量调整值,对所述第二原始运动矢量进行调整,得到所述子块的第二目标运动矢量。
所述处理模块92根据所述第一像素值和所述第二像素值,确定所述子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值、所述子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值时具体用于:
将所述第一原始运动矢量或者第二原始运动矢量确定为中心运动矢量;
确定与所述中心运动矢量对应的边缘运动矢量;
根据所述第一像素值和所述第二像素值,获取所述中心运动矢量对应的第一代价值、所述边缘运动矢量对应的第二代价值;
根据所述第一代价值和所述第二代价值,从所述中心运动矢量和所述边缘运动矢量中选择一个运动矢量作为最优运动矢量;
判断是否满足结束条件;如果否,将所述最优运动矢量确定为中心运动矢量,返回执行确定与所述中心运动矢量对应的边缘运动矢量;
如果是,则根据所述最优运动矢量确定所述子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值;根据所述最优运动矢量确定所述子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值。
所述处理模块92确定与所述中心运动矢量对应的边缘运动矢量时具体用于:
将所述中心运动矢量(x,y)向不同方向偏移S,顺序得到不同方向的边缘运动矢量(x,y+S)、边缘运动矢量(x,y-S)、边缘运动矢量(x+S,y)、边缘运动矢量(x-S,y)、边缘运动矢量(x+right,y+down);或者,
将所述中心运动矢量(x,y)向不同方向偏移S,顺序得到不同方向的边缘运动矢量(x,y-S)、边缘运动矢量(x,y+S)、边缘运动矢量(x-S,y)、边缘运动矢量(x+S,y)、边缘运动矢量(x+right,y+down);
其中,边缘运动矢量(x+right,y+down)的默认值为(x-S,y-S);
若边缘运动矢量(x+S,y)的代价值小于边缘运动矢量(x-S,y)的代价值,则right为S;若边缘运动矢量(x,y+S)的代价值小于边缘运动矢量(x,y-S)的代价值,则down为S;或者,若边缘运动矢量(x+S,y)的代价值小于或等于边缘运动矢量(x-S,y)的代价值,则right为S;若边缘运动矢量(x,y+S)的代价值小于或等于边缘运动矢量(x,y-S)的代价值,则down为S。
所述处理模块92根据所述第一像素值和所述第二像素值,获取所述中心运动矢量对应的第一代价值、所述边缘运动矢量对应的第二代价值时具体用于:
根据未下采样的第一像素值和未下采样的第二像素值,获取所述中心运动矢量对应的第一代价值、所述边缘运动矢量对应的第二代价值;或者,
对所述第一像素值进行下采样操作,对所述第二像素值进行下采样操作;根据下采样后的第一像素值和下采样后的第二像素值,获取所述中心运动矢量对应的第一代价值、所述边缘运动矢量对应的第二代价值;或者,
对所述第一像素值进行移位和下采样操作,对所述第二像素值进行移位和下采样操作;根据操作后的第一像素值和操作后的第二像素值,获取所述中心运动矢量对应的第一代价值、所述边缘运动矢量对应的第二代价值。
所述处理模块92根据所述第一像素值和所述第二像素值,确定所述子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值、所述子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值时具体用于:
以所述第一原始运动矢量或者第二原始运动矢量为中心,从周围的运动矢量中选择部分或者全部运动矢量,将选择的运动矢量作为候选运动矢量;
根据所述第一像素值和所述第二像素值,获取所述第一原始运动矢量或者第二原始运动矢量对应的第三代价值、所述候选运动矢量对应的第四代价值;
根据所述第三代价值和所述第四代价值,从所述第一原始运动矢量或者第二原始运动矢量、所述候选运动矢量中选择一个运动矢量作为最优运动矢量;
根据所述最优运动矢量确定所述子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值;根据所述最优运动矢量确定所述子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值。
所述处理模块92根据所述最优运动矢量确定所述子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值时具体用于:根据所述最优运动矢量和所述第一原始运动矢量确定所述子块的第一整像素运动矢量调整值,并根据所述第一整像素运动矢量调整值确定所述子块的第二整像素运动矢量调整值。
所述处理模块92根据所述最优运动矢量确定所述子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值时用于:根据所述最优运动矢量对应的代价值、与所述最优运动矢量对应的边缘运动矢量对应的代价值,确定所述子块的第一分像素运动矢量调整值,根据第一分像素运动矢量调整值确定所述子块的第二分像素运动矢量调整值。
所述编解码模块93根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行编码或者解码时具体用于:若所述当前块包括至少一个子块,针对所述当前块的每个子块,根据所述子块的第一目标运动矢量确定所述子块对应的第三参考块,并根据所述子块的第二目标运动矢量确定所述子块对应的第四参考块;根据所述第三参考块的第三像素值和所述第四参考块的第四像素值进行加权,得到子块的预测值;根据每个子块的预测值确定所述当前块的预测值。
所述编解码模块93根据所述子块的第一目标运动矢量确定所述子块对应的第三参考块,并根据所述子块的第二目标运动矢量确定所述子块对应的第四参考块时具体用于:基于所述子 块的第一目标运动矢量,从第一参考帧中确定所述子块对应的第五参考块,对所述第五参考块中的像素值进行插值,得到所述第三参考块;
基于所述子块的第二目标运动矢量,从第二参考帧中确定所述子块对应的第六参考块,对所述第六参考块中的像素值进行插值,得到所述第四参考块。
所述编解码模块93根据所述子块的第一目标运动矢量确定所述子块对应的第三参考块,并根据所述子块的第二目标运动矢量确定所述子块对应的第四参考块时具体用于:基于所述子块的第一目标运动矢量,从第一参考帧中确定所述子块对应的第七参考块,利用所述第七参考块中的像素值构造第八参考块,并对所述第八参考块中的像素值进行插值,得到所述第三参考块;基于所述子块的第二目标运动矢量,从第二参考帧中确定所述子块对应的第九参考块,利用所述第九参考块中的像素值构造第十参考块,并对所述第十参考块中的像素值进行插值,得到所述第四参考块。
所述装置还包括:存储模块,用于为所述当前块存储所述第一目标运动矢量和第二目标运动矢量;其中,所述第一目标运动矢量和第二目标运动矢量用于当前帧的环路滤波、所述第一目标运动矢量和第二目标运动矢量用于后续帧的时域参考、和/或,所述第一目标运动矢量和第二目标运动矢量用于当前帧的空域参考。
实施例39:
本申请实施例提供的解码端设备,从硬件层面而言,其硬件架构示意图具体可以参见图10所示。包括:处理器101和机器可读存储介质102,所述机器可读存储介质102存储有能够被所述处理器101执行的机器可执行指令;所述处理器101用于执行机器可执行指令,以实现本申请上述示例公开的方法。例如,处理器用于执行机器可执行指令,以实现如下步骤:
若当前块的特征信息满足特定条件,则根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块;根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对第一原始运动矢量和第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量;根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行解码。
本申请实施例提供的编码端设备,从硬件层面而言,其硬件架构示意图具体可以参见图11所示。包括:处理器111和机器可读存储介质112,所述机器可读存储介质112存储有能够被所述处理器111执行的机器可执行指令;所述处理器111用于执行机器可执行指令,以实现本申请上述示例公开的方法。例如,处理器111用于执行机器可执行指令,以实现如下步骤:若当前块的特征信息满足特定条件,则根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块;根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对第一原始运动矢量和第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量;根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行编码。
基于与上述方法同样的申请构思,本申请实施例还提供一种机器可读存储介质,所述机器可读存储介质上存储有若干计算机指令,所述计算机指令被处理器执行时,能够实现本申 请上述示例公开的编解码方法。其中,上述机器可读存储介质可以是任何电子、磁性、光学或其它物理存储装置,可以包含或存储信息,如可执行指令、数据,等等。例如,机器可读存储介质可以是:RAM(Random Access Memory,随机存取存储器)、易失存储器、非易失性存储器、闪存、存储驱动器(如硬盘驱动器)、固态硬盘、任何类型的存储盘(如光盘、DVD等),或者类似的存储介质,或者它们的组合。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可以由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其它可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其它可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
而且,这些计算机程序指令也可以存储在能引导计算机或其它可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或者多个流程和/或方框图一个方框或者多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其它可编程数据处理设备上,使得在计算机或者其它可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其它可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。

Claims (22)

  1. 一种编解码方法,所述方法包括:
    若当前块的特征信息满足特定条件,则根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块;
    根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量;
    根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行编码或者解码。
  2. 根据权利要求1所述的方法,其中,
    所述特征信息包括以下一种或者多种:所述当前块对应的运动信息预测模式;所述当前块对应的运动信息属性;所述当前块的尺寸信息。
  3. 根据权利要求2所述的方法,其中,若所述特征信息为所述当前块对应的运动信息预测模式,所述当前块的特征信息满足特定条件,包括:
    若所述当前块对应的运动信息预测模式为普通融合模式,则确定所述当前块对应的运动信息预测模式满足所述特定条件;或者,
    若所述当前块对应的运动信息预测模式为用于帧间预测值与帧内预测值联合生成新预测值的融合模式,则确定所述当前块对应的运动信息预测模式满足所述特定条件。
  4. 根据权利要求2所述的方法,其中,若所述特征信息为所述当前块对应的运动信息属性,所述当前块的特征信息满足特定条件,包括:
    若所述当前块对应的运动信息属性为所述当前块的运动信息包括两个不同方向的运动信息,则确定所述当前块对应的运动信息属性满足所述特定条件;或者,
    若所述当前块对应的运动信息属性为所述当前块的运动信息包括两个不同方向的运动信息,所述两个不同方向的运动信息对应的两个参考帧与当前帧的距离相同,则确定所述当前块对应的运动信息属性满足所述特定条件;或者,
    若所述当前块对应的运动信息属性为所述当前块复用周围块的运动信息,则确定所述当前块对应的运动信息属性满足所述特定条件;或者,
    若所述当前块对应的运动信息属性为所述当前块的每个子块的运动信息相同,则确定所述当前块对应的运动信息属性满足所述特定条件。
  5. 根据权利要求2所述的方法,其中,若所述特征信息为所述当前块的尺寸信息,所述当前块的尺寸信息包括所述当前块的宽度值和所述当前块的高度值,所述当前块的特征信息满足特定条件,包括:
    若所述当前块的宽度值位于第一区间[第一阈值,第二阈值]的范围内,则确定所述当前块的尺寸信息满足所述特定条件;或者,
    若所述当前块的高度值位于第二区间[第三阈值,第四阈值]的范围内,则确定所述当前块的尺寸信息满足所述特定条件;或者,
    若根据所述当前块的宽度值与高度值得到的面积位于第三区间[第五阈值,第六阈值]的范围内,则确定所述当前块的尺寸信息满足所述特定条件;或者,
    若所述宽度值位于第一区间[第一阈值,第二阈值]的范围内,所述高度值位于第二区间[第三阈值,第四阈值]的范围内,且所述面积位于第三区间[第五阈值,第六阈值]的范围内,则确定所述当前块的尺寸信息满足所述特定条件。
  6. 根据权利要求1所述的方法,其中,所述根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块,包括:
    基于所述当前块的第一原始运动矢量,从第一参考帧中确定所述当前块对应的第一参考块;
    基于所述当前块的第二原始运动矢量,从第二参考帧中确定所述当前块对应的第二参考块,
    其中,所述第一参考块中每个像素点的第一像素值是通过对所述第一参考块中的相邻像素点的像素值进行插值得到,或者通过对所述第一参考块中的相邻像素点的像素值进行拷贝得到;
    所述第二参考块中每个像素点的第二像素值是通过对所述第二参考块中的相邻像素点的像素值进行插值得到,或通过对所述第二参考块中的相邻像素点的像素值进行拷贝得到。
  7. 根据权利要求1所述的方法,其中,所述根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量,包括:
    若所述当前块包括至少一个子块,针对所述当前块的每个子块,则根据所述第一像素值和所述第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述子块的第一目标运动矢量和第二目标运动矢量。
  8. 根据权利要求7所述的方法,其中,所述根据所述第一像素值和所述第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述子块的第一目标运动矢量和第二目标运动矢量,包括:
    根据所述第一像素值和所述第二像素值,确定所述子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值,和/或,所述子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值;
    根据所述第一整像素运动矢量调整值和/或第一分像素运动矢量调整值,对所述第一原始运动矢量进行调整,得到所述子块的第一目标运动矢量;
    根据所述第二整像素运动矢量调整值和/或第二分像素运动矢量调整值,对所述第二原始运动矢量进行调整,得到所述子块的第二目标运动矢量。
  9. 根据权利要求8所述的方法,其中,
    所述根据所述第一像素值和所述第二像素值,确定所述子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值,和/或,所述子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值,包括:
    将所述第一原始运动矢量或者第二原始运动矢量确定为中心运动矢量;
    确定与所述中心运动矢量对应的边缘运动矢量;
    根据所述第一像素值和所述第二像素值,获取所述中心运动矢量对应的第一代价值、所述边缘运动矢量对应的第二代价值;
    根据所述第一代价值和所述第二代价值,从所述中心运动矢量和所述边缘运动矢量中选择一个运动矢量作为最优运动矢量;
    判断是否满足结束条件;
    如果不满足所述结束条件,则将所述最优运动矢量确定为中心运动矢量,返回执行确定与所述中心运动矢量对应的边缘运动矢量;
    如果满足所述结束条件,则根据所述最优运动矢量确定所述子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值;根据所述最优运动矢量确定所述子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值。
  10. 根据权利要求9所述的方法,其中,
    所述确定与所述中心运动矢量对应的边缘运动矢量,包括:
    将所述中心运动矢量(x,y)向不同方向偏移S,顺序得到不同方向的边缘运动矢量(x,y+S)、边缘运动矢量(x,y-S)、边缘运动矢量(x+S,y)、边缘运动矢量(x-S,y)、边缘运动矢量(x+right,y+down);或者,
    将所述中心运动矢量(x,y)向不同方向偏移S,顺序得到不同方向的边缘运动矢量(x,y-S)、边缘运动矢量(x,y+S)、边缘运动矢量(x-S,y)、边缘运动矢量(x+S,y)、边缘运动矢量(x+right,y+down),
    其中,边缘运动矢量(x+right,y+down)的默认值为(x-S,y-S);
    其中,若边缘运动矢量(x+S,y)的代价值小于边缘运动矢量(x-S,y)的代价值,则right为S;若边缘运动矢量(x,y+S)的代价值小于边缘运动矢量(x,y-S)的代价值,则down为S;或者,
    若边缘运动矢量(x+S,y)的代价值小于或等于边缘运动矢量(x-S,y)的代价值,则right为S;若边缘运动矢量(x,y+S)的代价值小于或等于边缘运动矢量(x,y-S)的代价值,则down为S。
  11. 根据权利要求9所述的方法,其中,
    所述根据所述第一像素值和所述第二像素值,获取所述中心运动矢量对应的第一代价值、所述边缘运动矢量对应的第二代价值,包括:
    根据未下采样的第一像素值和未下采样的第二像素值,获取所述中心运动矢量对应的第一代价值、所述边缘运动矢量对应的第二代价值;或者,
    对所述第一像素值进行下采样操作,对所述第二像素值进行下采样操作;根据下采样后的 第一像素值和下采样后的第二像素值,获取所述中心运动矢量对应的第一代价值、所述边缘运动矢量对应的第二代价值;或者,
    对所述第一像素值进行移位和下采样操作,对所述第二像素值进行移位和下采样操作;根据操作后的第一像素值和操作后的第二像素值,获取所述中心运动矢量对应的第一代价值、所述边缘运动矢量对应的第二代价值。
  12. 根据权利要求8所述的方法,其中,
    所述根据所述第一像素值和所述第二像素值,确定所述子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值,和/或,所述子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值,包括:
    以所述第一原始运动矢量或者所述第二原始运动矢量为中心,从周围的运动矢量中选择部分或者全部运动矢量,将选择的运动矢量作为候选运动矢量;
    根据所述第一像素值和所述第二像素值,获取所述第一原始运动矢量或者所述第二原始运动矢量对应的第三代价值、所述候选运动矢量对应的第四代价值;
    根据所述第三代价值和所述第四代价值,从所述第一原始运动矢量或者所述第二原始运动矢量、所述候选运动矢量中选择一个运动矢量作为最优运动矢量;
    根据所述最优运动矢量确定所述子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值,并根据所述最优运动矢量确定所述子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值。
  13. 根据权利要求9或12所述的方法,其中,
    所述根据所述最优运动矢量确定所述子块的第一整像素运动矢量调整值和第二整像素运动矢量调整值,包括:
    根据所述最优运动矢量和所述第一原始运动矢量确定所述子块的第一整像素运动矢量调整值,并根据所述第一整像素运动矢量调整值确定所述子块的第二整像素运动矢量调整值。
  14. 根据权利要求9或12所述的方法,其中,
    所述根据所述最优运动矢量确定所述子块的第一分像素运动矢量调整值和第二分像素运动矢量调整值,包括:
    根据所述最优运动矢量对应的代价值、与所述最优运动矢量对应的边缘运动矢量对应的代价值,确定所述子块的第一分像素运动矢量调整值,并根据所述第一分像素运动矢量调整值确定所述子块的第二分像素运动矢量调整值。
  15. 根据权利要求1所述的方法,其中,所述根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行编码或者解码,包括:
    若所述当前块包括至少一个子块,针对所述当前块的每个子块,根据所述子块的第一目标运动矢量确定所述子块对应的第三参考块,并根据所述子块的第二目标运动矢量确定所述子块对应的第四参考块;
    根据所述第三参考块的第三像素值和所述第四参考块的第四像素值进行加权,得到所述子块的预测值;
    根据每个所述子块的预测值确定所述当前块的预测值。
  16. 根据权利要求15所述的方法,其中,所述根据所述子块的第一目标运动矢量确定所述子块对应的第三参考块,并根据所述子块的第二目标运动矢量确定所述子块对应的第四参考块,包括:
    基于所述子块的第一目标运动矢量,从第一参考帧中确定所述子块对应的第五参考块,对所述第五参考块中的像素值进行插值,得到所述第三参考块;
    基于所述子块的第二目标运动矢量,从第二参考帧中确定所述子块对应的第六参考块,对所述第六参考块中的像素值进行插值,得到所述第四参考块。
  17. 根据权利要求15所述的方法,其中,所述根据所述子块的第一目标运动矢量确定所述子块对应的第三参考块,并根据所述子块的第二目标运动矢量确定所述子块对应的第四参考块,包括:
    基于所述子块的第一目标运动矢量,从第一参考帧中确定所述子块对应的第七参考块,利用所述第七参考块中的像素值构造第八参考块,并对所述第八参考块中的像素值进行插值,得到所述第三参考块;
    基于所述子块的第二目标运动矢量,从第二参考帧中确定所述子块对应的第九参考块,利用所述第九参考块中的像素值构造第十参考块,并对所述第十参考块中的像素值进行插值,得到所述第四参考块。
  18. 根据权利要求1所述的方法,所述根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行编码或者解码之后,还包括:
    为所述当前块存储所述第一目标运动矢量和所述第二目标运动矢量,
    其中,所述第一目标运动矢量和所述第二目标运动矢量用于当前帧的环路滤波,所述第一目标运动矢量和所述第二目标运动矢量用于后续帧的时域参考,和/或所述第一目标运动矢量和所述第二目标运动矢量用于当前帧的空域参考。
  19. 一种编解码装置,所述装置包括:
    确定模块,用于若当前块的特征信息满足特定条件,则根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块;
    处理模块,用于根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量;
    编解码模块,用于根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行编码或者解码。
  20. 一种编码端设备,包括处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;
    所述处理器用于执行所述机器可执行指令,以实现如下步骤:
    若当前块的特征信息满足特定条件,则根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块;
    根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量;
    根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行编码。
  21. 一种解码端设备,包括处理器和机器可读存储介质,
    其中,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;
    所述处理器用于执行所述机器可执行指令,以实现如下步骤:
    若当前块的特征信息满足特定条件,则根据所述当前块的第一原始运动矢量确定所述当前块对应的第一参考块,根据所述当前块的第二原始运动矢量确定所述当前块对应的第二参考块;
    根据所述第一参考块的第一像素值和所述第二参考块的第二像素值,对所述第一原始运动矢量和所述第二原始运动矢量进行调整,得到所述第一原始运动矢量对应的第一目标运动矢量和所述第二原始运动矢量对应的第二目标运动矢量;
    根据所述第一目标运动矢量和所述第二目标运动矢量对所述当前块进行解码。
  22. 一种机器可读存储介质,其上存储有计算机指令,所述计算机指令在被处理器执行时,使所述处理器实现根据权利要求1-18中任一项所述的方法。
PCT/CN2020/078849 2019-03-11 2020-03-11 编解码方法与装置、编码端设备和解码端设备 WO2020182161A1 (zh)

Priority Applications (12)

Application Number Priority Date Filing Date Title
MX2021010608A MX2021010608A (es) 2019-03-11 2020-03-11 Metodo y dispositivo de codificacion y decodificacion, aparato del lado del codificador y aparato del lado del decodificador.
EP20770308.3A EP3941056A4 (en) 2019-03-11 2020-03-11 CODING AND DECODER METHOD AND DEVICE, ENCODER SIDE APPARATUS AND DECODER SIDE APPARATUS
KR1020217031720A KR102619925B1 (ko) 2019-03-11 2020-03-11 인코딩 및 디코딩 방법 및 장치, 인코딩단 기기 및 디코딩단 기기
KR1020237043887A KR102664248B1 (ko) 2019-03-11 2020-03-11 인코딩 및 디코딩 방법 및 장치, 인코딩단 기기 및 디코딩단 기기
AU2020236452A AU2020236452B2 (en) 2019-03-11 2020-03-11 Encoding and decoding method and device, encoder side apparatus and decoder side apparatus
CA3131447A CA3131447C (en) 2019-03-11 2020-03-11 Encoding and decoding method and device, encoder side apparatus and decoder side apparatus
US17/433,953 US11902563B2 (en) 2019-03-11 2020-03-11 Encoding and decoding method and device, encoder side apparatus and decoder side apparatus
JP2021552234A JP7311619B2 (ja) 2019-03-11 2020-03-11 コーデック方法及び装置、符号化デバイス及び復号化デバイス
BR112021017777A BR112021017777A2 (pt) 2019-03-11 2020-03-11 Método e dispositivos de codificação e decodificação, dispositivos do lado de codificação e dispositivos do lado de decodificação
SG11202109366VA SG11202109366VA (en) 2019-03-11 2020-03-11 Encoding and decoding method and device, encoder side apparatus and decoder side apparatus
ZA2021/06161A ZA202106161B (en) 2019-03-11 2021-08-25 Encoding and decoding method and device, encoder side apparatus and decoder side apparatus
JP2023111468A JP2023126940A (ja) 2019-03-11 2023-07-06 コーデック方法及び装置、符号化デバイス及び復号化デバイス

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910182197.8A CN111698509B (zh) 2019-03-11 2019-03-11 一种编解码方法、装置及其设备
CN201910182197.8 2019-03-11

Publications (1)

Publication Number Publication Date
WO2020182161A1 true WO2020182161A1 (zh) 2020-09-17

Family

ID=68084067

Family Applications (3)

Application Number Title Priority Date Filing Date
PCT/CN2020/078850 WO2020182162A1 (zh) 2019-03-11 2020-03-11 编解码方法与装置、编码端设备和解码端设备
PCT/CN2020/078855 WO2020182164A1 (zh) 2019-03-11 2020-03-11 编解码方法与装置、编码端设备和解码端设备
PCT/CN2020/078849 WO2020182161A1 (zh) 2019-03-11 2020-03-11 编解码方法与装置、编码端设备和解码端设备

Family Applications Before (2)

Application Number Title Priority Date Filing Date
PCT/CN2020/078850 WO2020182162A1 (zh) 2019-03-11 2020-03-11 编解码方法与装置、编码端设备和解码端设备
PCT/CN2020/078855 WO2020182164A1 (zh) 2019-03-11 2020-03-11 编解码方法与装置、编码端设备和解码端设备

Country Status (12)

Country Link
US (1) US11902563B2 (zh)
EP (1) EP3941056A4 (zh)
JP (2) JP7311619B2 (zh)
KR (1) KR102619925B1 (zh)
CN (67) CN112954329B (zh)
AU (1) AU2020236452B2 (zh)
BR (1) BR112021017777A2 (zh)
CA (2) CA3131447C (zh)
MX (1) MX2021010608A (zh)
SG (1) SG11202109366VA (zh)
WO (3) WO2020182162A1 (zh)
ZA (2) ZA202106161B (zh)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112954329B (zh) * 2019-03-11 2022-08-26 杭州海康威视数字技术股份有限公司 一种编解码方法、装置及其设备
JP7456441B2 (ja) * 2019-06-11 2024-03-27 ソニーグループ株式会社 画像処理装置及び画像処理方法
CN112770113A (zh) * 2019-11-05 2021-05-07 杭州海康威视数字技术股份有限公司 一种编解码方法、装置及其设备
CN112135145B (zh) * 2019-11-14 2022-01-25 杭州海康威视数字技术股份有限公司 一种编解码方法、装置及其设备
WO2021108969A1 (zh) * 2019-12-02 2021-06-10 Oppo广东移动通信有限公司 属性信息的预测方法、编码器、解码器、及存储介质
CN113099240B (zh) * 2019-12-23 2022-05-31 杭州海康威视数字技术股份有限公司 一种编解码方法、装置及其设备
CN113452997B (zh) * 2020-03-25 2022-07-29 杭州海康威视数字技术股份有限公司 一种编解码方法、装置及其设备
CN113810686B (zh) * 2020-06-01 2023-02-24 杭州海康威视数字技术股份有限公司 一种编解码方法、装置及其设备
CN112738522A (zh) * 2020-12-17 2021-04-30 腾讯科技(深圳)有限公司 视频编码方法、装置
CN113794885B (zh) * 2020-12-30 2022-12-23 杭州海康威视数字技术股份有限公司 一种编解码方法、装置及其设备
CN116156174B (zh) * 2023-02-23 2024-02-13 格兰菲智能科技有限公司 数据编码处理方法、装置、计算机设备和存储介质
CN116074533B (zh) * 2023-04-06 2023-08-22 湖南国科微电子股份有限公司 运动矢量预测方法、系统、电子设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685504A (zh) * 2011-03-10 2012-09-19 华为技术有限公司 视频图像的编解码方法、编码装置、解码装置及其系统
US20140270555A1 (en) * 2013-03-18 2014-09-18 Samsung Electronics Co., Ltd. Method and apparatus for encoding and decoding an image by using an adaptive search range decision for motion estimation
CN107027029A (zh) * 2017-03-01 2017-08-08 四川大学 基于帧率变换的高性能视频编码改进方法
WO2018022309A1 (en) * 2016-07-27 2018-02-01 Cisco Technology, Inc. Motion compensation using a patchwork motion field
WO2019001786A1 (en) * 2017-06-30 2019-01-03 Huawei Technologies Co., Ltd. MOTION VECTOR REFINEMENT FOR MULTI-REFERENCE PREDICTION
CN110312132A (zh) * 2019-03-11 2019-10-08 杭州海康威视数字技术股份有限公司 一种编解码方法、装置及其设备

Family Cites Families (83)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5778190A (en) * 1995-07-21 1998-07-07 Intel Corporation Encoding video signals using multi-phase motion estimation
KR100774296B1 (ko) * 2002-07-16 2007-11-08 삼성전자주식회사 움직임 벡터 부호화 방법, 복호화 방법 및 그 장치
CN1181691C (zh) * 2003-01-24 2004-12-22 杭州国芯科技有限公司 视频运动估计方法
CN1225127C (zh) * 2003-09-12 2005-10-26 中国科学院计算技术研究所 一种用于视频编码的编码端/解码端双向预测方法
KR20050045746A (ko) 2003-11-12 2005-05-17 삼성전자주식회사 계층 구조의 가변 블록 크기를 이용한 움직임 추정 방법및 장치
EP1578137A2 (en) * 2004-03-17 2005-09-21 Matsushita Electric Industrial Co., Ltd. Moving picture coding apparatus with multistep interpolation process
US20050259878A1 (en) 2004-05-20 2005-11-24 Broadcom Corporation Motion estimation algorithm
EP1662799A3 (en) * 2004-11-30 2012-05-30 Humax Co., Ltd. Video down-sampling transcoding method and device
JP2006279573A (ja) * 2005-03-29 2006-10-12 Sanyo Electric Co Ltd 符号化装置と方法、ならびに復号装置と方法
US8879857B2 (en) 2005-09-27 2014-11-04 Qualcomm Incorporated Redundant data encoding methods and device
US8750387B2 (en) * 2006-04-04 2014-06-10 Qualcomm Incorporated Adaptive encoder-assisted frame rate up conversion
JP2008011158A (ja) * 2006-06-29 2008-01-17 Matsushita Electric Ind Co Ltd 動きベクトル探索方法及び動きベクトル探索装置
CN101188772B (zh) * 2006-11-17 2010-09-22 中兴通讯股份有限公司 一种视频解码的时域错误隐蔽方法
US8315466B2 (en) * 2006-12-22 2012-11-20 Qualcomm Incorporated Decoder-side region of interest video processing
KR101403343B1 (ko) * 2007-10-04 2014-06-09 삼성전자주식회사 부화소 움직임 추정을 이용한 인터 예측 부호화, 복호화방법 및 장치
CN101477690B (zh) * 2008-12-30 2011-04-27 清华大学 一种视频帧序列中物体轮廓跟踪的方法和装置
US9654792B2 (en) * 2009-07-03 2017-05-16 Intel Corporation Methods and systems for motion vector derivation at a video decoder
KR20110017302A (ko) * 2009-08-13 2011-02-21 삼성전자주식회사 움직임 벡터의 정확도 조절을 이용한 영상 부호화, 복호화 방법 및 장치
CN101699865B (zh) * 2009-10-28 2011-06-01 山东大学 一种块运动自适应的亚像素快速搜索方法
US8315310B2 (en) 2010-01-08 2012-11-20 Research In Motion Limited Method and device for motion vector prediction in video transcoding using full resolution residuals
KR101768207B1 (ko) 2010-01-19 2017-08-16 삼성전자주식회사 축소된 예측 움직임 벡터의 후보들에 기초해 움직임 벡터를 부호화, 복호화하는 방법 및 장치
CN101815218B (zh) * 2010-04-02 2012-02-08 北京工业大学 基于宏块特征的快速运动估计视频编码方法
US9300970B2 (en) * 2010-07-09 2016-03-29 Samsung Electronics Co., Ltd. Methods and apparatuses for encoding and decoding motion vector
CN102316317B (zh) * 2010-07-10 2013-04-24 华为技术有限公司 一种生成图像预测值的方法和装置
CN101895762A (zh) * 2010-07-30 2010-11-24 天津大学 基于零检测和矢量滤波的帧频提升算法
CN102387360B (zh) * 2010-09-02 2016-05-11 乐金电子(中国)研究开发中心有限公司 视频编解码帧间图像预测方法及视频编解码器
SG10201506682SA (en) * 2010-09-30 2015-10-29 Mitsubishi Electric Corp Moving image encoding device, moving image decoding device, moving image coding method, and moving image decoding method
EP4250732B1 (en) * 2011-01-07 2024-03-20 Nokia Technologies Oy Motion prediction in video coding
EP2479994B1 (en) * 2011-01-19 2017-03-15 BlackBerry Limited Method and device for improved multi-layer data compression
CN102611886A (zh) 2011-01-22 2012-07-25 华为技术有限公司 一种运动预测或补偿方法
KR101242560B1 (ko) * 2011-03-30 2013-03-19 한양대학교 산학협력단 탐색 영역 조정 장치 및 방법
JP5786478B2 (ja) * 2011-06-15 2015-09-30 富士通株式会社 動画像復号装置、動画像復号方法、及び動画像復号プログラム
CN102447904A (zh) * 2011-10-24 2012-05-09 成都虢电智能电力科技有限公司 一种快速对视频序列进行运动估计的方法
CN102395030B (zh) * 2011-11-18 2014-05-07 杭州海康威视数字技术股份有限公司 基于视频压缩码流的运动分析方法、码流转换方法及其装置
CN103260020A (zh) * 2012-02-18 2013-08-21 张新安 一种avs-m视频编码快速整像素运动估计方法
CN102769748B (zh) * 2012-07-02 2014-12-24 华为技术有限公司 运动矢量预测方法、装置及系统
CN102833583B (zh) * 2012-07-27 2015-07-01 北京视博云科技有限公司 一种视频图像的处理方法及装置
US9357195B2 (en) * 2012-08-16 2016-05-31 Qualcomm Incorporated Inter-view predicted motion vector for 3D video
KR101975206B1 (ko) * 2012-11-23 2019-05-07 삼성전자주식회사 시간상 연속하는 물체의 움직임들에 대응하는 이미지 데이터들을 프로세싱하는 방법 및 장치
CN103297778B (zh) * 2013-05-27 2017-04-19 华为技术有限公司 一种对图像进行编、解码的方法及设备
CN104244002B (zh) * 2013-06-14 2019-02-05 北京三星通信技术研究有限公司 一种视频编/解码中运动信息的获取方法及装置
CN103338377A (zh) * 2013-07-11 2013-10-02 青岛海信信芯科技有限公司 用于确定运动估计中最优运动矢量的方法
US20150036747A1 (en) 2013-07-30 2015-02-05 Electronics And Telecommunications Research Institute Encoding and decoding apparatus for concealing error in video frame and method using same
CN104427345B (zh) * 2013-09-11 2019-01-08 华为技术有限公司 运动矢量的获取方法、获取装置、视频编解码器及其方法
US10009629B2 (en) * 2013-10-11 2018-06-26 Sony Corporation Video coding system with search range and method of operation thereof
CN103974077B (zh) * 2014-05-14 2017-04-19 东南大学 一种用于h.264编码的整数运动估计快速搜索方法
KR102311815B1 (ko) * 2014-06-19 2021-10-13 마이크로소프트 테크놀로지 라이센싱, 엘엘씨 통합된 인트라 블록 카피 및 인터 예측 모드
US10412387B2 (en) * 2014-08-22 2019-09-10 Qualcomm Incorporated Unified intra-block copy and inter-prediction
US11477477B2 (en) 2015-01-26 2022-10-18 Qualcomm Incorporated Sub-prediction unit based advanced temporal motion vector prediction
CN104661031B (zh) 2015-02-16 2017-12-22 华为技术有限公司 用于视频图像编码和解码的方法、编码设备和解码设备
US10958927B2 (en) 2015-03-27 2021-03-23 Qualcomm Incorporated Motion information derivation mode determination in video coding
CN106331703B (zh) * 2015-07-03 2020-09-08 华为技术有限公司 视频编码和解码方法、视频编码和解码装置
CN107409211B (zh) * 2015-07-30 2019-10-22 华为技术有限公司 一种视频编解码方法及装置
KR20180043787A (ko) * 2015-08-23 2018-04-30 엘지전자 주식회사 인터 예측 모드 기반 영상 처리 방법 및 이를 위한 장치
US20180249172A1 (en) * 2015-09-02 2018-08-30 Mediatek Inc. Method and apparatus of motion compensation for video coding based on bi prediction optical flow techniques
JP2018533871A (ja) * 2015-11-11 2018-11-15 サムスン エレクトロニクス カンパニー リミテッド ビデオ復号方法及びその装置、並びにビデオ符号化方法及びその装置
CN105681807B (zh) * 2016-01-06 2018-11-02 福州瑞芯微电子股份有限公司 一种基于h264协议的分像素运动矢量计算方法和装置
US11153600B2 (en) 2016-02-08 2021-10-19 Sharp Kabushiki Kaisha Motion vector generation device, prediction image generation device, video decoding device, and video coding device
US10368083B2 (en) * 2016-02-15 2019-07-30 Qualcomm Incorporated Picture order count based motion vector pruning
CN105939475A (zh) * 2016-06-06 2016-09-14 中国矿业大学 一种高质量边信息生成方法
CN116708782A (zh) 2016-07-12 2023-09-05 韩国电子通信研究院 图像编码/解码方法以及用于该方法的记录介质
US10951912B2 (en) 2016-10-05 2021-03-16 Qualcomm Incorporated Systems and methods for adaptive selection of weights for video coding
KR102435500B1 (ko) * 2016-10-06 2022-08-23 세종대학교산학협력단 비디오 신호의 복호화 방법 및 이의 장치
CN108134939B (zh) * 2016-12-01 2020-08-07 北京金山云网络技术有限公司 一种运动估计方法及装置
JP2018093346A (ja) * 2016-12-01 2018-06-14 キヤノン株式会社 画像処理装置及びその制御方法、プログラム、記憶媒体
US10750203B2 (en) * 2016-12-22 2020-08-18 Mediatek Inc. Method and apparatus of adaptive bi-prediction for video coding
EP3556096B1 (en) * 2016-12-22 2024-05-22 HFI Innovation Inc. Method and apparatus of motion refinement for video coding
US10911761B2 (en) * 2016-12-27 2021-02-02 Mediatek Inc. Method and apparatus of bilateral template MV refinement for video coding
KR102581456B1 (ko) * 2017-01-04 2023-09-21 삼성전자주식회사 비디오 복호화 방법 및 그 장치 및 비디오 부호화 방법 및 그 장치
US20180199057A1 (en) * 2017-01-12 2018-07-12 Mediatek Inc. Method and Apparatus of Candidate Skipping for Predictor Refinement in Video Coding
CN108419082B (zh) * 2017-02-10 2020-09-11 北京金山云网络技术有限公司 一种运动估计方法及装置
CN106878737B (zh) * 2017-03-02 2019-10-08 西安电子科技大学 高效视频编码中的运动估计加速方法
US10805630B2 (en) * 2017-04-28 2020-10-13 Qualcomm Incorporated Gradient based matching for motion search and derivation
CN109005412B (zh) * 2017-06-06 2022-06-07 北京三星通信技术研究有限公司 运动矢量获取的方法及设备
US10477237B2 (en) * 2017-06-28 2019-11-12 Futurewei Technologies, Inc. Decoder side motion vector refinement in video coding
CN109218733B (zh) * 2017-06-30 2022-03-29 华为技术有限公司 一种确定预测运动矢量预测的方法以及相关设备
CN117615153A (zh) * 2017-08-29 2024-02-27 株式会社Kt 视频解码和编码方法及用于存储压缩视频数据的装置
WO2019084801A1 (zh) * 2017-10-31 2019-05-09 深圳市大疆创新科技有限公司 运动估计方法和装置
CN108259912A (zh) * 2018-03-28 2018-07-06 天津大学 一种分像素运动估计的并行实现方法
CN108833923B (zh) * 2018-06-20 2022-03-29 腾讯科技(深圳)有限公司 视频编码、解码方法、装置、存储介质和计算机设备
CN108848380B (zh) * 2018-06-20 2021-11-30 腾讯科技(深圳)有限公司 视频编码和解码方法、装置、计算机设备及存储介质
CN110876059B (zh) * 2018-09-03 2022-06-10 华为技术有限公司 运动矢量的获取方法、装置、计算机设备及存储介质
JP6976916B2 (ja) * 2018-09-21 2021-12-08 Kddi株式会社 画像復号装置、画像符号化装置、画像処理システム及びプログラム

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685504A (zh) * 2011-03-10 2012-09-19 华为技术有限公司 视频图像的编解码方法、编码装置、解码装置及其系统
US20140270555A1 (en) * 2013-03-18 2014-09-18 Samsung Electronics Co., Ltd. Method and apparatus for encoding and decoding an image by using an adaptive search range decision for motion estimation
WO2018022309A1 (en) * 2016-07-27 2018-02-01 Cisco Technology, Inc. Motion compensation using a patchwork motion field
CN107027029A (zh) * 2017-03-01 2017-08-08 四川大学 基于帧率变换的高性能视频编码改进方法
WO2019001786A1 (en) * 2017-06-30 2019-01-03 Huawei Technologies Co., Ltd. MOTION VECTOR REFINEMENT FOR MULTI-REFERENCE PREDICTION
CN110312132A (zh) * 2019-03-11 2019-10-08 杭州海康威视数字技术股份有限公司 一种编解码方法、装置及其设备

Also Published As

Publication number Publication date
JP7311619B2 (ja) 2023-07-19
CN113709470A (zh) 2021-11-26
CN113709472B (zh) 2022-11-01
CN112468812A (zh) 2021-03-09
CN113709465B (zh) 2022-11-01
CN112866700B (zh) 2022-07-29
CN112468810A (zh) 2021-03-09
CN112672156B (zh) 2022-07-29
CN112969072B (zh) 2022-08-26
CN112954335A (zh) 2021-06-11
CN112954325B (zh) 2022-09-30
CN113709475A (zh) 2021-11-26
WO2020182162A1 (zh) 2020-09-17
CN112866707A (zh) 2021-05-28
CN112468813A (zh) 2021-03-09
CN113709475B (zh) 2022-11-01
CN112866703B (zh) 2022-09-30
CN112468811B (zh) 2022-07-01
CN112954335B (zh) 2022-09-30
CN112954342B (zh) 2022-01-25
CN112969072A (zh) 2021-06-15
CN112954333B (zh) 2022-07-01
CN113709471B (zh) 2022-11-01
CN112511831A (zh) 2021-03-16
CN112866704B (zh) 2022-07-29
CN113709466B (zh) 2022-11-01
CN112969069B (zh) 2022-08-26
CN112468809B (zh) 2022-07-01
CN113709469A (zh) 2021-11-26
CN113709470B (zh) 2022-11-01
CN112954336B (zh) 2022-09-30
CN112866708A (zh) 2021-05-28
CN113709474B (zh) 2022-11-01
CN112866701A (zh) 2021-05-28
CN112511829A (zh) 2021-03-16
CN112954339B (zh) 2022-08-26
CN112954341A (zh) 2021-06-11
CN112468811A (zh) 2021-03-09
CN112468814A (zh) 2021-03-09
CN112866705B (zh) 2022-08-26
CN112954327A (zh) 2021-06-11
CN112866700A (zh) 2021-05-28
CN112954329B (zh) 2022-08-26
CN112468809A (zh) 2021-03-09
CA3131447A1 (en) 2020-09-17
CN112954333A (zh) 2021-06-11
CN112954329A (zh) 2021-06-11
ZA202106161B (en) 2024-01-31
CN113709471A (zh) 2021-11-26
CN112969071A (zh) 2021-06-15
CN112887716B (zh) 2022-05-31
EP3941056A1 (en) 2022-01-19
CN112511827B (zh) 2022-07-01
CN112954331B (zh) 2022-07-29
CN113709472A (zh) 2021-11-26
CN111698509A (zh) 2020-09-22
CN112954332B (zh) 2022-08-26
CN112511825A (zh) 2021-03-16
CN112866705A (zh) 2021-05-28
KR20240005123A (ko) 2024-01-11
CN112954327B (zh) 2022-09-30
CN113709468B (zh) 2022-11-01
CN113709473B (zh) 2022-11-25
CN112954340B (zh) 2022-08-26
CN112866709B (zh) 2022-07-29
CN112954336A (zh) 2021-06-11
CN112866699A (zh) 2021-05-28
CN113709468A (zh) 2021-11-26
CN112954326B (zh) 2022-09-30
CN112866702B (zh) 2022-03-01
JP2023126940A (ja) 2023-09-12
CN112511830A (zh) 2021-03-16
CN112954326A (zh) 2021-06-11
CA3228568A1 (en) 2020-09-17
CN112511828B (zh) 2022-07-29
EP3941056A4 (en) 2022-10-05
CN112969070B (zh) 2022-08-26
CN112866708B (zh) 2022-09-30
CN112887715A (zh) 2021-06-01
CN112954330A (zh) 2021-06-11
CN112866698B (zh) 2022-08-26
CN112954338B (zh) 2022-08-26
CN112954334A (zh) 2021-06-11
CN112866706A (zh) 2021-05-28
CN112866699B (zh) 2022-11-01
CN112954340A (zh) 2021-06-11
CN112492308A (zh) 2021-03-12
CN112954331A (zh) 2021-06-11
CN112511829B (zh) 2022-07-01
CN113709473A (zh) 2021-11-26
JP2022522376A (ja) 2022-04-18
CN112954332A (zh) 2021-06-11
AU2020236452A1 (en) 2021-09-23
MX2021010608A (es) 2021-09-28
WO2020182164A1 (zh) 2020-09-17
ZA202209597B (en) 2022-12-21
CN113709465A (zh) 2021-11-26
CN112866706B (zh) 2022-07-29
CN112672156A (zh) 2021-04-16
CN112532983B (zh) 2022-07-01
CN112954342A (zh) 2021-06-11
CN110557644B (zh) 2020-11-06
CN113709467B (zh) 2022-11-01
CN112954338A (zh) 2021-06-11
CN111698509B (zh) 2022-09-30
CN112511827A (zh) 2021-03-16
AU2020236452B2 (en) 2023-03-30
CN112866707B (zh) 2022-01-25
CN112954337B (zh) 2022-07-29
CN112866702A (zh) 2021-05-28
CN112511828A (zh) 2021-03-16
CN112969070A (zh) 2021-06-15
CN112532983A (zh) 2021-03-19
KR102619925B1 (ko) 2023-12-29
BR112021017777A2 (pt) 2021-11-16
US20220167004A1 (en) 2022-05-26
CN112468812B (zh) 2022-07-01
CN112954341B (zh) 2022-08-26
CN112866703A (zh) 2021-05-28
KR20210129206A (ko) 2021-10-27
CN112511826A (zh) 2021-03-16
CN110312132A (zh) 2019-10-08
SG11202109366VA (en) 2021-09-29
US11902563B2 (en) 2024-02-13
CN112954339A (zh) 2021-06-11
CN113709469B (zh) 2022-11-01
CN112866704A (zh) 2021-05-28
CN112969069A (zh) 2021-06-15
CN112954325A (zh) 2021-06-11
CN112866698A (zh) 2021-05-28
CN110557644A (zh) 2019-12-10
CN112954328A (zh) 2021-06-11
CN113709466A (zh) 2021-11-26
CN112954337A (zh) 2021-06-11
CN112969071B (zh) 2022-08-26
CN112954328B (zh) 2022-08-26
CN110312132B (zh) 2020-05-12
CN112887716A (zh) 2021-06-01
CA3131447C (en) 2024-03-19
CN112866709A (zh) 2021-05-28
CN113709474A (zh) 2021-11-26
CN112866701B (zh) 2022-08-26
CN112887715B (zh) 2022-03-25
CN112565759A (zh) 2021-03-26
CN113709467A (zh) 2021-11-26

Similar Documents

Publication Publication Date Title
WO2020182161A1 (zh) 编解码方法与装置、编码端设备和解码端设备
WO2021088695A1 (zh) 一种编解码方法、装置及其设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20770308

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 3131447

Country of ref document: CA

ENP Entry into the national phase

Ref document number: 2021552234

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: 112021017777

Country of ref document: BR

ENP Entry into the national phase

Ref document number: 2020236452

Country of ref document: AU

Date of ref document: 20200311

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 20217031720

Country of ref document: KR

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 2021127171

Country of ref document: RU

ENP Entry into the national phase

Ref document number: 2020770308

Country of ref document: EP

Effective date: 20211011

ENP Entry into the national phase

Ref document number: 112021017777

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20210908