CN117676132A - Mode decision method and device for chroma residual coding - Google Patents

Mode decision method and device for chroma residual coding Download PDF

Info

Publication number
CN117676132A
CN117676132A CN202311638899.5A CN202311638899A CN117676132A CN 117676132 A CN117676132 A CN 117676132A CN 202311638899 A CN202311638899 A CN 202311638899A CN 117676132 A CN117676132 A CN 117676132A
Authority
CN
China
Prior art keywords
mode
pixel image
decision
original pixel
coding
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202311638899.5A
Other languages
Chinese (zh)
Inventor
黄兆相
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiamen Yealink Network Technology Co Ltd
Original Assignee
Xiamen Yealink Network Technology Co Ltd
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 Xiamen Yealink Network Technology Co Ltd filed Critical Xiamen Yealink Network Technology Co Ltd
Priority to CN202311638899.5A priority Critical patent/CN117676132A/en
Publication of CN117676132A publication Critical patent/CN117676132A/en
Pending legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention discloses a mode decision method and a device for coding a chromaticity residual, wherein the method comprises the following steps: residual processing and dividing are carried out on the original pixel image and a preset target pixel image to obtain sub-blocks; according to the sub-block calculation, obtaining the coding distortion measure of the image and SATD values in all modes, firstly, determining a skip mode or a zero mode as an optimal decision mode according to the coding distortion measure in sequence, and then determining the skip mode, the zero mode or a macro block decision mode as the optimal decision mode according to the SATD values; and encoding the target object according to the optimal decision mode to obtain an encoding result. The invention provides a mode decision method and a mode decision device for coding a chromaticity residual error, which can select an optimal decision mode to code a target object and obtain a coding result by comparing coding distortion measure and SATD value, and can solve the problem of high coding complexity caused by coding in an original mode in an original pixel image when the original pixel image is coded.

Description

