Encoding and decoding method, device and medium for color list

文档序号:1849958 发布日期:2021-11-16 浏览:26次 中文

阅读说明:本技术 一种颜色列表的编解码方法、装置及介质 (Encoding and decoding method, device and medium for color list ) 是由 梁凡 莫铭鸿 于 2021-08-10 设计创作,主要内容包括:本发明公开了一种颜色列表的编解码方法、装置及介质,方法包括:获取调色板中颜色列表的色彩空间,所述色彩空间包括颜色的亮度分量和颜色的色度分量,所述颜色的色度分量包括第一色度分量和第二色度分量;采用差分脉冲编码调制的方式对所述颜色列表的所述第一色度分量进行编码,得到第一编码结果;采用基于线性模型的跨分量线性预测方式对所述颜色列表中的所述亮度分量和所述第二色度分量进行编码,得到第二编码结果;对所述第一编码结果进行第一解码处理以及对所述第二编码结果进行第二解码处理,完成对所述颜色列表的编解码处理。本发明可以有效的减少编码所需的比特数。可广泛应用于视频编码技术领域。(The invention discloses a method, a device and a medium for encoding and decoding a color list, wherein the method comprises the following steps: obtaining a color space of a color list in a color palette, wherein the color space comprises a brightness component of a color and a chrominance component of the color, and the chrominance component of the color comprises a first chrominance component and a second chrominance component; coding the first chrominance component of the color list by adopting a differential pulse code modulation mode to obtain a first coding result; coding the brightness component and the second chrominance component in the color list by adopting a cross-component linear prediction mode based on a linear model to obtain a second coding result; and performing first decoding processing on the first encoding result and performing second decoding processing on the second encoding result to finish the encoding and decoding processing on the color list. The invention can effectively reduce the bit number required by coding. The method can be widely applied to the technical field of video coding.)

1. A method for encoding and decoding a color list, comprising:

obtaining a color space of a color list in a color palette, wherein the color space comprises a brightness component of a color and a chrominance component of the color, and the chrominance component of the color comprises a first chrominance component and a second chrominance component;

coding the first chrominance component of the color list by adopting a differential pulse code modulation mode to obtain a first coding result;

coding the brightness component and the second chrominance component in the color list by adopting a cross-component linear prediction mode based on a linear model to obtain a second coding result;

and performing first decoding processing on the first encoding result and performing second decoding processing on the second encoding result to finish the encoding and decoding processing on the color list.

2. The method as claimed in claim 1, wherein the encoding the first chrominance component of the color list by using differential pulse code modulation to obtain a first encoding result comprises:

ordering first chroma components in the color list;

binary coding the arranged first chrominance components by adopting the original bit depth;

calculating a component difference value between any two adjacent first chrominance components, and determining a maximum component difference value;

calculating the maximum coding bit number of the maximum component difference value;

and coding the residual first chrominance components according to the maximum coding bit number of the maximum component difference value to obtain the first coding result.

3. The method of claim 2, wherein the encoding the remaining first chrominance components according to the maximum encoding bit number of the maximum component difference value to obtain the first encoding result comprises:

when the maximum coding bit number is larger than a first threshold value, configuring a coding identifier as 0, coding the coding identifier by using 1 bit, then coding the residual first chroma component by adopting an original mode and finishing the coding stage of the first chroma component;

when the maximum coding bit number is smaller than a second threshold value, configuring the maximum coding bit number as the second threshold value;

calculating a first bit number required for encoding the remaining first chrominance components by using an original mode, calculating a second bit number required for encoding the remaining first chrominance components by using a DPCM mode, configuring the encoding identifier as 0 or 1 according to a comparison result between the first bit number and the second bit number, and encoding the remaining first chrominance components according to the encoding identifier.

4. The method of claim 3, wherein the configuring the coded identifier to be 0 or 1 according to the comparison result between the first bit number and the second bit number, and the encoding the remaining first chrominance components according to the coded identifier comprises:

when the first number of bits is less than or equal to the second number of bits, configuring the coded identifier to be 0; when the first bit number is larger than the second bit number, configuring the coded identifier as 1;

encoding the coded identifier using 1 bit;

when the coding identifier is 0, adopting an original mode to code the residual first chroma component and ending the coding stage of the first chroma component;

when the coding identifier is 1, coding the maximum coding bit number by using 3 bits, calculating a residual value of each first chroma component, and coding each residual value by using a plurality of bits of the maximum coding bit;

