WO2023044618A1 - 编解码方法及装置 - Google Patents

编解码方法及装置 Download PDF

Info

Publication number
WO2023044618A1
WO2023044618A1 PCT/CN2021/119697 CN2021119697W WO2023044618A1 WO 2023044618 A1 WO2023044618 A1 WO 2023044618A1 CN 2021119697 W CN2021119697 W CN 2021119697W WO 2023044618 A1 WO2023044618 A1 WO 2023044618A1
Authority
WO
WIPO (PCT)
Prior art keywords
angle
image block
index
prediction
mode
Prior art date
Application number
PCT/CN2021/119697
Other languages
English (en)
French (fr)
Inventor
郭泽
王江林
郑萧桢
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN202180101496.XA priority Critical patent/CN117795953A/zh
Priority to PCT/CN2021/119697 priority patent/WO2023044618A1/zh
Publication of WO2023044618A1 publication Critical patent/WO2023044618A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/105Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction

Definitions

  • the present application relates to the technical field of encoding and decoding, and in particular, relates to an encoding method and device, and a decoding method and device.
  • AV1 is a video coding standard developed by the Alliance of Open Media Video.
  • AV1 video coding standard developed by the Alliance of Open Media Video.
  • it mainly performs a series of processing such as image block division, prediction, transformation, quantization, entropy encoding, and loop filtering on the input image to obtain the final code stream for storage or network. transmission.
  • Prediction is an important link in the encoding process, and accurate prediction of image blocks is the key to improving encoding efficiency.
  • the shape of the image blocks can be different, for example, it can be square, long or vertical.
  • the adjacent image blocks with higher correlation The location of the pixels will also change.
  • the prediction angle corresponding to the existing angle mode of the AV1 standard is a fixed angle, and the design of the angle mode cannot meet the needs of image blocks of different shapes, resulting in insufficient utilization of reference pixels, and the coding efficiency needs to be improved.
  • the present application provides an encoding method and device, and a decoding method and device.
  • a decoding method comprising:
  • Determining the prediction mode of the image block based on the code stream adopts an angle mode in an intra prediction mode, an index of the angle mode, and a size/shape of the image block;
  • an encoding method comprising:
  • the code stream includes first indication information for indicating that the prediction mode of the image block adopts the angle mode in the intra prediction mode, and an index for indicating the angle mode
  • the index is determined;
  • a decoding device includes a processor, a memory, and a computer program stored in the memory that can be executed by the processor, and the processor executes the computer program , perform the following steps:
  • Determining the prediction mode of the image block based on the code stream adopts an angle mode in an intra prediction mode, an index of the angle mode, and a size/shape of the image block;
  • an encoding device includes a processor, a memory, and a computer program stored in the memory for execution by the processor, when the processor executes the computer program , implement the following steps:
  • the code stream includes first indication information for indicating that the prediction mode of the image block adopts the angle mode in the intra prediction mode, and an index for indicating the angle mode
  • the index is determined;
  • a computer-readable storage medium is provided, and a computer program is stored on the computer-readable storage medium.
  • the computer program is executed, the above-mentioned first or second aspect is implemented. method.
  • the angle mode in the original AV1 standard is optimized, and a part of the prediction angle in the original AV1 standard can be mapped based on the shape/size of the image block , so that the reference pixel pointed by the mapped prediction angle is more correlated with the image block. For example, based on the shape of the image block, a part of the prediction angle pointing to the short side of the image block can be mapped to the prediction pointing to the long side of the image block. Angle, since the image is divided into rectangular blocks, it represents to a certain extent that the texture of the image block tends to a certain side. By mapping the predicted angle on the short side of the image block to the long side, the pixel correlation of the long side can be fully utilized to achieve The purpose of improving prediction accuracy, thereby improving coding efficiency.
  • Fig. 1 is a schematic diagram of 56 angle modes in the AV1 standard of an embodiment of the present application.
  • Fig. 2 is a schematic diagram of reference pixels of an image block in the AV1 standard according to an embodiment of the present application.
  • Fig. 3 is a schematic diagram of determining a predicted pixel value based on an angle mode according to an embodiment of the present application
  • Fig. 4(a) and Fig. 4(b) are schematic diagrams of an image block division method according to an embodiment of the present application.
  • Fig. 5 is a schematic diagram of distribution of prediction angles in a rectangular image block according to an embodiment of the present application.
  • Fig. 6 is a flowchart of an encoding method according to an embodiment of the present application.
  • Fig. 7 is a flowchart of a decoding method according to an embodiment of the present application.
  • Fig. 8 is a schematic diagram of distribution of prediction angles in a rectangular image block according to an embodiment of the present application.
  • Fig. 9 is a schematic diagram of flipping a prediction angle according to an embodiment of the present application.
  • Fig. 10 is a schematic diagram of reference pixels of a rectangular image block according to an embodiment of the present application.
  • 11( a ) and 11 ( b ) are schematic diagrams of mapping angles and reference pixels of a rectangular image block with an aspect ratio of 1:2 and a rectangular image block with an aspect ratio of 1:4 in the embodiment of the present application.
  • Fig. 12 is a schematic diagram of a logical structure of an encoding device according to an embodiment of the present application.
  • Fig. 13 is a schematic diagram of a logical structure of a decoding device according to an embodiment of the present application.
  • AV1 is a video coding standard developed by the Alliance of Open Media Video.
  • the image to be encoded is divided into blocks to obtain multiple image blocks .
  • the encoded image block can be used to perform intra-frame prediction or inter-frame prediction on the image block, determine the predicted pixel value of each pixel in the image block, and determine the actual pixel value of each pixel in the image block.
  • the residual of the pixel value and the predicted pixel value is encoded to obtain a code stream of the image block for storage or network transmission. Since there is no need to store and transmit the original pixel values of the image block, but only the residual, the amount of data can be greatly reduced.
  • predicting the current image block to be encoded based on the encoded image block, and determining the predicted pixel value of the current image block to be encoded is an important link in the encoding process. Accurately predicting the image block to be encoded is important. The key to improving coding efficiency.
  • the AV1 encoding standard there are mainly two modes for predicting an image block to be encoded, an intra-frame prediction mode and an inter-frame pre-mode.
  • the inter-frame prediction mode uses other coded frame images to predict the image block to be encoded, while the intra-frame prediction mode refers to using the video spatial correlation to use the pixels of the encoded image block on the left and above the image block to be encoded The value generates the predicted pixel value of the image block to be encoded.
  • the intra-frame prediction modes in the AV1 standard include two types: angle mode and non-angle mode. Both non-angular and angular modes can be further subdivided into multiple modes.
  • the angle mode in the AV1 standard supports a total of 56 angle modes from 36° to 212°, which can better fit the texture direction of the image for prediction.
  • Figure 1 shows the angle mode in the AV1 standard, where the prediction directions indicated by the 8 black arrows are defined as the main angle mode, and each main angle is shifted to both sides by 3 degrees, 6 degrees, and 9 degrees to obtain 6 extended angles mode (the gray arrow in Figure 1), there are 48 extended angle modes in total.
  • the direction indicated by the prediction angle corresponding to each angle mode is the prediction direction of the angle mode, and the prediction angle corresponding to each angle mode is shown in Table 1.
  • intra prediction uses adjacent pixels of an image block as reference pixels. Taking a W ⁇ H image block as an example, the reference pixels required for intra-frame prediction are shown in Figure 2, including W+H pixels on the left, W+H pixels on the top, and 1 pixel on the upper left. A total of 2 pixels are required. (W+H)+1 reference pixels. If any reference pixel is unavailable, it will be filled with the last available reference pixel value.
  • the 3 ⁇ 3 image block in the figure is the current image block to be predicted
  • the pixels above and to the left of the image block are used as reference Pixel
  • the reference Pixel in the 45° direction of pixel a is b, so the pixel value of pixel b can be used as its predicted pixel value.
  • the last reference pixel for example, pixel c
  • each angle mode corresponds to an index, which is used to uniquely identify the angle mode. Since the prediction angles corresponding to each angle mode are different, the index of the angle mode is determined, that is, the prediction angle corresponding to the angle mode can be known.
  • the AV1 standard includes 8 main angles, and each main angle is extended by 6 extended angles. There are 56 angle modes in total, and each angle mode has an index for identifying the angle mode. For example, the indexes of the 8 main angle modes can be represented by 0-7, and the indexes of the extended angle modes can be represented by the main angle index and the offset of the extended angle relative to the main angle.
  • the shape of the finally obtained image block is also different, for example, it may be square, long strip (wide and high), vertical strip Shape (higher than wide).
  • Figure 4(a) it is a schematic diagram of dividing an image in the AV1 standard.
  • the image can be divided into 128 ⁇ 128 image blocks, and then the divided square image blocks can be further divided to select The image block division method with the least encoding cost.
  • the image block can be further divided according to the 10 division methods shown in Fig. 4(b). It can be seen from Fig. 4(b) that the divided image may be a square image block, or a rectangular image block whose width is greater than its height, or a rectangular image block whose height is greater than its width.
  • the distribution of adjacent pixels that are more correlated with the image block is also different.
  • the correlation between the upper right adjacent pixel and the image block is greater than that of the lower left.
  • the correlation between adjacent pixels and image blocks is the opposite for vertical bar-shaped image blocks.
  • the current AV1 standard specifies 56 angle modes from 36 degrees to 212 degrees.
  • the prediction angles corresponding to the 56 angle modes are fixed, which cannot meet the needs of image blocks of different shapes.
  • the embodiment of the present application provides a codec method.
  • the angle mode in the original AV1 standard is optimized, and the original AV1 standard is optimized based on the shape/size of the image block.
  • a part of the prediction angles in is mapped, so that the reference pixels pointed by the mapped prediction angles are more correlated with the image block.
  • a part of the prediction angles pointing to the short side of the image block can be mapped to The prediction angle on the long side of the image block makes it possible to make full use of adjacent pixels on the long side that are more relevant to the image block when predicting the image block, thereby improving coding efficiency.
  • the encoding method provided by the embodiment of the present application can be used in various encoding devices, the decoding method can be used in various decoding devices, and the encoding and decoding method can be applied to encoding and decoding of various images or videos.
  • the encoding method and the decoding method provided by the embodiment of the present application are introduced below in conjunction with the processing flow of the encoding end and the decoding end.
  • the code stream includes first indication information for indicating that the prediction mode of the image block adopts the angle mode in the intra prediction mode, and is used for indicating the angle mode
  • the second indication information of the index of the index, and the third indication information used to indicate the size/shape of the image block; wherein, the prediction angle corresponding to the angle mode is based on the size/shape of the image block, and the angle index determination of the prediction mode;
  • the image or video frame to be encoded can be divided to obtain multiple image blocks.
  • dividing the image block you can refer to the method of dividing the image in the AV1 standard For example, firstly, the image can be divided into 128 ⁇ 128 image blocks, and then the divided square image blocks can be further divided, as shown in Figure 4(a), and the image block division method with the least coding cost is selected.
  • the image block can be further divided according to the 10 division methods shown in Fig. 4(b). It can be seen from Fig. 4(b) that the divided image may be a square image block or a rectangular image block.
  • each image block can be encoded.
  • the prediction mode with the smallest encoding cost can be selected from various intra prediction modes, and used for this Image blocks are intra-predicted.
  • each angle mode can be used to predict the predicted pixel value of the image block, determine its encoding cost, and select the optimal angle mode from the angle modes, and then compete with other non-angle modes to determine the final prediction mode.
  • the prediction angle in the angle mode in the existing AV1 standard is fixed and cannot meet the requirements of image blocks of different shapes/sizes
  • it when constructing the angle mode of intra prediction, it can be based on the shape of the image block /size maps a part of the prediction angles in the original AV1 standard, so that the reference pixels pointed to by the mapped prediction angles have a stronger correlation with the image block.
  • the index of the original angle mode can still be used to represent the mapped angle mode, only the index
  • the indicated prediction angle changes, and the prediction angle corresponding to the angle mode can be determined in combination with the shape/size of the image block and the angle indicated by the index.
  • the image block may be encoded based on the selected angle mode. For example, as shown in FIG.
  • the predicted pixel value of the pixel can be determined based on the pixel value of the reference pixel pointed to by the prediction angle corresponding to the angle mode. If the prediction angle just points to one reference pixel, the pixel value of the reference pixel is used as the predicted pixel value; if it points to multiple reference pixels, the predicted pixel value is determined by combining the pixel values of the multiple reference pixels. After determining the predicted pixel value of each pixel of the image block, the residual between the actual pixel value and the predicted pixel value of each pixel of the image block can be determined, and then the residual is encoded.
  • the code stream of the image block can be obtained, wherein the code stream can include the first indication information used to indicate that the prediction mode of the image block adopts the angle mode in the intra prediction mode, and used to indicate the The second indication information of the index of the angle mode, and the third indication information used to indicate the size/shape of the image block.
  • the third indication information used to indicate the size/shape of the image block may be information related to the division method of the image block, for example, the code stream may include the size of the image block after the preliminary division, and whether to The image block is further divided, and the way of further dividing, etc., and the decoding end can infer the shape/size of the image block based on the information of these division ways.
  • the code stream After obtaining the code stream of the image block to be encoded, the code stream can be sent to the decoding end, so that the decoding end can decode the code stream of the image block based on the above indication information.
  • the decoder can determine the type of the intra prediction mode of the image block from the code stream, for example, the intra prediction model uses the angle mode, and determine the angle mode from the code stream The index of the image block size/shape. Then, the prediction angle corresponding to the angle mode can be determined based on the shape/size of the image block and the angle indicated by the index of the angle mode, and then the code stream of the image block is decoded based on the prediction angle.
  • the prediction angle corresponding to the angle mode can be determined based on the aspect ratio of the image block and the angle indicated by the index.
  • the decoder may first determine the aspect ratio of the image block, and determine the prediction angle corresponding to the angle mode based on the aspect ratio and the angle indicated by the index.
  • mapping strategies can be formulated, so as to use different mapping strategies to map the prediction angles in the original AV1 standard.
  • the mapping strategy can be Based on information such as the angle value indicating the predicted angle to be mapped, the number of predicted angles to be mapped, which predicted angles in the AV1 standard are mapped can be known based on the mapping strategy.
  • the mapping strategy of the image block may be determined based on the aspect ratio of the image block, and then the prediction angle corresponding to the angle mode may be determined based on the index and the mapping strategy.
  • the decoder may first determine the aspect ratio of the image block, determine the corresponding mapping strategy based on the aspect ratio, and determine the prediction angle corresponding to the angle mode according to the index and the mapping strategy.
  • the prediction angle in the angle mode is the angle indicated by the index.
  • the decoder can also first determine the aspect ratio of the image block. If the aspect ratio is 1, directly use the angle indicated by the index as the prediction angle corresponding to the angle mode, and use the prediction angle Decode the stream.
  • the image block is a rectangular image block
  • the correlation between the image block and the adjacent pixels on the left and above of the image block is inconsistent, it can be Some prediction angles in the AV1 standard are mapped, so that the reference pixels pointed to by the mapped prediction angles have a stronger correlation with the image block.
  • the set of predicted angles that need to be mapped among the predicted angles of the AV1 standard at different aspect ratios can be preset, which can be called a set of target angles, and the set of target angles can include one or more predicted angles.
  • Angle when the image blocks have different aspect ratios and the angle indicated by the index is the angle of the target angle set, it means that the predicted angle corresponding to the angle mode at this time is the angle after mapping the angle indicated by the index.
  • the number of predicted angles in the target angle set is also different.
  • the aspect ratio of the image block is 1:2 and 1:4 since the correlation between the image block and the adjacent pixels on the left is stronger, the part of the AV1 standard located at the upper right of the image block can be predicted The angle is mapped to the prediction angle of the bottom left to make full use of the pixels with a stronger correlation between the bottom left and the image block for prediction.
  • the image block with an aspect ratio of 1:4 has more pixels in the lower left position that are more relevant to the image block.
  • the angle mode when constructing the angle mode, for the case that the aspect ratio of the image block is greater than 1, that is, the correlation between the image block and the upper right adjacent pixel is stronger than the correlation between the image block and the lower left adjacent pixel Therefore, part of the prediction angles pointing to the lower left of the image block in the AV1 standard can be mapped to the prediction angles pointing to the upper right of the image block, so as to increase the number of prediction angles located at the upper right of the image block and make full use of the upper right adjacent pixels Make predictions. Therefore, when the angle indicated by the index is located at the lower left of the image block, the predicted angle corresponding to the angle mode is the mapped predicted angle located at the upper right of the image block. In this case, the predicted angles in the target angle set point to the lower left of the image block, and the mapped angles point to the upper right of the image block.
  • the angle mode when constructing the angle mode, for the case that the aspect ratio of the image block is less than 1, that is, the correlation between the image block and the upper right adjacent pixel is weaker than the correlation between the image block and the lower left adjacent pixel Therefore, part of the prediction angles pointing to the upper right of the image block in the AV1 standard can be mapped to the prediction angles pointing to the lower left of the image block, so as to increase the number of prediction angles located at the lower left of the image block and make full use of the adjacent pixels in the lower left Make predictions. Therefore, when the angle indicated by the index is located at the upper right of the image block, the predicted angle corresponding to the angle mode is the predicted angle located at the lower left of the image block after mapping. In this case, the predicted angles in the target angle set point to the upper right of the image block, and the mapped angles point to the lower left of the image block.
  • the mapping relationship between the new prediction angle and the original prediction angle can be set based on the actual situation.
  • the The original prediction angle is flipped by 180° to be used as a new prediction angle.
  • other mapping methods may also be adopted, which are not limited in this embodiment of the present application.
  • the decoder can first determine the aspect ratio of the image block. If the aspect ratio is not equal to 1, it can determine the target angle set corresponding to the aspect ratio, and determine whether the angle indicated by the index is is the angle in the target angle set, if yes, the mapped angle of the angle indicated by the index is used as the predicted angle of the angle mode. Of course, if the aspect ratio is not equal to 1, and the angle indicated by the index is not an angle in the target angle set, the angle indicated by the index is directly used as the predicted angle, and then the code stream is decoded using the predicted angle. Certainly, when mapping the angle indicated by the index, the decoding end may determine the mapped angle based on a preset mapping relationship. For example, the angle indicated by the index can be flipped by 180° to obtain the mapped angle.
  • the aspect ratio for the image block is less than In the case of 1, the predicted angle in the AV1 standard that is less than or equal to the first angle threshold can be mapped to obtain the mapped angle. Therefore, at this time, the predicted angle of the angle mode is no longer the angle indicated by the index, but the angle indicated by the index
  • the mapping angle of wherein, the direction pointed by the mapping angle is opposite to the direction of the angle indicated by the index, that is, the mapping angle is obtained by flipping the original predicted angle by 180°.
  • no mapping is performed for predicted angles greater than the first angle threshold in the original AV1 standard. Therefore, when the angle indicated by the index is greater than the first angle threshold, the predicted angle of the angle mode is the index The indicated angle.
  • angles having an angle value less than or equal to the first angle threshold point to the upper right of the image block.
  • the first angle threshold can be a preset unified angle threshold. For example, for the case where the aspect ratio of all image blocks is less than 1, the predicted angles less than 45° are mapped. Therefore, the first angle threshold can be set into 45°.
  • the prediction angle to be mapped in the AV1 standard may also be different, for example, when the aspect ratio is different, the prediction angle to be mapped
  • the value of the angle and the number of predicted angles can be different. Therefore, for different aspect ratios, the corresponding first angle thresholds are also different. Therefore, the first angle threshold needs to be determined in combination with the aspect ratio of the image block.
  • the aspect ratio of the image block when the aspect ratio of the image block is less than 1, and the smaller the aspect ratio is, more prediction angles located at the upper right of the image block need to be mapped to prediction angles located at the lower left of the image block. Therefore, the smaller the aspect ratio of the image block is, the larger the first angle threshold is.
  • the decoder can first determine the aspect ratio of the image block and the angle indicated by the index, and then determine whether the angle indicated by the index is less than or equal to the first angle threshold. Flip the angle of 180° to get the mapping angle, which is used as the prediction angle. If the angle indicated by the index is greater than the first angle threshold, the angle indicated by the index is used as the predicted angle, and then the code stream is decoded using the predicted angle.
  • the aspect ratio for the image block is greater than In the case of 1, the predicted angle in the AV1 standard greater than or equal to the second angle threshold can be mapped to obtain the mapped angle. Therefore, at this time, the predicted angle of the angle mode is the mapped angle of the angle indicated by the index, where the mapped angle points to The direction of is opposite to the direction of the angle indicated by the index, that is, the mapping angle is obtained by flipping the original predicted angle by 180°. In some embodiments, mapping is not performed for predicted angles smaller than the second angle threshold in the original AV1 standard. Therefore, when the angle indicated by the index is smaller than the second angle threshold, the predicted angle of the angle mode is the index The indicated angle.
  • angles having an angle value greater than or equal to the second angle threshold point to the lower left of the image block.
  • the second angle threshold can be a preset unified angle threshold. For example, for the case where the aspect ratio of all image blocks is greater than 1, the prediction angle greater than 203° is mapped. Therefore, the second angle threshold can be set into 203°.
  • the prediction angle to be mapped in the AV1 standard may also be different.
  • the prediction angle to be mapped The value of the angle and the number of predicted angles can be different. Therefore, for different aspect ratios, the corresponding second angle thresholds are also different. Therefore, the second angle threshold needs to be determined in combination with the aspect ratio of the image block.
  • the aspect ratio of the image block when the aspect ratio of the image block is greater than 1 and the aspect ratio is smaller, fewer prediction angles located at the lower left of the image block need to be mapped to prediction angles located at the upper right of the image block. Therefore, the smaller the aspect ratio of the image block is, the larger the second angle threshold is.
  • the decoder can first determine the aspect ratio of the image block and the angle indicated by the index, and then determine whether the angle indicated by the index is greater than or equal to the second angle threshold. Flip the angle of 180° to get the mapping angle, which is used as the prediction angle. If the angle indicated by the index is smaller than the second angle threshold, the angle indicated by the index is used as the prediction angle, and then the code stream is decoded using the prediction angle.
  • reference pixels In the existing AV1 standard, for a W ⁇ H image block, its reference pixels include W+H pixels on the left side of the image block, W+H pixels above and 1 pixel on the upper left, a total of 2(W+H)+1 reference pixels, if any reference pixel is unavailable, it will be filled with the last available reference pixel value.
  • the reference pixels determined in this way are more suitable for square image blocks. For rectangular image blocks, since the correlation of adjacent pixels on the long side is higher than that on the short side, the reference pixels on the long and short sides If it is still set as the same, there will be a problem of excess reference pixels on the short side and insufficient reference pixels on the long side.
  • the number of image blocks on the left and above the image block can be determined based on the shape/size of the image block, for example, the reference above the image block
  • the number of pixels is determined based on the width of the image block, and/or the number of reference pixels located to the left of the image block may be determined based on the height of the image block.
  • the width of the image block is greater than the height, the upper reference pixels are more than the left reference pixels, and when the image block width is smaller than the height, the upper reference pixels are less than the left reference pixels.
  • the number of reference pixels located above the image block is twice the number of pixels in each row of the image block, and/or the number of reference pixels located on the left side of the image block is twice the number of pixels in each column of the image block.
  • its reference pixels may be the upper 2W pixels, the left 2H pixels, and the upper left corner of a pixel.
  • the decoder can first determine the size of the image block, then determine the reference pixels on the top and left based on the size of the image block, and use the reference pixels and prediction angle to restore the predicted pixel value of the image block , determine the actual pixel value of the image block based on the predicted pixel value and the residual in the code stream.
  • the angle mode in the AV1 standard includes 8 main angles, and each main angle has 6 extended angles. Therefore, each angle mode is identified by an index. In some embodiments, the angle indicated by the index may be the main angle or an extended angle of the main angle.
  • the index when the angle indicated by the index is an extended angle, the index may be represented by an index of the main angle of the extended angle, and an offset of the extended angle relative to the main angle.
  • the indexes of the 8 main angle modes can be represented by 0-7
  • the indexes of the extended angle modes can be represented by the main angle index and the offset of the extended angle relative to the main angle.
  • 36° is the extended angle of the main angle 45°, so its index can be represented by the index 0 of 45° and the relative angle offset of -9°.
  • the decoder can obtain the index of the main angle and the relative angle offset from the code stream, determine the index of the extension angle based on the two, and determine the prediction angle based on the index of the extension angle , for decoding.
  • the 56 angle modes in the AV1 standard correspond to angle values ranging from 36° to 212°.
  • the current coding block includes rectangular blocks of square blocks.
  • All angles from 36° to 212° are applied.
  • a rectangular block appears such as the rectangular block in FIG. 5
  • the pixel correlation of the short side is weaker than that of the long side.
  • the short side still uses the original part of the angle.
  • the prediction efficiency is relatively low, and the correlation of part of the long side is abandoned, resulting in the correlation of adjacent pixels not being fully utilized.
  • the image block is a rectangular block, the length of the reference pixel on the short side is still w+h.
  • the utilization rate of the reference pixel is unreasonable and inefficient.
  • the expansion angle of the upper right 45° direction that is, the direction of 36°-45°, will have insufficient reference pixels.
  • AV1 will use the last one of the upper right reference pixels to fill, but in fact the upper right corner could have been There will be effective reference pixels, which will lead to the deviation of the reference pixels, and finally lead to the prediction deviation.
  • the embodiment of the present application improves the AV1 standard.
  • the angle mode for the rectangular block, the number of predicted angles on the short side is reduced, and the number of angles on the long side is increased, and the corresponding reference pixel length is calculated. Modified to make full use of the correlation between the reference pixels on the short side and the long side and the current block, reducing the prediction deviation caused by the insufficient effectiveness of the reference pixels at the upper right 36° to 45°, without changing the total number of prediction angles, and improving the reference Pixel utilization increases coding performance while keeping the original prediction method unchanged for square blocks.
  • the current coding block is a rectangular block
  • map part of the prediction angle on the short side to the prediction angle on the long side taking a rectangular block with an aspect ratio of 2/1 as an example:
  • the colorless box is the current coding block
  • the dark box is the reference pixel. It can be seen from Figure 8 that for a rectangular image block, because it is more correlated with the image block on the left, the upper right corner There is an excess of predicted angles, and an insufficient predicted angle in the lower left corner.
  • some predicted angles in the upper right corner can be mapped, for example, all angles between 36° and 60° (including the main angle and extended angle) can be flipped by 180°, and mapped to the lower left corner Prediction angle, as can be seen from Figure 9, the angle of the upper right corner less than 60° is flipped to the lower left corner, that is, the angle below the red line in the lower left corner (for example, 45° in the upper right corner is flipped to 225° in the lower left corner, and 48° is flipped to 228° °, 42° flip to 222°).
  • the filling method of the reference pixel can be modified at this time. Specifically: the length of the reference pixel on the short side is 2*width, and the reference pixel on the long side is modified to 2*height, as shown in Figure 10 below, to meet the requirements of the reference pixel for the rectangular image block.
  • the image block can be encoded and decoded based on the mapped prediction angle.
  • the original index can be used to represent the mapped angle mode.
  • the prediction angle of the angle mode it may be determined in combination with the aspect ratio of the image block and the angle indicated by the index. For example, when the angle indicated by the index is between 36°-60°, the predicted angle corresponding to the angle mode is the angle after the angle indicated by the index is flipped by 180°, and in other cases, it is the angle indicated by the index.
  • All predicted angles in the upper right angle range 1 can be mapped to the angle range 2, and refer to Table 2 for the specific mapping relationship.
  • the original reference pixel on the top is shown in the gray plus white area. It can be seen that there will be a white area on the top after mapping.
  • the reference pixels will not be used; the original reference pixel on the left is shown in the gray area.
  • the white area on the rear left has no valid reference pixels. Therefore, the reference pixels need to be modified.
  • the reference pixel lengths of are 2W and 2H, respectively.
  • the main angle and the extended angle can be flipped together, or only the main angle can be flipped, and then the extended angle can be processed on the flipped main angle.
  • the extension of the former The angle is determined in advance, and the latter expansion angle can then be calculated on demand.
  • the image block can be encoded and decoded based on the mapped prediction angle.
  • the original index can be used to represent the mapped angle mode.
  • the aspect ratio of the image block may be determined first, and then based on Table 2, it is determined which original prediction angles are mapped. If the angle indicated by the index of the angle mode is the angle for which mapping occurs in Table 2, the predicted angle corresponding to the angle mode is the angle after the angle indicated by the index is flipped by 180°. For example, at this time, the aspect ratio of the image block is 1:2, and the angle indicated by the index is 36°, then the actual predicted angle of the angle mode is 216°.
  • the present application provides an encoding device.
  • the device 1200 includes a processor 1201, a memory 1202, and a computer program stored in the memory 1202 that can be executed by the processor 1201.
  • the processor 1201 executes the computer program, the following steps are implemented:
  • the code stream includes first indication information for indicating that the prediction mode of the image block adopts the angle mode in the intra prediction mode, and an index for indicating the angle mode
  • the index is determined;
  • the prediction angle corresponding to the angle mode is determined based on the size/shape of the image block and the index of the angle prediction mode, including:
  • a prediction angle corresponding to the angle mode is determined based on the aspect ratio of the image block and the index.
  • determining the prediction angle corresponding to the angle mode based on the aspect ratio of the image block and the index includes:
  • mapping strategy for the image block based on the aspect ratio of the image block, where the mapping strategy is used to indicate whether the predicted angle is obtained by mapping the angle indicated by the index;
  • a prediction angle corresponding to the angle mode is determined based on the index and the mapping policy of the image block.
  • the predicted angle is the angle indicated by the index
  • the angle indicated by the index pointing to the bottom left of the image block is mapped to the angle pointing to the top right of the image block, and the mapped angle is the angle mode the corresponding forecast angle;
  • the angle indicated by the index pointing to the upper right of the image block is mapped to the angle pointing to the lower left of the image block, and the mapped angle is the angle mode Corresponding forecast angle.
  • the angle indicated by the index after mapping is the angle The prediction angle corresponding to the mode.
  • the number of angles in the set of target angles is also different.
  • the aspect ratio of the image block is less than 1, the angle in the target angle concentration is the angle pointing to the upper right of the image block, and the mapped angle is the angle pointing to the lower left of the image block angle.
  • the aspect ratio of the image block is greater than 1, the angle in the target angle concentration is the angle pointing to the lower left of the image block, and the angle after the mapping is the angle pointing to the upper right of the image block .
  • the prediction angle corresponding to the angle mode is determined based on the shape/size of the image block and the index of the angle mode, including:
  • the prediction angle corresponding to the angle mode is the angle indicated by the index.
  • the prediction angle corresponding to the angle mode is determined based on the shape of the image block and the index of the angle mode, including:
  • the prediction angle is a mapping angle of the angle indicated by the index, and the The mapping angle points in the opposite direction to the angle indicated by the index.
  • the predicted angle is the angle indicated by the index .
  • angles whose angle values are less than or equal to the first angle threshold point to the upper right of the image block.
  • the first angle threshold is preset
  • the first angle threshold is determined based on the aspect ratio of the image block.
  • the prediction angle corresponding to the angle mode is determined based on the shape of the image block and the index of the angle mode, including:
  • the prediction angle is a mapping angle of the angle indicated by the index, and the The mapping angle points in the opposite direction to the angle indicated by the index.
  • the predicted angle is the angle indicated by the index.
  • angles with an angle value greater than or equal to the second angle threshold point to the lower left of the image block.
  • the second angle threshold is preset
  • the second angle threshold is determined based on the aspect ratio of the image block.
  • the number of reference pixels located above the image block is determined based on the width of the image block, and/or the reference pixels located on the left side of the image block The number of pixels is determined based on the height of the image block.
  • the number of reference pixels above the image block is twice the number of pixels in each row of the image block, and/or the number of reference pixels on the left side of the image block is twice the number of pixels in each column of the image block double the number of pixels.
  • the angle indicated by the index includes: a main angle, or an extended angle of the main angle.
  • the index when the angle indicated by the index is an extended angle, the index is represented by the index of the main angle of the extended angle, and the offset of the extended angle relative to the main angle .
  • the device 1300 includes a processor 1301, a memory 1302, and a computer program stored in the memory 1302 that can be executed by the processor 1301.
  • the processor 1301 executes the computer program, the following steps are implemented:
  • Determining the prediction mode of the image block based on the code stream adopts an angle mode in an intra prediction mode, an index of the angle mode, and a size/shape of the image block;
  • the processor when the processor is configured to determine the prediction angle corresponding to the angle mode based on the size/shape of the image block and the index, it is specifically configured to:
  • a prediction angle corresponding to the angle mode is determined based on the aspect ratio of the image block and the index.
  • the processor when the processor is configured to determine the prediction angle corresponding to the angle mode based on the aspect ratio of the image block and the index, it is specifically configured to:
  • mapping strategy for the image block based on the aspect ratio of the image block, where the mapping strategy is used to indicate whether the predicted angle is obtained by mapping the angle indicated by the index;
  • a prediction angle corresponding to the angle mode is determined based on the index and the mapping policy of the image block.
  • the predicted angle is the angle indicated by the index
  • the angle indicated by the index pointing to the bottom left of the image block is mapped to the angle pointing to the top right of the image block, and the mapped angle is used as the the predicted angle corresponding to the angle mode;
  • the angle indicated by the index pointing to the upper right of the image block is mapped to the angle pointing to the lower left of the image block, and the mapped angle is used as the The predicted angle corresponding to the angle mode.
  • the angle indicated by the index after mapping is the predicted angle corresponding to the angle mode .
  • the number of angles in the set of target angles is also different.
  • the aspect ratio of the image block is less than 1, the angle in the target angle concentration is the angle pointing to the upper right of the image block, and the mapped angle is the angle pointing to the lower left of the image block angle.
  • the aspect ratio of the image block is greater than 1, the angle in the target angle concentration is the angle pointing to the lower left of the image block, and the angle after the mapping is the angle pointing to the upper right of the image block .
  • the processor when the processor is configured to determine the prediction angle corresponding to the angle mode based on the shape/size of the image block and the index, it is specifically configured to:
  • the angle indicated by the index is used as the prediction angle corresponding to the angle mode.
  • the processor when the processor is configured to determine the prediction angle corresponding to the angle mode based on the shape of the image block and the index, it is specifically configured to:
  • the angle mapped to the angle indicated by the index is used as the prediction angle, so The direction pointed by the mapping angle is opposite to the direction indicated by the index.
  • the angle indicated by the index is used as the prediction angle.
  • angles whose angle values are less than or equal to the first angle threshold point to the upper right of the image block.
  • the first angle threshold is preset
  • the first angle threshold is determined based on the aspect ratio of the image block.
  • the processor when the processor is configured to determine the prediction angle corresponding to the angle mode based on the shape of the image block and the index, it is specifically configured to:
  • the angle mapped to the angle indicated by the index is used as the predicted angle, so The direction pointed by the mapping angle is opposite to the direction indicated by the index.
  • the angle indicated by the index is used as the prediction angle.
  • angles with an angle value greater than or equal to the second angle threshold point to the lower left of the image block.
  • the second angle threshold is preset
  • the second angle threshold is determined based on the aspect ratio of the image block.
  • the number of reference pixels located above the image block is determined based on the width of the image block, and/or, the number of reference pixels located on the left side of the image block The number of reference pixels is determined based on the height of the image block.
  • the number of reference pixels above the image block is twice the number of pixels in each row of the image block, and/or, the number of reference pixels on the left side of the image block is twice the number of pixels in each row of the image block. Twice the number of pixels in a column.
  • the angle indicated by the index includes: a main angle, or an extended angle of the main angle.
  • the index when the angle indicated by the index is an extended angle, the index is represented by the index of the main angle of the extended angle, and the offset of the extended angle relative to the main angle .
  • the embodiment of this specification also provides a computer storage medium, the storage medium stores a program, and when the program is executed by a processor, the encoding method and the decoding method in any of the foregoing embodiments are implemented.
  • Embodiments of the present description may take the form of a computer program product embodied on one or more storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) having program code embodied therein.
  • Computer usable storage media includes both volatile and non-permanent, removable and non-removable media, and may be implemented by any method or technology for information storage.
  • Information may be computer readable instructions, data structures, modules of a program, or other data.
  • Examples of storage media for computers include, but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic tape cartridge, tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read only memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • Flash memory or other memory technology
  • CD-ROM Compact Disc Read-Only Memory
  • DVD Digital Versatile Disc
  • Magnetic tape cartridge tape magnetic disk storage or other magnetic storage device or any other non-transmission medium that can be used to
  • the device embodiment since it basically corresponds to the method embodiment, for related parts, please refer to the part description of the method embodiment.
  • the device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

