WO2020182169A1 - 解码方法及装置 - Google Patents

解码方法及装置 Download PDF

Info

Publication number
WO2020182169A1
WO2020182169A1 PCT/CN2020/078875 CN2020078875W WO2020182169A1 WO 2020182169 A1 WO2020182169 A1 WO 2020182169A1 CN 2020078875 W CN2020078875 W CN 2020078875W WO 2020182169 A1 WO2020182169 A1 WO 2020182169A1
Authority
WO
WIPO (PCT)
Prior art keywords
image block
current image
mode
cclm
pixel value
Prior art date
Application number
PCT/CN2020/078875
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 杭州海康威视数字技术股份有限公司
Publication of WO2020182169A1 publication Critical patent/WO2020182169A1/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/136Incoming video signal characteristics or properties
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/186Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques

Definitions

  • This application relates to video coding and decoding technology, and in particular to a decoding method and device.
  • the intra-frame prediction technology in video coding reduces the redundancy of the information to be coded and improves the compression efficiency of image data by using the correlation between pixels within a frame of image.
  • the luminance and chrominance share the prediction partition mode (part_mode) for independent prediction, that is, the luminance component uses the surrounding reconstructed luminance value to predict the luminance value of the current block to be coded, and the chrominance
  • the prediction of the value is only based on the reconstructed chrominance values around it for intra prediction.
  • YUV a color coding method
  • RGB a color mode
  • the cross-component prediction technology uses the coded color component information to predict the color component to be coded, which further removes the correlation between the color components and improves the coding compression quality.
  • the current cross-component prediction technology does not limit the starting conditions of the cross-component prediction technology, which may lead to the use of the cross-component prediction technology in scenes that are not suitable for the use of the cross-component prediction technology, and thus lead to poor coding performance.
  • the present application provides a decoding method and device.
  • a decoding method which includes: determining whether the current image block allows the cross-component linear model prediction (CCLM) mode to be enabled according to the size of the current image block; If CCLM mode is disabled, the target prediction mode used by the current image block is determined, wherein the target prediction mode is a non-CCLM mode; the pixel of the current image block is determined according to the target prediction mode and decoded information value.
  • CCLM cross-component linear model prediction
  • the determining whether the current image block allows the CCLM mode to be enabled according to the size of the current image block includes:
  • the size of the current image block satisfies a preset CCLM mode disable condition, including:
  • the area of the current image block is less than or equal to a first area threshold, or greater than or equal to a second area threshold; wherein, the first area threshold is all 2 to the nth power, n is a positive integer, The area threshold is greater than the first area threshold,
  • the first area threshold value is 2 to the third power.
  • the size of the current image block satisfies the preset CCLM mode disablement condition, including:
  • the size of the current image block is 2x2, 2x4 or 4x2.
  • the first area threshold value is 2 to the second power.
  • the size of the current image block satisfies a preset CCLM mode disable condition, including:
  • the size of the current image block is 2x2.
  • the second area threshold is 2 to the power of 10.
  • the size of the current image block satisfies a preset CCLM mode disable condition, including:
  • the size of the current image block is greater than or equal to 32x32.
  • the current image block is chrominance Piece.
  • the non-CCLM mode includes angle prediction Mode, DM mode, Planar mode or DC mode.
  • a decoding device including a processor and a machine-readable storage medium
  • the machine-readable storage medium stores machine-readable instructions that can be executed by the processor, and The processor is prompted by the machine-readable instructions to determine whether the current image block allows the CCLM mode to be enabled according to the size of the current image block; if the current image block prohibits the CCLM mode from being enabled, determine the current image block used
  • the target prediction mode wherein the target prediction mode is a non-CCLM mode; and the pixel value of the current image block is determined according to the target prediction mode and decoded information.
  • the decoding method of the embodiment of the present application determines whether the current image block allows the CCLM mode to be enabled according to the size of the current image block; if the current image block prohibits the CCLM mode from being enabled, then determines the target prediction mode used by the current image block , Wherein the target prediction mode is a non-CCLM mode; the pixel value of the current image block is determined according to the target prediction mode and decoded information, which avoids the use of CCLM mode in scenes where CCLM mode is not applicable, and improves coding performance.
  • Fig. 1 is a schematic diagram of a reference pixel value acquisition position in a CCLM_T mode
  • Fig. 2 is a schematic diagram of a reference pixel value acquisition position in a CCLM_L mode
  • Fig. 3 is a schematic flowchart of a decoding method shown in an exemplary embodiment of the present application
  • Fig. 4A is a schematic diagram showing a reference pixel value acquisition position of a CCLM_L mode according to an exemplary embodiment of the present application
  • Fig. 4B is a schematic diagram showing a reference pixel value acquisition position of a CCLM_T mode according to an exemplary embodiment of the present application
  • Fig. 4C is a schematic diagram showing a reference pixel value acquisition position of a CCLM_T_L mode according to an exemplary embodiment of the present application
  • Fig. 4D is a schematic diagram of obtaining linear transformation parameters according to an exemplary embodiment of the present application.
  • Fig. 5 is a schematic diagram of the hardware structure of a decoding device shown in an exemplary embodiment of the present application.
  • Fig. 6 is a schematic structural diagram of a decoding device shown in an exemplary embodiment of the present application.
  • FIG. 3 is a schematic flowchart of a decoding method provided by an embodiment of this application, where the decoding method may be applied to a decoding end device.
  • the decoding method may include the following steps:
  • Step S300 based on the decoded information, determine whether the current image block allows the CCLM mode to be enabled. If yes, go to step S310; otherwise, end the current process.
  • Cross-Component Linear Model Prediction is a cross-component prediction technology, based on the area of the reference luminance block, it can include three CCLM reference modes: using the reconstructed value above the current chrominance block and the corresponding luminance area
  • the schematic diagram of the CCLM_T mode of the current chrominance block can be shown in Figure 1; the reconstruction value on the left side of the current chrominance block and the CCLM_L mode corresponding to the luminance area are used, and the schematic diagram can be shown in Figure 2; The reconstruction value of and the CCLM_T_L mode of the corresponding brightness area.
  • the starting conditions of the CCLM mode may be limited to ensure that the scenes using the CCLM mode are all scenes suitable for using the CCLM.
  • the decoding end device when the decoding end device decodes the received code stream, it can determine whether the current image block allows the CCLM mode to be started based on the decoded information.
  • the prediction mode of the current image block is intra mode
  • At least one other component of the current image block has decoded the required pixel information, and the current component exists and has not been decoded;
  • the prediction mode of the current image block is not the corresponding brightness component mode (Direct Mode, DM for short);
  • the decoding information of at least one side of the image block on the left side and the upper side of the current component of the current image block is available;
  • the size of the current image block is within the preset size range.
  • the current component refers to the component being decoded in the current image block, which may include, but is not limited to, a luminance component or a chrominance component.
  • the current image can be Whether the block is in intra mode, whether there is at least one other component that has decoded the required pixel information, and whether the decoding information of at least one of the left and upper sides of the current component of the current image block is available as the current image block Reference conditions for whether to enable CCLM mode.
  • the decoder device determines that the current image block is allowed to be enabled
  • the CCLM mode needs to ensure that the prediction mode of the current image block is not the DM mode.
  • the size range of the image blocks that allow the CCLM mode to be enabled can also be limited (referred to herein as the preset size range, which can be set according to the actual scene).
  • the decoder device may determine that the prediction mode of the current image block is intra mode, at least one other component of the current image block has decoded the required pixel information, and the current component exists and is not decoded, and the prediction of the current image block
  • the mode is not DM mode
  • the decoding information of at least one of the image blocks on the left and upper side of the current component of the current image block is available, and the size of the current image block is within the preset size range, it is determined that the current image block is allowed to be enabled CCLM mode.
  • At least one other component may be a luminance component; if the current component is a luminance component, at least one other component may be a chrominance component; Is a Cb component, then at least one other component may be a Cr component.
  • the encoding end device may also determine the current image block based on the corresponding reference conditions. Whether the CCLM mode is allowed to be enabled when the component is encoded, its specific implementation is not repeated here.
  • the size of the foregoing current image block is within a preset size range, which may include:
  • the area of the current image block is greater than or equal to the first area threshold and less than or equal to the second area threshold;
  • the first area threshold and the second area threshold are both the n-th power of 2, n is a positive integer, and the second area threshold is greater than the first area threshold.
  • the size of the current image block can be characterized based on the area of the current image block, that is, it is necessary to ensure that the area of the current image block is within the preset area range. To allow the current image block to enable CCLM mode.
  • the preset area range may be greater than or equal to the first area threshold (may be called Smin) and less than or equal to the second area threshold (Smax), that is, it is necessary to ensure that the area of the current image block is in the range of [Smin, Smax] Within; Smin ⁇ Smax; Smin and Smax are the nth power of 2, and n is a positive integer.
  • Smin first area threshold
  • Smax second area threshold
  • the size of the foregoing current image block is within a preset size range, which may include:
  • the width of the current image block is greater than or equal to the first width threshold and less than or equal to the second width threshold;
  • the height of the current image block is greater than or equal to the first height threshold and less than or equal to the second height threshold;
  • the first width threshold, the second width threshold, the first height threshold, and the second height threshold are the n-th power of 2, where n is a positive integer, the first width threshold is less than the second width threshold, and the first height threshold is less than the second Height threshold.
  • the size of the current image block can be characterized based on the width and height of the current image block, that is, it is necessary to ensure that the width and height of the current image block are at the preset width respectively. Within the range and the preset height range, the current image block is allowed to enable CCLM mode.
  • the preset width range may be greater than or equal to the first width threshold (may be called Wmin), and less than or equal to the second width threshold (Wmax), that is, it is necessary to ensure that the width of the current image block is in the range of [Wmin, Wmax] Within; Wmin ⁇ Wmax; Wmin and Wmax are the nth power of 2, and n is a positive integer.
  • Wmin first width threshold
  • Wmax second width threshold
  • the preset height range may be greater than or equal to the first height threshold (may be called Hmin) and less than or equal to the second height threshold (Hmax), that is, it is necessary to ensure that the height of the current image block is in the range of [Hmin, Hmax] Within; Hmin ⁇ Hmax; Hmin and Hmax are the nth power of 2, and n is a positive integer.
  • Hmin first height threshold
  • Hmax second height threshold
  • the above-mentioned characterizing the size of the image block by the area of the image block or characterizing the size of the image block by the width and height of the image block is only the representation of the image block in the embodiment of the present application.
  • the specific example of the size is not a limitation of the protection scope of this application.
  • the size of the image block may also be characterized by the area, width, and height of the image block, and its specific implementation is not described here.
  • the decoding end device may continue to decode the current component of the current image block in the manner of steps S310 to S340.
  • the decoding end device determines that the current image block does not allow the CCLM mode to be enabled, the decoding end device can continue to decode the current image block according to other strategies.
  • the specific implementation can refer to the related implementation of the related solution, which is not done here in the embodiment of the application. Repeat.
  • Step S310 Determine the target prediction mode used by the current image block.
  • the decoder device when the decoder device determines that the current image block allows the CCLM mode to be enabled, the decoder device can analyze the specific prediction mode used by the current image block (referred to herein as the target prediction mode) to determine the current image block used Whether the target prediction mode is the CCLM reference mode (CCLM_L, CCLM_T, or CCLM_T_L).
  • the target prediction mode is the CCLM reference mode (CCLM_L, CCLM_T, or CCLM_T_L).
  • the foregoing determination of the target prediction mode used by the current image block may include:
  • the target prediction mode used by the current image block is determined in the candidate prediction mode list.
  • the decoder device can determine the candidate prediction mode list of the current image block, that is, the prediction mode supported by the current image block; on the other hand, the decoder device can The index value of the prediction mode used by the current image block is parsed from the code stream, and then, based on the parsed index value, the target prediction mode used by the current image block is determined in the candidate prediction mode list.
  • the foregoing determination of the candidate prediction mode list of the current image block may include:
  • a default list as a candidate prediction mode list can be pre-configured on the encoding end device and the decoding end device.
  • the default list can be negotiated and determined by the encoding end device and the decoding end device, or manually configured by the user on the encoding end device. And decoding end equipment.
  • the above-mentioned default list is the first list or the second list including part of the prediction modes in the first list.
  • the first list is ⁇ CCLM_T_L mode, non-CCLM mode, CCLM_L mode, CCLM_T mode ⁇ .
  • the non-CCLM mode may include, but is not limited to, angular prediction mode, DM mode, Planar mode, or DC mode.
  • the order of the modes in the first list may be the order of the modes listed in the list, or other orders.
  • This article takes the order listed in the list as an example.
  • the second list may be ⁇ non-CCLM mode, CCLM_L mode, CCLM_T mode ⁇ , ⁇ CCLM_T_L mode, non-CCLM mode, CCLM_T mode ⁇ or ⁇ CCLM_T_L mode, CCLM_T mode ⁇ , etc.
  • the foregoing determination of the candidate prediction mode list of the current image block may include:
  • a list of candidate prediction modes for the current image block is determined.
  • the decoding end device may determine the candidate prediction mode list of the current image block based on the location information of the current image block.
  • the position information of the current image block may include: whether the decoding information of the left or upper image block of the current image block is available and the position of the current image block in the largest coding unit (LCU).
  • LCU largest coding unit
  • the decoder device can determine whether the decoding information of the left or upper image block of the current image block is available, and The position of the current image block in the LCU.
  • the CCLM_T_L mode and CCLM_L mode are excluded from the candidate prediction mode list; if the upper information of the current image block is not available, the CCLM_T_L mode and CCLM_T mode are removed from the candidate prediction mode list Exclude: If the current image block is at the upper boundary of the LCU, that is, the current image block is connected to the upper LCU, the CCLM_T_L mode and the CCLM_T mode are excluded.
  • the unavailability of the left or upper image block of the current image block includes, but is not limited to, the left or upper image block of the current image block does not exist, or exists but is not decoded.
  • the decoding end device when the decoding end device determines the candidate prediction mode list of the current image block, it may analyze the index value of the prediction mode used by the current image block.
  • the decoding end device can parse Max-1 bits to determine the index value of the prediction mode used by the current image block.
  • the decoding end device can parse up to 3 bits, or stop parsing immediately when the parsing reaches 1. At this time, if it is resolved to "1", the index value is determined to be 0; if it is resolved to "01”, the index value is determined to be 1; if it is resolved to "001", the index value is determined to be 2; if it is resolved to "000” ", the index value is determined to be 3.
  • the decoding end device when the decoding end device parses the index value of the prediction mode used by the current image block, it may determine the target prediction mode used by the current image block in the determined candidate prediction mode list based on the index value.
  • the decoding end device determines that the target prediction mode used by the current image block is the CCLM reference mode (CCLM_L, CCLM_T, or CCLM_T_L), the decoding end device can continue to follow the steps S320 to S340 Perform the decoding of the current component of the current image block.
  • the target prediction mode used by the current image block is the CCLM reference mode (CCLM_L, CCLM_T, or CCLM_T_L)
  • the decoding end device can continue to follow the steps S320 to S340 Perform the decoding of the current component of the current image block.
  • the decoding-end device determines that the target prediction mode used by the current image block is a non-CCLM reference mode, the decoding-end device can continue to decode the current image block according to other strategies, and its specific implementation can refer to related implementations of related solutions. This application implements The examples are not repeated here.
  • Step S320 If the target prediction mode is the CCLM reference mode, obtain the reference pixel value according to the target prediction mode.
  • the decoder device when the decoder device determines that the target prediction mode used by the current image block is the CCLM reference mode (CCLM_L, CCLM_T, or CCLM_T_L), the decoder device can determine the current component and the current image block according to the target prediction mode. The other component of the decoding obtains the reference pixel value.
  • the foregoing obtaining the reference pixel value according to the target prediction mode may include:
  • the size of the current component of the current image block is the same as that of another component that has been decoded, the same position and the same number of pixel values are obtained;
  • sampling is performed according to the aspect ratio to obtain the same number of pixel values.
  • the width of the current image block is width and the height is height.
  • the height of the current component is 1/H of the other component that has been decoded.
  • the decoder device can take the left L reference pixel values from the current component, and the reference decoded other component takes the L reference pixels at the corresponding position after H times upsampling. value.
  • L is 2*height.
  • the decoder device can take the upper T reference pixel values from the current component, and the reference decoded other component takes the corresponding position and the corresponding position after W times upsampling. value.
  • T is 2*width.
  • the decoding device can take the L reference pixel values on the left side and T reference pixel values on the upper side for the current component, and the decoded reference component takes the left side after H times upsampling.
  • the L reference pixel values of the corresponding position and the upper side take the T reference pixel values of the corresponding position after W times upsampling.
  • L is height and T is width.
  • Step S330 Determine linear transformation parameters according to the obtained reference pixel value.
  • the decoding end device when the decoding end device obtains the reference pixel value, it may determine the linear transformation parameter according to the obtained reference pixel value.
  • determining the linear transformation parameter according to the obtained reference pixel value may include:
  • the decoding device may first determine the maximum value (referred to as maxL in this article) and minimum value (referred to in this article as minL) of the reference pixel value of another component that has been decoded, and the current The maximum value (referred to herein as maxC) and the minimum value (referred to herein as minC) of the reference pixel value of the component.
  • the decoder device After the decoder device determines maxL, minL, maxC, and minC, it can determine the linear transformation parameters based on maxL, minL, maxC, and minC.
  • the foregoing determination of linear transformation parameters according to maxL, minL, maxC, and minC includes:
  • ⁇ and ⁇ are linear transformation parameters
  • Si is the average value of maxC, minC or maxC and minC.
  • the foregoing determination of linear transformation parameters according to maxL, minL, maxC, and minC includes:
  • the linear transformation parameters ⁇ and ⁇ can be determined according to the following formula:
  • the maximum and minimum values of the reference pixel value of the decoded luminance component are determined, and according to the reference pixel value of the decoded luminance component
  • the maximum and minimum values of, and the reference pixel value of the corresponding chrominance component determine the linear transformation parameters.
  • Li is the maximum value of the reference pixel value of the decoded luminance component
  • Lj is the minimum value of the reference pixel value of the decoded luminance component
  • Ci and Cj are the reference chrominance components corresponding to Li and Lj, respectively Pixel values.
  • linear transformation parameters ⁇ and ⁇ are determined according to the above formula, more multiplication and division operations are required, and the current hardware is less friendly to multiplication and division operations (especially division operations). Therefore, according to The above formula determines the hardware friendliness of linear transformation parameters will be relatively poor.
  • data can be multiplied and divided by shifting, so as to improve the hardware friendliness of the determination of linear transformation parameters.
  • the decoder device can determine the linear transformation parameters ⁇ and ⁇ according to the following formula:
  • diffL ⁇ 4 is 110000 (decimal is 48);
  • diffL>>1 is 111 (decimal is 7)
  • diffL>>2 is 11 (decimal is 3).
  • the multiplication and division operations are implemented by shifting left and shifting right, which improves the hardware friendliness.
  • Step S340 Determine the pixel value of the current component of the current image block according to the determined linear transformation parameter and the pixel value of another component of the current image block that has been decoded.
  • the decoder device when the decoder device determines the linear transformation parameter, it can determine the pixel value of the current component of the current image block according to the determined linear transformation parameter and the pixel value of another component of the current image block that has been decoded.
  • the foregoing determination of the pixel value of the current component of the current image block according to the determined linear transformation parameter and the pixel value of another component of the current image block that has been decoded can be implemented by the following formula :
  • Xi is the ith pixel value in another component that has been decoded
  • Yi is the ith pixel value in the current component
  • z is a natural number.
  • the pixel value of another component of the current image block that has been decoded may be referred to as the first reference pixel value
  • the pixel value of the current component of the current image block may be referred to as the target pixel value.
  • the reference pixel value on the left or upper side of the current component of the image block may be called the second reference pixel value
  • the reference pixel value on the left or upper side of the decoded other component of the current image block may be called the third reference pixel value.
  • the aforementioned first reference pixel value, second reference pixel value, and third reference pixel value may be reconstruction values; the target pixel value may be a predicted value.
  • the first reference pixel value, the second reference pixel value, and the third reference pixel value may be residual values; the target pixel value is a predicted value.
  • the pixel value of a certain component of an image block usually has a pixel value range (such as 0 to 255). Therefore, after the decoder device determines the pixel value of the current component in the above manner , It is also necessary to determine whether the pixel value of the current component is within the preset pixel value range.
  • the above determining the pixel value of the current component of the current image block it may further include:
  • the first preset pixel value threshold is used as the pixel value of the current component of the current image block
  • the second preset pixel value threshold is used as the pixel value of the current component of the current image block
  • the first preset pixel value threshold is greater than the second preset pixel value threshold.
  • the decoder device determines the pixel value of the pixel in the above manner, if the pixel value is greater than the first preset pixel value threshold (which can be set according to requirements, such as 2 to the power of D-1, D represents the number of bits of the current pixel value. For example, when D is 8, the first preset pixel value threshold is 255), then the decoder device can determine the pixel value of the pixel as the first The preset pixel value threshold.
  • the first preset pixel value threshold which can be set according to requirements, such as 2 to the power of D-1, D represents the number of bits of the current pixel value. For example, when D is 8, the first preset pixel value threshold is 255
  • the decoder device can determine the pixel value of the pixel as the first The preset pixel value threshold.
  • the decoder device can determine the pixel value of the pixel as the second preset pixel Threshold.
  • the decoder device determines that the pixel value of the current component is 300, the decoder device can use 255 as the current component Pixel value; when the decoder device determines that the pixel value of the current component is -2, the decoder device can use 0 as the pixel value of the current component.
  • the decoder device may use 255 as the current component
  • the decoder device determines that the pixel value of the current component is 1, the decoder device can use 2 as the pixel value of the current component.
  • CCLM_L CCLM_T, or CCLM_T_L
  • the encoding end device determines the rate-distortion cost of the CCLM reference mode or uses the CCLM reference mode for the current image block
  • the pixel value of the current component of the image block can be determined in the manner described in the above step S320 to step S340, and the specific implementation is not repeated here.
  • the current component of the current image block needs to be decoded, it can be implemented according to the following steps:
  • the decoding device can obtain the decoded information and determine whether the current image block meets the following conditions:
  • the prediction mode of the current image block is intra mode
  • At least one other component of the current image block has decoded the required pixel information, and the current component exists and has not been decoded;
  • the prediction mode of the current image block is not DM mode
  • the decoding information of at least one of the image blocks on the left side and the upper side of the current component of the current image block is available;
  • the size of the current image block is within the preset size range.
  • step 1.5 the following implementation manners may be included:
  • the size of the current image block is within the preset size range, which may include:
  • the area of the current image block is within the range of [Smin, Smax], Smin and Smax are the nth power of 2, and n is a positive integer.
  • the size of the current image block is within the preset size range, which may include:
  • the width of the current image block is within the range of [Wmin, Wmax];
  • the height of the current image block is within the range of [Hmin, Hmax];
  • Wmin, Wmax, Hmin, and Hmax are 2 to the nth power, and n is a positive integer.
  • the size of the current image block is within the preset size range, which may include:
  • the width of the current image block is within the range of [Wmin, Wmax];
  • the height of the current image block is within the range of [Hmin, Hmax];
  • the area of the current image block is within the range of [Smin, Smax];
  • Wmin, Wmax, Hmin, Hmax, Smin, and Smax are 2 to the nth power, and n is a positive integer.
  • the decoding end device determines that the current image block allows the CCLM mode to be enabled as an example.
  • the list of candidate prediction modes is the default list
  • the default list may be (in order) ⁇ CCLM_T_L mode, non-CCLM mode, CCLM_L mode, CCLM_T mode ⁇ .
  • the default list may be part of the modes in ⁇ CCLM_T_L mode, non-CCLM mode, CCLM_L mode, CCLM_T mode ⁇ .
  • the default list may be (in order) ⁇ CCLM_T_L mode, non-CCLM mode, CCLM_T mode ⁇ .
  • the default list may be (in order) ⁇ non-CCLM mode, CCLM_T mode ⁇ .
  • the position information of the current image block may include: whether the decoding information of the left or upper image block of the current image block is available and the position of the current image block in the LCU.
  • the decoder device can determine whether the decoding information of the left or upper image block of the current image block is available, and The position of the current image block in the LCU.
  • the CCLM_T_L mode and CCLM_L mode are excluded from the candidate prediction mode list; if the upper information of the current image block is not available, the CCLM_T_L mode and CCLM_T mode are removed from the candidate prediction mode list Exclude: If the current image block is at the upper boundary of the LCU, that is, the current image block is connected to the upper LCU, the CCLM_T_L mode and the CCLM_T mode are excluded.
  • the decoder device can parse up to 3 bits, or parse to 1. Then stop parsing immediately. At this time, if it is resolved to "1", the index value is determined to be 0; if it is resolved to "01”, the index value is determined to be 1; if it is resolved to "001", the index value is determined to be 2; if it is resolved to "000” ", the index value is determined to be 3.
  • the decoding end device can parse up to 2 bits, or immediately if it parses to 1 Stop parsing. At this time, if it is resolved to "1", the index value is determined to be 0; if it is resolved to "01”, the index value is determined to be 1; if it is resolved to "00", the index value is determined to be 2.
  • the candidate prediction mode list is (in order) ⁇ CCLM_T_L mode, non-CCLM mode, CCLM_L mode, CCLM_T mode ⁇ , if the resolved index value is 0, the target prediction mode is CCLM_T_L mode; If the index value is 2, the target prediction mode is CCLM_L mode.
  • the candidate prediction mode list is (in order) ⁇ CCLM_T_L mode, non-CCLM mode, CCLM_T mode ⁇ , if the parsed index value is 0, then the target prediction mode is CCLM_T_L mode; if the parsed index value Is 2, the target prediction mode is CCLM_T mode.
  • the target prediction mode is the CCLM reference mode as an example.
  • the decoding end device when the decoding end device determines the target prediction mode used by the current image block, it can obtain the reference pixel value from the current component of the current image block and another decoded component based on the target prediction mode.
  • the width of the current component is W and the height is H
  • the width of the current component is 1/2 of another component that has been decoded
  • the height of the current component is 1/2 of another component that has been decoded.
  • the target prediction mode is CCLM_L mode.
  • the decoding end device can take 2H reference pixel values from the left side of the current component, and take 2H reference pixel values from the corresponding position on the left side of another component that has been decoded after being upsampled twice. It can be as shown in Figure 4A.
  • the reference pixel value on the left side of the current component may be the pixel value of the first, second...2H chrominance block on the left side of the current image block;
  • the reference pixel value of the corresponding position on the left side of the other component (taking the luminance component as an example) after 2 times of upsampling is the first, third, fifth...2nd of the left side of the other component* Pixel values of 2H-1 luminance blocks.
  • the target prediction mode is CCLM_T mode.
  • the decoding device can take 2W reference pixel values from the upper side of the current component, and take 2W reference pixel values from the corresponding position of the upper side of the decoded another component after 2 times upsampling.
  • the schematic diagram It can be as shown in Figure 4B.
  • the reference pixel value on the upper side of the current component may be the pixel value of the first, second...2Wth chrominance block on the upper side of the current image block;
  • the reference pixel value of the corresponding position on the upper side of one component (take the luminance component as an example) after 2 times upsampling is the first, third, fifth... 2nd*2W of the other component’s upper side -1
  • the target prediction mode is CCLM_T_L mode.
  • the decoding end device can take H reference pixel values from the left side of the current component and W reference pixel values from the upper side of the current component; the decoded left side of another component is up-sampled by 2 times.
  • the corresponding position takes H reference pixel values, and the corresponding position after 2 times upsampling from the upper side of the decoded another component takes W reference pixel values.
  • the schematic diagram may be as shown in FIG. 4C.
  • the reference pixel value on the left side of the current component is the pixel value of the first, second...Hth chrominance block on the left side of the current image block.
  • the reference pixel value of can be the pixel value of the first, second...Wth chrominance block on the upper side of the current image block; the left side of the other component (taking the luminance component as an example) is upsampled twice
  • the reference pixel value of the corresponding position is the pixel value of the 1st, 3rd, 5th...2*H-1 luminance block on the left side of the other component, and the corresponding upper side after 2 times upsampling
  • the reference pixel value of the position is the pixel value of the first, third, fifth...2*W-1 luminance block above the other component.
  • the decoder device may first determine maxL, minL, maxC, and minC, and determine the linear transformation parameters according to maxL, minL, maxC, and minC.
  • determining the linear transformation parameters according to maxL, minL, maxC, and minC may include:
  • ⁇ and ⁇ are linear transformation parameters.
  • Floor means rounding down
  • Log2 means taking the logarithm of 2
  • a ⁇ x means a left shift by x bits
  • & means bitwise AND
  • abs means Absolute value
  • DivSigTable is a table
  • DivSigTable[] ⁇ 0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0 ⁇
  • Sign(x) means Take the sign bit of x.
  • the multiplication and division operations are implemented by shifting left and shifting right, which improves the hardware friendliness.
  • the pixel value of the current component of the current image block can be determined according to the determined linear transformation parameter and the pixel value of another component of the current image block that has been decoded.
  • the decoder device may determine the pixel value of the current component of the current image block by using the following formula:
  • Xi is the value of the i-th pixel in another component that has been decoded
  • Yi is the value of the i-th pixel in the current component
  • the decoder device may determine the pixel value of the current component of the current image block by using the following formula:
  • Xi is the i-th pixel value in another component that has been decoded
  • Yi is the i-th pixel value in the current component.
  • the target prediction mode used by the current image block is determined.
  • the target prediction mode is the CCLM reference mode
  • the reference pixel value is obtained according to the target prediction mode.
  • the linear transformation parameter is determined.
  • the pixel value of the current component of the current image block is determined according to the linear transformation parameter and the pixel value of another component of the current image block that has been decoded.
  • FIG. 5 is a schematic diagram of the hardware structure of a decoding apparatus provided by an embodiment of this application.
  • the decoding apparatus may include a processor 501 and a machine-readable storage medium 502 storing machine-executable instructions.
  • the processor 501 and the machine-readable storage medium 502 may communicate via a system bus 503. Furthermore, by reading and executing the machine executable instructions corresponding to the decoding control logic in the machine-readable storage medium 502, the processor 501 can execute the decoding method described above.
  • the machine-readable storage medium 502 mentioned herein may be any electronic, magnetic, optical, or other physical storage device, and may contain or store information, such as executable instructions, data, and so on.
  • the machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard drive), solid state hard drive, any type of storage disk (Such as CD, DVD, etc.), or similar storage media, or a combination of them.
  • the above-mentioned decoding control logic may include a first determination unit 610, a second determination unit 620, an acquisition unit 630, a third determination unit 640, and a fourth determination unit 650 in terms of functions.
  • the first determining unit 610 is configured to determine whether the current image block allows the CCLM mode to be enabled based on the decoded information
  • the second determining unit 620 is configured to determine the target prediction mode used by the current image block if the CCLM mode is allowed to be enabled for the current image block;
  • the obtaining unit 630 is configured to obtain a reference pixel value according to the target prediction mode if the target prediction mode is the CCLM reference mode;
  • the third determining unit 640 is configured to determine linear transformation parameters according to the reference pixel value
  • the fourth determining unit 650 is configured to determine the pixel value of the current component of the current image block according to the linear transformation parameter and the pixel value of another component of the current image block that has been decoded.
  • the first determining unit 610 is specifically configured to determine that the current image block allows the CCLM mode to be enabled when the current image block meets the following conditions:
  • the prediction mode of the current image block is an intra mode
  • At least one other component of the current image block has decoded required pixel information, and the current component exists and has not been decoded;
  • the prediction mode of the current image block is not the DM mode
  • Decoding information of at least one of the image blocks on the left side and the upper side of the current component of the current image block is available
  • the size of the current image block is within a preset size range.
  • the size of the current image block is within a preset size range, including:
  • the area of the current image block is greater than or equal to the first area threshold and less than or equal to the second area threshold;
  • the first area threshold value and the second area threshold value are both n-th power of 2, n is a positive integer, and the second area threshold value is greater than the first area threshold value.
  • the size of the current image block is within a preset size range, including:
  • the width of the current image block is greater than or equal to the first width threshold and less than or equal to the second width threshold;
  • the height of the current image block is greater than or equal to the first height threshold and less than or equal to the second height threshold;
  • the first width threshold, the second width threshold, the first height threshold, and the second height threshold are the nth power of 2, where n is a positive integer, and the first width threshold is less than the A second width threshold, and the first height threshold is smaller than the second height threshold.
  • the second determining unit 620 is specifically configured to: determine the candidate prediction mode list of the current image block; analyze the index value of the prediction mode used by the current image block; and based on the index value, The target prediction mode used by the current image block is determined in the candidate prediction mode list.
  • the second determining unit 620 is specifically configured to use the default list as the candidate prediction mode list of the current image block.
  • the default list is a first list or a second list including some prediction modes in the first list
  • the first list is ⁇ CCLM_T_L mode, non-CCLM mode, CCLM_L mode, CCLM_T mode ⁇ .
  • the second determining unit 620 is specifically configured to determine the candidate prediction mode list of the current image block based on the position information of the current image block.
  • the position information of the current image block includes: whether the decoding information of the left or upper image block of the current image block is available and the position of the current image block in the LCU.
  • the acquiring unit 630 is specifically configured to: if the current component of the current image block has the same size as the other decoded component, acquire the same position and the same number of pixel values; If the size of the current component of the current image block is different from that of the other decoded component, sampling is performed in the aspect ratio to obtain the same number of pixel values.
  • the third determining unit 640 is specifically configured to determine the maximum value maxL and the minimum value minL of the reference pixel value of the decoded another component, and the maximum value maxC of the reference pixel value of the current component. And the minimum value minC; according to maxL, minL, maxC and minC, determine the linear transformation parameters.
  • the fourth determining unit 650 is further configured to: if the determined pixel value of the current component is greater than a first preset pixel value threshold, use the first preset pixel value threshold as the The pixel value of the current component of the current image block; if the determined pixel value of the current component is less than a second preset pixel value threshold, the second preset pixel value threshold is taken as the current component of the current image block Pixel values;
  • the first preset pixel value threshold is greater than the second preset pixel value threshold.

Landscapes

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

Abstract

本申请提供一种解码方法及装置。该解码方法包括:根据当前图像块的尺寸,确定所述当前图像块是否允许启用CCLM模式;若所述当前图像块禁止启用CCLM模式,则确定所述当前图像块使用的目标预测模式,其中,所述目标预测模式为非CCLM模式;根据所述目标预测模式以及已解码信息,确定所述当前图像块的像素值。

Description

解码方法及装置 技术领域
本申请涉及视频编解码技术,尤其涉及一种解码方法及装置。
背景技术
视频编码中的帧内预测技术通过利用一帧图像内部像素间的相关性,降低待编码信息的冗余,提高图像数据的压缩效率。
在H.265的帧内预测中,亮度和色度共享预测分块模式(part_mode)独立进行预测,即亮度分量利用周边已重建的亮度值对当前待编码块的亮度值进行预测,而色度值的预测仅基于周围已重建的色度值进行帧内预测。但是研究发现,虽然YUV(一种颜色编码方法)的格式相对于RGB(一种色彩模式)已经降低了不同颜色分量的相关性,然而色度与亮度在纹理上仍有一定的一致性。跨分量预测技术就是利用已编码的颜色分量信息去预测待编码的颜色分量,进一步去除了颜色分量间的相关性,提高编码压缩质量。
然而实践发现,目前的跨分量预测技术中未对跨分量预测技术的启动条件进行限制,导致可能在不适合使用跨分量预测技术的场景使用跨分量预测技术,进而导致编码性能较差。
发明内容
有鉴于此,本申请提供一种解码方法及装置。
根据本申请实施例的第一方面,提供一种解码方法,其包括:根据当前图像块的尺寸,确定所述当前图像块是否允许启用跨分量线性模型预测(CCLM)模式;若所述当前图像块禁止启用CCLM模式,则确定所述当前图像块使用的目标预测模式,其中,所述目标预测模式为非CCLM模式;根据所述目标预测模式以及已解码信息,确定所述当前图像块的像素值。
结合第一方面,在第一种可能的实现方式中,所述根据当前图像块的尺寸,确定所述当前图像块是否允许启用CCLM模式,包括:
当所述当前图像块的尺寸满足预设CCLM模式禁用条件时,确定所述当前图像块禁止启用CCLM模式。
结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述当前图像块的尺寸满足预设CCLM模式禁用条件,包括:
所述当前图像块的面积小于或等于第一面积阈值,或者,大于或等于第二面积阈值;其中,所述第一面积阈值均为2的n次方,n为正整数,所述第二面积阈值大于第一面积阈值、
结合第一方面的第二种可能的实现方式,在第三种可能的实现方式中,所述第一面积阈值为2的3次方。
结合第一方面的第三种可能的实现方式,在第四种可能的实现方式中,所述当前图像块的尺寸满足预设CCLM模式禁用条件,包括:
所述当前图像块的尺寸为2x2、2x4或4x2。
结合第一方面的第二种可能的实现方式,在第五种可能的实现方式中,所述第一面积阈值为2的2次方。
结合第一方面的第五种可能的实现方式,在第六种可能的实现方式中,所述当前图像块的尺寸满足预设CCLM模式禁用条件,包括:
所述当前图像块的尺寸为2x2。
结合第一方面的第二种可能的实现方式,在第七种可能的实现方式中,所述第二面积阈值为2的10次方。
结合第一方面的第七种可能的实现方式,在第八种可能的实现方式中,所述当前图像块的尺寸满足预设CCLM模式禁用条件,包括:
所述当前图像块的尺寸大于或等于32x32。
结合第一方面以及第一方面的第一种可能的实现方式至第八种可能的实现方式中的任一种实现方式,在第九种可能的实现方式中,所述当前图像块为色度块。
结合第一方面以及第一方面的第一种可能的实现方式至第九种可能的实现方式中的任一种实现方式,在第十种可能的实现方式中,所述非CCLM模式包括角度预测模式、DM模式、Planar模式或DC模式。
根据本申请实施例的第二方面,提供一种解码装置,包括处理器和机器可读存储介质,所述机器可读存储介质存储有能够被所述处理器执行的机器可读指令,所述处理器被所述机器可读指令促使:根据当前图像块的尺寸,确定所述当前图像块是否允许启用CCLM模式;若所述当前图像块禁止启用CCLM模式,则确定所述当前图像块使用的目标预测模式,其中,所述目标预测模式为非CCLM模式;根据所述目标预测模式以及已解码信息,确定所述当前图像块的像素值。
本申请实施例的解码方法,根据当前图像块的尺寸,确定所述当前图像块是否允许启用CCLM模式;若所述当前图像块禁止启用CCLM模式,则确定所述当前图像块使用的目标预测模式,其中,所述目标预测模式为非CCLM模式;根据所述目标预测模式以及已解码信息,确定所述当前图像块的像素值,避免了在不适用CCLM模式的场景使用CCLM模式,提高了编码性能。
附图说明
图1是一种CCLM_T模式的参考像素值获取位置的示意图;
图2是一种CCLM_L模式的参考像素值获取位置的示意图;
图3是本申请一示例性实施例示出的一种解码方法的流程示意图;
图4A是本申请一示例性实施例示出的一种CCLM_L模式的参考像素值获取位置的示意图;
图4B是本申请一示例性实施例示出的一种CCLM_T模式的参考像素值获取位置的示意图;
图4C是本申请一示例性实施例示出的一种CCLM_T_L模式的参考像素值获取位置的示意图;
图4D是本申请一示例性实施例示出的一种线性变换参数获得示意图;
图5是本申请一示例性实施例示出的一种解码装置的硬件结构示意图;
图6是本申请一示例性实施例示出的一种解码装置的结构示意图。
具体实施方式
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同标记表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。
在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括复数形式,除非上下文清楚地表示其他含义。
为了使本申请实施例的上述目的、特征和优点能够更加明显易懂,下面结合附图对本申请实施例中技术方案作进一步详细的说明。
请参见图3,为本申请实施例提供的一种解码方法的流程示意图,其中,该解码方法可以应用于解码端设备,如图3所示,该解码方法可以包括以下步骤:
步骤S300、基于已解码信息,确定当前图像块是否允许启用CCLM模式。若是,则转至步骤S310;否则,结束当前流程。
跨分量线性模型预测(Cross Component Linear Mode,简称CCLM)为一种跨分量预测技术,基于参考亮度块的区域,可以包括三种CCLM参考模式:采用当前色度块上方的重建值和对应亮度区域的CCLM_T模式,其示意图可以如图1所示;采用当前色度块左侧的重建值和对应亮度区域的CCLM_L模式,其示意图可以如图2所示;以及采用当前色度块上方和左侧的重建值和对应亮度区域的CCLM_T_L模式。
本申请实施例中,为了提高编码性能,可以对CCLM模式的启动条件进行限定,以保证使用CCLM模式的场景均为适合使用CCLM的场景。
作为一种示例,当解码端设备对接收到的码流进行解码时,可以基于已解码信息,确定当前图像块是否允许启动CCLM模式。
在本申请一种可能的实施方式中,当当前图像块满足以下全部条件时,确定当前图像块允许启用CCLM模式:
当前图像块的预测模式为帧内模式;
当前图像块的至少一个其他分量已解码出所需像素信息,当前分量存在且未解码;
当前图像块的预测模式不为对应亮度分量模式(Direct Mode,简称DM);
当前图像块的当前分量的左侧和上侧中至少有一侧的图像块的解码信息可用;
当前图像块的尺寸在预设尺寸范围内。
需要说明的是,在本申请实施例中,当前分量是指当前图像块正在解码的分量,其可以包括但不限于亮度分量或色度分量。
作为一种示例,考虑到CCLM模式需要在帧内模式下使用,且CCLM模式需要参考其他 分量的解码信息,以及当前分量的左侧和上侧的图像块的解码信息,因此,可以将当前图像块是否为帧内模式、是否存在至少一个其他分量已解码出所需像素信息以及是否当前图像块的当前分量的左侧和上侧中至少有一侧的图像块的解码信息可用,作为当前图像块是否允许启用CCLM模式的参考条件。
作为一种示例,考虑到CCLM模式与DM模式为互斥的两种模式,即若当前图像块使用DM模式,则当前图像块不允许启用CCLM模式,因此,解码端设备确定当前图像块允许启用CCLM模式,需要保证当前图像块的预测模式不为DM模式。
作为一种示例,为了保证CCLM模式的性能,提高编码性能,还可以限定允许启用CCLM模式的图像块的尺寸范围(本文中称为预设尺寸范围,可以根据实际场景设定)。
作为一种示例,解码端设备可以在确定当前图像块的预测模式为帧内模式、当前图像块的至少一个其他分量已解码出所需像素信息以及当前分量存在且未解码、当前图像块的预测模式不为DM模式、当前图像块的当前分量的左侧和上侧中至少有一侧的图像块的解码信息可用、以及当前图像块的尺寸在预设尺寸范围内时,确定当前图像块允许启用CCLM模式。
示例性的,在本申请实施例中,若当前分量为色度分量,则至少一个其他分量可以为亮度分量;若当前分量为亮度分量,则至少一个其他分量可以为色度分量;若当前分量为Cb分量,则至少一个其他分量可以为Cr分量。
需要说明的是,在本申请实施例中,基于上述实施方式中描述的确定当前图像块是否允许启用CCLM模式的参考条件,编码端设备也可以基于相对应的参考条件确定在对图像块的当前分量进行编码时是否允许启用CCLM模式,其具体实现在此不做赘述。
作为该实施方式的一种实施例,上述当前图像块的尺寸在预设尺寸范围内,可以包括:
当前图像块的面积大于或等于第一面积阈值,且小于等于第二面积阈值;
其中,第一面积阈值和第二面积阈值均为2的n次方,n为正整数,第二面积阈值大于第一面积阈值。
作为一种示例,在确定当前图像块是否允许启用CCLM模式时,当前图像块的尺寸可以基于当前图像块的面积来表征,即需要在保证当前图像块的面积在预设面积范围内的情况下,允许当前图像块启用CCLM模式。
示例性的,预设面积范围可以为大于或等于第一面积阈值(可以称为Smin),且小于等于第二面积阈值(Smax),即需要保证当前图像块的面积在[Smin,Smax]范围内;Smin≤Smax;Smin、Smax为2的n次方,n为正整数。
作为该实施方式的另一种实施例,上述当前图像块的尺寸在预设尺寸范围内,可以包括:
当前图像块的宽大于或等于第一宽度阈值,且小于等于第二宽度阈值;
当前图像块的高大于或等于第一高度阈值,且小于等于第二高度阈值;
其中,第一宽度阈值、第二宽度阈值、第一高度阈值以及第二高度阈值为2的n次方,n为正整数,第一宽度阈值小于第二宽度阈值,第一高度阈值小于第二高度阈值。
作为一种示例,在确定当前图像块是否允许启用CCLM模式时,当前图像块的尺寸可以基于当前图像块的宽和高来表征,即需要在保证当前图像块的宽和高分别在预设宽度范围内和预 设高度范围内的情况下,允许当前图像块启用CCLM模式。
示例性的,预设宽度范围可以为大于或等于第一宽度阈值(可以称为Wmin),且小于等于第二宽度阈值(Wmax),即需要保证当前图像块的宽在[Wmin,Wmax]范围内;Wmin≤Wmax;Wmin、Wmax为2的n次方,n为正整数。
示例性的,预设高度范围可以为大于或等于第一高度阈值(可以称为Hmin),且小于等于第二高度阈值(Hmax),即需要保证当前图像块的高在[Hmin,Hmax]范围内;Hmin≤Hmax;Hmin、Hmax为2的n次方,n为正整数。
应该认识到,在本申请实施例中,上述通过图像块的面积对图像块的尺寸进行表征或通过图像块的宽和高对图像块的尺寸进行表征仅仅是本申请实施例中表征图像块的尺寸的具体示例,而并不是对本申请保护范围的限定,。例如,在本申请实施例中,还可以通过图像块的面积、宽和高对图像块的尺寸进行表征,其具体实现在此不做赘述。
本申请实施例中,若解码端设备确定当前图像块允许启用CCLM模式,则解码端设备可以继续按照步骤S310~S340的方式进行当前图像块的当前分量的解码。
若解码端设备确定当前图像块不允许启用CCLM模式,则解码端设备可以继续按照其他策略进行当前图像块的解码,其具体实现可以参照相关方案进行的相关实现,本申请实施例在此不做赘述。
步骤S310、确定当前图像块使用的目标预测模式。
本申请实施例中,当解码端设备确定当前图像块允许启用CCLM模式时,解码端设备可以解析当前图像块使用的具体预测模式(本文中称为目标预测模式),以确定当前图像块使用的目标预测模式是否为CCLM参考模式(CCLM_L、CCLM_T或CCLM_T_L)。
在本申请一种可能的实施方式中,上述确定当前图像块使用的目标预测模式,可以包括:
确定当前图像块的候选预测模式列表;
解析当前图像块使用的预测模式的索引值;
基于解析到的索引值,在候选预测模式列表中确定当前图像块使用的目标预测模式。
作为一种示例,为了确定当前图像块使用的目标预测模式,一方面,解码端设备可以确定当前图像块的候选预测模式列表,即当前图像块支持的预测模式;另一方面,解码端设备可以从码流中解析当前图像块使用的预测模式的索引值,进而,基于解析到的索引值,在候选预测模式列表中确定当前图像块使用的目标预测模式。
作为该实施方式的一种实施例,上述确定当前图像块的候选预测模式列表,可以包括:
确定当前图像块的候选预测模式列表为默认列表。
作为一种示例,可以预先在编码端设备和解码端设备上配置作为候选预测模式列表的默认列表,该默认列表可以由编码端设备和解码端设备协商确定,或者由用户手动配置在编码端设备和解码端设备。
在一个示例中,上述默认列表为第一列表或包括第一列表中的部分预测模式的第二列表。示例性的,第一列表为{CCLM_T_L模式、非CCLM模式、CCLM_L模式、CCLM_T模式}。示例性的,非CCLM模式可以包括但不限于角度预测模式、DM模式、Planar模式或DC模式 等。
需要说明的是,第一列表中各模式的顺序可以为列表中所列举各模式的顺序,也可以为其他顺序。本文中以列表中所列举顺序为例。
举例来说,第二列表可以为{非CCLM模式、CCLM_L模式、CCLM_T模式}、{CCLM_T_L模式、非CCLM模式、CCLM_T模式}或{CCLM_T_L模式、CCLM_T模式}等。
作为该实施方式的另一种实施例,上述确定当前图像块的候选预测模式列表,可以包括:
基于当前图像块的位置信息,确定当前图像块的候选预测模式列表。
作为一种示例,解码端设备可以基于当前图像块的位置信息,确定当前图像块的候选预测模式列表。
示例性的,当前图像块的位置信息可以包括:当前图像块的左侧或上侧图像块的解码信息是否可用以及当前图像块在最大编码单元(Largest Code Unit,简称LCU)中的位置。
举例来说,假设当前图像块的初始化候选预测模式列表为{非CCLM模式、CCLM_L模式、CCLM_T模式},解码端设备可以确定当前图像块的左侧或上侧图像块的解码信息是否可用,以及当前图像块在LCU中的位置。
若当前图像块的左侧信息不可用,则将CCLM_T_L模式和CCLM_L模式从候选预测模式列表中排除;若当前图像块的上侧信息不可用,则将CCLM_T_L模式和CCLM_T模式从候选预测模式列表中排除;若当前图像块处于LCU上边界,即当前图像块与上侧LCU相接,则将CCLM_T_L模式和CCLM_T模式排除。
示例性的,当前图像块左侧或上侧图像块不可用包括但不限于当前图像块左侧或上侧图像块不存在,或者,存在但未解码。
作为一种示例,解码端设备确定了当前图像块的候选预测模式列表时,可以解析当前图像块使用的预测模式的索引值。
示例性的,假设当前块的候选预测模式列表中的预测模式的总数为Max,则解码端设备可以解析最多Max-1个比特,确定当前图像块使用的预测模式的索引值。
举例来说,假设Max=4,结束位为1(即解码端设备在解析当前图像块使用的预测模式的索引值对应的二值化码字序列时,解析到1时,结束码流解析),则解码端设备可以最多解析3个比特,或解析到1时则立即停止解析。此时,若解析到“1”,则确定索引值为0;若解析到“01”,则确定索引值为1;若解析到“001”,则确定索引值为2;若解析到“000”,则确定索引值为3。
作为一种示例,解码端设备解析到当前图像块使用的预测模式的索引值时,可以基于该索引值,在所确定的候选预测模式列表中确定当前图像块使用的目标预测模式。
需要说明的是,在本申请实施例中,若解码端设备确定当前图像块使用的目标预测模式为CCLM参考模式(CCLM_L、CCLM_T或CCLM_T_L),则解码端设备可以继续按照步骤S320~S340的方式进行当前图像块的当前分量的解码。
若解码端设备确定当前图像块使用的目标预测模式为非CCLM参考模式,则解码端设备可以继续按照其他策略进行当前图像块的解码,其具体实现可以参照相关方案进行的相关实现, 本申请实施例在此不做赘述。
步骤S320、若目标预测模式为CCLM参考模式,则根据目标预测模式,获取参考像素值。
本申请实施例中,当解码端设备确定当前图像块使用的目标预测模式为CCLM参考模式(CCLM_L、CCLM_T或CCLM_T_L)时,解码端设备可以根据目标预测模式,从当前图像块的当前分量和已解码的另一分量获取参考像素值。
在本申请的一种可能的实施方式中,上述根据目标预测模式,获取参考像素值,可以包括:
若当前图像块的当前分量与已解码的另一分量的尺寸相同,则获取相同位置,相同数量的像素值;
若当前图像块的当前分量与已解码的另一分量的尺寸不同,则按长宽比例采样以获取相同数量的像素值。
举例来说,假设当前图像块的宽为width,高为height。
若当前分量的宽为已解码的另一分量的1/W,当前分量的高为已解码的另一分量的1/H。
若目标预测模式为CCLM_L模式,则解码端设备可以从当前分量取左侧L个参考像素值,参考的已解码的另一分量取对应位置经过H倍上采样后的对应位置的L个参考像素值。
示例性的,L为2*height。
若目标预测模式为CCLM_T模式,则解码端设备可以从当前分量取上侧T个参考像素值,参考的已解码的另一分量取对应位置经过W倍上采样后的对应位置的T个参考像素值。示例性的,T为2*width。
若目标预测模式为CCLM_T_L模式,则解码端设备可以当前分量取左侧L个参考像素值和上侧T个参考像素值,参考的已解码的另一分量取左侧经过H倍上采样后的对应位置的L个参考像素值和上侧取经过W倍上采样后的对应位置的T个参考像素值。示例性的,L为height,T为width。
步骤S330、根据获取到的参考像素值,确定线性变换参数。
本申请实施例中,解码端设备获取到参考像素值时,可以根据获取到的参考像素值,确定线性变换参数。
在本申请的一种可能的实施方式中,上述根据获取到的参考像素值,确定线性变换参数,可以包括:
确定已解码的另一分量的参考像素值的最大值maxL和最小值minL,以及当前分量的参考像素值的最大值maxC和最小值minC;
根据maxL、minL、maxC以及minC,确定线性变换参数。
作为一种示例,为了确定线性变换参数,解码端设备可以先确定已解码的另一分量的参考像素值的最大值(本文中称为maxL)和最小值(本文中称为minL),以及当前分量的参考像素值的最大值(本文中称为maxC)和最小值(本文中称为minC)。
解码端设备确定了maxL、minL、maxC和minC之后,可以根据maxL、minL、maxC和minC确定线性变换参数。
在一个示例中,上述根据maxL、minL、maxC以及minC,确定线性变换参数,包括:
若maxL等于minL,则α=0,β=Si;
其中,α和β为线性变换参数,Si为maxC、minC或maxC和minC的均值。
作为一种示例,若maxL等于minL,即已解码的另一分量的参考像素值均相同,则解码端设备可以确定线性变换参数α=0,β=Si。示例性的,Si=maxC;或者,Si=minC;或者,Si=(maxC+minC)/2。
在另一个示例中,上述根据maxL、minL、maxC以及minC,确定线性变换参数,包括:
若maxL不等于minL,则根据以下公式确定α和β:
diffL=maxL–minL;
diffC=maxC–minC;
x=Floor(Log2(diffL));
normDiff=((diffL<<4)>>x)&15,若normDiff!=0,则x=x+1;否则x不变;
y=Floor(Log2(Abs(diffC)))+1;
add=(1<<y)>>1,value=DivSigTable[normDiff]|8
α=(diffC*value+add)>>y;
shift=3+x–y;
若shift<1,则令shift=1,α=Sign(α)*15;
β=minC-((α*minL)>>shift)
其中,Floor表示向下取整,Log2表示取2的对数,a<<x表示a左移x位,>>表示右移,&表示按位与,|表示按位或,abs表示绝对值,DivSigTable为表格,DivSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0},Sign(x)表示取x的符号位(若x等于0,则Sign(x)为0;若x大于0,则Sign(x)为1;否则,Sign(x)为-1)。
作为一种示例,以当前分量为色度分量,已解码的另一分量为亮度分量为例,可以按照以下公式确定线性变换参数α和β:
Figure PCTCN2020078875-appb-000001
β=C j-α*L j
如图4D所示,通过遍历当前图像块的已解码的亮度分量的参考像素值,以确定已解码的亮度分量的参考像素值的最大值和最小值,并根据已解码亮度分量的参考像素值的最大值和最小值,以及对应的色度分量的参考像素值,确定线性变换参数。
在上述公式中,Li为已解码的亮度分量的参考像素值的最大值,Lj为已解码的亮度分量的参考像素值的最小值;Ci和Cj分别为Li和Lj对应的色度分量的参考像素值。
考虑到若按照上述公式确定线性变换参数α和β,则需要进行较多的乘法和除法运算,而目前的硬件对于乘法运算和除法运算(尤其是除法运算)的友好性较差,因此,按照上述公式确定线性变换参数的硬件友好性会比较差。
因而,在本申请实施例中,可以通过移位的方式来实现数据的乘除,以提高线性变换参数的确定的硬件友好性。
作为一种示例,解码端设备确定了maxL、minL、maxC以及minC,且确定maxL不等于minL时,解码端设备可以按照以下公式确定线性变换参数α和β:
diffL=maxL–minL;
diffC=maxC–minC;
x=Floor(Log2(diffL));
normDiff=((diffL<<4)>>x)&15,若normDiff!=0,则x=x+1;否则x不变;
y=Floor(Log2(Abs(diffC)))+1;
add=(1<<y)>>1,value=DivSigTable[normDiff]|8
α=(diffC*value+add)>>y;
shift=3+x–y;
若shift<1,则令shift=1,α=Sign(α)*15;
β=minC-((α*minL)>>shift)
举例来说,假设diffL=3(二进制为11),则diffL<<4为110000(十进制为48);假设diffL=15(二进制为1111),则diffL>>1为111(十进制为7),diffL>>2为11(十进制为3)。
DivSigTable[normDiff]表示取DivSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0}中的第normDiff位。
例如,假设normDiff=1,则DivSigTable[normDiff]为7;假设normDiff=2,则DivSigTable[normDiff]为6;假设normDiff=4,则DivSigTable[normDiff]为5。
可见,在该实施例中,通过左移和右移实现乘除运算,提高了硬件友好性。
步骤S340、根据所确定的线性变换参数以及当前图像块已解码的另一分量的像素值,确定当前图像块的当前分量的像素值。
本申请实施例中,解码端设备确定了线性变换参数时,可以根据所确定的线性变换参数以及当前图像块已解码的另一分量的像素值,确定当前图像块的当前分量的像素值。
在本申请的一种可能的实施方式中,上述根据所确定的线性变换参数以及当前图像块已解码的另一分量的像素值,确定当前图像块的当前分量的像素值,可以通过以下公式实现:
Yi=(αXi)>>z+β
其中,Xi为已解码的另一分量中的第i个像素值,Yi为当前分量中的第i个像素值,z为自然数。
作为一种示例,解码端设备确定了线性变换参数α和β时,解码端设备可以获取当前图像块已解码的另一分量的第i个像素值(本文中称为Xi),并根据α、β以及Xi,利用上述公式Yi=(αXi)>>z+β确定当前图像块的当前分量的第i个像素值(本文中称为Yi)。
示例性的,z=shift(shift的值可以按照上述实施例中描述的方式确定);或,z=0。
需要说明的是,在本申请实施例中,当前图像块已解码的另一分量的像素值可以称为第一参考像素值,当前图像块的当前分量的像素值可以称为目标像素值,当前图像块的当前分量左侧或上侧的参考像素值可以称为第二参考像素值,当前图像块的已解码的另一分量的左侧 或上侧的参考像素值可以称为第三参考像素值。
示例性的,上述第一参考像素值、第二参考像素值和第三参考像素值可以为重建值;目标像素值为预测值。
或者,示例性的,上述第一参考像素值、第二参考像素值和第三参考像素值可以为残差值;目标像素值为预测值。
作为一种示例,考虑到实际应用场景中,图像块的某一分量的像素值通常会存在像素值范围(如0~255),因此,解码端设备按照上述方式确定了当前分量的像素值之后,还需要确定当前分量的像素值是否在预设像素值的取值范围内。
作为该实施方式的一个实施例,上述确定当前图像块的当前分量的像素值之后,还可以包括:
若所确定的当前分量的像素值大于第一预设像素值阈值,则将第一预设像素值阈值作为当前图像块的当前分量的像素值;
若所确定的当前分量的像素值小于第二预设像素值阈值,则将第二预设像素值阈值作为当前图像块的当前分量的像素值;
示例性的,第一预设像素值阈值大于第二预设像素值阈值。
作为一种示例,对于当前图像块的任一像素点,解码端设备按照上述方式确定了该像素点的像素值之后,若该像素值大于第一预设像素值阈值(可以根据需求设置,如2的D次方-1,D表示当前像素值的比特数,如D为8时,第一预设像素值阈值为255),则解码端设备可以将该像素点的像素值确定为第一预设像素值阈值。
若该像素值小于第二预设像素值阈值(如0,或者,也可以根据需求设置为其他大于0的值),则解码端设备可以将该像素点的像素值确定为第二预设像素阈值。
举例来说,假设第一预设像素值阈值为255,第二预设像素值阈值为0,则当解码端设备确定当前分量的像素值为300时,解码端设备可以将255作为当前分量的像素值;当解码端设备确定当前分量的像素值为-2时,解码端设备可以将0作为当前分量的像素值。
又举例来说,假设第一预设像素值阈值为255,第二预设像素值阈值为2,则当解码端设备确定当前分量的像素值为300时,解码端设备可以将255作为当前分量的像素值;当解码端设备确定当前分量的像素值为1时,解码端设备可以将2作为当前分量的像素值。
需要说明的是,在本申请实施例中,对于任一CCLM参考模式(CCLM_L、CCLM_T或CCLM_T_L),当编码端设备在确定该CCLM参考模式的率失真代价或者使用该CCLM参考模式对当前图像块的当前分量进行编码时,均可以按照上述步骤S320~步骤S340中描述的方式确定图像块的当前分量的像素值,其具体实现在此不做赘述。
为了使本领域技术人员更好地理解本申请实施例提供的技术方案,下面结合具体实例对本申请实施例提供的技术方案进行说明。
作为一种示例,当需要对当前图像块的当前分量进行解码时,可以按照以下步骤实现:
1、解码端设备可以获取已解码信息,并确定当前图像块是否满足以下条件:
1.1、当前图像块的预测模式为帧内模式;
1.2、当前图像块的至少一个其他分量已解码出所需像素信息,当前分量存在且未解码;
1.3、当前图像块的预测模式不为DM模式;
1.4、当前图像块的当前分量的左侧和上侧中至少有一侧的图像块的解码信息可用;
1.5、当前图像块的尺寸在预设尺寸范围内。
在该实施例中,对于步骤1.5,可以包括以下实施方式:
实施例一
作为一种示例,当前图像块的尺寸在预设尺寸范围内,可以包括:
当前图像块的面积在[Smin,Smax]范围内,Smin、Smax为2的n次方,n为正整数。
示例性的,Smin=8,Smax=4096。
实施例二
作为一种示例,当前图像块的尺寸在预设尺寸范围内,可以包括:
当前图像块的宽在[Wmin,Wmax]范围内;
当前图像块的高在[Hmin,Hmax]范围内;
Wmin、Wmax、Hmin和Hmax为2的n次方,n为正整数。
示例性的,Wmin=2,Wmax=64,Hmin=2,Hmax=64。
实施例三
作为一种示例,当前图像块的尺寸在预设尺寸范围内,可以包括:
当前图像块的宽在[Wmin,Wmax]范围内;
当前图像块的高在[Hmin,Hmax]范围内;
当前图像块的面积在[Smin,Smax]范围内;
Wmin、Wmax、Hmin、Hmax、Smin和Smax为2的n次方,n为正整数。
示例性的,Wmin=2,Wmax=64,Hmin=2,Hmax=64,Smin=8,Smax=4096。
可见,在该实施例中,通过对CCLM模式的启用条件进行限定,避免了在不适用CCLM模式的场景使用CCLM模式,提高了编码性能。
下文中以解码端设备确定当前图像块允许启用CCLM模式为例。
2、确定当前图像块使用的目标预测模式。
2.1、确定当前图像块的候选预测模式列表。
1)、候选预测模式列表为默认列表
实施例四
作为一种示例,默认列表可以为(区分顺序){CCLM_T_L模式、非CCLM模式、CCLM_L模式、CCLM_T模式}。
实施例五
作为一种示例,默认列表可以为{CCLM_T_L模式、非CCLM模式、CCLM_L模式、CCLM_T模式}中的部分模式。
举例来说,默认列表可以为(区分顺序){CCLM_T_L模式、非CCLM模式、CCLM_T模式}。
又举例来说,默认列表可以为(区分顺序){非CCLM模式、CCLM_T模式}。
2)、基于当前图像块的位置信息,确定当前图像块的候选预测模式列表。
示例性的,当前图像块的位置信息可以包括:当前图像块的左侧或上侧图像块的解码信息是否可用以及当前图像块在LCU中的位置。
举例来说,假设当前图像块的初始化候选预测模式列表为{非CCLM模式、CCLM_L模式、CCLM_T模式},解码端设备可以确定当前图像块的左侧或上侧图像块的解码信息是否可用,以及当前图像块在LCU中的位置。
若当前图像块的左侧信息不可用,则将CCLM_T_L模式和CCLM_L模式从候选预测模式列表中排除;若当前图像块的上侧信息不可用,则将CCLM_T_L模式和CCLM_T模式从候选预测模式列表中排除;若当前图像块处于LCU上边界,即当前图像块与上侧LCU相接,则将CCLM_T_L模式和CCLM_T模式排除。
2.2、解析当前图像块使用的预测模式的索引值。
举例来说、假设候选预测模式列表为(区分顺序){CCLM_T_L模式、非CCLM模式、CCLM_L模式、CCLM_T模式},结束位为1,则解码端设备可以最多解析3个比特,或解析到1时则立即停止解析。此时,若解析到“1”,则确定索引值为0;若解析到“01”,则确定索引值为1;若解析到“001”,则确定索引值为2;若解析到“000”,则确定索引值为3。
又举例来说,假设候选预测模式列表为(区分顺序){CCLM_T_L模式、非CCLM模式、CCLM_T模式},结束位为1,则解码端设备可以最多解析2个比特,或解析到1时则立即停止解析。此时,若解析到“1”,则确定索引值为0;若解析到“01”,则确定索引值为1;若解析到“00”,则确定索引值为2。
2.3、根据解析到的索引值,从候选预测模式列表中确定当前图像块使用的目标预测模式。
举例来说,假设候选预测模式列表为(区分顺序){CCLM_T_L模式、非CCLM模式、CCLM_L模式、CCLM_T模式},若解析到的索引值为0,则目标预测模式为CCLM_T_L模式;若解析到的索引值为2,则目标预测模式为CCLM_L模式。
又举例来说,假设候选预测模式列表为(区分顺序){CCLM_T_L模式、非CCLM模式、CCLM_T模式},若解析到的索引值为0,则目标预测模式为CCLM_T_L模式;若解析到的索引值为2,则目标预测模式为CCLM_T模式。
下文中以目标预测模式为CCLM参考模式为例。
3、根据目标预测模式,获取参考像素值。
作为一种示例,解码端设备确定了当前图像块使用的目标预测模式时,可以基于该目标预测模式,从当前图像块的当前分量和已解码的另一分量获取参考像素值。
假设当前分量的宽为W,高为H,当前分量的宽为已解码的另一分量的1/2,当前分量的高为已解码的另一分量的1/2。
实施例六
假设目标预测模式为CCLM_L模式。
作为一种示例,解码端设备可以从当前分量左侧取2H个参考像素值,并从已解码的另一分量的左侧经过2倍上采样后的对应位置取2H个参考像素值,其示意图可以如图4A所示。
示例性的,当前分量(以当前分量为色度分量为例)左侧的参考像素值可以为当前图像块的左侧的第1个、第2个…第2H个色度块的像素值;另一分量(以亮度分量为例)的左侧经过2倍上采样后的对应位置的参考像素值为该另一分量的左侧的第1个、第3个、第5个…第2*2H-1个亮度块的像素值。
实施例七
假设目标预测模式为CCLM_T模式。
作为一种示例,解码端设备可以从当前分量上侧取2W个参考像素值,并从已解码的另一分量的上侧经过2倍上采样后的对应位置取2W个参考像素值,其示意图可以如图4B所示。
示例性的,当前分量(以当前分量为色度分量为例)上侧的参考像素值可以为当前图像块上侧的第1个、第2个…第2W个色度块的像素值;另一分量(以亮度分量为例)的上侧经过2倍上采样后的对应位置的参考像素值为该另一分量的上侧的第1个、第3个、第5个…第2*2W-1个亮度块的像素值。
实施例八
假设目标预测模式为CCLM_T_L模式。
作为一种示例,解码端设备可以从当前分量左侧取H个参考像素值,从当前分量上侧取W个参考像素值;从已解码的另一分量的左侧经过2倍上采样后的对应位置取H个参考像素值,从已解码的另一分量的上侧经过2倍上采样后的对应位置取W个参考像素值,其示意图可以如图4C所示。
示例性的,当前分量(以当前分量为色度分量为例)左侧的参考像素值为当前图像块左侧的第1个、第2个…第H个色度块的像素值,上侧的参考像素值可以为当前图像块上侧的第1个、第2个…第W个色度块的像素值;另一分量(以亮度分量为例)的左侧经过2倍上采样后的对应位置的参考像素值为该另一分量的左侧的第1个、第3个、第5个…第2*H-1个亮度块的像素值,上侧经过2倍上采样后的对应位置的参考像素值为该另一分量的上侧的第1个、第3个、第5个…第2*W-1个亮度块的像素值。
4、根据获取到的参考值,确定线性变换参数α和β。
作为一种示例,解码端设备可以先确定maxL、minL、maxC和minC,并根据maxL、minL、maxC和minC确定线性变换参数。
实施例九
作为一种示例,根据maxL、minL、maxC和minC确定线性变换参数,可以包括:
若maxL等于minL,则α=0,β=Si;
其中,α和β为线性变换参数。
示例性的,Si=maxC;或者,Si=minC;或者,Si=(maxC+minC)/2。
若maxL不等于minL,则根据以下公式确定α和β:
diffL=maxL–minL;
diffC=maxC–minC;
x=Floor(Log2(diffL));
normDiff=((diffL<<4)>>x)&15,若normDiff!=0,则x=x+1;否则x不变;
y=Floor(Log2(Abs(diffC)))+1;
add=(1<<y)>>1,value=DivSigTable[normDiff]|8
α=(diffC*value+add)>>y;
shift=3+x–y;
若shift<1,则令shift=1,α=Sign(α)*15;
β=minC-((α*minL)>>shift)
示例性的,Floor表示向下取整,Log2表示取2的对数,a<<x表示a左移x位,>>表示右移,&为按位与,|表示按位或,abs表示绝对值,DivSigTable为表格,DivSigTable[]={0,7,6,5,5,4,4,3,3,2,2,1,1,1,1,0},Sign(x)表示取x的符号位。
可见,在该实施例中,通过左移和右移实现乘除运算,提高了硬件友好性。
5、根据所确定的线性变换参数α和β以及当前图像块已解码的另一分量的像素值,确定当前图像块的当前分量的像素值。
作为一种示例,解码端设备确定了线性变换参数α和β时,可以根据所确定的线性变换参数以及当前图像块已解码的另一分量的像素值,确定当前图像块的当前分量的像素值。
实施例十
作为一种示例,解码端设备可以通过以下公式确定当前图像块的当前分量的像素值:
Yi=(αXi)>>shift+β
在该公式中,Xi为已解码的另一分量中的第i个像素值,Yi为当前分量中的第i个像素值,shift的值可以通过上述步骤4中的公式确定。
作为一种示例,确定了Yi之后,若Yi<0,则将Yi设为0;若Yi大于2的D次方减1(以Yi采用D比特编码为例),则将Yi设为2的D次方减1。
实施例十一
作为一种示例,解码端设备可以通过以下公式确定当前图像块的当前分量的像素值:
Yi=(αXi)+β
在该公式中,Xi为已解码的另一分量中的第i个像素值,Yi为当前分量中的第i个像素值。
作为一种示例,确定了Yi之后,若Yi<0,则将Yi设为0;若Yi大于2的D次方减1(以Yi采用D比特编码为例),则将Yi设为2的D次方减1。
本申请实施例中,通过基于已解码信息,确定当前图像块是否允许启用CCLM模式。当当前图像块允许启用CCLM模式时,确定当前图像块使用的目标预测模式。当目标预测模式为CCLM参考模式时,根据目标预测模式,获取参考像素值。进而,根据参考像素值,确定线 性变换参数。然后,根据线性变换参数以及当前图像块已解码的另一分量的像素值,确定当前图像块的当前分量的像素值。通过对CCLM模式的启用条件进行限定,避免了在不适用CCLM模式的场景使用CCLM模式,提高了编码性能。
以上对本申请提供的方法进行了描述。下面对本申请提供的装置进行描述:
请参见图5,为本申请实施例提供的一种解码装置的硬件结构示意图。该解码装置可包括处理器501、存储有机器可执行指令的机器可读存储介质502。处理器501与机器可读存储介质502可经由系统总线503通信。并且,通过读取并执行机器可读存储介质502中与解码控制逻辑对应的机器可执行指令,处理器501可执行上文描述的解码方法。
本文中提到的机器可读存储介质502可以是任何电子、磁性、光学或其它物理存储装置,可以包含或存储信息,如可执行指令、数据,等等。例如,机器可读存储介质可以是:RAM(Random Access Memory,随机存取存储器)、易失存储器、非易失性存储器、闪存、存储驱动器(如硬盘驱动器)、固态硬盘、任何类型的存储盘(如光盘、DVD等),或者类似的存储介质,或者它们的组合。
如图6所示,从功能上划分,上述解码控制逻辑可以包括第一确定单元610、第二确定单元620、获取单元630、第三确定单元640以及第四确定单元650;其中:
第一确定单元610,用于基于已解码信息,确定当前图像块是否允许启用CCLM模式;
第二确定单元620,用于若所述当前图像块允许启用CCLM模式,则确定所述当前图像块使用的目标预测模式;
获取单元630,用于若所述目标预测模式为CCLM参考模式,则根据所述目标预测模式,获取参考像素值;
第三确定单元640,用于根据所述参考像素值,确定线性变换参数;
第四确定单元650,用于根据所述线性变换参数以及所述当前图像块已解码的另一分量的像素值,确定所述当前图像块的当前分量的像素值。
作为一种可能的实施方式,第一确定单元610具体用于在所述当前图像块满足以下条件时,确定所述当前图像块允许启用CCLM模式:
所述当前图像块的预测模式为帧内模式;
所述当前图像块的至少一个其他分量已解码出所需像素信息,当前分量存在且未解码;
所述当前图像块的预测模式不为DM模式;
所述当前图像块的当前分量的左侧和上侧中至少有一侧的图像块的解码信息可用;
所述当前图像块的尺寸在预设尺寸范围内。
作为一种可能的实施方式,所述当前图像块的尺寸在预设尺寸范围内,包括:
所述当前图像块的面积大于或等于第一面积阈值,且小于等于第二面积阈值;
其中,所述第一面积阈值和所述第二面积阈值均为2的n次方,n为正整数,所述第二面积阈值大于所述第一面积阈值。
作为一种可能的实施方式,所述当前图像块的尺寸在预设尺寸范围内,包括:
所述当前图像块的宽大于或等于第一宽度阈值,且小于等于第二宽度阈值;
所述当前图像块的高大于或等于第一高度阈值,且小于等于第二高度阈值;
其中,所述第一宽度阈值、所述第二宽度阈值、所述第一高度阈值以及所述第二高度阈值为2的n次方,n为正整数,所述第一宽度阈值小于所述第二宽度阈值,所述第一高度阈值小于所述第二高度阈值。
作为一种可能的实施方式,第二确定单元620具体用于:确定所述当前图像块的候选预测模式列表;解析所述当前图像块使用的预测模式的索引值;基于所述索引值,在所述候选预测模式列表中确定所述当前图像块使用的目标预测模式。
作为一种可能的实施方式,第二确定单元620具体用于将默认列表作为所述当前图像块的候选预测模式列表。
作为一种可能的实施方式,所述默认列表为第一列表或包括所述第一列表中的部分预测模式的第二列表;
其中,所述第一列表为{CCLM_T_L模式、非CCLM模式、CCLM_L模式、CCLM_T模式}。
作为一种可能的实施方式,所述第二确定单元620,具体用于基于所述当前图像块的位置信息,确定所述当前图像块的候选预测模式列表。
作为一种可能的实施方式,所述当前图像块的位置信息包括:所述当前图像块的左侧或上侧图像块的解码信息是否可用以及所述当前图像块在LCU中的位置。
作为一种可能的实施方式,获取单元630具体用于:若所述当前图像块的当前分量与所述已解码的另一分量的尺寸相同,则获取相同位置,相同数量的像素值;若所述当前图像块的当前分量与所述已解码的另一分量的尺寸不同,则按长宽比例采样以获取相同数量的像素值。
作为一种可能的实施方式,第三确定单元640具体用于:确定所述已解码的另一分量的参考像素值的最大值maxL和最小值minL,以及当前分量的参考像素值的最大值maxC和最小值minC;根据maxL、minL、maxC以及minC,确定线性变换参数。
作为一种可能的实施方式,所述第四确定单元650还用于:若所确定的当前分量的像素值大于第一预设像素值阈值,则将所述第一预设像素值阈值作为所述当前图像块的当前分量的像素值;若所确定的当前分量的像素值小于第二预设像素值阈值,则将所述第二预设像素值阈值作为所述当前图像块的当前分量的像素值;
示例性的,所述第一预设像素值阈值大于所述第二预设像素值阈值。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅为本申请的实施例,并不用以限制本申请。凡在本申请的精神和原则之内所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (12)

  1. 一种解码方法,包括:
    根据当前图像块的尺寸,确定所述当前图像块是否允许启用跨分量线性模型预测CCLM模式;
    若所述当前图像块禁止启用CCLM模式,则确定所述当前图像块使用的目标预测模式,其中,所述目标预测模式为非CCLM模式;
    根据所述目标预测模式以及已解码信息,确定所述当前图像块的像素值。
  2. 根据权利要求1所述的方法,其中,所述根据当前图像块的尺寸,确定所述当前图像块是否允许启用CCLM模式,包括:
    当所述当前图像块的尺寸满足预设CCLM模式禁用条件时,确定所述当前图像块禁止启用CCLM模式。
  3. 根据权利要求2所述的方法,其中,所述当前图像块的尺寸满足预设CCLM模式禁用条件,包括:
    所述当前图像块的面积小于或等于第一面积阈值,或者,大于或等于第二面积阈值,其中,所述第一面积阈值为2的n次方,n为正整数,所述第二面积阈值大于所述第一面积阈值。
  4. 根据权利要求3所述的方法,其中,所述第一面积阈值为2的3次方。
  5. 根据权利要求4所述的方法,其中,所述当前图像块的尺寸满足预设CCLM模式禁用条件,包括:
    所述当前图像块的尺寸为2x2、2x4或4x2。
  6. 根据权利要求3所述的方法,其中,所述第一面积阈值为2的2次方。
  7. 根据权利要求6所述的方法,其中,所述当前图像块的尺寸满足预设CCLM模式禁用条件,包括:
    所述当前图像块的尺寸为2x2。
  8. 根据权利要求3所述的方法,其中,所述第二面积阈值为2的10次方。
  9. 根据权利要求8所述的方法,其中,所述当前图像块的尺寸满足预设CCLM模式禁用条件,包括:
    所述当前图像块的尺寸大于或等于32x32。
  10. 根据权利要求1-9中任一项所述的方法,其中,所述当前图像块为色度块。
  11. 根据权利要求1-10中任一项所述的方法,其中,所述非CCLM模式包括角度预测模式、DM模式、Planar模式或DC模式。
  12. 一种解码装置,包括处理器和机器可读存储介质,
    其中,所述机器可读存储介质存储有能够被所述处理器执行的机器可读指令,所述处理器被所述机器可读指令促使:
    根据当前图像块的尺寸,确定所述当前图像块是否允许启用跨分量线性模型预测CCLM模式;
    若所述当前图像块禁止启用CCLM模式,则确定所述当前图像块使用的目标预测模式,其中,所述目标预测模式为非CCLM模式;
    根据所述目标预测模式以及已解码信息,确定所述当前图像块的像素值。
PCT/CN2020/078875 2019-03-11 2020-03-11 解码方法及装置 WO2020182169A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910181866.XA CN111698501B (zh) 2019-03-11 2019-03-11 解码方法及装置
CN201910181866.X 2019-03-11

Publications (1)

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

Family

ID=69052582

Family Applications (2)

Application Number Title Priority Date Filing Date
PCT/CN2020/078874 WO2020182168A1 (zh) 2019-03-11 2020-03-11 解码方法及装置
PCT/CN2020/078875 WO2020182169A1 (zh) 2019-03-11 2020-03-11 解码方法及装置

Family Applications Before (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/078874 WO2020182168A1 (zh) 2019-03-11 2020-03-11 解码方法及装置

Country Status (2)

Country Link
CN (2) CN110662031B (zh)
WO (2) WO2020182168A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113129294A (zh) * 2021-04-28 2021-07-16 桂林电子科技大学 多尺度连接深度学习一步相位展开方法

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110662031B (zh) * 2019-03-11 2021-03-23 杭州海康威视数字技术股份有限公司 解码方法及装置
CN116668704B (zh) * 2023-08-02 2024-02-06 深圳传音控股股份有限公司 处理方法、处理设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105009590A (zh) * 2013-03-15 2015-10-28 高通股份有限公司 用于视频信息的可缩放译码的装置和方法
CN106576164A (zh) * 2014-06-27 2017-04-19 三菱电机株式会社 用于预测和过滤图片中的颜色分量的方法和解码器
JP2018056685A (ja) * 2016-09-27 2018-04-05 株式会社ドワンゴ 画像符号化装置、画像符号化方法、及び画像符号化プログラム、並びに、画像復号装置、画像復号方法、及び画像復号プログラム
CN110662031A (zh) * 2019-03-11 2020-01-07 杭州海康威视数字技术股份有限公司 解码方法及装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101590633B1 (ko) * 2008-11-11 2016-02-02 삼성전자주식회사 슬라이스 단위로 분할된 동영상을 처리하는 동영상 부호화/복호화장치 및 동영상 부호화/복호화방법
US9998742B2 (en) * 2015-01-27 2018-06-12 Qualcomm Incorporated Adaptive cross component residual prediction
WO2016124711A1 (en) * 2015-02-05 2016-08-11 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. 3d-video codec supporting inter-component prediction
CN115150618A (zh) * 2016-05-27 2022-10-04 松下电器(美国)知识产权公司 解码装置及系统
US10419757B2 (en) * 2016-08-31 2019-09-17 Qualcomm Incorporated Cross-component filter
CN109274969B (zh) * 2017-07-17 2020-12-22 华为技术有限公司 色度预测的方法和设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105009590A (zh) * 2013-03-15 2015-10-28 高通股份有限公司 用于视频信息的可缩放译码的装置和方法
CN106576164A (zh) * 2014-06-27 2017-04-19 三菱电机株式会社 用于预测和过滤图片中的颜色分量的方法和解码器
JP2018056685A (ja) * 2016-09-27 2018-04-05 株式会社ドワンゴ 画像符号化装置、画像符号化方法、及び画像符号化プログラム、並びに、画像復号装置、画像復号方法、及び画像復号プログラム
CN110662031A (zh) * 2019-03-11 2020-01-07 杭州海康威视数字技术股份有限公司 解码方法及装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113129294A (zh) * 2021-04-28 2021-07-16 桂林电子科技大学 多尺度连接深度学习一步相位展开方法

Also Published As

Publication number Publication date
CN111698501B (zh) 2022-03-01
WO2020182168A1 (zh) 2020-09-17
CN110662031A (zh) 2020-01-07
CN110662031B (zh) 2021-03-23
CN111698501A (zh) 2020-09-22

Similar Documents

Publication Publication Date Title
US20240267540A1 (en) Coded-block-flag coding and derivation
JP6553220B2 (ja) 適応色空間変換の符号化
WO2020182169A1 (zh) 解码方法及装置
JP5775084B2 (ja) モード情報を符号化、復号化する方法及びその装置
US8509310B2 (en) Method, medium, and system encoding and/or decoding an image
US9743080B2 (en) Encoding or decoding method and apparatus
US20140205006A1 (en) Super macro block based intra coding method and apparatus
WO2015194187A1 (en) Harmonized palette coding
US20130114687A1 (en) Fixed intra run-level mode for cavlc in hevc
EP2406953B1 (en) A method of compression of graphics images and videos
JP2013240081A (ja) ビデオ符号化および復号化のための方法および装置
JP2009027698A (ja) 画像フレームの非フレームエッジブロックの表現における改良された圧縮
US20130114684A1 (en) Electronic devices for selective run-level coding and decoding
US20130202201A1 (en) Image coding method and apparatus and image decoding method and apparatus, based on characteristics of regions of image
JP2009260494A (ja) 画像符号化装置及びその制御方法
CN112449201B (zh) 解码方法、编码方法、相应的装置、电子设备及存储介质
CN112449186B (zh) 编码方法、解码方法、相应的装置、电子设备及存储介质
US11706410B2 (en) Methods and systems for combined lossless and lossy coding
WO2023131221A2 (zh) 图像编解码的方法、装置及存储介质
JP4986906B2 (ja) 復号装置、復号方法、プログラム及び記録媒体
JP2006140967A (ja) 画像符号化装置及び方法、並びに、コンピュータプログラム及びコンピュータ可読記憶媒体
JP2011223462A (ja) 画像符号化装置及びその制御方法

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: 20770527

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20770527

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20770527

Country of ref document: EP

Kind code of ref document: A1