the encoding of the remaining first chrominance component in the original mode specifically includes: the remaining first chrominance components are binary coded using the original bit depth.

5. The method according to claim 1, wherein the encoding the luma component in the color list using a cross-component linear prediction based on a linear model comprises:

constructing a linear model of the luminance component;

determining a gradient parameter and an offset parameter in the linear model;

calculating the maximum brightness component difference value of the difference values between each brightness component and the linear prediction component according to the gradient parameter and the offset parameter;

calculating a third number of bits required to encode the maximum luminance component difference;

when the third bit number is larger than a third threshold value, configuring the coded identifier as 0; when the third number of bits is less than or equal to the third threshold, configuring the coded identifier to be 1;

when the coded identifier is 0, coding the coded identifier by 1 bit, then coding the residual brightness component by adopting an original mode and finishing the coding stage of the brightness component;

when the third bit number is smaller than a fourth threshold value, configuring the third bit number as a fourth threshold value;

calculating a fourth bit number required when the residual luminance component is encoded by using the original mode, and calculating a fifth bit number required when the residual luminance component is encoded by using the LM mode;

when the fourth bit number is less than or equal to the fifth bit number, configuring the coded identifier to be 0, otherwise to be 1;

encoding the coded identifier using 1 bit;

if the coding identifier is 0, adopting the original bit depth to code the residual brightness component and ending the coding stage of the brightness component;

if the coding identifier is not 0, the third number of bits is coded with 3 bits, the residual of each luminance component is calculated, then the sign bit of the residual of the luminance component is coded with 1 bit, and the absolute value of each residual is coded with the third number of bits.

6. The method according to claim 1, wherein said performing the first decoding process on the first encoding result comprises:

binary decoding the first chrominance component using the original bit depth;

decoding the coded identifier by 1 bit;

when the coded identifier is 0, decoding the residual first chrominance components by adopting the original bit depth and finishing the decoding stage of the first chrominance components;

when the coded identifier is 1, decoding by using 3 bits to obtain residual bit depth;

decoding the residual error of each first chrominance component according to the bit number of the bit depth of the residual error;

and obtaining the value of the residual first chrominance component according to the residual error of each first chrominance component.

7. The method as claimed in claim 5, wherein said performing the second decoding process on the second encoding result comprises:

decoding the coded identifier with 1 bit;

when the coded identifier is 0, decoding the residual luminance component by adopting the original bit depth and finishing the decoding stage of the luminance component;

when the coding identifier is not 0, establishing a linear model according to the color elements reused in the predictor to obtain a gradient parameter and an offset parameter;

decoding the residual bit depth with 3 bits;

determining a decoding bit of each luminance residual according to the residual bit depth, wherein 1 bit of the decoding bit of each luminance residual is used for decoding a sign bit, and the other bits are used for decoding an absolute value of the luminance residual;

and acquiring a brightness component according to the brightness residual error obtained by decoding.

8. An apparatus for encoding and decoding a color list, comprising:

a first module, configured to obtain a color space of a color list in a palette, where the color space includes a luminance component of a color and a chrominance component of the color, and the chrominance component of the color includes a first chrominance component and a second chrominance component;

a second module, configured to encode the first chrominance component of the color list in a differential pulse code modulation manner to obtain a first encoding result;

a third module, configured to encode the luminance component and the second chrominance component in the color list by using a cross-component linear prediction method based on a linear model, so as to obtain a second encoding result;

and the fourth module is used for performing first decoding processing on the first encoding result and performing second decoding processing on the second encoding result to finish the encoding and decoding processing on the color list.

9. An electronic device comprising a processor and a memory;

the memory is used for storing programs;

the processor executing the program realizes the method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that the storage medium stores a program, which is executed by a processor to implement the method according to any one of claims 1-7.

Technical Field

The present invention relates to the field of video coding technologies, and in particular, to a method, an apparatus, and a medium for encoding and decoding a color list.

Background

In the new generation of video compression standard, multifunctional video coding (VVC), developed by the ITU-T/ISO/IEC joint video experts group (jvt), screen content coding is one of its important target applications. While palette has been studied in HEVC as an efficient screen content compression tool, VVC further optimizes palette mode and adds it as a stand-alone mode to the standard. The VVC reference software formally adds a palette mode after the sixth version of VTM6 and requires that the mode be turned on when testing the SSC sequence.

