CN-116647675-B - Intra-frame prediction method and device, and computer readable storage medium
Abstract
An intra-frame prediction method, an intra-frame prediction device and a computer storage medium comprise the steps of configuring an actual angle mode represented by a relative angle number, wherein the relative angle number sequentially represents the actual angle mode corresponding to a preset angle sampling point after sampling from a starting angle in a prediction direction range corresponding to a preset wide-height relation, the starting angle is determined according to the wide-height relation of a processing block and the prediction direction range corresponding to the preset wide-height relation, and the actual angle corresponds to the actual angle mode one by one.
Inventors
- HUO JUNYAN
- MA YANZHUO
- WAN SHUAI
- YANG FUZHENG
- GUO JINKUN
Assignees
- OPPO广东移动通信有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20190102
Claims (20)
- 1. An intra prediction method applied to a decoder, the method comprising: Determining a plurality of neighboring blocks of the current block; Determining a first intra prediction mode of the plurality of neighboring blocks; if the first intra-frame prediction mode is an angular intra-frame prediction mode, constructing an intra-frame prediction mode list of the current block according to the first intra-frame prediction modes of the plurality of adjacent blocks; Determining a first intra-frame prediction mode number of the current block according to the intra-frame prediction mode list; obtaining the aspect ratio of the current block, and mapping a first intra-frame prediction mode number of the current block into a second intra-frame prediction mode number in a wide-angle intra-frame prediction mode according to the aspect ratio; Obtaining reconstructed blocks of the plurality of adjacent blocks, wherein the reconstructed blocks are obtained by prediction based on wide-angle intra-prediction modes corresponding to the second intra-prediction mode numbers of the plurality of adjacent blocks, and the second intra-prediction mode numbers of the plurality of adjacent blocks are obtained by mapping first intra-prediction mode numbers of the plurality of adjacent blocks into intra-prediction mode numbers in the wide-angle prediction mode according to aspect ratios of the plurality of adjacent blocks; Obtaining a predicted block according to the reconstructed blocks of the plurality of adjacent blocks based on a target intra-prediction mode corresponding to the second intra-prediction mode number of the current block; wherein, in the case that the width of the current block is greater than the height and the ratio of the width to the height is greater than or equal to 2: If the ratio of the width to the height is 2, determining the second intra-frame prediction mode number by the sum value between the first intra-frame prediction mode number and a first preset value 65 if the value of the first intra-frame prediction mode number is smaller than 8; If the ratio of the width to the height is 4, determining the second intra-frame prediction mode number by the sum value between the first intra-frame prediction mode number and the first preset value 65 if the value of the first intra-frame prediction mode number is smaller than 12; if the ratio of the width to the height is 8, determining the second intra-frame prediction mode number by the sum between the first intra-frame prediction mode number and the first preset value 65 if the value of the first intra-frame prediction mode number is smaller than 14; If the ratio of the width to the height is 16, determining the second intra-frame prediction mode number by the sum between the first intra-frame prediction mode number and the first preset value 65 if the value of the first intra-frame prediction mode number is smaller than 16; wherein, the value range of the second intra prediction mode number is 8-80.
- 2. The method of claim 1, wherein the plurality of neighboring blocks of the current block comprises at least one of a left neighboring block and an upper neighboring block corresponding to the current block.
- 3. The method of claim 2, wherein the method further comprises: Determining a maximum value and a minimum value of the first intra prediction modes of the plurality of neighboring blocks; The intra prediction mode list of the current block is constructed according to at least one of the first intra prediction mode of the plurality of neighboring blocks, the maximum value and the minimum value of the first intra prediction mode of the plurality of neighboring blocks.
- 4. A method according to claim 3, wherein the method further comprises: Calculating at least one actual angle prediction mode with at least one of the first intra prediction mode of the plurality of neighboring blocks, the maximum value and the minimum value of the first intra prediction mode of the plurality of neighboring blocks as a relative angle prediction mode; And constructing an intra-frame prediction mode list of the current block according to the at least one actual angle prediction mode.
- 5. The method of claim 4, wherein the method further comprises: and acquiring the at least one actual angle prediction mode according to a preset offset value and the relative angle prediction mode.
- 6. The method of claim 5, wherein the method further comprises: and calculating the sum or difference between the relative angle prediction mode and the preset offset value, and determining the at least one actual angle prediction mode according to a calculation result.
- 7. The method of any of claims 1-6, wherein mapping a first intra prediction mode number of the current block to a second intra prediction mode number in a wide angle intra prediction mode according to the aspect ratio comprises: Determining the second intra-frame prediction mode number according to a first preset value and the first intra-frame prediction mode number when the width of the current block is larger than the height and the ratio of the width to the height is larger than or equal to 2; and determining the second intra-frame prediction mode number according to a second preset value and the first intra-frame prediction mode number when the height of the current block is larger than the width and the ratio of the height to the width is larger than or equal to 2.
- 8. The method of claim 7, wherein the mapping of the first intra prediction mode number of the current block to a second intra prediction mode number in a wide angle intra prediction mode according to the aspect ratio is skipped in a case where a width of the current block is equal to high.
- 9. The method of claim 7, wherein, in a case where the height of the current block is greater than the width and the ratio of the height to the width is greater than or equal to 2: if the ratio of the height to the width is 2, determining the second intra-frame prediction mode number by the difference between the first intra-frame prediction mode number and a second preset value 67 if the value of the first intra-frame prediction mode number is greater than 60; If the ratio of the height to the width is 4, determining the second intra-frame prediction mode number by the difference between the first intra-frame prediction mode number and the second preset value 67 if the value of the first intra-frame prediction mode number is greater than 58; if the ratio of the height to the width is 8, determining the second intra-frame prediction mode number by the difference between the first intra-frame prediction mode number and the second preset value 67 if the value of the first intra-frame prediction mode number is greater than 56; If the ratio of the height to the width is 16, determining the second intra-frame prediction mode number by the difference between the first intra-frame prediction mode number and the second preset value 67 if the value of the first intra-frame prediction mode number is greater than 54; Wherein, the value range of the second intra prediction mode number is-14-60.
- 10. The method according to any one of claims 1-6, wherein, In the case that the width of the current block is greater than the height and the ratio of the width to the height is greater than or equal to 2, determining the second intra prediction mode number according to the following manner: If the ratio of the width to the height is 2, determining that the number of the second intra-frame prediction mode sequentially takes on natural numbers from 67 to 72 if the number of the first intra-frame prediction mode sequentially takes on natural numbers from 2 to 7; If the ratio of the width to the height is 4, if the first intra-frame prediction mode numbers are sequentially valued as natural numbers from 2 to 11, determining that the second intra-frame prediction mode numbers are sequentially valued as natural numbers from 67 to 76; if the ratio of the width to the height is 8, if the number of the first intra-frame prediction mode sequentially takes a natural number from 2 to 13, determining that the number of the second intra-frame prediction mode sequentially takes a natural number from 67 to 78; If the ratio of the width to the height is 16, if the number of the first intra-frame prediction mode sequentially takes a natural number from 2 to 15, determining that the number of the second intra-frame prediction mode sequentially takes a natural number from 67 to 80; in the case that the height of the current block is greater than the width and the ratio of the height to the width is greater than or equal to 2, determining the second intra prediction mode number according to the following manner: If the ratio of the height to the width is 2, determining that the number of the second intra-frame prediction mode sequentially takes on negative integers from-6 to-1 if the number of the first intra-frame prediction mode sequentially takes on natural numbers from 61 to 66; If the ratio of the height to the width is 4, determining that the number of the second intra-frame prediction mode sequentially takes on negative integers from-10 to-1 if the number of the first intra-frame prediction mode sequentially takes on natural numbers from 57 to 66; If the ratio of the height to the width is 8, determining that the number of the second intra-frame prediction mode sequentially takes on negative integers from-12 to-1 if the number of the first intra-frame prediction mode sequentially takes on natural numbers from 55 to 66; If the ratio of the height to the width is 16, determining that the number of the second intra-frame prediction mode sequentially takes on negative integers from-14 to-1 if the number of the first intra-frame prediction mode sequentially takes on natural numbers from 53 to 66; Wherein the first intra-frame prediction mode numbers are mapped to the second intra-frame prediction mode numbers in a one-to-one correspondence in sequence.
- 11. An intra prediction method applied to an encoder, the method comprising: Determining a plurality of neighboring blocks of the current block; Determining a first intra prediction mode of the plurality of neighboring blocks; if the first intra-frame prediction mode is an angular intra-frame prediction mode, constructing an intra-frame prediction mode list of the current block according to the first intra-frame prediction modes of the plurality of adjacent blocks; Determining a first intra-frame prediction mode number of the current block according to the intra-frame prediction mode list; obtaining the aspect ratio of the current block, and mapping a first intra-frame prediction mode number of the current block into a second intra-frame prediction mode number in a wide-angle intra-frame prediction mode according to the aspect ratio; Obtaining reconstructed blocks of the plurality of adjacent blocks, wherein the reconstructed blocks are obtained by prediction based on wide-angle intra-prediction modes corresponding to the second intra-prediction mode numbers of the plurality of adjacent blocks, and the second intra-prediction mode numbers of the plurality of adjacent blocks are obtained by mapping first intra-prediction mode numbers of the plurality of adjacent blocks into intra-prediction mode numbers in the wide-angle prediction mode according to aspect ratios of the plurality of adjacent blocks; Obtaining a predicted block according to the reconstructed blocks of the plurality of adjacent blocks based on a target intra-prediction mode corresponding to the second intra-prediction mode number of the current block; wherein, in the case that the width of the current block is greater than the height and the ratio of the width to the height is greater than or equal to 2: If the ratio of the width to the height is 2, determining the second intra-frame prediction mode number by the sum value between the first intra-frame prediction mode number and a first preset value 65 if the value of the first intra-frame prediction mode number is smaller than 8; If the ratio of the width to the height is 4, determining the second intra-frame prediction mode number by the sum value between the first intra-frame prediction mode number and the first preset value 65 if the value of the first intra-frame prediction mode number is smaller than 12; if the ratio of the width to the height is 8, determining the second intra-frame prediction mode number by the sum between the first intra-frame prediction mode number and the first preset value 65 if the value of the first intra-frame prediction mode number is smaller than 14; If the ratio of the width to the height is 16, determining the second intra-frame prediction mode number by the sum between the first intra-frame prediction mode number and the first preset value 65 if the value of the first intra-frame prediction mode number is smaller than 16; wherein, the value range of the second intra prediction mode number is 8-80.
- 12. The method of claim 11, wherein the plurality of neighboring blocks of the current block comprises at least one of a left neighboring block and an upper neighboring block corresponding to the current block.
- 13. The method of claim 12, wherein the method further comprises: Determining a maximum value and a minimum value of the first intra prediction modes of the plurality of neighboring blocks; The intra prediction mode list of the current block is constructed according to at least one of the first intra prediction mode of the plurality of neighboring blocks, the maximum value and the minimum value of the first intra prediction mode of the plurality of neighboring blocks.
- 14. The method of claim 13, wherein the method further comprises: Calculating at least one actual angle prediction mode with at least one of the first intra prediction mode of the plurality of neighboring blocks, the maximum value and the minimum value of the first intra prediction mode of the plurality of neighboring blocks as a relative angle prediction mode; And constructing an intra-frame prediction mode list of the current block according to the at least one actual angle prediction mode.
- 15. The method of claim 14, wherein the method further comprises: and acquiring the at least one actual angle prediction mode according to a preset offset value and the relative angle prediction mode.
- 16. The method of claim 14, wherein the method further comprises: and calculating the sum or difference between the relative angle prediction mode and the preset offset value, and determining the at least one actual angle prediction mode according to a calculation result.
- 17. The method of any of claims 11-16, wherein mapping a first intra prediction mode number of the current block to a second intra prediction mode number in a wide angle intra prediction mode according to the aspect ratio comprises: Determining the second intra-frame prediction mode number according to a first preset value and the first intra-frame prediction mode number when the width of the current block is larger than the height and the ratio of the width to the height is larger than or equal to 2; and determining the second intra-frame prediction mode number according to a second preset value and the first intra-frame prediction mode number when the height of the current block is larger than the width and the ratio of the height to the width is larger than or equal to 2.
- 18. The method of claim 17, wherein the mapping of the first intra prediction mode number of the current block to a second intra prediction mode number in a wide angle intra prediction mode according to the aspect ratio is skipped in a case where a width of the current block is equal to high.
- 19. The method of claim 17, wherein, in the case where the height of the current block is greater than the width and the ratio of the height to the width is greater than or equal to 2: if the ratio of the height to the width is 2, determining the second intra-frame prediction mode number by the difference between the first intra-frame prediction mode number and a second preset value 67 if the value of the first intra-frame prediction mode number is greater than 60; If the ratio of the height to the width is 4, determining the second intra-frame prediction mode number by the difference between the first intra-frame prediction mode number and the second preset value 67 if the value of the first intra-frame prediction mode number is greater than 58; if the ratio of the height to the width is 8, determining the second intra-frame prediction mode number by the difference between the first intra-frame prediction mode number and the second preset value 67 if the value of the first intra-frame prediction mode number is greater than 56; If the ratio of the height to the width is 16, determining the second intra-frame prediction mode number by the difference between the first intra-frame prediction mode number and the second preset value 67 if the value of the first intra-frame prediction mode number is greater than 54; Wherein, the value range of the second intra prediction mode number is-14-60.
- 20. The method according to any one of claims 11-16, wherein, In the case that the width of the current block is greater than the height and the ratio of the width to the height is greater than or equal to 2, determining the second intra prediction mode number according to the following manner: If the ratio of the width to the height is 2, determining that the number of the second intra-frame prediction mode sequentially takes on natural numbers from 67 to 72 if the number of the first intra-frame prediction mode sequentially takes on natural numbers from 2 to 7; If the ratio of the width to the height is 4, if the first intra-frame prediction mode numbers are sequentially valued as natural numbers from 2 to 11, determining that the second intra-frame prediction mode numbers are sequentially valued as natural numbers from 67 to 76; if the ratio of the width to the height is 8, if the number of the first intra-frame prediction mode sequentially takes a natural number from 2 to 13, determining that the number of the second intra-frame prediction mode sequentially takes a natural number from 67 to 78; If the ratio of the width to the height is 16, if the number of the first intra-frame prediction mode sequentially takes a natural number from 2 to 15, determining that the number of the second intra-frame prediction mode sequentially takes a natural number from 67 to 80; in the case that the height of the current block is greater than the width and the ratio of the height to the width is greater than or equal to 2, determining the second intra prediction mode number according to the following manner: If the ratio of the height to the width is 2, determining that the number of the second intra-frame prediction mode sequentially takes on negative integers from-6 to-1 if the number of the first intra-frame prediction mode sequentially takes on natural numbers from 61 to 66; If the ratio of the height to the width is 4, determining that the number of the second intra-frame prediction mode sequentially takes on negative integers from-10 to-1 if the number of the first intra-frame prediction mode sequentially takes on natural numbers from 57 to 66; If the ratio of the height to the width is 8, determining that the number of the second intra-frame prediction mode sequentially takes on negative integers from-12 to-1 if the number of the first intra-frame prediction mode sequentially takes on natural numbers from 55 to 66; If the ratio of the height to the width is 16, determining that the number of the second intra-frame prediction mode sequentially takes on negative integers from-14 to-1 if the number of the first intra-frame prediction mode sequentially takes on natural numbers from 53 to 66; Wherein the first intra-frame prediction mode numbers are mapped to the second intra-frame prediction mode numbers in a one-to-one correspondence in sequence.
Description
Intra-frame prediction method and device, and computer readable storage medium The application relates to a division application of an application with a filing date of 2019, 1 month and 2 days, an application number of 2019800712115, a frame prediction method and device and a computer readable storage medium. Technical Field The embodiment of the application relates to an intra-frame prediction technology in the field of video coding, in particular to an intra-frame prediction method and device and a computer storage medium. Background In the luminance prediction process of the next generation video coding standard h.266 or the multi-function video coding (VERSATILE VIDEO CODING, VVC), in order to reduce the number of entropy-coded bits, an MPM list is constructed, and the prediction modes of neighboring blocks are stored. Based on the principle that the similarity of the spatial neighboring blocks is high, the prediction mode selected by the current block has a high probability that the prediction mode is the same as a certain mode existing in the MPM list, so that the prediction mode of the current block can be encoded with a smaller number of bits. However, due to the existence of the non-square block wide angle mode, the actual angle direction represented by the angle mode number may be different from the original meaning, which results in that in the MPM list, the angle mode of the same number may represent different prediction directions for the neighboring block and the current block, and the situation classification is numerous, which affects the accurate representation and use of the prediction mode of the current block. In the chroma prediction process, the DM mode may use the prediction mode of the luminance block where the center of the current chroma block is located, and whether the prediction mode of the luminance block is a wide angle mode or not, the DM mode may use the original angle mode number, which may cause a deviation between the actually used angle mode of the chroma block and the angle mode of the corresponding luminance block. That is, in the wide angle mode, the angle mode numbers may correspond to different actual angle modes, so that the angle conversion in the luminance prediction process is more complex, and the angle modes of the luminance blocks borrowed by the chrominance prediction have deviation, and the problem of inaccurate prediction occurs. Disclosure of Invention The embodiment of the application provides an intra-frame prediction method and device and a computer readable storage medium, which can effectively improve the accuracy of intra-frame prediction and improve the coding and decoding efficiency. The technical scheme of the embodiment of the application is realized as follows: the application provides an intra-frame prediction method, which comprises the following steps: the method comprises the steps of configuring an actual angle mode represented by a relative angle number, wherein the relative angle number sequentially represents the actual angle mode corresponding to a preset angle sampling point after sampling from a starting angle in a prediction direction range corresponding to a preset wide-high relation, the starting angle is determined according to the wide-high relation of a processing block and the prediction direction range corresponding to the preset wide-high relation, and the actual angle corresponds to the actual angle mode one by one. In the above scheme, when the sampling of the preset angle sampling point is 65, the relative angle numbers are continuous numbers in the range of 2 'to 66', the actual angle modes corresponding to the relative angle numbers are 65 continuous actual angle modes in the range of-14 to 80, and the selection of the 65 actual angle modes is determined by a wide-high relationship, wherein the relative angle numbers and the actual angle modes are in one-to-one correspondence in sequence. In the above scheme, when the sampling of the preset angle sampling point is 33, the relative angle numbers are continuous numbers in the range of 2 'to 34', the actual angle modes corresponding to the relative angle numbers are 33 continuous actual angle modes in the range of-7 to 41, and the selection of the 33 actual angle modes is determined by a wide-high relationship, wherein the relative angle numbers and the actual angle modes are in one-to-one correspondence in sequence. In the above scheme, when the sampling of the preset angle sampling point is 129, the relative angle numbers are continuous numbers in the range of 2 'to 130', the actual angle modes corresponding to the relative angle numbers are 129 continuous actual angle modes in the range of-28 to 158, and the selection of the 129 actual angle modes is determined by a wide-high relationship, wherein the relative angle numbers and the actual angle modes are in one-to-one correspondence in sequence. The embodiment of the application also provides an intra-frame prediction