一种编解码方法及装置。在构造帧内预测中的角度模式时,对原有AV1标准中的角度模式进行了优化,可以基于图像块的形状将指向图像块短边上的一部分预测角度映射成指向图像块长边上的预测角度,由于将图像划分成矩形块,就一定程度上代表着图像块的纹理趋向于某一边,通过将图像块短边上预测角度映射到长边,可以充分利用长边的像素相关性,达到提高预测准确度的目的,进而提高编码效率。

Description

编解码方法及装置 技术领域
本申请涉及编解码技术领域,具体而言,涉及一种编码方法及装置、解码方法及装置。
背景技术
AV1是由开放媒体视频联盟(Alliance of Open Media Video)开发的视频编码标准。基于AV1标准对图像或视频进行编码时,主要是对输入的图像进行图像块划分、预测、变换、量化、熵编码、环路滤波等一系列处理,得到最终的码流,用于存储或网络传输。预测是编码过程中的一个重要的环节,准确的对图像块进行预测,是提升编码效率的关键。
由于在将图像划分成图像块时,图像块的形状可以不一样,比如,可以是方形、长条形或竖条形,对于不同形状的图像块,与该图像块相关性更高的相邻像素所在位置也会发生变化。而AV1标准现有的角度模式对应的预测角度是固定的角度,其角度模式的设计无法满足不同形状的图像块的需求,导致对参考像素的利用率不够充分,编码效率还有待提高。
发明内容
有鉴于此,本申请提供一种编码方法及装置、解码方法及装置。
根据本申请的第一方面,提供一种解码方法,所述方法包括:
获取待解码的图像块的码流;
基于所述码流确定所述图像块的预测模式采用帧内预测模式中的角度模式、所述角度模式的索引以及所述图像块的大小/形状;
基于所述图像块的大小/形状以及所述索引确定所述角度模式对应的预测角度;
基于所述预测角度对所述码流进行解码处理。
根据本申请的第二方面,提供一种编码方法,所述方法包括:
获得待编码的图像块的码流,所述码流中包括用于指示所述图像块的预测模式采用帧内预测模式中的角度模式的第一指示信息、用于指示所述角度模式的索引的第二指示信息,以及用于指示所述图像块的大小/形状的第三指示信息;其中,所述角度模式对应的预测角度基于所述图像块的大小/形状,以及所述角度预测模式的索引确定;
发送所述码流。
根据本申请的第三方面,提供一种解码装置,所述解码装置包括处理器、存储器、存储于所述存储器可供所述处理器执行的计算机程序,所述处理器器执行所述计算机程序时,实现以下步骤:
获取待解码的图像块的码流;
基于所述码流确定所述图像块的预测模式采用帧内预测模式中的角度模式、所述角度模式的索引以及所述图像块的大小/形状;
基于所述图像块的大小/形状以及所述索引确定所述角度模式对应的预测角度;
基于所述预测角度对所述码流进行解码处理。
根据本申请的第四方面,提供一种编码装置,所述处理器包括处理器、存储器、存储于所述存储器可供所述处理器执行的计算机程序,所述处理器执行所述计算机程序时,实现以下步骤:
获得待编码的图像块的码流,所述码流中包括用于指示所述图像块的预测模式采用帧内预测模式中的角度模式的第一指示信息、用于指示所述角度模式的索引的第二指示信息,以及用于指示所述图像块的大小/形状的第三指示信息;其中,所述角度模式对应的预测角度基于所述图像块的大小/形状,以及所述角度预测模式的索引确定;
发送所述码流。
根据本申请的第五方面,提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被执行时,实现上述第一方面或第二方面提及的方法。
应用本申请提供的方案,在构造帧内预测中的角度模式时,对原有AV1标准中的角度模式进行了优化,可以基于图像块的形状/大小对原AV1标准中的一部分预测角度进行映射,使得映射后的预测角度所指向的参考像素与图像块的相关性更强,比如,可以基于图像块的形状将指向图像块短边上的一部分预测角度映射成指向图像块长边上的预测角度,由于将图像划分成矩形块,就一定程度上代表着图像块的纹理趋向于某一边,通过将图像块短边上预测角度映射到长边,可以充分利用长边的像素相关性,达到提高预测准确度的目的,进而提高编码效率。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一个实施例AV1标准中56种角度模式的示意图。
图2是本申请一个实施例AV1标准中图像块的参考像素的示意图。
图3是本申请一个实施例的基于角度模式确定预测像素值的示意图
图4(a)和图4(b)是本申请一个实施例的一种图像块的划分方式的示意图。
图5是本申请一个实施例的一种预测角度在矩形图像块中的分布示意图。
图6是本申请一个实施例的一种编码方法的流程图。
图7是本申请一个实施例的一种解码方法的流程图。
图8是本申请一个实施例的一种预测角度在矩形图像块中的分布示意图。
图9是本申请一个实施例的对预测角度进行翻转的示意图。
图10是本申请一个实施例的矩形图像块的参考像素的示意图。
图11(a)和11(b)是本申请实施例中宽高比为1:2的矩形图像块以及宽高比为1:4的矩形图像块映射角度及参考像素的示意图。
图12是本申请一个实施例的编码装置的逻辑结构示意图。
图13是本申请一个实施例的解码装置的逻辑结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
AV1是由开放媒体视频联盟(Alliance of Open Media Video)开发的视频编码标准,采用AV1标准对图像或视频进行编码时,主要包括以下步骤:首先对待编码的图像进行块划分,得到多个图像块。针对当前待编码的图像块,可以利用已编码的图像块对该图像块进行帧内预测或者帧间预测,确定该图像块中各像素的预测像素值,并且确定该图像块中各像素的实际像素值和预测像素值的残差,对该残差进行编码,得到图像块的码流,用于存储或网络传输。由于无需存储和传输图像块的原始像素值,而是仅存储或传输残差,可以大大减小数据量。
其中,基于已编码的图像块对当前待编码的图像块进行预测,确定当前待编码的图像块的预测像素值,是编码过程中的一个重要环节,准确地对待编码的图像块进行预测,是提升编码效率的关键。在AV1编码标准中, 对待编码的图像块进行预测的模式主要有两种,帧内预测模式和帧间预模式。帧间预测模式是利用已编码的其他帧图像对待编码的图像块进行预测,而帧内预测模式是指利用视频空域相关性,利用待编码的图像块左侧和上方的已编码图像块的像素值生成待编码图像块的预测像素值。AV1标准中的帧内预测模式包含角度模式和非角度模式两大类。非角度模式和角度模式均可以进一步细分成多种模式。
AV1标准中的角度模式,支持预测角度从36°到212°共56种角度模式,可以更好的贴合图像的纹理方向进行预测。图1展示了AV1标准中的角度模式,其中,8个黑色箭头表示的预测方向被定义为主角度模式,每个主角度向两侧偏移3度、6度、9度得到6个扩展角度模式(如图1中的灰色箭头),共有48个扩展角度模式。其中,每一种角度模式对应的预测角度指示的方向为该角度模式的预测方向,每一种角度模式对应的预测角度如表1所示。
表1、AV1各角度模式对应的预测角度
Figure PCTCN2021119697-appb-000001
在选用某种角度模式进行帧内预测时,针对待编码图像块中的每个像素,在确定其预测像素值时,会基于该像素在该角度模式对应的预测角度所指向的方向上的参考像素确定该像素的预测像素值。在AV1编码标准中,帧内预测会使用图像块的相邻像素作为参考像素。以一个W×H的图像块为例,其帧内预测所需要的参考像素如图2所示,包括左侧W+H个像素,上方W+H个像素,左上1个像素,共需要2(W+H)+1个参考像素。如果 存在参考像素不可用时,会使用最后一个可用的参考像素值进行填充。
举个例子,如图3所示,假设图中3×3的图像块为当前待预测的图像块,在对该图像块进行帧内预测时,该图像块上方和左侧的像素为其参考像素,针对图像块中的像素a,如果是按照45°角度模式确定其预测像素值,像素a的45°方向上的参考像素为b,因而可以以像素b的像素值作为其预测像素值。当然,如果当某个角度模式的预测方向指向的像素超出参考像素的范围(比如,指向像素d或者像素d右边的像素),则以最后一个参考像素(比如,像素c)代替,作为其预测像素值。
如果是采用帧内预测的方式,帧内预测会通过竞争的方式从所有角度模式中选出一种最优角度模式(即编码代价最小的角度模式),并与其他帧内预测模式进行竞争得到最终的帧内预测模式,写入码流中。如果最终选中角度模式,则会将该角度模式的索引写入码流。AV1标准中,每种角度模式对应一个索引,用于唯一标识该角度模式,由于每种角度模式对应的预测角度不一样,确定了角度模式的索引,即可以知道该角度模式对应的预测角度。AV1标准中包括8个主角度,每个主角度又扩展了6个扩展角度,一共有56个角度模式,每个角度模式都有一个索引,用于标识该角度模式。比如,8个主角度模式的索引可以用0-7表示,而扩展角度模式的索引可以用主角度索引,以及扩展角度相对于主角度的偏移量表示。
由于在对图像进行划分,得到待编码的图像块时,存在多种划分方式,因而,最后得到的图像块的形状也不一样,比如,可能是方形、长条形(宽大高)、竖条形(高大于宽)。比如,如图4(a)所示,为AV1标准中对图像进行划分的示意图,首先可以将图像分为128×128的图像块,然后可以对划分得到的方形图像块进行进一步划分,选出编码代价最小的图像块划分方式。在对图像块进行进一步划分时,可以按照图4(b)给出的10种划分方式对图像块进行进一步划分。从图4(b)可知,划分后的图像可能是方形图像块,也可能是宽大于高的矩形图像块,或高大于宽的矩形图像块。
针对不同形状的图像块,与图像块相关性更强的相邻像素的分布也不一 样,比如,针对长条形的图像块,右上方的相邻像素与图像块的相关度大于左下方的相邻像素与图像块的相关度,对于竖条形的图像块,则相反。而目前AV1标准规定了从36度到212度的56种角度模式,针对不同形状的图像块,56种角度模式对应的预测角度都是固定的,无法适应不同形状的图像块的需求,比如,如图5所示,针对宽小于高的图像块,由于图像块与左下方的相邻像素关联性较强,而预测角度主要分布在图像块的右上方,将会导致右上方的预测角度(如图5中框选出的部分预测角度)预测效率较低,并且无法充分利用左下方相关性更强的相邻像素进行预测,严重影响编码效率。
基于此,本申请实施例提供了一种编解码方法,在构造帧内预测中的角度模式时,对原有AV1标准中的角度模式进行了优化,基于图像块的形状/大小对原AV1标准中的一部分预测角度进行映射,使得映射后的预测角度所指向的参考像素与图像块的相关性更强,比如,可以基于图像块的形状将指向图像块短边上的一部分预测角度映射成指向图像块长边上的预测角度,使得在对图像块进行预测时,可以更加充分的利用与图像块相关性更高的长边上的相邻像素,从而提高编码效率。
本申请实施例提供的编码方法可以用于各种编码装置,解码方法可以用于各种解码装置,该编解码方法可以适用于各种图像或视频的编解码。
以下结合编码端和解码端的处理流程对本申请实施例提供的编码方法和解码方法进行介绍。
其中,编码方法的具体流程如图6所示,具体包括以下步骤:
S602、获得待编码的图像块的码流,所述码流中包括用于指示所述图像块的预测模式采用帧内预测模式中的角度模式的第一指示信息、用于指示所述角度模式的索引的第二指示信息,以及用于指示所述图像块的大小/形状的第三指示信息;其中,所述角度模式对应的预测角度基于所述图像块的大小/形状,以及所述角度预测模式的索引确定;
S604、发送所述码流。
在对图像或视频帧进行编码时,可以将先对待编码的图像或视频帧进行 划分,得到多个图像块,其中,在对图像块进行划分时,可以参考AV1标准中对图像进行划分的方法,比如,首先可以将图像分为128×128的图像块,然后可以对划分得到的方形图像块进行进一步划分,如图4(a)所示,选出编码代价最小的图像块划分方式。在对图像块进行进一步划分时,可以按照图4(b)给出的10种划分方式对图像块进行进一步划分。从图4(b)可知,划分后的图像可能是方形图像块,也可能是矩形图像块。
在划分得到图像块后,可以针对每个图像块进行编码处理,在获取到当前待编码的图像块后,可以从多种帧内预测模式中筛选出编码代价最小的预测模式,用于对该图像块进行帧内预测。比如,可以先用每种角度模式预测该图像块的预测像素值,确定其编码代价,从角度模式中竞选出最优角度模式,然后再与其他非角度模式竞选,确定最终的预测模式。
鉴于现有AV1标准中的角度模式中的预测角度是固定的,无法满足不同形状/大小的图像块的需求,本申请实施例中在构造帧内预测的角度模式时,可以基于图像块的形状/大小对原AV1标准中的一部分预测角度进行映射,使得映射后的预测角度所指向的参考像素与图像块的相关性更强。并且,为了对原有的AV1标准的改动尽可能小,在对AV1标准中的角度模式的预测角度进行映射后,依然可以使用原有的角度模式的索引来表示映射后的角度模式,只是索引表示的预测角度发生变化,角度模式对应的预测角度可以结合图像块的形状/大小、以及索引指示的角度确定。在确定待编码的图像块的预测模式为帧内预测模式中的角度模式的情况下,则可以基于所选出的角度模式对图像块进行编码处理。比如,如图3所示,针对待编码图像块中的每个像素,都可以以该角度模式对应的预测角度所指向的参考像素的像素值确定该像素的预测像素值。如果该预测角度刚好指向一个参考像素,则以该参考像素的像素值作为该预测像素值,如果指向多个参考像素,则结合该多个参考像素的像素值确定该预测像素值。在确定图像块各像素的预测像素值后,可以确定图像块各像素的实际像素值和预测像素值的残差,然后对残差进行编码。
在将图像块编码后,即可以得到图像块的码流,其中,码流中可以包括 用于指示图像块的预测模式采用帧内预测模式中的角度模式的第一指示信息、用于指示该角度模式的索引的第二指示信息,以及用于指示图像块的大小/形状的第三指示信息。其中,用于指示图像块的大小/形状的第三指示信息可以是与图像块的划分方式相关的信息,比如,码流中可以包括初步划分后的图像块的大小,以及是否对初步划分的图像块进一步划分,以及进一步划分的方式等,解码端基于这些划分方式信息即可以推测出图像块的形状/大小。
在获得待编码图像块的码流后,可以将码流发送给解码端,以便解码端基于上述指示信息对图像块的码流进行解码处理。
相应的,解码在接收到图像块的码流后,其具体的处理流程如图7所示,包括以下步骤:
S702、获取待解码的图像块的码流;
S704、基于所述码流确定所述图像块的预测模式采用帧内预测模式中的角度模式、所述角度模式的索引以及所述图像块的大小/形状;
S706、基于所述图像块的大小/形状以及所述索引确定所述角度模式对应的预测角度;
S708、基于所述预测角度对所述码流进行解码处理。
解码端在获取到待解码图像块的码流后,可以从码流中确定图像块的帧内预测模式的类型,比如,帧内预测模型采用的是角度模式,以及从码流中确定角度模式的索引、图像块的大小/形状。然后可以基于图像块的形状/大小、角度模式的索引指示的角度确定该角度模式对应的预测角度,然后基于预测角度对图像块的码流进行解码处理。
由于图像块的宽高比不一致时,与图像块相关性较强的像素的分布也不同,比如,随着图像块的宽高比增大,图像块右上方的像素与图像块的相关性会变强,而左下方的像素与图像块的相关性会变弱。因而,在构造角度模式时,可以针对不同的宽高比设计不同的预测角度,即宽高比不同时,可以对原有AV1标准中不同的预测角度进行映射,使得映射后的角度与图像块的相关性更强。比如,当宽高比为1:1、1:2、1:4时,其要映射的预测角度均可 以不一样。所以,在一些实施例中,角度模式对应的预测角度可以基于图像块的宽高比以及索引指示的角度确定。
相应的,解码端在接收到码流后,也可以先确定图像块的宽高比,基于宽高比和索引指示的角度确定角度模式对应的预测角度。
在一些实施例,针对不同宽高比的图像块,在构造角度模式时,可以制定不同的映射策略,以采用不同的映射策略对原有AV1标准中的预测角度进行映射,比如,映射策略可以指示要映射的预测角度的角度值、要映射的预测角度的数量等信息,基于映射策略可以知道AV1标准中的哪些预测角度发生了映射。在确定角度模式对应的预测角度时,可以基于图像块的宽高比确定图像块的映射策略,然后基于索引和映射策略确定角度模式对应的预测角度。
相应的,解码端在接收到码流后,也可以先确定图像块的宽高比,基于宽高比确定对应的映射策略,根据索引和映射策略确定角度模式对应的预测角度。
在一些实施例中,在构造角度模式时,针对图像块的宽高比等于1的情况,即图像块为方形图像块,此时由于图像块与的左侧和上方的相邻像素的相关性一致,因而,可以无需对AV1标准中的预测角度进行映射,所以,角度模式的预测角度即为索引指示的角度。
相应的,解码端在接收到码流后,也可以先确定图像块的宽高比,如果宽高比为1,则直接将索引指示的角度作为该角度模式对应的预测角度,并利用预测角度对码流进行解码。
在一些实施例中,针对图像块的宽高比不等于1的情况,即图像块为矩形图像块,此时由于图像块与的左侧和上方的相邻像素的相关性不一致,因而,可以对AV1标准中的某些预测角度进行映射,使得映射后的预测角度指向的参考像素与图像块的相关性更强。
比如,在一些实施例中,可以预先设定不同宽高比时AV1标准的预测角度中需要进行映射的预测角度的集合,可以称之为目标角度集合,目标角度 集合可以包括一个或者多个预测角度,当图像块的宽高比不同,且索引指示的角度为目标角度集的角度时,说明此时角度模式对应的预测角度是对索引指示的角度进行映射后的角度。
在一些实施例中,当图像块的宽高比不同时,目标角度集合中的预测角度的数量也不同。比如,针对图像块的宽高比为1:2和1:4时,由于图像块与左侧的相邻像素的相关性更强,因而可以将AV1标准中位于图像块右上方的一部预测角度映射成左下方的预测角度,以充分利用左下方和图像块相关性更强的像素进行预测。当然,相比于宽高比为1:2的图像块,宽高比为1:4的图像块左下方位置与该图像块相关性更高的像素更多,为了可以充分利用左下方的像素进行预测,可以将更多位于右上方的预测角度映射至左下方。因而,图像块宽高比为1:4时,需映射的预测角度的数量多于宽高比为1:2时需映射的预测角度的数量。同理,相比于宽高比为2:1的图像块,在对原有的预测角度进行映射时,对于宽高比为4:1的图像块,也可以将更多位于左下方的预测角度映射至右上方。
在一些实施例中,在构造角度模式时,针对图像块的宽高比大于1的情况,即图像块与右上方的相邻像素的相关性强于图像块与左下方的相邻像素的相关性,因此,可以将AV1标准中指向图像块左下方的部分预测角度映射成指向图像块右上方的预测角度,以增加位于图像块右上方的预测角度的数量,充分利用右上方的相邻像素进行预测。因而,当索引指示的角度位于图像块左下方时,角度模式对应的预测角度为映射后的位于图像块右上方的预测角度。此种情况下,目标角度集合中的预测角度指向图像块的左下方,映射后的角度指向图像块的右上方。
在一些实施例中,在构造角度模式时,针对图像块的宽高比小于1的情况,即图像块与右上方的相邻像素的相关性弱于图像块与左下方的相邻像素的相关性,因此,可以将AV1标准中指向图像块右上方的部分预测角度映射成指向图像块左下方的预测角度,以增加位于图像块左下方的预测角度的数量,充分利用左下方的相邻像素进行预测。因而,当索引指示的角度位于图 像块右上方时,角度模式对应的预测角度为映射后的位于图像块左下方的预测角度。此种情况下,目标角度集合中的预测角度指向图像块的右上方,映射后的角度指向图像块的左下方。
其中,在对AV1标准中的预测角度进行映射,得到新的预测角度时,新的预测角度和原有的预测角度的映射关系可以基于实际情况设置,比如,在一些实施例中,可以直接将原有的预测角度翻转180°,作为新的预测角度,当然,也可以采取其他的映射方式,本申请实施例不作限制。
相应的,解码端在接收到码流后,也可以先确定图像块的宽高比,如果宽高比不等于1,则可以确定与宽高比对应的目标角度集合,确定索引指示的角度是否为目标角度集合中的角度,如果是,则将该索引指示的角度的映射后的角度作为角度模式的预测角度。当然,如果宽高比不等于1,且索引指示的角度不是目标角度集合中的角度,则直接将索引指示的角度作为预测角度,然后利用预测角度对码流进行解码。当然,在对索引指示的角度进行映射时,解码端可以基于预先设置的映射关系确定映射后的角度。比如,可以将索引指示的角度翻转180°,得到映射后的角度。
由于越靠近图像块的右上方的预测角度的角度值越小,越靠近左下方的预测角度的角度值越大,在一些实施例中,在构建角度模式时,针对图像块的宽高比小于1的情况下,可以将AV1标准中小于或等于第一角度阈值的预测角度进行映射,得到映射角度,因而,此时角度模式的预测角度不再是索引指示的角度,而是索引指示的角度的映射角度,其中,映射角度指向的方向和索引指示的角度的方向相反,即将原有的预测角度翻转180°后得到映射角度。在一些实施例中,对于原有AV1标准中大于第一角度阈值的预测角度,则不进行映射,因而,在索引指示的角度大于第一角度阈值的情况下,角度模式的预测角度即为索引指示的角度。
在一些实施例中,角度值小于或等于第一角度阈值的角度指向图像块的右上方。
在一些实施例中,在构造角度模式时,图像块的宽高比小于1且宽高比 不同时,AV1标准中需映射的预测角度可以是一样的,比如,即便宽高比不一样,需映射的预测角度的角度值以及预测角度的数量均一样。因而第一角度阈值可以是预先设定的统一的角度阈值,比如,针对所有图像块的宽高比小于1的情况,均将小于45°的预测角度进行映射,因而,第一角度阈值可以设置成45°。当然,在一些实施例中,图像块的宽高比小于1且宽高比不同时,AV1标准中需映射的预测角度也可以不一样,比如,宽高比不一样时,需映射的预测角度的角度值以及预测角度的数量可以不一样。因而,针对不同的宽高比,其对应的第一角度阈值也不一样。所以,需要结合图像块的宽高比确定第一角度阈值。
在一些实施例中,当图像块的宽高比小于1,且宽高比越小时,需要将越多的位于图像块的右上方的预测角度映射成位于图像块左下方的预测角度。因而,图像块的宽高比越小时,第一角度阈值越大。
相应的,解码端在接收到码流后,可以先确定图像块的宽高比,以及索引指示的角度,然后判定索引指示的角度是否小于或等于第一角度阈值,如果是,则将索引指示的角度翻转180°,得到映射角度,将该映射角度作为预测角度。如果索引指示的角度大于第一角度阈值,则将索引指示的角度作为预测角度,然后利用预测角度对码流进行解码。
由于越靠近图像块的右上方的预测角度的角度值越小,越靠近左下方的预测角度的角度值越大,在一些实施例中,在构建角度模式时,针对图像块的宽高比大于1的情况下,可以将AV1标准中大于或等于第二角度阈值的预测角度进行映射,得到映射角度,因而,此时角度模式的预测角度为索引指示的角度的映射角度,其中,映射角度指向的方向和索引指示的角度的方向相反,即将原有的预测角度翻转180°后得到映射角度。在一些实施例中,对于原有AV1标准中小于第二角度阈值的预测角度,则不进行映射,因而,在索引指示的角度小于第二角度阈值的情况下,角度模式的预测角度即为索引指示的角度。
在一些实施例中,角度值大于或等于第二角度阈值的角度指向图像块的 左下方。
在一些实施例中,在构造角度模式时,图像块的宽高比大于1且宽高比不同时,AV1标准中需映射的预测角度可以是一样的,比如,即便宽高比不一样,需映射的预测角度的角度值以及预测角度的数量均一样。因而第二角度阈值可以是预先设定的统一的角度阈值,比如,针对所有图像块的宽高比大于1的情况,均将大于203°的预测角度进行映射,因而,第二角度阈值可以设置成203°。当然,在一些实施例中,图像块的宽高比大于1且宽高比不同时,AV1标准中需映射的预测角度也可以不一样,比如,宽高比不一样时,需映射的预测角度的角度值以及预测角度的数量可以不一样。因而,针对不同的宽高比,其对应的第二角度阈值也不一样。所以,需要结合图像块的宽高比确定第二角度阈值。
在一些实施例中,当图像块宽高比大于1且宽高比越小时,需要将越少的位于图像块的左下方的预测角度映射成位于图像块右上方的预测角度。因而,图像块的宽高比越小时,第二角度阈值越大。
相应的,解码端在接收到码流后,可以先确定图像块的宽高比,以及索引指示的角度,然后判定索引指示的角度是否大于或等于第二角度阈值,如果是,则将索引指示的角度翻转180°,得到映射角度,将该映射角度作为预测角度。如果索引指示的角度小于第二角度阈值,则将索引指示的角度作为预测角度,然后利用预测角度对码流进行解码。
现有AV1标准中,针对一个W×H的图像块,其参考像素包括图像块左侧W+H个像素,上方W+H个像素以及左上1个像素,共2(W+H)+1个参考像素,如果存在参考像素不可用时,会使用最后一个可用的参考像素值进行填充。这种方式确定的参考像素比较适用于方形的图像块,对于矩形图像块,由于其长边的相邻像素的相关性会比短边的相邻像素的相关性高,而长短边的参考像素仍设置成一样,会出现短边的参考像素过剩,而长边的参考像素不够用的问题。
为了解决上述问题,在一些实施例中,在对图像块进行帧内预测时,图 像块左侧和上方的图像块的数量可以基于图像块的形状/大小确定,比如,位于图像块上方的参考像素的数量基于图像块的宽度确定,和/或位于图像块左侧的参考像素的数量可以基于图像块的高度确定。当图像块的宽度大于高度时,上方的参考像素多于左侧的参考像素,当图像块的宽度小于高度时,上方的参考像素少于左侧的参考像素。
在一些实施例,位于图像块上方的参考像素的数量为图像块每一行像素数量的两倍,和/或位于图像块左侧的参考像素的数量为图像块每一列像素数量的两倍。比如,针对一个W×H的图像块,其参考像素可以是上方的2W个像素,左侧的2H个像素,以及左上角的一个像素。
相应的,解码端在接收到码流后,可以先确定图像块的大小,然后基于图像块的大小确定位于上方和左侧的参考像素,利用参考像素和预测角度还原出图像块的预测像素值,基于预测像素值和码流中的残差确定图像块的实际像素值。
AV1标准中的角度模式包括8个主角度,每个主角度又有6个扩展角度,因而,每个角度模式都通过一个索引标识。在一些实施例中,索引指示的角度可以是主角度,也可以是主角度的扩展角度。
在一些实施例,在索引指示的角度为扩展角度的情况下,该索引可以通过扩展角度的主角度的索引,以及扩展角度相对于主角度的偏移量表示。比如,8个主角度模式的索引可以用0-7表示,而扩展角度模式的索引可以用主角度索引,以及扩展角度相对于主角度的偏移量表示。举个例子,36°为主角度45°的扩展角度,因而,其索引可以用45°的索引0,以及相对角度偏移量-9°表示。
相应的,解码端在接收到图像块的码流后,可以从码流中获取主角度的索引和相对角度偏移量,基于两者确定扩展角度的索引,并基于扩展角度的索引确定预测角度,以用于解码。
为了进一步解释本申请实施例提供的编解码方法,以下结合几个具体的实施例加以解释。
AV1标准中的56种角度模式对应角度值范围从36°到212°,而划分后当前编码块包括方形块的矩形块,为当前编码块使用角度模式时,不管是方形块,还是矩形块,都会应用36°到212°的所有角度。当矩形块出现时,例如图5中的矩形块,其短边的像素相关性相比于长边是比较弱的。而此时短边依然使用原有的部分角度,实际上预测效率比较低下,且放弃了部分长边的相关性,导致没有完全利用到临近像素的相关性。且在图像块为矩形块时,短边的参考像素长度依然为w+h,由于上述问题的存在,此时参考像素的利用率不合理且不高效。在矩形块时,右上45°方向的扩展角度,即36°-45°方向,会存在参考像素不足的情况,此时AV1会采用右上参考像素的最后一个进行填充,但实际上右上角本来可能会存在有效的参考像素,此时就会导致参考像素的偏差,最终导致预测偏差。
基于此,本申请实施例在对AV1标准进行了改进,在构造角度模式时,针对矩形块,减少短边的预测角度数量,增加到长边的角度数量上,同时对对应的参考像素长度进行修改,充分利用短边和长边的参考像素和当前块的相关性,减少原本右上36°到45°参考像素有效性不够所带来的预测偏差,同时不改变预测角度的总数量,提高参考像素利用率,增加编码性能,而在方形块时,保持原有的预测方法不变。
实施例1:
当前编码块是矩形块时,将短边的部分预测角度映射成长边上的预测角度,以宽高比为2/1的矩形块为例:
如下图8所示,无色方框为当前编码块,深色方框为参考像素从图8可知,对于矩形图像块,由于其与左侧的图像块相关性更强,因而,右上角的预测角度过剩,而左下角的预测角度不足。
因而,如图9所示,可以对右上角的一些预测角度进行映射,例如,可将36°到60°之间的所有角度(包括主角度和扩展角度)翻转180°,映射成左下角的预测角度,从图9中可以看出,右上角小于60°的角度被翻转到了左下角,即左下角红线以下的角度(例如,右上角45°翻转到左下角225°, 48°翻转到228°,42°翻转到222°)。
此时,除了对原有映射角度进行映射,可以看到左下角最后一个角度值,如果按照原来的参考像素的填充方法,此时是没有有效的参考像素的,且右上角有很多多余的参考像素。所以此时可以对参考像素的填充方法进行修改。具体为:短边的参考像素长度为2*宽度,长边的参考像素修改为2*高度,如下图10所示,以满足矩形图像块对参考像素的需求。
在确定角度模式中的预测角度后,即可以基于映射后的预测角度对图像块进行编解码,其中,为了对原有AV1标准改动较小,可以采用原来的索引表示映射后的角度模式。在确定角度模式的预测角度时,可以结合图像块的宽高比和索引指示的角度确定。比如,当索引指示的角度位于36°-60°,则角度模式对应的预测角度为索引指示的角度翻转180°后的角度,其余情况下,则为索引指示的角度。
实施例2:
当图像块的宽高比不同时,适用于该图像块的预测角度的分布也不同,因为,针对不同宽高比的图像块,可以采用不同的方式对AV1标准中的预测角度进行映射。比如,根据宽高比(W:H)不同时,需映射的预测角度和预测角度的数量不同,具体映射关系如表2所示,其中W:H=1时无需进行映射。
表2:不同宽高比时需映射的预测角度
Figure PCTCN2021119697-appb-000002
Figure PCTCN2021119697-appb-000003
如图11(a)所示,为W:H=1:2时,预测角度映射和参考像素的设置的示意图,如图11(b)所示,为W:H=1:4时,预测角度映射和参考像素的设置的示意图。映射时,可以将右上方角度区间1内的所有预测角度映射至角度区域2内,具体映射关系参考表2。上方原参考像素为灰色加白色区域所示,可以看到,映射后上方会有白色区域参考像素不会被使用;左侧原参考像素为灰色区域所示,可以看到,参考像素不够,映射后左侧白色区域没有有效的参考像素。因此需要对参考像素进行修改。W:H=1:2调整后的最大和最小角度为61和238,W:H=1:4调整后的最大和最小角度为76和263,由三角函数可推得上方和左侧所需的参考像素长度分别为2W和2H。
其中,在对预测角度进行翻转,得到映射角度时,既可以将主角度和扩展角度一起翻转,也可以只翻转主角度,而后再对翻转后的主角度做扩展角度处理,此时前者的扩展角度是提前确定好的,后者的扩展角度可以再按需进行计算。
在确定角度模式中的预测角度后,即可以基于映射后的预测角度对图像块进行编解码,其中,为了对原有AV1标准改动较小,可以采用原来的索引表示映射后的角度模式。在确定角度模式的预测角度时,可以先确定图像块的宽高比,然后基于表2确定对原有的哪些预测角度进行了映射。如果角度模式索引指示的角度为表2中发生了映射的角度,因而,该角度模式对应的预测角度为索引指示的角度翻转180°后的角度。比如,此时图像块的宽高比为1:2,索引指示的角度为36°,则角度模式实际的预测角度为216°。
相应的,本申请提供了一种编码装置,如图12所示,所述装置1200包括处理器1201、存储器1202、存储于所述存储器1202可供所述处理器1201执行的计算机程序,所述处理器1201执行所述计算机程序时实现以下步骤:
获得待编码的图像块的码流,所述码流中包括用于指示所述图像块的预 测模式采用帧内预测模式中的角度模式的第一指示信息、用于指示所述角度模式的索引的第二指示信息,以及用于指示所述图像块的大小/形状的第三指示信息;其中,所述角度模式对应的预测角度基于所述图像块的大小/形状,以及所述角度预测模式的索引确定;
发送所述码流。
在一些实施例中,所述角度模式对应的预测角度基于所述图像块的大小/形状,以及所述角度预测模式的索引确定,包括:
基于所述图像块的宽高比以及所述索引确定所述角度模式对应的预测角度。
在一些实施例中,基于所述图像块的宽高比以及所述索引确定所述角度模式对应的预测角度,包括:
基于所述图像块的宽高比确定所述图像块的映射策略,所述映射策略用于指示所述预测角度是否通过对所述索引指示的角度进行映射得到;
基于所述索引和所述图像块的映射策略确定所述角度模式对应的预测角度。
在一些实施例中,在所述宽高比等于1的情况下,所述预测角度为所述索引指示的角度;或
在所述图像块的宽高比大于1的情况下,所述索引指示的指向所述图像块左下方的角度映射为指向所述图像块右上方的角度,映射后的角度为所述角度模式对应的预测角度;或
在所述图像块的宽高比小于1的情况下,所述索引指示的指向所述图像块右上方的角度映射为指向所述图像块左下方的角度,映射后的角度为所述角度模式对应的预测角度。
在一些实施例中,在所述图像块宽高比不等于1且所述索引指示的角度为目标角度集合中的角度的情况下,所述索引指示的角度进行映射后的角度为所述角度模式对应的预测角度。
在一些实施例中,所述宽高比不同时,所述目标角度集合中的角度的数 量也不同。
在一些实施例中,所述图像块宽高比小于1,所述目标角度集中的角度为指向所述图像块右上方的角度,所述映射后的角度为指向所述图像块的左下方的角度。
在一些实施例中,所述图像块宽高比大于1,所述目标角度集中的角度为指向所述图像块左下方的角度,所述映射后的角度为指向所述图像块右上方的角度。
在一些实施例中,所述角度模式对应的预测角度基于所述图像块的形状/大小,以及所述角度模式的索引确定,包括:
在所述图像块高度等于宽度的情况下,所述角度模式对应的预测角度为所述索引指示的角度。
在一些实施例中,所述角度模式对应的预测角度基于所述图像块的形状,以及所述角度模式的索引确定,包括:
在所述图像块的宽度小于所述图像块的高度,且所述索引指示的角度小于或等于第一角度阈值的情况下,所述预测角度为所述索引指示的角度的映射角度,所述映射角度指向的方向和所述索引指示的角度的方向相反。
在一些实施例中,在所述图像块的宽度小于所述图像块的高度,且所述索引指示的角度大于所述第一角度阈值的情况下,所述预测角度为所述索引指示的角度。
在一些实施例中,角度值小于或等于所述第一角度阈值的角度指向所述图像块的右上方。
在一些实施例中,所述第一角度阈值预先设定;或
所述第一角度阈值基于所述图像块的宽高比确定。
在一些实施例中,所述图像块的宽高比越小,所述第一角度阈值越大。
在一些实施例中,所述角度模式对应的预测角度基于所述图像块的形状,以及所述角度模式的索引确定,包括:
在所述图像块的宽度大于所述图像块的高度,且所述索引指示的角度大 于或等于第二角度阈值的情况下,所述预测角度为所述索引指示的角度的映射角度,所述映射角度指向的方向和所述索引指示的角度的方向相反。
在一些实施例中,在所述图像块的宽度大于所述图像块的高度,且所述索引指示的角度小于第二角度阈值的情况下,所述预测角度为所述索引指示的角度。
在一些实施例中,角度值大于或等于所述第二角度阈值的角度指向所述图像块的左下方。
在一些实施例中,所述第二角度阈值预先设定;
或所述第二角度阈值基于所述图像块的宽高比确定。
在一些实施例中,所述图像块的宽高比越小,所述第二角度阈值越大。
在一些实施例中,在对所述图像块进行帧内预测时,位于所述图像块上方的参考像素的数量基于所述图像块的宽度确定,和/或位于所述图像块左侧的参考像素的数量基于所述图像块的高度确定。
在一些实施例中,所述图像块上方的参考像素的数量为所述图像块每一行像素数量的两倍,和/或所述图像块左侧的参考像素的数量为所述图像块每一列像素数量的两倍。
在一些实施例中,所述索引指示的角度包括:主角度,或主角度的扩展角度。
在一些实施例中,在所述索引指示的角度为扩展角度的情况下,所述索引通过所述扩展角度的主角度的索引,以及所述扩展角度相对于所述主角度的偏移量表示。
进一步的,本申请实施例提供一种解码装置,如图13所示,所述装置1300包括处理器1301、存储器1302、存储于所述存储器1302可供所述处理器1301执行的计算机程序,所述处理器1301执行所述计算机程序时实现以下步骤:
获取待解码的图像块的码流;
基于所述码流确定所述图像块的预测模式采用帧内预测模式中的角度模式、所述角度模式的索引以及所述图像块的大小/形状;
基于所述图像块的大小/形状以及所述索引确定所述角度模式对应的预测角度;
基于所述预测角度对所述码流进行解码处理。
在一些实施例中,所述处理器用于基于所述图像块的大小/形状以及所述索引确定所述角度模式对应的预测角度时,具体用于:
基于所述图像块的宽高比以及所述索引确定所述角度模式对应的预测角度。
在一些实施例中,所述处理器用于基于所述图像块的宽高比以及所述索引确定所述角度模式对应的预测角度时,具体用于:
基于所述图像块的宽高比确定所述图像块的映射策略,所述映射策略用于指示所述预测角度是否通过对所述索引指示的角度进行映射得到;
基于所述索引和所述图像块的映射策略确定所述角度模式对应的预测角度。
在一些实施例中,在所述宽高比等于1的情况下,所述预测角度为所述索引指示的角度;或
在所述图像块的宽高比大于1的情况下,所述索引指示的指向所述图像块左下方的角度映射为指向所述图像块右上方的角度,所述映射后的角度作为所述角度模式对应的预测角度;或
在所述图像块的宽高比小于1的情况下,所述索引指示的指向所述图像块右上方的角度映射为指向所述图像块左下方的角度,所述映射后的角度作为所述角度模式对应的预测角度。
在一些实施例中,若所述图像块宽高比不等于1且所述索引指示的角度位于目标角度集合内,所述索引指示的角度进行映射后的角度为所述角度模式对应的预测角度。
在一些实施例中,所述宽高比不同时,所述目标角度集合中的角度的数量也不同。
在一些实施例中,所述图像块宽高比小于1,所述目标角度集中的角度为 指向所述图像块右上方的角度,所述映射后的角度为指向所述图像块的左下方的角度。
在一些实施例中,所述图像块宽高比大于1,所述目标角度集中的角度为指向所述图像块左下方的角度,所述映射后的角度为指向所述图像块右上方的角度。
在一些实施例中,所述处理器用于基于所述图像块的形状/大小以及所述索引确定所述角度模式对应的预测角度时,具体用于:
在所述图像块高度等于宽度的情况下,将所述索引指示的角度作为所述角度模式对应的预测角度。
在一些实施例中,所述处理器用于基于所述图像块的形状以及所述索引确定所述角度模式对应的预测角度时,具体用于:
在所述图像块的宽度小于所述图像块的高度,且所述索引指示的角度小于或等于第一角度阈值的情况下,将所述索引指示的角度的映射角度作为所述预测角度,所述映射角度指向的方向和所述索引指示的角度的方向相反。
在一些实施例中,在所述图像块的宽度小于所述图像块的高度,且所述索引指示的角度大于所述第一角度阈值的情况下,将所述索引指示的角度作为所述预测角度。
在一些实施例中,角度值小于或等于所述第一角度阈值的角度指向所述图像块的右上方。
在一些实施例中,所述第一角度阈值预先设定;或
所述第一角度阈值基于所述图像块的宽高比确定。
在一些实施例中,所述图像块的宽高比越小,所述第一角度阈值越大。
在一些实施例,所述处理器用于基于所述图像块的形状以及所述索引确定所述角度模式对应的预测角度时,具体用于:
在所述图像块的宽度大于所述图像块的高度,且所述索引指示的角度大于或等于第二角度阈值的情况下,将所述索引指示的角度的映射角度作为所述预测角度,所述映射角度指向的方向和所述索引指示的角度的方向相反。
在一些实施例中,在所述图像块的宽度大于所述图像块的高度,且所述索引指示的角度小于第二角度阈值的情况下,将所述索引指示的角度作为所述预测角度。
在一些实施例中,角度值大于或等于所述第二角度阈值的角度指向所述图像块的左下方。
在一些实施例中,所述第二角度阈值预先设定;
或所述第二角度阈值基于所述图像块的宽高比确定。
在一些实施例中,所述图像块的宽高比越小,所述第二角度阈值越大。
在一些实施例中,在对所述图像块进行帧内预测时,位于所述图像块上方的参考像素的数量基于所述图像块的宽度确定,和/或,位于所述图像块左侧的参考像素的数量基于所述图像块的高度确定。
在一些实施例中,所述图像块上方的参考像素的数量为所述图像块每一行像素数量的两倍,和/或,所述图像块左侧的参考像素的数量为所述图像块每一列像素数量的两倍。
在一些实施例中,所述索引指示的角度包括:主角度,或,主角度的扩展角度。
在一些实施例中,在所述索引指示的角度为扩展角度的情况下,所述索引通过所述扩展角度的主角度的索引,以及所述扩展角度相对于所述主角度的偏移量表示。
相应地,本说明书实施例还提供一种计算机存储介质,所述存储介质中存储有程序,所述程序被处理器执行时实现上述任一实施例中的编码方法和解码方法。
本说明书实施例可采用在一个或多个其中包含有程序代码的存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机可用存储介质包括永久性和非永久性、可移动和非可移动媒体,可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括但 不限于:相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上对本发明实施例所提供的方法和装置进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。