In the VVC standard, when the palette mode is allowed to be used, a flag is transmitted for Coding Units (CUs) smaller than or equal to 64 × 64 and having more than 16 sample points to indicate whether to use the palette. A CU of palette mode is considered as another mode than intra, inter, IBC.

When using a palette, the sample values in a CU are represented using a typical set of color values, this set being called the palette. For pixel values that are close to the palette color, a color index is sent. For samples outside the palette (escape points) are identified and the quantized component values are transmitted directly.

To code the palette, a palette predictor is maintained, which starts at 0 at the beginning of a slice of the non-wavefront condition and at the beginning of a Coding Tree Unit (CTU) row of the wavefront condition. Each CU calls a predictor once when performing palette coding, and the predictor uses a reuse flag to indicate whether a color is part of the current palette, and the reuse flag uses 0 run coding. The number of colors and component values of the new palette (the part of the color list in the current CU palette that is not present in the predictor) are then encoded and transmitted. After the palette CU is encoded, the predictor uses the current palette update, and the colors of the palette predictor that were not multiplexed in the current palette are added to the end of the new predictor up to the maximum allowed. There is an escape flag in each CU, and if the escape flag is true, the palette color number is increased by 1, and the color is added at the end.

In the related art, the palette color component values are directly binarized and encoded using equal bit lengths, wherein the number of encoding bits required to encode each component value is the actual bit depth of the component.

As can be seen from the conventional palette color component encoding method, this method simply binarizes each color component value in the color list, and does not use redundancy removal by using information related to the color list, so that a large number of bits are consumed in encoding to encode unnecessary redundant information.

Disclosure of Invention

In view of the above, embodiments of the present invention provide a method, an apparatus, and a medium for encoding and decoding a color list, so as to effectively reduce the number of bits required for encoding.

One aspect of the present invention provides a method for encoding and decoding a color list, including:

obtaining a color space of a color list in a color palette, wherein the color space comprises a brightness component of a color and a chrominance component of the color, and the chrominance component of the color comprises a first chrominance component and a second chrominance component;

coding the first chrominance component of the color list by adopting a differential pulse code modulation mode to obtain a first coding result;

coding the brightness component and the second chrominance component in the color list by adopting a cross-component linear prediction mode based on a linear model to obtain a second coding result;

and performing first decoding processing on the first encoding result and performing second decoding processing on the second encoding result to finish the encoding and decoding processing on the color list.

Optionally, the encoding the first chrominance component of the color list in a differential pulse code modulation manner to obtain a first encoding result includes:

ordering first chroma components in the color list;

binary coding the arranged first chrominance components by adopting the original bit depth;

calculating a component difference value between any two adjacent first chrominance components, and determining a maximum component difference value;

calculating the maximum coding bit number of the maximum component difference value;

and coding the residual first chrominance components according to the maximum coding bit number of the maximum component difference value to obtain the first coding result.

Optionally, the encoding the remaining first chrominance components according to the maximum encoding bit number of the maximum component difference to obtain the first encoding result includes:

when the maximum coding bit number is larger than a first threshold value, configuring a coding identifier as 0, coding the coding identifier by using 1 bit, then coding the residual first chroma component by adopting an original mode and finishing the coding stage of the first chroma component;

when the maximum coding bit number is smaller than a second threshold value, configuring the maximum coding bit number as the second threshold value;

calculating a first bit number required for encoding the remaining first chrominance components by using an original mode, calculating a second bit number required for encoding the remaining first chrominance components by using a DPCM mode, configuring the encoding identifier as 0 or 1 according to a comparison result between the first bit number and the second bit number, and encoding the remaining first chrominance components according to the encoding identifier.

Optionally, the configuring the coding identifier to be 0 or 1 according to the comparison result between the first bit number and the second bit number, and coding the remaining first chrominance components according to the coding identifier includes:

when the first number of bits is less than or equal to the second number of bits, configuring the coded identifier to be 0; when the first bit number is larger than the second bit number, configuring the coded identifier as 1;

encoding the coded identifier using 1 bit;

when the coding identifier is 0, adopting an original mode to code the residual first chroma component and ending the coding stage of the first chroma component;

when the coding identifier is 1, coding the maximum coding bit number by using 3 bits, calculating a residual value of each first chroma component, and then coding each residual value by using a plurality of bits of the maximum coding bit;

the encoding of the remaining first chrominance component in the original mode specifically includes: the remaining first chrominance components are binary coded using the original bit depth.

Optionally, the encoding the luminance component in the color list by using a cross-component linear prediction method based on a linear model includes:

constructing a linear model of the luminance component;

determining a gradient parameter and an offset parameter in the linear model;

calculating the maximum brightness component difference value of the difference values between each brightness component and the linear prediction component according to the gradient parameter and the offset parameter;

calculating a third number of bits required to encode the maximum luminance component difference;

when the third bit number is larger than a third threshold value, configuring the coded identifier as 0; when the third number of bits is less than or equal to the third threshold, configuring the coded identifier to be 1;

when the coded identifier is 0, coding the coded identifier by 1 bit, then coding the residual brightness component by adopting an original mode and finishing the coding stage of the brightness component;

when the third bit number is smaller than a fourth threshold value, configuring the third bit number as a fourth threshold value;

calculating a fourth bit number required when the residual luminance component is encoded by using the original mode, and calculating a fifth bit number required when the residual luminance component is encoded by using the LM mode;

when the fourth bit number is less than or equal to the fifth bit number, configuring the coded identifier to be 0, otherwise to be 1;

encoding the coded identifier using 1 bit;

if the coding identifier is 0, adopting the original bit depth to code the residual brightness component and ending the coding stage of the brightness component;

if the coding identifier is not 0, the third number of bits is coded with 3 bits, the residual of each luminance component is calculated, then the sign bit of the residual of the luminance component is coded with 1 bit, and the absolute value of each residual is coded with the third number of bits.

Optionally, the performing a first decoding process on the first encoding result includes:

binary decoding the first chrominance component using the original bit depth;

decoding the coded identifier by 1 bit;

when the coded identifier is 0, decoding the residual first chrominance components by adopting the original bit depth and finishing the decoding stage of the first chrominance components;

when the coded identifier is 1, decoding by using 3 bits to obtain residual bit depth;

decoding the residual error of each first chrominance component according to the bit number of the bit depth of the residual error;

and obtaining the value of the residual first chrominance component according to the residual error of each first chrominance component.

Optionally, the performing a second decoding process on the second encoding result includes:

decoding the coded identifier with 1 bit;

when the coded identifier is 0, decoding the residual luminance component by adopting the original bit depth and finishing the decoding stage of the luminance component;

when the coding identifier is not 0, establishing a linear model according to the color elements reused in the predictor to obtain a gradient parameter and an offset parameter;

decoding the residual bit depth with 3 bits;

determining a decoding bit of each luminance residual according to the residual bit depth, wherein 1 bit of the decoding bit of each luminance residual is used for decoding a sign bit, and the other bits are used for decoding an absolute value of the luminance residual;

and acquiring a brightness component according to the brightness residual error obtained by decoding.

Another aspect of the embodiments of the present invention provides an encoding and decoding apparatus for a color list, including:

a first module, configured to obtain a color space of a color list in a palette, where the color space includes a luminance component of a color and a chrominance component of the color, and the chrominance component of the color includes a first chrominance component and a second chrominance component;

a second module, configured to encode the first chrominance component of the color list in a differential pulse code modulation manner to obtain a first encoding result;

a third module, configured to encode the luminance component and the second chrominance component in the color list by using a cross-component linear prediction method based on a linear model, so as to obtain a second encoding result;

and the fourth module is used for performing first decoding processing on the first encoding result and performing second decoding processing on the second encoding result to finish the encoding and decoding processing on the color list.

Another aspect of the embodiments of the present invention provides an electronic device, including a processor and a memory;

the memory is used for storing programs;

the processor executes the program to implement the method as described above.

Another aspect of the embodiments of the present invention provides a computer-readable storage medium storing a program, the program being executed by a processor to implement the method as described above.

The embodiment of the invention also discloses a computer program product or a computer program, which comprises computer instructions, and the computer instructions are stored in a computer readable storage medium. The computer instructions may be read by a processor of a computer device from a computer-readable storage medium, and the computer instructions executed by the processor cause the computer device to perform the foregoing method.

The method includes the steps that a color space of a color list in a palette is obtained, the color space comprises a brightness component of a color and a chroma component of the color, and the chroma component of the color comprises a first chroma component and a second chroma component; coding the first chrominance component of the color list by adopting a differential pulse code modulation mode to obtain a first coding result; coding the brightness component and the second chrominance component in the color list by adopting a cross-component linear prediction mode based on a linear model to obtain a second coding result; and performing first decoding processing on the first encoding result and performing second decoding processing on the second encoding result to finish the encoding and decoding processing on the color list. The invention can predict the actual component values in the color list by utilizing the similar information between the same components and between different components, and then encode the difference value between the predicted value and the actual value, and the amplitude of the difference value is usually much smaller than the original true value, so the bit number required by encoding can be effectively reduced.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

FIG. 1 is a flowchart illustrating the overall steps of an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

To solve the problems in the prior art, an embodiment of the present invention provides a method for encoding and decoding a color list, and referring to fig. 1, the method of the present invention includes:

obtaining a color space of a color list in a color palette, wherein the color space comprises a brightness component of a color and a chrominance component of the color, and the chrominance component of the color comprises a first chrominance component and a second chrominance component;

coding the first chrominance component of the color list by adopting a differential pulse code modulation mode to obtain a first coding result;

coding the brightness component and the second chrominance component in the color list by adopting a cross-component linear prediction mode based on a linear model to obtain a second coding result;

and performing first decoding processing on the first encoding result and performing second decoding processing on the second encoding result to finish the encoding and decoding processing on the color list.

Optionally, the encoding the first chrominance component of the color list in a differential pulse code modulation manner to obtain a first encoding result includes:

ordering first chroma components in the color list;

binary coding the arranged first chrominance components by adopting the original bit depth;

calculating a component difference value between any two adjacent first chrominance components, and determining a maximum component difference value;

calculating the maximum coding bit number of the maximum component difference value;

and coding the residual first chrominance components according to the maximum coding bit number of the maximum component difference value to obtain the first coding result.

Optionally, the encoding the remaining first chrominance components according to the maximum encoding bit number of the maximum component difference to obtain the first encoding result includes:

when the maximum coding bit number is larger than a first threshold value, configuring a coding identifier as 0, coding the coding identifier by using 1 bit, then coding the residual first chroma component by adopting an original mode and finishing the coding stage of the first chroma component;

when the maximum coding bit number is smaller than a second threshold value, configuring the maximum coding bit number as the second threshold value;

calculating a first bit number required for encoding the remaining first chrominance components by using an original mode, calculating a second bit number required for encoding the remaining first chrominance components by using a DPCM mode, configuring the encoding identifier as 0 or 1 according to a comparison result between the first bit number and the second bit number, and encoding the remaining first chrominance components according to the encoding identifier.

Optionally, the configuring the coding identifier to be 0 or 1 according to the comparison result between the first bit number and the second bit number, and coding the remaining first chrominance components according to the coding identifier includes:

when the first number of bits is less than or equal to the second number of bits, configuring the coded identifier to be 0; when the first bit number is larger than the second bit number, configuring the coded identifier as 1;

encoding the coded identifier using 1 bit;

when the coding identifier is 0, adopting an original mode to code the residual first chroma component and ending the coding stage of the first chroma component;

when the coding identifier is 1, coding the maximum coding bit number by using 3 bits, calculating a residual value of each first chroma component, and then coding each residual value by using a plurality of bits of the maximum coding bit;

the encoding of the remaining first chrominance component in the original mode specifically includes: the remaining first chrominance components are binary coded using the original bit depth.

Optionally, the encoding the luminance component in the color list by using a cross-component linear prediction method based on a linear model includes:

constructing a linear model of the luminance component;

determining a gradient parameter and an offset parameter in the linear model;

calculating the maximum brightness component difference value of the difference values between each brightness component and the linear prediction component according to the gradient parameter and the offset parameter;

calculating a third number of bits required to encode the maximum luminance component difference;

when the third bit number is larger than a third threshold value, configuring the coded identifier as 0; when the third number of bits is less than or equal to the third threshold, configuring the coded identifier to be 1;

when the coded identifier is 0, coding the coded identifier by 1 bit, then coding the residual brightness component by adopting an original mode and finishing the coding stage of the brightness component;

when the third bit number is smaller than a fourth threshold value, configuring the third bit number as a fourth threshold value;

calculating a fourth bit number required when the residual luminance component is encoded by using the original mode, and calculating a fifth bit number required when the residual luminance component is encoded by using the LM mode;

when the fourth bit number is less than or equal to the fifth bit number, configuring the coded identifier to be 0, otherwise to be 1;

encoding the coded identifier using 1 bit;

if the coding identifier is 0, adopting the original bit depth to code the residual brightness component and ending the coding stage of the brightness component;

