WO2020001624A1 - 一种运动矢量确定方法和设备 - Google Patents
一种运动矢量确定方法和设备 Download PDFInfo
- Publication number
- WO2020001624A1 WO2020001624A1 PCT/CN2019/093709 CN2019093709W WO2020001624A1 WO 2020001624 A1 WO2020001624 A1 WO 2020001624A1 CN 2019093709 W CN2019093709 W CN 2019093709W WO 2020001624 A1 WO2020001624 A1 WO 2020001624A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image block
- motion vector
- template
- candidate image
- candidate
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
- H04N19/51—Motion estimation or motion compensation
- H04N19/513—Processing of motion vectors
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
Definitions
- the present disclosure relates to the technical field of video codecs, and in particular, to a method and a device for determining a motion vector.
- Video encoding may include 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 the pixels adjacent to the coded image to effectively remove the video time domain redundancy.
- a motion vector (Motion Vector, MV) can be used to represent the relative displacement between the current image block of the current frame image and the reference image block of the reference frame image. For example, there is a strong time-domain correlation between the video image A of the current frame and the video image B of the reference frame.
- the video image B can be moved. Search to find the image block B1 (that is, the reference image block) that most closely matches the image block A1, and determine the relative displacement between the image block A1 and the image block B1, which is also 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 may 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 less than the number of bits occupied by the image block A1, the above manner can save a large number of bits.
- the transmission of the motion vector of each image block will also occupy more bits.
- the spatial correlation between candidate image blocks can also be used to predict the motion vector of the image blocks.
- the motion vector of the image block A2 adjacent to the image block A1 may be determined as the motion vector of the image block A1.
- the encoding end can send the index value of the motion vector of the image block A2 to the decoding end, and the decoding end can determine the motion vector of the image block A2, which is the motion vector of the image block A1, based on the index value. Since the number of bits occupied by the index value of the motion vector of the image block A2 is smaller than the number of bits occupied by the motion vector, the above manner can further save bits.
- the motion vector of image block A2 is determined as the motion of image block A1 Vector, there are problems such as low prediction quality and prediction error.
- the present disclosure provides a method and a device for determining a motion vector, which can help improve the accuracy of the motion vector and improve the coding performance.
- the present disclosure provides a method for determining a motion vector, which is applied to a decoder.
- the method includes: acquiring motion information of a candidate image block of a current image block; and acquiring a template of the current image block according to the motion information of the candidate image block; Obtaining a target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template; and determining a final motion vector of the current image block based on the target motion vector.
- the present disclosure provides a method for determining a motion vector, which is applied to an encoding end.
- the method includes: acquiring motion information of a candidate image block of a current image block; acquiring a template of the current image block according to the motion information of the candidate image block; According to the original motion vector corresponding to the current image block and the obtained template, a target motion vector based on the template is obtained; and an encoded bit stream is sent to a decoding end according to the original motion vector and the target motion vector.
- the present disclosure provides a decoding device, including: a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; and the processor is configured to execute the machine-executable An instruction is executed to implement the motion vector determination method steps described above.
- the present disclosure provides an encoding-side device, including: a processor and a machine-readable storage medium, where the machine-readable storage medium stores machine-executable instructions that can be executed by the processor; and the processor is configured to execute the machine-executable An instruction is executed to implement the motion vector determination method steps described above.
- the target motion vector can be obtained according to the original motion vector, and the final motion vector of the current image block is determined according to the target motion vector, instead of determining the final motion vector of the current image block according to the original motion vector. , Thereby improving the accuracy of the motion vector and improving the coding performance.
- a template of the current image block may be obtained according to the motion information of the candidate image block, and a target motion vector may be obtained according to the template of the current image block.
- the foregoing method may quickly obtain the current image block. Template, and then obtain the target motion vector based on the template, which can improve decoding efficiency and reduce decoding delay. For example, before the decoding reconstruction phase, a template of the current image block can be obtained, and a target motion vector can be obtained according to the template.
- FIG. 1 is a schematic diagram of a motion vector in an embodiment of the present disclosure.
- FIG. 2 is a flowchart of a method for determining a motion vector in an embodiment of the present disclosure.
- 3A-3O are schematic diagrams of templates of a current image block in an embodiment of the present disclosure.
- 4A and 4B are flowcharts of a method for determining a motion vector in another embodiment of the present disclosure.
- FIG. 5 is a flowchart of a method for determining a motion vector in another embodiment of the present disclosure.
- 6A and 6B are flowcharts of a method for determining a motion vector in another embodiment of the present disclosure.
- FIG. 7 is a structural diagram of a motion vector determination device in an embodiment of the present disclosure.
- FIG. 8 is a structural diagram of a motion vector determination device in another embodiment of the present disclosure.
- FIG. 9 is a hardware structural diagram of a decoder device in an embodiment of the present disclosure.
- FIG. 10 is a hardware structure diagram of an encoding-side device in an embodiment of the present disclosure.
- first, second, third, etc. may be used to describe various information in the embodiments of the present disclosure, these 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 the second information, and similarly, the second information may also be referred to as the first information.
- word “if” can be interpreted as "at” or “at " or "in response to a determination”.
- a method for determining a motion vector is provided in an embodiment of the present disclosure.
- the method may involve the following concepts:
- Motion Vector In inter-frame coding, the motion vector is used to represent the relative displacement between the current image block of the current frame image and the reference image block of the reference frame image. Each image block has a corresponding motion vector. Send to the decoder. If the motion vector of each image block is independently encoded and transmitted, it consumes a considerable number of bits, especially when the number of image blocks is very large. In order to reduce the number of bits used to encode the motion vector, the spatial correlation between adjacent image blocks can be used to predict the motion vector of the current image block to be encoded according to the motion vector of the adjacent encoded image block, and then the prediction difference is Encoding, this can effectively reduce the number of bits representing the motion vector.
- Motion Information Since the motion vector indicates 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, it is necessary to refer to the index information of the frame image to indicate which one to use Reference frame image.
- a reference frame image list can usually be established, and the reference frame index indicates that the current image block uses the reference frame image in the reference frame image list.
- Motion-related information such as motion vectors and reference frame indexes can be collectively referred to as motion information.
- the coding process is performed on an image-by-image block basis.
- the reconstruction information of the surrounding encoded image blocks can be used.
- the template refers to the encoding / decoding information of a fixed shape around the current image block (adjacent areas in the time domain or the spatial domain).
- the template is exactly the same at the encoding end and the decoding end. Therefore, some operations performed by the template at the encoding end can be used to obtain completely consistent results at the decoding end, that is, the information derived by the encoding end based on the template can be Lossless recovery at the decoding end without the need to pass additional information, thereby further reducing the number of transmitted bits.
- Rate-Distortion Optimized There are two major indicators for evaluating coding efficiency: code rate (also known as Bit Rate, Second, BPS) and PSNR (Peak Signal to Noise Ratio), bit stream The smaller the compression ratio is, the larger the PSNR is, the better the reconstructed image quality is.
- code rate also known as Bit Rate, Second, BPS
- PSNR Peak Signal to Noise Ratio
- SSE Sud-Square Error
- the mean square sum of the difference of the image ⁇ is a Lagrangian multiplier
- R is the actual number of bits required for image block encoding in this encoding mode, including the bits required for encoding mode information, motion information, prediction residuals, etc. sum.
- Intra prediction The reconstructed pixel values of spatially adjacent image blocks (such as in the same frame as the current image block) of the current image block can be used for predictive coding, and interprediction: the current image can be used The reconstructed pixel values of time-domain neighboring image blocks of the block (such as images in different frames from the current image block) are predictively encoded.
- a method for determining a motion vector is provided in an embodiment of the present disclosure, and can be applied to an inter-frame coding technology.
- a motion vector may be used to represent a relative displacement between a current image block of a current frame image and a reference image block of a reference frame image.
- video image A is a current frame image
- image block A1 is a current image block
- video image B is a reference frame image of video image A
- image block B1 is a reference image block of image block A1.
- motion search can be performed in video image B to find image block B1 that best matches image block A1 And determine the relative displacement between image block A1 and image block B1, and the relative displacement is also the motion vector of image block A1.
- the motion vector is (-6, 4), which indicates that the image block B1 is moved 6 pixels to the left relative to the image block A1 in the horizontal direction and 4 pixels upwards relative to the image block A1 in the vertical direction. point.
- the encoded bit stream carries the motion vector (-6, 4) of the image block A1, not the image block A1.
- the decoder can obtain the motion vector (-6, 4) of image block A1. Based on the position and motion vector (-6, 4) of image block A1, determine the image block B1 in video image B Position, that is: from the position of image block A1, move 6 pixels to the left and up 4 pixels to get the position of image block B1, read image block B1 from the position of image block B1, and use the image block B1 reconstructs the image block A1.
- the similarity between the image block B1 and the image block A1 is very high, using the image block B1 to reconstruct the image block A1 can reconstruct an image with a high degree of similarity. Since the number of bits occupied by the motion vector is less than the number of bits occupied by the image block A1, a large number of bits are saved by carrying the motion vector in the encoded bit stream instead of carrying the image block A1.
- the motion vector determines the motion vector of the image block A1.
- an image block adjacent to image block A1 may include: image block A2, image block A3, image block A4, and image block A5, and the motion vector list includes the motion vector A21 of image block A2, The motion vector A31 of the image block A3, the motion vector A41 of the image block A4, and the motion vector A51 of the image block A5.
- a motion vector can be selected from the motion vector list. Assume that the motion vector A21 is selected, and the motion vector A21 is used as the original motion vector. The original motion vector A21 is used to obtain the target motion vector, and the target motion vector is used as the image. Final motion vector for block A1.
- a target motion vector different from the original motion vector A21 is obtained based on the original motion vector A21, and the target motion vector is different from the image block A1.
- the motion vector is closest, so the target motion vector can be used as the final motion vector of the image block A1.
- the above method of “using the target motion vector as the final motion vector of the image block A1” can solve the problem of low prediction quality and prediction. Problems such as errors.
- the encoded bit stream carries the index value of the original motion vector A21 (that is, the index value in the motion vector list), rather than the motion vector of the image block A1 (-6, 4), not even image block A1.
- the decoder can obtain the index value of the original motion vector A21, and obtain the original motion vector A21 from the motion vector list according to the index value, and obtain the target motion vector according to the original motion vector A21, which is the target motion vector.
- the final motion vector of the image block A1 so as to obtain the final motion vector of the image block A1.
- the bits can be further saved.
- the decoded information (such as reconstruction information or prediction information) of the adjacent image block of the current image block can be used to obtain the template of the current image block, and the template of the current image block and the original motion can be used.
- Vector gets target motion vector.
- the decoded information of the adjacent image block is reconstruction information
- the generation of the template of the current image block needs to wait until the decoding and reconstruction stage, which greatly reduces the decoding efficiency and brings the decoding delay.
- the decoding information is prediction information, so the generation of the template of the current image block also needs to wait until the decoding and reconstruction stage, which greatly reduces the decoding efficiency and brings the decoding delay. Therefore, the above-mentioned manner will greatly affect the parallelism of decoding.
- a better template generation method is proposed. Different from the method of using reconstruction information and prediction information to generate a template, it can be based on the motion information (such as motion vector) of the candidate image block of the current image block. And reference frame index, etc.) to obtain the template of the current image block. Then, the target motion vector can be obtained according to the template of the current image block and the original motion vector, thereby improving efficiency.
- the motion information such as motion vector
- reference frame index etc.
- FIG. 2 is a schematic flowchart of a method for determining a motion vector
- the method may include:
- Step 201 The encoder obtains motion information of a candidate image block of the current image block.
- the candidate image block of the current image block may include, but is not limited to, a spatial-domain candidate image block of the current image block; or a time-domain candidate image block of the current image block; there is no limitation on this candidate image block.
- the candidate image block of the current image block has been encoded, that is, the motion information of the candidate image block is known, so the encoding end can directly obtain the motion information of the candidate image block, such as the candidate There are no restrictions on the motion vector and reference frame index of the image block.
- Step 202 The encoder obtains a template of the current image block according to the motion information of the candidate image block.
- Step 203 The encoding end obtains a template-based target motion vector according to the original motion vector corresponding to the current image block and the obtained template, and the target motion vector may be different from the original motion vector.
- the original motion vector of the current image block may be obtained first.
- the motion vector list at the encoding end includes motion vector A21, motion vector A31, motion vector A41, and motion vector A51 in sequence.
- a motion vector can be selected from the motion vector list, and the selected motion vector is the original motion vector of the image block A1.
- the above manner is only an example, and there is no limitation on this.
- the default motion vector may be directly determined as the original motion vector.
- the encoding end selects a motion vector from the motion vector list, which may include: the encoding end selects the first motion vector from the motion vector list; or, selects the last motion vector from the motion vector list; or, selects the motion vector from the motion vector list.
- a motion vector is randomly selected in the method; or a motion vector is selected from the motion vector list using a hash algorithm.
- the above method is only a few examples, and there is no limitation on this, as long as the motion vector can be selected from the motion vector list.
- the motion vector list is used to record a motion vector of an image block adjacent to the current image block. For example, after obtaining the motion vector A21 of the image block A2, the motion vector A21 may be recorded in the motion vector list, and after obtaining the motion vector A31 of the image block A3, the motion vector A31 may be recorded in the motion vector list, so as to By analogy, in the end, the motion vector list of image block A1 can be obtained.
- Step 204 The encoding end sends an encoded bit stream to the decoding end according to the original motion vector and the target motion vector.
- the encoding end can obtain the encoding performance of the original motion vector and the encoding performance of the target motion vector.
- the encoded bit stream corresponding to the current image block sent to the decoding end may carry first indication information, which is used to instruct the decoding end to determine based on the template The final motion vector of the current image block.
- the encoded bitstream corresponding to the current image block sent to the decoding end may carry second instruction information, and the second instruction information is used to indicate that the The original motion vector determines the final motion vector of the current image block.
- the foregoing manner is to notify the first indication information or the second indication information in an explicit manner.
- the notification may also be performed in an implicit manner, that is, the first indication information or the second indication information is not carried in the encoded bit stream.
- the encoding end and the decoding end can also negotiate a motion vector decision strategy or store the encoding vector and the decoding end by defining a policy in a standard.
- the motion vector decision strategy may be first strategy information, where the first strategy information is used to indicate that a final motion vector of the current image block is determined based on a template; or, second strategy information, which is used to indicate that the current image block is based on the current image.
- the original motion vector corresponding to the block determines the final motion vector of the current image block; or, the third policy information indicates that the same policy information as the candidate image block of the current image block is used to determine the final of the current image block.
- Motion vector may be first strategy information, where the first strategy information is used to indicate that a final motion vector of the current image block
- the encoded bit stream corresponding to the current image block may not carry the first indication information and the second indication information.
- the encoded bit stream corresponding to the current image block may not carry the first indication information and the second indication information.
- the encoded bit stream may not carry the first The indication information and the second indication information; when the neighboring image block adopts the second policy information and the encoding performance of the original motion vector is better than the encoding performance of the target motion vector, the encoded bit stream corresponding to the current image block may not carry the first Instruction information and second instruction information.
- the encoding end sends the encoded bit stream to the decoding end according to the original motion vector and the target motion vector, and may further include: obtaining an index value of the original motion vector in the motion vector list of the current image block; The encoded bit stream of the index value. For example, if the original motion vector is motion vector A21 and motion vector A21 is the first motion vector in the motion vector list, the index value may be 1.
- the target motion vector can be obtained based on the original motion vector and the final motion vector of the current image block can be determined based on the target motion vector, instead of determining the final motion vector of the current image block based on the original motion vector, thereby improving the motion vector's Accuracy improves encoding performance.
- a template of the current image block may be obtained according to the motion information of the candidate image block, and a target motion vector may be obtained according to the template of the current image block.
- the foregoing method may quickly obtain the current image block. Template, and then obtain the target motion vector based on the template, which can improve decoding efficiency and reduce decoding delay. For example, before the decoding reconstruction phase, a template of the current image block can be obtained, and a target motion vector can be obtained according to the template of the current image block.
- each image block of each frame of image is encoded one by one.
- the encoding information of the adjacent image blocks can be used. Reconstruct the current image block.
- the encoding information of the neighboring image blocks of the current image block may be used to obtain the template of the current image block.
- the encoding information may include, but is not limited to, reconstruction information of adjacent image blocks and / or prediction information of adjacent image blocks.
- the reconstruction information may include, but is not limited to, a luminance value, a chrominance value, and the like; the prediction information may be an intermediate value capable of obtaining reconstruction information. For example, if a luminance value can be obtained using the intermediate value A, the intermediate value A is prediction information. This prediction information is not limited.
- the template generation of the current image block needs to wait until the reconstruction stage, which greatly reduces the decoding efficiency and brings decoding delay; while the encoding information is prediction information, the The generation also needs to wait until the reconstruction stage, which greatly reduces the decoding efficiency and brings decoding delay. Therefore, the above-mentioned method will greatly affect the parallelism of encoding and decoding.
- a better template generation method is proposed. Different from the method of using reconstruction information and prediction information to generate a template, it can be based on the motion information (such as motion vector) of the candidate image block of the current image block. And reference frame index, etc.)
- the method of obtaining the template of the current image block, and the method of obtaining the template of the current image block according to the motion information of the candidate image block can be applied at the encoding end and the decoding end.
- Obtaining a template of the current image block according to the motion information of the candidate image block may include: when the motion information of the candidate image block includes a motion vector of the candidate image block and a reference frame index, determining the candidate image block corresponding to the reference frame index A reference frame image according to the motion vector; obtaining a reference image block corresponding to the candidate image block from the reference frame image according to the motion vector, and obtaining a template of the current image block according to the reference image block.
- image block A1 is the current image block
- image block A2 and image block A3 are candidate image blocks of image block A1.
- image block A2 if the reference frame index of image block A2 is the index of video image B, it can be determined that the reference frame image corresponding to image block A2 is video image B according to the reference frame index; then, select from video image B and Image block B2 corresponding to image block A2, that is, the position of image block B2 in video image B is the same as the position of image block A2 in video image A; then, image block B2 can be moved according to the motion vector of image block A2 For example, if the motion vector (3, 3) is used to move the image block B2 to obtain the image block B2 'corresponding to the image block B2 (such as moving 3 pixels to the right and 3 pixels upward), the image block B2' is the image Reference image block corresponding to block A2.
- the reference image block corresponding to the image block A3 is the image block B3 '.
- the template of the image block A2 may be determined according to the image block B2 'and the image block B3', as shown in FIG. 3A.
- the candidate image block may include M first candidate image blocks and N second candidate image blocks, where M is a natural number greater than or equal to 1, N is a natural number greater than or equal to 0, or M is greater than or A natural number equal to 0, and N is a natural number greater than or equal to 1.
- the first candidate image block is a candidate image block on the upper side of the current image block
- the second candidate image block is a candidate image block on the left side of the current image block.
- Obtaining a template of the current image block according to the motion information of the candidate image block may include, but is not limited to, determining the first template according to the motion vector prediction mode and the motion information of the M first candidate image blocks; and determining the second candidate image block according to the N second candidate image blocks.
- a motion vector prediction mode and motion information to determine a second template Then, the first template is determined as the template of the current image block; or the second template is determined as the template of the current image block; or the first template and the second template are stitched and determined as the template of the current image block.
- a first template may be determined according to the motion vector prediction mode and motion information of the M first candidate image blocks, and the first template may be determined as the current image block Template.
- N is a natural number greater than or equal to 1
- M is 0, a second template may be determined according to the motion vector prediction mode and motion information of the N second candidate image blocks, and the second template may be determined as a template of the current image block. .
- a first template may be determined based on the motion vector prediction mode and motion information of the M first candidate image blocks, and according to the N second candidate images Block motion vector prediction mode and motion information, determine the second template, determine the first template as the template of the current image block; or determine the second template as the template of the current image block; or stitch the first template and the second template It is then determined as the template of the current image block.
- the first candidate image block includes an adjacent image block and / or a second-neighboring image block on the upper side of the current image block; the prediction mode of the adjacent image block is an inter mode or an intra mode; the prediction mode of the second-neighbor image block is Inter mode.
- the first candidate image block may include at least one adjacent image block whose prediction mode is inter mode, for example, all adjacent image blocks on the upper side of the current image block, or the first adjacent image on the upper side of the current image block. Block, or any one or more adjacent image blocks above the current image block.
- the first candidate image block may further include at least one second neighboring image block whose prediction mode is the inter mode, for example, on the upper side of the current image block. All neighboring image blocks of, or the first neighboring image block above the current image block, or any one or more neighboring image blocks above the current image block.
- the first candidate image block may further include adjacent image blocks in the intra mode, for example, in the first frame on the upper side of the current image block. The adjacent image blocks of the mode, the adjacent image blocks of all intra modes on the upper side of the current image block, and so on.
- the above is only an example of the first candidate image block, which is not limited thereto.
- the second candidate image block includes an adjacent image block and / or a second-neighboring image block on the left side of the current image block; the prediction mode of the adjacent image block is an inter mode or an intra mode; and the prediction mode of the second-neighbor image block is Inter mode.
- the second candidate image block may include at least one adjacent image block whose prediction mode is inter mode, for example, all adjacent image blocks to the left of the current image block, or the first adjacent image to the left of the current image block. Block, or any one or more adjacent image blocks to the left of the current image block.
- the second candidate image block may further include at least one second-neighbor image block with a prediction mode of inter mode, for example, the left side of the current image block All neighboring image blocks of, or the first neighboring image block to the left of the current image block, or any one or more neighboring image blocks to the left of the current image block.
- the second candidate image block may further include adjacent image blocks in the intra mode, for example, in the first frame on the left side of the current image block. The neighboring image blocks of the pattern, the neighboring image blocks of all intra modes on the left side of the current image block, and so on.
- the above is only an example of the second candidate image block, which is not limited.
- the adjacent image blocks of the current image block include, but are not limited to, spatially adjacent image blocks of the current image block (that is, adjacent image blocks in the same frame of image); or time-domain adjacent image blocks of the current image block ( (Ie, adjacent image blocks in different frame images).
- the second-neighbor image block of the current image block includes, but is not limited to, the spatially-neighbor image block of the current image block (that is, the second-neighbor image block in the same frame image); or the time-domain next-neighbor image block of the current image block (that is, different The next-most neighboring image block in the frame image).
- the first template when M is greater than 1, the first template may include M sub-templates or P sub-templates, and is stitched from M sub-templates or P sub-templates, and P may be the first candidate image block of the inter-frame mode. , P is less than or equal to M.
- the first template when the M first candidate image blocks are all candidate image blocks of the inter mode, the first template may include M sub-templates, and the M sub-templates are stitched together.
- the M first candidate image blocks include P inter-mode candidate image blocks and include MP intra-mode candidate image blocks
- the first template when the M first candidate image blocks include P inter-mode candidate image blocks and include MP intra-mode candidate image blocks, the first template may include M sub-templates (that is, each candidate image Block corresponds to one sub-template) and is composed of M sub-templates.
- the first template may include P sub-templates (that is, P sub-templates corresponding to P inter-mode candidate image blocks), and the P
- the first template may include a first sub-template, which may be determined according to a motion vector prediction mode and motion information of a first candidate image block on the upper side of the current image block; or The first sub-template may be determined according to a motion vector prediction mode and motion information of any candidate image block on the upper side of the current image block.
- the first candidate image block includes at least one neighboring image block or a second neighboring image block whose prediction mode is the inter mode
- the first template includes the neighboring image blocks of the inter mode or The first sub-template corresponding to the next neighboring image block.
- the motion information may include a motion vector and a reference frame index of the first candidate image block.
- the first template is determined according to the motion vector prediction mode and motion information of the M first candidate image blocks, and may include: not limited to:
- Case 1 For the i-th candidate image block among the M first candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an inter mode, the reference frame of the i-th candidate image block is used The index determines the reference frame image corresponding to the i-th candidate image block; according to the motion vector of the i-th candidate image block, the reference image block corresponding to the i-th candidate image block is determined from the reference frame image, and the reference image block and the first The relative position offset of the i candidate image blocks matches the motion vector of the ith candidate image block; then, according to the determined reference image block, an image block having a size of the first horizontal length and the first vertical length can be obtained as
- the first template includes an i-th sub-template.
- Case 2 For the i-th candidate image block among the M first candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, the i-th candidate image block is set to a default value (Such as the default pixel value, which can be a brightness value that is pre-configured based on experience) padding, based on the image blocks filled with the default values, to obtain image blocks of the first horizontal length and the first vertical length as the i-th included in the first template Child templates.
- a default value Such as the default pixel value, which can be a brightness value that is pre-configured based on experience
- Case 3 For the i-th candidate image block among the M first candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, according to the reference frame corresponding to the i-th candidate image block The index determines the reference frame image corresponding to the i-th candidate image block; and determines the reference image block corresponding to the i-th candidate image block from the reference frame image according to the motion vector corresponding to the i-th candidate image block.
- the relative position offset of the candidate image blocks matches the motion vector corresponding to the i-th candidate image block (for example, equal or approximately equal); according to the determined reference image block, the size is obtained as the first horizontal length and the first vertical length
- the image block as the i-th sub-template included in the first template; wherein the reference frame index and motion vector corresponding to the i-th candidate image block are reference frame indices and motion vectors of neighboring image blocks of the i-th candidate image block .
- the first horizontal length and the horizontal length of the first candidate image block satisfy a first proportional relationship (such as 1: 1, 1: 2, 2: 1, etc., which is not limited), or the horizontal length of the current image block Meet the second proportional relationship (such as 1: 1, 1: 2, 2: 1, etc.), or be equal to the first preset length (configured according to experience).
- a first proportional relationship such as 1: 1, 1: 2, 2: 1, etc., which is not limited
- the horizontal length of the current image block Meet the second proportional relationship (such as 1: 1, 1: 2, 2: 1, etc.), or be equal to the first preset length (configured according to experience).
- the first vertical length and the vertical length of the first candidate image block satisfy a third proportional relationship (such as 1: 1, 1: 2, 2: 1, etc.), or the vertical length of the current image block satisfies a fourth proportional relationship ( (Such as 1: 1, 1: 2, 2: 1, etc.), or equal to a second preset length (that is, a length configured according to experience).
- a third proportional relationship such as 1: 1, 1: 2, 2: 1, etc.
- a fourth proportional relationship (Such as 1: 1, 1: 2, 2: 1, etc.), or equal to a second preset length (that is, a length configured according to experience).
- the first proportional relationship, the second proportional relationship, the third proportional relationship, and the fourth proportional relationship may be set to be the same or different.
- the first preset length and the second preset length may be set to be the same or different.
- the second template when N is greater than 1, may include N sub-templates or R sub-templates, and is spliced from N sub-templates or R sub-templates, and R may be a second candidate image block of the inter-frame mode. Number, R is less than or equal to N.
- the second template when the N second candidate image blocks are all candidate image blocks in the inter mode, the second template may include N sub-templates, and is formed by splicing the N sub-templates.
- the second template may include N sub-templates (that is, each candidate image Block corresponds to one sub-template) and is formed by splicing N sub-templates, or the second template may include R sub-templates (that is, R sub-templates corresponding to R inter-frame mode candidate image blocks), and is spliced by R sub-templates Made.
- the second template may include a second sub-template, which may be determined according to a motion vector prediction mode and motion information of a first candidate image block on the left side of the current image block; or The second sub-template may be determined according to a motion vector prediction mode and motion information of any candidate image block on the left side of the current image block.
- the second candidate image block since the second candidate image block includes at least one neighboring image block or the next neighboring image block whose prediction mode is the inter mode, when N is equal to 1, the second template includes the neighboring image blocks of the inter mode or The second sub-template corresponding to the next-neighbor image block.
- the motion information may include a motion vector and a reference frame index of the second candidate image block.
- the second template is determined according to the motion vector prediction mode and motion information of the N second candidate image blocks, and may include: not limited to:
- Case 1 For the i-th candidate image block of the N second candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an inter mode, the i-th candidate image is determined according to the reference frame index Reference frame image corresponding to the block; according to the motion vector of the i-th candidate image block, a reference image block corresponding to the i-th candidate image block is determined from the reference frame image, and the relative of the reference image block to the i-th candidate image block The position offset matches the motion vector of the i-th candidate image block; then, according to the determined reference image block, an image block having a size of the second horizontal length and the second vertical length can be obtained as the i-th included in the second template Child templates.
- Case 2 For the i-th candidate image block of the N second candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, the i-th candidate image block is set to a default value (Such as the default pixel value, which can be a brightness value pre-configured according to experience) padding, based on the image blocks filled with the default values, to obtain image blocks of the second horizontal length and the second vertical length as the i-th included in the second template Child templates.
- a default value Sud as the default pixel value, which can be a brightness value pre-configured according to experience
- Case 3 For the i-th candidate image block of the N second candidate image blocks, when it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, according to the reference frame corresponding to the i-th candidate image block The index determines the reference frame image corresponding to the i-th candidate image block; and determines the reference image block corresponding to the i-th candidate image block from the reference frame image according to the motion vector corresponding to the i-th candidate image block.
- the relative position offset of the candidate image blocks matches the motion vector corresponding to the i-th candidate image block (for example, equal or approximately equal); according to the determined reference image block, the size is obtained as the second horizontal length and the second vertical length
- the image block as the i-th sub-template included in the second template; wherein the reference frame index and motion vector corresponding to the i-th candidate image block are reference frame indices and motion vectors of neighboring image blocks of the i-th candidate image block .
- the second horizontal length and the horizontal length of the second candidate image block satisfy a fifth proportional relationship (such as 1: 1, 1: 2, 2: 1, etc., which is not limited), or the horizontal length of the current image block Meet the sixth proportional relationship (such as 1: 1, 1: 2, 2: 1, etc.), or be equal to the third preset length (configured according to experience).
- a fifth proportional relationship such as 1: 1, 1: 2, 2: 1, etc., which is not limited
- the horizontal length of the current image block Meet the sixth proportional relationship (such as 1: 1, 1: 2, 2: 1, etc.), or be equal to the third preset length (configured according to experience).
- the second vertical length and the vertical length of the second candidate image block satisfy a seventh proportional relationship (such as 1: 1, 1: 2, 2: 1, etc.), or the vertical length of the current image block satisfies an eighth proportional relationship ( (Such as 1: 1, 1: 2, 2: 1, etc.), or equal to the fourth preset length (that is, a length configured according to experience).
- the fifth proportional relationship, the sixth proportional relationship, the seventh proportional relationship, and the eighth proportional relationship may be set to be the same or different.
- the third preset length and the fourth preset length may be set to be the same or different.
- obtaining the template of the current image block according to the motion information of the candidate image block may further include but is not limited to: when the current image block corresponds to multiple motion information (including the original motion vector of the current image block), according to each The motion information acquires a template corresponding to the motion information.
- a weight corresponding to each motion information is obtained, and a template of the current image block is obtained according to the weight corresponding to each motion information and the template corresponding to the motion information. For example, based on the weight corresponding to each motion information and the template corresponding to the motion information, a template of the current image block is obtained based on a weighted average method.
- the current image block corresponds to the motion information A and the motion information B
- the template TA corresponding to the motion information A is obtained by using the foregoing embodiment
- the template TB corresponding to the motion information B is obtained by using the foregoing embodiment.
- the weight W1 of the motion information A and the weight W2 of the motion information B can be obtained.
- the template of the current image block can be (TA * W1 + TB * W2) / 2.
- the candidate image block may include adjacent image blocks of all inter-modes on the upper side of the current image block, and adjacent image blocks of all inter-modes on the left side of the current image block.
- the image block A3 and image block A4 in the inter mode can be determined as Candidate image block for current image block A1.
- the image block A2 in the inter mode can be determined as a candidate image block of the current image block A1.
- the technical solution of this embodiment is no longer adopted, but a conventional method is adopted, and details are not described herein again. If the current image block A1 has candidate image blocks, such as the left candidate image block and / or the upper candidate image block, the technical solution of this embodiment is adopted.
- the candidate image blocks are the image block A2, the image block A3, and the image block A4, it can be obtained according to the motion information of the image block A2, the motion information of the image block A3, and the motion information of the image block A4.
- a reference frame image corresponding to the image block A2 may be determined according to the reference frame index.
- An image block B2 corresponding to the image block A2 is selected from the reference frame image, and the image block B2 is selected according to the motion vector of the image block A2. Move to obtain the reference image block B2 'corresponding to the image block A2.
- the reference image block B3' corresponding to the image block A3 and the reference image block B4 'corresponding to the image block A4 can be obtained, as shown in FIG. 3C. . Then, a template of the current image block A1 can be obtained from the reference image block B2 ', the reference image block B3', and the reference image block B4 '.
- the horizontal length of the upper template of the current image block A1 is W and the vertical length is S.
- the value of W can be configured based on experience, the value of S can be configured according to experience, and the values of W and S are both No restrictions.
- W may be the horizontal length of the current image block A1, the horizontal length of the candidate image block A2, twice the horizontal length of the current image block A1, etc.
- S may be the vertical length of the candidate image block A2, and is a candidate image block A2 is 1/3 of the longitudinal length.
- FIG. 3D a template corresponding to the reference image block B2 'is shown. In FIG.
- W is taken as the horizontal length of the candidate image block A2 as an example, that is, W is the horizontal length of the reference image block B2 ′;
- S is taken as the 1/3 of the longitudinal length of the candidate image block A2 as an example, that is, S is 1/3 of the longitudinal length of the reference image block B2 '.
- the horizontal length of the template on the left side of the current image block A1 is R and the vertical length is H.
- the value of R can be configured based on experience, and the value of H can be configured based on experience.
- H may be the vertical length of the current image block A1, the vertical length of the candidate image block A3, R may be the horizontal length of the candidate image block A3, and 1/3 of the horizontal length of the candidate image block A3.
- a template corresponding to the reference image block B3 ' is shown, with H as the vertical length of the candidate image block A3 as an example, and R as the 1/3 of the horizontal length of the candidate image block A3 as example.
- the template corresponding to the reference image block B4 'can also be referred to as shown in FIG. 3D, which is not repeated here.
- the prediction mode of the candidate image block is determined.
- the sub-template is no longer generated, or it is filled according to the default value (such as the default pixel value, which can be a brightness value pre-configured according to experience), and is used as the ith sub-template of the upper template (the first template).
- the default value such as the default pixel value, which can be a brightness value pre-configured according to experience
- the motion information (such as a motion vector and a reference frame index) of the i-th candidate image block is obtained, and a template with a horizontal length w i and a vertical length S is generated based on the motion vector and the reference frame index.
- a template with a horizontal length w i and a vertical length S is generated based on the motion vector and the reference frame index.
- the i-th sub-template of the upper template Specifically, if the motion vector is MV and the reference frame index is idx, then in the idx reference image of the current frame, a rectangular block with a relative position offset of MV and a horizontal length of w i and a vertical length of S is taken as the above.
- the i-th child template of the side template is taken as the above.
- the i-th candidate for the image block, i H is assumed that the longitudinal length, lateral length is R, the determined prediction mode candidate image block.
- the sub-template is no longer generated, or it is filled according to the default value (such as the default pixel value, which can be a brightness value pre-configured according to experience), and is used as the i-th sub-template of the left template (second template).
- the default value such as the default pixel value, which can be a brightness value pre-configured according to experience
- the motion information is acquired i-th candidate image blocks (e.g., motion vector and reference frame index, etc.), to generate a transverse length R based on the motion vector and the reference frame index, the longitudinal length of template h i As the i-th child template of the template on the left.
- the motion vector is MV
- the reference frame index idx find the relative positions of the lateral offset is MV length R, a longitudinal length of a rectangular block of idx h i in the reference image of the current frame, as the left The i-th child template of the side template.
- the upper template can be stitched from all the sub templates on the upper side
- the left template can be stitched from all the sub templates on the left
- the upper template and the left template are stitched into the template of the current image block.
- the candidate image block may include a neighboring image block of the first inter mode on the upper side of the current image block, and a neighboring image block of the first inter mode on the left of the current image block.
- the image block A3 may be determined as a candidate image block of the current image block A1. If the first image block A2 on the upper side is in an inter mode, the image block A2 may be determined as a candidate image block of the current image block A1.
- the current image block A1 has no candidate image blocks.
- the technical solution of this embodiment is no longer adopted, but a conventional method is adopted, and details are not described herein again. If the current image block A1 has candidate image blocks, such as the left candidate image block and / or the upper candidate image block, the technical solution of this embodiment is adopted.
- the template of the current image block A1 can be obtained according to the motion information of the image block A2 and the motion information of the image block A3.
- the reference frame image corresponding to the image block A2 may be determined according to the reference frame index
- the image block B2 corresponding to the image block A2 is selected from the reference frame image
- the image block B2 is moved according to the neighboring motion vector of the image block A2 to obtain
- the reference image block B2 'corresponding to the image block A2 can be obtained by the same way.
- the reference image block B3' corresponding to the image block A3 can be obtained, and a template can be obtained according to the reference image block B2 'and the reference image block B3'.
- the horizontal length of the upper template of the current image block A1 is W and the vertical length is S.
- the value of W can be configured based on experience, the value of S can be configured according to experience, and the values of W and S are both No restrictions.
- W may be the horizontal length of the current image block A1, the horizontal length of the candidate image block A2, S may be the vertical length of the candidate image block A2, and 1/3 of the vertical length of the candidate image block A2.
- FIG. 3F a template corresponding to the reference image block B2 'is shown.
- the horizontal length of the template on the left side of the current image block A1 is R and the vertical length is H.
- the value of R can be configured based on experience, and the value of H can be configured based on experience.
- H may be the vertical length of the current image block A1, the vertical length of the candidate image block A3, etc.
- R may be the horizontal length of the candidate image block A3, and 1/3 of the horizontal length of the candidate image block A3, and so on.
- FIG. 3F a template corresponding to the reference image block B3 'is shown.
- the candidate image is judged The prediction mode of the block. If it is in the intra mode, the template is no longer generated, or it is filled according to the default value (such as the default pixel value, which may be a brightness value pre-configured according to experience), and used as the upper template. If it is in the inter mode, the motion information (such as the motion vector and the reference frame index) of the candidate image block is obtained, and a template with a horizontal length of w and a vertical length of S is generated based on the motion vector and the reference frame index as an upper template. .
- the default value such as the default pixel value, which may be a brightness value pre-configured according to experience
- the prediction mode of the candidate image block is determined. If it is in the intra mode, the template is no longer generated, or it is filled according to the default value as the left template.
- motion information such as a motion vector and a reference frame index
- a template having a horizontal length of R and a vertical length of h is generated based on the motion vector and the reference frame index as a left-side template.
- the candidate image block may include a neighboring image block of the first inter mode on the upper side of the current picture block, and a neighboring image block of the first inter mode on the left of the current picture block.
- the lateral length W of the upper template of the current image block A1 is set to the horizontal length of the current image block A1, and the left side of the current image block A1
- the vertical length H of the template is set to the vertical length of the current image block A1.
- the candidate image block may include the adjacent image block in the inter mode on the upper side of the current image block, and the next adjacent image block in the inter mode on the upper side of the current image block (that is, when the adjacent image block is in the intra mode, select The adjacent image block corresponds to the current image block that is the second-neighboring image block), the adjacent image block in the inter mode on the left side of the current image block, and the second-neighbor image block on the left side of the current image block.
- the image block A3 and the image block A4 in the inter mode can be determined.
- the image block A2 in the inter mode can be determined as a candidate image block of the current image block A1.
- image block A7 there are adjacent image blocks in the intra mode on the left, such as image block A7, and there is an image block A8 in the inter mode on the left of image block A7, that is, image block A8 is the next-to-adjacent image block on the left of the current image block A1. Therefore, the image block A8 in the inter mode can be determined as a candidate image block of the current image block A1.
- image block A5 there are adjacent image blocks in the intra mode on the upper side, such as image block A5, and there is an image block A6 in the inter mode on the upper side of image block A5, that is, image block A6 is the next-neighbor image on the upper side of the current image block A1. Therefore, the image block A6 in the inter mode can be determined as a candidate image block of the current image block A1.
- the candidate image block is an image block A2, an image block A3, an image block A4, an image block A6, and an image block A8, according to the motion information of the image block A2, the motion information of the image block A3, the motion information of the image block A4, Obtain the template of the current image block A1 from the motion information of the image block A6 and the motion information of the image block A8.
- the template is obtained based on the motion information of the image block A6 and the motion information of the image block A8. This is not repeated here, and the template is finally shown in FIG. 3I.
- the candidate image block may include the current image block The next neighboring image block in the inter mode.
- the candidate image block may include the current image block left The next neighboring image block of the inter-frame mode.
- the image block A4 in the inter mode can be determined as a candidate image block of the current image block A1.
- the image block A5 in the inter mode may be determined as a candidate image block of the current image block A1.
- the template of the current image block A1 can be obtained according to the motion information of the image block A4 and the motion information of the image block A5. For details, please refer to Cases 2 and 3. The details are not repeated here, and the template is finally shown in FIG. 3K or FIG. 3L.
- the candidate image block may include an adjacent image block in an inter mode on the upper side of the current image block, an adjacent image block in an intra mode on the upper side of the current image block, and an adjacent inter mode in the left side of the current image block.
- the image block A3 and the image block A4 in the inter mode can be determined.
- the image block A2 in the inter mode can be determined as a candidate image block of the current image block A1.
- image block A7 There are adjacent image blocks in the intra mode on the left, such as image block A7.
- the image block A7 in the intra mode can be determined as a candidate image block of the current image block A1.
- the image block A5 in the intra mode can be determined as a candidate image block of the current image block A1.
- the candidate image block is an image block A2, an image block A3, an image block A4, an image block A5, and an image block A7, according to the motion information of the image block A2, the motion information of the image block A3, the motion information of the image block A4, For the motion information of image block A5 and the motion information of image block A7, obtain the template of the current image block A1.
- the template is obtained based on the motion information of image block A5 and the motion information of image block A7. This is not repeated here, and the template is finally shown in FIG. 3M.
- a template when obtaining a template based on the motion information of image block A5, since image block A5 is in the intra mode and does not have motion information, the neighboring image blocks of image block A5 (that is, image block A6) The motion information is determined as the motion information of the image block A5. After the motion information of the image block A5 is obtained, a template can be obtained by using the motion information of the image block A5. For details, see Case 1.
- the motion information of the adjacent image block (that is, the image block A8) of the image block A7 can be determined. Is the motion information of the image block A5, and the template is obtained by using the motion information of the image block A5.
- the candidate image block may include the current image block Adjacent image blocks of the first intra mode on the upper side.
- the candidate image block may include the current image block left Adjacent image blocks of the first intra mode on the side.
- the image block A2 in the intra mode is determined as Candidate image block for current image block A1. If the first image block A3 on the left side is in the intra mode, and the image block A5 in the inter mode exists on the left side of the image block A3, the image block A3 in the intra mode is determined as a candidate image block of the current image block A1.
- the template of the current image block A1 can be obtained according to the motion information of the image block A2 and the motion information of the image block A3.
- the template is finally shown in FIG. 3N or 3O.
- the neighboring image blocks of image block A2 (that is, image block A4)
- the motion information is determined as the motion information of the image block A2, and a template is obtained using the motion information of the image block A2.
- the motion information of an adjacent image block of the image block A3 (that is, the image block A5) can be determined as an image block A3's motion information, and use the motion information of image block A3 to obtain a template.
- step 203 the encoding end obtains the target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template.
- the implementation process can be shown in FIG. 4A and can include:
- Step 401 The encoding end determines the original motion vector as a central motion vector.
- Step 402 The encoding end determines an edge motion vector corresponding to the central motion vector.
- the edge motion vector may be different from the center motion vector.
- the determining of the edge motion vector corresponding to the central motion vector by the encoding end may include: moving the central motion vector (x, y) by an offset S in different directions, thereby obtaining edge motion vectors (xS, y) in different directions. ), Edge motion vector (x + S, y), edge motion vector (x, y + S), edge motion vector (x, yS).
- the center motion vector (x, y) can be shifted to the left by an offset S to obtain the edge motion vector (xS, y); in the horizontal direction, the center motion vector (x, y) can be Move the offset S to the right to get the edge motion vector (x + S, y); in the vertical direction, you can move the center motion vector (x, y) up by the offset S to get the edge motion vector (x, y) + S); in the vertical direction, the center motion vector (x, y) can be shifted downward by the offset S to obtain the edge motion vector (x, yS).
- the initial value of the offset S can be configured according to experience, for example, it can be 2, 4, 8, 16, and so on.
- the edge motion vector is the edge motion vector (7, 3), the edge motion vector (3, 7), and the edge motion vector (-1, 3). , Edge motion vector (3, -1).
- Step 403 The encoder obtains the encoding performance of the central motion vector according to the template of the current image block, and obtains the encoding performance of the edge motion vector according to the template of the current image block.
- Case 1 The encoding end obtains the encoding performance of the central motion vector according to the template of the current image block, which may include, but is not limited to, determining the encoding of the central motion vector according to the parameter information of the template of the current image block and the parameter information of the first target reference block.
- the first target reference block may be an image block obtained after the reference image block corresponding to the template is offset based on the central motion vector.
- the encoding end may determine the prediction performance of the center motion vector according to the parameter information of the template and the parameter information of the first target reference block, and determine the encoding performance of the center motion vector according to the prediction performance of the center motion vector.
- the prediction performance and the actual number of bits required for encoding determine the encoding performance of the central motion vector.
- the foregoing parameter information may be a brightness value; or may be a brightness value and a chrominance value.
- the brightness value of the template of the current image block and the brightness value of the first target reference block may be obtained first. For example, after obtaining the template of the current image block, the brightness value of each pixel of the template can be obtained, and the reference image block of the template can be obtained.
- the central motion vector ( 3, 3) Move the reference image block to obtain an image block X corresponding to the reference image block (for example, move the reference image block to the right by 3 pixels and move it upward by 3 pixels, and record the processed image block as an image Block X), and the image block X is the first target reference block, and the brightness value of each pixel of the image block X can be obtained.
- the prediction performance of the central motion vector can be determined using the following formula:
- SAD is the sum of available absolute differences used to represent the prediction performance of the central motion vector.
- TM i represents the brightness value of the i-th pixel of the template
- TMP i represents the brightness value of the i-th pixel of the image block X
- M represents the total number of pixels.
- the parameter information is a luminance value and a chrominance value
- the following formula is used to determine the brightness value prediction performance SAD of the central motion vector
- the average of the luma value prediction performance SAD and the chroma value prediction performance CSAD is the prediction performance of the center motion vector.
- CSAD is the sum of the available absolute differences, which is used to represent the chrominance value prediction performance of the central motion vector
- CTM i represents the chrominance value of the i-th pixel point of the template
- CTMP i represents the chrominance of the i-th pixel point of the image block X Value
- M c represents the total number of pixels.
- the encoding performance of the center motion vector may be determined according to the prediction performance and the actual number of bits required for encoding.
- RDO Rate Distortion Optimized, Rate-Distortion Principle
- J encoding performance
- D prediction performance
- ⁇ a Lagrangian multiplier, which is a numerical value configured according to experience
- R is an actual number of bits required for image block encoding, that is, a sum of bits of information carried by an encoded bit stream.
- the encoder obtains the encoding performance of the edge motion vector according to the template of the current image block, which may include, but is not limited to, determining the encoding of the edge motion vector according to the parameter information of the template of the current image block and the parameter information of the second target reference block.
- the second target reference block may be an image block obtained after the reference image block corresponding to the template is offset based on the edge motion vector.
- the encoding end may determine the prediction performance of the edge motion vector according to the parameter information of the template and the parameter information of the second target reference block, and determine the encoding performance of the center motion vector according to the prediction performance of the edge motion vector; for example, it may be based on the The prediction performance and the actual number of bits required for encoding determine the encoding performance of the edge motion vector.
- the foregoing parameter information may be a brightness value; or may be a brightness value and a chrominance value.
- Case 2 is similar to Case 1, except that in Case 2, the reference image block of the template is moved using the edge motion vector to obtain the second target reference block, and the encoding performance of the edge motion vector is obtained using the second target reference block.
- the reference image block of the template is moved using the central motion vector to obtain a first target reference block, and the coding performance of the central motion vector is obtained using the first target reference block.
- Step 404 The encoding end determines a target motion vector from the center motion vector and the edge motion vector according to the encoding performance of the center motion vector and the edge motion vector.
- the encoding end may select a motion vector with the best encoding performance from the center motion vector and the edge motion vector.
- the motion vector with the best encoding performance may be determined. Is the target motion vector; when the motion vector with the best encoding performance is the original motion vector, the encoding end can select the motion vector with the best encoding performance from the center motion vector and the edge motion vector, and the motion vector with the best encoding performance Determined as the target motion vector.
- the encoding end may determine the edge motion vector (7, 3) as the target motion vector. If the motion vector with the best coding performance is the center motion vector of (3, 3), that is, the original motion vector, the coding end can also use the motion vector with the best coding performance (such as the edge motion vector (7, 3), etc.) Determined as the target motion vector.
- Embodiment 4 is a diagrammatic representation of Embodiment 4:
- step 203 the encoding end obtains the target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template.
- the implementation process can be shown in FIG. 4A and can include:
- Step 411 The encoding end determines the original motion vector as the central motion vector.
- Step 412 The encoding end determines an edge motion vector corresponding to the central motion vector.
- the edge motion vector may be different from the center motion vector.
- Step 413 The encoder obtains the encoding performance of the central motion vector according to the template of the current image block, and obtains the encoding performance of the edge motion vector according to the template of the current image block.
- steps 411 to 413 reference may be made to steps 401 to 403, and details are not described herein again.
- Step 414 The encoder determines whether the iteration end condition of the target motion vector is satisfied.
- step 416 If yes, go to step 416; if not, go to step 415.
- the iteration end condition may include, but is not limited to, the number of iterations reaching the number threshold, or the execution time reaching the time threshold, or the offset parameter S has been modified to a preset value, such as 1.
- Step 415 The encoder selects a motion vector with the best coding performance from the center motion vector and the edge motion vector, determines the motion vector with the best coding performance as a new center motion vector, and returns to step 412.
- the edge motion vector (7, 3) may be determined as the new central motion vector, and step 412 is performed again, and so on.
- the value of the offset parameter S may be an initial value, such as 16.
- the value of the offset parameter S is adjusted first, such as adjusted to the last offset parameter S minus 2, or adjusted to half of the last offset parameter S, etc.
- the value of the offset parameter S is 8; when step 412 is executed for the third time, the value of the offset parameter S is 4; and so on.
- step 412 After adjusting the value of the offset parameter S, it is first determined whether the adjusted offset parameter S is less than or equal to a preset value, such as 1. If not, step 412 may be performed based on the adjusted offset parameter S, and the process is not described again. If yes, the value of the offset parameter S can be set to 1, and step 412 is performed based on the offset parameter S (that is, the value 1), and when the execution proceeds to step 414, the judgment result is that the end of the iteration is satisfied condition.
- a preset value such as 1.
- Step 416 The encoding end determines the target motion vector from the center motion vector and the edge motion vector according to the encoding performance of the center motion vector and the edge motion vector.
- step 416 For the processing in step 416, refer to step 404, and details are not described herein again.
- Embodiment 5 is a diagrammatic representation of Embodiment 5:
- the encoding performance of the original motion vector and the encoding performance of the target motion vector may be obtained.
- the encoding end obtains the encoding performance of the original motion vector, which may include but is not limited to: according to the parameter information of the template of the current image block and the third target
- the parameter information of the reference block determines the encoding performance of the original motion vector.
- the third target reference block is an image block obtained after the reference image block corresponding to the template is offset based on the original motion vector.
- the prediction performance of the original motion vector may be determined according to the parameter information of the template and the parameter information of the third target reference block, and the encoding performance of the original motion vector may be determined according to the prediction performance; for example, according to the prediction performance and encoding requirements
- the actual number of bits determines the encoding performance of the original motion vector.
- the foregoing parameter information may be a brightness value; or a brightness value and a chrominance value.
- the encoding end obtains the encoding performance of the target motion vector, which may include but is not limited to: determining the encoding performance of the target motion vector according to the parameter information of the template of the current image block and the parameter information of the fourth target reference block, where the fourth target reference block is a template
- the corresponding reference image block is an image block obtained after the target motion vector is shifted.
- the prediction performance of the target motion vector may be determined according to the parameter information of the template and the parameter information of the fourth target reference block, and the encoding performance of the target motion vector may be determined according to the prediction performance; for example, according to the prediction performance and encoding requirements
- the actual number of bits determines the encoding performance of the target motion vector.
- the foregoing parameter information may be a brightness value; or a brightness value and a chrominance value.
- the above process is similar to the third embodiment, except that when the third target reference block or the fourth target reference block is obtained, the reference image block of the template is moved using the original motion vector or the target motion vector, instead of using the central motion vector to move the template.
- the reference image blocks are not repeated here.
- Embodiment 6 is a diagrammatic representation of Embodiment 6
- the method may include:
- Step 501 The decoder obtains motion information of a candidate image block of the current image block.
- the candidate image block of the current image block may include, but is not limited to, a spatial-domain candidate image block of the current image block; or a time-domain candidate image block of the current image block; there is no limitation on this candidate image block.
- Step 502 The decoder obtains a template of the current image block according to the motion information of the candidate image block.
- the method for the decoder to obtain the template of the current image block according to the motion information of the candidate image block is the same as that of the encoder.
- the method for the decoder to obtain the template of the current image block according to the motion information of the candidate image block is the same as that of the encoder.
- Step 503 The decoding end obtains a template-based target motion vector according to the original motion vector corresponding to the current image block and the obtained template, and the target motion vector may be different from the original motion vector.
- the decoding end may also obtain the encoded bit stream of the current image block.
- the encoded bit stream may be sent by the encoding end or the decoding end. It is obtained after encoding the bit stream, and there is no limitation on this.
- the encoding end sends the encoded bit stream as an example.
- the decoding end may receive an encoded bit stream from the encoding end.
- the encoded bit stream carries first indication information
- the first indication information is used to indicate that the final motion vector of the current image block is determined based on the template.
- the decoding end may receive an encoded bit stream from the encoding end, and when the encoded bit stream carries second indication information, the second indication information is used to indicate that the final motion vector of the current image block is determined based on the original motion vector corresponding to the current image block. , Obtaining an original motion vector corresponding to the current image block according to the second instruction information, and determining a final motion vector of the current image block according to the original motion vector.
- the foregoing manner is to notify the first indication information or the second indication information in an explicit manner.
- the notification may also be performed in an implicit manner, that is, the encoded bitstream does not carry the first indication information or the second indication information.
- the decoder can determine the method of acquiring the final motion vector of the current image block according to the motion vector decision strategy agreed with the encoder.
- the decoding end may obtain the motion information of the candidate image block of the current image block according to the locally preset first policy information, and obtain the template of the current image block according to the motion information of the candidate image block.
- the first policy information is used to indicate The template determines the final motion vector of the current image block; or, the original motion vector corresponding to the current image block can be obtained according to the locally preset second strategy information; the final motion vector of the current image block is determined based on the original motion vector, and the second strategy
- the information is used to indicate that the final motion vector of the current image block is determined based on the original motion vector corresponding to the current image block; or, third strategy information may be obtained, which indicates that the same strategy as that of the adjacent image block of the current image block is adopted
- the information determines the final motion vector of the current image block; then, according to the third policy information, the final motion vector of the current image block is determined.
- the encoding end and the decoding end can negotiate a motion vector decision strategy or store the encoding end and the decoding end by defining a policy in a standard.
- the motion vector decision strategy can be agreed first strategy information; or agreed second strategy information; or Agree on the third strategy information.
- the motion vector decision strategy is the agreed first strategy information
- the motion information of the candidate image block of the current image block is obtained according to the locally preset first strategy information
- the template of the current image block is obtained according to the motion information of the candidate image block.
- the motion vector decision strategy is the agreed second policy information
- the original motion vector corresponding to the current image block is obtained according to the locally preset second policy information
- the final motion vector of the current image block is determined according to the original motion vector
- the motion vector decision strategy is the third strategy information
- the strategy information of the neighboring image block of the current image block is the first strategy information
- the motion information of the candidate image block of the current image block is obtained, and the motion information of the candidate image block is obtained according to the motion information of the candidate image block.
- the decoding end may also receive an encoded bit stream from the encoding end.
- the encoded bit stream carries the original motion vector in The index value in the motion vector list; the decoder can select a motion vector corresponding to the index value from the motion vector list; and determine the selected motion vector as the original motion vector corresponding to the current image block. If the index value is 1, the first motion vector of the motion vector list is obtained, and the motion vector is the original motion vector of the current image block.
- the motion vector list is used to record the motion vectors of image blocks adjacent to the current image block.
- the motion vector list maintained by the decoder is the same as the motion vector list maintained by the encoder.
- the above manner is only an example.
- the motion vector of the candidate image block of the current image block may be determined as the original motion vector corresponding to the current image block.
- the decoding end obtains a template-based target motion vector based on the original motion vector corresponding to the current image block and the obtained template.
- Step 504 The decoding end determines the final motion vector of the current image block according to the target motion vector.
- the target motion vector may be determined as the final motion vector of the current image block.
- the target motion vector can be obtained based on the original motion vector and the final motion vector of the current image block can be determined based on the target motion vector, instead of directly determining the final motion vector of the current image block based on the original motion vector, thereby improving the motion vector. Accuracy, improving decoding performance.
- a template of the current image block can be obtained according to the motion information of the candidate image block, and the target motion vector is obtained based on the template of the current image block based on the original motion vector; the above method can quickly obtain the current The template of the image block, and then obtaining the target motion vector according to the template, can improve the decoding efficiency and reduce the decoding delay.
- a template of the current image block can be obtained, and a target motion vector can be obtained according to the template.
- Embodiment 7 is a diagrammatic representation of Embodiment 7:
- a template of the current image block may be obtained according to motion information (such as a motion vector and a reference frame index) of a candidate image block of the current image block.
- the decoding end may then determine a reference frame image corresponding to the candidate image block according to the reference frame index; obtain a reference image block corresponding to the candidate image block from the reference frame image according to the motion vector, and according to the reference image Block to get the template of the current image block.
- the candidate image block may include M first candidate image blocks and N second candidate image blocks, where M is a natural number greater than or equal to 1, N is a natural number greater than or equal to 0, or M is a greater than or equal to 0 Natural numbers, N is a natural number greater than or equal to 1.
- the first candidate image block is a candidate image block on the upper side of the current image block
- the second candidate image block is a candidate image block on the left side of the current image block.
- the first candidate image block includes an adjacent image block and / or a second-neighboring image block on the upper side of the current image block; the prediction mode of the adjacent image block is an inter mode or an intra mode; the prediction mode of the next-neighbor image block is inter mode.
- the second candidate image block includes an adjacent image block and / or a second-neighboring image block on the left side of the current image block; the prediction mode of the adjacent image block is an inter mode or an intra mode; the prediction mode of the next-neighbor image block is inter mode.
- Obtaining a template of the current image block according to the motion information of the candidate image block may include, but is not limited to, determining the first template according to the motion vector prediction mode and the motion information of the M first candidate image blocks; and determining the second candidate image block according to the N second candidate image blocks.
- a motion vector prediction mode and motion information to determine a second template Then, the first template is determined as the template of the current image block; or the second template is determined as the template of the current image block; or the first template and the second template are stitched and determined as the template of the current image block.
- the first template when M is greater than 1, may include M sub-templates or P sub-templates, and is stitched from M sub-templates or P sub-templates, where P is the first candidate image block of the inter mode.
- the first template may include a first sub-template, and the first sub-template is determined according to a motion vector prediction mode and motion information of the first candidate image block on the upper side of the current image block.
- the second template may include N sub-templates or R sub-templates, and is formed by concatenating N sub-templates or R sub-templates, where R is the number of second candidate image blocks in the inter mode; when N is equal to At 1, the second template may include a second sub-template, and the second sub-template is determined according to the motion vector prediction mode and motion information of the first candidate image block on the left side of the current image block.
- acquiring the template of the current image block according to the motion information of the candidate image block may further include but is not limited to: when the current image block corresponds to multiple motion information, acquiring a template corresponding to the motion information according to each motion information. A weight corresponding to each motion information is obtained, and a template of a current image block is obtained according to a weight corresponding to each motion information and a template corresponding to the motion information.
- the processing process of the seventh embodiment is similar to that of the second embodiment, and details are not described herein again.
- Embodiment 8 is a diagrammatic representation of Embodiment 8
- step 503 the decoder obtains the target motion vector based on the template according to the original motion vector corresponding to the current image block and the obtained template.
- the implementation process can be shown in FIG. 6A, and can include:
- Step 601 The decoding end determines the original motion vector as a central motion vector.
- Step 602 The decoder determines an edge motion vector corresponding to the central motion vector.
- the edge motion vector may be different from the center motion vector.
- determining the edge motion vector corresponding to the central motion vector may include: moving the central motion vector (x, y) in different directions by an offset S to obtain an edge motion vector (xS, y) and an edge motion vector in different directions. (x + S, y), edge motion vector (x, y + S), edge motion vector (x, yS).
- Step 603 The decoder obtains the encoding performance of the central motion vector according to the template of the current image block, and obtains the encoding performance of the edge motion vector according to the template of the current image block.
- the decoding end obtains the encoding performance of the central motion vector according to the template of the current image block, which may include, but is not limited to, the decoding end may determine the central motion vector according to the parameter information of the template of the current image block and the parameter information of the first target reference block. Encoding performance, wherein the first target reference block is an image block obtained after the reference image block corresponding to the template is shifted based on the central motion vector.
- the decoding end obtains the encoding performance of the edge motion vector according to the template of the current image block, which may include, but is not limited to, the decoding end may determine the edge motion vector according to the parameter information of the template of the current image block and the parameter information of the second target reference block. Encoding performance, wherein the second target reference block is an image block obtained after the reference image block corresponding to the template is offset based on the edge motion vector.
- Step 604 The decoding end determines a target motion vector from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the edge motion vector.
- the decoder can select the motion vector with the best coding performance from the center motion vector and the edge motion vector.
- the motion vector with the best coding performance can be determined. Is the target motion vector; when the motion vector with the best coding performance is the original motion vector, the decoder can select the motion vector with the second best coding performance from the center motion vector and the edge motion vector, and set the motion vector with the second best coding performance. Determined as the target motion vector.
- steps 601 to 604 refer to the third embodiment, except that the execution body is changed from the encoding end to the decoding end.
- the other processing flows are the same, and are not repeated here.
- step 503 the decoding end obtains a template-based target motion vector according to the original motion vector corresponding to the current image block and the obtained template.
- the implementation process can be shown in FIG. 6B, and can include:
- Step 611 The decoding end determines the original motion vector as a central motion vector.
- Step 612 The decoder determines an edge motion vector corresponding to the central motion vector.
- the edge motion vector may be different from the center motion vector.
- Step 613 The decoder obtains the encoding performance of the central motion vector according to the template of the current image block, and obtains the encoding performance of the edge motion vector according to the template of the current image block.
- Step 614 The decoder determines whether the iteration end condition of the target motion vector is satisfied.
- step 616 may be performed; if not, step 615 may be performed.
- Step 615 The decoder selects a motion vector with the best coding performance from the center motion vector and the edge motion vector, determines the motion vector with the best coding performance as the center motion vector, and returns to step 612.
- Step 616 The decoding end determines a target motion vector from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the edge motion vector.
- Embodiment 10 is a diagrammatic representation of Embodiment 10:
- an embodiment of the present disclosure also proposes a motion vector determining device, which is applied to the decoding end.
- FIG. 7 it is a structural diagram of the device, and the device includes:
- An obtaining module 71 is configured to obtain motion information of a candidate image block of the current image block; obtain a template of the current image block according to the motion information of the candidate image block; and obtain an original motion vector corresponding to the current image block and the acquired
- the template obtains a target motion vector based on the template;
- a determining module 72 is configured to determine a final motion vector of the current image block according to the target motion vector.
- the obtaining module 71 is further configured to receive an encoded bit stream corresponding to the current image block from an encoding end, where the encoded bit stream carries first indication information, and the first indication information is used to instruct to determine the current based on a template.
- a final motion vector of the image block acquiring motion information of a candidate image block of the current image block according to the first instruction information, and acquiring a template of the current image block according to the motion information of the candidate image block.
- the obtaining module 71 is further configured to: receive an encoded bit stream corresponding to the current image block from the encoding end, where the encoded bit stream carries second instruction information, and the second instruction information is used to indicate that the The original motion vector determines the final motion vector of the current image block; the original motion vector corresponding to the current image block is obtained according to the second instruction information; the final motion of the current image block is determined according to the original motion vector Vector.
- the obtaining module 71 is further configured to obtain the motion information of the candidate image block of the current image block according to the locally preset first policy information, and obtain the template of the current image block according to the motion information of the candidate image block;
- the first strategy information is used to instruct to determine a final motion vector of the current image block based on a template; or to obtain an original motion vector corresponding to the current image block according to locally preset second policy information; and according to the original motion Vector to determine the final motion vector of the current image block;
- the second policy information is used to instruct to determine the final motion vector of the current image block based on the original motion vector corresponding to the current image block; or, to obtain third policy information
- the third policy information indicates that a final motion vector of the current image block is determined by using the same policy information as a neighboring image block of the current image block; and a final motion vector of the current image block is determined according to the third policy information.
- the obtaining module 71 is further configured to: receive an encoded bit stream corresponding to the current image block from an encoding end, where the encoded bit stream carries an index value of an original motion vector in a motion vector list; and select from the motion vector list A motion vector corresponding to the index value; determining the selected motion vector as an original motion vector corresponding to the current image block; or determining a motion vector of a candidate image block of the current image block as the current image block Corresponding original motion vector.
- the candidate image block includes M first candidate image blocks and N second candidate image blocks, where M is a natural number greater than or equal to 1, N is a natural number greater than or equal to 0, or M is a natural number greater than or equal to 0 , N is a natural number greater than or equal to 1; the first candidate image block is a candidate image block on the upper side of the current image block, and the second candidate image block is a candidate image block on the left side of the current image block;
- the acquiring module 71 is specifically configured to: determine the first template according to the motion vector prediction mode and motion information of the M first candidate image blocks; Determine a second template of the motion vector prediction mode and motion information of the N second candidate image blocks; determine the first template as a template of the current image block; or determine the second template as the current template A template of an image block; or, determining the template of the current image block after stitching the first template and the second template.
- the first candidate image block includes an adjacent image block and / or a second-neighboring image block on the upper side of the current image block; and the prediction mode of the adjacent image block is an inter mode or an intra mode.
- the prediction mode of the second neighboring image block is an inter mode; the second candidate image block includes a neighboring image block and / or a second neighboring image block to the left of the current image block;
- the prediction mode is an inter mode or an intra mode; the prediction mode of the next neighboring image block is an inter mode.
- the first template when the M is greater than 1, includes M sub-templates or P sub-templates, and is formed by splicing the M sub-templates or the P sub-templates, where P is an inter-frame
- the vector prediction mode and motion information are determined.
- the motion information includes a motion vector and a reference frame index of the first candidate image block
- the obtaining module 71 is specifically configured to determine the first template according to the motion vector prediction modes and motion information of the M first candidate image blocks. : For the ith candidate image block of the M first candidate image blocks, when it is determined that the motion vector prediction mode of the ith candidate image block is an inter mode, determine the reference frame index according to the reference frame index A reference frame image corresponding to the i-th candidate image block; and determining a reference image block corresponding to the i-th candidate image block from the reference frame image according to a motion vector of the i-th candidate image block, the reference The relative position offset between the image block and the i-th candidate image block matches the motion vector of the i-th candidate image block; according to the determined reference image block, the size is obtained as a first lateral length and a first An image block of a vertical length is used as an ith sub-template included in the first template.
- the obtaining module 71 is specifically configured to determine the first template according to the motion vector prediction mode and motion information of the M first candidate image blocks, and for the i-th candidate image block of the M first candidate image blocks, When it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, the i-th candidate image block is filled with a default value, and an image with a size of a first horizontal length and a first vertical length is obtained Block as the i-th sub-template included in the first template; or determining a reference frame image corresponding to the i-th candidate image block according to a reference frame index corresponding to the i-th candidate image block; according to the i-th A motion vector corresponding to each candidate image block, and a reference image block corresponding to the i-th candidate image block is determined from the reference frame image, and the relative position of the reference image block and the i-th candidate image block is offset Match the motion vector corresponding to the i-th candidate image block; and obtain, according to the determined reference image
- the first horizontal length and the horizontal length of the first candidate image block satisfy a first proportional relationship, or the horizontal length of the current image block satisfies a second proportional relationship, or is equal to a first preset length;
- the first longitudinal length and the longitudinal length of the first candidate image block satisfy a third proportional relationship, or the longitudinal length of the current image block satisfies a fourth proportional relationship, or is equal to a second preset length.
- the second template when the N is greater than 1, includes N sub-templates or R sub-templates, and is formed by splicing the N sub-templates or the R sub-templates, where R is an inter-frame
- the vector prediction mode and motion information are determined.
- the motion information includes a motion vector and a reference frame index of the second candidate image block
- the obtaining module 71 is specifically configured to determine the second template according to the motion vector prediction mode and motion information of the N second candidate image blocks.
- the obtaining module 71 is specifically configured to determine the second template according to the motion vector prediction mode and motion information of the N second candidate image blocks: for the ith candidate image block of the N second candidate image blocks, When it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, the i-th candidate image block is filled with a default value, and an image with a size of a second horizontal length and a second vertical length is obtained Block as the i-th sub-template included in the second template; or determining a reference frame image corresponding to the i-th candidate image block according to a reference frame index corresponding to the i-th candidate image block; according to the i-th A motion vector corresponding to each candidate image block, and a reference image block corresponding to the i-th candidate image block is determined from the reference frame image, and the relative position of the reference image block and the i-th candidate image block is offset Match the motion vector corresponding to the i-th candidate image block; and according to the determined reference image block, obtain an image
- the second horizontal length and the horizontal length of the second candidate image block satisfy a fifth proportional relationship, or the horizontal length of the current image block satisfies a sixth proportional relationship, or is equal to a third preset length;
- the second vertical length and the vertical length of the second candidate image block satisfy a seventh proportional relationship, or the vertical length of the current image block satisfies an eighth proportional relationship, or is equal to a fourth preset length.
- the acquisition module 71 is specifically configured to: when the current image block corresponds to multiple motion information, acquire the corresponding motion information according to each motion information. Obtaining a weight corresponding to each motion information, and obtaining a template of the current image block according to the weight corresponding to each motion information and the template corresponding to the motion information.
- the acquisition module 71 is specifically configured to: determine the original motion vector as a central motion vector; determine An edge motion vector corresponding to the center motion vector, the edge motion vector being different from the center motion vector; obtaining the encoding performance of the center motion vector and the encoding performance of the edge motion vector according to the template; The coding performance of the center motion vector and the coding performance of the edge motion vector are described, and the target motion vector is determined from the center motion vector and the edge motion vector.
- the acquisition module 71 is specifically configured to move the central motion vector (x, y) by an offset S in different directions to obtain edge motion vectors (xS, y), edge motion vector (x + S, y), edge motion vector (x, y + S), and edge motion vector (x, yS).
- the obtaining module 71 When the obtaining module 71 obtains the encoding performance of the central motion vector and the encoding performance of the edge motion vector according to the template, the obtaining module 71 is specifically configured to: according to the parameter information of the template of the current image block and the first target reference block. Parameter information to determine the encoding performance of the central motion vector, wherein the first target reference block is an image block obtained after the reference image block corresponding to the template is offset based on the central motion vector; according to the current The parameter information of the template of the image block and the parameter information of the second target reference block determine the encoding performance of the edge motion vector, and the second target reference block is a reference image block corresponding to the template based on the edge motion vector. Image patches obtained after offset.
- the obtaining module 71 determines the target motion vector from the center motion vector and the edge motion vector according to the coding performance of the center motion vector and the edge motion vector, the obtaining module 71 is specifically configured to: The motion vector with the best coding performance is selected from the center motion vector and the edge motion vector; and when the motion vector with the best coding performance is not the original motion vector, the motion vector with the best coding performance is determined as the target motion.
- Vector when the motion vector with the best encoding performance is the original motion vector, select the motion vector with the best encoding performance from the center motion vector and the edge motion vector, and determine the motion vector with the best encoding performance Is the target motion vector.
- the obtaining module 71 is further configured to determine whether the iteration end condition of the target motion vector is satisfied; if so, according to the encoding performance of the central motion vector and the encoding performance of the edge motion vector, the The target motion vector is determined from the edge motion vector; if not, the motion vector with the best coding performance is selected from the center motion vector and the edge motion vector, and the motion vector with the best coding performance is determined as The center motion vector, and return to perform an operation of determining an edge motion vector corresponding to the center motion vector.
- an embodiment of the present disclosure further proposes a motion vector determining device, which is applied to the encoding end. See FIG. 8 for a structural diagram of the device, where the device includes:
- An acquiring module 81 is configured to acquire motion information of a candidate image block of the current image block; acquire a template of the current image block according to the motion information of the candidate image block; and obtain an original motion vector corresponding to the current image block and the acquired The template to obtain a target motion vector based on the template;
- a sending module 82 is configured to send an encoded bit stream to a decoding end according to the original motion vector and the target motion vector.
- the candidate image block includes M first candidate image blocks and N second candidate image blocks, where M is a natural number greater than or equal to 1, N is a natural number greater than or equal to 0, or M is a natural number greater than or equal to 0 , N is a natural number greater than or equal to 1; the first candidate image block is a candidate image block above the current image block, and the second candidate image block is a candidate image block to the left of the current image block;
- the acquiring module 81 is specifically configured to: determine the first template according to the motion vector prediction mode and motion information of the M first candidate image blocks; Determine a second template of the motion vector prediction mode and motion information of the N second candidate image blocks; determine the first template as a template of the current image block; or determine the second template as the current template A template of an image block; or, determining the template of the current image block after stitching the first template and the second template.
- the first candidate image block includes an adjacent image block and / or a second-neighboring image block on the upper side of the current image block; and the prediction mode of the adjacent image block is an inter mode or an intra mode.
- the prediction mode of the second neighboring image block is an inter mode; the second candidate image block includes a neighboring image block and / or a second neighboring image block to the left of the current image block;
- the prediction mode is an inter mode or an intra mode; the prediction mode of the next neighboring image block is an inter mode.
- the first template when the M is greater than 1, includes M sub-templates or P sub-templates, and is formed by splicing the M sub-templates or the P sub-templates, where P is an inter-frame
- the vector prediction mode and motion information are determined.
- the motion information includes a motion vector and a reference frame index of the first candidate image block
- the obtaining module 81 is specifically configured to determine the first template according to the motion vector prediction modes and motion information of the M first candidate image blocks. : For the ith candidate image block of the M first candidate image blocks, when it is determined that the motion vector prediction mode of the ith candidate image block is an inter mode, determine the reference frame index according to the reference frame index A reference frame image corresponding to the i-th candidate image block; and determining a reference image block corresponding to the i-th candidate image block from the reference frame image according to a motion vector of the i-th candidate image block, the reference The relative position offset between the image block and the i-th candidate image block matches the motion vector of the i-th candidate image block; according to the determined reference image block, the size is obtained as a first lateral length and a first An image block of a vertical length is used as an ith sub-template included in the first template.
- the obtaining module 81 is specifically configured to determine the first template according to the motion vector prediction mode and motion information of the M first candidate image blocks, and for the i-th candidate image block of the M first candidate image blocks, When it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, the i-th candidate image block is filled with a default value, and an image with a size of a first horizontal length and a first vertical length is obtained Block as the i-th sub-template included in the first template; or determining a reference frame image corresponding to the i-th candidate image block according to a reference frame index corresponding to the i-th candidate image block; according to the i-th A motion vector corresponding to each candidate image block, and a reference image block corresponding to the i-th candidate image block is determined from the reference frame image, and the relative position of the reference image block and the i-th candidate image block is offset Match the motion vector corresponding to the i-th candidate image block; and obtain, according to the determined reference image
- the first horizontal length and the horizontal length of the first candidate image block satisfy a first proportional relationship, or the horizontal length of the current image block satisfies a second proportional relationship, or is equal to a first preset length;
- a longitudinal length satisfies a third proportional relationship with the longitudinal length of the first candidate image block, or satisfies a fourth proportional relationship with the longitudinal length of the current image block, or is equal to a second preset length.
- the second template when the N is greater than 1, includes N sub-templates or R sub-templates, and is formed by splicing the N sub-templates or the R sub-templates, where R is an inter-frame
- the vector prediction mode and motion information are determined.
- the motion information includes a motion vector and a reference frame index of the second candidate image block
- the obtaining module 81 is specifically configured to determine the second template according to the motion vector prediction mode and motion information of the N second candidate image blocks.
- the obtaining module 81 is specifically configured to determine the second template according to the motion vector prediction mode and the motion information of the N second candidate image blocks: for the ith candidate image block of the N second candidate image blocks, When it is determined that the motion vector prediction mode of the i-th candidate image block is an intra mode, the i-th candidate image block is filled with a default value, and an image with a size of a second horizontal length and a second vertical length is obtained Block as the i-th sub-template included in the second template; or determining a reference frame image corresponding to the i-th candidate image block according to a reference frame index corresponding to the i-th candidate image block; according to the i-th A motion vector corresponding to each candidate image block, and a reference image block corresponding to the i-th candidate image block is determined from the reference frame image, and the relative position of the reference image block and the i-th candidate image block is offset Match the motion vector corresponding to the i-th candidate image block; and according to the determined reference image block, obtain an
- the second horizontal length and the horizontal length of the second candidate image block satisfy a fifth proportional relationship, or the horizontal length of the current image block satisfies a sixth proportional relationship, or is equal to a third preset length;
- the second longitudinal length and the longitudinal length of the second candidate image block satisfy a seventh proportional relationship, and the longitudinal length of the second candidate image block and the current image block satisfy an eighth proportional relationship, or are equal to a fourth preset length.
- the acquiring module 81 is specifically configured to acquire a template of the current image block according to the motion information of the candidate image block, and when the current image block corresponds to multiple motion information, acquire the corresponding motion information according to each motion information. Obtaining a weight corresponding to each motion information, and obtaining a template of the current image block according to the weight corresponding to each motion information and the template corresponding to the motion information.
- the acquisition module 81 is specifically configured to: determine the original motion vector as a central motion vector; determine An edge motion vector corresponding to the center motion vector, the edge motion vector being different from the center motion vector; obtaining the encoding performance of the center motion vector and the encoding performance of the edge motion vector according to the template; The coding performance of the center motion vector and the coding performance of the edge motion vector are described, and the target motion vector is determined from the center motion vector and the edge motion vector.
- the acquisition module 81 is specifically configured to move the central motion vector (x, y) in different directions by an offset S to obtain edge motion vectors (xS, y), edge motion vector (x + S, y), edge motion vector (x, y + S), and edge motion vector (x, yS).
- the obtaining module 81 When the obtaining module 81 obtains the encoding performance of the central motion vector and the encoding performance of the edge motion vector according to the template, the obtaining module 81 is specifically configured to: according to parameter information of the template of the current image block and the first target reference block Parameter information to determine the encoding performance of the central motion vector, wherein the first target reference block is an image block obtained after the reference image block corresponding to the template is offset based on the central motion vector; according to the current The parameter information of the template of the image block and the parameter information of the second target reference block determine the encoding performance of the edge motion vector, and the second target reference block is a reference image block corresponding to the template based on the edge motion vector. Image patches obtained after offset.
- the acquiring module 81 is specifically configured to determine the target motion vector from the center motion vector and the edge motion vector according to the encoding performance of the center motion vector and the edge motion vector, and is used to: The motion vector with the best coding performance is selected from the center motion vector and the edge motion vector; and when the motion vector with the best coding performance is not the original motion vector, the motion vector with the best coding performance is determined as the target motion.
- Vector when the motion vector with the best encoding performance is the original motion vector, select the motion vector with the best encoding performance from the center motion vector and the edge motion vector, and determine the motion vector with the best encoding performance Is the target motion vector.
- the obtaining module 81 is further configured to: determine whether an iteration end condition of a target motion vector is satisfied; if so, according to the encoding performance of the central motion vector and the encoding performance of the edge motion vector, the The target motion vector is determined from the edge motion vector; if not, the motion vector with the best coding performance is selected from the center motion vector and the edge motion vector, and the motion vector with the best coding performance is determined as The center motion vector, and return to perform an operation of determining an edge motion vector corresponding to the center motion vector.
- the sending module 82 When the sending module 82 sends an encoded bit stream to a decoding end according to the original motion vector and the target motion vector, the sending module 82 is specifically configured to: obtain the encoding performance of the original motion vector and the encoding performance of the target motion vector; When the encoding performance of the target motion vector is better than the encoding performance of the original motion vector, the encoding bit stream carrying the first indication information is sent to the decoding end, and the first indication information is used to instruct to determine the current image block based on the template Final motion vector.
- the sending module 82 When the sending module 82 sends an encoded bit stream to a decoding end according to the original motion vector and the target motion vector, the sending module 82 is specifically configured to: obtain the encoding performance of the original motion vector and the encoding performance of the target motion vector; When the encoding performance of the original motion vector is better than the encoding performance of the target motion vector, the encoding bit stream carrying the second instruction information is sent to the decoding end, and the second instruction information is used to indicate the determination based on the original motion vector corresponding to the current image block. A final motion vector of the current image block.
- the sending module 82 When the sending module 82 sends the encoded bit stream to the decoding end according to the original motion vector and the target motion vector, the sending module 82 is specifically configured to: obtain an index value of the original motion vector in the motion vector list; and send the carrying bitstream to the decoding end. The encoded bit stream of the index value.
- the sending module 82 obtains the encoding performance of the original motion vector is specifically used to determine the encoding performance of the original motion vector according to parameter information of a template of the current image block and parameter information of a third target reference block,
- the third target reference block is an image block obtained after the reference image block corresponding to the template is offset based on the original motion vector;
- the obtaining, by the sending module 82, the encoding performance of the target motion vector is specifically used to determine the encoding performance of the target motion vector according to parameter information of a template of the current image block and parameter information of a fourth target reference block,
- the fourth target reference block is an image block obtained after the reference image block corresponding to the template is offset based on the target motion vector.
- the processor 91 includes a processor 91 and a machine-readable storage medium 92.
- the machine-readable storage medium 92 stores machine-executable instructions that can be executed by the processor 91.
- the processor 91 is configured to execute machine-executable instructions. Instructions to implement the motion vector determination method disclosed in the above example.
- an embodiment of the present disclosure further provides a machine-readable storage medium.
- the machine-readable storage medium stores a number of computer instructions.
- the present disclosure can be implemented.
- the processor 93 includes a processor 93 and a machine-readable storage medium 94.
- the machine-readable storage medium 94 stores machine-executable instructions that can be executed by the processor 93.
- the processor 93 is configured to execute machine-executable instructions. The method for determining a motion vector disclosed in the above example is implemented.
- an embodiment of the present disclosure further provides a machine-readable storage medium.
- the machine-readable storage medium stores a number of computer instructions.
- the present disclosure can be implemented.
- the 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 may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard drive), solid state hard disk, any type of storage disk (Such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.
- the system, device, module, or unit described in the foregoing embodiments may be specifically implemented by a computer chip or entity, or a product with a certain function.
- a typical implementation device is a computer, and the specific form of the computer may 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 sending and receiving device, and a game control Desk, tablet computer, wearable device, or a combination of any of these devices.
- the embodiments of the present disclosure may be provided as a method, a system, or a computer program product. Therefore, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer-usable program code.
- computer-usable storage media including but not limited to disk memory, CD-ROM, optical memory, etc.
- these computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device,
- the instruction device implements the functions specified in a flowchart or a plurality of processes and / or a block or a plurality of blocks in the block diagram.
- These computer program instructions can also be loaded on a computer or other programmable data processing device, so that a series of operation steps can be performed on the computer or other programmable device to generate a computer-implemented process, which can be executed on the computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
Claims (45)
- 一种运动矢量确定方法,应用于解码端,包括:获取当前图像块的候选图像块的运动信息;根据所述候选图像块的运动信息获取所述当前图像块的模板;根据所述当前图像块对应的原始运动矢量和获取的所述模板,得到基于所述模板的目标运动矢量;根据所述目标运动矢量确定所述当前图像块的最终运动矢量。
- 根据权利要求1所述的方法,其特征在于,所述获取当前图像块的候选图像块的运动信息之前,所述方法还包括:接收来自编码端的所述当前图像块对应的编码比特流,所述编码比特流携带第一指示信息,所述第一指示信息用于指示基于模板确定所述当前图像块的最终运动矢量;根据所述第一指示信息,获取当前图像块的候选图像块的运动信息,根据所述候选图像块的运动信息获取所述当前图像块的模板。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:接收来自编码端的所述当前图像块对应的编码比特流,所述编码比特流携带第二指示信息,所述第二指示信息用于指示基于当前图像块对应的原始运动矢量确定所述当前图像块的最终运动矢量;根据所述第二指示信息,获取所述当前图像块对应的原始运动矢量;根据所述原始运动矢量,确定所述当前图像块的最终运动矢量。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:根据本地预设的第一策略信息,获取当前图像块的候选图像块的运动信息,根据所述候选图像块的运动信息获取所述当前图像块的模板;所述第一策略信息用于指示基于模板确定所述当前图像块的最终运动矢量;或者,根据本地预设的第二策略信息,获取所述当前图像块对应的原始运动矢量;根据所述原始运动矢量,确定所述当前图像块的最终运动矢量;所述第二策略信息用于指示基于当前图像块对应的原始运动矢量确定所述当前图像块的最终运动矢量;或者,获取第三策略信息,所述第三策略信息表示采用与当前图像块的相邻图像块相同的策略信息确定所述当前图像块的最终运动矢量;根据所述第三策略信息,确定所述当前图像块的最终运动矢量。
- 根据权利要求1至4中任一项所述的方法,其特征在于,所述根据所述当前图像块对应的原始运动矢量和获取的所述模板,得到基于所述模板的目标运动矢量之前,所述方法还包括:接收来自编码端的所述当前图像块对应的编码比特流,所述编码比特流携带原始运动矢量在运动矢量列表中的索引值;从运动矢量列表中选取与所述索引值对应的运动矢量;将选取的所述运动矢量确定为所述当前图像块对应的原始运动矢量。
- 根据权利要求1至4中任一项所述的方法,其特征在于,在所述根据所述当前图像块对应的原始运动矢量和获取的所述模板,得到基于所述模板的目标运动矢量之前,所述方法还包括:将所述当前图像块的候选图像块的运动矢量确定为所述当前图像块对应的原始运 动矢量。
- 根据权利要求1至6中任一项所述的方法,其特征在于,所述候选图像块包括M个第一候选图像块和N个第二候选图像块,M为大于或等于1的自然数,N为大于或等于0的自然数,或者,M为大于或等于0的自然数,N为大于或等于1的自然数;所述第一候选图像块为所述当前图像块上侧的候选图像块,所述第二候选图像块为所述当前图像块左侧的候选图像块;所述根据所述候选图像块的运动信息获取所述当前图像块的模板,包括:根据M个第一候选图像块的运动矢量预测模式和运动信息,确定第一模板;根据N个第二候选图像块的运动矢量预测模式和运动信息,确定第二模板;将所述第一模板确定为所述当前图像块的模板;或者,将所述第二模板确定为所述当前图像块的模板;或者,将所述第一模板和所述第二模板拼接之后确定为所述当前图像块的模板。
- 根据权利要求7所述的方法,其特征在于,所述第一候选图像块包括所述当前图像块上侧的相邻图像块和/或次邻图像块;所述相邻图像块的预测模式为帧间模式或者帧内模式;所述次邻图像块的预测模式为帧间模式;所述第二候选图像块包括所述当前图像块左侧的相邻图像块和/或次邻图像块;所述相邻图像块的预测模式为帧间模式或者帧内模式;所述次邻图像块的预测模式为帧间模式。
- 根据权利要求7所述的方法,其特征在于,当所述M大于1时,所述第一模板包括M个子模板或者P个子模板,且由所述M个子模板或所述P个子模板拼接而成,所述P为帧间模式的第一候选图像块的数量;当M等于1时,所述第一模板包括第一子模板,所述第一子模板是根据所述当前图像块上侧的一个候选图像块的运动矢量预测模式和运动信息确定的。
- 根据权利要求9所述的方法,其特征在于,所述运动信息包括所述第一候选图像块的运动矢量和参考帧索引,所述根据M个第一候选图像块的运动矢量预测模式和运动信息,确定第一模板,包括:针对所述M个第一候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧间模式时,根据所述参考帧索引确定所述第i个候选图像块对应的参考帧图像;根据所述第i个候选图像块的运动矢量,从所述参考帧图像中确定所述第i个候选图像块对应的参考图像块,所述参考图像块与所述第i个候选图像块的相对位置偏移与所述第i个候选图像块的运动矢量相匹配;根据确定的所述参考图像块,获取尺寸为第一横向长度和第一纵向长度的图像块作为所述第一模板包括的第i个子模板。
- 根据权利要求9所述的方法,其特征在于,所述根据M个第一候选图像块的运动矢量预测模式和运动信息,确定第一模板,包括:针对所述M个第一候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧内模式时,将所述第i个候选图像块按照默认值填充,并获取尺寸为第一横向长度和第一纵向长度的图像块作为所述第一模板包括的第i个子模板;或者,根据所述第i个候选图像块对应的参考帧索引确定所述第i个候选图像块对应的参考帧图像;根据所述第i个候选图像块对应的运动矢量,从所述参考帧图像中确定所述第i个候选图像块对应的参考图像块,所述参考图像块与所述第i个候选图像块的相对位置偏移与所述第i个候选图像块对应的运动矢量相匹配;根据确定的所述参考图像块,获取尺寸为第一横向长度和第一纵向长度的图像块作为所述第一模板包括的第i个子模板;其中,所述第i个候选图像块对应的参考帧索引和运动矢量,是所述第i个候选图像块的相邻图像块的参考帧索引和运动矢量。
- 根据权利要求10或11所述的方法,其特征在于,所述第一横向长度与所述第一候选图像块的横向长度满足第一比例关系,或者与所述当前图像块的横向长度满足第二比例关系,或者等于第一预设长度;所述第一纵向长度与所述第一候选图像块的纵向长度满足第三比例关系,或者与所述当前图像块的纵向长度满足第四比例关系,或者等于第二预设长度。
- 根据权利要求7所述的方法,其特征在于,当所述N大于1时,所述第二模板包括N个子模板或者R个子模板,且由所述N个子模板或所述R个子模板拼接而成,所述R为帧间模式的第二候选图像块的数量;当N等于1时,所述第二模板包括第二子模板,所述第二子模板是根据所述当前图像块左侧的一个候选图像块的运动矢量预测模式和运动信息确定的。
- 根据权利要求13所述的方法,其特征在于,所述运动信息包括所述第二候选图像块的运动矢量和参考帧索引,所述根据N个第二候选图像块的运动矢量预测模式和运动信息,确定第二模板,包括:针对所述N个第二候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧间模式时,根据所述参考帧索引确定所述第i个候选图像块对应的参考帧图像;根据所述第i个候选图像块的运动矢量,从所述参考帧图像中确定所述第i个候选图像块对应的参考图像块,所述参考图像块与所述第i个候选图像块的相对位置偏移与所述第i个候选图像块的运动矢量相匹配;根据确定的所述参考图像块,获取尺寸为第二横向长度和第二纵向长度的图像块作为所述第二模板包括的第i个子模板。
- 根据权利要求13所述的方法,其特征在于,所述根据N个第二候选图像块的运动矢量预测模式和运动信息,确定第二模板,包括:针对所述N个第二候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧内模式时,将所述第i个候选图像块按照默认值填充,并获取尺寸为第二横向长度和第二纵向长度的图像块作为所述第二模板包括的第i个子模板;或者,根据所述第i个候选图像块对应的参考帧索引确定所述第i个候选图像块对应的参考帧图像;根据所述第i个候选图像块对应的运动矢量,从所述参考帧图像中确定所述第i个候选图像块对应的参考图像块,所述参考图像块与所述第i个候选图像块的相对位置偏移与所述第i个候选图像块对应的运动矢量相匹配;根据确定的所述参考图像块,获取尺寸为第二横向长度和第二纵向长度的图像块作为所述第一模板包括的第i个子模 板;其中,所述第i个候选图像块对应的参考帧索引和运动矢量,是所述第i个候选图像块的相邻图像块的参考帧索引和运动矢量。
- 根据权利要求14或15所述的方法,其特征在于,所述第二横向长度与所述第二候选图像块的横向长度满足第五比例关系,或者与所述当前图像块的横向长度满足第六比例关系,或者等于第三预设长度;所述第二纵向长度与所述第二候选图像块的纵向长度满足第七比例关系,或者与所述当前图像块的纵向长度满足第八比例关系,或者等于第四预设长度。
- 根据权利要求1至16中任一项所述的方法,其特征在于,所述根据所述候选图像块的运动信息获取所述当前图像块的模板,包括:当所述当前图像块对应多个运动信息时,根据每个运动信息获取该运动信息对应的模板;获取每个运动信息对应的权重,并根据每个运动信息对应的权重以及所述运动信息对应的模板获取所述当前图像块的模板。
- 根据权利要求1所述的方法,其特征在于,根据所述当前图像块对应的原始运动矢量和获取的所述模板,得到基于所述模板的目标运动矢量,包括:将所述原始运动矢量确定为中心运动矢量;确定与所述中心运动矢量对应的边缘运动矢量,所述边缘运动矢量与所述中心运动矢量不同;根据所述模板获得所述中心运动矢量的编码性能和所述边缘运动矢量的编码性能;根据所述中心运动矢量的编码性能和所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述目标运动矢量。
- 根据权利要求18所述的方法,其特征在于,确定与所述中心运动矢量对应的边缘运动矢量,包括:将中心运动矢量(x,y)向不同方向移动偏移量S,得到不同方向的边缘运动矢量(x-S,y)、边缘运动矢量(x+S,y)、边缘运动矢量(x,y+S)、边缘运动矢量(x,y-S)。
- 根据权利要求18所述的方法,其特征在于,所述根据所述模板获得所述中心运动矢量的编码性能和所述边缘运动矢量的编码性能,包括:根据所述当前图像块的模板的参数信息和第一目标参考块的参数信息,确定所述中心运动矢量的编码性能,其中,所述第一目标参考块为所述模板对应的参考图像块基于所述中心运动矢量进行偏移之后获得的图像块;根据所述当前图像块的模板的参数信息和第二目标参考块的参数信息,确定所述边缘运动矢量的编码性能,其中,所述第二目标参考块为所述模板对应的参考图像块基于所述边缘运动矢量进行偏移之后获得的图像块。
- 根据权利要求18所述的方法,其特征在于,根据所述中心运动矢量的编码性能和所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述目标运动矢量,包括:从所述中心运动矢量和所述边缘运动矢量中选择编码性能最优的运动矢量;当编码性能最优的运动矢量不是所述原始运动矢量时,将编码性能最优的运动矢量确定为所述目标运动矢量;当编码性能最优的运动矢量是所述原始运动矢量时,从所述 中心运动矢量和所述边缘运动矢量中选择编码性能次优的运动矢量,并将编码性能次优的运动矢量确定为所述目标运动矢量。
- 根据权利要求18所述的方法,其特征在于,根据所述中心运动矢量的编码性能和所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述目标运动矢量之前,还包括:判断是否满足目标运动矢量的迭代结束条件;如果是,则执行根据所述中心运动矢量的编码性能和所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述目标运动矢量的操作;如果否,则从所述中心运动矢量和所述边缘运动矢量中选择编码性能最优的运动矢量,并将编码性能最优的运动矢量确定为所述中心运动矢量,并返回执行确定与所述中心运动矢量对应的边缘运动矢量的操作。
- 一种运动矢量确定方法,其特征在于,应用于编码端,包括:获取当前图像块的候选图像块的运动信息;根据所述候选图像块的运动信息获取所述当前图像块的模板;根据所述当前图像块对应的原始运动矢量和获取的所述模板,得到基于所述模板的目标运动矢量;根据所述原始运动矢量和所述目标运动矢量向解码端发送编码比特流。
- 根据权利要求23所述的方法,其特征在于,所述候选图像块包括M个第一候选图像块和N个第二候选图像块,M为大于或等于1的自然数,N为大于或等于0的自然数,或者,M为大于或等于0的自然数,N为大于或等于1的自然数;所述第一候选图像块为所述当前图像块上侧的候选图像块,所述第二候选图像块为所述当前图像块左侧的候选图像块;所述根据所述候选图像块的运动信息获取所述当前图像块的模板,包括:根据M个第一候选图像块的运动矢量预测模式和运动信息,确定第一模板;根据N个第二候选图像块的运动矢量预测模式和运动信息,确定第二模板;将所述第一模板确定为所述当前图像块的模板;或者,将所述第二模板确定为所述当前图像块的模板;或者,将所述第一模板和所述第二模板拼接之后确定为所述当前图像块的模板。
- 根据权利要求24所述的方法,其特征在于,所述第一候选图像块包括所述当前图像块上侧的相邻图像块和/或次邻图像块;所述相邻图像块的预测模式为帧间模式或者帧内模式;所述次邻图像块的预测模式为帧间模式;所述第二候选图像块包括所述当前图像块左侧的相邻图像块和/或次邻图像块;所述相邻图像块的预测模式为帧间模式或者帧内模式;所述次邻图像块的预测模式为帧间模式。
- 根据权利要求24所述的方法,其特征在于,当所述M大于1时,所述第一模板包括M个子模板或者P个子模板,且由所述M个子模板或所述P个子模板拼接而成,所述P为帧间模式的第一候选图像块的数量;当M等于1时,所述第一模板包括第一子模板,所述第一子模板是根据所述当前图像块上侧的一个候选图像块的运动矢量预测模式和运动信息确定的。
- 根据权利要求26所述的方法,其特征在于,所述运动信息包括所述第一候选 图像块的运动矢量和参考帧索引,所述根据M个第一候选图像块的运动矢量预测模式和运动信息,确定第一模板,包括:针对所述M个第一候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧间模式时,根据所述参考帧索引确定所述第i个候选图像块对应的参考帧图像;根据所述第i个候选图像块的运动矢量,从所述参考帧图像中确定所述第i个候选图像块对应的参考图像块,所述参考图像块与所述第i个候选图像块的相对位置偏移与所述第i个候选图像块的运动矢量相匹配;根据确定的所述参考图像块,获取尺寸为第一横向长度和第一纵向长度的图像块作为所述第一模板包括的第i个子模板。
- 根据权利要求26所述的方法,其特征在于,所述根据M个第一候选图像块的运动矢量预测模式和运动信息,确定第一模板,包括:针对所述M个第一候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧内模式时,将所述第i个候选图像块按照默认值填充,并获取尺寸为第一横向长度和第一纵向长度的图像块作为所述第一模板包括的第i个子模板;或者,根据所述第i个候选图像块对应的参考帧索引确定所述第i个候选图像块对应的参考帧图像;根据所述第i个候选图像块对应的运动矢量,从所述参考帧图像中确定所述第i个候选图像块对应的参考图像块,所述参考图像块与所述第i个候选图像块的相对位置偏移与所述第i个候选图像块对应的运动矢量相匹配;根据确定的所述参考图像块,获取尺寸为第一横向长度和第一纵向长度的图像块作为所述第一模板包括的第i个子模板;其中,所述第i个候选图像块对应的参考帧索引和运动矢量,是所述第i个候选图像块的相邻图像块的参考帧索引和运动矢量。
- 根据权利要求27或28所述的方法,其特征在于,所述第一横向长度与所述第一候选图像块的横向长度满足第一比例关系,或者与所述当前图像块的横向长度满足第二比例关系,或者等于第一预设长度;所述第一纵向长度与所述第一候选图像块的纵向长度满足第三比例关系,或者与所述当前图像块的纵向长度满足第四比例关系,或者等于第二预设长度。
- 根据权利要求24所述的方法,其特征在于,当所述N大于1时,所述第二模板包括N个子模板或者R个子模板,且由所述N个子模板或所述R个子模板拼接而成,所述R为帧间模式的第二候选图像块的数量;当N等于1时,所述第二模板包括第二子模板,所述第二子模板是根据所述当前图像块左侧的一个候选图像块的运动矢量预测模式和运动信息确定的。
- 根据权利要求30所述的方法,其特征在于,所述运动信息包括所述第二候选图像块的运动矢量和参考帧索引,所述根据N个第二候选图像块的运动矢量预测模式和运动信息,确定第二模板,包括:针对所述N个第二候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧间模式时,根据所述参考帧索引确定所述第i个候选图像块对应的参考帧图像;根据所述第i个候选图像块的运动矢量,从所述参考帧图像中确定所述第i个候选图像块对应的参考图像块,所述参考图像块与所述第i个候选图像块的相对位置偏移与所述第i个候选图像块的运动矢量相匹配;根据确定的所述参考图像块,获取尺寸为第二横向长度和第二纵向长度的图像块作为所述第二模板包括的第i个子模板。
- 根据权利要求30所述的方法,其特征在于,所述根据N个第二候选图像块的运动矢量预测模式和运动信息,确定第二模板,包括:针对所述N个第二候选图像块中的第i个候选图像块,当确定所述第i个候选图像块的运动矢量预测模式为帧内模式时,将所述第i个候选图像块按照默认值填充,并获取尺寸为第二横向长度和第二纵向长度的图像块作为所述第二模板包括的第i个子模板;或者,根据所述第i个候选图像块对应的参考帧索引确定所述第i个候选图像块对应的参考帧图像;根据所述第i个候选图像块对应的运动矢量,从所述参考帧图像中确定所述第i个候选图像块对应的参考图像块,所述参考图像块与所述第i个候选图像块的相对位置偏移与所述第i个候选图像块对应的运动矢量相匹配;根据确定的所述参考图像块,获取尺寸为第二横向长度和第二纵向长度的图像块作为所述第一模板包括的第i个子模板;其中,所述第i个候选图像块对应的参考帧索引和运动矢量,是所述第i个候选图像块的相邻图像块的参考帧索引和运动矢量。
- 根据权利要求31或32所述的方法,其特征在于,所述第二横向长度与所述第二候选图像块的横向长度满足第五比例关系,或者与所述当前图像块的横向长度满足第六比例关系,或者等于第三预设长度;所述第二纵向长度与所述第二候选图像块的纵向长度满足第七比例关系,或者与所述当前图像块的纵向长度满足第八比例关系,或者等于第四预设长度。
- 根据权利要求23至33中任一项所述的方法,其特征在于,所述根据所述候选图像块的运动信息获取所述当前图像块的模板,包括:当所述当前图像块对应多个运动信息时,根据每个运动信息获取该运动信息对应的模板;获取每个运动信息对应的权重,并根据每个运动信息对应的权重以及所述运动信息对应的模板获取所述当前图像块的模板。
- 根据权利要求23所述的方法,其特征在于,根据所述当前图像块对应的原始运动矢量和获取的所述模板,得到基于所述模板的目标运动矢量,包括:将所述原始运动矢量确定为中心运动矢量;确定与所述中心运动矢量对应的边缘运动矢量,所述边缘运动矢量与所述中心运动矢量不同;根据所述模板获得所述中心运动矢量的编码性能和所述边缘运动矢量的编码性能;根据所述中心运动矢量的编码性能和所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述目标运动矢量。
- 根据权利要求35所述的方法,其特征在于,确定与所述中心运动矢量对应的边缘运动矢量,包括:将中心运动矢量(x,y)向 不同方向移动偏移量S,得到不同方向的边缘运动矢量(x-S,y)、边缘运动矢量(x+S,y)、边缘运动矢量(x,y+S)、边缘运动矢量(x,y-S)。
- 根据权利要求35所述的方法,其特征在于,所述根据所述模板获得所述中心运动矢量的编码性能和所述边缘运动矢量的编码性能,包括:根据所述当前图像块的模板的参数信息和第一目标参考块的参数信息,确定所述中心运动矢量的编码性能,其中,所述第一目标参考块为所述模板对应的参考图像块基于所述中心运动矢量进行偏移之后获得的图像块;根据所述当前图像块的模板的参数信息和第二目标参考块的参数信息,确定所述边缘运动矢量的编码性能,其中,所述第二目标参考块为所述模板对应的参考图像块基于所述边缘运动矢量进行偏移之后获得的图像块。
- 根据权利要求35所述的方法,其特征在于,根据所述中心运动矢量的编码性能和所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述目标运动矢量,包括:从所述中心运动矢量和所述边缘运动矢量中选择编码性能最优的运动矢量;当编码性能最优的运动矢量不是所述原始运动矢量时,将编码性能最优的运动矢量确定为所述目标运动矢量;当编码性能最优的运动矢量是所述原始运动矢量时,从所述中心运动矢量和所述边缘运动矢量中选择编码性能次优的运动矢量,并将编码性能次优的运动矢量确定为所述目标运动矢量。
- 根据权利要求35所述的方法,其特征在于,根据所述中心运动矢量的编码性能和所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述目标运动矢量之前,还包括:判断是否满足目标运动矢量的迭代结束条件;如果是,则执行根据所述中心运动矢量的编码性能和所述边缘运动矢量的编码性能,从所述中心运动矢量和所述边缘运动矢量中确定所述目标运动矢量的操作;如果否,则从所述中心运动矢量和所述边缘运动矢量中选择编码性能最优的运动矢量,并将编码性能最优的运动矢量确定为所述中心运动矢量,并返回执行确定与所述中心运动矢量对应的边缘运动矢量的操作。
- 根据权利要求23所述的方法,其特征在于,所述根据所述原始运动矢量和所述目标运动矢量向解码端发送编码比特流,包括:获取所述原始运动矢量的编码性能和所述目标运动矢量的编码性能;当所述目标运动矢量的编码性能优于所述原始运动矢量的编码性能时,向解码端发送携带第一指示信息的编码比特流,所述第一指示信息用于指示基于模板确定所述当前图像块的最终运动矢量。
- 根据权利要求23所述的方法,其特征在于,所述根据所述原始运动矢量和所述目标运动矢量向解码端发送编码比特流,包括:获取所述原始运动矢量的编码性能和所述目标运动矢量的编码性能;当所述原始运动矢量的编码性能优于所述目标运动矢量的编码性能时,向解码端发送携带第二指示信息的编码比特流,所述第二指示信息用于指示基于当前图像块对应的原始运动矢量确定所述当前图像块的最终运动矢量。
- 根据权利要求23所述的方法,其特征在于,所述根据所述原始运动矢量和所 述目标运动矢量向解码端发送编码比特流,包括:获取所述原始运动矢量在运动矢量列表中的索引值;向解码端发送携带所述索引值的编码比特流。
- 根据权利要求40或41所述的方法,其特征在于,获取所述原始运动矢量的编码性能,包括:根据所述当前图像块的模板的参数信息和第三目标参考块的参数信息,确定所述原始运动矢量的编码性能,其中,所述第三目标参考块为所述模板对应的参考图像块基于所述原始运动矢量进行偏移之后获得的图像块;获取所述目标运动矢量的编码性能,包括:根据所述当前图像块的模板的参数信息和第四目标参考块的参数信息,确定所述目标运动矢量的编码性能,其中,所述第四目标参考块为所述模板对应的参考图像块基于所述目标运动矢量进行偏移之后获得的图像块。
- 一种解码端设备,包括:处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;所述处理器用于执行机器可执行指令,以实现权利要求1-22任一所述的方法步骤。
- 一种编码端设备,包括:处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可执行指令;所述处理器用于执行机器可执行指令,以实现权利要求23-43任一所述的方法步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810692034.XA CN110662074B (zh) | 2018-06-28 | 2018-06-28 | 一种运动矢量确定方法和设备 |
CN201810692034.X | 2018-06-28 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020001624A1 true WO2020001624A1 (zh) | 2020-01-02 |
Family
ID=68985404
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/093709 WO2020001624A1 (zh) | 2018-06-28 | 2019-06-28 | 一种运动矢量确定方法和设备 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110662074B (zh) |
WO (1) | WO2020001624A1 (zh) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112312131B (zh) * | 2020-12-31 | 2021-04-06 | 腾讯科技(深圳)有限公司 | 一种帧间预测方法、装置、设备及计算机可读存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3646845B2 (ja) * | 1998-03-03 | 2005-05-11 | Kddi株式会社 | ビデオ符号化装置 |
CN102215386A (zh) * | 2010-04-09 | 2011-10-12 | 华为技术有限公司 | 视频图像块处理方法及装置 |
CN102215387A (zh) * | 2010-04-09 | 2011-10-12 | 华为技术有限公司 | 视频图像处理方法以及编/解码器 |
CN102611886A (zh) * | 2011-01-22 | 2012-07-25 | 华为技术有限公司 | 一种运动预测或补偿方法 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101686393B (zh) * | 2008-09-28 | 2012-10-17 | 华为技术有限公司 | 应用于模板匹配的快速运动搜索方法及装置 |
KR101456499B1 (ko) * | 2010-07-09 | 2014-11-03 | 삼성전자주식회사 | 움직임 벡터의 부호화 방법 및 장치, 그 복호화 방법 및 장치 |
US20120082228A1 (en) * | 2010-10-01 | 2012-04-05 | Yeping Su | Nested entropy encoding |
SG11201703454XA (en) * | 2014-11-18 | 2017-06-29 | Mediatek Inc | Method of bi-prediction video coding based on motion vectors from uni-prediction and merge candidate |
CN108134939B (zh) * | 2016-12-01 | 2020-08-07 | 北京金山云网络技术有限公司 | 一种运动估计方法及装置 |
-
2018
- 2018-06-28 CN CN201810692034.XA patent/CN110662074B/zh active Active
-
2019
- 2019-06-28 WO PCT/CN2019/093709 patent/WO2020001624A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3646845B2 (ja) * | 1998-03-03 | 2005-05-11 | Kddi株式会社 | ビデオ符号化装置 |
CN102215386A (zh) * | 2010-04-09 | 2011-10-12 | 华为技术有限公司 | 视频图像块处理方法及装置 |
CN102215387A (zh) * | 2010-04-09 | 2011-10-12 | 华为技术有限公司 | 视频图像处理方法以及编/解码器 |
CN102611886A (zh) * | 2011-01-22 | 2012-07-25 | 华为技术有限公司 | 一种运动预测或补偿方法 |
Also Published As
Publication number | Publication date |
---|---|
CN110662074B (zh) | 2021-11-23 |
CN110662074A (zh) | 2020-01-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5937717B2 (ja) | 映像復号化方法及び装置 | |
US8098731B2 (en) | Intraprediction method and apparatus using video symmetry and video encoding and decoding method and apparatus | |
WO2020057559A1 (zh) | 一种解码、编码方法及其设备 | |
TWI688257B (zh) | 視訊編解碼之方法及裝置 | |
US8229233B2 (en) | Method and apparatus for estimating and compensating spatiotemporal motion of image | |
JP5367097B2 (ja) | 動きベクトル予測符号化方法、動きベクトル予測復号方法、動画像符号化装置、動画像復号装置およびそれらのプログラム | |
JP5306485B2 (ja) | 動きベクトル予測符号化方法、動きベクトル予測復号方法、動画像符号化装置、動画像復号装置およびそれらのプログラム | |
US9979976B2 (en) | Light-weight video coding system and decoder for light-weight video coding system | |
US11025913B2 (en) | Encoding video using palette prediction and intra-block copy | |
WO2020001591A1 (zh) | 一种解码、编码方法及其设备 | |
WO2020001624A1 (zh) | 一种运动矢量确定方法和设备 | |
JP2018511237A (ja) | コンテンツ適応型bピクチャパターンビデオエンコーディング | |
WO2020007306A1 (zh) | 一种解码、编码方法和设备 | |
CN112565747B (zh) | 一种解码、编码方法、装置及其设备 | |
CN113794883B (zh) | 一种编解码方法、装置及其设备 | |
Jubran et al. | Sequence-level reference frames in video coding | |
CN113766234B (zh) | 一种解码、编码方法、装置及其设备 | |
WO2019196650A1 (zh) | 一种运动矢量确定方法、装置及其设备 | |
CN113709486B (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: 19826358 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19826358 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19826358 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19826358 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 22.06.2021) |