Claims (93)

  1. 一种解码方法,其特征在于,所述方法包括:
    获取待解码的图像块的码流;
    基于所述码流确定所述图像块的预测模式采用帧内预测模式中的角度模式、所述角度模式的索引以及所述图像块的大小/形状;
    基于所述图像块的大小/形状以及所述索引确定所述角度模式对应的预测角度;
    基于所述预测角度对所述码流进行解码处理。
  2. 根据权利要求1所述的方法,其特征在于,基于所述图像块的大小/形状以及所述索引确定所述角度模式对应的预测角度,包括:
    基于所述图像块的宽高比以及所述索引确定所述角度模式对应的预测角度。
  3. 根据权利要求2所述的方法,其特征在于,基于所述图像块的宽高比以及所述索引确定所述角度模式对应的预测角度,包括:
    基于所述图像块的宽高比确定所述图像块的映射策略,所述映射策略用于指示所述预测角度是否通过对所述索引指示的角度进行映射得到;
    基于所述索引和所述图像块的映射策略确定所述角度模式对应的预测角度。
  4. 根据权利要求2或3所述的方法,其特征在于,
    在所述宽高比等于1的情况下,所述预测角度为所述索引指示的角度;或
    在所述图像块的宽高比大于1的情况下,所述索引指示的指向所述图像块左下方的角度映射为指向所述图像块右上方的角度,所述映射后的角度作为所述角度模式对应的预测角度;或
    在所述图像块的宽高比小于1的情况下,所述索引指示的指向所述图像块右上方的角度映射为指向所述图像块左下方的角度,所述映射后的角度作为所述角度模式对应的预测角度。
  5. 根据权利要求2或3所述的方法,其特征在于,
    若所述图像块宽高比不等于1且所述索引指示的角度位于目标角度集合内,所述索引指示的角度进行映射后的角度为所述角度模式对应的预测角度。
  6. 根据权利要求5所述的方法,其特征在于,所述宽高比不同时,所述目标角度集合中的角度的数量也不同。
  7. 根据权利要求5或6所述的方法,其特征在于,所述图像块宽高比小于1,所述目标角度集中的角度为指向所述图像块右上方的角度,所述映射后的角度为指向所述图像块的左下方的角度。
  8. 根据权利要求5或6所述的方法,其特征在于,所述图像块宽高比大于1,所述目标角度集中的角度为指向所述图像块左下方的角度,所述映射后的角度为指向所述图像块右上方的角度。
  9. 根据权利要求1所述的方法,其特征在于,基于所述图像块的形状/大小以及所述索引确定所述角度模式对应的预测角度,包括:
    在所述图像块高度等于宽度的情况下,将所述索引指示的角度作为所述角度模式对应的预测角度。
  10. 根据权利要求1或9所述的方法,其特征在于,基于所述图像块的形状以及所述索引确定所述角度模式对应的预测角度,包括:
    在所述图像块的宽度小于所述图像块的高度,且所述索引指示的角度小于或等于第一角度阈值的情况下,将所述索引指示的角度的映射角度作为所述预测角度,所述映射角度指向的方向和所述索引指示的角度的方向相反。
  11. 根据权利要求10所述的方法,其特征在于,在所述图像块的宽度小于所述图像块的高度,且所述索引指示的角度大于所述第一角度阈值的情况下,将所述索引指示的角度作为所述预测角度。
  12. 根据权利要求10或11所述的方法,其特征在于,角度值小于或等于所述第一角度阈值的角度指向所述图像块的右上方。
  13. 根据权利要求10-12任一项所述的方法,其特征在于,所述第一角度阈值预先设定;或
    所述第一角度阈值基于所述图像块的宽高比确定。
  14. 根据权利要求10-13任一项所述的方法,其特征在于,所述图像块的宽高比越小,所述第一角度阈值越大。
  15. 根据权利要求1或9所述的方法,其特征在于,基于所述图像块的形状以及所述索引确定所述角度模式对应的预测角度,包括:
    在所述图像块的宽度大于所述图像块的高度,且所述索引指示的角度大于或等于第二角度阈值的情况下,将所述索引指示的角度的映射角度作为所述预测角度,所述映射角度指向的方向和所述索引指示的角度的方向相反。
  16. 根据权利要求15所述的方法,其特征在于,在所述图像块的宽度大于所述图像块的高度,且所述索引指示的角度小于第二角度阈值的情况下,将所述索引指示的角度作为所述预测角度。
  17. 根据权利要求15或16所述的方法,其特征在于,角度值大于或等于所述第二角度阈值的角度指向所述图像块的左下方。
  18. 根据权利要求15-17任一项所述的方法,其特征在于,所述第二角度阈值预先设定;
    或所述第二角度阈值基于所述图像块的宽高比确定。
  19. 根据权利要求15-18任一项所述的方法,其特征在于,所述图像块的宽高比越小,所述第二角度阈值越大。
  20. 根据权利要求1-19任一项所述的方法,其特征在于,在对所述图像块进行帧内预测时,位于所述图像块上方的参考像素的数量基于所述图像块的宽度确定,和/或,位于所述图像块左侧的参考像素的数量基于所述图像块的高度确定。
  21. 根据权利要求20所述的方法,其特征在于,所述图像块上方的参考像素的数量为所述图像块每一行像素数量的两倍,和/或,所述图像块左侧的参考像素的数量为所述图像块每一列像素数量的两倍。
  22. 根据权利要求1-21任一项所述的方法,其特征在于,所述索引指示的角度包括:主角度,或,主角度的扩展角度。
  23. 根据权利要求22所述的方法,其特征在于,在所述索引指示的角度为扩展角度的情况下,所述索引通过所述扩展角度的主角度的索引,以及所述扩展角度相对于所述主角度的偏移量表示。
  24. 一种编码方法,其特征在于,所述方法包括:
    获得待编码的图像块的码流,所述码流中包括用于指示所述图像块的预测模式采用帧内预测模式中的角度模式的第一指示信息、用于指示所述角度模式的索引的第二指示信息,以及用于指示所述图像块的大小/形状的第三指示信息;其中,所述角度模式对应的预测角度基于所述图像块的大小/形状,以及所述角度预测模式的索引确定;
    发送所述码流。
  25. 根据权利要求24所述的方法,其特征在于,所述角度模式对应的预测角度基于所述图像块的大小/形状,以及所述角度预测模式的索引确定,包括:
    基于所述图像块的宽高比以及所述索引确定所述角度模式对应的预测角度。
  26. 根据权利要求25所述的方法,其特征在于,基于所述图像块的宽高比以及所述索引确定所述角度模式对应的预测角度,包括:
    基于所述图像块的宽高比确定所述图像块的映射策略,所述映射策略用于指示所述预测角度是否通过对所述索引指示的角度进行映射得到;
    基于所述索引和所述图像块的映射策略确定所述角度模式对应的预测角度。
  27. 根据权利要求25或26所述的方法,其特征在于,
    在所述宽高比等于1的情况下,所述预测角度为所述索引指示的角度;或
    在所述图像块的宽高比大于1的情况下,所述索引指示的指向所述图像块左下方的角度映射为指向所述图像块右上方的角度,映射后的角度为所述角度模式对应的预测角度;或
    在所述图像块的宽高比小于1的情况下,所述索引指示的指向所述图像块右上方的角度映射为指向所述图像块左下方的角度,映射后的角度为所述角度模式对应的预测角度。
  28. 根据权利要求25或26所述的方法,其特征在于,
    在所述图像块宽高比不等于1且所述索引指示的角度为目标角度集合中的角度的情况下,所述索引指示的角度进行映射后的角度为所述角度模式对应的预测角度。
  29. 根据权利要求28所述的方法,其特征在于,所述宽高比不同时,所述目标角度集合中的角度的数量也不同。
  30. 根据权利要求28或29所述的方法,其特征在于,所述图像块宽高比小于1,所述目标角度集中的角度为指向所述图像块右上方的角度,所述映射后的角度为指向所述图像块的左下方的角度。
  31. 根据权利要求28或29所述的方法,其特征在于,所述图像块宽高比大于1,所述目标角度集中的角度为指向所述图像块左下方的角度,所述映射后的角度为指向所述图像块右上方的角度。
  32. 根据权利要求24所述的方法,其特征在于,所述角度模式对应的预测角度基于所述图像块的形状/大小,以及所述角度模式的索引确定,包括:
    在所述图像块高度等于宽度的情况下,所述角度模式对应的预测角度为所述索引指示的角度。
  33. 根据权利要求24或32所述的方法,其特征在于,所述角度模式对应的预测角度基于所述图像块的形状,以及所述角度模式的索引确定,包括:
    在所述图像块的宽度小于所述图像块的高度,且所述索引指示的角度小于或等于第一角度阈值的情况下,所述预测角度为所述索引指示的角度的映射角度,所述映射角度指向的方向和所述索引指示的角度的方向相反。
  34. 根据权利要求33所述的方法,其特征在于,在所述图像块的宽度小于所述图像块的高度,且所述索引指示的角度大于所述第一角度阈值的情况下,所述预测角度为所述索引指示的角度。
  35. 根据权利要求33或34所述的方法,其特征在于,角度值小于或等于所述第一角度阈值的角度指向所述图像块的右上方。
  36. 根据权利要求33-35任一项所述的方法,其特征在于,所述第一角度阈值预先设定;或
    所述第一角度阈值基于所述图像块的宽高比确定。
  37. 根据权利要求36所示的方法,其特征在于,所述图像块的宽高比越小,所述第一角度阈值越大。
  38. 根据权利要求24或32所述的方法,其特征在于,所述角度模式对应的预测角度基于所述图像块的形状,以及所述角度模式的索引确定,包括:
    在所述图像块的宽度大于所述图像块的高度,且所述索引指示的角度大于或等于第二角度阈值的情况下,所述预测角度为所述索引指示的角度的映射角度,所述映射角度指向的方向和所述索引指示的角度的方向相反。
  39. 根据权利要求38所述的方法,其特征在于,在所述图像块的宽度大于所述图像块的高度,且所述索引指示的角度小于第二角度阈值的情况下,所述预测角度为所述索引指示的角度。
  40. 根据权利要求38或39所述的方法,其特征在于,角度值大于或等于所述第二角度阈值的角度指向所述图像块的左下方。
  41. 根据权利要求38-40任一项所述的方法,其特征在于,所述第二角度阈值预先设定;
    或所述第二角度阈值基于所述图像块的宽高比确定。
  42. 根据权利要求38-41任一项所述的方法,其特征在于,所述图像块的宽高比越小,所述第二角度阈值越大。
  43. 根据权利要求24-42任一项所述的方法,其特征在于,在对所述图像块进行帧内预测时,位于所述图像块上方的参考像素的数量基于所述图像块的宽度确定,和/或位于所述图像块左侧的参考像素的数量基于所述图像块的高度确定。
  44. 根据权利要求43所述的方法,其特征在于,所述图像块上方的参考 像素的数量为所述图像块每一行像素数量的两倍,和/或所述图像块左侧的参考像素的数量为所述图像块每一列像素数量的两倍。
  45. 根据权利要求24-44任一项所述的方法,其特征在于,所述索引指示的角度包括:主角度,或主角度的扩展角度。
  46. 根据权利要求45所述的方法,其特征在于,在所述索引指示的角度为扩展角度的情况下,所述索引通过所述扩展角度的主角度的索引,以及所述扩展角度相对于所述主角度的偏移量表示。
  47. 一种解码装置,其特征在于,所述装置包括处理器、存储器、存储于所述存储器可供所述处理器执行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
    获取待解码的图像块的码流;
    基于所述码流确定所述图像块的预测模式采用帧内预测模式中的角度模式、所述角度模式的索引以及所述图像块的大小/形状;
    基于所述图像块的大小/形状以及所述索引确定所述角度模式对应的预测角度;
    基于所述预测角度对所述码流进行解码处理。
  48. 根据权利要求47所述的装置,其特征在于,所述处理器用于基于所述图像块的大小/形状以及所述索引确定所述角度模式对应的预测角度时,具体用于:
    基于所述图像块的宽高比以及所述索引确定所述角度模式对应的预测角度。
  49. 根据权利要求48所述的装置,其特征在于,所述处理器用于基于所述图像块的宽高比以及所述索引确定所述角度模式对应的预测角度时,具体用于:
    基于所述图像块的宽高比确定所述图像块的映射策略,所述映射策略用于指示所述预测角度是否通过对所述索引指示的角度进行映射得到;
    基于所述索引和所述图像块的映射策略确定所述角度模式对应的预测角 度。
  50. 根据权利要求48或49所述的装置,其特征在于,
    在所述宽高比等于1的情况下,所述预测角度为所述索引指示的角度;或
    在所述图像块的宽高比大于1的情况下,所述索引指示的指向所述图像块左下方的角度映射为指向所述图像块右上方的角度,所述映射后的角度作为所述角度模式对应的预测角度;或
    在所述图像块的宽高比小于1的情况下,所述索引指示的指向所述图像块右上方的角度映射为指向所述图像块左下方的角度,所述映射后的角度作为所述角度模式对应的预测角度。
  51. 根据权利要求48或49所述的装置,其特征在于,
    若所述图像块宽高比不等于1且所述索引指示的角度位于目标角度集合内,所述索引指示的角度进行映射后的角度为所述角度模式对应的预测角度。
  52. 根据权利要求51所述的装置,其特征在于,所述宽高比不同时,所述目标角度集合中的角度的数量也不同。
  53. 根据权利要求51或52所述的装置,其特征在于,所述图像块宽高比小于1,所述目标角度集中的角度为指向所述图像块右上方的角度,所述映射后的角度为指向所述图像块的左下方的角度。
  54. 根据权利要求51或52所述的装置,其特征在于,所述图像块宽高比大于1,所述目标角度集中的角度为指向所述图像块左下方的角度,所述映射后的角度为指向所述图像块右上方的角度。
  55. 根据权利要求47所述的装置,其特征在于,所述处理器用于基于所述图像块的形状/大小以及所述索引确定所述角度模式对应的预测角度时,具体用于:
    在所述图像块高度等于宽度的情况下,将所述索引指示的角度作为所述角度模式对应的预测角度。
  56. 根据权利要求47或55所述的装置,其特征在于,所述处理器用于 基于所述图像块的形状以及所述索引确定所述角度模式对应的预测角度时,具体用于:
    在所述图像块的宽度小于所述图像块的高度,且所述索引指示的角度小于或等于第一角度阈值的情况下,将所述索引指示的角度的映射角度作为所述预测角度,所述映射角度指向的方向和所述索引指示的角度的方向相反。
  57. 根据权利要求56所述的装置,其特征在于,在所述图像块的宽度小于所述图像块的高度,且所述索引指示的角度大于所述第一角度阈值的情况下,将所述索引指示的角度作为所述预测角度。
  58. 根据权利要求56或57所述的装置,其特征在于,角度值小于或等于所述第一角度阈值的角度指向所述图像块的右上方。
  59. 根据权利要求56-58任一项所述的装置,其特征在于,所述第一角度阈值预先设定;或
    所述第一角度阈值基于所述图像块的宽高比确定。
  60. 根据权利要求56-59任一项所述的装置,其特征在于,所述图像块的宽高比越小,所述第一角度阈值越大。
  61. 根据权利要求47或55所述的装置,其特征在于,所述处理器用于基于所述图像块的形状以及所述索引确定所述角度模式对应的预测角度时,具体用于:
    在所述图像块的宽度大于所述图像块的高度,且所述索引指示的角度大于或等于第二角度阈值的情况下,将所述索引指示的角度的映射角度作为所述预测角度,所述映射角度指向的方向和所述索引指示的角度的方向相反。
  62. 根据权利要求61所述的装置,其特征在于,在所述图像块的宽度大于所述图像块的高度,且所述索引指示的角度小于第二角度阈值的情况下,将所述索引指示的角度作为所述预测角度。
  63. 根据权利要求61或62所述的装置,其特征在于,角度值大于或等于所述第二角度阈值的角度指向所述图像块的左下方。
  64. 根据权利要求61-63任一项所述的装置,其特征在于,所述第二角度 阈值预先设定;
    或所述第二角度阈值基于所述图像块的宽高比确定。
  65. 根据权利要求61-64任一项所述的装置,其特征在于,所述图像块的宽高比越小,所述第二角度阈值越大。
  66. 根据权利要求47-65任一项所述的装置,其特征在于,在对所述图像块进行帧内预测时,位于所述图像块上方的参考像素的数量基于所述图像块的宽度确定,和/或,位于所述图像块左侧的参考像素的数量基于所述图像块的高度确定。
  67. 根据权利要求66所述的装置,其特征在于,所述图像块上方的参考像素的数量为所述图像块每一行像素数量的两倍,和/或,所述图像块左侧的参考像素的数量为所述图像块每一列像素数量的两倍。
  68. 根据权利要求47-67任一项所述的装置,其特征在于,所述索引指示的角度包括:主角度,或,主角度的扩展角度。
  69. 根据权利要求68所述的装置,其特征在于,在所述索引指示的角度为扩展角度的情况下,所述索引通过所述扩展角度的主角度的索引,以及所述扩展角度相对于所述主角度的偏移量表示。
  70. 一种编码装置,其特征在于,所述装置包括处理器、存储器、存储于所述存储器可供所述处理器执行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
    获得待编码的图像块的码流,所述码流中包括用于指示所述图像块的预测模式采用帧内预测模式中的角度模式的第一指示信息、用于指示所述角度模式的索引的第二指示信息,以及用于指示所述图像块的大小/形状的第三指示信息;其中,所述角度模式对应的预测角度基于所述图像块的大小/形状,以及所述角度预测模式的索引确定;
    发送所述码流。
  71. 根据权利要求70所述的装置,其特征在于,所述角度模式对应的预测角度基于所述图像块的大小/形状,以及所述角度预测模式的索引确定,包 括:
    基于所述图像块的宽高比以及所述索引确定所述角度模式对应的预测角度。
  72. 根据权利要求71所述的装置,其特征在于,基于所述图像块的宽高比以及所述索引确定所述角度模式对应的预测角度,包括:
    基于所述图像块的宽高比确定所述图像块的映射策略,所述映射策略用于指示所述预测角度是否通过对所述索引指示的角度进行映射得到;
    基于所述索引和所述图像块的映射策略确定所述角度模式对应的预测角度。
  73. 根据权利要求71或72所述的装置,其特征在于,
    在所述宽高比等于1的情况下,所述预测角度为所述索引指示的角度;或
    在所述图像块的宽高比大于1的情况下,所述索引指示的指向所述图像块左下方的角度映射为指向所述图像块右上方的角度,映射后的角度为所述角度模式对应的预测角度;或
    在所述图像块的宽高比小于1的情况下,所述索引指示的指向所述图像块右上方的角度映射为指向所述图像块左下方的角度,映射后的角度为所述角度模式对应的预测角度。
  74. 根据权利要求71或72所述的装置,其特征在于,
    在所述图像块宽高比不等于1且所述索引指示的角度为目标角度集合中的角度的情况下,所述索引指示的角度进行映射后的角度为所述角度模式对应的预测角度。
  75. 根据权利要求74所述的装置,其特征在于,所述宽高比不同时,所述目标角度集合中的角度的数量也不同。
  76. 根据权利要求74或75所述的装置,其特征在于,所述图像块宽高比小于1,所述目标角度集中的角度为指向所述图像块右上方的角度,所述映射后的角度为指向所述图像块的左下方的角度。
  77. 根据权利要求74或75所述的装置,其特征在于,所述图像块宽高比大于1,所述目标角度集中的角度为指向所述图像块左下方的角度,所述映射后的角度为指向所述图像块右上方的角度。
  78. 根据权利要求70所述的装置,其特征在于,所述角度模式对应的预测角度基于所述图像块的形状/大小,以及所述角度模式的索引确定,包括:
    在所述图像块高度等于宽度的情况下,所述角度模式对应的预测角度为所述索引指示的角度。
  79. 根据权利要求70或78所述的装置,其特征在于,所述角度模式对应的预测角度基于所述图像块的形状,以及所述角度模式的索引确定,包括:
    在所述图像块的宽度小于所述图像块的高度,且所述索引指示的角度小于或等于第一角度阈值的情况下,所述预测角度为所述索引指示的角度的映射角度,所述映射角度指向的方向和所述索引指示的角度的方向相反。
  80. 根据权利要求79所述的装置,其特征在于,在所述图像块的宽度小于所述图像块的高度,且所述索引指示的角度大于所述第一角度阈值的情况下,所述预测角度为所述索引指示的角度。
  81. 根据权利要求79或80所述的装置,其特征在于,角度值小于或等于所述第一角度阈值的角度指向所述图像块的右上方。
  82. 根据权利要求79-81任一项所述的装置,其特征在于,所述第一角度阈值预先设定;或
    所述第一角度阈值基于所述图像块的宽高比确定。
  83. 根据权利要求79-82任一项所述的装置,其特征在于,所述图像块的宽高比越小,所述第一角度阈值越大。
  84. 根据权利要求70或78所述的装置,其特征在于,所述角度模式对应的预测角度基于所述图像块的形状,以及所述角度模式的索引确定,包括:
    在所述图像块的宽度大于所述图像块的高度,且所述索引指示的角度大于或等于第二角度阈值的情况下,所述预测角度为所述索引指示的角度的映射角度,所述映射角度指向的方向和所述索引指示的角度的方向相反。
  85. 根据权利要求84所述的装置,其特征在于,在所述图像块的宽度大于所述图像块的高度,且所述索引指示的角度小于第二角度阈值的情况下,所述预测角度为所述索引指示的角度。
  86. 根据权利要求84或85所述的装置,其特征在于,角度值大于或等于所述第二角度阈值的角度指向所述图像块的左下方。
  87. 根据权利要求84-86任一项所述的装置,其特征在于,所述第二角度阈值预先设定;
    或所述第二角度阈值基于所述图像块的宽高比确定。
  88. 根据权利要求84-87任一项所述的装置,其特征在于,所述图像块的宽高比越小,所述第二角度阈值越大。
  89. 根据权利要求70-88任一项所述的装置,其特征在于,在对所述图像块进行帧内预测时,位于所述图像块上方的参考像素的数量基于所述图像块的宽度确定,和/或位于所述图像块左侧的参考像素的数量基于所述图像块的高度确定。
  90. 根据权利要求89所述的装置,其特征在于,所述图像块上方的参考像素的数量为所述图像块每一行像素数量的两倍,和/或所述图像块左侧的参考像素的数量为所述图像块每一列像素数量的两倍。
  91. 根据权利要求70-90任一项所述的装置,其特征在于,所述索引指示的角度包括:主角度,或主角度的扩展角度。
  92. 根据权利要求91所述的装置,其特征在于,在所述索引指示的角度为扩展角度的情况下,所述索引通过所述扩展角度的主角度的索引,以及所述扩展角度相对于所述主角度的偏移量表示。
  93. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被执行时,实现如权利要求1-23或24-46任一项所述的方法。
PCT/CN2021/119697 2021-09-22 2021-09-22 编解码方法及装置 WO2023044618A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202180101496.XA CN117795953A (zh) 2021-09-22 2021-09-22 编解码方法及装置
PCT/CN2021/119697 WO2023044618A1 (zh) 2021-09-22 2021-09-22 编解码方法及装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/119697 WO2023044618A1 (zh) 2021-09-22 2021-09-22 编解码方法及装置

Publications (1)

Publication Number Publication Date
WO2023044618A1 true WO2023044618A1 (zh) 2023-03-30

Family

ID=85719759

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/119697 WO2023044618A1 (zh) 2021-09-22 2021-09-22 编解码方法及装置

Country Status (2)

Country Link
CN (1) CN117795953A (zh)
WO (1) WO2023044618A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150365692A1 (en) * 2013-04-09 2015-12-17 Mediatek Singapore Pte. Ltd. Method and Apparatus for Non-Square Intra Mode Coding
CN110971911A (zh) * 2018-09-30 2020-04-07 北京三星通信技术研究有限公司 视频编解码中的帧内预测的方法和装置
CN111373750A (zh) * 2017-10-24 2020-07-03 韦勒斯标准与技术协会公司 视频信号处理方法和装置
WO2020140219A1 (zh) * 2019-01-02 2020-07-09 Oppo广东移动通信有限公司 帧内预测方法、装置及计算机存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150365692A1 (en) * 2013-04-09 2015-12-17 Mediatek Singapore Pte. Ltd. Method and Apparatus for Non-Square Intra Mode Coding
CN111373750A (zh) * 2017-10-24 2020-07-03 韦勒斯标准与技术协会公司 视频信号处理方法和装置
CN110971911A (zh) * 2018-09-30 2020-04-07 北京三星通信技术研究有限公司 视频编解码中的帧内预测的方法和装置
WO2020140219A1 (zh) * 2019-01-02 2020-07-09 Oppo广东移动通信有限公司 帧内预测方法、装置及计算机存储介质
CN113228641A (zh) * 2019-01-02 2021-08-06 Oppo广东移动通信有限公司 帧内预测方法、装置及计算机存储介质

Also Published As

Publication number Publication date
CN117795953A (zh) 2024-03-29

Similar Documents

Publication Publication Date Title
US11979559B2 (en) Image prediction method and device
US20200244986A1 (en) Picture prediction method and related apparatus
US10841583B2 (en) Coding unit depth determining method and apparatus
CN110290388B (zh) 帧内预测方法、视频编码方法、计算机设备及存储装置
US20160373767A1 (en) Encoding and Decoding Methods and Apparatuses
TW201332370A (zh) 圖像編碼方法、圖像解碼方法、圖像編碼裝置、圖像解碼裝置及其程式
US8081680B2 (en) Selective inter-layer prediction in layered video coding
WO2021196235A1 (zh) 帧间预测方法、编码器、解码器及存储介质
WO2016180129A1 (zh) 预测模式选择方法、装置及设备
WO2009097809A1 (zh) 基于自适应块变换的帧内预测方法及装置
US20130301730A1 (en) Spatial domain prediction encoding method, decoding method, apparatus, and system
CN111586410B (zh) 视频编码方法、解码方法及其相关装置
CN112203096A (zh) 视频编码方法、装置、计算机设备和存储介质
US10659800B2 (en) Inter prediction method and device
WO2019052254A1 (zh) 编码树节点划分方式的确定方法、装置及编码设备
CN115118977B (zh) 针对360度视频的帧内预测编码方法、系统及介质
JP2023123784A (ja) クロマイントラ予測方法および装置、並びにコンピュータ記憶媒体
CN102377992B (zh) 运动矢量的预测值的获取方法和装置
TWI249291B (en) Method of video compression that accommodates scene changes
WO2023044618A1 (zh) 编解码方法及装置
WO2021258841A1 (zh) 帧间预测方法、编码器、解码器以及计算机存储介质
CA3222255A1 (en) Decoding prediction method and apparatus, and computer storage medium
CN109451306B (zh) 色度分量的最佳预测模式的选择方法、装置及电子设备
CN115361582B (zh) 一种视频实时超分辨率处理方法、装置、终端及存储介质
WO2023044617A1 (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: 21957760

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180101496.X

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE