Search

CN-121986487-A - Coding and decoding method and device, coder and decoder, code stream, equipment and storage medium

CN121986487ACN 121986487 ACN121986487 ACN 121986487ACN-121986487-A

Abstract

The embodiment of the application discloses a coding and decoding method and device, a coder and decoder, a code stream, equipment and a storage medium, wherein the decoding method comprises the steps of determining a first difference value of sample values between a first reference block pointed by a first candidate MV of a current block and a second reference block pointed by a second candidate MV of the current block, determining a second difference value of sample values between a template of the current block and a template of the first reference block, determining a third difference value of sample values between a template of the current block and a template of the second reference block, performing motion estimation on the current block at least according to the first difference value, the second difference value and the third difference value to obtain a first prediction MV and a second prediction MV of the current block, and performing motion compensation on the current block according to the first prediction MV and the second prediction MV to obtain a prediction block of the current block.

Inventors

  • WANG FAN

Assignees

  • OPPO广东移动通信有限公司

Dates

Publication Date
20260505
Application Date
20230928

Claims (20)

  1. A decoding method applied to a decoder, the method comprising: Determining a first difference value of sample values between a first reference block pointed by a first candidate MV of a current block and a second reference block pointed by a second candidate MV of the current block; Determining a second difference in sample values between the template of the current block and the template of the first reference block; Determining a third difference in sample values between the template of the current block and the template of the second reference block; Performing motion estimation on the current block at least according to the first difference value, the second difference value and the third difference value to obtain a first prediction MV and a second prediction MV of the current block; and performing motion compensation on the current block according to the first prediction MV and the second prediction MV to obtain a prediction block of the current block.
  2. The method of claim 1, wherein the performing motion estimation on the current block based at least on the first difference value, the second difference value, and the third difference value to obtain a first predicted MV and a second predicted MV for the current block comprises: Determining a first matching cost according to at least the first difference value, the second difference value and the third difference value, wherein the first matching cost represents the matching degree of the first reference block and the second reference block with the current block; The method comprises the steps of taking a first candidate MV as a starting point, searching in a first direction to obtain a new first candidate MV by taking the first candidate MV as a searching step length, taking the second candidate MV as a starting point, searching in a second direction by taking the first step length as a searching step length, and determining a new first matching cost according to the new first candidate MV and the new second candidate MV, wherein the first direction and the second direction are in a mirror image relationship; and determining the first prediction MV and the second prediction MV at least according to the obtained two first matching costs.
  3. The method of claim 2, wherein the determining the first predicted MV and the second predicted MV based at least on the two resulting first matching costs comprises: And under the condition that a first search cutoff condition is met, determining the first prediction MV and the second prediction MV according to the obtained two first matching costs.
  4. The method of claim 2, wherein the determining the first predicted MV and the second predicted MV based at least on the two resulting first matching costs comprises: And under the condition that a first search cutoff condition is not met, iteratively performing the first search process by taking the new first candidate MV and the new second candidate MV as starting points until the first search cutoff condition is met, and determining the first predicted MV and the second predicted MV according to the obtained multiple first matching costs.
  5. The method according to claim 3 or 4, wherein, The first prediction MV is equal to the MV corresponding to the minimum first matching cost in the obtained first matching costs; and the second prediction MV is equal to the MV corresponding to the minimum first matching cost.
  6. The method of claim 2, wherein the determining the first matching cost based at least on the first difference, the second difference, and the third difference comprises: Determining a first weighting coefficient of the first difference, a second weighting coefficient of the second difference, and a third weighting coefficient of the third difference; And weighting the first difference value, the second difference value and the third difference value according to the first weighting coefficient, the second weighting coefficient and the third weighting coefficient to obtain the first matching cost.
  7. The method of claim 2, wherein the determining a first matching cost based at least on the first difference, the second difference, and the third difference comprises: Determining a first MVD of the first candidate MV and a second MVD of the second candidate MV; And determining the first matching cost according to the first difference value, the second difference value, the third difference value, the first MVD and the second MVD.
  8. The method of claim 7, wherein the determining the first matching cost from the first difference, the second difference, the third difference, the first MVD, and the second MVD comprises: Determining a first weighting coefficient of the first difference, a second weighting coefficient of the second difference, a third weighting coefficient of the third difference, a fourth weighting coefficient of the first MVD, and a fifth weighting coefficient of the second MVD; and weighting the first difference value, the second difference value, the third difference value, the first MVD and the second MVD according to the first weighting coefficient, the second weighting coefficient, the third weighting coefficient, the fourth weighting coefficient and the fifth weighting coefficient to obtain the first matching cost.
  9. The method of claim 1, wherein the performing motion estimation on the current block based at least on the first difference value, the second difference value, and the third difference value to obtain a first predicted MV and a second predicted MV for the current block comprises: determining a second matching cost according to at least the first difference value and the second difference value, wherein the second matching cost represents the matching degree of the first reference block and the current block; The first candidate MV is used as a starting point, and a second search process is carried out to obtain a new second matching cost, wherein the second search process comprises the steps of searching in a first direction to obtain a new first candidate MV by taking the first candidate MV as a starting point and taking a second step length as a search step length; Under the condition that the second search cutoff condition is not met, iteratively performing the second search process with the new first candidate MV as a starting point until the second search cutoff condition is met; And under the condition that a second search cutoff condition is met, determining the first prediction MV and the second prediction MV according to at least the obtained plurality of second matching costs and the third difference value.
  10. The method of claim 9, wherein the determining the first predicted MV and the second predicted MV based at least on the resulting plurality of the second matching costs and the third difference comprises: Taking a first candidate MV corresponding to the minimum second matching cost in the obtained plurality of second matching costs as a third candidate MV; determining a fourth difference in sample values between a third reference block to which the third candidate MV points and a second reference block to which the second candidate MV points; determining a third matching cost according to at least the fourth difference value and the third difference value, wherein the third matching cost represents the matching degree of the second reference block and the current block; the third searching process is carried out by taking the second candidate MV as a starting point, and a new third matching cost is obtained, wherein the third searching process comprises the steps of searching in a second direction by taking the second candidate MV as a starting point and a third step length as a searching step length, and determining the new third matching cost according to the third candidate MV and the new second candidate MV; under the condition that the third search cutoff condition is not met, iteratively performing the third search process with the new second candidate MV as a starting point until the third search cutoff condition is met; And under the condition that a third search cutoff condition is met, determining the first prediction MV and the second prediction MV according to the obtained multiple third matching costs and the third candidate MVs.
  11. The method of claim 10, wherein the determining the first predicted MV and the second predicted MV from the resulting plurality of the third matching costs and the third candidate MV comprises: taking the third candidate MV as the first predicted MV; And taking a second candidate MV corresponding to the smallest third matching cost in the obtained multiple third matching costs as the second prediction MV.
  12. The method of claim 10, wherein determining the second predicted MV from the resulting plurality of third matching costs and the third candidate MV comprises: And based on the fact that the second matching cost corresponding to the third candidate MV is larger than the smallest third matching cost in the obtained multiple third matching costs, the second candidate MV corresponding to the smallest third matching cost is the second prediction MV.
  13. The method of claim 12, wherein determining the first predicted MV from the resulting plurality of third matching costs and the third candidate MV comprises: Determining a fifth difference in sample values between a third reference block to which the third candidate MV points and a fourth reference block to which the second predicted MV points; correcting the template of the current block according to the template of the fourth reference block to obtain a first corrected template of the current block; determining a sixth difference in sample values between the template of the third reference block and the first modified template; Determining a fourth matching cost according to at least the fifth difference value and the sixth difference value, wherein the fourth matching cost represents the matching degree of the third reference block and the current block; the third candidate MV is used as a starting point, and a fourth searching process is carried out to obtain a new fourth matching cost, wherein the fourth searching process comprises the steps of searching in a first direction to obtain a new third candidate MV by taking the third candidate MV as a starting point and taking a fourth step length as a searching step length; And determining the first prediction MV at least according to the obtained two fourth matching costs.
  14. The method of claim 13, wherein the determining the first predicted MV based at least on the resulting two fourth matching costs comprises: And under the condition that a fourth search cutoff condition is met, determining the first prediction MV according to the obtained two fourth matching costs.
  15. The method of claim 13, wherein the determining the first predicted MV based at least on the resulting two fourth matching costs comprises: And under the condition that a fourth search cutoff condition is not met, iteratively performing the fourth search process by taking the new third candidate MV as a starting point until the fourth search cutoff condition is met, and determining the first prediction MV according to the obtained multiple fourth matching costs.
  16. The method according to claim 14 or 15, wherein, And the first prediction MV is equal to a third candidate MV corresponding to the smallest fourth matching cost in the obtained fourth matching costs.
  17. The method of claim 13, wherein, The sample value of each position of the first modified template is equal to 2 times the sample value of the corresponding position of the template of the current block minus the sample value of the corresponding position of the template of the fourth reference block.
  18. The method of claim 9, wherein the determining a second matching cost based at least on the first difference and the second difference comprises: Determining a first weighting coefficient of the first difference and a second weighting coefficient of the second difference; And weighting the first difference value and the second difference value according to the first weighting coefficient and the second weighting coefficient to obtain the second matching cost.
  19. The method of claim 9, wherein the determining a second matching cost based at least on the first difference and the second difference comprises: determining a first MVD of the first candidate MV; and determining the second matching cost according to the first difference value, the second difference value and the first MVD.
  20. The method of claim 19, wherein the determining the second matching cost from the first difference, the second difference, and the first MVD comprises: determining a first weighting coefficient of the first difference, a second weighting coefficient of the second difference, and a fourth weighting coefficient of the first MVD; and weighting the first difference value, the second difference value and the first MVD according to the first weighting coefficient, the second weighting coefficient and the fourth weighting coefficient to obtain the second matching cost.

Description

Coding and decoding method and device, coder and decoder, code stream, equipment and storage medium Technical Field Embodiments of the present application relate to video encoding and decoding techniques, and relate to, but are not limited to, encoding and decoding methods and apparatuses, codecs, code streams, devices, and storage media. Background In the field of video coding, how to enhance video compression efficiency is of paramount importance. The image and video create a significant amount of data redundancy in the digitizing process, which makes video compression techniques possible. Because of the strong similarity between adjacent images in video, the inter-image prediction method is used in the video coding and decoding technology to eliminate the time redundancy between the adjacent images, thereby improving the coding efficiency. However, the inter prediction in the existing video codec standard has a problem of poor video codec performance. Therefore, it is still of some significance to study how to further improve the accuracy of inter prediction, and thus enhance video codec performance. Disclosure of Invention In view of this, the coding and decoding method and device, the coder and decoder, the code stream, the device and the storage medium provided by the embodiment of the application can improve the accuracy of inter-frame prediction so as to enhance the video coding and decoding performance, and the coding and decoding method and device, the coder and decoder, the code stream, the device and the storage medium provided by the embodiment of the application are realized in the following way: According to one aspect of the embodiment of the application, a decoding method is provided, and the decoding method is applied to a decoder, and comprises the steps of determining a first difference value of sample values between a first reference block pointed by a first candidate MV of a current block and a second reference block pointed by a second candidate MV of the current block, determining a second difference value of sample values between a template of the current block and a template of the first reference block, determining a third difference value of sample values between a template of the current block and a template of the second reference block, performing motion estimation on the current block according to at least the first difference value, the second difference value and the third difference value to obtain a first prediction MV and a second prediction MV of the current block, and performing motion compensation on the current block according to the first prediction MV and the second prediction MV to obtain a prediction block of the current block. According to one aspect of the embodiment of the application, an encoding method is provided, and the encoding method is applied to an encoder, and comprises the steps of determining a first difference value of sample values between a first reference block pointed by a first candidate MV of a current block and a second reference block pointed by a second candidate MV of the current block, determining a second difference value of sample values between a template of the current block and a template of the first reference block, determining a third difference value of sample values between a template of the current block and a template of the second reference block, performing motion estimation on the current block according to at least the first difference value, the second difference value and the third difference value to obtain a first prediction MV and a second prediction MV of the current block, and performing motion compensation on the current block according to the first prediction MV and the second prediction MV to obtain a prediction block of the current block. According to an aspect of an embodiment of the present application, there is provided a decoding apparatus applied to a decoder, the apparatus including a first determining module configured to determine a first difference of sample values between a first reference block to which a first candidate MV of a current block points and a second reference block to which a second candidate MV of the current block points, a second determining module configured to determine a second difference of sample values between a template of the current block and a template of the first reference block, a third determining module configured to determine a third difference of sample values between a template of the current block and a template of the second reference block, a first motion estimating module configured to perform motion estimation on the current block based on at least the first difference, the second difference, and the third difference, to obtain a first prediction MV and a second prediction MV of the current block, and a first motion compensating module configured to perform motion compensation on the current block based on the first prediction MV and the second prediction MV, t