if the coding identifier is not 0, the third number of bits is coded with 3 bits, the residual of each luminance component is calculated, then the sign bit of the residual of the luminance component is coded with 1 bit, and the absolute value of each residual is coded with the third number of bits.

Optionally, the performing a first decoding process on the first encoding result includes:

binary decoding the first chrominance component using the original bit depth;

decoding the coded identifier by 1 bit;

when the coded identifier is 0, decoding the residual first chrominance components by adopting the original bit depth and finishing the decoding stage of the first chrominance components;

when the coded identifier is 1, decoding by using 3 bits to obtain residual bit depth;

decoding the residual error of each first chrominance component according to the bit number of the bit depth of the residual error;

and obtaining the value of the residual first chrominance component according to the residual error of each first chrominance component.

Optionally, the performing a second decoding process on the second encoding result includes:

decoding the coded identifier with 1 bit;

when the coded identifier is 0, decoding the residual luminance component by adopting the original bit depth and finishing the decoding stage of the luminance component;

when the coding identifier is not 0, establishing a linear model according to the color elements reused in the predictor to obtain a gradient parameter and an offset parameter;

decoding the residual bit depth with 3 bits;

determining a decoding bit of each luminance residual according to the residual bit depth, wherein 1 bit of the decoding bit of each luminance residual is used for decoding a sign bit, and the other bits are used for decoding an absolute value of the luminance residual;

and acquiring a brightness component according to the brightness residual error obtained by decoding.

Another aspect of the embodiments of the present invention provides an encoding and decoding apparatus for a color list, including:

a first module, configured to obtain a color space of a color list in a palette, where the color space includes a luminance component of a color and a chrominance component of the color, and the chrominance component of the color includes a first chrominance component and a second chrominance component;

a second module, configured to encode the first chrominance component of the color list in a differential pulse code modulation manner to obtain a first encoding result;

a third module, configured to encode the luminance component and the second chrominance component in the color list by using a cross-component linear prediction method based on a linear model, so as to obtain a second encoding result;

and the fourth module is used for performing first decoding processing on the first encoding result and performing second decoding processing on the second encoding result to finish the encoding and decoding processing on the color list.

Another aspect of the embodiments of the present invention provides an electronic device, including a processor and a memory;

the memory is used for storing programs;

the processor executes the program to implement the method as described above.

Another aspect of the embodiments of the present invention provides a computer-readable storage medium storing a program, the program being executed by a processor to implement the method as described above.

The embodiment of the invention also discloses a computer program product or a computer program, which comprises computer instructions, and the computer instructions are stored in a computer readable storage medium. The computer instructions may be read by a processor of a computer device from a computer-readable storage medium, and the computer instructions executed by the processor cause the computer device to perform the foregoing method.

The implementation principle of the encoding and decoding method of the present invention is described in detail below:

as can be seen from the conventional palette color component encoding method, the conventional method simply binarizes each color component value in the color list, and does not use redundancy removal by using information related to the color list, so that a large number of bits are consumed for encoding unnecessary redundant information. Based on the defects, the invention provides a color list coding optimization algorithm based on differential pulse code modulation and linear prediction. The proposed algorithm will use the similarity information between the same components and between different components to predict the actual component values in the color list and then encode the difference between the predicted and actual values. Since the magnitude of the difference is often much smaller than the original true value, the number of bits required for encoding can be effectively reduced.

It should be noted that, in the present invention, the color of the palette is represented by a color space in the format of Y, Cb, and Cr, where Y is a luminance (luma) component of the color, and Cb and Cr are two chrominance components, where Cr is a first chrominance component and Cb is a second chrominance component.

Firstly, the present invention encodes one of the chrominance components (where the Cr component, i.e. the first chrominance component, is selected without loss of generality) in the color list in a manner based on differential pulse code modulation.

The specific implementation steps of the encoding end comprise (1) to (13):

(1) the color list is rearranged from small to large based on the Cr component.

(2) The first Cr component is directly binary encoded with the original bit depth.

(3) The maximum value of the Cr component difference (i.e., the maximum component difference) is calculated. The calculation method comprises the following steps:

max (maxCr, Cr [ i ] -ci-1), (1 < i ≦ length), where length is the list length and Cr [ i ] represents the ith Cr component; max (val1, val2) represents the maximum value of val1 and val2, and maxCr is the maximum value of the calculated Cr component difference.

(4) The number of bits required to encode the maximum Cr component difference, respitdepthcr (i.e., the maximum number of coded bits) is calculated. The calculation method comprises the following steps: and shifting maxCr to the right until maxCr becomes 0, so that the number of right shifts is the number of bits ResBitDepthCr required for encoding the maximum Cr component difference. For example: if maxCr is 6, its binary representation is 110, and it becomes 0 after shifting it to the right by 3 bits, so ResBitDepthCr is 3.

(5) If ResBitDepthCr >9, (the judgment threshold value "9" is the first threshold value), setting use _ DPCM _ flag (namely the coding identifier) to 0, coding use _ DPCM _ flag by using 1 bit, then coding the rest Cr components by adopting the original mode and finishing the coding stage of the Cr components; otherwise, the following operations are continued.

The original encoding method mentioned in the present invention refers to: in the VVC, the original color list encoding method, i.e. according to the original bit depth, directly performs binarization processing on the color components, for example: if the original bit depth is 10 and a color component x is 256, x is encoded as 0100000000.

(6) If ResBitDepthCr is less than 2, ResBitDepthCr is 2 (the determination threshold "2" is the second threshold).

(7) Calculating the bit number cost needed by the encoding by using the original encoding modeorig(i.e., first number of bits), costorigLength × OrigBitDepthCr. Where length is the length of the color list and OrigBitDepthCr is the original bit depth of the Cr component.

(8) Calculating the bit number cost required for coding by using DPCM modeDPCM(i.e., second number of bits), costDPCM=length*ResBitDepthCr+3。

(9) Comparison costorigAnd costDPCMIf costorig≤costDPCMThe identifier use _ DPCM _ flag is set to 0, and the negative use _ DPCM _ flag is set to 1.

(10) Use _ DPCM _ flag is encoded using 1 bit.

(11) If use _ DPCM _ flag is 0, the residual Cr component is coded according to the original bit depth, and the coding stage of the Cr component is ended. Otherwise, the following steps are performed.

(12) ResBitDepthCr is encoded with 3 bits (note: the ResBitDepthCr of the present invention ranges from 2 to 9 according to the previous threshold decision step, so this step requires 3 bits to encode).

(13) Calculating residual ResCr of each Cr componenti,ResCri=Cri-Cri-1(1 < i ≦ length), and encoding each ResCr with ResBitDepthCr bitsi

The specific implementation steps (i.e., the first decoding processing stage) of the decoding end corresponding to this stage include the following (1) to (6):

(1) the first Cr component is binary decoded with the original bit depth.

(2) Use _ DPCM _ flag is decoded with 1 bit.

(3) If use _ DPCM _ flag is 0, decoding the residual Cr component according to the original bit depth, and ending the decoding stage of the Cr component. Otherwise, the following steps are performed.

(4) Decoding with 3 bits results in a residual bit depth ResBitDepthCr.

(5) Decoding each Cr residual ResCr with ResBitDepthCr bitsi

(6) Obtaining the other Cr component values Cri,Cri=ResCri+Cri-1(i is more than 1 and less than or equal to length). The remaining Cr component values herein refer to Cr components other than the first one.

Secondly, the present invention encodes the luminance component and another chrominance component (Cb component for non-loss of generality) in the color list by using a cross-component linear prediction method based on a linear model.

The linear model is constructed as shown in equations (1) to (4).

In the above formula, Y' [ n ]]、Cb′[n]And Cr' [ n ]]Three color components in the reuse color list, N is the length of the reuse color list, aYAnd bYGradient and offset, respectively, in the Cr-Y linear model, aCbAnd bCbRespectively, a gradient parameter and a migration parameter in the Cr-Cb linear model.

Note: only the encoding/decoding process of the luminance component (i.e., Y component) is described below, wherein the encoding/decoding process of the second chrominance component (Cb component) is similar to the Y component, and thus will not be described herein again.

The specific implementation steps of the encoding end are as follows:

(1) a Cr-Y linear model is built based on the reused color elements in the predictor, and is constructed in the manner shown in equations (1) - (4) above. Thereby obtaining a parameter aYAnd bY

(2) The maximum value of the difference between each Y component and the linear prediction Y component (referred to as the maximum luminance component difference for short) is calculated.

The calculation method comprises the following steps: max (maxY, Y)i-(aY*Cr+bY) (1 ≦ i ≦ length), where length is the list length, max (val1, val2) represents the maximum of val1 and val2, and maxY is the maximum luminance component difference value that is found.

(3) Calculating the number of bits ResBitDepth needed to encode the maximum luma component differenceY(i.e., the third number of bits).

The calculation method comprises the following steps: and shifting maxY to the right until maxY becomes 0, then the number of right shifts is the number of bits ResBitDepthY needed to encode the maximum Y component difference. For example: if maxY is 6, its binary representation is 110, which becomes 0 after shifting it to the right by 3 bits, so ResBitDepthY is 3.

(4) If ResBitDepthY >8, (wherein the judgment threshold value "8" here is the third threshold value), use _ LM _ Y _ flag is set to 0, otherwise, use _ LM _ Y _ flag is set to 1, and then use _ LM _ Y _ flag is encoded by using 1 bit.

(5) And if the use _ LM _ Y _ flag is 0, coding the Y component according to the original method, and finishing the coding process of the Y component. Otherwise, the following steps are continued.

(6) If ResBitDepthY is less than 1, ResBitDepthY is equal to 1 (the determination threshold "1" is a fourth threshold).

(7) Calculating the bit number cost needed by the encoding by using the original encoding modeorigY(i.e., fourth number of bits), costorigYLength × OrigBitDepthY. Where length is the length of the color list and OrigBitDepthY is the original bit depth of the Y component.

(8) Calculating miningBit number cost required for coding in LM modeLMY(i.e., the fifth number of bits), costLMY=length*ResBitDepthY+4。

(9) Comparison costorigYAnd costLMYIf costorigY≤costLMYThe identifier use _ LM _ Y _ flag is set to 0, and the negative use _ LM _ Y _ flag is set to 1.

(10) Use _ LM _ Y _ flag is encoded using 1 bit.

(11) If use _ LM _ Y _ flag is 0, the remaining Y component is encoded according to the original bit depth, and the Y component encoding stage is ended. Otherwise, the following steps are continued.

(12) ResBitDepthY is encoded with 3 bits (note: ResBitDepthY ranges from 1 to 8, so 3 bits are needed for encoding).

(13) Computing the residual ResY of each Y componenti,ResYi=Yi-(aY*Cr+bY) (1 ≦ i ≦ length), then the sign bit is encoded with 1 bit and each ResY bit is encoded with ResBitDepthY bitsiAbsolute value of (a).

In addition, the specific implementation steps (i.e. the second decoding processing stage) of the decoding end at this stage of the present invention include the following steps (1) to (6):

(1) use _ LM _ Y _ flag is decoded with 1 bit.

(2) And if the use _ LM _ Y _ flag is 0, decoding the Y component according to the original bit depth, and finishing the decoding stage of the Y component. Otherwise, the following steps are continued.

(3) And establishing a Cr-Y linear model according to the reused color elements in the predictor, wherein the model is constructed in a way shown in formulas (1) to (4). Thereby obtaining a parameter aYAnd bY

(4) The residual bit depth ResBitDepthY is decoded with 3 bits.

(5) Resy for each luminance residuali(ResBitDepthY +1) bits are used for decoding, where 1 bit is used for decoding the sign bit and the else bitdepthy bits are used for decoding the absolute value of ResY.

(6) Obtaining Y component value Yi,Yi=ResYi+(aY*Cr+bY),(1≤i≤length)。

In summary, the present invention provides a color list coding optimization method based on differential pulse code modulation and linear prediction. The proposed method uses the similarity information between the same components and between different components to predict the actual component values in the color list and then encodes the difference between the predicted and actual values. Since the magnitude of the difference is usually much smaller than the original true value, the number of bits required for encoding can be effectively reduced.

In alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flow charts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are performed independently.

Furthermore, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise stated to the contrary, one or more of the described functions and/or features may be integrated in a single physical device and/or software module, or one or more functions and/or features may be implemented in a separate physical device or software module. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary for an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be understood within the ordinary skill of an engineer, given the nature, function, and internal relationship of the modules. Accordingly, those skilled in the art can, using ordinary skill, practice the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative of and not intended to limit the scope of the invention, which is defined by the appended claims and their full scope of equivalents.

The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.

More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.

It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.

In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

While embodiments of the invention have been shown and described, it will be understood by those of ordinary skill in the art that: various changes, modifications, substitutions and alterations can be made to the embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.

While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种实时多路H.265视频实时解压显示的方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类