Mode decision method and device for chroma residual coding
Technical Field
The invention relates to the technical field of video coding and compression, in particular to a mode decision method and device for chroma residual coding.
Background
For processing high-quality images and videos, in order to solve the limitation of YUV420 on color sampling, video formats with higher sampling rates, such as YUV422 and YUV444, are currently selected in the field of video coding. Compared with YUV420, YUV422 and YUV444 have higher chroma sampling rate, which means that each brightness sample in YUV444 is accompanied by a corresponding chroma sample, so that the original color information in images and videos can be captured more accurately, the quality of the images and videos is improved, and with the development of digital videos and image applications, the wide application of YUV444 becomes a trend.
However, from the aspect of complexity of coded chrominance information, YUV422 is 2 times of YUV420, YUV444 is 4 times of YUV420, and under the condition that the amount of chrominance information is multiplied, if original mode in YUV420 is still adopted for coding, the complexity of coding can be correspondingly improved, and the performance of a decoding terminal is also extremely high.
Disclosure of Invention
The invention provides a mode decision method and a mode decision device for coding a chromaticity residual, which are used for solving the problem of high coding complexity caused by coding an original mode in an original pixel image when the original pixel image is coded.
In order to solve the above problems, the present invention provides a mode decision method for chroma residual coding, comprising:
acquiring an original pixel image, and carrying out residual processing on the original pixel image and a preset target pixel image to obtain a UV residual image;
dividing the UV residual image according to the dividing mode of the original pixel image to obtain divided sub-blocks;
calculating to obtain coding distortion measure of the image according to the dividing data of the sub-blocks, and sequentially judging whether the coding distortion measure meets the preset conditions of a skip mode and a zero mode;
if the coding distortion measure is determined to meet the skip mode or the zero mode, selecting a corresponding mode as an optimal decision mode;
if the skip mode, the zero mode and the SATD value under the macro block decision mode are not met, respectively calculating the SATD values to obtain a plurality of SATD values, and taking the mode with the minimum SATD value as the optimal decision mode; the skip mode and the zero mode are modes capable of directly encoding the target pixel image, and the macro block decision mode is acquired through the encoding condition of the original pixel image;
and encoding the original pixel image and the UV residual image according to the optimal decision mode to obtain an encoding result.
According to the invention, the original pixel image and the target pixel image are subjected to residual processing so as to establish the connection between the original pixel image and the target pixel image, and the UV residual image is obtained, so that the optimal decision mode can be selected and obtained on the basis of the UV residual image. By comparing the coding distortion measures to preferentially select the skip mode or the zero mode as the optimal decision mode, the coding efficiency can be improved and the coding complexity can be reduced based on the property that the skip mode and the zero mode can directly code the original pixel image. In addition, the SATD value is a measure of the size of the video residual signal, and the value can reflect the size of the generated code stream to a certain extent, so that the scheme can select the corresponding skip mode, zero mode or macro block decision mode as the optimal decision mode by comparing the SATD values in different modes, and finally, the decision mode is used for encoding the target object, thus obtaining the encoding result. Compared with the prior art, the method and the device have the advantages that the corresponding skip mode, zero mode or macro block decision mode can be selected as the optimal decision mode to code through comparing the coding distortion measure and the SATD value, the constraint of the original coding mode is overcome, the optimal decision mode is obtained on the basis of the UV residual image to code, and the problem that when the original pixel image is coded, the original mode in the original pixel image is used for coding, so that the coding complexity is high can be solved.
Preferably, if it is determined that the coding distortion measure meets the skip mode or the zero mode, the corresponding mode is selected as the best decision mode, specifically:
if the coding distortion measure is determined to meet a first preset formula, selecting the skip mode as an optimal decision mode;
if the coding distortion measure does not meet the first preset formula, judging whether the coding distortion measure meets a second preset formula, and if the coding distortion measure meets the second preset formula, selecting the zero mode as an optimal decision mode;
the coding distortion measure comprises an initial SATD value, an SSD value and a pixel number value, wherein the absolute value of a chrominance difference value in the sub-block exceeds a preset threshold value, and the initial SATD value, the SSD value and the pixel number value are calculated according to the dividing data of the sub-block.
The coding distortion measure in the preferred embodiment includes an initial SATD value, an SSD value, and a pixel number value of the sub-block, where the absolute value of the chrominance difference value exceeds a preset threshold, and these data can comprehensively reflect the size of the code stream generated by the original pixel image, the degree of association between the two variables of the original pixel image and the target pixel image, and the degree of slowing down the processing speed of the image when the pixel number exceeds the preset threshold, so that a suitable decision mode can be selected by determining whether these data satisfy the first preset formula or the second preset formula.
As a preferred scheme, if neither of the skip mode, the zero mode and the macro block decision mode is determined to be satisfied, respectively calculating SATD values in the skip mode, the zero mode and the macro block decision mode to obtain a plurality of SATD values, and taking a mode with the minimum SATD value as an optimal decision mode, specifically:
if the coding distortion measure does not meet the preset conditions of the skip mode and the zero mode, calculating SATD values in the skip mode, the zero mode and the macro block decision mode respectively to obtain a first SATD value, a second SATD value and a third SATD value;
if the first SATD value is determined to be smaller than the second SATD value and the third SATD value, or the second SATD value and the third SATD value exceed preset values, selecting the macroblock decision mode as the optimal decision mode;
otherwise, selecting the skip mode or the zero mode as the optimal decision mode.
The SATD value in the preferred scheme refers to the sum of absolute values of prediction residues obtained by carrying out Hardman transform on residues dividing the sub-block under different modes, so that the SATD value is a measure of the size of a video residual signal, can be regarded as simple time-frequency transform, and can reflect the size of a generated code stream to a certain extent, so that the scheme can take a corresponding macro block decision mode, skip mode or zero mode as a decision mode by comparing and selecting smaller SATD values under different conditions or SATD values meeting preset standards.
Preferably, the skip mode or the zero mode is selected as the optimal decision mode, specifically:
if the second SATD value is determined to be greater than the third SATD value, selecting the skip mode as the optimal decision mode;
and if the second SATD value is smaller than the third SATD value, selecting the zero mode as the optimal decision mode.
The preferred scheme reflects the situation when the first SATD value is greater than the second SATD value, the first SATD value is greater than the third SATD value, the second SATD value does not exceed a preset number, or the third SATD value does not exceed the preset number; since the SATD value can reflect the size of the generated code stream, the scheme can select the skip mode or the zero mode corresponding to the smaller SATD value as the decision mode by comparing the sizes of the second SATD value and the third SATD value.
As a preferred scheme, residual processing is performed on the original pixel image and a preset target pixel image to obtain a UV residual image, which specifically includes:
downsampling the original pixel image to the target pixel image, and performing coding reconstruction and upsampling on the target pixel image to obtain an upsampled original pixel image;
performing residual processing on the original pixel image and the up-sampled original pixel image according to an initial preset formula to obtain a UV residual image;
The initial preset formula is:
wherein u is ori For the original pixel image, u 1 And (3) performing coding reconstruction and upsampling on the target pixel image to obtain an original pixel image, wherein u' is the UV residual image.
According to the optimal scheme, residual processing is carried out on an original pixel image and the sampled original pixel image through a preset formula to obtain a UV residual image, so that an optimal decision mode can be selected and obtained on the basis of the UV residual image.
As a preferred solution, the original pixel image and the UV residual image are encoded according to the optimal decision mode, so as to obtain an encoding result, specifically:
if the optimal decision mode is determined to be the skip mode, encoding the original pixel image according to the skip mode to obtain an encoding result;
if the optimal decision mode is determined to be the zero mode, encoding the original pixel image according to the zero mode to obtain an encoding result;
and if the optimal decision mode is determined to be the macro block decision mode, encoding the original pixel image and the UV residual image according to the macro block decision mode to obtain an encoding result.
In the preferred scheme, different optimal decision modes are selected, different coding objects exist, when the optimal decision mode is a skip mode or a zero mode, only the original pixel image is needed to be coded, and when the optimal decision mode is a macro block decision mode, the original pixel image and the UV residual image are needed to be coded together; because the skip mode and the zero mode can be regarded as special merging modes (Merge modes), the skip mode and the zero mode are utilized to carry out inter-prediction on the PU, only the use index of the motion information of the adjacent block is needed to be encoded, and the prediction residual information is not needed to be encoded, therefore, the encoding result can be obtained by only encoding the original pixel image during encoding, and the two preferable modes can accelerate the encoding process and improve the encoding efficiency.
As a preferred solution, the macroblock decision mode is obtained by the encoding condition of the original pixel image, specifically:
and acquiring the macro block decision mode of the original pixel image from a code stream or a code function interface of the original pixel image.
The preferred scheme provides a plurality of modes for acquiring the macro block decision mode, can directly acquire the division mode and the mode selection from the code stream of the original pixel image, and can also directly acquire the mode from the code function interface, and the data acquisition mode is simple and quick and does not need to carry out any processing on the acquired data.
As a preferred solution, the skip mode and the zero mode specifically are:
the skip mode is to fill the pixel values of the original pixel image according to the macro block pixel values of the target pixel image;
the zero mode is to fill the pixel values of the original pixel image according to 128 pixel values.
In the preferred scheme, the skip mode is to directly fill the pixel value of the reference macro block (target pixel image) into the current block (original pixel image), which is equivalent to that the corresponding pixel is consistent with the reference frame; the zero mode is to directly fill the current block (original pixel image) with 128 pixel values in order to reduce complexity and code rate, which is equivalent to replacing a whole frame with 128 pixel values; both decision modes do not consider the problem of encoding the UV residual image, so that the encoding efficiency can be improved when the two modes are finally used for encoding.
As a preferable solution, the target pixel image specifically includes:
the target pixel image is downsampled from the original pixel image.
The invention also provides a mode decision device for chroma residual coding, which comprises a preprocessing module, a dividing module, a judging module, a first decision module, a second decision module and a coding module;
The preprocessing module is used for acquiring an original pixel image, and carrying out residual processing on the original pixel image and a preset target pixel image to obtain a UV residual image;
the dividing module is used for dividing the UV residual image according to the dividing mode of the original pixel image to obtain divided sub-blocks;
the judging module is used for calculating the coding distortion measure of the image according to the division data of the sub-blocks and judging whether the coding distortion measure meets the preset conditions of a skip mode and a zero mode or not in sequence;
the first decision module is configured to select a corresponding mode as an optimal decision mode if it is determined that the coding distortion measure meets the skip mode or the zero mode;
the second decision module is configured to calculate SATD values in the skip mode, the zero mode, and the macro block decision mode, respectively, if neither of the two decision modules is satisfied, to obtain a plurality of SATD values, and take a mode with a minimum SATD value as an optimal decision mode; the skip mode and the zero mode are modes capable of directly encoding the target pixel image, and the macro block decision mode is acquired through the encoding condition of the original pixel image;
And the encoding module is used for encoding the original pixel image and the UV residual image according to the optimal decision mode to obtain an encoding result.
Preferably, the first decision module includes a mode first determination unit;
the mode first determining unit is configured to select the skip mode as an optimal decision mode if it is determined that the coding distortion measure meets a first preset level;
and the method is further used for judging whether the coding distortion measure meets a second preset formula or not if the coding distortion measure does not meet the first preset formula, and selecting the zero mode as an optimal decision mode if the coding distortion measure meets the second preset formula;
the coding distortion measure comprises an initial SATD value, an SSD value and a pixel number value, wherein the absolute value of a chrominance difference value in the sub-block exceeds a preset threshold value, and the initial SATD value, the SSD value and the pixel number value are calculated according to the dividing data of the sub-block.
Preferably, the second decision module includes a mode second determination unit;
the mode second determining unit is configured to calculate SATD values in the skip mode, the zero mode, and the macroblock decision mode, respectively, if it is determined that the coding distortion measure does not meet the preset conditions of the skip mode and the zero mode, to obtain a first SATD value, a second SATD value, and a third SATD value;
And if it is determined that the first SATD value is smaller than the second SATD value and the third SATD value, or the second SATD value and the third SATD value both exceed a preset value, selecting the macroblock decision mode as the optimal decision mode;
otherwise, selecting the skip mode or the zero mode as the optimal decision mode.
Preferably, the skip mode or the zero mode is selected as the optimal decision mode, specifically:
if the second SATD value is determined to be greater than the third SATD value, selecting the skip mode as the optimal decision mode;
and if the second SATD value is smaller than the third SATD value, selecting the zero mode as the optimal decision mode.
Preferably, the preprocessing module comprises a data processing unit;
the data processing unit is used for downsampling the original pixel image to the target pixel image, and performing coding reconstruction upsampling on the target pixel image to obtain an upsampled original pixel image;
the method is also used for carrying out residual processing on the original pixel image and the up-sampled original pixel image according to an initial preset formula to obtain a UV residual image;
The initial preset formula is:
wherein u is ori For the original pixel image, u 1 And (3) performing coding reconstruction and upsampling on the target pixel image to obtain an original pixel image, wherein u' is the UV residual image.
As a preferred scheme, the coding module specifically comprises:
if the optimal decision mode is determined to be the skip mode, encoding the original pixel image according to the skip mode to obtain an encoding result;
if the optimal decision mode is determined to be the zero mode, encoding the original pixel image according to the zero mode to obtain an encoding result;
and if the optimal decision mode is determined to be the macro block decision mode, encoding the original pixel image and the UV residual image according to the macro block decision mode to obtain an encoding result.
Preferably, the second decision module includes a mode acquisition unit;
the mode obtaining unit is configured to obtain the macroblock decision mode of the original pixel image from a code stream or a code function interface of the original pixel image.
As a preferred solution, the skip mode and the zero mode specifically are:
the skip mode is to fill the pixel values of the original pixel image according to the macro block pixel values of the target pixel image;
The zero mode is to fill the pixel values of the original pixel image according to 128 pixel values.
As a preferable solution, the target pixel image specifically includes:
the target pixel image is downsampled from the original pixel image.
The invention also provides a storage medium, wherein the storage medium is stored with a computer program, the computer program is called and executed by a computer, and the mode decision method of chroma residual coding is realized.
Drawings
Fig. 1 is a flow chart of a mode decision method for chroma residual coding according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a mode decision flow provided by an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a mode decision device for chroma residual coding according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In the description of the present application, it should be understood that the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first", "a second", and "a third" may explicitly or implicitly include one or more such feature. In the description of the present application, unless otherwise indicated, the meaning of "a number" is two or more.
Referring to fig. 1, an embodiment of the present invention provides a mode decision method for coding a chrominance residual, including S1 to S6, which are implemented as follows:
s1, acquiring an original pixel image, and carrying out residual processing on the original pixel image and a preset target pixel image to obtain a UV residual image.
In the embodiment of the invention, S1 comprises S1.1-S1.3:
s1.1, acquiring a first original pixel image YUV444, and acquiring a division mode, a macro block decision mode and mv (motion vector) information of the first original pixel image YUV444 from a coding code stream or a coding function interface of the first original pixel image YUV 444.
The embodiment provides a plurality of modes for acquiring the division mode, the macro block decision mode and the mv information, the division mode and the mode selection can be directly acquired from the code stream of the original pixel image, and the data can also be directly acquired from the code function interface, and the data acquisition mode is simple and quick and does not need to carry out any processing on the acquired data.
S1.2, downsampling the first original pixel image YUV444 to a target pixel image YUV420, and then upsampling the coded and reconstructed image by the target pixel image YUV420 to obtain a second original pixel image YUV444'.
In the embodiment, the second original pixel image is obtained by downsampling the first original pixel image and upsampling the encoded reconstructed image, and because the first original pixel image is relatively close to the upsampled second original pixel image, a plurality of residual all-zero blocks exist in the chromaticity residual image between the two pixel images in a scene with less bright color, which is beneficial to dividing the UV residual image.
S1.3, carrying out residual processing on a first original pixel image YUV444 and a second original pixel image YUV444' according to an initial preset mode to obtain a UV residual image;
the initial preset is:
wherein u is ori For the first raw pixel image YUV444, u 1 And the second original pixel image YUV444', u' obtained after the target pixel image is subjected to coding reconstruction and then up-sampling is a UV residual image.
In this embodiment, residual processing is performed on the first original pixel image and the second original pixel image through a preset formula to obtain a UV residual image, so that an optimal decision mode can be selected and obtained based on the UV residual image.
S2, dividing the UV residual image according to the dividing mode of the original pixel image to obtain divided sub-blocks.
The embodiment of the invention specifically comprises the following steps:
and dividing the UV residual image according to the dividing mode of the original pixel image YUV444 to obtain divided sub-blocks.
In the embodiment, the dividing mode of the UV residual image is completely consistent with the dividing mode of the original pixel image YUV444, so that the decision mode can be selected to encode the original pixel image YUV444 on the basis of the UV residual image conveniently.
And S3, calculating to obtain coding distortion measure of the image according to the divided data of the sub-blocks, and sequentially judging whether the coding distortion measure meets the preset conditions of the skip mode and the zero mode.
The embodiment of the invention specifically comprises the following steps:
and calculating according to the divided data of the sub-blocks to obtain the coding distortion measure of the image, wherein the coding distortion measure comprises an initial SATD value, an SSD value and a pixel number value, wherein the absolute value of a chromaticity difference value in the sub-blocks exceeds a preset threshold value, and sequentially judging whether the coding distortion measure meets the preset conditions of a skip mode and a zero mode.
The skip mode is to fill the pixel value of the original pixel image according to the macro block pixel value of the target pixel image; the zero mode is to fill the pixel value of the original pixel image according to 128 pixel values;
The SATD is an absolute sum of coefficients obtained by performing Hadamard transform on residuals in the UV residual images, and the SSD is a mean square sum of differences between the first original pixel image YUV444 and the second original pixel image YUV 444'.
In this embodiment, the skip mode is to directly fill the pixel value of the reference macroblock (target pixel image) into the current block (original pixel image), which corresponds to the correspondence between the corresponding pixel and the reference frame, and the performance at the decoding end is: the pixels of the current block are originally and locally filled into pixels of a reference macro block, namely, the corresponding position of each pixel point of the current block is completely consistent with the reference macro block, so that the residual error is 0, and finally, the residual error does not need to be considered when the coding is carried out; in addition, the skip mode can inherit mv (motion vector) information, so that compared with the zero mode and the macro block decision mode, the skip mode is used for encoding, so that the mv information can be encoded into a code rate stream, and a decoding end can decode an original image through the mv information, thereby being convenient for the development of decoding work;
the zero mode is to directly fill the current block (original pixel image) with 128 pixel values in order to reduce complexity and code rate, which is equivalent to replacing a whole frame with 128 pixel values; the representation at the decoding end is: filling all pixel points in the current block with 128, and if the current block is an m×n block, obtaining an m×n 128 array; because the macro block is adopted, the encoding and decoding can be directly used for pixel filling, so that the problem of encoding residual errors is not needed to be considered;
Both decision modes do not consider the problem of encoding the UV residual image, so that the encoding efficiency can be improved when the two modes are finally used for encoding.
And S4, if the coding distortion measure is determined to meet the skip mode or the zero mode, selecting the corresponding mode as the optimal decision mode.
In the embodiment of the invention, S4 comprises S4.1-S4.2:
s4.1, if the coding distortion measure is determined to meet the first preset, selecting a skip mode as an optimal decision mode;
the first preset is:
wherein chroma_num is the absolute value of the chroma difference exceeding the threshold d 1 Pix_num is the number of pixels contained in the current sub-block, a 1 、b 1 、c 1 And d 1 Are all preset threshold parameters, SATD is the absolute sum of coefficients obtained by carrying out Hardman transformation on residual errors in the UV residual error image, SSD is the absolute sum of coefficients of a first original pixel image YUV444 and a second original pixel image YUV444'the difference squared sum'.
S4.2, if the coding distortion measure does not meet the first preset formula, judging whether the coding distortion measure meets the second preset formula, and if the coding distortion measure meets the second preset formula, selecting a zero mode as an optimal decision mode;
the second preset is:
Wherein chroma_num is the absolute value of the chroma difference exceeding the threshold d 2 Pix_num is the number of pixels contained in the current sub-block, a 2 、b 2 、c 2 And d 2 The SATD is the absolute sum of coefficients obtained by carrying out Hardman transformation on residual errors in the UV residual images, and SSD is the mean square sum of differences between the first original pixel image YUV444 and the second original pixel image YUV 444'.
A is that 2 、b 2 、c 2 And d 2 Ratio a of respectively 1 、b 1 、c 1 And d 1 The higher the accuracy, the smaller the values of a, b, c and d, the more accurate the mode decision is; a. the value standard of b, c and d is always determined based on the index of best rate distortion performance, specifically: traversing each macro block in the sub-blocks by the skip mode, the zero mode and the macro block decision mode, selecting an optimal mode, and respectively calculating the characteristic values by selecting all macro blocks in the skip mode and the zero mode to finally determine the values of a, b, c and d; for example, when the encoding object is 1080p image, (a) 1 ,b 1 ,c 1 ,d 1 ) The corresponding formula is (2,3,10,20), and the comprehensive performance is better.
The coding distortion measure in this embodiment includes an initial SATD value, an SSD value, and a pixel number value in which an absolute value of a chrominance difference value in a sub-block exceeds a preset threshold, and these data can comprehensively reflect a size of a code stream generated by an original pixel image, a degree of association between two variables of the original pixel image and a target pixel image, and a degree of slowing down a processing speed of the image when the pixel number exceeds the preset threshold, so that a suitable decision mode can be selected by determining whether these data satisfy the first preset formula or the second preset formula.
S5, if the determination is not satisfied, calculating SATD values in a skip mode, a zero mode and a macro block decision mode respectively to obtain a plurality of SATD values, and taking a mode with the minimum SATD value as an optimal decision mode; the skip mode and the zero mode are modes capable of directly encoding the target pixel image, and the macro block decision mode is acquired through the encoding condition of the original pixel image.
In the embodiment of the invention, S5 comprises S5.1-S5.2:
s5.1, if the coding distortion measure (an initial SATD value, an SSD value and a pixel number value) are determined not to meet the preset conditions of the skip mode and the zero mode, respectively calculating the SATD values in the skip mode, the zero mode and the macro block decision mode to obtain a first SATD value, a second SATD value and a third SATD value;
if the first SATD value is smaller than the second SATD value and the third SATD value or the second SATD value and the third SATD value exceed the preset value e, selecting a macro block decision mode as an optimal decision mode;
otherwise, if the second SATD value is determined to be larger than the third SATD value, selecting a skip mode as an optimal decision mode; and if the second SATD value is determined to be smaller than the third SATD value, selecting the zero mode as the optimal decision mode.
It should be noted that, the first SATD value, the second SATD value, and the third SATD value are all: and predicting the original pixel image YUV444 by using the corresponding modes to obtain a predicted image with n multiplied by n pixel values, subtracting the corresponding positions of the original pixel image YUV444 and the predicted image to obtain a residual image, and carrying out Hadamard transform on a residual matrix of the residual image to obtain an absolute sum of coefficients, namely a first SATD value, a second SATD value or a third SATD value. The value standard of the preset value e is also determined based on the index of the best rate distortion performance, and the obtaining mode of the preset value e is the same as the principle of the obtaining modes of the parameters a, b, c and d.
In this embodiment, the SATD value refers to the sum of absolute values of prediction residuals obtained by hadamard transform of residuals of a divided block in different modes, so that the SATD value is a measure of the size of a video residual signal, which can be regarded as simple time-frequency transform, and the value of the SATD value can reflect the size of a generated code stream to a certain extent, so that the scheme can use a corresponding macroblock decision mode, skip mode or zero mode as a decision mode by comparing and selecting smaller SATD values in different conditions or SATD values meeting a preset standard.
S5.2, when the optimal decision mode selected by the subblocks in the CU (coding unit) in the original pixel image YUV444 is a skip mode and mv (motion vector) of all the subblocks in the subblocks is uniform, fusing the CU into a skip mode;
when the best decision mode for sub-block selection inside the CU in the original pixel image YUV444 is zero mode, then the CU is fused into zero mode.
In this embodiment, because of the mergence of the skip mode and the zero mode, when the best decision mode is determined to be the skip mode or the zero mode, CU blocks in the original pixel image YUV444 are merged, so that not only the encoding rate can be reduced, but also the time consumed for decoding can be reduced.
And S6, encoding the original pixel image and the UV residual image according to the optimal decision mode to obtain an encoding result.
The embodiment of the invention specifically comprises the following steps:
if the optimal decision mode is determined to be a skip mode, encoding the original pixel image YUV444 according to the skip mode to obtain an encoding result;
if the optimal decision mode is determined to be the zero mode, encoding the original pixel image YUV444 according to the zero mode to obtain an encoding result;
if the optimal decision mode is determined to be a macro block decision mode, encoding the original pixel image YUV444 and the UV residual image according to the macro block decision mode to obtain an encoding result.
In this embodiment, for different best decision modes, there are different encoding objects, when the best decision mode is skip mode or zero mode, only the original pixel image needs to be encoded, and when the best decision mode is macro block decision mode, the original pixel image and the UV residual image need to be encoded together; because the skip mode and the zero mode can be regarded as special merging modes (Merge modes), the skip mode and the zero mode are utilized to carry out inter-prediction on the PU, only the use index of the motion information of the adjacent block is needed to be encoded, and the prediction residual information is not needed to be encoded, therefore, the encoding result can be obtained by only encoding the original pixel image during encoding, and the two preferable modes can accelerate the encoding process and improve the encoding efficiency.
For application of the embodiment of the present invention, please refer to fig. 2, fig. 2 is a schematic diagram of a mode decision flow provided by the embodiment of the present invention, and the specific flow is as follows:
1. starting.
2. Acquiring a first original pixel image, and preprocessing: acquiring a first original pixel image YUV444, and acquiring a dividing mode, a macro block decision mode and mv information of the first original pixel image YUV444 from a coding code stream or a coding function interface of the first original pixel image YUV 444; the first original pixel image YUV444 is used for carrying out coding reconstruction image up-sampling to obtain a second original pixel image YUV444'; carrying out residual processing on the first original pixel image YUV444 and the second original pixel image YUV444' according to the initial preset to obtain a UV residual image; and dividing the UV residual image according to the dividing mode of the original pixel image to obtain divided sub-blocks.
3. Obtaining a coding distortion measure: and acquiring an initial SATD value and an SSD value according to the divided data of the sub-blocks, and obtaining the pixel number value of which the absolute value of the chromaticity difference value in the sub-blocks exceeds a preset threshold value.
4. Decision skip mode: judging whether the coding distortion measure meets a first preset mode, if so, selecting a skip mode as an optimal decision mode, and executing the step 8; if not, executing the step 5.
5. Decision zero mode: judging whether the coding distortion measure meets a second preset mode, if so, selecting a zero mode as an optimal decision mode, and executing the step 8; if not, executing the step 6.
6. Obtaining SATD values in different modes: SATD values in skip mode, zero mode and macroblock decision mode are obtained.
7. Decision skip mode, zero mode, and macroblock decision mode: the decision skip mode, the zero mode or the macroblock decision mode is determined as the best decision mode by comparing the magnitudes of the SATD values.
8. Obtaining the optimal decision mode and coding: when the optimal decision mode is a skip mode or a zero mode, encoding the original pixel image to obtain an encoding result; and when the optimal decision mode is a macro block decision mode, encoding the original pixel image and the UV residual image to obtain an encoding result.
9. And (5) ending.
In general, the embodiments of the present invention have the following beneficial effects:
according to the method, the target pixel image is obtained by carrying out coding reconstruction image up-sampling on the original pixel image, so that a plurality of residual all-zero blocks exist in the chromaticity residual image between the original pixel image and the target pixel image, and the UV residual image can be divided later. The skip mode or the zero mode is preferably selected as the optimal decision mode by comparing coding distortion measures, the coding efficiency can be improved and the coding complexity can be reduced based on the property that the skip mode and the zero mode can directly code an original pixel image, and the skip mode can inherit mv (motion vector) information and enable the mv information to be coded into a code rate stream, so that a decoding end can decode the original image through the mv information, and the development of subsequent decoding work is facilitated. In addition, the SATD value is a measure of the size of the video residual signal, and the value can reflect the size of the generated code stream to a certain extent, so that the scheme can select a corresponding skip mode, zero mode or macro block decision mode as an optimal decision mode by comparing the SATD values in different modes, and finally, the decision mode is used for encoding a target object to obtain an encoding result; and before encoding, if the optimal decision mode is determined to be skip mode or zero mode, the CU blocks in the original pixel image YUV444 are combined, so that not only can the encoding code rate be reduced, but also the time consumed by decoding can be reduced.
Referring to fig. 3, an embodiment of the present invention provides a mode decision device for coding a chroma residual, which includes a preprocessing module 10, a dividing module 20, a judging module 30, a first decision module 40, a second decision module 50 and a coding module 60;
the preprocessing module 10 is configured to obtain an original pixel image, and perform residual processing on the original pixel image and a preset target pixel image to obtain a UV residual image;
the dividing module 20 is configured to divide the UV residual image according to a dividing manner of the original pixel image, so as to obtain divided sub-blocks;
the judging module 30 is configured to calculate a coding distortion measure of the image according to the division data of the sub-blocks, and sequentially judge whether the coding distortion measure meets a preset condition of skip mode and zero mode;
a first decision module 40, configured to select a corresponding mode as an optimal decision mode if it is determined that the coding distortion measure satisfies a skip mode or a zero mode;
the second decision module 50 is configured to calculate SATD values in skip mode, zero mode and macro block decision mode, respectively, if neither of the two modes is satisfied, to obtain a plurality of SATD values, and to use a mode with a minimum SATD value as an optimal decision mode; the skip mode and the zero mode are modes capable of directly encoding the target pixel image, and the macro block decision mode is obtained through the encoding condition of the original pixel image;
The encoding module 60 is configured to encode the original pixel image and the UV residual image according to the optimal decision mode, so as to obtain an encoding result.
In one embodiment, the first decision module 40 comprises a mode first determination unit;
a mode first determining unit, configured to select a skip mode as an optimal decision mode if it is determined that the coding distortion measure meets a first preset;
the mode first determining unit is further configured to determine whether the coding distortion measure meets a second preset formula if it is determined that the coding distortion measure does not meet the first preset formula, and select a zero mode as an optimal decision mode if it is determined that the coding distortion measure meets the second preset formula;
the coding distortion measure comprises an initial SATD value, an SSD value and a pixel number value, wherein the absolute value of a chrominance difference value in a sub-block exceeds a preset threshold value, and the initial SATD value, the SSD value and the pixel number value are calculated according to the divided data of the sub-block.
In one embodiment, the second decision module 50 comprises a pattern second determination unit;
a mode second determining unit, configured to calculate SATD values in the skip mode, the zero mode, and the macroblock decision mode, respectively, if it is determined that the coding distortion measure does not satisfy the skip mode and the zero mode, to obtain a first SATD value, a second SATD value, and a third SATD value;
The mode second determining unit is further configured to select the macroblock decision mode as the optimal decision mode if it is determined that the first SATD value is smaller than the second SATD value and the third SATD value, or the second SATD value and the third SATD value both exceed a preset value;
otherwise, the skip mode or the zero mode is selected as the best decision mode.
In one embodiment, a skip mode or a zero mode is selected as the best decision mode, specifically:
if the second SATD value is determined to be greater than the third SATD value, selecting a skip mode as an optimal decision mode;
and if the second SATD value is determined to be smaller than the third SATD value, selecting the zero mode as the optimal decision mode.
In one embodiment, the preprocessing module 10 includes a data processing unit;
the data processing unit is used for downsampling the original pixel image to a target pixel image, and performing coding reconstruction and upsampling on the target pixel image to obtain an upsampled original pixel image;
the data processing unit is also used for carrying out residual processing on the original pixel image and the original pixel image after up-sampling according to the initial preset mode to obtain a UV residual image;
the initial preset is:
wherein u is ori U is the original pixel image 1 And u' is an UV residual image, which is an original pixel image obtained after the target pixel image is subjected to coding reconstruction and upsampling.
In one embodiment, the encoding module 60 is specifically:
if the optimal decision mode is determined to be a skip mode, encoding the original pixel image according to the skip mode to obtain an encoding result;
if the optimal decision mode is determined to be the zero mode, encoding the original pixel image according to the zero mode to obtain an encoding result;
if the optimal decision mode is determined to be a macro block decision mode, encoding the original pixel image and the UV residual image according to the macro block decision mode to obtain an encoding result.
In one embodiment, the second decision module 50 comprises a mode acquisition unit;
and the mode acquisition unit is used for acquiring the macro block decision mode of the original pixel image from the code stream or the code function interface of the original pixel image.
In one embodiment, the skip mode and the zero mode are specifically:
the skip mode is to fill the pixel value of the original pixel image according to the macro block pixel value of the target pixel image;
the zero mode is to fill the pixel values of the original pixel image according to 128 pixel values.
In one embodiment, the target pixel image is specifically:
the target pixel image is downsampled from the original pixel image.
The device has the following beneficial effects:
The device obtains the UV residual image by carrying out residual processing on the original pixel image and the target pixel image so as to establish the connection between the original pixel image and the target pixel image, thereby being capable of selecting and obtaining the optimal decision mode on the basis of the UV residual image. The skip mode or the zero mode is preferentially selected as the optimal decision mode by comparing the coding distortion measure, and the coding efficiency can be improved and the coding complexity can be reduced based on the property that the skip mode and the zero mode can directly code the original pixel image; in addition, the SATD value is a measure of the size of the video residual signal, and the value can reflect the size of the generated code stream to a certain extent, so that the scheme can select the corresponding skip mode, zero mode or macro block decision mode as the optimal decision mode by comparing the SATD values in different modes, and finally, the decision mode is used for encoding the target object, thus obtaining the encoding result.
Correspondingly, the embodiment of the invention also provides a computer readable storage medium, which comprises a stored computer program, wherein the computer program is used for controlling equipment where the computer readable storage medium is positioned to execute the mode decision method of the chromaticity residual error coding;
Wherein the mode decision method of chroma residual coding can be stored in a computer readable storage medium if implemented in the form of a software functional unit and used as a stand alone product. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth.
The foregoing is a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention and are intended to be comprehended within the scope of the present invention.

Claims (10)

1. A mode decision method for chroma residual coding, comprising:
acquiring an original pixel image, and carrying out residual processing on the original pixel image and a preset target pixel image to obtain a UV residual image;
dividing the UV residual image according to the dividing mode of the original pixel image to obtain divided sub-blocks;
calculating to obtain coding distortion measure of the image according to the dividing data of the sub-blocks, and sequentially judging whether the coding distortion measure meets the preset conditions of a skip mode and a zero mode;
if the coding distortion measure is determined to meet the skip mode or the zero mode, selecting a corresponding mode as an optimal decision mode;
if the skip mode, the zero mode and the SATD value under the macro block decision mode are not met, respectively calculating the SATD values to obtain a plurality of SATD values, and taking the mode with the minimum SATD value as the optimal decision mode; the skip mode and the zero mode are modes capable of directly encoding the target pixel image, and the macro block decision mode is acquired through the encoding condition of the original pixel image;
And encoding the original pixel image and the UV residual image according to the optimal decision mode to obtain an encoding result.
2. Mode decision method for chroma residual coding as claimed in claim 1, characterized in that if it is determined that the coding distortion measure satisfies the skip mode or the zero mode, the corresponding mode is selected as the best decision mode, in particular:
if the coding distortion measure is determined to meet a first preset formula, selecting the skip mode as an optimal decision mode;
if the coding distortion measure does not meet the first preset formula, judging whether the coding distortion measure meets a second preset formula, and if the coding distortion measure meets the second preset formula, selecting the zero mode as an optimal decision mode;
the coding distortion measure comprises an initial SATD value, an SSD value and a pixel number value, wherein the absolute value of a chrominance difference value in the sub-block exceeds a preset threshold value, and the initial SATD value, the SSD value and the pixel number value are calculated according to the dividing data of the sub-block.
3. The method for deciding a mode of chroma residual coding as set forth in claim 1, wherein if none of the determinations is satisfied, respectively calculating SATD values in the skip mode, the zero mode and the macroblock decision mode to obtain a plurality of SATD values, and taking a mode with a minimum SATD value as an optimal decision mode, specifically:
If the coding distortion measure does not meet the preset conditions of the skip mode and the zero mode, calculating SATD values in the skip mode, the zero mode and the macro block decision mode respectively to obtain a first SATD value, a second SATD value and a third SATD value;
if the first SATD value is determined to be smaller than the second SATD value and the third SATD value, or the second SATD value and the third SATD value exceed preset values, selecting the macroblock decision mode as the optimal decision mode;
otherwise, selecting the skip mode or the zero mode as the optimal decision mode.
4. A mode decision method for chroma residual coding as claimed in claim 3, characterized in that either the skip mode or the zero mode is selected as the best decision mode, in particular:
if the second SATD value is determined to be greater than the third SATD value, selecting the skip mode as the optimal decision mode;
and if the second SATD value is smaller than the third SATD value, selecting the zero mode as the optimal decision mode.
5. The method for mode decision of chroma residual coding as claimed in claim 1, wherein residual processing is performed on the original pixel image and a preset target pixel image to obtain a UV residual image, specifically:
Downsampling the original pixel image to the target pixel image, and performing coding reconstruction and upsampling on the target pixel image to obtain an upsampled original pixel image;
performing residual processing on the original pixel image and the up-sampled original pixel image according to an initial preset formula to obtain a UV residual image;
the initial preset formula is:
wherein u is ori For the original pixel image, u 1 And (3) performing coding reconstruction and upsampling on the target pixel image to obtain an original pixel image, wherein u' is the UV residual image.
6. The method for mode decision of chroma residual coding as claimed in claim 1, wherein said original pixel image and said UV residual image are coded according to said optimal decision mode to obtain a coding result, specifically:
if the optimal decision mode is determined to be the skip mode, encoding the original pixel image according to the skip mode to obtain an encoding result;
if the optimal decision mode is determined to be the zero mode, encoding the original pixel image according to the zero mode to obtain an encoding result;
and if the optimal decision mode is determined to be the macro block decision mode, encoding the original pixel image and the UV residual image according to the macro block decision mode to obtain an encoding result.
7. The mode decision method of chroma residual coding as claimed in claim 1, wherein the macroblock decision mode is obtained by the coding conditions of the original pixel image, specifically:
and acquiring the macro block decision mode of the original pixel image from a code stream or a code function interface of the original pixel image.
8. Mode decision method for chroma residual coding as claimed in claim 1, characterized in that the skip mode and the zero mode are in particular:
the skip mode is to fill the pixel values of the original pixel image according to the macro block pixel values of the target pixel image;
the zero mode is to fill the pixel values of the original pixel image according to 128 pixel values.
9. A mode decision method for chroma residual coding as claimed in claim 1, characterized in that the target pixel image is in particular:
the target pixel image is downsampled from the original pixel image.
10. The mode decision device for coding the chromaticity residual is characterized by comprising a preprocessing module, a dividing module, a judging module, a first decision module, a second decision module and a coding module;
The preprocessing module is used for acquiring an original pixel image, and carrying out residual processing on the original pixel image and a preset target pixel image to obtain a UV residual image;
the dividing module is used for dividing the UV residual image according to the dividing mode of the original pixel image to obtain divided sub-blocks;
the judging module is used for calculating the coding distortion measure of the image according to the division data of the sub-blocks and judging whether the coding distortion measure meets the preset conditions of a skip mode and a zero mode or not in sequence;
the first decision module is configured to select a corresponding mode as an optimal decision mode if it is determined that the coding distortion measure meets the skip mode or the zero mode;
the second decision module is configured to calculate SATD values in the skip mode, the zero mode, and the macro block decision mode, respectively, if neither of the two decision modules is satisfied, to obtain a plurality of SATD values, and take a mode with a minimum SATD value as an optimal decision mode; the skip mode and the zero mode are modes capable of directly encoding the target pixel image, and the macro block decision mode is acquired through the encoding condition of the original pixel image;
And the encoding module is used for encoding the original pixel image and the UV residual image according to the optimal decision mode to obtain an encoding result.
CN202311638899.5A 2023-11-30 2023-11-30 Mode decision method and device for chroma residual coding Pending CN117676132A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311638899.5A CN117676132A (en) 2023-11-30 2023-11-30 Mode decision method and device for chroma residual coding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311638899.5A CN117676132A (en) 2023-11-30 2023-11-30 Mode decision method and device for chroma residual coding

Publications (1)

Publication Number Publication Date
CN117676132A true CN117676132A (en) 2024-03-08

Family

ID=90065544

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311638899.5A Pending CN117676132A (en) 2023-11-30 2023-11-30 Mode decision method and device for chroma residual coding

Country Status (1)

Country Link
CN (1) CN117676132A (en)

Similar Documents

Publication Publication Date Title
CN107211128B (en) Adaptive chroma downsampling and color space conversion techniques
US9014471B2 (en) Method of classifying a chroma downsampling error
WO2017083784A1 (en) Adaptive chroma downsampling and color space conversion techniques
KR100922510B1 (en) Image coding and decoding method, corresponding devices and applications
US20190141324A1 (en) Encoding data arrays
US11206418B2 (en) Method of image encoding and facility for the implementation of the method
CN115606179A (en) CNN filter for learning-based downsampling for image and video coding using learned downsampling features
CN115552905A (en) Global skip connection based CNN filter for image and video coding
CN116848843A (en) Switchable dense motion vector field interpolation
Boitard et al. Motion-guided quantization for video tone mapping
CN117676132A (en) Mode decision method and device for chroma residual coding
CN114793282A (en) Neural network based video compression with bit allocation
CN116250240A (en) Image encoding method, image decoding method and related devices
CN109302605B (en) Image coding method and device based on multi-core processor
CN109587487B (en) Method and system for evaluating structural distortion degree of RDO strategy
WO2024078635A1 (en) Down-sampling methods and ratios for super-resolution based video coding
Mir et al. Rate distortion analysis of high dynamic range video coding techniques
US20240137513A1 (en) Application of Super Resolution
WO2023274406A1 (en) Super resolution upsampling and downsampling
US20240137517A1 (en) Super Resolution Position and Network Structure
EP3777175A1 (en) Image processing apparatus and method
US20060176961A1 (en) Method for reducing bit rate requirements for encoding multimedia data
US20240137519A1 (en) Super resolution downsampling
US20240137518A1 (en) Utilizing coded information during super resolution process
CN112154667B (en) Encoding and decoding of video

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination