WO2023123358A1 - Encoding and decoding methods, code stream, encoder, decoder, and storage medium - Google Patents

Encoding and decoding methods, code stream, encoder, decoder, and storage medium Download PDF

Info

Publication number
WO2023123358A1
WO2023123358A1 PCT/CN2021/143688 CN2021143688W WO2023123358A1 WO 2023123358 A1 WO2023123358 A1 WO 2023123358A1 CN 2021143688 W CN2021143688 W CN 2021143688W WO 2023123358 A1 WO2023123358 A1 WO 2023123358A1
Authority
WO
WIPO (PCT)
Prior art keywords
current block
value
coefficient group
last coefficient
sign
Prior art date
Application number
PCT/CN2021/143688
Other languages
French (fr)
Chinese (zh)
Inventor
徐陆航
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2021/143688 priority Critical patent/WO2023123358A1/en
Publication of WO2023123358A1 publication Critical patent/WO2023123358A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/48Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using compressed domain processing techniques other than decoding, e.g. modification of transform coefficients, variable length coding [VLC] data or run-length data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding

Definitions

  • the embodiments of the present application relate to the technical field of video encoding and decoding, and in particular, relate to an encoding and decoding method, a code stream, an encoder, a decoder, and a storage medium.
  • the image data to be encoded will be compressed and encoded through the entropy encoding unit after transformation and quantization, and the code stream generated after the entropy encoding process will be transmitted to Decoder; then analyze the code stream, and after inverse quantization and inverse transformation processing, the original input image data can be restored.
  • non-zero quantized coefficients can be positive or negative, and sign prediction technology can be used to predict the sign of these coefficients.
  • sign prediction technology can be used to predict the sign of these coefficients.
  • sign prediction of non-zero quantized coefficients at the image edge and block edge due to the imperfection of related technologies, there may be defects such as limited transform block size and unreasonable cost calculation during sign prediction, resulting in inaccurate sign prediction results. low degree.
  • Embodiments of the present application provide a codec method, a code stream, an encoder, a decoder, and a storage medium, which can not only expand the scope of application of sign prediction technology, but also improve the accuracy of sign prediction for positive and negative signs.
  • the embodiment of the present application provides a decoding method applied to a decoder, and the method includes:
  • the embodiment of the present application provides an encoding method applied to an encoder, and the method includes:
  • the embodiment of the present application provides a code stream, which is generated by bit coding according to the information to be encoded; wherein the information to be encoded includes at least one of the following: the absolute value of the reconstruction coefficient and the symbol residual value .
  • the embodiment of the present application provides an encoder, including a first determination unit and a first prediction unit; wherein,
  • a first determining unit configured to determine a transform coefficient of a current block
  • the first determining unit is further configured to scan the transform coefficients of the current block according to a preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
  • the first prediction unit is configured to perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
  • the embodiment of the present application provides an encoder, where the encoder includes a first memory and a first processor; wherein,
  • a first memory for storing a computer program capable of running on the first processor
  • the first processor is configured to execute the method as described in the second aspect when running the computer program.
  • the embodiment of the present application provides a decoder, including a decoding unit, a second determination unit, and a second prediction unit; wherein,
  • the decoding unit is configured to analyze the code stream and determine the absolute value of the reconstruction coefficient of the current block
  • the second determining unit is configured to scan the absolute value of the reconstruction coefficient of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
  • the first prediction unit is configured to perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
  • the embodiment of the present application provides a decoder, where the decoder includes a second memory and a second processor; wherein,
  • a second memory for storing a computer program capable of running on the second processor
  • the second processor is configured to execute the method as described in the first aspect when running the computer program.
  • an embodiment of the present application provides a computer storage medium, the computer storage medium stores a computer program, and when the computer program is executed, the method as described in the first aspect is implemented, or the method as described in the second aspect is implemented. . .
  • the embodiment of the present application provides a codec method, code stream, encoder, decoder, and storage medium.
  • the transformation coefficient of the current block is determined; the transformation coefficient of the current block is scanned according to the preset scanning order to determine The last coefficient group of the current block in the preset scanning order; perform sign prediction on the last coefficient group, and determine the sign prediction value of the last coefficient group.
  • analyze the code stream to determine the absolute value of the reconstruction coefficient of the current block; scan the absolute value of the reconstruction coefficient of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order; Sign prediction is performed for one coefficient group, and the sign prediction value for the last coefficient group is determined.
  • both the encoding end and the decoding end can scan the transform coefficients of the current block according to the preset scanning order, and then determine the last coefficient group of the current block in the preset scanning order, so as to perform Sign prediction, which not only allows blocks of more shapes and sizes to perform sign prediction, but also expands the scope of application of sign prediction technology; and in the process of sign prediction, for the current block at the upper boundary or left of the image or coding tree unit
  • the cost calculation method is also optimized, and at the same time, the energy calculation method for screening the transform coefficients to be predicted is also adaptively adjusted, thereby reducing the computational complexity and improving the accuracy of sign prediction Spend.
  • Figure 1 is a schematic diagram of the composition of a hybrid coding framework
  • Fig. 2 is a schematic diagram of a block including non-zero quantized coefficients
  • Fig. 3 is a schematic diagram of a coefficient block to be inversely transformed
  • Fig. 4 is a schematic diagram of a coefficient block of an inverse transform
  • Fig. 5 is a schematic diagram of a normalized template
  • Fig. 6 is a schematic diagram of a normalized template of inverse transformation
  • FIG. 7 is a schematic diagram of an application for calculating a cost based on a hypothetical reconstruction value
  • FIG. 8A is a schematic diagram of a system composition block diagram of an encoder provided by an embodiment of the present application.
  • FIG. 8B is a schematic diagram of a system composition block diagram of a decoder provided in an embodiment of the present application.
  • FIG. 9 is a first schematic flowchart of a decoding method provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a test result using symbol prediction for a block smaller than 4 ⁇ 4 provided by an embodiment of the present application.
  • FIG. 11 is a schematic diagram of a position where the current block is at the boundary of a coding tree unit provided by an embodiment of the present application.
  • FIG. 12 is a schematic diagram of a test result of using symbol prediction when the current block is at the coding tree unit boundary provided by the embodiment of the present application;
  • Fig. 13 is a schematic diagram of a position where the current block is at the image boundary provided by the embodiment of the present application.
  • Fig. 14 is a schematic diagram of a test result of using symbol prediction when the current block is at the image boundary provided by the embodiment of the present application;
  • Fig. 15 is a schematic diagram of the position of the current block in the upper left corner of the image provided by the embodiment of the present application.
  • Fig. 16 is a schematic diagram of a test result in which the current block is in the upper left corner of the image without using symbol prediction according to the embodiment of the present application;
  • FIG. 17 is a second schematic flow diagram of a decoding method provided by an embodiment of the present application.
  • FIG. 18 is a first schematic flowchart of an encoding method provided by an embodiment of the present application.
  • FIG. 19 is a schematic flow diagram II of an encoding method provided by an embodiment of the present application.
  • FIG. 20 is a schematic flow diagram III of an encoding method provided in an embodiment of the present application.
  • FIG. 21 is a schematic diagram of the composition and structure of an encoder provided by an embodiment of the present application.
  • FIG. 22 is a schematic diagram of a specific hardware structure of an encoder provided by an embodiment of the present application.
  • FIG. 23 is a schematic structural diagram of a decoder provided by an embodiment of the present application.
  • FIG. 24 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application.
  • FIG. 25 is a schematic diagram of the composition and structure of an encoding and decoding system provided by an embodiment of the present application.
  • references to “some embodiments” describe a subset of all possible embodiments, but it is understood that “some embodiments” may be the same subset or a different subset of all possible embodiments, and Can be combined with each other without conflict.
  • first ⁇ second ⁇ third involved in the embodiment of the present application is only used to distinguish similar objects, and does not represent a specific ordering of objects. Understandably, “first ⁇ second ⁇ The specific order or sequence of "third” may be interchanged where permitted so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein.
  • VVC Very Video Coding
  • LCU Largest Coding Unit
  • Transform Unit Transform Unit, TU
  • VVC reference software test model
  • Sign Prediction (Sign Prediction, SP): a prediction technique for the positive and negative of non-zero transform coefficients
  • ECM Enhanced Compression Model
  • each frame in the video image is divided into square LCUs of the same size (such as 128 ⁇ 128, 64 ⁇ 64, etc.), and each LCU can also be divided into rectangular CUs according to the rules; and the CU may also be divided into smaller ones PU, TU, etc.
  • the hybrid coding framework may include steps such as prediction, transformation, quantization, entropy coding, and loop filtering.
  • prediction can be divided into intra prediction (Intra Prediction) and inter prediction (Inter Prediction), and inter prediction can include motion estimation (Motion Estimation) and motion compensation (Motion Compensation).
  • the use of intra-frame prediction in video coding and decoding technology can eliminate the spatial redundancy between adjacent pixels; but due to the adjacent pixels in the video image There is also a strong similarity between frames.
  • the inter-frame prediction method is used to eliminate the temporal redundancy between adjacent frames, thereby improving the coding and decoding efficiency.
  • the basic flow of a video codec is as follows:
  • a frame of image is divided into blocks, intra-frame prediction or inter-frame prediction is used for the current block to generate the prediction block of the current block, and the original block of the current block is subtracted from the prediction block to obtain
  • the residual block is transformed and quantized to obtain a quantized coefficient matrix, and the quantized coefficient matrix is entropy encoded and output to the code stream.
  • intra prediction or inter prediction is used for the current block to generate the prediction block of the current block.
  • the quantization coefficient matrix is obtained by decoding the code stream, and the quantization coefficient matrix is dequantized and inversely transformed to obtain the residual block.
  • the predicted block and the residual block are added to obtain the reconstructed block.
  • the reconstructed blocks form a reconstructed image
  • the decoded image is obtained by performing loop filtering on the reconstructed image based on the image or based on the block.
  • the encoder also needs similar operations as the decoder to obtain the decoded image.
  • the decoded image may serve as a reference frame for inter-frame prediction for subsequent frames.
  • the decoded image obtained by the encoder is usually also called the reconstructed image.
  • the current block may be divided into prediction units, and during transformation, the current block may be divided into transformation units, and the division of prediction units and transformation units may be different.
  • the current block may be a current coding unit (CU), a current prediction unit (PU), or a current transform block (TU).
  • CU current coding unit
  • PU current prediction unit
  • TU current transform block
  • the encoder in VVC makes a difference between the original value and the predicted value of the current block to obtain a residual block, and the residual block is transformed to obtain the transformed residual, and then the transformed The residual is quantized to obtain quantized coefficients, and then the quantized coefficients are encoded into the code stream.
  • the probability of the non-zero quantized coefficient since the probability of the non-zero quantized coefficient’s positive and negative occurrences is random, equal-probability coding is used in VVC and other standards (where the positive and negative probabilities are both 50 %).
  • Fig. 2 shows a schematic diagram of a block containing non-zero quantized coefficients.
  • the non-zero quantization coefficients are 5, -1, -2 and 1. Their plus and minus signs are +, -, -, + respectively.
  • Positive and negative can be represented by a binary code, such as 1 for + and 0 for -.
  • the Sign Prediction technology can be used to predict the positive and negative of the non-zero quantized coefficients in this block, assuming that the predicted positive and negative are +, -, -, -. Then according to the above content, the correct positive and negative values are 1, 0, 0, 1; the predicted values are 1, 0, 0, 0.
  • each "residual error” can also be represented by a binary code, for example, 0 is correct and 1 is wrong. At this time, the "residual” is 0, 0, 0, 1. It is not difficult to see that when the prediction is more accurate, the probability of 0 in the "residual” will be higher than the probability of 1. For such binary codes with obvious uneven distribution, using context model coding can greatly reduce the codeword.
  • the Sign prediction technology is to use the information between the current block and the adjacent blocks to accurately predict the sign of the non-zero quantization coefficient in the current block, so that the "residual" coding cost of the sign is reduced.
  • transform coefficients are divisible.
  • the transformation used in image/video compression is a linear transformation. Taking the most commonly used DCT-II transformation as an example, assuming that the transformation coefficient of the current block is shown in Figure 3, a coefficient block to be inversely transformed is shown here. Can be represented by block A.
  • Fig. 4 After the block A in Fig. 3 is inversely transformed using DCT-II transformation, the results in Fig. 4 can be obtained (each value is the result of rounding after ⁇ 64), and a schematic diagram of a coefficient block of inverse transformation is shown here, It can be represented by InvA.
  • the embodiment of the present application can split the above inverse transformation. Specifically, two normalized templates shown in FIG. 5 can be used, including template B and template C. Then perform DCT-II inverse transformation on template B and template C respectively, and the result in Figure 6 can be obtained (each value is the result of rounding after ⁇ 64), which shows the two templates after inverse transformation, including template InvB and template InvC.
  • the sign of the transform coefficients can be predicted. Wherein, predicting the sign of the transformation coefficient should first be based on the known (decoded) basis of the absolute value of the quantization coefficient and the transformation mode used by the current block.
  • the prediction process is divided into the following steps:
  • Step 1 Construct the inverse-transformed templates of the possible sizes of each transformation block of each transformation type.
  • the inverse-transformation template only needs to use the values of the uppermost row and the leftmost column, so only these values are saved.
  • Step 2 Calculate the absolute value of the coefficient after inverse quantization. If L is greater than K, select K coefficients according to a certain rule to predict the sign. 2 K possible positive and negative combinations, according to the pre-calculated template, calculate the hypothetical inverse transform residual value of the 2 K transform blocks in the first row and the first column.
  • Step 3 Using the inverse transformation residual values and predicted values of the 2 K hypotheses of the transform block, 2 K hypothesis reconstruction values (hypothesis reconstruction) can be obtained, and one of the 2 K hypothesis reconstruction values is selected to be consistent with the surrounding reconstructed The hypothetical reconstruction value with the least cost between the blocks of ; where the hypothetical reconstruction value is equal to the inverse transformation residual value plus the prediction value of the current transformation block.
  • 2 K hypothesis reconstruction values hyperthesis reconstruction
  • the reconstructed adjacent pixel values of the current block may include the upper two rows and the left two columns of the current transform block, where the upper two rows are respectively represented by p x,-1 and p x, -2 means, the two columns on the left are respectively represented by p -1,y and p -2,y , the range of x is 0,1,...,w-1, and the range of y is 0,1,...,h-1 , w represents the width of the current transformation block, and h represents the height of the current transformation block; at this time, the cost value is calculated according to the assumed reconstruction value, as shown below,
  • Step 4 The set of signs used by the inverse transformation residual value with the smallest cost value (expressed in cost) is the sign prediction made by Sign Prediction.
  • Step 5 For the selected group of predicted positive and negative values, specifically, the positive and negative values of the optimal quantization coefficient in the current mode selected by the current transform block at the encoding end through rate-distortion optimization are taken as the real positive and negative values value, and then determine the residual of the positive and negative values based on the true positive and negative values and the predicted positive and negative values.
  • the context model is used in the subsequent encoding process to encode positive and negative residuals. In this way, the decoder decodes positive and negative residuals from the context model.
  • the real positive and negative values can also be obtained according to the residual of the positive and negative values and the predicted positive and negative values, and the real positive and negative values can be directly assigned to the transformation coefficients to further complete subsequent decoding operations (such as inverse transformation, reconstruction, etc. ).
  • the surrounding neighboring pixel reconstruction values are fixed for the current block, i.e. (2 ⁇ p x,-1 -p x,-2 -pred x,0 ) and (2 ⁇ p -1,y -p -2,y -pred 0,y ) values are fixed, only the assumed inverse transformation residual (denoted by resi) will be different due to different symbol combinations, using c x to represent (2 ⁇ p x,-1 -p x,-2 -pred x,0 ), c y represents (2 ⁇ p -1, y -p -2, y -pred 0, y ), at this time the generation value ( Expressed by cost) can be written as the following formula,
  • Prediction only acts on the 4 ⁇ 4 region of the upper left corner of each 4 ⁇ 4 transform block that is greater than or equal to it. The reason is that the upper left corner of the transform block is where low-frequency coefficients are concentrated, and changes in the value of these coefficients have a greater impact on the entire transform block, so these coefficients are easier to predict than coefficients at other positions.
  • One implementation method is to directly select the non-zero coefficient with a large absolute value from the 8 non-zero transformation coefficients; the other implementation method is to sort the non-zero transformation coefficients in the 4 ⁇ 4 area and reflect them on the edge of the transformation unit after inverse transformation Energy size, determine the 8 non-zero coefficients with the largest energy as the transform coefficients to be predicted positive and negative. where the energy value is calculated as follows,
  • tc i,j is the transformation coefficient in the upper left corner region of 4 ⁇ 4 (i,j represents coordinates)
  • T i,j (k) is the transformation coefficient at position (i,j) when it is 1
  • the k-th inverse transform value in the left edge and upper edge of the current transform block, w and h represent the width and height of the current transform block.
  • these non-zero quantized coefficients can be positive or negative.
  • equal probability coding can be used, and sign prediction technology can also be used to predict the coefficients of these coefficients.
  • the plus and minus signs make predictions.
  • the sign prediction of non-zero quantized coefficients at the image edge and block edge due to the imperfection of related technologies, there may be defects such as limited transform block size and unreasonable cost calculation during sign prediction, resulting in the sign prediction results. Accuracy is low.
  • the embodiment of the present application provides a decoding method.
  • the absolute value of the reconstruction coefficient of the current block is determined; the absolute value of the reconstruction coefficient of the current block is scanned according to the preset scanning order, and it is determined that the current block is within the preset scanning sequence.
  • the embodiment of the present application also provides an encoding method, by determining the transformation coefficient of the current block; scanning the transformation coefficient of the current block according to the preset scanning order, and determining the last coefficient group of the current block in the preset scanning order; The last coefficient group performs sign prediction, and the sign prediction value of the last coefficient group is determined.
  • both the encoding end and the decoding end can scan the transform coefficients of the current block according to the preset scanning order, and then determine the last coefficient group of the current block in the preset scanning order, so as to perform Sign prediction, which not only allows blocks of more shapes and sizes to perform sign prediction, but also expands the scope of application of sign prediction technology; and in the process of sign prediction, for the current block at the upper boundary or left of the image or coding tree unit
  • the cost calculation method is also optimized, and at the same time, the energy calculation method for screening the transform coefficients to be predicted is also adaptively adjusted, thereby reducing the computational complexity and improving the accuracy of sign prediction Spend.
  • the encoder 100 may include: a segmentation unit 101, a prediction unit 102, a first adder 107, a transform unit 108, a quantization unit 109, an inverse quantization unit 110, an inverse transform unit 111, a second adder 112, A filtering unit 113, a decoded picture buffer (Decoded Picture Buffer, DPB) unit 114 and an entropy encoding unit 115.
  • the input of the encoder 100 may be a video composed of a series of pictures or a static picture
  • the output of the encoder 100 may be a bit stream (also called a "code stream") representing a compressed version of the input video. .
  • the segmentation unit 101 divides the pictures in the input video into one or more coding tree units (Coding Tree Units, CTUs).
  • CTUs Coding Tree Units
  • the segmentation unit 101 divides the picture into multiple tiles (or called tiles, tiles), and can further divide a tile into one or more bricks (bricks).
  • a tile or a brick can include one or more complete and/or partial CTUs.
  • the segmentation unit 101 may form one or more slices, wherein one slice may include one or more tiles arranged in a grid order in the picture, or one or more tiles covering a rectangular area in the picture.
  • the segmentation unit 101 may also form one or more sub-pictures, wherein one sub-picture may include one or more slices, tiles or bricks.
  • the division unit 101 transmits the CTU to the prediction unit 102 .
  • the prediction unit 102 may be composed of a block division unit 103, a motion estimation (Motion Estimation, ME) unit 104, a motion compensation (Motion Compensation, MC) unit 105 and an intra prediction unit 106.
  • the block partitioning unit 103 iteratively uses quadtree partitioning, binary tree partitioning and ternary tree partitioning to further divide the input CTU into smaller coding units (Coding Units, CUs).
  • Prediction unit 102 may use ME unit 104 and MC unit 105 to obtain an inter-prediction block for a CU.
  • Intra prediction unit 106 may obtain an intra prediction block for a CU using various intra prediction modes including MIP mode.
  • the rate-distortion optimized motion estimation approach can be invoked by the ME unit 104 and the MC unit 105 to obtain an inter prediction block
  • the rate-distortion optimized mode determination approach can be invoked by the intra prediction unit 106 to obtain an intra prediction block .
  • the prediction unit 102 outputs the prediction block of the CU, and the first adder 107 calculates the difference between the CU in the output of the division unit 101 and the prediction block of the CU, that is, the residual CU.
  • the transform unit 108 reads the residual CU and performs one or more transform operations on the residual CU to obtain coefficients.
  • the quantization unit 109 quantizes the coefficients and outputs the quantized coefficients (ie levels).
  • the inverse quantization unit 110 performs a scaling operation on the quantized coefficients to output reconstructed coefficients.
  • the inverse transform unit 111 performs one or more inverse transforms corresponding to the transforms in the transform unit 108 and outputs a reconstruction residual.
  • the second adder 112 calculates a reconstructed CU by adding the reconstruction residual to the prediction block of the CU from the prediction unit 102 .
  • the second adder 112 also sends its output to the prediction unit 102 for use as an intra prediction reference.
  • the filtering unit 113 performs loop filtering on the reconstructed picture or sub-picture.
  • the filtering unit 113 includes one or more filters, such as a deblocking filter, a sample adaptive offset (Sample Adaptive Offset, SAO) filter, an adaptive loop filter (Adaptive Loop Filter, ALF), a brightness map And chroma scaling (Luma Mapping with Chroma Scaling, LMCS) filters and filters based on neural networks, etc.
  • filters such as a deblocking filter, a sample adaptive offset (Sample Adaptive Offset, SAO) filter, an adaptive loop filter (Adaptive Loop Filter, ALF), a brightness map And chroma scaling (Luma Mapping with Chroma Scaling, LMCS) filters and filters based on neural networks, etc.
  • SAO sample adaptive offset
  • ALF adaptive Loop Filter
  • LMCS brightness map And chroma scaling
  • the output of the filtering unit 113 is decoded pictures or sub-pictures, which are buffered into the DPB unit 114 .
  • the DPB unit 114 outputs decoded pictures or sub-pictures according to timing and control information.
  • the pictures stored in the DPB unit 114 can also be used as a reference for the prediction unit 102 to perform inter prediction or intra prediction.
  • the entropy encoding unit 115 converts the parameters (such as control parameters and supplementary information) necessary for decoding pictures from the encoder 100 into binary form, and writes such binary form into the code stream according to the syntax structure of each data unit , that is, the encoder 100 finally outputs a code stream.
  • the encoder 100 may have a first processor and a first memory recording a computer program. When the first processor reads and runs the computer program, the encoder 100 reads the input video and generates a corresponding code stream. Additionally, encoder 100 may also be a computing device having one or more chips. These units, implemented as integrated circuits on the chip, have similar connection and data exchange functions as the corresponding units in FIG. 8A.
  • the decoder 200 may include: an analysis unit 201 , a prediction unit 202 , an inverse quantization unit 205 , an inverse transformation unit 206 , an adder 207 , a filter unit 208 and a decoded picture buffer unit 209 .
  • the input of the decoder 200 is a bit stream representing a compressed version of a video or a still picture
  • the output of the decoder 200 may be a decoded video composed of a series of pictures or a decoded still picture.
  • the input code stream of the decoder 200 may be the code stream generated by the encoder 100 .
  • the parsing unit 201 parses the input code stream and obtains the value of the syntax element from the input code stream.
  • the parsing unit 201 converts the binary representation of the syntax elements into digital values and sends the digital values to units in the decoder 200 to obtain one or more decoded pictures.
  • the parsing unit 201 may also parse one or more syntax elements from the input code stream to display the decoded picture.
  • the parsing unit 201 sends the value of the syntax element and one or more variables set or determined according to the value of the syntax element to obtain one or more decoded pictures to the decoder 200 unit.
  • the prediction unit 202 determines a prediction block for a currently decoded block (eg, CU).
  • the prediction unit 202 may include a motion compensation unit 203 and an intra prediction unit 204 .
  • the prediction unit 202 passes the relevant parameters from the parsing unit 201 to the motion compensation unit 203 to obtain the inter-frame prediction block;
  • the intra-frame prediction mode When the MIP mode indicated based on the MIP mode index value) is used to decode the current decoding block, the prediction unit 202 transmits the relevant parameters from the parsing unit 201 to the intra prediction unit 204 to obtain the intra prediction block.
  • the dequantization unit 205 has the same function as the dequantization unit 110 in the encoder 100 .
  • the inverse quantization unit 205 performs a scaling operation on the quantization coefficients (ie levels) from the parsing unit 201 to obtain reconstruction coefficients.
  • the inverse transform unit 206 has the same function as the inverse transform unit 111 in the encoder 100 .
  • the inverse transform unit 206 performs one or more transform operations (ie, the inverse of the one or more transform operations performed by the inverse transform unit 111 in the encoder 100 ) to obtain the reconstruction residual.
  • the adder 207 performs an addition operation on its inputs (the predicted block from the prediction unit 202 and the reconstructed residual from the inverse transform unit 206) to obtain the reconstructed block of the currently decoded block.
  • the reconstructed block is also sent to the prediction unit 202 to be used as a reference for other blocks encoded in intra prediction mode.
  • filtering unit 208 After all CUs in a picture or sub-picture are reconstructed, filtering unit 208 performs loop filtering on the reconstructed picture or sub-picture.
  • the filtering unit 208 includes one or more filters, such as a deblocking filter, a sampling adaptive compensation filter, an adaptive loop filter, a luma mapping and chroma scaling filter, and a neural network-based filter.
  • filters such as a deblocking filter, a sampling adaptive compensation filter, an adaptive loop filter, a luma mapping and chroma scaling filter, and a neural network-based filter.
  • filtering unit 208 determines that the reconstructed block is not used as a reference when decoding other blocks, filtering unit 208 performs loop filtering on one or more target pixels in the reconstructed block.
  • the output of the filtering unit 208 is a decoded picture or sub-picture, and the decoded picture or sub-picture is cached in the DPB unit 209 .
  • the DPB unit 209 outputs decoded pictures or sub-pictures according to timing and control information.
  • the picture stored in the DPB unit 209 can also be used as a reference to perform inter prediction or intra prediction by the prediction unit 202 .
  • the decoder 200 may have a second processor and a second memory recording a computer program. When the first processor reads and runs the computer program, the decoder 200 reads the input code stream and generates a corresponding decoded video. Additionally, decoder 200 may also be a computing device having one or more chips. These units implemented on-chip as integrated circuits have similar connectivity and data exchange functions as the corresponding units in Figure 8B.
  • the current block specifically refers to the block currently to be encoded in the video image
  • the current block when the embodiment of the present application is applied to the decoder 200, the “current block “Specifically refers to the current block to be decoded in the video image.
  • the current block here may be a current coding unit, a current prediction unit, or a current transformation block, etc., which is not limited in this embodiment of the present application.
  • FIG. 9 shows a schematic flowchart of a decoding method provided in an embodiment of the present application.
  • the method may include:
  • S901 Analyze the code stream, and determine the absolute value of the reconstruction coefficient of the current block.
  • the decoding method in the embodiment of the present application is applied to a decoder, and may specifically be a sign prediction method, where the sign of the absolute value of the reconstruction coefficient in the current block is mainly predicted.
  • the decoding method of the embodiment of the present application is applied to the "analysis unit 201" part of the decoder 200.
  • the code stream obtains the absolute value of the reconstruction coefficient of the current block, so that the absolute value of the reconstruction coefficient that needs to be predicted is selected according to the absolute value of the reconstruction coefficient, and then the sign of the reconstruction coefficient is predicted.
  • the block size is usually greater than or equal to 4 ⁇ 4.
  • the sign prediction is also prohibited for intra blocks larger than 32 ⁇ 32 and inter blocks larger than 128 ⁇ 128.
  • the sign prediction can be applied to more shapes and more Multi-sized blocks extend the applicability of sign prediction techniques.
  • S902 Scan the absolute values of the reconstruction coefficients of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order.
  • S903 Perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
  • the absolute value of the reconstruction coefficient of the current block can be scanned according to the preset scanning order to determine the last coefficient group of the current block in the preset scanning order;
  • the sign prediction value of which can allow blocks of more shapes and sizes to perform sign prediction, and expand the application range of sign prediction technology.
  • the preset scanning order may be diagonal, Zigzag, horizontal, vertical, 4 ⁇ 4 sub-block scanning or any other scanning order, which is not limited herein.
  • the method may further include:
  • the size of the current block is 1 ⁇ N, and N is an integer greater than or equal to 16, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient group is 1 ⁇ 16;
  • the size of the current block is N ⁇ 1, and N is an integer greater than or equal to 16, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient group is 16 ⁇ 1;
  • the size of the current block is 2 ⁇ N, and N is an integer greater than or equal to 8, then determine that the absolute value of the reconstruction coefficient of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient group is 2 ⁇ 8;
  • the size of the current block is N ⁇ 2, and N is an integer greater than or equal to 8, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient group is 8 ⁇ 2;
  • the size of the current block is M ⁇ N, and both M and N are integers greater than or equal to 4, it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (M ⁇ N/16) coefficient groups, and the size of the coefficient group for 4 ⁇ 4.
  • ECM for a side whose length is less than 4, ECM currently does not allow such a block to use sign prediction. However, in the embodiment of the present application, it is allowed to use sign prediction for non-zero coefficients in all regions or partial regions in the block (for example, the same as the 4 ⁇ 4 region at the upper left corner position in ECM).
  • sign prediction is allowed for non-zero coefficients in the 4 ⁇ 4 area at the upper left corner (coefficient group at the upper left corner); similarly, for blocks smaller than 4 ⁇ 4 For the current block, it is also allowed to select non-zero coefficients in the last coefficient group in the preset scanning order to use sign prediction.
  • FIG. 10 it shows a schematic diagram of a test result of using sign prediction for a block smaller than 4 ⁇ 4 provided by an embodiment of the present application.
  • Figure 10 it is provided here that when a block smaller than 4 ⁇ 4 is allowed to use sign prediction for the last coefficient group in the preset scanning order, the coding effect improvement brought by the ECM reference software under full intra-frame coding is compared.
  • the performance improvement of 0.02%, 0.1% and 0.07% was brought respectively, and the encoding time (expressed by EncT) and decoding time (expressed by DecT said) little changed.
  • the embodiment of the present application may also cancel the restriction on the maximum size of a block using the sign prediction technology.
  • the current intra block larger than 32 ⁇ 32 and the inter block larger than 128 ⁇ 128 cannot use sign prediction, but actually the maximum size block is currently allowed to be 256 ⁇ 256. So removing the restriction on the maximum block size means allowing up to 256x256 transformation blocks in part (for example, the 4x4 region with the upper left corner position in ECM) or the sign of non-zero coefficient signs in all regions predict.
  • the method may also include:
  • the last coefficient group is determined according to the absolute value of the reconstruction coefficients in the first area; wherein, the number of absolute values of the reconstruction coefficients in the last coefficient group is 2 L , and L is the number greater than or equal to zero.
  • the 4 ⁇ 4 area at the upper left corner can be directly used as the last coefficient group.
  • the number of non-zero coefficients used for symbol prediction is usually K
  • the upper left area can be appropriately expanded at this time, for example, the 8 ⁇ 8 area, 16 ⁇ 16 area, etc. as the last coefficient group, so that the number of absolute value reconstruction coefficients in the last coefficient group is 2L .
  • the first area may be a 4 ⁇ 4 area, but it is not specifically limited here.
  • K is an integer greater than zero.
  • the value of K may be 8; for the second transformation, the value of K may be 4, but this is not specifically limited.
  • the use range of the current block that can be predicted by using the sign of the transform coefficient can be expanded, allowing blocks with more shapes and sizes to use the sign prediction technology.
  • a block smaller than 4 ⁇ 4 a block larger than 32 ⁇ 32 in an intra frame, and a block larger than 128 ⁇ 128 in an inter frame can all use this symbol prediction technology.
  • the performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
  • the cost value of the last coefficient group under the combination of various candidate symbols is calculated
  • the symbol prediction value corresponding to the last coefficient group is determined.
  • the first adjacent pixel value may be composed of reference pixel values in two adjacent columns on the left side of the current block.
  • the performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
  • the current block is at the left boundary of the object to which it belongs, then calculate the cost value of the last coefficient group under various candidate symbol combinations according to the second adjacent pixel value corresponding to the upper side of the current block;
  • the symbol prediction value corresponding to the last coefficient group is determined.
  • the second adjacent pixel values may be composed of reference pixel values of two adjacent rows on the upper side of the current block.
  • the belonging object may include at least one of the following: an image and a coding tree unit. That is to say, no matter whether the current block is at the upper boundary of the image or the upper boundary of the coding tree unit, at this time, the last coefficient group can be calculated according to the value of the first adjacent pixel corresponding to the left side of the current block among multiple candidate The cost value under the symbol combination; or, whether the current block is at the left boundary of the image or the left boundary of the coding tree unit, at this time, the last coefficient can be calculated according to the second adjacent pixel value corresponding to the upper side of the current block The cost value of the group under various candidate symbol combinations. It should be noted that the multiple candidate symbol combinations here may be determined based on different symbol prediction modes.
  • Sign prediction acts on a certain block area in the current block, for example, the N ⁇ M area at the upper left corner, where M and N are positive integers.
  • the current block needs to use the reconstructed value in the upper coding tree unit.
  • the calculation of the upper side cost can be omitted; similar to the cost of processing the edge of the image, the calculation of the reconstruction value in the upper coding tree unit is omitted, as shown below,
  • the current block For the current block in the first column of the coding tree unit, the current block needs to use the reconstructed value in the left coding tree unit.
  • the calculation of the left cost can also be omitted; similar to the cost of processing the edge of the image, the calculation of the reconstruction value in the left coding tree unit is omitted, as shown below,
  • the symbol prediction needs to refer to the reconstruction values of the two rows and two columns above and on the left, but in the above-mentioned embodiment, it is proposed that only the left The side way can reduce the complexity.
  • an alternative solution is also proposed here, which is to modify the use of the upper two rows to only use the upper row, while still using two columns on the left.
  • performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
  • the symbol prediction value corresponding to the last coefficient group is determined.
  • the first adjacent pixel value may be composed of the reference pixel values of two columns adjacent to the left side of the current block
  • the second adjacent pixel value may be composed of the reference pixel values of the upper side of the current block adjacent to one row Composed of reference pixel values.
  • the cost calculation is as follows,
  • performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
  • the symbol prediction value corresponding to the last coefficient group is determined.
  • the first adjacent pixel value may be composed of reference pixel values adjacent to the left side of the current block in one column
  • the second adjacent pixel value may be composed of reference pixel values adjacent to the upper side of the current block in two rows. Composed of reference pixel values.
  • the cost calculation is as follows,
  • the belonging object may include at least one of the following: an image and a coding tree unit.
  • the embodiment of the present application can even use the reference pixel values of a column adjacent to the left side of the current block and the reference pixel values of a row adjacent to the upper side of the current block.
  • the cost value is calculated with reference to the pixel value, which is not specifically limited here.
  • determining the symbol prediction value corresponding to the last coefficient group according to the cost values under the various candidate symbol combinations may include:
  • the symbol prediction value corresponding to the last coefficient group is determined.
  • the cost calculation method needs to be adjusted, for example, the upper side cost calculation is restricted, and the reconstruction value obtained across the coding tree unit is reduced In the case of , especially take the reconstructed value in the coding tree unit above.
  • the embodiment of the present application proposes a simplified solution: directly skip the upper side cost calculation or only consider using one row.
  • the cost calculation always skips the side that has no reconstruction value, for example, as shown in Figure 13, (a) shows that the current block is on the top of the image Border, (b) shows that the current block is at the left border of the image. If the current block is in the first row of the image (that is, the upper boundary), then the cost calculation skips the upper side and only calculates the left side, as shown in the above formula (5); if the current block is in the first column of the image (that is, the left boundary ), then the cost calculation skips the left side and only counts the upper side, as shown in the above formula (6).
  • the total energy change of the upper side and the left side is still considered, so for the method of selecting non-zero transformation coefficients based on the energy size to predict the sign, the calculation is not reconstructed The energy on that side of the value is meaningless.
  • the embodiment of the present application proposes another implementation manner. Firstly, the transform coefficients whose sign is to be predicted are selected based on the magnitude of the energy on the upper side and the left side of the current block. This way of selecting coefficients needs to satisfy the following restrictions:
  • the defined screening method can be used to filter out K coefficients with signs to be predicted.
  • performing sign prediction on the last coefficient group and determining a sign prediction value of the last coefficient group may include:
  • K is an integer greater than zero
  • the selection of K absolute values of non-zero reconstruction coefficients from the last coefficient group may include:
  • the largest K energy values are determined from the energy values of the non-zero reconstruction coefficients, and the absolute values of K selected non-zero reconstruction coefficients are determined according to the K energy values.
  • the first K values scanned may be determined as the absolute values of the selected K non-zero reconstruction coefficients according to the raster scanning order in the ECM; Alternatively, it is also possible to determine the largest K absolute values according to the absolute value, and then determine the selected K absolute values of non-zero reconstruction coefficients according to the K absolute values; or, it is also possible to determine the largest K absolute values according to the energy value energy values, and then determine K selected absolute values of non-zero reconstruction coefficients according to the K energy values, which are not specifically limited in this embodiment of the present application.
  • the determining the energy value of the non-zero reconstruction coefficient in the last coefficient group may include:
  • the energy value of the non-zero reconstruction coefficient is calculated according to the inverse transformation value of the non-zero reconstruction coefficient on the upper side of the current block.
  • the cost calculation on the upper side is skipped. At this time, only the left side is used for energy calculation.
  • the energy calculation is as follows,
  • tc i,j is the transformation coefficient in the area of the upper left corner of 4 ⁇ 4 (i,j represents coordinates)
  • T i,j (k) is the transformation coefficient at position (i,j) when it is 1, in The k-th inverse transform value in the left edge and upper edge of the current transform block
  • w and h represent the width and height of the current transform block.
  • the criteria for screening the transformation coefficients of the sign to be predicted also need to be optimized accordingly.
  • the cost calculation only refers to a certain side
  • the energy Calculations should also refer to that side only.
  • the method may further include: if the current block is at the upper left corner of the object to which it belongs, determining the absolute value of the reconstruction coefficient of the current block without performing sign prediction.
  • the embodiment of the present application may directly skip the sign prediction of the transform coefficient for this block.
  • the test is carried out in the full intra-frame coding configuration, and the codec performance changes are shown in Figure 16. According to FIG. 16 , it can be obtained that if the transform block with no adjacent reference block on the upper left is skipped, a certain encoding performance gain can also be provided.
  • the method may further include:
  • S1702 Determine the original sign value of the last coefficient group according to the sign prediction value of the last coefficient group and the sign residual value of the last coefficient group.
  • S1703 Determine the reconstruction coefficient of the current block according to the signed original value of the last coefficient group.
  • the sign residual value of the last coefficient group can be decoded based on the context model.
  • the original sign of the last coefficient group is determined according to the sign prediction value of the last coefficient group and the sign residual value of the last coefficient group.
  • the value may include: performing an XOR operation on the predicted value of the sign of the last coefficient group and the residual value of the sign of the last coefficient group to determine the original value of the sign of the last coefficient group.
  • the determining the original sign value of the last coefficient group according to the sign prediction value of the last coefficient group and the sign residual value of the last coefficient group may include: An addition operation is performed on the predicted value according to the sign of the last coefficient group and the sign residual value of the last coefficient group to determine the original sign value of the last coefficient group.
  • the decoder decodes the sign residual value of the sign from the context model, and then obtains the sign original value of the last coefficient group (that is, the real sign) according to the sign residual value and the sign prediction value,
  • the actual positive and negative signs are directly assigned to the reconstruction coefficients, and then subsequent decoding operations (for example, inverse transformation, reconstruction, etc.) are further completed.
  • the embodiment of the present application provides a decoding method, which determines the absolute value of the reconstruction coefficient of the current block by analyzing the code stream; scans the absolute value of the reconstruction coefficient of the current block according to the preset scanning order, and determines that the current block is in the preset scanning order.
  • the last coefficient group of ; perform sign prediction on the last coefficient group, and determine the sign prediction value of the last coefficient group.
  • the transform coefficients of the current block are scanned according to the preset scanning order, and then the last coefficient group of the current block in the preset scanning order is determined, so as to perform sign prediction on the last coefficient group, which not only allows more shapes Blocks of more sizes can be used for symbol prediction, which expands the applicable scope of symbol prediction technology; and in the process of symbol prediction, for the case where the current block is at the upper boundary or left boundary of the image or coding tree unit, the cost calculation method is also adjusted. Optimization is carried out, and at the same time, adaptive adjustments are made to the energy calculation method for screening the transform coefficients to be predicted, thereby reducing the computational complexity and improving the sign prediction accuracy of the sign.
  • FIG. 18 shows the first schematic flowchart of an encoding method provided by the embodiment of the present application.
  • the method may include:
  • the encoding method in the embodiment of the present application is applied to an encoder, and specifically may be a sign prediction method, where the sign of the transform coefficient in the current block is mainly predicted.
  • the encoding method of the embodiment of the present application is applied to the "entropy encoding unit 115" part of the encoder 100.
  • the entropy encoding unit 115 it can The residual value of the symbol is entropy coded by using the adaptive binary arithmetic coding mode based on the context model, and then written into the code stream.
  • the sign residual value is determined based on the sign original value and the sign prediction value.
  • the block size is usually greater than or equal to 4 ⁇ 4.
  • the sign prediction is also prohibited for intra blocks larger than 32 ⁇ 32 and inter blocks larger than 128 ⁇ 128.
  • the sign prediction can be applied to blocks of more shapes and sizes, extending The scope of applicability of sign prediction technology.
  • S1802 Scan the transform coefficients of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order.
  • S1803 Perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
  • the transform coefficients of the current block can be scanned according to the preset scanning order to determine the last coefficient group of the current block in the preset scanning order; then the symbol of the last coefficient group can be predicted to determine the sign of the last coefficient group Prediction value, so that blocks with more shapes and sizes can be used for symbol prediction, which expands the applicable range of symbol prediction technology.
  • the preset scanning order may be diagonal, Zigzag, horizontal, vertical, 4 ⁇ 4 sub-block scanning or any other scanning order, which is not limited herein.
  • the method may further include:
  • the transform coefficient of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient group is 1 ⁇ 16;
  • the transform coefficient of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient group is 16 ⁇ 1;
  • the transform coefficient of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient group is 2 ⁇ 8;
  • N is an integer greater than or equal to 8
  • the transform coefficients of the current block can be divided into (M ⁇ N/16) coefficient groups, and the size of the coefficient groups is 4 ⁇ 4.
  • ECM for a side whose length is less than 4, ECM currently does not allow such a block to use sign prediction. However, in the embodiment of the present application, it is allowed to use sign prediction for non-zero transform coefficients in all regions or partial regions in the block (for example, the same as the 4 ⁇ 4 region at the upper left corner position in ECM).
  • the non-zero transform coefficients in the 4 ⁇ 4 area (coefficient group at the upper left position) in the upper left corner position allow the use of sign prediction; similarly, for the current block smaller than 4 ⁇ 4
  • Fig. 10 shows the encoding effect of the ECM reference software under full intra-frame encoding when the last coefficient group in the preset scanning order is allowed to use sign prediction for a block smaller than 4 ⁇ 4 provided by the embodiment of the present application. Raise sign.
  • the embodiment of the present application may also cancel the restriction on the maximum size of a block using the sign prediction technology.
  • the current intra block larger than 32 ⁇ 32 and the inter block larger than 128 ⁇ 128 cannot use sign prediction, but actually the maximum size block is currently allowed to be 256 ⁇ 256. So canceling the block maximum size restriction means allowing up to 256 ⁇ 256 transformation blocks in part (for example, the same as in the ECM 4 ⁇ 4 region for the upper left corner position) or the sign of non-zero coefficient signs in all regions predict.
  • the method may also include:
  • the 4 ⁇ 4 area at the upper left corner can be directly used as the last coefficient group.
  • the number of non-zero transform coefficients used for symbol prediction is usually K
  • the upper left corner area can be appropriately expanded at this time, for example, the upper left corner position
  • the 8 ⁇ 8 area, 16 ⁇ 16 area, etc. of the last coefficient group are used as the last coefficient group, so that the number of transformation coefficients in the last coefficient group is 2L .
  • the first area may be a 4 ⁇ 4 area, but it is not specifically limited here.
  • K is an integer greater than zero.
  • the value of K may be 8; for the second transformation, the value of K may be 4, but this is not specifically limited.
  • the use range of the current block that can be predicted by using the sign of the transform coefficient can be expanded, allowing blocks with more shapes and sizes to use the sign prediction technology.
  • a block smaller than 4 ⁇ 4 a block larger than 32 ⁇ 32 in an intra frame, and a block larger than 128 ⁇ 128 in an inter frame can all use this symbol prediction technology.
  • this step may include:
  • S1902 Determine the minimum cost value from the cost values under various candidate symbol combinations.
  • S1903 Determine the symbol prediction value corresponding to the last coefficient group according to the candidate symbol combination corresponding to the minimum cost value.
  • the first adjacent pixel value may be composed of reference pixel values in two adjacent columns on the left side of the current block.
  • the current block is at the upper boundary of the object to which it belongs, then calculate the cost value of the last coefficient group under various candidate symbol combinations according to the first adjacent pixel value corresponding to the left side of the current block;
  • the cost value under the candidate symbol combination determines the symbol prediction value corresponding to the last coefficient group.
  • the first adjacent pixel value may be composed of reference pixel values in two adjacent columns on the left side of the current block.
  • the performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
  • the current block is at the left boundary of the object to which it belongs, then calculate the cost value of the last coefficient group under various candidate symbol combinations according to the second adjacent pixel value corresponding to the upper side of the current block;
  • the symbol prediction value corresponding to the last coefficient group is determined.
  • the second adjacent pixel values may be composed of reference pixel values of two adjacent rows on the upper side of the current block.
  • the belonging object may include at least one of the following: an image and a coding tree unit. That is to say, no matter whether the current block is at the upper boundary of the image or the upper boundary of the coding tree unit, at this time, the last coefficient group can be calculated according to the value of the first adjacent pixel corresponding to the left side of the current block among multiple candidate The cost value under the symbol combination; or, whether the current block is at the left boundary of the image or the left boundary of the coding tree unit, at this time, the last coefficient can be calculated according to the second adjacent pixel value corresponding to the upper side of the current block The cost value of the group under various candidate symbol combinations. It should be noted that the multiple candidate symbol combinations here may be determined based on different symbol prediction modes.
  • the premise of the implementation of the technical solution of the embodiment of the present application is that the following restrictions are met: (1) the current sequence allows the use of symbol prediction technology; (2) the symbol prediction acts on a certain block area in the current block, for example The N ⁇ M area at the upper left corner, where M and N are positive integers.
  • the current block in the first row of the coding tree unit the current block needs to use the reconstructed value in the upper coding tree unit.
  • the calculation of the upper side cost can be omitted; similar to the cost of processing the edge of the image, the calculation of the reconstruction value in the upper coding tree unit is omitted, as shown in the above formula (5).
  • the current block in the first column of the coding tree unit the current block needs to use the reconstructed value in the left coding tree unit.
  • the calculation of the left cost can also be omitted; similar to the cost of processing the edge of the image, the calculation of the reconstruction value in the left coding tree unit is omitted, as shown in the above formula (6).
  • symbol prediction needs to refer to the reconstructed values of the two rows and two columns above and on the left.
  • An alternative would be to change from using the top two rows to just the top row, while still using two columns to the left.
  • the performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
  • the symbol prediction value corresponding to the last coefficient group is determined.
  • the first adjacent pixel value may be composed of reference pixel values adjacent to two columns on the left side of the current block
  • the second adjacent pixel value may be composed of reference pixel values adjacent to one row on the upper side of the current block composed of values.
  • the cost calculation is shown in Equation (7) above.
  • performing sign prediction on the last coefficient group and determining a sign prediction value of the last coefficient group may include:
  • the symbol prediction value corresponding to the last coefficient group is determined.
  • the first adjacent pixel value may be composed of reference pixel values adjacent to one column on the left side of the current block
  • the second adjacent pixel value may be composed of reference pixel values adjacent to two rows on the upper side of the current block composed of values.
  • the cost calculation is shown in equation (8) above.
  • the belonging object may include at least one of the following: an image and a coding tree unit.
  • the embodiment of the present application can even use the reference pixel values of a column adjacent to the left side of the current block and the reference pixel values of a row adjacent to the upper side of the current block.
  • the cost value is calculated with reference to the pixel value, which is not specifically limited here.
  • determining the symbol prediction value corresponding to the last coefficient group according to the cost values under the various candidate symbol combinations may include:
  • the symbol prediction value corresponding to the last coefficient group is determined.
  • the cost calculation method needs to be adjusted, for example, the upper side cost calculation is restricted, and the reconstruction value obtained across the coding tree unit is reduced In the case of , especially take the reconstructed value in the coding tree unit above.
  • the embodiment of the present application proposes a simplified solution: directly skip the upper side cost calculation or only consider using one line.
  • the cost calculation always skips the side that has no reconstruction value.
  • the total energy change of the upper side and the left side is still considered, so for the method of selecting non-zero transformation coefficients based on the energy size to predict the sign, the calculation is not reconstructed The energy on that side of the value is meaningless.
  • the embodiment of the present application proposes another implementation manner.
  • the transform coefficients whose sign is to be predicted are selected based on the magnitude of the energy on the upper side and the left side of the current block.
  • performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
  • K is an integer greater than zero
  • the K non-zero transform coefficients are used to perform sign prediction, and the sign prediction values of the K non-zero transform coefficients are determined.
  • the selection of K non-zero transform coefficients from the last coefficient group may include:
  • the largest K energy values are determined from the energy values of the non-zero transformation coefficients, and K selected non-zero transformation coefficients are determined according to the K energy values.
  • the screening of non-zero transform coefficients used for sign prediction may be to determine the first K values scanned as the selected K non-zero transform coefficients according to the raster scanning order in the ECM; or , or determine the largest K absolute values according to the absolute value, and then determine the selected K non-zero transformation coefficients according to the K absolute values; or, determine the largest K energy values according to the energy value, Then, K selected non-zero transformation coefficients are determined according to the K energy values, which is not specifically limited in this embodiment of the present application.
  • the determining the energy value of the non-zero transform coefficient in the last coefficient group may include:
  • the energy value of the non-zero transform coefficient is calculated according to the inverse transform value of the non-zero transform coefficient on the upper side of the current block.
  • the upper side cost calculation is skipped, and only the left side is used for energy calculation at this time, and the energy calculation is shown in the above formula (9).
  • the cost calculation on the left side is skipped. At this time, only the upper side is used for energy calculation, and the energy calculation is shown in the above formula (10).
  • the energy calculation should also skip the energy of a certain side, as shown in the above formulas (9) and (10). That is to say, when using a certain side cost calculation to skip the solution, the criteria for screening the transformation coefficients of the sign to be predicted also need to be optimized accordingly. For example, when the cost calculation only refers to a certain side, the energy Calculations should also refer to that side only.
  • the method may further include: if the current block is at the upper left corner of the object to which it belongs, determining that the transform coefficients of the current block do not perform sign prediction.
  • the method may further include:
  • S2001 Determine the sign residual value of the last coefficient group according to the sign prediction value of the last coefficient group.
  • the determining the sign residual value of the last coefficient group according to the sign prediction value of the last coefficient group may include:
  • a signed residual value of the last coefficient group is determined based on the signed original value of the last coefficient group and the signed predicted value of the last coefficient group.
  • the determining the sign residual value of the last coefficient group according to the sign original value of the last coefficient group and the sign predicted value of the last coefficient group may include: The signed original value and the signed predicted value of the last coefficient group are XORed to determine the signed residual value of the last coefficient group.
  • the determining the sign residual value of the last coefficient group according to the sign original value of the last coefficient group and the sign predicted value of the last coefficient group may include: for the last coefficient group Subtract the signed original value of , and the signed predicted value of the last coefficient group to determine the signed residual value of the last coefficient group.
  • encoding the sign residual value may be based on a context model.
  • the positive and negative values of the optimal quantization coefficient in the current mode selected by the current block through rate-distortion optimization are used as the original value of the sign, and then it can be determined according to the original value of the sign and the obtained predicted value of the sign
  • the signed residual value of the sign is extracted, and then the signed residual value of the sign is encoded using the context model.
  • the range of use of the transform block predicted using the sign of the transform coefficient can be extended, allowing blocks of more shapes and sizes to use this technology, specifically, for example, less than This technology can be used for 4 ⁇ 4 transformation blocks, transformation blocks larger than 32 ⁇ 32 in a frame, and larger than 128 ⁇ 128 in an interframe.
  • the cost calculation method should be adjusted, such as limiting the cost calculation on the upper side, and reducing the cost across coding tree units.
  • the embodiment of the present application also provides an encoding method, by determining the transformation coefficient of the current block; scanning the transformation coefficient of the current block according to the preset scanning order, and determining the last coefficient group of the current block in the preset scanning order; The last coefficient group performs sign prediction, and the sign prediction value of the last coefficient group is determined.
  • the transform coefficients of the current block are scanned according to the preset scanning order, and then the last coefficient group of the current block in the preset scanning order is determined, so as to perform sign prediction on the last coefficient group, which not only allows more shapes Blocks of more sizes can be used for symbol prediction, which expands the applicable scope of symbol prediction technology; and in the process of symbol prediction, for the case where the current block is at the upper boundary or left boundary of the image or coding tree unit, the cost calculation method is also adjusted. Optimization is carried out, and at the same time, adaptive adjustments are made to the energy calculation method for screening the transform coefficients to be predicted, thereby reducing the computational complexity and improving the sign prediction accuracy of the sign.
  • the embodiment of the present application provides a code stream, which is generated by performing bit coding according to the information to be encoded; wherein, the information to be encoded may include at least one of the following: reconstruction coefficient absolute value and signed residual value.
  • the encoder can transmit the absolute value of the reconstruction coefficient and the sign residual value to the decoder through the code stream, and then scan the absolute value of the reconstruction coefficient of the current block in the decoder according to the preset scanning order , and then determine the last coefficient group of the current block in the preset scanning order, so as to perform sign prediction on the last coefficient group, which not only allows more shapes and sizes of blocks to perform sign prediction, but also expands the sign prediction technology Scope of application; and in the sign prediction process, in view of the current block at the upper boundary or left boundary of the image or coding tree unit, the cost calculation method is also optimized, and at the same time, the energy of the positive and negative transform coefficients to be predicted is screened The calculation method is also adjusted adaptively, thereby reducing the calculation complexity and improving the sign prediction accuracy of the positive and negative signs.
  • FIG. 21 shows a schematic structural diagram of an encoder 210 provided in the embodiment of the present application.
  • the encoder 210 may include: a first determination unit 2101 and a first prediction unit 2102; wherein,
  • the first determining unit 2101 is configured to determine the transform coefficient of the current block
  • the first determining unit 2101 is further configured to scan the transform coefficients of the current block according to a preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
  • the first prediction unit 2102 is configured to perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
  • the encoder 210 may further include an encoding unit 2103;
  • the first determining unit 2101 is further configured to determine the sign residual value of the last coefficient group according to the sign prediction value of the last coefficient group;
  • the encoding unit 2103 is configured to encode the symbol residual value, and write the obtained encoded bits into a code stream.
  • the first determining unit 2101 is further configured to determine the original sign value of the last coefficient group according to the transform coefficient of the current block; and determine the original sign value of the last coefficient group according to the original sign value of the last coefficient group and the The sign prediction value of the last coefficient group is determined, and the sign residual value of the last coefficient group is determined.
  • the first determining unit 2101 is further configured to perform an XOR operation on the original sign value of the last coefficient group and the predicted sign value of the last coefficient group to determine the sign residual value of the last coefficient group.
  • the size of the current block is 1 ⁇ N, and N is an integer greater than or equal to 16, it is determined that the transform coefficients of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient groups is 1 ⁇ 16; if the size of the current block is N ⁇ 1, and N is an integer greater than or equal to 16, it is determined that the transform coefficient of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient group is 16 ⁇ 1; if the size of the current block is 2 ⁇ N, and N is an integer greater than or equal to 8, then it is determined that the transform coefficients of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient group is 2 ⁇ 8; If the size of the current block is N ⁇ 2, and N is an integer greater than or equal to 8, it is determined that the transform coefficients of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient group is 8 ⁇ 2; if the current The size of the block is M ⁇ N, and both M
  • the first determining unit 2101 is further configured to determine the first region; and determine the last coefficient group according to the transformation coefficients in the first region; wherein, the number of transformation coefficients in the last coefficient group is 2 L , and L is the number greater than or equal to zero.
  • the first prediction unit 2102 is further configured to calculate the last coefficient group in multiple The cost value under the candidate symbol combination; and according to the cost value under the various candidate symbol combinations, determine the symbol prediction value corresponding to the last coefficient group; wherein, the first adjacent pixel value is determined by the two adjacent left sides of the current block Column reference pixel values.
  • the first prediction unit 2102 is further configured to calculate the last coefficient group in multiple The cost value under the combination of candidate symbols; and according to the cost values under various candidate symbol combinations, determine the symbol prediction value corresponding to the last coefficient group; wherein, the second adjacent pixel value is determined by the upper side of the current block.
  • the reference pixel value of the row is further configured to calculate the last coefficient group in multiple The cost value under the combination of candidate symbols; and according to the cost values under various candidate symbol combinations, determine the symbol prediction value corresponding to the last coefficient group; wherein, the second adjacent pixel value is determined by the upper side of the current block.
  • the reference pixel value of the row is further configured to calculate the last coefficient group in multiple The cost value under the combination of candidate symbols.
  • the first prediction unit 2102 is further configured to: if the current block is at the upper boundary of the object to which it belongs, according to the value of the first adjacent pixel corresponding to the left side of the current block and the value corresponding to the upper side of the current block For the second adjacent pixel value, calculate the cost value of the last coefficient group under multiple candidate symbol combinations; and determine the symbol prediction value corresponding to the last coefficient group according to the cost values under multiple candidate symbol combinations; wherein, the first The adjacent pixel values are composed of reference pixel values in two adjacent columns on the left side of the current block, and the second adjacent pixel value is composed of reference pixel values in a row adjacent to the upper side of the current block.
  • the belonging object includes at least one of: a picture and a coding tree unit.
  • the first determination unit 2101 is further configured to determine the minimum cost value from the cost values under various candidate symbol combinations; and determine the symbol corresponding to the last coefficient group according to the candidate symbol combination corresponding to the minimum cost value Predictive value.
  • the first prediction unit 2102 is further configured to select K non-zero transform coefficients from the last coefficient group if the number of non-zero transform coefficients in the last coefficient group is greater than K; where K is an integer greater than zero; and perform sign prediction using K non-zero transform coefficients, and determine sign prediction values of the K non-zero transform coefficients.
  • the first determining unit 2101 is further configured to scan the last coefficient group in a raster scan order, and determine the first scanned K non-zero transform coefficients as K non-zero transform coefficients; or, Determine the absolute values of the non-zero transform coefficients in the last coefficient group, determine the largest K absolute values from the absolute values of the non-zero transform coefficients, determine the K non-zero transform coefficients according to the K absolute values; or, determine the last coefficient The energy values of the non-zero transform coefficients in the group, the largest K energy values are determined from the energy values of the non-zero transform coefficients, and the K non-zero transform coefficients are determined according to the K energy values.
  • the first determining unit 2101 is further configured to determine the inverse transform value of the non-zero transform coefficients in the last coefficient group on the left side of the current block and the inverse transform value on the upper side of the current block; and If the current block is on the upper boundary of the object to which it belongs, calculate the energy value of the non-zero transform coefficient according to the inverse transform value of the non-zero transform coefficient on the left side of the current block; The inverse transform value of the zero transform coefficient on the upper side of the current block, calculates the energy value of the non-zero transform coefficient.
  • the first determining unit 2101 is further configured to determine that the transform coefficients of the current block do not perform sign prediction if the current block is at the upper left corner of the object to which it belongs.
  • a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course it may also be a module, or it may be non-modular.
  • each component in this embodiment may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software function modules.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially or It is said that the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes several instructions to make a computer device (which can It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the method described in this embodiment.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other various media that can store program codes.
  • an embodiment of the present application provides a computer storage medium, which is applied to the encoder 210, and the computer storage medium stores a computer program, and when the computer program is executed by the first processor, it implements any one of the preceding embodiments. Methods.
  • the encoder 210 may include: a first communication interface 2201 , a first memory 2202 and a first processor 2203 ; each component is coupled together through a first bus system 2204 .
  • the first bus system 2204 is used to realize connection and communication between these components.
  • the first bus system 2204 also includes a power bus, a control bus and a status signal bus.
  • the various buses are labeled as first bus system 2204 in FIG. 22 . in,
  • the first communication interface 2201 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
  • the first memory 2202 is used to store computer programs that can run on the first processor 2203;
  • the first processor 2203 is configured to, when running the computer program, execute:
  • Sign prediction is performed on the last coefficient group, and a sign prediction value of the last coefficient group is determined.
  • the first memory 2202 in the embodiment of the present application may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories.
  • the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electronically programmable Erase Programmable Read-Only Memory (Electrically EPROM, EEPROM) or Flash.
  • the volatile memory can be Random Access Memory (RAM), which acts as external cache memory.
  • RAM Static Random Access Memory
  • DRAM Dynamic Random Access Memory
  • Synchronous Dynamic Random Access Memory Synchronous Dynamic Random Access Memory
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDRSDRAM
  • enhanced SDRAM ESDRAM
  • Synchlink DRAM SLDRAM
  • Direct Memory Bus Random Access Memory Direct Rambus RAM, DRRAM
  • the first memory 2202 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
  • the first processor 2203 may be an integrated circuit chip, which has a signal processing capability. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the first processor 2203 or instructions in the form of software.
  • the above-mentioned first processor 2203 may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed.
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • the steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register.
  • the storage medium is located in the first memory 2202, and the first processor 2203 reads the information in the first memory 2202, and completes the steps of the above method in combination with its hardware.
  • the embodiments described in this application may be implemented by hardware, software, firmware, middleware, microcode or a combination thereof.
  • the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing device (DSP Device, DSPD), programmable Logic device (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other devices used to perform the functions described in this application electronic unit or its combination.
  • the techniques described herein can be implemented through modules (eg, procedures, functions, and so on) that perform the functions described herein.
  • Software codes can be stored in memory and executed by a processor. Memory can be implemented within the processor or external to the processor.
  • the first processor 2203 is further configured to execute the method described in any one of the foregoing embodiments when running the computer program.
  • This embodiment provides an encoder, and the encoder may include a first determination unit and a first prediction unit.
  • the transform coefficients of the current block are scanned according to the preset scanning order, and the last coefficient group of the current block in the preset scanning order is determined, so as to perform sign prediction on the last coefficient group, which not only allows more shapes and more Multi-size blocks can be used for sign prediction, which expands the scope of application of sign prediction technology; and in the process of sign prediction, for the case where the current block is at the upper boundary or left boundary of the image or coding tree unit, the cost calculation method is also adjusted. Optimization, and at the same time, adaptive adjustments are made to the energy calculation method for screening the transform coefficients to be predicted, which also reduces the computational complexity and improves the sign prediction accuracy of the sign.
  • FIG. 23 shows a schematic diagram of the composition and structure of a decoder 230 provided in the embodiment of the present application.
  • the decoder 230 may include: a decoding unit 2301, a second determination unit 2302, and a second prediction unit 2303; wherein,
  • the decoding unit 2301 is configured to analyze the code stream and determine the absolute value of the reconstruction coefficient of the current block
  • the second determining unit 2302 is configured to scan the absolute value of the reconstruction coefficient of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
  • the second prediction unit 2303 is configured to perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
  • the decoding unit 2301 is further configured to analyze the code stream, determine the sign residual value of the last coefficient group; and determine according to the sign prediction value of the last coefficient group and the sign residual value of the last coefficient group The signed original value of the last coefficient group; and determining the reconstruction coefficient of the current block according to the signed original value of the last coefficient group.
  • the second determining unit 2302 is further configured to perform an XOR operation on the predicted sign value of the last coefficient group and the sign residual value of the last coefficient group to determine the original sign value of the last coefficient group.
  • the second determining unit 2302 is further configured to determine that the absolute value of the reconstruction coefficient of the current block can be divided into (N/16 ) coefficient groups, and the size of the coefficient group is 1 ⁇ 16; if the size of the current block is N ⁇ 1, and N is an integer greater than or equal to 16, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/16 ) coefficient groups, and the size of the coefficient group is 16 ⁇ 1; if the size of the current block is 2 ⁇ N, and N is an integer greater than or equal to 8, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/8 ) coefficient groups, and the size of the coefficient group is 2 ⁇ 8; if the size of the current block is N ⁇ 2, and N is an integer greater than or equal to 8, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/8 ) coefficient groups, and the size of the coefficient group is 8 ⁇ 2; if the size of the current block is M ⁇ N
  • the second determining unit 2302 is further configured to determine the first area; and determine the last coefficient group according to the absolute value of the reconstruction coefficient in the first area; wherein, the number of absolute values of the reconstruction coefficient in the last coefficient group is 2 L , and L is a number greater than or equal to zero.
  • the second prediction unit 2303 is further configured to calculate the last coefficient group in multiple The cost value under the candidate symbol combination; and according to the cost value under the various candidate symbol combinations, determine the symbol prediction value corresponding to the last coefficient group; wherein, the first adjacent pixel value is determined by the two adjacent left sides of the current block Column reference pixel values.
  • the second prediction unit 2303 is further configured to calculate the last coefficient group in multiple The cost value under the combination of candidate symbols; and according to the cost values under various candidate symbol combinations, determine the symbol prediction value corresponding to the last coefficient group; wherein, the second adjacent pixel value is determined by the upper side of the current block.
  • the reference pixel value of the row is further configured to calculate the last coefficient group in multiple The cost value under the combination of candidate symbols; and according to the cost values under various candidate symbol combinations, determine the symbol prediction value corresponding to the last coefficient group; wherein, the second adjacent pixel value is determined by the upper side of the current block.
  • the reference pixel value of the row is further configured to calculate the last coefficient group in multiple The cost value under the combination of candidate symbols.
  • the second prediction unit 2303 is further configured to: if the current block is at the upper boundary of the object to which it belongs, according to the value of the first adjacent pixel corresponding to the left side of the current block and the value corresponding to the upper side of the current block For the second adjacent pixel value, calculate the cost value of the last coefficient group under multiple candidate symbol combinations; and determine the symbol prediction value corresponding to the last coefficient group according to the cost values under multiple candidate symbol combinations; wherein, the first The adjacent pixel values are composed of reference pixel values in two adjacent columns on the left side of the current block, and the second adjacent pixel value is composed of reference pixel values in a row adjacent to the upper side of the current block.
  • the belonging object includes at least one of: a picture and a coding tree unit.
  • the second determination unit 2302 is further configured to determine the minimum cost value from the cost values under various candidate symbol combinations; and determine the symbol corresponding to the last coefficient group according to the candidate symbol combination corresponding to the minimum cost value Predictive value.
  • the second prediction unit 2303 is further configured to select K absolute values of non-zero reconstruction coefficients from the last coefficient group if the number of absolute values of non-zero reconstruction coefficients in the last coefficient group is greater than K; Wherein, K is an integer greater than zero; and performing sign prediction by using the absolute values of the K non-zero reconstruction coefficients, and determining the sign prediction values of the K absolute values of the non-zero reconstruction coefficients.
  • the second determining unit 2302 is further configured to scan the last coefficient group in raster scan order, and determine the first scanned absolute values of the K non-zero reconstruction coefficients as the K non-zero reconstruction coefficient absolute values value; or, determine the absolute value of the non-zero reconstruction coefficient in the last coefficient group; determine the largest K absolute values from the absolute values of the non-zero reconstruction coefficients, and determine the K absolute values of the non-zero reconstruction coefficients according to the K absolute values; Or, determine the energy values of the non-zero reconstruction coefficients in the last coefficient group, determine the largest K energy values from the energy values of the non-zero reconstruction coefficients, and determine the K absolute values of the non-zero reconstruction coefficients according to the K energy values.
  • the second determining unit 2302 is further configured to determine the inverse transform value of the non-zero reconstruction coefficients in the last coefficient group on the left side of the current block and the inverse transform value on the upper side of the current block; and If the current block is at the upper boundary of the object, calculate the energy value of the non-zero reconstruction coefficient according to the inverse transformation value of the non-zero reconstruction coefficient on the left side of the current block; if the current block is at the left boundary of the object, calculate the energy value of the non-zero reconstruction coefficient according to the non-zero reconstruction coefficient The inverse transform value of the zero reconstruction coefficient on the upper side of the current block, calculates the energy value of the non-zero reconstruction coefficient.
  • the second determination unit 2302 is further configured to determine the absolute value of the reconstruction coefficient of the current block without performing sign prediction if the current block is at the upper left corner of the object to which it belongs.
  • a "unit” may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course it may also be a module, or it may be non-modular.
  • each component in this embodiment may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or in the form of software function modules.
  • the integrated units are implemented in the form of software function modules and are not sold or used as independent products, they can be stored in a computer-readable storage medium.
  • this embodiment provides a computer storage medium, which is applied to the decoder 230, and the computer storage medium stores a computer program, and when the computer program is executed by the second processor, any one of the preceding embodiments is implemented. the method described.
  • the decoder 230 may include: a second communication interface 2401 , a second memory 2402 and a second processor 2403 ; each component is coupled together through a second bus system 2404 .
  • the second bus system 2404 is used to realize connection and communication between these components.
  • the second bus system 2404 also includes a power bus, a control bus and a status signal bus.
  • the various buses are labeled as the second bus system 2404 in FIG. 24 . in,
  • the second communication interface 2401 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
  • the second memory 2402 is used to store computer programs that can run on the second processor 2403;
  • the second processor 2403 is configured to, when running the computer program, execute:
  • the second processor 2403 is further configured to execute the method described in any one of the foregoing embodiments when running the computer program.
  • the hardware function of the second memory 2402 is similar to that of the first memory 2202, and the hardware function of the second processor 2403 is similar to that of the first processor 2203; details will not be described here.
  • This embodiment provides a decoder, which may include a decoding unit, a second determining unit, and a second predicting unit.
  • the transform coefficients of the current block are scanned according to the preset scanning order, and the last coefficient group of the current block in the preset scanning order is determined, so as to perform sign prediction on the last coefficient group, which not only allows more shapes and more Multi-size blocks can be used for sign prediction, which expands the scope of application of sign prediction technology; and in the process of sign prediction, for the case where the current block is at the upper boundary or left boundary of the image or coding tree unit, the cost calculation method is also adjusted. Optimization, and at the same time, adaptive adjustments are made to the energy calculation method for screening the transform coefficients to be predicted, which also reduces the computational complexity and improves the sign prediction accuracy of the sign.
  • FIG. 25 shows a schematic diagram of the composition and structure of a codec system provided by the embodiment of the present application.
  • the codec system 250 may include an encoding device 2501 and a decoding device 2502 .
  • the encoding device 2501 may be the encoder described in any one of the foregoing embodiments
  • the decoding device 2502 may be the decoder described in any one of the foregoing embodiments.
  • the codec system 250 can scan the transform coefficients of the current block according to the preset scanning order, and then determine the last coefficient group of the current block in the preset scanning order, so that the last coefficient group Perform sign prediction, which not only allows blocks of more shapes and sizes to perform sign prediction, expanding the scope of application of sign prediction technology; but also in the process of sign prediction, for the current block at the upper boundary of the image or coding tree unit or In the case of the left boundary, the cost calculation method is also optimized, and the energy calculation method for screening the transform coefficients to be predicted is also adaptively adjusted, thereby reducing the computational complexity and improving the sign prediction of the sign Accuracy.
  • the transformation coefficient of the current block is determined; the transformation coefficient of the current block is scanned according to the preset scanning order, and the last coefficient group of the current block in the preset scanning order is determined; for the last coefficient sign prediction for the last coefficient group, determining the sign prediction value for the last coefficient group.
  • analyze the code stream to determine the absolute value of the reconstruction coefficient of the current block; scan the absolute value of the reconstruction coefficient of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order; Sign prediction is performed for one coefficient group, and the sign prediction value for the last coefficient group is determined.
  • both the encoding end and the decoding end can scan the transform coefficients of the current block according to the preset scanning order, and then determine the last coefficient group of the current block in the preset scanning order, so as to perform Sign prediction, which not only allows blocks of more shapes and sizes to perform sign prediction, but also expands the scope of application of sign prediction technology; and in the process of sign prediction, for the current block at the upper boundary or left of the image or coding tree unit
  • the cost calculation method is also optimized, and at the same time, the energy calculation method for screening the transform coefficients to be predicted is also adaptively adjusted, thereby reducing the computational complexity and improving the accuracy of sign prediction Spend.

Abstract

Disclosed in embodiments of the present application are encoding and decoding methods, a code stream, an encoder, a decoder, and a storage medium. The method comprises: analyzing a code stream, and determining absolute values of reconstruction coefficients of the current block; scanning, according to a preset scanning sequence, the absolute values of the reconstruction coefficients of the current block, and determining, on the basis of the preset scanning sequence, the last coefficient group of the current block; and performing sign prediction on the last coefficient group to determine a predicted sign value for the last coefficient group. Therefore, the invention not only expands the scope of application of the sign prediction technology, but also improves the accuracy of prediction of positive and negative signs.

Description

编解码方法、码流、编码器、解码器以及存储介质Codec method, code stream, encoder, decoder and storage medium 技术领域technical field
本申请实施例涉及视频编解码技术领域,尤其涉及一种编解码方法、码流、编码器、解码器以及存储介质。The embodiments of the present application relate to the technical field of video encoding and decoding, and in particular, relate to an encoding and decoding method, a code stream, an encoder, a decoder, and a storage medium.
背景技术Background technique
随着人们对视频显示质量要求的提高,计算机视觉相关领域得到了越来越多的关注。近年来,图像处理技术在各行各业都取得了成功地应用。对于视频图像的编解码过程而言,在编码端,针对待编码的图像数据,在经过变换和量化处理之后将通过熵编码单元进行压缩编码,而熵编码处理后所生成的码流将传输到解码端;然后解析码流,再经过反量化和逆变换处理之后,可以恢复出原始输入的图像数据。With the improvement of people's requirements for video display quality, computer vision-related fields have received more and more attention. In recent years, image processing technology has been successfully applied in various industries. For the encoding and decoding process of video images, at the encoding end, the image data to be encoded will be compressed and encoded through the entropy encoding unit after transformation and quantization, and the code stream generated after the entropy encoding process will be transmitted to Decoder; then analyze the code stream, and after inverse quantization and inverse transformation processing, the original input image data can be restored.
然而,对于一个经过变换和量化处理得到的非零量化系数,这些非零量化系数可以是正值也可以是负值,目前可以使用符号预测技术对这些系数的正负号进行预测。但是对于图像边缘和块边缘的非零量化系数的符号预测,由于相关技术的不完善性,导致在符号预测时可能存在变换块尺寸受限、代价计算不合理等缺陷,导致符号预测结果的准确度低。However, for a non-zero quantized coefficient obtained through transformation and quantization, these non-zero quantized coefficients can be positive or negative, and sign prediction technology can be used to predict the sign of these coefficients. However, for the sign prediction of non-zero quantized coefficients at the image edge and block edge, due to the imperfection of related technologies, there may be defects such as limited transform block size and unreasonable cost calculation during sign prediction, resulting in inaccurate sign prediction results. low degree.
发明内容Contents of the invention
本申请实施例提供一种编解码方法、码流、编码器、解码器以及存储介质,不仅能够拓展符号预测技术的适用范围,还能够提高正负号的符号预测准确度。Embodiments of the present application provide a codec method, a code stream, an encoder, a decoder, and a storage medium, which can not only expand the scope of application of sign prediction technology, but also improve the accuracy of sign prediction for positive and negative signs.
本申请实施例的技术方案可以如下实现:The technical solutions of the embodiments of the present application can be implemented as follows:
第一方面,本申请实施例提供了一种解码方法,应用于解码器,该方法包括:In the first aspect, the embodiment of the present application provides a decoding method applied to a decoder, and the method includes:
解析码流,确定当前块的重建系数绝对值;Analyze the code stream to determine the absolute value of the reconstruction coefficient of the current block;
按照预设扫描顺序对当前块的重建系数绝对值进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;Scan the absolute value of the reconstruction coefficient of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。Make a sign prediction for the last coefficient group, and determine the sign prediction value for the last coefficient group.
第二方面,本申请实施例提供了一种编码方法,应用于编码器,该方法包括:In the second aspect, the embodiment of the present application provides an encoding method applied to an encoder, and the method includes:
确定当前块的变换系数;determining transform coefficients for the current block;
按照预设扫描顺序对当前块的变换系数进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;Scan the transform coefficients of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。Make a sign prediction for the last coefficient group, and determine the sign prediction value for the last coefficient group.
第三方面,本申请实施例提供了一种码流,该码流是根据待编码信息进行比特编码生成的;其中,待编码信息包括下述至少之一:重建系数绝对值和符号残差值。In the third aspect, the embodiment of the present application provides a code stream, which is generated by bit coding according to the information to be encoded; wherein the information to be encoded includes at least one of the following: the absolute value of the reconstruction coefficient and the symbol residual value .
第四方面,本申请实施例提供了一种编码器,包括第一确定单元和第一预测单元;其中,In a fourth aspect, the embodiment of the present application provides an encoder, including a first determination unit and a first prediction unit; wherein,
第一确定单元,配置为确定当前块的变换系数;A first determining unit configured to determine a transform coefficient of a current block;
第一确定单元,还配置为按照预设扫描顺序对当前块的变换系数进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;The first determining unit is further configured to scan the transform coefficients of the current block according to a preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
第一预测单元,配置为对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。The first prediction unit is configured to perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
第五方面,本申请实施例提供了一种编码器,该编码器包括第一存储器和第一处理器;其中,In a fifth aspect, the embodiment of the present application provides an encoder, where the encoder includes a first memory and a first processor; wherein,
第一存储器,用于存储能够在第一处理器上运行的计算机程序;a first memory for storing a computer program capable of running on the first processor;
第一处理器,用于在运行计算机程序时,执行如第二方面所述的方法。The first processor is configured to execute the method as described in the second aspect when running the computer program.
第六方面,本申请实施例提供了一种解码器,包括解码单元、第二确定单元和第二预测单元;其中,In a sixth aspect, the embodiment of the present application provides a decoder, including a decoding unit, a second determination unit, and a second prediction unit; wherein,
解码单元,配置为解析码流,确定当前块的重建系数绝对值;The decoding unit is configured to analyze the code stream and determine the absolute value of the reconstruction coefficient of the current block;
第二确定单元,配置为按照预设扫描顺序对当前块的重建系数绝对值进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;The second determining unit is configured to scan the absolute value of the reconstruction coefficient of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
第一预测单元,配置为对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。The first prediction unit is configured to perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
第七方面,本申请实施例提供了一种解码器,该解码器包括第二存储器和第二处理器;其中,In a seventh aspect, the embodiment of the present application provides a decoder, where the decoder includes a second memory and a second processor; wherein,
第二存储器,用于存储能够在第二处理器上运行的计算机程序;a second memory for storing a computer program capable of running on the second processor;
第二处理器,用于在运行计算机程序时,执行如第一方面所述的方法。The second processor is configured to execute the method as described in the first aspect when running the computer program.
第八方面,本申请实施例提供了一种计算机存储介质,该计算机存储介质存储有计算机程序,计算机程序被执行时实现如第一方面所述的方法、或者实现如第二方面所述的方法。。In an eighth aspect, an embodiment of the present application provides a computer storage medium, the computer storage medium stores a computer program, and when the computer program is executed, the method as described in the first aspect is implemented, or the method as described in the second aspect is implemented. . .
本申请实施例提供了一种编解码方法、码流、编码器、解码器以及存储介质,在编码端,确定当前块的变换系数;按照预设扫描顺序对当前块的变换系数进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。在解码端,解析码流,确定当前块的重建系数绝对值;按照预设扫描顺序对当前块的重建系数绝对值进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。这样,无论是编码端还是解码端,都可以按照预设扫描顺序对当前块的变换系数进行扫描,然后确定出当前块在预设扫描顺序上的最后一个系数组,以便对最后一个系数组进行符号预测,如此不仅能够允许更多形状更多大小的块可以进行符号预测,拓展了符号预测技术的适用范围;而且在符号预测过程中,针对当前块处于图像或者编码树单元的上边界或左边界的情况,还对代价计算的方式进行优化,同时针对筛选待预测正负的变换系数的能量计算方式也进行适应性调整,从而还降低了计算复杂度,提高了正负号的符号预测准确度。The embodiment of the present application provides a codec method, code stream, encoder, decoder, and storage medium. At the encoding end, the transformation coefficient of the current block is determined; the transformation coefficient of the current block is scanned according to the preset scanning order to determine The last coefficient group of the current block in the preset scanning order; perform sign prediction on the last coefficient group, and determine the sign prediction value of the last coefficient group. At the decoding end, analyze the code stream to determine the absolute value of the reconstruction coefficient of the current block; scan the absolute value of the reconstruction coefficient of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order; Sign prediction is performed for one coefficient group, and the sign prediction value for the last coefficient group is determined. In this way, both the encoding end and the decoding end can scan the transform coefficients of the current block according to the preset scanning order, and then determine the last coefficient group of the current block in the preset scanning order, so as to perform Sign prediction, which not only allows blocks of more shapes and sizes to perform sign prediction, but also expands the scope of application of sign prediction technology; and in the process of sign prediction, for the current block at the upper boundary or left of the image or coding tree unit For boundary conditions, the cost calculation method is also optimized, and at the same time, the energy calculation method for screening the transform coefficients to be predicted is also adaptively adjusted, thereby reducing the computational complexity and improving the accuracy of sign prediction Spend.
附图说明Description of drawings
图1为一种混合编码框架的组成示意图;Figure 1 is a schematic diagram of the composition of a hybrid coding framework;
图2为一种包含非零量化系数的块示意图;Fig. 2 is a schematic diagram of a block including non-zero quantized coefficients;
图3为一种待反变换的系数块示意图;Fig. 3 is a schematic diagram of a coefficient block to be inversely transformed;
图4为一种反变换的系数块示意图;Fig. 4 is a schematic diagram of a coefficient block of an inverse transform;
图5为一种归一化模板示意图;Fig. 5 is a schematic diagram of a normalized template;
图6为一种反变换的归一化模板示意图;Fig. 6 is a schematic diagram of a normalized template of inverse transformation;
图7为一种根据假设重建值计算代价的应用示意图;FIG. 7 is a schematic diagram of an application for calculating a cost based on a hypothetical reconstruction value;
图8A为本申请实施例提供的一种编码器的系统组成框图示意图;FIG. 8A is a schematic diagram of a system composition block diagram of an encoder provided by an embodiment of the present application;
图8B为本申请实施例提供的一种解码器的系统组成框图示意图;FIG. 8B is a schematic diagram of a system composition block diagram of a decoder provided in an embodiment of the present application;
图9为本申请实施例提供的一种解码方法的流程示意图一;FIG. 9 is a first schematic flowchart of a decoding method provided by an embodiment of the present application;
图10为本申请实施例提供的一种对小于4×4的块使用符号预测的测试结果示意图;FIG. 10 is a schematic diagram of a test result using symbol prediction for a block smaller than 4×4 provided by an embodiment of the present application;
图11为本申请实施例提供的一种当前块处于编码树单元边界的位置示意图;FIG. 11 is a schematic diagram of a position where the current block is at the boundary of a coding tree unit provided by an embodiment of the present application;
图12为本申请实施例提供的一种当前块处于编码树单元边界使用符号预测的测试结果示意图;FIG. 12 is a schematic diagram of a test result of using symbol prediction when the current block is at the coding tree unit boundary provided by the embodiment of the present application;
图13为本申请实施例提供的一种当前块处于图像边界的位置示意图;Fig. 13 is a schematic diagram of a position where the current block is at the image boundary provided by the embodiment of the present application;
图14为本申请实施例提供的一种当前块处于图像边界使用符号预测的测试结果示意图;Fig. 14 is a schematic diagram of a test result of using symbol prediction when the current block is at the image boundary provided by the embodiment of the present application;
图15为本申请实施例提供的一种当前块处于图像左上角的位置示意图;Fig. 15 is a schematic diagram of the position of the current block in the upper left corner of the image provided by the embodiment of the present application;
图16为本申请实施例提供的一种当前块处于图像左上角不使用符号预测的测试结果示意图;Fig. 16 is a schematic diagram of a test result in which the current block is in the upper left corner of the image without using symbol prediction according to the embodiment of the present application;
图17为本申请实施例提供的一种解码方法的流程示意图二;FIG. 17 is a second schematic flow diagram of a decoding method provided by an embodiment of the present application;
图18为本申请实施例提供的一种编码方法的流程示意图一;FIG. 18 is a first schematic flowchart of an encoding method provided by an embodiment of the present application;
图19为本申请实施例提供的一种编码方法的流程示意图二;FIG. 19 is a schematic flow diagram II of an encoding method provided by an embodiment of the present application;
图20为本申请实施例提供的一种编码方法的流程示意图三;FIG. 20 is a schematic flow diagram III of an encoding method provided in an embodiment of the present application;
图21为本申请实施例提供的一种编码器的组成结构示意图;FIG. 21 is a schematic diagram of the composition and structure of an encoder provided by an embodiment of the present application;
图22为本申请实施例提供的一种编码器的具体硬件结构示意图;FIG. 22 is a schematic diagram of a specific hardware structure of an encoder provided by an embodiment of the present application;
图23为本申请实施例提供的一种解码器的组成结构示意图;FIG. 23 is a schematic structural diagram of a decoder provided by an embodiment of the present application;
图24为本申请实施例提供的一种解码器的具体硬件结构示意图;FIG. 24 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application;
图25为本申请实施例提供的一种编解码系统的组成结构示意图。FIG. 25 is a schematic diagram of the composition and structure of an encoding and decoding system provided by an embodiment of the present application.
具体实施方式Detailed ways
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。In order to understand the characteristics and technical contents of the embodiments of the present application in more detail, the implementation of the embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. The attached drawings are only for reference and description, and are not intended to limit the embodiments of the present application.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。还需要指出,本申请实施例所涉及的术语“第一\第二\第三”仅是用于区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。In the following description, references to "some embodiments" describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or a different subset of all possible embodiments, and Can be combined with each other without conflict. It should also be pointed out that the term "first\second\third" involved in the embodiment of the present application is only used to distinguish similar objects, and does not represent a specific ordering of objects. Understandably, "first\second\ The specific order or sequence of "third" may be interchanged where permitted so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein.
对本申请实施例进行进一步详细说明之前,先对本申请实施例中涉及的名词和术语进行说明,本申请实施例中涉及的名词和术语适用于如下的解释:Before the embodiment of the present application is described in further detail, the nouns and terms involved in the embodiments of the present application are explained first, and the nouns and terms involved in the embodiments of the present application are applicable to the following explanations:
新一代视频编码标准H.266/多功能视频编码(Versatile Video Coding,VVC)A new generation of video coding standard H.266/Versatile Video Coding (VVC)
编码单元(Coding Unit,CU)Coding Unit (CU)
编码树单元(Coding Tree Unit,CTU)Coding Tree Unit (CTU)
最大编码单元(Largest Coding Unit,LCU)Largest Coding Unit (LCU)
预测单元(Prediction Unit,PU)Prediction Unit (PU)
变换单元(Transform Unit,TU)Transform Unit (Transform Unit, TU)
离散余弦变换(Discrete Cosine Transform,DCT)Discrete Cosine Transform (DCT)
VVC的参考软件测试模型(VVC Test Model,VTM)VVC's reference software test model (VVC Test Model, VTM)
符号预测(Sign Prediction,SP):非零变换系数正负的预测技术Sign Prediction (Sign Prediction, SP): a prediction technique for the positive and negative of non-zero transform coefficients
增强压缩模型(Enhanced Compression Model,ECM):基于VTM-10.0,集成各类新工具,能够进一步挖掘VVC性能的参考模型Enhanced Compression Model (ECM): Based on VTM-10.0, it integrates various new tools and can further explore the reference model of VVC performance
可以理解,目前通用的视频编解码标准(如VVC)都采用基于块的混合编码框架。视频图像中的每一帧被分割成相同大小(如128×128,64×64等)正方形的LCU,每个LCU还可以根据规则划分成矩形的CU;而且CU可能还会划分成更小的PU、TU等。具体地,如图1所示,混合编码框架可以包括有预测(Prediction)、变换(Transform)、量化(Quantization)、熵编码(Entropy Coding)、环路滤波(In Loop Filter)等步骤。其中,预测又可以分为帧内预测(Intra Prediction)和帧间预测(Inter Prediction),帧间预测可以包括运动估计(Motion Estimation)和运动补偿(Motion Compensation)。由于视频图像的一个帧内相邻像素之间存在很强的相关性,在视频编解码技术中使用帧内预测方式能够消除相邻像素之间的空间冗余;但是由于视频图像中的相邻帧之间也存在着很强的相似性,在视频编解码技术中使用帧间预测方式消除相邻帧之间的时间冗余,从而能够提高编解码效率。It can be understood that currently common video codec standards (such as VVC) all adopt a block-based hybrid coding framework. Each frame in the video image is divided into square LCUs of the same size (such as 128×128, 64×64, etc.), and each LCU can also be divided into rectangular CUs according to the rules; and the CU may also be divided into smaller ones PU, TU, etc. Specifically, as shown in Figure 1, the hybrid coding framework may include steps such as prediction, transformation, quantization, entropy coding, and loop filtering. Among them, prediction can be divided into intra prediction (Intra Prediction) and inter prediction (Inter Prediction), and inter prediction can include motion estimation (Motion Estimation) and motion compensation (Motion Compensation). Because there is a strong correlation between adjacent pixels in a video image, the use of intra-frame prediction in video coding and decoding technology can eliminate the spatial redundancy between adjacent pixels; but due to the adjacent pixels in the video image There is also a strong similarity between frames. In the video coding and decoding technology, the inter-frame prediction method is used to eliminate the temporal redundancy between adjacent frames, thereby improving the coding and decoding efficiency.
视频编解码器的基本流程如下:在编码器中,将一帧图像划分成块,对当前块使用帧内预测或帧间预测产生当前块的预测块,当前块的原始块减去预测块得到残差块,对残差块进行变换、量化得到量化系数矩阵,对量化系数矩阵进行熵编码输出到码流中。在解码器中,对当前块使用帧内预测或帧间预测产生当前块的预测块,另一方面解码码流得到量化系数矩阵,对量化系数矩阵进行反量化、逆变换得到残差块,将预测块和残差块相加得到重建块。重建块组成重建图像,基于图像或基于块对重建图像进行环路滤波得到解码图像。编码器同样需要和解码器类似的操作获得解码图像。解码图像可以为后续的帧作为帧间预测的参考帧。编码器确定的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息如果有必要需要输出到码流中;然后解码器通过解析及根据已有信息进行分析确定与编码器相同的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息,从而保证编码器获得的解码图像和解码器获得的解码图像相同。编码器获得的解码图像通常也叫做重建图像。在预测时可以将当前块划分成预测单元,在变换时可以将当前块划分成变换单元,预测单元和变换单元的划分可以不同。上述是基于块的混合编码框架下的视频编码器和解码器的基本流程,随着技术的发展,该框架或流程的一些模块或步骤可能会被优化,本申请实施例适用于该基于块的混合编码框架下的视频编解码器的基本流程,但不限于该框架及流程。The basic flow of a video codec is as follows: In the encoder, a frame of image is divided into blocks, intra-frame prediction or inter-frame prediction is used for the current block to generate the prediction block of the current block, and the original block of the current block is subtracted from the prediction block to obtain The residual block is transformed and quantized to obtain a quantized coefficient matrix, and the quantized coefficient matrix is entropy encoded and output to the code stream. In the decoder, intra prediction or inter prediction is used for the current block to generate the prediction block of the current block. On the other hand, the quantization coefficient matrix is obtained by decoding the code stream, and the quantization coefficient matrix is dequantized and inversely transformed to obtain the residual block. The predicted block and the residual block are added to obtain the reconstructed block. The reconstructed blocks form a reconstructed image, and the decoded image is obtained by performing loop filtering on the reconstructed image based on the image or based on the block. The encoder also needs similar operations as the decoder to obtain the decoded image. The decoded image may serve as a reference frame for inter-frame prediction for subsequent frames. The block division information determined by the encoder, mode information or parameter information such as prediction, transformation, quantization, entropy coding, and loop filtering, if necessary, needs to be output to the code stream; then the decoder determines and The encoder has the same block division information, mode information or parameter information such as prediction, transformation, quantization, entropy coding, and loop filtering, so as to ensure that the decoded image obtained by the encoder is the same as that obtained by the decoder. The decoded image obtained by the encoder is usually also called the reconstructed image. During prediction, the current block may be divided into prediction units, and during transformation, the current block may be divided into transformation units, and the division of prediction units and transformation units may be different. The above is the basic process of the video encoder and decoder under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. The embodiments of this application are applicable to the block-based The basic flow of the video codec under the hybrid coding framework, but not limited to the framework and flow.
在本申请实施例中,当前块(Current Block)可以是当前编码单元(CU)、当前预测单元(PU)、或者当前变换块(TU)等。In this embodiment of the present application, the current block (Current Block) may be a current coding unit (CU), a current prediction unit (PU), or a current transform block (TU).
需要说明的是,与许多编解码器类似,VVC中的编码器对当前块的原始值与预测值做差得到残差块,该残差块经过变换得到变换后的残差,然后对变换后的残差进行量化得到量化系数,再将量化系数编码到码流中。对于一个经过变换和量化处理后得到的非零量化系数,由于该非零量化系数的正负出现的概率随机,在VVC等标准中采用等概率编码正负(其中,正和负的概率都为50%)。It should be noted that, similar to many codecs, the encoder in VVC makes a difference between the original value and the predicted value of the current block to obtain a residual block, and the residual block is transformed to obtain the transformed residual, and then the transformed The residual is quantized to obtain quantized coefficients, and then the quantized coefficients are encoded into the code stream. For a non-zero quantized coefficient obtained after transformation and quantization, since the probability of the non-zero quantized coefficient’s positive and negative occurrences is random, equal-probability coding is used in VVC and other standards (where the positive and negative probabilities are both 50 %).
示例性地,图2示出了一种包含非零量化系数的块示意图。其中,非零量化系数为5,-1,-2和1。 它们的正负号分别为+、-、-、+。正负可以使用一个二元码(binary code)表示,例如1表示+,0表示-。使用Sign Prediction技术可以对这个块中的非零量化系数的正负做出预测,假设预测出的正负为+、-、-、-。那么按照上述内容,正确的正负值为1、0、0、1;预测值为1、0、0、0。预测正确与否可称为“残差”,每一个“残差”也同样可以用一个二元码表示,例如正确为0,错误为1。此时“残差”为0、0、0、1。不难看出,当预测越准确时,“残差”中0出现的概率就会高于1出现的概率,对于这样有明显不均匀分布的二元码,使用上下文模型编码可以大大降低码字。而Sign prediction技术就是使用当前块与邻近块之间的信息,对当前块中非零量化系数的正负号进行准确的预测,从而使得正负号的“残差”编码代价降低。Exemplarily, Fig. 2 shows a schematic diagram of a block containing non-zero quantized coefficients. Among them, the non-zero quantization coefficients are 5, -1, -2 and 1. Their plus and minus signs are +, -, -, + respectively. Positive and negative can be represented by a binary code, such as 1 for + and 0 for -. The Sign Prediction technology can be used to predict the positive and negative of the non-zero quantized coefficients in this block, assuming that the predicted positive and negative are +, -, -, -. Then according to the above content, the correct positive and negative values are 1, 0, 0, 1; the predicted values are 1, 0, 0, 0. Whether the prediction is correct or not can be called "residual error", and each "residual error" can also be represented by a binary code, for example, 0 is correct and 1 is wrong. At this time, the "residual" is 0, 0, 0, 1. It is not difficult to see that when the prediction is more accurate, the probability of 0 in the "residual" will be higher than the probability of 1. For such binary codes with obvious uneven distribution, using context model coding can greatly reduce the codeword. The Sign prediction technology is to use the information between the current block and the adjacent blocks to accurately predict the sign of the non-zero quantization coefficient in the current block, so that the "residual" coding cost of the sign is reduced.
还可以理解,变换系数具有可拆分性。其中,图像/视频压缩中使用的变换为线性变换,以最常用的DCT-II变换为例,假定当前块的变换系数如图3所示,这里示出了一种待反变换的系数块,可以用块A表示。It can also be understood that the transform coefficients are divisible. Among them, the transformation used in image/video compression is a linear transformation. Taking the most commonly used DCT-II transformation as an example, assuming that the transformation coefficient of the current block is shown in Figure 3, a coefficient block to be inversely transformed is shown here. Can be represented by block A.
当使用DCT-II变换对图3的块A进行反变换处理后,可以得到图4的结果(每个值为×64后四舍五入的结果),这里示出了一种反变换的系数块示意图,可以用InvA表示。After the block A in Fig. 3 is inversely transformed using DCT-II transformation, the results in Fig. 4 can be obtained (each value is the result of rounding after ×64), and a schematic diagram of a coefficient block of inverse transformation is shown here, It can be represented by InvA.
而由于变换是线性的,本申请实施例可以对上述反变换进行拆分,具体可以使用图5所示的两个归一化的模板,包括模板B和模板C。然后分别对模板B和模板C进行DCT-II的反变换,可以得到图6的结果(每个值为×64后四舍五入的结果),这里示出了反变换后的两个模板,包括模板InvB和模板InvC。Since the transformation is linear, the embodiment of the present application can split the above inverse transformation. Specifically, two normalized templates shown in FIG. 5 can be used, including template B and template C. Then perform DCT-II inverse transformation on template B and template C respectively, and the result in Figure 6 can be obtained (each value is the result of rounding after ×64), which shows the two templates after inverse transformation, including template InvB and template InvC.
根据图3~图6可以得到,A=2×B-C,InvA=2×InvB–InvC。由此可见,通过构建反变换后的模板,能够按照比例累加反变换后的模板来得到任意反变换后的残差。According to Figure 3 to Figure 6, it can be obtained that A=2×B-C, InvA=2×InvB-InvC. It can be seen that by constructing the inversely transformed template, the inversely transformed template can be accumulated in proportion to obtain any residual after inversely transformed.
还可以理解,变换系数的正负号可以预测。其中,预测变换系数的正负号首先要建立在量化系数的绝对值和当前块使用的变换模式已知(已解码)基础之上。It will also be appreciated that the sign of the transform coefficients can be predicted. Wherein, predicting the sign of the transformation coefficient should first be based on the known (decoded) basis of the absolute value of the quantization coefficient and the transformation mode used by the current block.
在ECM中,Sign prediction只预测变换单元左上N×N区域中的非零变换系数的正负号,且预测的正负号的个数需少于或等于K个。例如,N=4,K=8。In ECM, Sign prediction only predicts the signs of non-zero transform coefficients in the upper left N×N area of the transform unit, and the number of predicted signs must be less than or equal to K. For example, N=4, K=8.
在一种具体的实施例中,对于一个含有L个待预测正负号的变换系数,预测过程分为如下几步骤:In a specific embodiment, for a transformation coefficient containing L signs to be predicted, the prediction process is divided into the following steps:
步骤一:构建各个变换类型各个变换块可能大小的反变换后的模板,其中反变换后的模板仅需使用到最上一行和最左一列的值,所以只保存这些值。Step 1: Construct the inverse-transformed templates of the possible sizes of each transformation block of each transformation type. The inverse-transformation template only needs to use the values of the uppermost row and the leftmost column, so only these values are saved.
步骤二:计算反量化后系数绝对值,若L大于K,则按照一定规律选择出其中的K个系数来预测正负号。2 K种可能的正负组合,根据预先计算的模板,计算出2 K种变换块在第一行和第一列的假设的反变换残差值。 Step 2: Calculate the absolute value of the coefficient after inverse quantization. If L is greater than K, select K coefficients according to a certain rule to predict the sign. 2 K possible positive and negative combinations, according to the pre-calculated template, calculate the hypothetical inverse transform residual value of the 2 K transform blocks in the first row and the first column.
步骤三:利用变换块的这2 K种假设的反变换残差值和预测值,能够得到2 K种假设重建值(hypothesis reconstruction),从2 K种假设重建值选出一种与周围已重建的块之间代价最小的假设重建值;其中,假设重建值等于反变换残差值加上当前变换块的预测值。在这里,如图7所示,当前块的已重建相邻像素值可以包括当前变换块的上侧两行和左侧两列,其中上侧两行分别用p x,-1、p x,-2表示,左侧两列分别用p -1,y、p -2,y表示,x的范围为0,1,…,w-1,y的范围为0,1,…,h-1,w表示当前变换块的宽度,h表示当前变换块的高度;这时候根据假设重建值进行代价值计算,具体如下所示, Step 3: Using the inverse transformation residual values and predicted values of the 2 K hypotheses of the transform block, 2 K hypothesis reconstruction values (hypothesis reconstruction) can be obtained, and one of the 2 K hypothesis reconstruction values is selected to be consistent with the surrounding reconstructed The hypothetical reconstruction value with the least cost between the blocks of ; where the hypothetical reconstruction value is equal to the inverse transformation residual value plus the prediction value of the current transformation block. Here, as shown in FIG. 7 , the reconstructed adjacent pixel values of the current block may include the upper two rows and the left two columns of the current transform block, where the upper two rows are respectively represented by p x,-1 and p x, -2 means, the two columns on the left are respectively represented by p -1,y and p -2,y , the range of x is 0,1,...,w-1, and the range of y is 0,1,...,h-1 , w represents the width of the current transformation block, and h represents the height of the current transformation block; at this time, the cost value is calculated according to the assumed reconstruction value, as shown below,
Figure PCTCN2021143688-appb-000001
Figure PCTCN2021143688-appb-000001
步骤四:代价值(用cost表示)最小的反变换残差值所使用的一组正负即Sign Prediction做出的正负号预测。Step 4: The set of signs used by the inverse transformation residual value with the smallest cost value (expressed in cost) is the sign prediction made by Sign Prediction.
步骤五:对于所选出的这一组预测的正负值,具体而言,编码端当前变换块通过率失真优化选出的当前模式下最优的量化系数的正负值作为真实的正负值,然后根据真实的正负值与预测的正负值确定正负值的残差。后续编码过程中使用上下文模型编码正负值的残差。这样,解码端从上下文模型中解码正负值的残差。后续过程中还可以根据正负值的残差与预测的正负值得到真实的正负值,将真实的正负值直接赋值给变换系数之后进一步完成解码后续操作(例如反变换、重建等等)。Step 5: For the selected group of predicted positive and negative values, specifically, the positive and negative values of the optimal quantization coefficient in the current mode selected by the current transform block at the encoding end through rate-distortion optimization are taken as the real positive and negative values value, and then determine the residual of the positive and negative values based on the true positive and negative values and the predicted positive and negative values. The context model is used in the subsequent encoding process to encode positive and negative residuals. In this way, the decoder decodes positive and negative residuals from the context model. In the follow-up process, the real positive and negative values can also be obtained according to the residual of the positive and negative values and the predicted positive and negative values, and the real positive and negative values can be directly assigned to the transformation coefficients to further complete subsequent decoding operations (such as inverse transformation, reconstruction, etc. ).
在ECM的实现中,式(1)可进一步简化,如下所示,In the implementation of ECM, formula (1) can be further simplified as follows,
Figure PCTCN2021143688-appb-000002
Figure PCTCN2021143688-appb-000002
由于当前块的预测值(用pred表示),周围的相邻像素重建值对于当前块来说是固定的,即(2×p x,-1-p x,-2-pred x,0)和(2×p -1,y-p -2,y-pred 0,y)值是固定的,仅假设的反变换残差(用resi表示)会因为符号组合的不同而不同,使用c x代表(2×p x,-1-p x,-2-pred x,0),c y代表(2×p -1,y-p -2,y-pred 0,y),这时候代价值(用cost表示)可写为如下公式, Due to the prediction value of the current block (denoted by pred), the surrounding neighboring pixel reconstruction values are fixed for the current block, i.e. (2×p x,-1 -p x,-2 -pred x,0 ) and (2×p -1,y -p -2,y -pred 0,y ) values are fixed, only the assumed inverse transformation residual (denoted by resi) will be different due to different symbol combinations, using c x to represent (2×p x,-1 -p x,-2 -pred x,0 ), c y represents (2×p -1, y -p -2, y -pred 0, y ), at this time the generation value ( Expressed by cost) can be written as the following formula,
Figure PCTCN2021143688-appb-000003
Figure PCTCN2021143688-appb-000003
然而,为了控制变换系数正负号预测的复杂度,预测技术存在有两个主要的限制:However, in order to control the complexity of transform coefficient sign prediction, there are two main limitations of the prediction technique:
(1)预测只作用在每个大于或等于4×4变换块上的左上角位置的4×4区域。原因是变换块的左上角为低频系数集中的地方,这些系数数值的变化会对整个变换块有更大的影响,所以相对于其它位置上的系数,这些系数更容易预测。(1) Prediction only acts on the 4×4 region of the upper left corner of each 4×4 transform block that is greater than or equal to it. The reason is that the upper left corner of the transform block is where low-frequency coefficients are concentrated, and changes in the value of these coefficients have a greater impact on the entire transform block, so these coefficients are easier to predict than coefficients at other positions.
(2)在上述区域中,只预测小于或等于8个非零变换系数的正负号,当4×4区域中有多于8个非零变换系数时,那么只预测前8个光栅扫描顺序上的非零变换系数的正负。原因是为了控制复杂度,预测K个系数就需要从2 K种反变换后的系数中找到边界代价最小的一种,其中,K越大,复杂度越高;而K越小,复杂度越低。 (2) In the above area, only predict the sign of less than or equal to 8 non-zero transform coefficients, when there are more than 8 non-zero transform coefficients in the 4×4 area, then only predict the first 8 raster scan order The sign of the nonzero transform coefficients on . The reason is that in order to control the complexity, predicting K coefficients requires finding the one with the smallest boundary cost from 2 K inversely transformed coefficients. The larger K is, the higher the complexity is; and the smaller K is, the more complex it is. Low.
进一步地,在实现中,对于左上角4×4区域中可能出现超过8个非零变换系数的情况,这里还提出了按照一定的准则选择8个非零变换系数进行正负号预测。而且在超过8个非零变换系数的寻找过程中,能够对在假设反变换时对块边界造成较大影响的位置上的非零变换系数更容易预测。一种实现方式是直接从8个非零变换系数中选取绝对值大的非零系数;另一种实现方式是排序4×4区域中非零变换系数反变换后在变换单元边缘上反映出的能量大小,将能量最大的8个非零系数确定为待预测正负的变换系数。其中,能量值计算如下,Furthermore, in the implementation, for the situation that more than 8 non-zero transform coefficients may appear in the upper left 4×4 area, it is also proposed to select 8 non-zero transform coefficients according to certain criteria for sign prediction. Moreover, in the process of finding more than 8 non-zero transform coefficients, it is easier to predict the non-zero transform coefficients at positions that have a greater impact on the block boundary when inverse transform is assumed. One implementation method is to directly select the non-zero coefficient with a large absolute value from the 8 non-zero transformation coefficients; the other implementation method is to sort the non-zero transformation coefficients in the 4×4 area and reflect them on the edge of the transformation unit after inverse transformation Energy size, determine the 8 non-zero coefficients with the largest energy as the transform coefficients to be predicted positive and negative. where the energy value is calculated as follows,
Figure PCTCN2021143688-appb-000004
Figure PCTCN2021143688-appb-000004
在这里,tc i,j为4×4的左上角区域中的变换系数(i,j代表坐标),T i,j(k)为在(i,j)位置处的变换系数为1时,在当前变换块左侧边缘和上侧边缘中的第k个反变换值,w和h表示当前变换块的宽度和高度。 Here, tc i,j is the transformation coefficient in the upper left corner region of 4×4 (i,j represents coordinates), T i,j (k) is the transformation coefficient at position (i,j) when it is 1, The k-th inverse transform value in the left edge and upper edge of the current transform block, w and h represent the width and height of the current transform block.
简单来说,对于一个经过变换和量化处理得到的非零量化系数,这些非零量化系数可以是正值也可以是负值,目前可以使用等概率编码,也可以使用符号预测技术对这些系数的正负号进行预测。但是对于图像边缘和块边缘的非零量化系数的符号预测,由于相关技术的不完善性,从而导致在符号预测时可能存在变换块尺寸受限、代价计算不合理等缺陷,导致符号预测结果的准确度低。To put it simply, for a non-zero quantized coefficient obtained through transformation and quantization, these non-zero quantized coefficients can be positive or negative. At present, equal probability coding can be used, and sign prediction technology can also be used to predict the coefficients of these coefficients. The plus and minus signs make predictions. However, for the sign prediction of non-zero quantized coefficients at the image edge and block edge, due to the imperfection of related technologies, there may be defects such as limited transform block size and unreasonable cost calculation during sign prediction, resulting in the sign prediction results. Accuracy is low.
这样,本申请实施例提供了一种解码方法,通过解析码流,确定当前块的重建系数绝对值;按照预设扫描顺序对当前块的重建系数绝对值进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。In this way, the embodiment of the present application provides a decoding method. By analyzing the code stream, the absolute value of the reconstruction coefficient of the current block is determined; the absolute value of the reconstruction coefficient of the current block is scanned according to the preset scanning order, and it is determined that the current block is within the preset scanning sequence. The last coefficient group in order; sign prediction is performed on the last coefficient group, and the sign prediction value of the last coefficient group is determined.
本申请实施例还提供了一种编码方法,通过确定当前块的变换系数;按照预设扫描顺序对当前块的变换系数进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。The embodiment of the present application also provides an encoding method, by determining the transformation coefficient of the current block; scanning the transformation coefficient of the current block according to the preset scanning order, and determining the last coefficient group of the current block in the preset scanning order; The last coefficient group performs sign prediction, and the sign prediction value of the last coefficient group is determined.
这样,无论是编码端还是解码端,都可以按照预设扫描顺序对当前块的变换系数进行扫描,然后确定出当前块在预设扫描顺序上的最后一个系数组,以便对最后一个系数组进行符号预测,如此不仅能够允许更多形状更多大小的块可以进行符号预测,拓展了符号预测技术的适用范围;而且在 符号预测过程中,针对当前块处于图像或者编码树单元的上边界或左边界的情况,还对代价计算的方式进行优化,同时针对筛选待预测正负的变换系数的能量计算方式也进行适应性调整,从而还降低了计算复杂度,提高了正负号的符号预测准确度。In this way, both the encoding end and the decoding end can scan the transform coefficients of the current block according to the preset scanning order, and then determine the last coefficient group of the current block in the preset scanning order, so as to perform Sign prediction, which not only allows blocks of more shapes and sizes to perform sign prediction, but also expands the scope of application of sign prediction technology; and in the process of sign prediction, for the current block at the upper boundary or left of the image or coding tree unit For boundary conditions, the cost calculation method is also optimized, and at the same time, the energy calculation method for screening the transform coefficients to be predicted is also adaptively adjusted, thereby reducing the computational complexity and improving the accuracy of sign prediction Spend.
下面将结合附图对本申请各实施例进行清楚、完整的描述。Various embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
参见图8A,其示出了本申请实施例提供的一种编码器的系统组成框图示意图。如图8A所示,编码器100可以包括:分割单元101、预测单元102、第一加法器107、变换单元108、量化单元109、反量化单元110、逆变换单元111、第二加法器112、滤波单元113、解码图片缓存(Decoded Picture Buffer,DPB)单元114和熵编码单元115。这里,编码器100的输入可以是由一系列图片或者一张静态图片组成的视频,编码器100的输出可以是用于表示输入视频的压缩版本的比特流(也可以称为“码流”)。Referring to FIG. 8A , it shows a schematic diagram of a system composition block diagram of an encoder provided by an embodiment of the present application. As shown in FIG. 8A, the encoder 100 may include: a segmentation unit 101, a prediction unit 102, a first adder 107, a transform unit 108, a quantization unit 109, an inverse quantization unit 110, an inverse transform unit 111, a second adder 112, A filtering unit 113, a decoded picture buffer (Decoded Picture Buffer, DPB) unit 114 and an entropy encoding unit 115. Here, the input of the encoder 100 may be a video composed of a series of pictures or a static picture, and the output of the encoder 100 may be a bit stream (also called a "code stream") representing a compressed version of the input video. .
其中,分割单元101将输入视频中的图片分割成一个或多个编码树单元(Coding Tree Units,CTUs)。分割单元101将图片分成多个图块(或称为瓦片,tiles),还可以进一步将一个tile分成一个或多个砖块(bricks),这里,一个tile或者一个brick中可以包括一个或多个完整的和/或部分的CTUs。另外,分割单元101可以形成一个或多个切片(slices),其中一个slice可以包括图片中按照栅格顺序排列的一个或多个tiles,或者覆盖图片中矩形区域的一个或多个tiles。分割单元101还可形成一个或多个子图片,其中,一个子图片可以包括一个或多个slices、tiles或bricks。Wherein, the segmentation unit 101 divides the pictures in the input video into one or more coding tree units (Coding Tree Units, CTUs). The segmentation unit 101 divides the picture into multiple tiles (or called tiles, tiles), and can further divide a tile into one or more bricks (bricks). Here, a tile or a brick can include one or more complete and/or partial CTUs. In addition, the segmentation unit 101 may form one or more slices, wherein one slice may include one or more tiles arranged in a grid order in the picture, or one or more tiles covering a rectangular area in the picture. The segmentation unit 101 may also form one or more sub-pictures, wherein one sub-picture may include one or more slices, tiles or bricks.
在编码器100的编码过程中,分割单元101将CTU传送到预测单元102。通常,预测单元102可以由块分割单元103、运动估计(Motion Estimation,ME)单元104、运动补偿(Motion Compensation,MC)单元105和帧内预测单元106组成。具体地,块分割单元103迭代地使用四叉树分割、二叉树分割和三叉树分割而进一步将输入CTU划分成更小的编码单元(Coding Units,CUs)。预测单元102可使用ME单元104和MC单元105获取CU的帧间预测块。帧内预测单元106可使用包括MIP模式的各种帧内预测模式获取CU的帧内预测块。在示例中,率失真优化的运动估计方式可被ME单元104和MC单元105调用以获取帧间预测块,以及率失真优化的模式确定方式可被帧内预测单元106调用以获取帧内预测块。During the encoding process of the encoder 100 , the division unit 101 transmits the CTU to the prediction unit 102 . Generally, the prediction unit 102 may be composed of a block division unit 103, a motion estimation (Motion Estimation, ME) unit 104, a motion compensation (Motion Compensation, MC) unit 105 and an intra prediction unit 106. Specifically, the block partitioning unit 103 iteratively uses quadtree partitioning, binary tree partitioning and ternary tree partitioning to further divide the input CTU into smaller coding units (Coding Units, CUs). Prediction unit 102 may use ME unit 104 and MC unit 105 to obtain an inter-prediction block for a CU. Intra prediction unit 106 may obtain an intra prediction block for a CU using various intra prediction modes including MIP mode. In an example, the rate-distortion optimized motion estimation approach can be invoked by the ME unit 104 and the MC unit 105 to obtain an inter prediction block, and the rate-distortion optimized mode determination approach can be invoked by the intra prediction unit 106 to obtain an intra prediction block .
预测单元102输出CU的预测块,第一加法器107计算分割单元101的输出中的CU和CU的预测块之间的差值,即残差CU。变换单元108读取残差CU并对残差CU执行一个或多个变换操作以获取系数。量化单元109对系数进行量化并输出量化系数(即levels)。反量化单元110对量化系数执行缩放操作以输出重构系数。逆变换单元111执行对应于变换单元108中的变换的一个或多个逆变换并输出重构残差。第二加法器112通过使重构残差和来自预测单元102的CU的预测块相加而计算出重构CU。第二加法器112还将其输出发送到预测单元102以用作帧内预测参考。在图片或子图片中的所有CU被重构之后,滤波单元113对重构图片或子图片执行环路滤波。这里,滤波单元113包含一个或多个滤波器,例如去方块滤波器、采样自适应偏移(Sample Adaptive Offset,SAO)滤波器、自适应环路滤波器(Adaptive Loop Filter,ALF)、亮度映射和色度缩放(Luma Mapping with Chroma Scaling,LMCS)滤波器以及基于神经网络的滤波器等。或者,当滤波单元113确定CU不用作其它CU编码时的参考时,滤波单元113对CU中的一个或多个目标像素执行环路滤波。The prediction unit 102 outputs the prediction block of the CU, and the first adder 107 calculates the difference between the CU in the output of the division unit 101 and the prediction block of the CU, that is, the residual CU. The transform unit 108 reads the residual CU and performs one or more transform operations on the residual CU to obtain coefficients. The quantization unit 109 quantizes the coefficients and outputs the quantized coefficients (ie levels). The inverse quantization unit 110 performs a scaling operation on the quantized coefficients to output reconstructed coefficients. The inverse transform unit 111 performs one or more inverse transforms corresponding to the transforms in the transform unit 108 and outputs a reconstruction residual. The second adder 112 calculates a reconstructed CU by adding the reconstruction residual to the prediction block of the CU from the prediction unit 102 . The second adder 112 also sends its output to the prediction unit 102 for use as an intra prediction reference. After all CUs in a picture or sub-picture are reconstructed, the filtering unit 113 performs loop filtering on the reconstructed picture or sub-picture. Here, the filtering unit 113 includes one or more filters, such as a deblocking filter, a sample adaptive offset (Sample Adaptive Offset, SAO) filter, an adaptive loop filter (Adaptive Loop Filter, ALF), a brightness map And chroma scaling (Luma Mapping with Chroma Scaling, LMCS) filters and filters based on neural networks, etc. Alternatively, when the filtering unit 113 determines that the CU is not used as a reference for encoding other CUs, the filtering unit 113 performs loop filtering on one or more target pixels in the CU.
滤波单元113的输出是解码图片或子图片,这些解码图片或子图片缓存至DPB单元114。DPB单元114根据时序和控制信息输出解码图片或子图片。这里,存储在DPB单元114中的图片还可用作预测单元102执行帧间预测或帧内预测的参考。最后熵编码单元115将来自编码器100中解码图片所必需的参数(比如控制参数和补充信息等)转换成二进制形式,并根据每个数据单元的语法结构将这样的二进制形式写入码流中,即编码器100最终输出码流。The output of the filtering unit 113 is decoded pictures or sub-pictures, which are buffered into the DPB unit 114 . The DPB unit 114 outputs decoded pictures or sub-pictures according to timing and control information. Here, the pictures stored in the DPB unit 114 can also be used as a reference for the prediction unit 102 to perform inter prediction or intra prediction. Finally, the entropy encoding unit 115 converts the parameters (such as control parameters and supplementary information) necessary for decoding pictures from the encoder 100 into binary form, and writes such binary form into the code stream according to the syntax structure of each data unit , that is, the encoder 100 finally outputs a code stream.
进一步地,编码器100可以是具有第一处理器和记录计算机程序的第一存储器。当第一处理器读取并运行计算机程序时,编码器100读取输入视频并生成对应的码流。另外,编码器100还可以是具有一个或多个芯片的计算设备。在芯片上实现为集成电路的这些单元具有与图8A中相应单元类似的连接和数据交换功能。Further, the encoder 100 may have a first processor and a first memory recording a computer program. When the first processor reads and runs the computer program, the encoder 100 reads the input video and generates a corresponding code stream. Additionally, encoder 100 may also be a computing device having one or more chips. These units, implemented as integrated circuits on the chip, have similar connection and data exchange functions as the corresponding units in FIG. 8A.
参见图8B,其示出了本申请实施例提供的一种解码器的系统组成框图示意图。如图8B所示,该解码器200可以包括:解析单元201、预测单元202、反量化单元205、逆变换单元206、加法器207、滤波单元208和解码图片缓存单元209。这里,解码器200的输入是用于表示视频或者一张静态图片的压缩版本的比特流,解码器200的输出可以是由一系列图片组成的解码视频或者一张解码的静态图片。Referring to FIG. 8B , it shows a schematic diagram of a system composition block diagram of a decoder provided by an embodiment of the present application. As shown in FIG. 8B , the decoder 200 may include: an analysis unit 201 , a prediction unit 202 , an inverse quantization unit 205 , an inverse transformation unit 206 , an adder 207 , a filter unit 208 and a decoded picture buffer unit 209 . Here, the input of the decoder 200 is a bit stream representing a compressed version of a video or a still picture, and the output of the decoder 200 may be a decoded video composed of a series of pictures or a decoded still picture.
其中,解码器200的输入码流可以是编码器100所生成的码流。解析单元201对输入码流进行 解析并从输入码流获取语法元素的值。解析单元201将语法元素的二进制表示转换成数字值并将数字值发送到解码器200中的单元以获取一个或多个解码图片。解析单元201还可从输入码流解析一个或多个语法元素以显示解码图片。Wherein, the input code stream of the decoder 200 may be the code stream generated by the encoder 100 . The parsing unit 201 parses the input code stream and obtains the value of the syntax element from the input code stream. The parsing unit 201 converts the binary representation of the syntax elements into digital values and sends the digital values to units in the decoder 200 to obtain one or more decoded pictures. The parsing unit 201 may also parse one or more syntax elements from the input code stream to display the decoded picture.
在解码器200的解码过程中,解析单元201将语法元素的值以及根据语法元素的值设置或确定的、用于获取一个或多个解码图片的一个或多个变量发送到解码器200中的单元。During the decoding process of the decoder 200, the parsing unit 201 sends the value of the syntax element and one or more variables set or determined according to the value of the syntax element to obtain one or more decoded pictures to the decoder 200 unit.
预测单元202确定当前解码块(例如CU)的预测块。这里,预测单元202可以包括运动补偿单元203和帧内预测单元204。具体地,当指示帧间解码模式用于对当前解码块进行解码时,预测单元202将来自解析单元201的相关参数传递到运动补偿单元203以获取帧间预测块;当指示帧内预测模式(包括基于MIP模式索引值指示的MIP模式)用于对当前解码块进行解码时,预测单元202将来自解析单元201的相关参数传送到帧内预测单元204以获取帧内预测块。The prediction unit 202 determines a prediction block for a currently decoded block (eg, CU). Here, the prediction unit 202 may include a motion compensation unit 203 and an intra prediction unit 204 . Specifically, when the inter-frame decoding mode is indicated for decoding the current decoding block, the prediction unit 202 passes the relevant parameters from the parsing unit 201 to the motion compensation unit 203 to obtain the inter-frame prediction block; when the intra-frame prediction mode ( When the MIP mode indicated based on the MIP mode index value) is used to decode the current decoding block, the prediction unit 202 transmits the relevant parameters from the parsing unit 201 to the intra prediction unit 204 to obtain the intra prediction block.
反量化单元205具有与编码器100中的反量化单元110相同的功能。反量化单元205对来自解析单元201的量化系数(即levels)执行缩放操作以获取重构系数。The dequantization unit 205 has the same function as the dequantization unit 110 in the encoder 100 . The inverse quantization unit 205 performs a scaling operation on the quantization coefficients (ie levels) from the parsing unit 201 to obtain reconstruction coefficients.
逆变换单元206具有与编码器100中的逆变换单元111相同的功能。逆变换单元206执行一个或多个变换操作(即通过编码器100中的逆变换单元111执行的一个或多个变换操作的反操作)以获取重构残差。The inverse transform unit 206 has the same function as the inverse transform unit 111 in the encoder 100 . The inverse transform unit 206 performs one or more transform operations (ie, the inverse of the one or more transform operations performed by the inverse transform unit 111 in the encoder 100 ) to obtain the reconstruction residual.
加法器207对其输入(来自预测单元202的预测块和来自逆变换单元206的重构残差)执行相加操作以获取当前解码块的重构块。重构块还发送到预测单元202以用作在帧内预测模式下编码的其它块的参考。The adder 207 performs an addition operation on its inputs (the predicted block from the prediction unit 202 and the reconstructed residual from the inverse transform unit 206) to obtain the reconstructed block of the currently decoded block. The reconstructed block is also sent to the prediction unit 202 to be used as a reference for other blocks encoded in intra prediction mode.
在图片或子图片中的所有CU被重构之后,滤波单元208对重构图片或子图片执行环路滤波。滤波单元208包含一个或多个滤波器,例如去方块滤波器、采样自适应补偿滤波器、自适应环路滤波器、亮度映射和色度缩放滤波器以及基于神经网络的滤波器等。或者,当滤波单元208确定重构块不用作对其它块解码时的参考时,滤波单元208对重构块中的一个或多个目标像素执行环路滤波。这里,滤波单元208的输出是解码图片或子图片,解码图片或子图片缓存至DPB单元209。DPB单元209根据时序和控制信息输出解码图片或子图片。存储在DPB单元209中的图片还可用作通过预测单元202执行帧间预测或帧内预测的参考。After all CUs in a picture or sub-picture are reconstructed, filtering unit 208 performs loop filtering on the reconstructed picture or sub-picture. The filtering unit 208 includes one or more filters, such as a deblocking filter, a sampling adaptive compensation filter, an adaptive loop filter, a luma mapping and chroma scaling filter, and a neural network-based filter. Alternatively, when filtering unit 208 determines that the reconstructed block is not used as a reference when decoding other blocks, filtering unit 208 performs loop filtering on one or more target pixels in the reconstructed block. Here, the output of the filtering unit 208 is a decoded picture or sub-picture, and the decoded picture or sub-picture is cached in the DPB unit 209 . The DPB unit 209 outputs decoded pictures or sub-pictures according to timing and control information. The picture stored in the DPB unit 209 can also be used as a reference to perform inter prediction or intra prediction by the prediction unit 202 .
进一步地,解码器200可以是具有第二处理器和记录计算机程序的第二存储器。当第一处理器读取并运行计算机程序时,解码器200读取输入码流并生成对应的解码视频。另外,解码器200还可以是具有一个或多个芯片的计算设备。在芯片上实现为集成电路的这些单元具有与图8B中相应单元类似的连接和数据交换功能。Further, the decoder 200 may have a second processor and a second memory recording a computer program. When the first processor reads and runs the computer program, the decoder 200 reads the input code stream and generates a corresponding decoded video. Additionally, decoder 200 may also be a computing device having one or more chips. These units implemented on-chip as integrated circuits have similar connectivity and data exchange functions as the corresponding units in Figure 8B.
还需要说明的是,当本申请实施例应用于编码器100时,“当前块”具体是指视频图像中的当前待编码的块;当本申请实施例应用于解码器200时,“当前块”具体是指视频图像中的当前待解码的块。另外,这里的当前块可以是当前编码单元、当前预测单元、或者当前变换块等等,本申请实施例并不作任何限定。It should also be noted that when the embodiment of the present application is applied to the encoder 100, the "current block" specifically refers to the block currently to be encoded in the video image; when the embodiment of the present application is applied to the decoder 200, the "current block "Specifically refers to the current block to be decoded in the video image. In addition, the current block here may be a current coding unit, a current prediction unit, or a current transformation block, etc., which is not limited in this embodiment of the present application.
本申请的一实施例中,参见图9,其示出了本申请实施例提供的一种解码方法的流程示意图。如图9所示,该方法可以包括:In an embodiment of the present application, refer to FIG. 9 , which shows a schematic flowchart of a decoding method provided in an embodiment of the present application. As shown in Figure 9, the method may include:
S901:解析码流,确定当前块的重建系数绝对值。S901: Analyze the code stream, and determine the absolute value of the reconstruction coefficient of the current block.
需要说明的是,本申请实施例的解码方法应用于解码器,具体可以是一种符号预测方法,这里主要是针对当前块中的重建系数绝对值的正负号进行预测。It should be noted that the decoding method in the embodiment of the present application is applied to a decoder, and may specifically be a sign prediction method, where the sign of the absolute value of the reconstruction coefficient in the current block is mainly predicted.
还需要说明的是,基于图8B所示解码器200的组成结构,本申请实施例的解码方法则是应用于解码器200中的“解析单元201”部分,针对该解析单元201,可以通过解码码流获得当前块的重建系数绝对值,以便后续根据这些重建系数绝对值来选取需要进行符号预测的重建系数绝对值,然后对这些重建系数的正负号进行预测。It should also be noted that, based on the composition structure of the decoder 200 shown in FIG. 8B , the decoding method of the embodiment of the present application is applied to the "analysis unit 201" part of the decoder 200. For the analysis unit 201, it can be decoded The code stream obtains the absolute value of the reconstruction coefficient of the current block, so that the absolute value of the reconstruction coefficient that needs to be predicted is selected according to the absolute value of the reconstruction coefficient, and then the sign of the reconstruction coefficient is predicted.
可以理解,在ECM的实现中,对于当前块而言,块尺寸通常为大于或等于4×4。对于小于4×4的当前块,由于此时左上角位置不存在4×4区域供符号预测(Sign Prediction)使用,所以这样的当前块是禁止使用符号预测。同时,对于大于32×32的帧内块和大于128×128的帧间块,也禁止使用符号预测。然而,在本申请实施例中,可以通过确定在预设扫描顺序上的最后一个系数组(Coefficient Group,CG),然后对最后一个系数组使用符号预测,使得符号预测能够应用于更多形状更多尺寸的块,拓展了符号预测技术的适用范围。It can be understood that, in the implementation of ECM, for the current block, the block size is usually greater than or equal to 4×4. For a current block smaller than 4×4, since there is no 4×4 area in the upper left corner for sign prediction (Sign Prediction), such a current block is prohibited from using sign prediction. At the same time, sign prediction is also prohibited for intra blocks larger than 32×32 and inter blocks larger than 128×128. However, in the embodiment of the present application, by determining the last coefficient group (Coefficient Group, CG) in the preset scanning order, and then using sign prediction for the last coefficient group, the sign prediction can be applied to more shapes and more Multi-sized blocks extend the applicability of sign prediction techniques.
S902:按照预设扫描顺序对当前块的重建系数绝对值进行扫描,确定当前块在预设扫描顺序上 的最后一个系数组。S902: Scan the absolute values of the reconstruction coefficients of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order.
S903:对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。S903: Perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
需要说明的是,在本申请实施例中,可以允许在预设扫描顺序上最后一个系数组中选取非零变换系数来使用符号预测。这样,首先可以按照预设扫描顺序对当前块的重建系数绝对值进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;然后对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值,从而能够允许更多形状更多大小的块可以进行符号预测,拓展了符号预测技术的适用范围。It should be noted that, in the embodiment of the present application, it may be allowed to select non-zero transform coefficients in the last coefficient group in the preset scanning order to use sign prediction. In this way, firstly, the absolute value of the reconstruction coefficient of the current block can be scanned according to the preset scanning order to determine the last coefficient group of the current block in the preset scanning order; The sign prediction value of , which can allow blocks of more shapes and sizes to perform sign prediction, and expand the application range of sign prediction technology.
还需要说明的是,在本申请实施例中,预设扫描顺序可以是对角线、Zigzag、水平、垂直、4×4子块扫描或者任何其它扫描顺序,这里不作任何限定。It should also be noted that, in this embodiment of the present application, the preset scanning order may be diagonal, Zigzag, horizontal, vertical, 4×4 sub-block scanning or any other scanning order, which is not limited herein.
还需要说明的是,不同尺寸的当前块,可以划分为不同数量的系数组。因此,对于系数组的划分,在一些实施例中,该方法还可以包括:It should also be noted that current blocks of different sizes may be divided into coefficient groups of different numbers. Therefore, for the division of coefficient groups, in some embodiments, the method may further include:
若当前块的尺寸为1×N,N为大于或等于16的整数,则确定当前块的重建系数绝对值可划分为(N/16)个系数组,且系数组的尺寸为1×16;If the size of the current block is 1×N, and N is an integer greater than or equal to 16, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient group is 1×16;
若当前块的尺寸为N×1,N为大于或等于16的整数,则确定当前块的重建系数绝对值可划分为(N/16)个系数组,且系数组的尺寸为16×1;If the size of the current block is N×1, and N is an integer greater than or equal to 16, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient group is 16×1;
若当前块的尺寸为2×N,N为大于或等于8的整数,则确定当前块的重建系数绝对值可划分为(N/8)个系数组,且系数组的尺寸为2×8;If the size of the current block is 2×N, and N is an integer greater than or equal to 8, then determine that the absolute value of the reconstruction coefficient of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient group is 2×8;
若当前块的尺寸为N×2,N为大于或等于8的整数,则确定当前块的重建系数绝对值可划分为(N/8)个系数组,且系数组的尺寸为8×2;If the size of the current block is N×2, and N is an integer greater than or equal to 8, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient group is 8×2;
若当前块的尺寸为M×N,M和N均为大于或等于4的整数,则确定当前块的重建系数绝对值可划分为(M×N/16)个系数组,且系数组的尺寸为4×4。If the size of the current block is M×N, and both M and N are integers greater than or equal to 4, it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (M×N/16) coefficient groups, and the size of the coefficient group for 4×4.
需要说明的是,针对当前块的尺寸来说,还可能出现1×N、2×N的块,这些块的形状以及对应的系数组大小如表1所示。It should be noted that for the size of the current block, 1×N and 2×N blocks may also appear, and the shapes of these blocks and the corresponding coefficient group sizes are shown in Table 1.
表1Table 1
块尺寸block size 系数组的尺寸The size of the coefficient group
1×N,N≥161×N, N≥16 1×161×16
N×1,N≥16N×1,N≥16 16×116×1
2×N,N≥82×N,N≥8 2×82×8
N×2,N≥8N×2,N≥8 8×28×2
其它形状的当前块current block of other shapes 4×44×4
在相关技术中,对于某一侧的长度小于4,ECM中目前是不允许这样的块使用符号预测。而在本申请实施例中,可以允许对块中的所有区域或者部分区域(例如,同ECM中的对左上角位置的4×4区域)中非零系数使用符号预测。In the related art, for a side whose length is less than 4, ECM currently does not allow such a block to use sign prediction. However, in the embodiment of the present application, it is allowed to use sign prediction for non-zero coefficients in all regions or partial regions in the block (for example, the same as the 4×4 region at the upper left corner position in ECM).
示例性地,ECM中目前对大于4×4的当前块,左上角位置的4×4区域(左上角位置的系数组)中非零系数允许使用符号预测;同理,对于小于4×4的当前块,也可以允许在预设扫描顺序上最后一个系数组中选取非零系数使用符号预测。Exemplarily, for a current block larger than 4×4 in the ECM, sign prediction is allowed for non-zero coefficients in the 4×4 area at the upper left corner (coefficient group at the upper left corner); similarly, for blocks smaller than 4×4 For the current block, it is also allowed to select non-zero coefficients in the last coefficient group in the preset scanning order to use sign prediction.
参见图10,其示出了本申请实施例提供的一种对小于4×4的块使用符号预测的测试结果示意图。如图10所示,这里提供了对小于4×4的块允许其在预设扫描顺序上最后一个系数组使用符号预测时在对比ECM参考软件在全帧内编码下带来的编码效果提升,其中,在YUV颜色空间下的Y分量、U分量和V分量等三个分量下分别带来了0.02%、0.1%、0.07%的性能提升,而且编码时间(用EncT表示)和解码时间(用DecT表示)变化不大。Referring to FIG. 10 , it shows a schematic diagram of a test result of using sign prediction for a block smaller than 4×4 provided by an embodiment of the present application. As shown in Figure 10, it is provided here that when a block smaller than 4×4 is allowed to use sign prediction for the last coefficient group in the preset scanning order, the coding effect improvement brought by the ECM reference software under full intra-frame coding is compared. Among them, under the three components of Y component, U component and V component under the YUV color space, the performance improvement of 0.02%, 0.1% and 0.07% was brought respectively, and the encoding time (expressed by EncT) and decoding time (expressed by DecT said) little changed.
另外,在实际应用中,越靠近左上角位置,在预设扫描顺序上越靠后,即最后一个系数组即是处于当前块的左上角位置。因此,本申请实施例也可以取消使用符号预测技术的块最大尺寸的限制。In addition, in practical applications, the closer to the upper left corner, the later in the preset scanning order, that is, the last coefficient group is located at the upper left corner of the current block. Therefore, the embodiment of the present application may also cancel the restriction on the maximum size of a block using the sign prediction technology.
示例性地,在ECM中目前大于32×32的帧内块和大于128×128的帧间块不可以使用符号预测,而实际上目前允许最大尺寸的块为256×256。所以取消块最大尺寸的限制意味着允许最多到256×256的变换块中部分(例如,同ECM中的对左上角位置的4×4区域)或所有区域中的非零系数正负号的符号预测。Exemplarily, in the ECM, the current intra block larger than 32×32 and the inter block larger than 128×128 cannot use sign prediction, but actually the maximum size block is currently allowed to be 256×256. So removing the restriction on the maximum block size means allowing up to 256x256 transformation blocks in part (for example, the 4x4 region with the upper left corner position in ECM) or the sign of non-zero coefficient signs in all regions predict.
进一步地,在当前块的尺寸为M×N,M和N均为大于或等于4的整数情况下,这时候系数组的尺寸为4×4。在一些实施例中,该方法还可以包括:Further, when the size of the current block is M×N, and both M and N are integers greater than or equal to 4, then the size of the coefficient group is 4×4. In some embodiments, the method may also include:
确定当前块中处于左上角位置的第一区域;Determine the first area in the upper left corner of the current block;
根据第一区域内的重建系数绝对值确定最后一个系数组;其中,最后一个系数组中的重建系数 绝对值个数为2 L个,且L为大于或等于零的个数。 The last coefficient group is determined according to the absolute value of the reconstruction coefficients in the first area; wherein, the number of absolute values of the reconstruction coefficients in the last coefficient group is 2 L , and L is the number greater than or equal to zero.
需要说明的是,通常情况下,如果当前块的尺寸大于或等于4×4,那么可以直接将左上角位置的4×4区域作为最后一个系数组。另外,考虑到符号预测所使用非零系数的个数通常为K个,如果4×4区域中的非零系数小于K个,这时候还可以适当扩大左上角区域,例如将左上角位置的8×8区域、16×16区域等作为最后一个系数组,以使得最后一个系数组中的重建系数绝对值个数为2 L个。在本申请实施例中,第一区域可以为4×4区域,但是这里不作具体限定。 It should be noted that, generally, if the size of the current block is greater than or equal to 4×4, then the 4×4 area at the upper left corner can be directly used as the last coefficient group. In addition, considering that the number of non-zero coefficients used for symbol prediction is usually K, if the number of non-zero coefficients in the 4×4 area is less than K, the upper left area can be appropriately expanded at this time, for example, the 8 ×8 area, 16×16 area, etc. as the last coefficient group, so that the number of absolute value reconstruction coefficients in the last coefficient group is 2L . In the embodiment of the present application, the first area may be a 4×4 area, but it is not specifically limited here.
还需要说明的是,K为大于零的整数。示例性地,对于一次变换,K的取值可以为8;对于二次变换,K的取值可以为4,但是并不作具体限定。It should also be noted that K is an integer greater than zero. Exemplarily, for the first transformation, the value of K may be 8; for the second transformation, the value of K may be 4, but this is not specifically limited.
这样,可以将可以使用变换系数正负号预测的当前块的使用范围进行拓展,允许更多形状更多大小的块使用符号预测技术。具体地,例如小于4×4的块和帧内大于32×32,帧间大于128×128的块,都可以使用此符号预测技术。In this way, the use range of the current block that can be predicted by using the sign of the transform coefficient can be expanded, allowing blocks with more shapes and sizes to use the sign prediction technology. Specifically, for example, a block smaller than 4×4, a block larger than 32×32 in an intra frame, and a block larger than 128×128 in an inter frame can all use this symbol prediction technology.
还可以理解,如图11所示,(a)示出了当前块处于编码树单元的上边界,(b)示出了当前块处于编码树单元的左边界。这时候在ECM的实现中,如果当前块处于编码树单元边缘时,那么c x和c y的计算会使用到邻近的编码树单元中的重建值,详见前述的图7和式(1)所示。具体地,当处于编码树单元第一行的当前块,需要使用到上方另一个编码树单元中的重建值时会给硬件带来更多实现复杂度。 It can also be understood that, as shown in FIG. 11 , (a) shows that the current block is at the upper boundary of the coding tree unit, and (b) shows that the current block is at the left boundary of the coding tree unit. At this time, in the implementation of ECM, if the current block is at the edge of the coding tree unit, then the calculation of c x and cy will use the reconstruction value in the adjacent coding tree unit, see the aforementioned Figure 7 and formula (1) for details shown. Specifically, when the current block in the first row of the coding tree unit needs to use the reconstructed value in another coding tree unit above, more implementation complexity will be brought to the hardware.
如此,为了减少复杂度以及保证正负号的预测准确度,对于编码树单元第一行的变换单元,代价的计算方式可以进行合理的简化。In this way, in order to reduce the complexity and ensure the prediction accuracy of the sign, for the transformation units in the first row of the coding tree unit, the calculation method of the cost can be reasonably simplified.
在一种可能的实现方式中,所述对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值,可以包括:In a possible implementation, the performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
若当前块处于所属对象的上边界,则根据当前块的左侧边对应的第一相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;If the current block is at the upper boundary of the object to which it belongs, then according to the value of the first adjacent pixel corresponding to the left side of the current block, the cost value of the last coefficient group under the combination of various candidate symbols is calculated;
根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值。According to the cost values under various candidate symbol combinations, the symbol prediction value corresponding to the last coefficient group is determined.
在这里,第一相邻像素值可以是由当前块的左侧边相邻两列的参考像素值组成的。Here, the first adjacent pixel value may be composed of reference pixel values in two adjacent columns on the left side of the current block.
在另一种可能的实现方式中,所述对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值,可以包括:In another possible implementation manner, the performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
若当前块处于所属对象的左边界,则根据当前块的上侧边对应的第二相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;If the current block is at the left boundary of the object to which it belongs, then calculate the cost value of the last coefficient group under various candidate symbol combinations according to the second adjacent pixel value corresponding to the upper side of the current block;
根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值。According to the cost values under various candidate symbol combinations, the symbol prediction value corresponding to the last coefficient group is determined.
在这里,第二相邻像素值可以是由当前块的上侧边相邻两行的参考像素值组成的。Here, the second adjacent pixel values may be composed of reference pixel values of two adjacent rows on the upper side of the current block.
需要说明的是,在本申请实施例中,所属对象可以包括下述至少之一:图像和编码树单元。也就是说,当前块无论是处于图像的上边界还是编码树单元的上边界,这时候都可以根据当前块的左侧边对应的第一相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;或者,当前块无论是处于图像的左边界还是编码树单元的左边界,这时候都可以根据当前块的上侧边对应的第二相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值。需要注意的是,这里的多种候选符号组合可以是基于不同的符号预测模式确定的。It should be noted that, in this embodiment of the present application, the belonging object may include at least one of the following: an image and a coding tree unit. That is to say, no matter whether the current block is at the upper boundary of the image or the upper boundary of the coding tree unit, at this time, the last coefficient group can be calculated according to the value of the first adjacent pixel corresponding to the left side of the current block among multiple candidate The cost value under the symbol combination; or, whether the current block is at the left boundary of the image or the left boundary of the coding tree unit, at this time, the last coefficient can be calculated according to the second adjacent pixel value corresponding to the upper side of the current block The cost value of the group under various candidate symbol combinations. It should be noted that the multiple candidate symbol combinations here may be determined based on different symbol prediction modes.
还需要说明的是,在本申请实施例中,本申请实施例的技术方案实现的前提是满足以下的一些限定:It should also be noted that, in the embodiment of the present application, the premise of realizing the technical solution of the embodiment of the present application is to meet some of the following limitations:
(1)当前序列允许使用符号预测技术;(1) The current sequence allows the use of sign prediction techniques;
(2)符号预测作用于当前块中的某一块区域,例如左上角位置的N×M区域,M和N为正整数。(2) Sign prediction acts on a certain block area in the current block, for example, the N×M area at the upper left corner, where M and N are positive integers.
具体而言,对于处于编码树单元第一行的当前块,当前块需要使用到上方编码树单元中的重建值。为了减少行缓存,可以省去上侧代价的计算;类似于处理图像边缘的代价一样,省去取上方编码树单元中的重建值计算,具体如下所示,Specifically, for the current block in the first row of the coding tree unit, the current block needs to use the reconstructed value in the upper coding tree unit. In order to reduce the line cache, the calculation of the upper side cost can be omitted; similar to the cost of processing the edge of the image, the calculation of the reconstruction value in the upper coding tree unit is omitted, as shown below,
Figure PCTCN2021143688-appb-000005
Figure PCTCN2021143688-appb-000005
对于处于编码树单元第一列的当前块,当前块需要使用到左侧编码树单元中的重建值。为了减少列缓存,也可以省去左侧代价的计算;类似于处理图像边缘的代价一样,省去取左侧编码树单元中的重建值计算,具体如下所示,For the current block in the first column of the coding tree unit, the current block needs to use the reconstructed value in the left coding tree unit. In order to reduce the column cache, the calculation of the left cost can also be omitted; similar to the cost of processing the edge of the image, the calculation of the reconstruction value in the left coding tree unit is omitted, as shown below,
Figure PCTCN2021143688-appb-000006
Figure PCTCN2021143688-appb-000006
这样,以当前块处于编码树单元的上边界为例,在通用测试条件下使用全帧内编码配置进行测试,该方法(跳过上方的代价计算)后编解码性能变化如图12所示。根据图12可以得到,在这样的简化下,对编解码性能造成的影响不明显。In this way, taking the current block at the upper boundary of the coding tree unit as an example, the full intra-frame coding configuration is used for testing under common test conditions, and the codec performance changes after this method (skipping the upper cost calculation) are shown in Figure 12. According to FIG. 12 , it can be obtained that under such simplification, the influence on the performance of encoding and decoding is not obvious.
进一步地,在ECM的实现中,符号预测需要参考上方和左侧的两行两列的重建值,而在上述的实施例中提出了对于编码树单元第一行的当前块可以采用只参考左侧的方式,能够减少复杂度。另外,这里还提出一个可以替代的方案,即将使用上方两行修改为只使用上方一行,而左侧仍然使用两列。Furthermore, in the implementation of ECM, the symbol prediction needs to refer to the reconstruction values of the two rows and two columns above and on the left, but in the above-mentioned embodiment, it is proposed that only the left The side way can reduce the complexity. In addition, an alternative solution is also proposed here, which is to modify the use of the upper two rows to only use the upper row, while still using two columns on the left.
因此,在一些实施例中,所述对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值,可以包括:Therefore, in some embodiments, performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
若当前块处于所属对象的上边界,则根据当前块的左侧边对应的第一相邻像素值和当前块的上侧边对应的第二相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;If the current block is at the upper boundary of the object to which it belongs, calculate the last coefficient group in multiple The cost value under the combination of candidate symbols;
根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值。According to the cost values under various candidate symbol combinations, the symbol prediction value corresponding to the last coefficient group is determined.
需要说明的是,第一相邻像素值可以是由当前块的左侧边相邻两列的参考像素值组成的,第二相邻像素值可以是由当前块的上侧边相邻一行的参考像素值组成的。在这种情况下,代价计算如下所示,It should be noted that the first adjacent pixel value may be composed of the reference pixel values of two columns adjacent to the left side of the current block, and the second adjacent pixel value may be composed of the reference pixel values of the upper side of the current block adjacent to one row Composed of reference pixel values. In this case, the cost calculation is as follows,
Figure PCTCN2021143688-appb-000007
Figure PCTCN2021143688-appb-000007
还需要说明的是,如果当前块处于所属对象的左边界,那么也可以是参考上方两行以及左侧一列。因此,在一些实施例中,所述对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值,可以包括:It should also be noted that if the current block is at the left boundary of the object to which it belongs, it may also refer to the upper two rows and the left column. Therefore, in some embodiments, performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
若当前块处于所属对象的左边界,则根据当前块的左侧边对应的第一相邻像素值和当前块的上侧边对应的第二相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;If the current block is at the left boundary of the object to which it belongs, calculate the last coefficient group in multiple The cost value under the combination of candidate symbols;
根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值。According to the cost values under various candidate symbol combinations, the symbol prediction value corresponding to the last coefficient group is determined.
需要说明的是,第一相邻像素值可以是由当前块的左侧边相邻一列的参考像素值组成的,第二相邻像素值可以是由当前块的上侧边相邻两行的参考像素值组成的。在这种情况下,代价计算如下所示,It should be noted that the first adjacent pixel value may be composed of reference pixel values adjacent to the left side of the current block in one column, and the second adjacent pixel value may be composed of reference pixel values adjacent to the upper side of the current block in two rows. Composed of reference pixel values. In this case, the cost calculation is as follows,
Figure PCTCN2021143688-appb-000008
Figure PCTCN2021143688-appb-000008
还需要说明的是,在本申请实施例中,所属对象可以包括下述至少之一:图像和编码树单元。另外,对于当前块处于图像或者编码树单元的左边界或者上边界,本申请实施例甚至还可以使用当前块的左侧边相邻一列的参考像素值和当前块的上侧边相邻一行的参考像素值进行代价值计算,这里对此不作具体限定。It should also be noted that, in this embodiment of the present application, the belonging object may include at least one of the following: an image and a coding tree unit. In addition, for the current block at the left boundary or upper boundary of the image or coding tree unit, the embodiment of the present application can even use the reference pixel values of a column adjacent to the left side of the current block and the reference pixel values of a row adjacent to the upper side of the current block. The cost value is calculated with reference to the pixel value, which is not specifically limited here.
还需要说明的是,在确定出多种候选符号组合下的代价值之后,所述根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值,可以包括:It should also be noted that, after determining the cost values under various candidate symbol combinations, determining the symbol prediction value corresponding to the last coefficient group according to the cost values under the various candidate symbol combinations may include:
从多种候选符号组合下的代价值中确定最小代价值;Determining the minimum cost value from the cost values under a variety of candidate symbol combinations;
根据最小代价值对应的候选符号组合,确定最后一个系数组对应的符号预测值。According to the candidate symbol combination corresponding to the minimum cost value, the symbol prediction value corresponding to the last coefficient group is determined.
也就是说,假设从最后一个系数组选择出其中的K个系数来预测正负号,能够得到2 K种可能的正负组合;然后根据预先计算的模板,计算出2 K种变换块在第一行和第一列的假设的反变换残差值;再利用变换块的这2 K种假设的反变换残差值和预测值,能够得到2 K种假设重建值,从2 K种假设重建值选出一种与周围已重建的块之间代价最小的假设重建值;最后,代价值最小的反变换残差值所使用的一组正负号即为正负号预测得到的符号预测值。 That is to say, assuming that K coefficients are selected from the last coefficient group to predict the sign, 2 K possible combinations of signs and negatives can be obtained; then according to the pre-calculated template, 2 K kinds of transform blocks are calculated The hypothetical inverse transformation residual value of one row and the first column; and then using the inverse transformation residual value and predicted value of these 2 K hypotheses of the transformation block, 2 K hypothetical reconstruction values can be obtained, and reconstruction from 2 K hypothetical value to select a hypothetical reconstruction value with the smallest cost between the surrounding reconstructed blocks; finally, a set of signs used by the inverse transformation residual value with the smallest cost value is the sign prediction value obtained by sign prediction .
这样,对于变换系数正负号的符号预测,如果当前块处于编码树单元上边界,那么需要对代价计算的方式进行调整,例如对上侧代价计算进行限制,减少跨编码树单元来取重建值的情况,尤其是取上方编码树单元中的重建值。本申请实施例提出了简化的解决方案:直接跳过上侧代价计算或 只考虑使用一行。In this way, for the sign prediction of the sign of the transformation coefficient, if the current block is at the upper boundary of the coding tree unit, then the cost calculation method needs to be adjusted, for example, the upper side cost calculation is restricted, and the reconstruction value obtained across the coding tree unit is reduced In the case of , especially take the reconstructed value in the coding tree unit above. The embodiment of the present application proposes a simplified solution: directly skip the upper side cost calculation or only consider using one row.
还可以理解,对于图像边缘来说,在ECM的实现中,代价计算始终跳过了没有重建值的那一侧,例如,如图13所示,(a)示出了当前块处于图像的上边界,(b)示出了当前块处于图像的左边界。如果当前块处于图像的第一行(即上边界),那么代价计算跳过上侧只算左侧,同上述的式(5)所示;如果当前块处于图像的第一列(即左边界),那么代价计算跳过左侧只算上侧,同上述的式(6)所示。It can also be understood that for the edge of the image, in the implementation of ECM, the cost calculation always skips the side that has no reconstruction value, for example, as shown in Figure 13, (a) shows that the current block is on the top of the image Border, (b) shows that the current block is at the left border of the image. If the current block is in the first row of the image (that is, the upper boundary), then the cost calculation skips the upper side and only calculates the left side, as shown in the above formula (5); if the current block is in the first column of the image (that is, the left boundary ), then the cost calculation skips the left side and only counts the upper side, as shown in the above formula (6).
而对于只算一侧代价的情况,在一种实现方式中仍然是考虑上侧和左侧总共的能量变化,所以对于基于能量大小选择非零变换系数来预测正负号的方法,计算没有重建值那一侧的能量没有意义。For the case of only calculating the cost of one side, in one implementation, the total energy change of the upper side and the left side is still considered, so for the method of selecting non-zero transformation coefficients based on the energy size to predict the sign, the calculation is not reconstructed The energy on that side of the value is meaningless.
基于此,本申请实施例提出另一种实现方式。首先,基于当前块上侧和左侧能量的的大小来选择待预测正负号的变换系数。这种选择系数的方式需满足以下限定:Based on this, the embodiment of the present application proposes another implementation manner. Firstly, the transform coefficients whose sign is to be predicted are selected based on the magnitude of the energy on the upper side and the left side of the current block. This way of selecting coefficients needs to satisfy the following restrictions:
(1)符号预测允许最多预测该区域中不大于K个非零系数的正负号,例如在ECM中,对于一次变换K=8个,二次变换K=4个。(1) Sign prediction allows to predict the signs of no more than K non-zero coefficients in the region at most, for example, in ECM, K=8 for one transformation and K=4 for secondary transformation.
(2)当当前区域中非零系数超过最大限制时,可以采用定义的筛选方法筛选出K个待预测正负号的系数。(2) When the non-zero coefficients in the current area exceed the maximum limit, the defined screening method can be used to filter out K coefficients with signs to be predicted.
具体地,在一些实施例中,所述对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值,可以包括:Specifically, in some embodiments, performing sign prediction on the last coefficient group and determining a sign prediction value of the last coefficient group may include:
若最后一个系数组中非零重建系数绝对值的个数大于K,则从最后一个系数组中选取K个非零重建系数绝对值;其中,K为大于零的整数;If the number of non-zero reconstruction coefficient absolute values in the last coefficient group is greater than K, then select K non-zero reconstruction coefficient absolute values from the last coefficient group; wherein, K is an integer greater than zero;
利用K个非零重建系数绝对值进行符号预测,确定K个非零重建系数绝对值的符号预测值。Using the absolute values of the K non-zero reconstruction coefficients for sign prediction, determine the sign prediction values of the K non-zero absolute values of the reconstruction coefficients.
进一步地,在一些实施例中,所述从最后一个系数组中选取K个非零重建系数绝对值,可以包括:Further, in some embodiments, the selection of K absolute values of non-zero reconstruction coefficients from the last coefficient group may include:
利用光栅扫描顺序对最后一个系数组进行扫描,将最先扫描到的K个非零重建系数绝对值确定为选取的K个非零重建系数绝对值;Scanning the last coefficient group by raster scanning order, and determining the absolute values of the first scanned K non-zero reconstruction coefficients as the selected K non-zero reconstruction coefficient absolute values;
或者,or,
确定最后一个系数组中非零重建系数的绝对值;determine the absolute value of the non-zero reconstruction coefficients in the last coefficient group;
从非零重建系数的绝对值中确定最大的K个绝对值,根据K个绝对值确定选取的K个非零重建系数绝对值;Determine the largest K absolute values from the absolute values of the non-zero reconstruction coefficients, and determine the selected K absolute values of the non-zero reconstruction coefficients according to the K absolute values;
或者,or,
确定最后一个系数组中非零重建系数的能量值;determine the energy values of the non-zero reconstruction coefficients in the last coefficient group;
从非零重建系数的能量值中确定最大的K个能量值,根据K个能量值确定选取的K个非零重建系数绝对值。The largest K energy values are determined from the energy values of the non-zero reconstruction coefficients, and the absolute values of K selected non-zero reconstruction coefficients are determined according to the K energy values.
也就是说,针对用于正负号预测的非零系数的筛选,可以是按照ECM中的光栅扫描顺序,将最先扫描到的K个值确定为选取的K个非零重建系数绝对值;或者,也可以是根据绝对值大小确定最大的K个绝对值,然后根据这K个绝对值确定选取的K个非零重建系数绝对值;或者,也可以是根据能量值大小确定最大的K个能量值,然后根据这K个能量值确定选取的K个非零重建系数绝对值,本申请实施例并不作具体限定。That is to say, for the screening of non-zero coefficients used for sign prediction, the first K values scanned may be determined as the absolute values of the selected K non-zero reconstruction coefficients according to the raster scanning order in the ECM; Alternatively, it is also possible to determine the largest K absolute values according to the absolute value, and then determine the selected K absolute values of non-zero reconstruction coefficients according to the K absolute values; or, it is also possible to determine the largest K absolute values according to the energy value energy values, and then determine K selected absolute values of non-zero reconstruction coefficients according to the K energy values, which are not specifically limited in this embodiment of the present application.
进一步地,在能量值的计算过程中,对于处于编码树单元边界或者图像边界的当前块,可以参考代价的计算,仅使用某一侧能量计算跳过的解决方案。具体地,在一些实施例中,所述确定最后一个系数组中非零重建系数的能量值,可以包括:Further, in the process of calculating the energy value, for the current block at the boundary of the coding tree unit or the boundary of the picture, the calculation of the cost may be referred to, and only the energy of one side is used to calculate the solution of skipping. Specifically, in some embodiments, the determining the energy value of the non-zero reconstruction coefficient in the last coefficient group may include:
确定最后一个系数组中非零重建系数在当前块的左侧边的反变换值和在当前块的上侧边的反变换值;determining the inverse transform value of the non-zero reconstruction coefficients in the last coefficient group on the left side of the current block and the inverse transform value on the upper side of the current block;
若当前块处于所属对象的上边界,则根据非零重建系数在当前块的左侧边的反变换值,计算非零重建系数的能量值;If the current block is at the upper boundary of the object to which it belongs, calculate the energy value of the non-zero reconstruction coefficient according to the inverse transformation value of the non-zero reconstruction coefficient on the left side of the current block;
若当前块处于所属对象的左边界,则根据非零重建系数在当前块的上侧边的反变换值,计算非零重建系数的能量值。If the current block is at the left boundary of the object to which it belongs, the energy value of the non-zero reconstruction coefficient is calculated according to the inverse transformation value of the non-zero reconstruction coefficient on the upper side of the current block.
需要说明的是,针对用于正负号预测的非零系数的筛选,当使用能量计算时,在ECM中对于处于图像边界的当前块,代价只计算了有邻近重建块的一侧,对于超出图像边界一侧的代价实施跳过。对于这样的情况,计算超过图像边界一侧的能量没有意义,也应当跳过。同理,对于其它潜在的筛选方法,应当去除筛选方法中对超过图像边界一侧的计算。It should be noted that, for the screening of non-zero coefficients used for sign prediction, when energy calculation is used, in ECM, for the current block at the image boundary, the cost is only calculated on the side with adjacent reconstruction blocks. The cost on one side of the image boundary implements skipping. For such cases, it is meaningless to calculate the energy beyond the side of the image boundary and should be skipped. Similarly, for other potential screening methods, calculations on the side beyond the image boundary in the screening method should be removed.
示例性地,当前块处于图像上边界时,上侧代价计算跳过,这时候仅利用左侧进行能量计算,该能量计算如下所示,Exemplarily, when the current block is at the upper boundary of the image, the cost calculation on the upper side is skipped. At this time, only the left side is used for energy calculation. The energy calculation is as follows,
Figure PCTCN2021143688-appb-000009
Figure PCTCN2021143688-appb-000009
当前块处于图像左边界时,左侧代价计算跳过,这时候仅利用上侧进行能量计算,该能量计算如下所示,When the current block is at the left boundary of the image, the cost calculation on the left side is skipped. At this time, only the upper side is used for energy calculation. The energy calculation is as follows,
Figure PCTCN2021143688-appb-000010
Figure PCTCN2021143688-appb-000010
其中,tc i,j为4×4的左上角区域中的变换系数(i,j代表坐标),T i,j(k)为在(i,j)位置处的变换系数为1时,在当前变换块左侧边缘和上侧边缘中的第k个反变换值,w和h表示当前变换块的宽度和高度。 Among them, tc i,j is the transformation coefficient in the area of the upper left corner of 4×4 (i,j represents coordinates), T i,j (k) is the transformation coefficient at position (i,j) when it is 1, in The k-th inverse transform value in the left edge and upper edge of the current transform block, w and h represent the width and height of the current transform block.
考虑到在ECM后续的实施中,有可能存在对处于编码树单元第一行的当前块的代价计算进行限制,例如,对于这一行的当前块,不再同时计算上侧和左侧总共的代价而是只计算左侧跳过上侧,筛选能量的标准也可以只参考左侧不参考上侧。因此,在编码树单元边界的情况下,能量计算也应该跳过某侧能量,如上述的式(9)和式(10)所示。Considering that in the subsequent implementation of ECM, there may be restrictions on the cost calculation of the current block in the first row of the coding tree unit, for example, for the current block of this row, the total cost of the upper side and the left side is no longer calculated at the same time Instead, only the left side is calculated and the upper side is skipped, and the energy screening standard can only refer to the left side instead of the upper side. Therefore, in the case of coding tree unit boundaries, the energy calculation should also skip the energy of a certain side, as shown in the above formulas (9) and (10).
也就是说,对于使用某一侧代价计算跳过的解决方案时,筛选待预测正负号的变换系数的标准也需做出相应优化,例如,代价的计算只参考某一侧时,能量的计算也只应参考那一侧。That is to say, when using a certain side cost calculation to skip the solution, the criteria for screening the transformation coefficients of the sign to be predicted also need to be optimized accordingly. For example, when the cost calculation only refers to a certain side, the energy Calculations should also refer to that side only.
这样,以将上述优化应用于图像边界的当前块能量计算为例,与优化之前的能量计算方案相比,在全帧内编码配置进行测试,编解码性能变化如图14所示。根据图14可以得到,此优化在对图像边界的能量计算进行简化的同时,还能够提供0.01%的编码性能增益。In this way, taking the above optimization applied to the current block energy calculation of the image boundary as an example, compared with the energy calculation scheme before optimization, the test is carried out in the full intra-frame coding configuration, and the codec performance changes are shown in Figure 14. According to FIG. 14 , it can be obtained that this optimization can provide a coding performance gain of 0.01% while simplifying the energy calculation of the image boundary.
还可以理解,在ECM的实现中对于图像左上角位置的当前块,如图15所示,这时候的代价计算公式如下所示,It can also be understood that in the implementation of ECM, for the current block at the upper left corner of the image, as shown in Figure 15, the cost calculation formula at this time is as follows,
Figure PCTCN2021143688-appb-000011
Figure PCTCN2021143688-appb-000011
其中,default为初始值,当像素比特深度为n时,default=2 n-1。然而对于处于边缘的当前块,由于没有附近块的重建值,这样的代价计算是不合理的。 Wherein, default is an initial value, and when the pixel bit depth is n, default=2 n-1 . However, for the current block at the edge, since there is no reconstruction value of nearby blocks, such cost calculation is unreasonable.
在本申请实施例中,该方法还可以包括:若当前块处于所属对象的左上角位置,则确定当前块的重建系数绝对值不进行符号预测。In the embodiment of the present application, the method may further include: if the current block is at the upper left corner of the object to which it belongs, determining the absolute value of the reconstruction coefficient of the current block without performing sign prediction.
也就是说,由于将左上角位置没有邻近块的当前块参考重建值设为默认值不合理,那么本申请实施例可以直接跳过对这个块进行变换系数的正负号预测。与设置默认值的方案相比,在全帧内编码配置进行测试,编解码性能变化如图16所示。根据图16可以得到,如果跳过左上方没有邻近参考块的变换块,那么也能够提供一定的编码性能增益。That is to say, since it is unreasonable to set the reference reconstruction value of the current block with no adjacent block at the upper left corner as the default value, the embodiment of the present application may directly skip the sign prediction of the transform coefficient for this block. Compared with the scheme of setting the default value, the test is carried out in the full intra-frame coding configuration, and the codec performance changes are shown in Figure 16. According to FIG. 16 , it can be obtained that if the transform block with no adjacent reference block on the upper left is skipped, a certain encoding performance gain can also be provided.
进一步地,在一些实施例中,在确定出最后一个系数组的符号预测值之后,如图17所示,该方法还可以包括:Further, in some embodiments, after the sign prediction value of the last coefficient group is determined, as shown in FIG. 17 , the method may further include:
S1701:解析码流,确定最后一个系数组的符号残差值。S1701: Parse the code stream, and determine the sign residual value of the last coefficient group.
S1702:根据最后一个系数组的符号预测值和最后一个系数组的符号残差值,确定最后一个系数组的符号原始值。S1702: Determine the original sign value of the last coefficient group according to the sign prediction value of the last coefficient group and the sign residual value of the last coefficient group.
S1703:根据最后一个系数组的符号原始值,确定当前块的重建系数。S1703: Determine the reconstruction coefficient of the current block according to the signed original value of the last coefficient group.
需要说明的是,在本申请实施例中,可以基于上下文模型解码出最后一个系数组的符号残差值。It should be noted that, in the embodiment of the present application, the sign residual value of the last coefficient group can be decoded based on the context model.
还需要说明的是,在一种具体的实施例中,对于S1702来说,所述根据最后一个系数组的符号预测值和最后一个系数组的符号残差值,确定最后一个系数组的符号原始值,可以包括:对根据最后一个系数组的符号预测值和最后一个系数组的符号残差值进行异或运算,确定最后一个系数组的符号原始值。It should also be noted that, in a specific embodiment, for S1702, the original sign of the last coefficient group is determined according to the sign prediction value of the last coefficient group and the sign residual value of the last coefficient group. The value may include: performing an XOR operation on the predicted value of the sign of the last coefficient group and the residual value of the sign of the last coefficient group to determine the original value of the sign of the last coefficient group.
在另一种具体的实施例中,对于S1702来说,所述根据最后一个系数组的符号预测值和最后一个系数组的符号残差值,确定最后一个系数组的符号原始值,可以包括:对根据最后一个系数组的符号预测值和最后一个系数组的符号残差值进行加法运算,确定最后一个系数组的符号原始值。In another specific embodiment, for S1702, the determining the original sign value of the last coefficient group according to the sign prediction value of the last coefficient group and the sign residual value of the last coefficient group may include: An addition operation is performed on the predicted value according to the sign of the last coefficient group and the sign residual value of the last coefficient group to determine the original sign value of the last coefficient group.
也就是说,解码器从上下文模型中解码出正负号的符号残差值,然后根据符号残差值与符号预测值可以得到最后一个系数组的符号原始值(即真实的正负号),将真实的正负号直接赋值给重建系 数,然后在进一步完成解码后续操作(例如,反变换、重建等等)。That is to say, the decoder decodes the sign residual value of the sign from the context model, and then obtains the sign original value of the last coefficient group (that is, the real sign) according to the sign residual value and the sign prediction value, The actual positive and negative signs are directly assigned to the reconstruction coefficients, and then subsequent decoding operations (for example, inverse transformation, reconstruction, etc.) are further completed.
本申请实施例提供了一种解码方法,通过解析码流,确定当前块的重建系数绝对值;按照预设扫描顺序对当前块的重建系数绝对值进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。这样,按照预设扫描顺序对当前块的变换系数进行扫描,然后确定出当前块在预设扫描顺序上的最后一个系数组,以便对最后一个系数组进行符号预测,如此不仅能够允许更多形状更多大小的块可以进行符号预测,拓展了符号预测技术的适用范围;而且在符号预测过程中,针对当前块处于图像或者编码树单元的上边界或左边界的情况,还对代价计算的方式进行优化,同时针对筛选待预测正负的变换系数的能量计算方式也进行适应性调整,从而还降低了计算复杂度,提高了正负号的符号预测准确度。The embodiment of the present application provides a decoding method, which determines the absolute value of the reconstruction coefficient of the current block by analyzing the code stream; scans the absolute value of the reconstruction coefficient of the current block according to the preset scanning order, and determines that the current block is in the preset scanning order The last coefficient group of ; perform sign prediction on the last coefficient group, and determine the sign prediction value of the last coefficient group. In this way, the transform coefficients of the current block are scanned according to the preset scanning order, and then the last coefficient group of the current block in the preset scanning order is determined, so as to perform sign prediction on the last coefficient group, which not only allows more shapes Blocks of more sizes can be used for symbol prediction, which expands the applicable scope of symbol prediction technology; and in the process of symbol prediction, for the case where the current block is at the upper boundary or left boundary of the image or coding tree unit, the cost calculation method is also adjusted. Optimization is carried out, and at the same time, adaptive adjustments are made to the energy calculation method for screening the transform coefficients to be predicted, thereby reducing the computational complexity and improving the sign prediction accuracy of the sign.
本申请的另一实施例中,参见图18,其示出了本申请实施例提供的一种编码方法的流程示意图一。如图18所示,该方法可以包括:In another embodiment of the present application, refer to FIG. 18 , which shows the first schematic flowchart of an encoding method provided by the embodiment of the present application. As shown in Figure 18, the method may include:
S1801:确定当前块的变换系数。S1801: Determine the transformation coefficient of the current block.
需要说明的是,本申请实施例的编码方法应用于编码器,具体可以是一种符号预测方法,这里主要是针对当前块中的变换系数的正负号进行预测。It should be noted that the encoding method in the embodiment of the present application is applied to an encoder, and specifically may be a sign prediction method, where the sign of the transform coefficient in the current block is mainly predicted.
还需要说明的是,基于图8A所示编码器100的组成结构,本申请实施例的编码方法则是应用于编码器100中的“熵编码单元115”部分,针对该熵编码单元115,可以采用基于上下文模型的自适应二进制算术编码模式对符号残差值进行熵编码,然后写入码流。其中,符号残差值是基于符号原始值和符号预测值确定的。It should also be noted that, based on the composition structure of the encoder 100 shown in FIG. 8A, the encoding method of the embodiment of the present application is applied to the "entropy encoding unit 115" part of the encoder 100. For the entropy encoding unit 115, it can The residual value of the symbol is entropy coded by using the adaptive binary arithmetic coding mode based on the context model, and then written into the code stream. Wherein, the sign residual value is determined based on the sign original value and the sign prediction value.
可以理解,在ECM的实现中,对于当前块而言,块尺寸通常为大于或等于4×4。对于小于4×4的当前块,由于此时左上角位置不存在4×4区域供符号预测(Sign Prediction)使用,所以这样的当前块是禁止使用符号预测。同时,对于大于32×32的帧内块和大于128×128的帧间块,也禁止使用符号预测。然而,在本申请实施例中,可以通过确定在预设扫描顺序上的最后一个系数组,然后对最后一个系数组使用符号预测,使得符号预测能够应用于更多形状更多尺寸的块,拓展了符号预测技术的适用范围。It can be understood that, in the implementation of ECM, for the current block, the block size is usually greater than or equal to 4×4. For a current block smaller than 4×4, since there is no 4×4 area in the upper left corner for sign prediction (Sign Prediction), such a current block is prohibited from using sign prediction. At the same time, sign prediction is also prohibited for intra blocks larger than 32×32 and inter blocks larger than 128×128. However, in the embodiment of the present application, by determining the last coefficient group in the preset scanning order and then using sign prediction for the last coefficient group, the sign prediction can be applied to blocks of more shapes and sizes, extending The scope of applicability of sign prediction technology.
S1802:按照预设扫描顺序对当前块的变换系数进行扫描,确定当前块在预设扫描顺序上的最后一个系数组。S1802: Scan the transform coefficients of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order.
S1803:对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。S1803: Perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
需要说明的是,在本申请实施例中,可以允许在预设扫描顺序上最后一个系数组中选取非零变换系数来使用符号预测。这样,首先可以按照预设扫描顺序对当前块的变换系数进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;然后对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值,从而能够允许更多形状更多大小的块可以进行符号预测,拓展了符号预测技术的适用范围。It should be noted that, in the embodiment of the present application, it may be allowed to select non-zero transform coefficients in the last coefficient group in the preset scanning order to use sign prediction. In this way, firstly, the transform coefficients of the current block can be scanned according to the preset scanning order to determine the last coefficient group of the current block in the preset scanning order; then the symbol of the last coefficient group can be predicted to determine the sign of the last coefficient group Prediction value, so that blocks with more shapes and sizes can be used for symbol prediction, which expands the applicable range of symbol prediction technology.
还需要说明的是,在本申请实施例中,预设扫描顺序可以是对角线、Zigzag、水平、垂直、4×4子块扫描或者任何其它扫描顺序,这里不作任何限定。It should also be noted that, in this embodiment of the present application, the preset scanning order may be diagonal, Zigzag, horizontal, vertical, 4×4 sub-block scanning or any other scanning order, which is not limited herein.
还需要说明的是,不同尺寸的当前块,可以划分为不同数量的系数组。因此,对于系数组的划分,在一些实施例中,该方法还可以包括:It should also be noted that current blocks of different sizes may be divided into coefficient groups of different numbers. Therefore, for the division of coefficient groups, in some embodiments, the method may further include:
若当前块的尺寸为1×N,N为大于或等于16的整数,则确定当前块的变换系数可划分为(N/16)个系数组,且系数组的尺寸为1×16;If the size of the current block is 1×N, and N is an integer greater than or equal to 16, it is determined that the transform coefficient of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient group is 1×16;
若当前块的尺寸为N×1,N为大于或等于16的整数,则确定当前块的变换系数可划分为(N/16)个系数组,且系数组的尺寸为16×1;If the size of the current block is N×1, and N is an integer greater than or equal to 16, it is determined that the transform coefficient of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient group is 16×1;
若当前块的尺寸为2×N,N为大于或等于8的整数,则确定当前块的变换系数可划分为(N/8)个系数组,且系数组的尺寸为2×8;If the size of the current block is 2×N, and N is an integer greater than or equal to 8, it is determined that the transform coefficient of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient group is 2×8;
若当前块的尺寸为N×2,N为大于或等于8的整数,则确定当前块的变换系数可划分为(N/8)个系数组,且系数组的尺寸为8×2;If the size of the current block is N×2, and N is an integer greater than or equal to 8, it is determined that the transform coefficients of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient group is 8×2;
若当前块的尺寸为M×N,M和N均为大于或等于4的整数,则确定当前块的变换系数可划分为(M×N/16)个系数组,且系数组的尺寸为4×4。If the size of the current block is M×N, and both M and N are integers greater than or equal to 4, it is determined that the transform coefficients of the current block can be divided into (M×N/16) coefficient groups, and the size of the coefficient groups is 4 ×4.
需要说明的是,针对当前块的尺寸来说,还可能出现1×N、2×N的块,这些块的形状以及对应的系数组大小如上述的表1所示。It should be noted that for the size of the current block, 1×N and 2×N blocks may also appear, and the shapes of these blocks and the corresponding coefficient group sizes are shown in Table 1 above.
在相关技术中,对于某一侧的长度小于4,ECM中目前是不允许这样的块使用符号预测。而在本申请实施例中,可以允许对块中的所有区域或者部分区域(例如,同ECM中的对左上角位置的4 ×4区域)中非零变换系数使用符号预测。In the related art, for a side whose length is less than 4, ECM currently does not allow such a block to use sign prediction. However, in the embodiment of the present application, it is allowed to use sign prediction for non-zero transform coefficients in all regions or partial regions in the block (for example, the same as the 4×4 region at the upper left corner position in ECM).
示例性地,ECM中目前对大于4×4的当前块,左上角位置的4×4区域(左上角位置的系数组)中非零变换系数允许使用符号预测;同理,对于小于4×4的当前块,也可以允许在预设扫描顺序上最后一个系数组中选取非零变换系数使用符号预测。图10示出了本申请实施例提供的对小于4×4的块允许其在预设扫描顺序上最后一个系数组使用符号预测时在对比ECM参考软件在全帧内编码下带来的编码效果提升示意。其中,在YUV颜色空间下的Y分量、U分量和V分量等三个分量下分别带来了0.02%、0.1%、0.07%的性能提升,而且编码时间(用EncT表示)和解码时间(用DecT表示)变化不大。Exemplarily, for a current block larger than 4×4 in the ECM, the non-zero transform coefficients in the 4×4 area (coefficient group at the upper left position) in the upper left corner position allow the use of sign prediction; similarly, for the current block smaller than 4×4 For the current block, it is also allowed to select non-zero transform coefficients in the last coefficient group in the preset scanning order to use sign prediction. Fig. 10 shows the encoding effect of the ECM reference software under full intra-frame encoding when the last coefficient group in the preset scanning order is allowed to use sign prediction for a block smaller than 4×4 provided by the embodiment of the present application. Raise sign. Among them, under the three components of Y component, U component and V component under the YUV color space, the performance improvement of 0.02%, 0.1% and 0.07% was brought respectively, and the encoding time (expressed by EncT) and decoding time (expressed by DecT said) little changed.
另外,在实际应用中,越靠近左上角位置,在预设扫描顺序上越靠后,即最后一个系数组即是处于当前块的左上角位置。因此,本申请实施例也可以取消使用符号预测技术的块最大尺寸的限制。示例性地,在ECM中目前大于32×32的帧内块和大于128×128的帧间块不可以使用符号预测,而实际上目前允许最大尺寸的块为256×256。所以取消块最大尺寸的限制意味着允许最多到256×256的变换块中部分(例如,同ECM中的对左上角位置的4×4区域)或所有区域中的非零系数正负号的符号预测。In addition, in practical applications, the closer to the upper left corner, the later in the preset scanning order, that is, the last coefficient group is located at the upper left corner of the current block. Therefore, the embodiment of the present application may also cancel the restriction on the maximum size of a block using the sign prediction technology. Exemplarily, in the ECM, the current intra block larger than 32×32 and the inter block larger than 128×128 cannot use sign prediction, but actually the maximum size block is currently allowed to be 256×256. So canceling the block maximum size restriction means allowing up to 256×256 transformation blocks in part (for example, the same as in the ECM 4×4 region for the upper left corner position) or the sign of non-zero coefficient signs in all regions predict.
进一步地,在当前块的尺寸为M×N,M和N均为大于或等于4的整数情况下,这时候系数组的尺寸为4×4。在一些实施例中,该方法还可以包括:Further, when the size of the current block is M×N, and both M and N are integers greater than or equal to 4, then the size of the coefficient group is 4×4. In some embodiments, the method may also include:
确定当前块中处于左上角位置的第一区域;Determine the first area in the upper left corner of the current block;
根据第一区域内的变换系数确定最后一个系数组;其中,最后一个系数组中的变换系数个数为2 L个,且L为大于或等于零的个数。 Determine the last coefficient group according to the transformation coefficients in the first area; wherein, the number of transformation coefficients in the last coefficient group is 2 L , and L is a number greater than or equal to zero.
需要说明的是,通常情况下,如果当前块的尺寸大于或等于4×4,那么可以直接将左上角位置的4×4区域作为最后一个系数组。另外,考虑到符号预测所使用非零变换系数的个数通常为K个,如果4×4区域中的非零变换系数小于K个,这时候还可以适当扩大左上角区域,例如将左上角位置的8×8区域、16×16区域等作为最后一个系数组,以使得最后一个系数组中的变换系数个数为2 L个。在本申请实施例中,第一区域可以为4×4区域,但是这里不作具体限定。 It should be noted that, generally, if the size of the current block is greater than or equal to 4×4, then the 4×4 area at the upper left corner can be directly used as the last coefficient group. In addition, considering that the number of non-zero transform coefficients used for symbol prediction is usually K, if the number of non-zero transform coefficients in the 4×4 area is less than K, the upper left corner area can be appropriately expanded at this time, for example, the upper left corner position The 8×8 area, 16×16 area, etc. of the last coefficient group are used as the last coefficient group, so that the number of transformation coefficients in the last coefficient group is 2L . In the embodiment of the present application, the first area may be a 4×4 area, but it is not specifically limited here.
还需要说明的是,K为大于零的整数。示例性地,对于一次变换,K的取值可以为8;对于二次变换,K的取值可以为4,但是并不作具体限定。It should also be noted that K is an integer greater than zero. Exemplarily, for the first transformation, the value of K may be 8; for the second transformation, the value of K may be 4, but this is not specifically limited.
这样,可以将可以使用变换系数正负号预测的当前块的使用范围进行拓展,允许更多形状更多大小的块使用符号预测技术。具体地,例如小于4×4的块和帧内大于32×32,帧间大于128×128的块,都可以使用此符号预测技术。In this way, the use range of the current block that can be predicted by using the sign of the transform coefficient can be expanded, allowing blocks with more shapes and sizes to use the sign prediction technology. Specifically, for example, a block smaller than 4×4, a block larger than 32×32 in an intra frame, and a block larger than 128×128 in an inter frame can all use this symbol prediction technology.
还可以理解,为了减少复杂度以及保证正负号的预测准确度,对于编码树单元第一行的变换单元,代价的计算方式可以进行合理的简化。在一种可能的实现方式中,如图19所示,对于S1803来说,该步骤可以包括:It can also be understood that, in order to reduce the complexity and ensure the prediction accuracy of the sign, for the transformation units in the first row of the coding tree unit, the calculation method of the cost can be reasonably simplified. In a possible implementation manner, as shown in FIG. 19, for S1803, this step may include:
S1901:若当前块处于所属对象的上边界,则根据当前块的左侧边对应的第一相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值。S1901: If the current block is at the upper boundary of the object to which it belongs, calculate the cost value of the last coefficient group under various candidate symbol combinations according to the first adjacent pixel value corresponding to the left side of the current block.
S1902:从多种候选符号组合下的代价值中确定最小代价值。S1902: Determine the minimum cost value from the cost values under various candidate symbol combinations.
S1903:根据最小代价值对应的候选符号组合,确定最后一个系数组对应的符号预测值。S1903: Determine the symbol prediction value corresponding to the last coefficient group according to the candidate symbol combination corresponding to the minimum cost value.
在本申请实施例中,第一相邻像素值可以是由当前块的左侧边相邻两列的参考像素值组成的。In the embodiment of the present application, the first adjacent pixel value may be composed of reference pixel values in two adjacent columns on the left side of the current block.
也就是说,如果当前块处于所属对象的上边界,那么根据当前块的左侧边对应的第一相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值。在这里,第一相邻像素值可以是由当前块的左侧边相邻两列的参考像素值组成的。That is to say, if the current block is at the upper boundary of the object to which it belongs, then calculate the cost value of the last coefficient group under various candidate symbol combinations according to the first adjacent pixel value corresponding to the left side of the current block; The cost value under the candidate symbol combination determines the symbol prediction value corresponding to the last coefficient group. Here, the first adjacent pixel value may be composed of reference pixel values in two adjacent columns on the left side of the current block.
在另一种可能的实现方式中,所述对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值,可以包括:In another possible implementation manner, the performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
若当前块处于所属对象的左边界,则根据当前块的上侧边对应的第二相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;If the current block is at the left boundary of the object to which it belongs, then calculate the cost value of the last coefficient group under various candidate symbol combinations according to the second adjacent pixel value corresponding to the upper side of the current block;
根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值。According to the cost values under various candidate symbol combinations, the symbol prediction value corresponding to the last coefficient group is determined.
在这里,第二相邻像素值可以是由当前块的上侧边相邻两行的参考像素值组成的。Here, the second adjacent pixel values may be composed of reference pixel values of two adjacent rows on the upper side of the current block.
需要说明的是,在本申请实施例中,所属对象可以包括下述至少之一:图像和编码树单元。也就是说,当前块无论是处于图像的上边界还是编码树单元的上边界,这时候都可以根据当前块的左侧边对应的第一相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;或者,当前块无论是处于图像的左边界还是编码树单元的左边界,这时候都可以根据当前块的上侧边对应的第二 相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值。需要注意的是,这里的多种候选符号组合可以是基于不同的符号预测模式确定的。It should be noted that, in this embodiment of the present application, the belonging object may include at least one of the following: an image and a coding tree unit. That is to say, no matter whether the current block is at the upper boundary of the image or the upper boundary of the coding tree unit, at this time, the last coefficient group can be calculated according to the value of the first adjacent pixel corresponding to the left side of the current block among multiple candidate The cost value under the symbol combination; or, whether the current block is at the left boundary of the image or the left boundary of the coding tree unit, at this time, the last coefficient can be calculated according to the second adjacent pixel value corresponding to the upper side of the current block The cost value of the group under various candidate symbol combinations. It should be noted that the multiple candidate symbol combinations here may be determined based on different symbol prediction modes.
还需要说明的是,本申请实施例的技术方案实现的前提是满足以下的一些限定:(1)当前序列允许使用符号预测技术;(2)符号预测作用于当前块中的某一块区域,例如左上角位置的N×M区域,M和N为正整数。It should also be noted that the premise of the implementation of the technical solution of the embodiment of the present application is that the following restrictions are met: (1) the current sequence allows the use of symbol prediction technology; (2) the symbol prediction acts on a certain block area in the current block, for example The N×M area at the upper left corner, where M and N are positive integers.
具体而言,对于处于编码树单元第一行的当前块,当前块需要使用到上方编码树单元中的重建值。为了减少行缓存,可以省去上侧代价的计算;类似于处理图像边缘的代价一样,省去取上方编码树单元中的重建值计算,具体如上述的式(5)所示。对于处于编码树单元第一列的当前块,当前块需要使用到左侧编码树单元中的重建值。为了减少列缓存,也可以省去左侧代价的计算;类似于处理图像边缘的代价一样,省去取左侧编码树单元中的重建值计算,具体如上述的式(6)所示。Specifically, for the current block in the first row of the coding tree unit, the current block needs to use the reconstructed value in the upper coding tree unit. In order to reduce the line cache, the calculation of the upper side cost can be omitted; similar to the cost of processing the edge of the image, the calculation of the reconstruction value in the upper coding tree unit is omitted, as shown in the above formula (5). For the current block in the first column of the coding tree unit, the current block needs to use the reconstructed value in the left coding tree unit. In order to reduce the column cache, the calculation of the left cost can also be omitted; similar to the cost of processing the edge of the image, the calculation of the reconstruction value in the left coding tree unit is omitted, as shown in the above formula (6).
这样,以当前块处于编码树单元的上边界为例,在通用测试条件下使用全帧内编码配置进行测试,该方法(跳过上侧的代价计算)后编解码性能变化如图12所示。由此可以得到,在这样的简化下,对编解码性能造成的影响并不明显。In this way, taking the current block at the upper boundary of the coding tree unit as an example, the full intra-frame coding configuration is used for testing under common test conditions, and the codec performance changes after this method (skipping the cost calculation on the upper side) are shown in Figure 12 . It can be obtained from this that under such simplification, the impact on the encoding and decoding performance is not obvious.
进一步地,在ECM的实现中,符号预测需要参考上方和左侧的两行两列的重建值,在上述的实施例中提出了对于编码树单元第一行的当前块可以采用只参考左侧的方式来减少复杂度。一个可以替代的方法为将使用上方两行改为只使用上方一行,而左侧仍然使用两列。Furthermore, in the implementation of ECM, symbol prediction needs to refer to the reconstructed values of the two rows and two columns above and on the left. In the above-mentioned embodiment, it is proposed that only the left way to reduce complexity. An alternative would be to change from using the top two rows to just the top row, while still using two columns to the left.
在又一种可能的实现方式中,所述对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值,可以包括:In yet another possible implementation manner, the performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
若当前块处于所属对象的上边界,则根据当前块的左侧边对应的第一相邻像素值和当前块的上侧边对应的第二相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;If the current block is at the upper boundary of the object to which it belongs, calculate the last coefficient group in multiple The cost value under the combination of candidate symbols;
根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值。According to the cost values under various candidate symbol combinations, the symbol prediction value corresponding to the last coefficient group is determined.
在这里,第一相邻像素值可以是由当前块的左侧边相邻两列的参考像素值组成的,第二相邻像素值可以是由当前块的上侧边相邻一行的参考像素值组成的。在这种情况下,代价计算如上述的式(7)所示.Here, the first adjacent pixel value may be composed of reference pixel values adjacent to two columns on the left side of the current block, and the second adjacent pixel value may be composed of reference pixel values adjacent to one row on the upper side of the current block composed of values. In this case, the cost calculation is shown in Equation (7) above.
还需要说明的是,如果当前块处于所属对象的左边界,那么也可以是参考上方两行以及左侧一列。因此,在再一种可能的实现方式中,所述对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值,可以包括:It should also be noted that if the current block is at the left boundary of the object to which it belongs, it may also refer to the upper two rows and the left column. Therefore, in yet another possible implementation manner, performing sign prediction on the last coefficient group and determining a sign prediction value of the last coefficient group may include:
若当前块处于所属对象的左边界,则根据当前块的左侧边对应的第一相邻像素值和当前块的上侧边对应的第二相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;If the current block is at the left boundary of the object to which it belongs, calculate the last coefficient group in multiple The cost value under the combination of candidate symbols;
根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值。According to the cost values under various candidate symbol combinations, the symbol prediction value corresponding to the last coefficient group is determined.
在这里,第一相邻像素值可以是由当前块的左侧边相邻一列的参考像素值组成的,第二相邻像素值可以是由当前块的上侧边相邻两行的参考像素值组成的。在这种情况下,代价计算如上述的式(8)所示。Here, the first adjacent pixel value may be composed of reference pixel values adjacent to one column on the left side of the current block, and the second adjacent pixel value may be composed of reference pixel values adjacent to two rows on the upper side of the current block composed of values. In this case, the cost calculation is shown in equation (8) above.
还需要说明的是,在本申请实施例中,所属对象可以包括下述至少之一:图像和编码树单元。另外,对于当前块处于图像或者编码树单元的左边界或者上边界,本申请实施例甚至还可以使用当前块的左侧边相邻一列的参考像素值和当前块的上侧边相邻一行的参考像素值进行代价值计算,这里对此不作具体限定。It should also be noted that, in this embodiment of the present application, the belonging object may include at least one of the following: an image and a coding tree unit. In addition, for the current block at the left boundary or upper boundary of the image or coding tree unit, the embodiment of the present application can even use the reference pixel values of a column adjacent to the left side of the current block and the reference pixel values of a row adjacent to the upper side of the current block. The cost value is calculated with reference to the pixel value, which is not specifically limited here.
还需要说明的是,在确定出多种候选符号组合下的代价值之后,所述根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值,可以包括:It should also be noted that, after determining the cost values under various candidate symbol combinations, determining the symbol prediction value corresponding to the last coefficient group according to the cost values under the various candidate symbol combinations may include:
从多种候选符号组合下的代价值中确定最小代价值;Determining the minimum cost value from the cost values under a variety of candidate symbol combinations;
根据最小代价值对应的候选符号组合,确定最后一个系数组对应的符号预测值。According to the candidate symbol combination corresponding to the minimum cost value, the symbol prediction value corresponding to the last coefficient group is determined.
也就是说,假设从最后一个系数组选择出其中的K个变换系数来预测正负号,能够得到2 K种可能的正负组合;然后计算2 K种变换块在第一行和第一列的假设的反变换残差值,再利用变换块的这2 K种假设的反变换残差值和预测值,能够得到2 K种假设重建值,从2 K种假设重建值选出一种与周围已重建的块之间代价最小的假设重建值;最后,代价值最小的反变换残差值所使用的一组正负号即为正负号预测得到的符号预测值。 That is to say, assuming that K transform coefficients are selected from the last coefficient group to predict the sign, 2 K possible sign combinations can be obtained; then calculate 2 K transform blocks in the first row and first column The hypothetical inverse transformation residual value of the transformation block, and then using the 2 K hypothetical inverse transformation residual values and predicted values of the transformation block, 2 K hypothetical reconstruction values can be obtained, and one of the hypothetical reconstruction values is selected from the 2 K hypothetical reconstruction values. The hypothetical reconstruction value with the least cost between the surrounding reconstructed blocks; finally, the set of signs used for the inverse transformation residual value with the least cost value is the sign prediction value obtained by sign prediction.
这样,对于变换系数正负号的符号预测,如果当前块处于编码树单元上边界,那么需要对代价计算的方式进行调整,例如对上侧代价计算进行限制,减少跨编码树单元来取重建值的情况,尤其是取上方编码树单元中的重建值。本申请实施例提出了简化的解决方案:直接跳过上侧代价计算或只考虑使用一行。In this way, for the sign prediction of the sign of the transformation coefficient, if the current block is at the upper boundary of the coding tree unit, then the cost calculation method needs to be adjusted, for example, the upper side cost calculation is restricted, and the reconstruction value obtained across the coding tree unit is reduced In the case of , especially take the reconstructed value in the coding tree unit above. The embodiment of the present application proposes a simplified solution: directly skip the upper side cost calculation or only consider using one line.
还可以理解,对于图像边缘来说,在ECM的实现中,代价计算始终跳过了没有重建值的那一侧。 而对于只算一侧代价的情况,在一种实现方式中仍然是考虑上侧和左侧总共的能量变化,所以对于基于能量大小选择非零变换系数来预测正负号的方法,计算没有重建值那一侧的能量没有意义。It can also be understood that for image edges, in the implementation of ECM, the cost calculation always skips the side that has no reconstruction value. For the case of only calculating the cost of one side, in one implementation, the total energy change of the upper side and the left side is still considered, so for the method of selecting non-zero transformation coefficients based on the energy size to predict the sign, the calculation is not reconstructed The energy on that side of the value is meaningless.
基于此,本申请实施例提出另一种实现方式。首先,基于当前块上侧和左侧能量的的大小来选择待预测正负号的变换系数。这种选择系数的方式需满足以下限定:(1)符号预测允许最多预测该区域中不大于K个非零系数的正负号,例如在ECM中,对于一次变换K=8个,二次变换K=4个。(2)当当前区域中非零系数超过最大限制时,可以采用定义的筛选方法筛选出K个待预测正负号的系数。Based on this, the embodiment of the present application proposes another implementation manner. Firstly, the transform coefficients whose sign is to be predicted are selected based on the magnitude of the energy on the upper side and the left side of the current block. This way of selecting coefficients needs to meet the following restrictions: (1) sign prediction allows to predict the signs of no more than K non-zero coefficients in this area at most, for example, in ECM, for one transformation K=8, the second transformation K=4. (2) When the non-zero coefficients in the current area exceed the maximum limit, the defined screening method can be used to filter out K coefficients with signs to be predicted.
具体地,在一些实施例中,所述对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值,可以包括:Specifically, in some embodiments, performing sign prediction on the last coefficient group and determining the sign prediction value of the last coefficient group may include:
若最后一个系数组中非零变换系数的个数大于K,则从最后一个系数组中选取K个非零变换系数;其中,K为大于零的整数;If the number of non-zero transformation coefficients in the last coefficient group is greater than K, then select K non-zero transformation coefficients from the last coefficient group; wherein, K is an integer greater than zero;
利用K个非零变换系数进行符号预测,确定K个非零变换系数的符号预测值。The K non-zero transform coefficients are used to perform sign prediction, and the sign prediction values of the K non-zero transform coefficients are determined.
进一步地,在一些实施例中,所述从最后一个系数组中选取K个非零变换系数,可以包括:Further, in some embodiments, the selection of K non-zero transform coefficients from the last coefficient group may include:
利用光栅扫描顺序对最后一个系数组进行扫描,将最先扫描到的K个非零变换系数确定为选取的K个非零变换系数;Scanning the last coefficient group by raster scanning order, and determining the first scanned K non-zero transformation coefficients as the selected K non-zero transformation coefficients;
或者,or,
确定最后一个系数组中非零变换系数的绝对值;determine the absolute value of the non-zero transform coefficients in the last coefficient group;
从非零变换系数的绝对值中确定最大的K个绝对值,根据K个绝对值确定选取的K个非零变换系数;Determine the largest K absolute values from the absolute values of the non-zero transformation coefficients, and determine the selected K non-zero transformation coefficients according to the K absolute values;
或者,or,
确定最后一个系数组中非零变换系数的能量值;determining the energy values of the non-zero transform coefficients in the last coefficient group;
从非零变换系数的能量值中确定最大的K个能量值,根据K个能量值确定选取的K个非零变换系数。The largest K energy values are determined from the energy values of the non-zero transformation coefficients, and K selected non-zero transformation coefficients are determined according to the K energy values.
也就是说,针对用于正负号预测的非零变换系数的筛选,可以是按照ECM中的光栅扫描顺序,将最先扫描到的K个值确定为选取的K个非零变换系数;或者,也可以是根据绝对值大小确定最大的K个绝对值,然后根据这K个绝对值确定选取的K个非零变换系数;或者,也可以是根据能量值大小确定最大的K个能量值,然后根据这K个能量值确定选取的K个非零变换系数,本申请实施例并不作具体限定。That is to say, the screening of non-zero transform coefficients used for sign prediction may be to determine the first K values scanned as the selected K non-zero transform coefficients according to the raster scanning order in the ECM; or , or determine the largest K absolute values according to the absolute value, and then determine the selected K non-zero transformation coefficients according to the K absolute values; or, determine the largest K energy values according to the energy value, Then, K selected non-zero transformation coefficients are determined according to the K energy values, which is not specifically limited in this embodiment of the present application.
进一步地,在能量值的计算过程中,对于处于编码树单元边界或者图像边界的当前块,可以参考代价的计算,仅使用某一侧能量计算跳过的解决方案。具体地,在一些实施例中,所述确定最后一个系数组中非零变换系数的能量值,可以包括:Further, in the process of calculating the energy value, for the current block at the boundary of the coding tree unit or the boundary of the picture, the calculation of the cost may be referred to, and only the energy of one side is used to calculate the solution of skipping. Specifically, in some embodiments, the determining the energy value of the non-zero transform coefficient in the last coefficient group may include:
确定最后一个系数组中非零变换系数在当前块的左侧边的反变换值和在当前块的上侧边的反变换值;determining the inverse transform value of the non-zero transform coefficients in the last coefficient group on the left side of the current block and the inverse transform value on the upper side of the current block;
若当前块处于所属对象的上边界,则根据非零变换系数在当前块的左侧边的反变换值,计算非零变换系数的能量值;If the current block is at the upper boundary of the object to which it belongs, calculate the energy value of the non-zero transform coefficient according to the inverse transform value of the non-zero transform coefficient on the left side of the current block;
若当前块处于所属对象的左边界,则根据非零变换系数在当前块的上侧边的反变换值,计算非零变换系数的能量值。If the current block is at the left boundary of the object to which it belongs, the energy value of the non-zero transform coefficient is calculated according to the inverse transform value of the non-zero transform coefficient on the upper side of the current block.
需要说明的是,针对用于正负号预测的非零系数的筛选,当使用能量计算时,在ECM中对于处于图像边界的当前块,代价只计算了有邻近重建块的一侧,对于超出图像边界一侧的代价实施跳过。对于这样的情况,计算超过图像边界一侧的能量没有意义,也应当跳过。同理,对于其它潜在的筛选方法,应当去除筛选方法中对超过图像边界一侧的计算。It should be noted that, for the screening of non-zero coefficients used for sign prediction, when energy calculation is used, in ECM, for the current block at the image boundary, the cost is only calculated on the side with adjacent reconstruction blocks. The cost on one side of the image boundary implements skipping. For such cases, it is meaningless to calculate the energy beyond the side of the image boundary and should be skipped. Similarly, for other potential screening methods, calculations on the side beyond the image boundary in the screening method should be removed.
示例性地,当前块处于图像上边界时,上侧代价计算跳过,这时候仅利用左侧进行能量计算,该能量计算如上述的式(9)所示。当前块处于图像左边界时,左侧代价计算跳过,这时候仅利用上侧进行能量计算,该能量计算如上述的式(10)所示。Exemplarily, when the current block is at the upper boundary of the image, the upper side cost calculation is skipped, and only the left side is used for energy calculation at this time, and the energy calculation is shown in the above formula (9). When the current block is at the left boundary of the image, the cost calculation on the left side is skipped. At this time, only the upper side is used for energy calculation, and the energy calculation is shown in the above formula (10).
考虑到在ECM后续的实施中,有可能存在对处于编码树单元第一行的当前块的代价计算进行限制,例如,对于这一行的当前块,不再同时计算上侧和左侧总共的代价而是只计算左侧跳过上侧,筛选能量的标准也可以只参考左侧不参考上侧。因此,在编码树单元边界的情况下,能量计算也应该跳过某侧能量,如上述的式(9)和式(10)所示。也就是说,对于使用某一侧代价计算跳过的解决方案时,筛选待预测正负号的变换系数的标准也需做出相应优化,例如,代价的计算只参考某一侧时,能量的计算也只应参考那一侧。Considering that in the subsequent implementation of ECM, there may be restrictions on the cost calculation of the current block in the first row of the coding tree unit, for example, for the current block of this row, the total cost of the upper side and the left side is no longer calculated at the same time Instead, only the left side is calculated and the upper side is skipped, and the energy screening standard can only refer to the left side instead of the upper side. Therefore, in the case of coding tree unit boundaries, the energy calculation should also skip the energy of a certain side, as shown in the above formulas (9) and (10). That is to say, when using a certain side cost calculation to skip the solution, the criteria for screening the transformation coefficients of the sign to be predicted also need to be optimized accordingly. For example, when the cost calculation only refers to a certain side, the energy Calculations should also refer to that side only.
这样,以将上述优化应用于图像边界的当前块能量计算为例,与优化之前的能量计算方案相比, 在全帧内编码配置进行测试,编解码性能变化如图14所示。由此可以得到,此优化在对图像边界的能量计算进行简化的同时,还能够提供0.01%的编码性能增益。In this way, taking the above optimization applied to the current block energy calculation of the image boundary as an example, compared with the energy calculation scheme before optimization, the test is carried out in the full intra-frame coding configuration, and the codec performance changes are shown in Figure 14. It can be obtained from this that this optimization can provide a coding performance gain of 0.01% while simplifying the energy calculation of the image boundary.
除此之外,在一些实施例中,该方法还可以包括:若当前块处于所属对象的左上角位置,则确定当前块的变换系数不进行符号预测。In addition, in some embodiments, the method may further include: if the current block is at the upper left corner of the object to which it belongs, determining that the transform coefficients of the current block do not perform sign prediction.
也就是说,在ECM的实现中对于图像左上角位置的当前块(如图15所示),由于将左上角位置没有邻近块的当前块参考重建值,将其设置为默认值是不合理的,那么本申请实施例可以直接跳过对这个块进行变换系数的正负号预测。与设置默认值的方案相比,在全帧内编码配置进行测试,编解码性能变化如图16所示。由此可以得到,如果跳过左上方没有邻近参考块的变换块,那么也能够提供一定的编码性能增益。That is to say, in the implementation of ECM, for the current block at the upper left corner of the image (as shown in Figure 15), it is unreasonable to set it as the default value because the current block at the upper left corner without adjacent blocks refers to the reconstruction value , then in this embodiment of the present application, the sign prediction of the transform coefficient for this block can be directly skipped. Compared with the scheme of setting the default value, the test is carried out in the full intra-frame coding configuration, and the codec performance changes are shown in Figure 16. It can be obtained from this that if the transform block with no adjacent reference block on the upper left is skipped, a certain coding performance gain can also be provided.
进一步地,在一些实施例中,在确定出最后一个系数组的符号预测值之后,如图20所示,该方法还可以包括:Further, in some embodiments, after the sign prediction value of the last coefficient group is determined, as shown in FIG. 20 , the method may further include:
S2001:根据最后一个系数组的符号预测值,确定最后一个系数组的符号残差值。S2001: Determine the sign residual value of the last coefficient group according to the sign prediction value of the last coefficient group.
S2002:对符号残差值进行编码,将所得到的编码比特写入码流。S2002: Encode the symbol residual value, and write the obtained encoded bits into the code stream.
需要说明的是,在一些实施例中,所述根据最后一个系数组的符号预测值,确定最后一个系数组的符号残差值,可以包括:It should be noted that, in some embodiments, the determining the sign residual value of the last coefficient group according to the sign prediction value of the last coefficient group may include:
根据当前块的变换系数,确定最后一个系数组的符号原始值;Determine the signed original value of the last coefficient group according to the transform coefficients of the current block;
根据最后一个系数组的符号原始值和最后一个系数组的符号预测值,确定最后一个系数组的符号残差值。A signed residual value of the last coefficient group is determined based on the signed original value of the last coefficient group and the signed predicted value of the last coefficient group.
在一种具体的实施例中,所述根据最后一个系数组的符号原始值和最后一个系数组的符号预测值,确定最后一个系数组的符号残差值,可以包括:对最后一个系数组的符号原始值和最后一个系数组的符号预测值进行异或运算,确定最后一个系数组的符号残差值。In a specific embodiment, the determining the sign residual value of the last coefficient group according to the sign original value of the last coefficient group and the sign predicted value of the last coefficient group may include: The signed original value and the signed predicted value of the last coefficient group are XORed to determine the signed residual value of the last coefficient group.
在另一种具体的实施例中,所述根据最后一个系数组的符号原始值和最后一个系数组的符号预测值,确定最后一个系数组的符号残差值,可以包括:对最后一个系数组的符号原始值和最后一个系数组的符号预测值进行减法运算,确定最后一个系数组的符号残差值。In another specific embodiment, the determining the sign residual value of the last coefficient group according to the sign original value of the last coefficient group and the sign predicted value of the last coefficient group may include: for the last coefficient group Subtract the signed original value of , and the signed predicted value of the last coefficient group to determine the signed residual value of the last coefficient group.
还需要说明的是,在本申请实施例中,对符号残差值进行编码,可以是基于上下文模型进行编码的。It should also be noted that, in the embodiment of the present application, encoding the sign residual value may be based on a context model.
也就是说,在编码器中,首先当前块通过率失真优化选出的当前模式下最优的量化系数的正负值作为符号原始值,然后根据符号原始值与所得到的符号预测值可以确定出正负号的符号残差值,再使用上下文模型编码正负号的符号残差值。That is to say, in the encoder, firstly, the positive and negative values of the optimal quantization coefficient in the current mode selected by the current block through rate-distortion optimization are used as the original value of the sign, and then it can be determined according to the original value of the sign and the obtained predicted value of the sign The signed residual value of the sign is extracted, and then the signed residual value of the sign is encoded using the context model.
简言之,在本申请实施例中,一方面,可以将使用变换系数正负号预测的变换块的使用范围进行拓展,允许更多形状更多大小的块使用此技术,具体的,例如小于4×4的变换块,帧内大于32×32,帧间大于128x128的变换块,都可以使用此技术。另一方面,对于已有变换系数正负号预测的方案,当变换块处于编码树单元上边界时,应对代价计算的方式进行调整,例如对上侧代价计算进行限制,减少跨编码树单元来取重建值的情况,尤其是获取上方编码树单元中的重建值;这里提出了简化的解决方案:直接跳过上侧代价计算或只考虑使用上侧一行。又一方面,对于使用某一侧代价计算跳过的解决方案时,筛选待预测正负号的变换系数的方案也需要做出相应调整,例如代价的计算只参考某一侧时,能量的计算也只应参考那一侧等等。In short, in the embodiment of the present application, on the one hand, the range of use of the transform block predicted using the sign of the transform coefficient can be extended, allowing blocks of more shapes and sizes to use this technology, specifically, for example, less than This technology can be used for 4×4 transformation blocks, transformation blocks larger than 32×32 in a frame, and larger than 128×128 in an interframe. On the other hand, for existing transform coefficient sign prediction schemes, when the transform block is at the upper boundary of the coding tree unit, the cost calculation method should be adjusted, such as limiting the cost calculation on the upper side, and reducing the cost across coding tree units. In the case of taking reconstructed values, especially those in the upper coding tree unit; here a simplified solution is proposed: directly skip the upper side cost calculation or consider only using the upper side row. On the other hand, when using a certain side cost calculation skip solution, the scheme of screening the transformation coefficient of the sign to be predicted also needs to be adjusted accordingly. For example, when the calculation of the cost only refers to a certain side, the calculation of the energy Also only that side should be referenced etc.
本申请实施例还提供了一种编码方法,通过确定当前块的变换系数;按照预设扫描顺序对当前块的变换系数进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。这样,按照预设扫描顺序对当前块的变换系数进行扫描,然后确定出当前块在预设扫描顺序上的最后一个系数组,以便对最后一个系数组进行符号预测,如此不仅能够允许更多形状更多大小的块可以进行符号预测,拓展了符号预测技术的适用范围;而且在符号预测过程中,针对当前块处于图像或者编码树单元的上边界或左边界的情况,还对代价计算的方式进行优化,同时针对筛选待预测正负的变换系数的能量计算方式也进行适应性调整,从而还降低了计算复杂度,提高了正负号的符号预测准确度。The embodiment of the present application also provides an encoding method, by determining the transformation coefficient of the current block; scanning the transformation coefficient of the current block according to the preset scanning order, and determining the last coefficient group of the current block in the preset scanning order; The last coefficient group performs sign prediction, and the sign prediction value of the last coefficient group is determined. In this way, the transform coefficients of the current block are scanned according to the preset scanning order, and then the last coefficient group of the current block in the preset scanning order is determined, so as to perform sign prediction on the last coefficient group, which not only allows more shapes Blocks of more sizes can be used for symbol prediction, which expands the applicable scope of symbol prediction technology; and in the process of symbol prediction, for the case where the current block is at the upper boundary or left boundary of the image or coding tree unit, the cost calculation method is also adjusted. Optimization is carried out, and at the same time, adaptive adjustments are made to the energy calculation method for screening the transform coefficients to be predicted, thereby reducing the computational complexity and improving the sign prediction accuracy of the sign.
本申请的又一实施例中,本申请实施例提供了一种码流,该码流是根据待编码信息进行比特编码生成的;其中,待编码信息可以包括下述至少之一:重建系数绝对值和符号残差值。In yet another embodiment of the present application, the embodiment of the present application provides a code stream, which is generated by performing bit coding according to the information to be encoded; wherein, the information to be encoded may include at least one of the following: reconstruction coefficient absolute value and signed residual value.
这样,在本申请实施例中,编码器可以通过码流将重建系数绝对值和符号残差值传输给解码器,然后在解码器中按照预设扫描顺序对当前块的重建系数绝对值进行扫描,然后确定出当前块在预设扫描顺序上的最后一个系数组,以便对最后一个系数组进行符号预测,如此不仅能够允许更多形状 更多大小的块可以进行符号预测,拓展了符号预测技术的适用范围;而且在符号预测过程中,针对当前块处于图像或者编码树单元的上边界或左边界的情况,还对代价计算的方式进行优化,同时针对筛选待预测正负的变换系数的能量计算方式也进行适应性调整,从而还降低了计算复杂度,提高了正负号的符号预测准确度。In this way, in the embodiment of the present application, the encoder can transmit the absolute value of the reconstruction coefficient and the sign residual value to the decoder through the code stream, and then scan the absolute value of the reconstruction coefficient of the current block in the decoder according to the preset scanning order , and then determine the last coefficient group of the current block in the preset scanning order, so as to perform sign prediction on the last coefficient group, which not only allows more shapes and sizes of blocks to perform sign prediction, but also expands the sign prediction technology Scope of application; and in the sign prediction process, in view of the current block at the upper boundary or left boundary of the image or coding tree unit, the cost calculation method is also optimized, and at the same time, the energy of the positive and negative transform coefficients to be predicted is screened The calculation method is also adjusted adaptively, thereby reducing the calculation complexity and improving the sign prediction accuracy of the positive and negative signs.
本申请的再一实施例中,基于前述实施例相同的发明构思,参见图21,其示出了本申请实施例提供的一种编码器210的组成结构示意图。如图21所示,该编码器210可以包括:第一确定单元2101和第一预测单元2102;其中,In yet another embodiment of the present application, based on the same inventive concept as the foregoing embodiments, refer to FIG. 21 , which shows a schematic structural diagram of an encoder 210 provided in the embodiment of the present application. As shown in Figure 21, the encoder 210 may include: a first determination unit 2101 and a first prediction unit 2102; wherein,
第一确定单元2101,配置为确定当前块的变换系数;The first determining unit 2101 is configured to determine the transform coefficient of the current block;
第一确定单元2101,还配置为按照预设扫描顺序对当前块的变换系数进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;The first determining unit 2101 is further configured to scan the transform coefficients of the current block according to a preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
第一预测单元2102,配置为对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。The first prediction unit 2102 is configured to perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
在一些实施例中,参见图21,编码器210还可以包括编码单元2103;In some embodiments, referring to FIG. 21 , the encoder 210 may further include an encoding unit 2103;
第一确定单元2101,还配置为根据所述最后一个系数组的符号预测值,确定所述最后一个系数组的符号残差值;The first determining unit 2101 is further configured to determine the sign residual value of the last coefficient group according to the sign prediction value of the last coefficient group;
编码单元2103,配置为对所述符号残差值进行编码,将所得到的编码比特写入码流。The encoding unit 2103 is configured to encode the symbol residual value, and write the obtained encoded bits into a code stream.
在一些实施例中,第一确定单元2101,还配置为根据所述当前块的变换系数,确定所述最后一个系数组的符号原始值;以及根据所述最后一个系数组的符号原始值和所述最后一个系数组的符号预测值,确定所述最后一个系数组的符号残差值。In some embodiments, the first determining unit 2101 is further configured to determine the original sign value of the last coefficient group according to the transform coefficient of the current block; and determine the original sign value of the last coefficient group according to the original sign value of the last coefficient group and the The sign prediction value of the last coefficient group is determined, and the sign residual value of the last coefficient group is determined.
在一些实施例中,第一确定单元2101,还配置为对最后一个系数组的符号原始值和最后一个系数组的符号预测值进行异或运算,确定最后一个系数组的符号残差值。In some embodiments, the first determining unit 2101 is further configured to perform an XOR operation on the original sign value of the last coefficient group and the predicted sign value of the last coefficient group to determine the sign residual value of the last coefficient group.
在一些实施例中,若当前块的尺寸为1×N,N为大于或等于16的整数,则确定当前块的变换系数可划分为(N/16)个系数组,且系数组的尺寸为1×16;若当前块的尺寸为N×1,N为大于或等于16的整数,则确定当前块的变换系数可划分为(N/16)个系数组,且系数组的尺寸为16×1;若当前块的尺寸为2×N,N为大于或等于8的整数,则确定当前块的变换系数可划分为(N/8)个系数组,且系数组的尺寸为2×8;若当前块的尺寸为N×2,N为大于或等于8的整数,则确定当前块的变换系数可划分为(N/8)个系数组,且系数组的尺寸为8×2;若当前块的尺寸为M×N,M和N均为大于或等于4的整数,则确定当前块的变换系数可划分为(M×N/16)个系数组,且系数组的尺寸为4×4。In some embodiments, if the size of the current block is 1×N, and N is an integer greater than or equal to 16, it is determined that the transform coefficients of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient groups is 1×16; if the size of the current block is N×1, and N is an integer greater than or equal to 16, it is determined that the transform coefficient of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient group is 16× 1; if the size of the current block is 2×N, and N is an integer greater than or equal to 8, then it is determined that the transform coefficients of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient group is 2×8; If the size of the current block is N×2, and N is an integer greater than or equal to 8, it is determined that the transform coefficients of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient group is 8×2; if the current The size of the block is M×N, and both M and N are integers greater than or equal to 4, then it is determined that the transform coefficients of the current block can be divided into (M×N/16) coefficient groups, and the size of the coefficient group is 4×4 .
在一些实施例中,在当前块的尺寸为M×N,M和N均为大于或等于4的整数情况下,第一确定单元2101,还配置为确定当前块中处于左上角位置的第一区域;以及根据第一区域内的变换系数确定最后一个系数组;其中,最后一个系数组中的变换系数个数为2 L个,L为大于或等于零的个数。 In some embodiments, when the size of the current block is M×N, and both M and N are integers greater than or equal to 4, the first determining unit 2101 is further configured to determine the first region; and determine the last coefficient group according to the transformation coefficients in the first region; wherein, the number of transformation coefficients in the last coefficient group is 2 L , and L is the number greater than or equal to zero.
在一些实施例中,第一预测单元2102,还配置为若当前块处于所属对象的上边界,则根据当前块的左侧边对应的第一相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;以及根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值;其中,第一相邻像素值是由当前块的左侧边相邻两列的参考像素值组成的。In some embodiments, the first prediction unit 2102 is further configured to calculate the last coefficient group in multiple The cost value under the candidate symbol combination; and according to the cost value under the various candidate symbol combinations, determine the symbol prediction value corresponding to the last coefficient group; wherein, the first adjacent pixel value is determined by the two adjacent left sides of the current block Column reference pixel values.
在一些实施例中,第一预测单元2102,还配置为若当前块处于所属对象的左边界,则根据当前块的上侧边对应的第二相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;以及根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值;其中,第二相邻像素值是由当前块的上侧边相邻两行的参考像素值组成的。In some embodiments, the first prediction unit 2102 is further configured to calculate the last coefficient group in multiple The cost value under the combination of candidate symbols; and according to the cost values under various candidate symbol combinations, determine the symbol prediction value corresponding to the last coefficient group; wherein, the second adjacent pixel value is determined by the upper side of the current block. The reference pixel value of the row.
在一些实施例中,第一预测单元2102,还配置为若当前块处于所属对象的上边界,则根据当前块的左侧边对应的第一相邻像素值和当前块的上侧边对应的第二相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;以及根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值;其中,第一相邻像素值是由当前块的左侧边相邻两列的参考像素值组成的,第二相邻像素值是由当前块的上侧边相邻一行的参考像素值组成的。In some embodiments, the first prediction unit 2102 is further configured to: if the current block is at the upper boundary of the object to which it belongs, according to the value of the first adjacent pixel corresponding to the left side of the current block and the value corresponding to the upper side of the current block For the second adjacent pixel value, calculate the cost value of the last coefficient group under multiple candidate symbol combinations; and determine the symbol prediction value corresponding to the last coefficient group according to the cost values under multiple candidate symbol combinations; wherein, the first The adjacent pixel values are composed of reference pixel values in two adjacent columns on the left side of the current block, and the second adjacent pixel value is composed of reference pixel values in a row adjacent to the upper side of the current block.
在一些实施例中,所属对象包括下述至少之一:图像和编码树单元。In some embodiments, the belonging object includes at least one of: a picture and a coding tree unit.
在一些实施例中,第一确定单元2101,还配置为从多种候选符号组合下的代价值中确定最小代价值;以及根据最小代价值对应的候选符号组合,确定最后一个系数组对应的符号预测值。In some embodiments, the first determination unit 2101 is further configured to determine the minimum cost value from the cost values under various candidate symbol combinations; and determine the symbol corresponding to the last coefficient group according to the candidate symbol combination corresponding to the minimum cost value Predictive value.
在一些实施例中,第一预测单元2102,还配置为若最后一个系数组中非零变换系数的个数大于K,则从最后一个系数组中选取K个非零变换系数;其中,K为大于零的整数;以及利用K个非零 变换系数进行符号预测,确定K个非零变换系数的符号预测值。In some embodiments, the first prediction unit 2102 is further configured to select K non-zero transform coefficients from the last coefficient group if the number of non-zero transform coefficients in the last coefficient group is greater than K; where K is an integer greater than zero; and perform sign prediction using K non-zero transform coefficients, and determine sign prediction values of the K non-zero transform coefficients.
在一些实施例中,第一确定单元2101,还配置为利用光栅扫描顺序对最后一个系数组进行扫描,将最先扫描到的K个非零变换系数确定为K个非零变换系数;或者,确定最后一个系数组中非零变换系数的绝对值,从非零变换系数的绝对值中确定最大的K个绝对值,根据K个绝对值确定K个非零变换系数;或者,确定最后一个系数组中非零变换系数的能量值,从非零变换系数的能量值中确定最大的K个能量值,根据K个能量值确定K个非零变换系数。In some embodiments, the first determining unit 2101 is further configured to scan the last coefficient group in a raster scan order, and determine the first scanned K non-zero transform coefficients as K non-zero transform coefficients; or, Determine the absolute values of the non-zero transform coefficients in the last coefficient group, determine the largest K absolute values from the absolute values of the non-zero transform coefficients, determine the K non-zero transform coefficients according to the K absolute values; or, determine the last coefficient The energy values of the non-zero transform coefficients in the group, the largest K energy values are determined from the energy values of the non-zero transform coefficients, and the K non-zero transform coefficients are determined according to the K energy values.
在一些实施例中,第一确定单元2101,还配置为确定最后一个系数组中非零变换系数在当前块的左侧边的反变换值和在当前块的上侧边的反变换值;以及若当前块处于所属对象的上边界,则根据非零变换系数在当前块的左侧边的反变换值,计算非零变换系数的能量值;若当前块处于所属对象的左边界,则根据非零变换系数在当前块的上侧边的反变换值,计算非零变换系数的能量值。In some embodiments, the first determining unit 2101 is further configured to determine the inverse transform value of the non-zero transform coefficients in the last coefficient group on the left side of the current block and the inverse transform value on the upper side of the current block; and If the current block is on the upper boundary of the object to which it belongs, calculate the energy value of the non-zero transform coefficient according to the inverse transform value of the non-zero transform coefficient on the left side of the current block; The inverse transform value of the zero transform coefficient on the upper side of the current block, calculates the energy value of the non-zero transform coefficient.
在一些实施例中,第一确定单元2101,还配置为若当前块处于所属对象的左上角位置,则确定当前块的变换系数不进行符号预测。In some embodiments, the first determining unit 2101 is further configured to determine that the transform coefficients of the current block do not perform sign prediction if the current block is at the upper left corner of the object to which it belongs.
可以理解地,在本申请实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It can be understood that in the embodiments of the present application, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course it may also be a module, or it may be non-modular. Moreover, each component in this embodiment may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software function modules.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or It is said that the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes several instructions to make a computer device (which can It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other various media that can store program codes.
因此,本申请实施例提供了一种计算机存储介质,应用于编码器210,该计算机存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现前述实施例中任一项所述的方法。Therefore, an embodiment of the present application provides a computer storage medium, which is applied to the encoder 210, and the computer storage medium stores a computer program, and when the computer program is executed by the first processor, it implements any one of the preceding embodiments. Methods.
基于上述编码器210的组成以及计算机存储介质,参见图22,其示出了本申请实施例提供的编码器210的具体硬件结构示意图。如图22所示,编码器210可以包括:第一通信接口2201、第一存储器2202和第一处理器2203;各个组件通过第一总线系统2204耦合在一起。可理解,第一总线系统2204用于实现这些组件之间的连接通信。第一总线系统2204除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图22中将各种总线都标为第一总线系统2204。其中,Based on the above composition of the encoder 210 and the computer storage medium, refer to FIG. 22 , which shows a schematic diagram of a specific hardware structure of the encoder 210 provided by the embodiment of the present application. As shown in FIG. 22 , the encoder 210 may include: a first communication interface 2201 , a first memory 2202 and a first processor 2203 ; each component is coupled together through a first bus system 2204 . It can be understood that the first bus system 2204 is used to realize connection and communication between these components. In addition to the data bus, the first bus system 2204 also includes a power bus, a control bus and a status signal bus. However, for clarity of illustration, the various buses are labeled as first bus system 2204 in FIG. 22 . in,
第一通信接口2201,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;The first communication interface 2201 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
第一存储器2202,用于存储能够在第一处理器2203上运行的计算机程序;The first memory 2202 is used to store computer programs that can run on the first processor 2203;
第一处理器2203,用于在运行所述计算机程序时,执行:The first processor 2203 is configured to, when running the computer program, execute:
确定当前块的变换系数;determining transform coefficients for the current block;
按照预设扫描顺序对所述当前块的变换系数进行扫描,确定所述当前块在所述预设扫描顺序上的最后一个系数组;Scan the transform coefficients of the current block according to a preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值。Sign prediction is performed on the last coefficient group, and a sign prediction value of the last coefficient group is determined.
可以理解,本申请实施例中的第一存储器2202可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的系统和方法的第一存储器2202旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the first memory 2202 in the embodiment of the present application may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electronically programmable Erase Programmable Read-Only Memory (Electrically EPROM, EEPROM) or Flash. The volatile memory can be Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (Static RAM, SRAM), Dynamic Random Access Memory (Dynamic RAM, DRAM), Synchronous Dynamic Random Access Memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (Synchlink DRAM, SLDRAM) And Direct Memory Bus Random Access Memory (Direct Rambus RAM, DRRAM). The first memory 2202 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
而第一处理器2203可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过第一处理器2203中的硬件的集成逻辑电路或者软件形式的指令完成。上述的第一 处理器2203可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于第一存储器2202,第一处理器2203读取第一存储器2202中的信息,结合其硬件完成上述方法的步骤。The first processor 2203 may be an integrated circuit chip, which has a signal processing capability. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the first processor 2203 or instructions in the form of software. The above-mentioned first processor 2203 may be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a ready-made programmable gate array (Field Programmable Gate Array, FPGA) Or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Various methods, steps, and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can be located in a mature storage medium in the field such as random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, register. The storage medium is located in the first memory 2202, and the first processor 2203 reads the information in the first memory 2202, and completes the steps of the above method in combination with its hardware.
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。It should be understood that the embodiments described in this application may be implemented by hardware, software, firmware, middleware, microcode or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing device (DSP Device, DSPD), programmable Logic device (Programmable Logic Device, PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other devices used to perform the functions described in this application electronic unit or its combination. For software implementation, the techniques described herein can be implemented through modules (eg, procedures, functions, and so on) that perform the functions described herein. Software codes can be stored in memory and executed by a processor. Memory can be implemented within the processor or external to the processor.
可选地,作为另一个实施例,第一处理器2203还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。Optionally, as another embodiment, the first processor 2203 is further configured to execute the method described in any one of the foregoing embodiments when running the computer program.
本实施例提供了一种编码器,该编码器可以包括第一确定单元和第一预测单元。这样,按照预设扫描顺序对当前块的变换系数进行扫描,确定出当前块在预设扫描顺序上的最后一个系数组,以便对最后一个系数组进行符号预测,如此不仅能够允许更多形状更多大小的块可以进行符号预测,拓展了符号预测技术的适用范围;而且在符号预测过程中,针对当前块处于图像或者编码树单元的上边界或左边界的情况,还对代价计算的方式进行优化,同时针对筛选待预测正负的变换系数的能量计算方式也进行适应性调整,从而还降低了计算复杂度,提高了正负号的符号预测准确度。This embodiment provides an encoder, and the encoder may include a first determination unit and a first prediction unit. In this way, the transform coefficients of the current block are scanned according to the preset scanning order, and the last coefficient group of the current block in the preset scanning order is determined, so as to perform sign prediction on the last coefficient group, which not only allows more shapes and more Multi-size blocks can be used for sign prediction, which expands the scope of application of sign prediction technology; and in the process of sign prediction, for the case where the current block is at the upper boundary or left boundary of the image or coding tree unit, the cost calculation method is also adjusted. Optimization, and at the same time, adaptive adjustments are made to the energy calculation method for screening the transform coefficients to be predicted, which also reduces the computational complexity and improves the sign prediction accuracy of the sign.
本申请的再一实施例中,基于前述实施例相同的发明构思,参见图23,其示出了本申请实施例提供的一种解码器230的组成结构示意图。如图23所示,该解码器230可以包括:解码单元2301、第二确定单元2302和第二预测单元2303;其中,In yet another embodiment of the present application, based on the same inventive concept as the preceding embodiments, refer to FIG. 23 , which shows a schematic diagram of the composition and structure of a decoder 230 provided in the embodiment of the present application. As shown in FIG. 23, the decoder 230 may include: a decoding unit 2301, a second determination unit 2302, and a second prediction unit 2303; wherein,
解码单元2301,配置为解析码流,确定当前块的重建系数绝对值;The decoding unit 2301 is configured to analyze the code stream and determine the absolute value of the reconstruction coefficient of the current block;
第二确定单元2302,配置为按照预设扫描顺序对当前块的重建系数绝对值进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;The second determining unit 2302 is configured to scan the absolute value of the reconstruction coefficient of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
第二预测单元2303,配置为对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。The second prediction unit 2303 is configured to perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
在一些实施例中,解码单元2301,还配置为解析码流,确定最后一个系数组的符号残差值;以及根据最后一个系数组的符号预测值和最后一个系数组的符号残差值,确定最后一个系数组的符号原始值;以及根据最后一个系数组的符号原始值,确定当前块的重建系数。In some embodiments, the decoding unit 2301 is further configured to analyze the code stream, determine the sign residual value of the last coefficient group; and determine according to the sign prediction value of the last coefficient group and the sign residual value of the last coefficient group The signed original value of the last coefficient group; and determining the reconstruction coefficient of the current block according to the signed original value of the last coefficient group.
在一些实施例中,第二确定单元2302,还配置为对根据最后一个系数组的符号预测值和最后一个系数组的符号残差值进行异或运算,确定最后一个系数组的符号原始值。In some embodiments, the second determining unit 2302 is further configured to perform an XOR operation on the predicted sign value of the last coefficient group and the sign residual value of the last coefficient group to determine the original sign value of the last coefficient group.
在一些实施例中,第二确定单元2302,还配置为若当前块的尺寸为1×N,N为大于或等于16的整数,则确定当前块的重建系数绝对值可划分为(N/16)个系数组,且系数组的尺寸为1×16;若当前块的尺寸为N×1,N为大于或等于16的整数,则确定当前块的重建系数绝对值可划分为(N/16)个系数组,且系数组的尺寸为16×1;若当前块的尺寸为2×N,N为大于或等于8的整数,则确定当前块的重建系数绝对值可划分为(N/8)个系数组,且系数组的尺寸为2×8;若当前块的尺寸为N×2,N为大于或等于8的整数,则确定当前块的重建系数绝对值可划分为(N/8)个系数组,且系数组的尺寸为8×2;若当前块的尺寸为M×N,M和N均为大于或等于4的整数,则确定当前块的重建系数绝对值可划分为(M×N/16)个系数组,且系数组的尺寸为4×4。In some embodiments, the second determining unit 2302 is further configured to determine that the absolute value of the reconstruction coefficient of the current block can be divided into (N/16 ) coefficient groups, and the size of the coefficient group is 1×16; if the size of the current block is N×1, and N is an integer greater than or equal to 16, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/16 ) coefficient groups, and the size of the coefficient group is 16×1; if the size of the current block is 2×N, and N is an integer greater than or equal to 8, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/8 ) coefficient groups, and the size of the coefficient group is 2×8; if the size of the current block is N×2, and N is an integer greater than or equal to 8, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/8 ) coefficient groups, and the size of the coefficient group is 8×2; if the size of the current block is M×N, and both M and N are integers greater than or equal to 4, it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into ( M×N/16) coefficient groups, and the size of the coefficient group is 4×4.
在一些实施例中,在当前块的尺寸为M×N,M和N均为大于或等于4的整数情况下,第二确定单元2302,还配置为确定当前块中处于左上角位置的第一区域;以及根据第一区域内的重建系数绝对值确定最后一个系数组;其中,最后一个系数组中的重建系数绝对值个数为2 L个,且L为大于或等于零的数。 In some embodiments, when the size of the current block is M×N, and both M and N are integers greater than or equal to 4, the second determining unit 2302 is further configured to determine the first area; and determine the last coefficient group according to the absolute value of the reconstruction coefficient in the first area; wherein, the number of absolute values of the reconstruction coefficient in the last coefficient group is 2 L , and L is a number greater than or equal to zero.
在一些实施例中,第二预测单元2303,还配置为若当前块处于所属对象的上边界,则根据当前块的左侧边对应的第一相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;以及根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值;其中,第一相邻像素值是由当前块的左侧边相邻两列的参考像素值组成的。In some embodiments, the second prediction unit 2303 is further configured to calculate the last coefficient group in multiple The cost value under the candidate symbol combination; and according to the cost value under the various candidate symbol combinations, determine the symbol prediction value corresponding to the last coefficient group; wherein, the first adjacent pixel value is determined by the two adjacent left sides of the current block Column reference pixel values.
在一些实施例中,第二预测单元2303,还配置为若当前块处于所属对象的左边界,则根据当前块的上侧边对应的第二相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;以及根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值;其中,第二相邻像素值是由当前块的上侧边相邻两行的参考像素值组成的。In some embodiments, the second prediction unit 2303 is further configured to calculate the last coefficient group in multiple The cost value under the combination of candidate symbols; and according to the cost values under various candidate symbol combinations, determine the symbol prediction value corresponding to the last coefficient group; wherein, the second adjacent pixel value is determined by the upper side of the current block. The reference pixel value of the row.
在一些实施例中,第二预测单元2303,还配置为若当前块处于所属对象的上边界,则根据当前块的左侧边对应的第一相邻像素值和当前块的上侧边对应的第二相邻像素值,计算最后一个系数组在多种候选符号组合下的代价值;以及根据多种候选符号组合下的代价值,确定最后一个系数组对应的符号预测值;其中,第一相邻像素值是由当前块的左侧边相邻两列的参考像素值组成的,第二相邻像素值是由当前块的上侧边相邻一行的参考像素值组成的。In some embodiments, the second prediction unit 2303 is further configured to: if the current block is at the upper boundary of the object to which it belongs, according to the value of the first adjacent pixel corresponding to the left side of the current block and the value corresponding to the upper side of the current block For the second adjacent pixel value, calculate the cost value of the last coefficient group under multiple candidate symbol combinations; and determine the symbol prediction value corresponding to the last coefficient group according to the cost values under multiple candidate symbol combinations; wherein, the first The adjacent pixel values are composed of reference pixel values in two adjacent columns on the left side of the current block, and the second adjacent pixel value is composed of reference pixel values in a row adjacent to the upper side of the current block.
在一些实施例中,所属对象包括下述至少之一:图像和编码树单元。In some embodiments, the belonging object includes at least one of: a picture and a coding tree unit.
在一些实施例中,第二确定单元2302,还配置为从多种候选符号组合下的代价值中确定最小代价值;以及根据最小代价值对应的候选符号组合,确定最后一个系数组对应的符号预测值。In some embodiments, the second determination unit 2302 is further configured to determine the minimum cost value from the cost values under various candidate symbol combinations; and determine the symbol corresponding to the last coefficient group according to the candidate symbol combination corresponding to the minimum cost value Predictive value.
在一些实施例中,第二预测单元2303,还配置为若最后一个系数组中非零重建系数绝对值的个数大于K,则从最后一个系数组中选取K个非零重建系数绝对值;其中,K为大于零的整数;以及利用K个非零重建系数绝对值进行符号预测,确定K个非零重建系数绝对值的符号预测值。In some embodiments, the second prediction unit 2303 is further configured to select K absolute values of non-zero reconstruction coefficients from the last coefficient group if the number of absolute values of non-zero reconstruction coefficients in the last coefficient group is greater than K; Wherein, K is an integer greater than zero; and performing sign prediction by using the absolute values of the K non-zero reconstruction coefficients, and determining the sign prediction values of the K absolute values of the non-zero reconstruction coefficients.
在一些实施例中,第二确定单元2302,还配置为利用光栅扫描顺序对最后一个系数组进行扫描,将最先扫描到的K个非零重建系数绝对值确定为K个非零重建系数绝对值;或者,确定最后一个系数组中非零重建系数的绝对值;从非零重建系数的绝对值中确定最大的K个绝对值,根据K个绝对值确定K个非零重建系数绝对值;或者,确定最后一个系数组中非零重建系数的能量值,从非零重建系数的能量值中确定最大的K个能量值,根据K个能量值确定K个非零重建系数绝对值。In some embodiments, the second determining unit 2302 is further configured to scan the last coefficient group in raster scan order, and determine the first scanned absolute values of the K non-zero reconstruction coefficients as the K non-zero reconstruction coefficient absolute values value; or, determine the absolute value of the non-zero reconstruction coefficient in the last coefficient group; determine the largest K absolute values from the absolute values of the non-zero reconstruction coefficients, and determine the K absolute values of the non-zero reconstruction coefficients according to the K absolute values; Or, determine the energy values of the non-zero reconstruction coefficients in the last coefficient group, determine the largest K energy values from the energy values of the non-zero reconstruction coefficients, and determine the K absolute values of the non-zero reconstruction coefficients according to the K energy values.
在一些实施例中,第二确定单元2302,还配置为确定最后一个系数组中非零重建系数在当前块的左侧边的反变换值和在当前块的上侧边的反变换值;以及若当前块处于所属对象的上边界,则根据非零重建系数在当前块的左侧边的反变换值,计算非零重建系数的能量值;若当前块处于所属对象的左边界,则根据非零重建系数在当前块的上侧边的反变换值,计算非零重建系数的能量值。In some embodiments, the second determining unit 2302 is further configured to determine the inverse transform value of the non-zero reconstruction coefficients in the last coefficient group on the left side of the current block and the inverse transform value on the upper side of the current block; and If the current block is at the upper boundary of the object, calculate the energy value of the non-zero reconstruction coefficient according to the inverse transformation value of the non-zero reconstruction coefficient on the left side of the current block; if the current block is at the left boundary of the object, calculate the energy value of the non-zero reconstruction coefficient according to the non-zero reconstruction coefficient The inverse transform value of the zero reconstruction coefficient on the upper side of the current block, calculates the energy value of the non-zero reconstruction coefficient.
在一些实施例中,第二确定单元2302,还配置为若当前块处于所属对象的左上角位置,则确定当前块的重建系数绝对值不进行符号预测。In some embodiments, the second determination unit 2302 is further configured to determine the absolute value of the reconstruction coefficient of the current block without performing sign prediction if the current block is at the upper left corner of the object to which it belongs.
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。It can be understood that, in this embodiment, a "unit" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course it may also be a module, or it may be non-modular. Moreover, each component in this embodiment may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software function modules.
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本实施例提供了一种计算机存储介质,应用于解码器230,该计算机存储介质存储有计算机程序,所述计算机程序被第二处理器执行时实现前述实施例中任一项所述的方法。If the integrated units are implemented in the form of software function modules and are not sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer storage medium, which is applied to the decoder 230, and the computer storage medium stores a computer program, and when the computer program is executed by the second processor, any one of the preceding embodiments is implemented. the method described.
基于上述解码器230的组成以及计算机存储介质,参见图24,其示出了本申请实施例提供的解码器230的具体硬件结构示意图。如图24所示,解码器230可以包括:第二通信接口2401、第二存储器2402和第二处理器2403;各个组件通过第二总线系统2404耦合在一起。可理解,第二总线系统2404用于实现这些组件之间的连接通信。第二总线系统2404除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图24中将各种总线都标为第二总线系统2404。其中,Based on the above composition of the decoder 230 and the computer storage medium, refer to FIG. 24 , which shows a schematic diagram of a specific hardware structure of the decoder 230 provided by the embodiment of the present application. As shown in FIG. 24 , the decoder 230 may include: a second communication interface 2401 , a second memory 2402 and a second processor 2403 ; each component is coupled together through a second bus system 2404 . It can be understood that the second bus system 2404 is used to realize connection and communication between these components. In addition to the data bus, the second bus system 2404 also includes a power bus, a control bus and a status signal bus. However, for clarity of illustration, the various buses are labeled as the second bus system 2404 in FIG. 24 . in,
第二通信接口2401,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;The second communication interface 2401 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
第二存储器2402,用于存储能够在第二处理器2403上运行的计算机程序;The second memory 2402 is used to store computer programs that can run on the second processor 2403;
第二处理器2403,用于在运行所述计算机程序时,执行:The second processor 2403 is configured to, when running the computer program, execute:
解析码流,确定当前块的重建系数绝对值;Analyze the code stream to determine the absolute value of the reconstruction coefficient of the current block;
按照预设扫描顺序对当前块的重建系数绝对值进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;Scan the absolute value of the reconstruction coefficient of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。Make a sign prediction for the last coefficient group, and determine the sign prediction value for the last coefficient group.
可选地,作为另一个实施例,第二处理器2403还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。Optionally, as another embodiment, the second processor 2403 is further configured to execute the method described in any one of the foregoing embodiments when running the computer program.
可以理解,第二存储器2402与第一存储器2202的硬件功能类似,第二处理器2403与第一处理器2203的硬件功能类似;这里不再详述。It can be understood that the hardware function of the second memory 2402 is similar to that of the first memory 2202, and the hardware function of the second processor 2403 is similar to that of the first processor 2203; details will not be described here.
本实施例提供了一种解码器,该解码器可以包括解码单元、第二确定单元和第二预测单元。这样,按照预设扫描顺序对当前块的变换系数进行扫描,确定出当前块在预设扫描顺序上的最后一个系数组,以便对最后一个系数组进行符号预测,如此不仅能够允许更多形状更多大小的块可以进行符号预测,拓展了符号预测技术的适用范围;而且在符号预测过程中,针对当前块处于图像或者编码树单元的上边界或左边界的情况,还对代价计算的方式进行优化,同时针对筛选待预测正负的变换系数的能量计算方式也进行适应性调整,从而还降低了计算复杂度,提高了正负号的符号预测准确度。This embodiment provides a decoder, which may include a decoding unit, a second determining unit, and a second predicting unit. In this way, the transform coefficients of the current block are scanned according to the preset scanning order, and the last coefficient group of the current block in the preset scanning order is determined, so as to perform sign prediction on the last coefficient group, which not only allows more shapes and more Multi-size blocks can be used for sign prediction, which expands the scope of application of sign prediction technology; and in the process of sign prediction, for the case where the current block is at the upper boundary or left boundary of the image or coding tree unit, the cost calculation method is also adjusted. Optimization, and at the same time, adaptive adjustments are made to the energy calculation method for screening the transform coefficients to be predicted, which also reduces the computational complexity and improves the sign prediction accuracy of the sign.
在本申请的再一实施例中,参见图25,其示出了本申请实施例提供的一种编解码系统的组成结构示意图。如图25所示,编解码系统250可以包括编码设备2501和解码设备2502。其中,编码设备2501可以为前述实施例中任一项所述的编码器,解码设备2502可以为前述实施例中任一项所述的解码器。In yet another embodiment of the present application, refer to FIG. 25 , which shows a schematic diagram of the composition and structure of a codec system provided by the embodiment of the present application. As shown in FIG. 25 , the codec system 250 may include an encoding device 2501 and a decoding device 2502 . Wherein, the encoding device 2501 may be the encoder described in any one of the foregoing embodiments, and the decoding device 2502 may be the decoder described in any one of the foregoing embodiments.
在本申请实施例中,该编解码系统250可以按照预设扫描顺序对当前块的变换系数进行扫描,然后确定出当前块在预设扫描顺序上的最后一个系数组,以便对最后一个系数组进行符号预测,如此不仅能够允许更多形状更多大小的块可以进行符号预测,拓展了符号预测技术的适用范围;而且在符号预测过程中,针对当前块处于图像或者编码树单元的上边界或左边界的情况,还对代价计算的方式进行优化,同时针对筛选待预测正负的变换系数的能量计算方式也进行适应性调整,从而还降低了计算复杂度,提高了正负号的符号预测准确度。In the embodiment of the present application, the codec system 250 can scan the transform coefficients of the current block according to the preset scanning order, and then determine the last coefficient group of the current block in the preset scanning order, so that the last coefficient group Perform sign prediction, which not only allows blocks of more shapes and sizes to perform sign prediction, expanding the scope of application of sign prediction technology; but also in the process of sign prediction, for the current block at the upper boundary of the image or coding tree unit or In the case of the left boundary, the cost calculation method is also optimized, and the energy calculation method for screening the transform coefficients to be predicted is also adaptively adjusted, thereby reducing the computational complexity and improving the sign prediction of the sign Accuracy.
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that in this application, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements , but also includes other elements not expressly listed, or also includes elements inherent in such a process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in several method embodiments provided in this application can be combined arbitrarily to obtain new method embodiments under the condition of no conflict.
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。The features disclosed in several product embodiments provided in this application can be combined arbitrarily without conflict to obtain new product embodiments.
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。The features disclosed in several method or device embodiments provided in this application can be combined arbitrarily without conflict to obtain new method embodiments or device embodiments.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above is only a specific implementation of the application, but the scope of protection of the application is not limited thereto. Anyone familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the application. Should be covered within the protection scope of this application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.
工业实用性Industrial Applicability
本申请实施例中,在编码端,确定当前块的变换系数;按照预设扫描顺序对当前块的变换系数进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。在解码端,解析码流,确定当前块的重建系数绝对值;按照预设扫描顺序对当前块的重建系数绝对值进行扫描,确定当前块在预设扫描顺序上的最后一个系数组;对最后一个系数组进行符号预测,确定最后一个系数组的符号预测值。这样,无论是编码端还是解码端,都可以按照预设扫描顺序对当前块的变换系数进行扫描,然后确定出当前块在预设扫描顺序上的最后一个系数组,以便对最后一个系数组进行符号预测,如此不仅能够允许更多形状更多大小的块可以进行符号预测,拓展了符号预测技术的适用范围;而且在符号预测过程中,针对当前块处于图像或者编码树单元的上边界或左边界的情况,还对代价计算的方式进行优化,同时针对筛选待预测正负的变换系数的能量计算方式也进行适应性调整,从而还降低了计算复杂度,提高了正负号的符号预测准确度。In the embodiment of the present application, at the coding end, the transformation coefficient of the current block is determined; the transformation coefficient of the current block is scanned according to the preset scanning order, and the last coefficient group of the current block in the preset scanning order is determined; for the last coefficient sign prediction for the last coefficient group, determining the sign prediction value for the last coefficient group. At the decoding end, analyze the code stream to determine the absolute value of the reconstruction coefficient of the current block; scan the absolute value of the reconstruction coefficient of the current block according to the preset scanning order, and determine the last coefficient group of the current block in the preset scanning order; Sign prediction is performed for one coefficient group, and the sign prediction value for the last coefficient group is determined. In this way, both the encoding end and the decoding end can scan the transform coefficients of the current block according to the preset scanning order, and then determine the last coefficient group of the current block in the preset scanning order, so as to perform Sign prediction, which not only allows blocks of more shapes and sizes to perform sign prediction, but also expands the scope of application of sign prediction technology; and in the process of sign prediction, for the current block at the upper boundary or left of the image or coding tree unit For boundary conditions, the cost calculation method is also optimized, and at the same time, the energy calculation method for screening the transform coefficients to be predicted is also adaptively adjusted, thereby reducing the computational complexity and improving the accuracy of sign prediction Spend.

Claims (35)

  1. 一种解码方法,应用于解码器,所述方法包括:A decoding method applied to a decoder, the method comprising:
    解析码流,确定当前块的重建系数绝对值;Analyze the code stream to determine the absolute value of the reconstruction coefficient of the current block;
    按照预设扫描顺序对所述当前块的重建系数绝对值进行扫描,确定所述当前块在所述预设扫描顺序上的最后一个系数组;Scan the absolute value of the reconstruction coefficient of the current block according to a preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
    对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值。Sign prediction is performed on the last coefficient group, and a sign prediction value of the last coefficient group is determined.
  2. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    解析码流,确定所述最后一个系数组的符号残差值;Parsing the code stream to determine the sign residual value of the last coefficient group;
    根据所述最后一个系数组的符号预测值和所述最后一个系数组的符号残差值,确定所述最后一个系数组的符号原始值;determining an original sign value of the last coefficient group based on the sign prediction value of the last coefficient group and the sign residual value of the last coefficient group;
    根据所述最后一个系数组的符号原始值,确定所述当前块的重建系数。Determining the reconstruction coefficients of the current block according to the signed original value of the last coefficient group.
  3. 根据权利要求2所述的方法,其中,所述根据所述最后一个系数组的符号预测值和所述最后一个系数组的符号残差值,确定所述最后一个系数组的符号原始值,包括:The method according to claim 2, wherein said determining the original sign value of the last coefficient group according to the sign prediction value of the last coefficient group and the sign residual value of the last coefficient group comprises :
    对根据所述最后一个系数组的符号预测值和所述最后一个系数组的符号残差值进行异或运算,确定所述最后一个系数组的符号原始值。Exclusive OR operation is performed on the predicted value according to the sign of the last coefficient group and the sign residual value of the last coefficient group to determine the original sign value of the last coefficient group.
  4. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    若所述当前块的尺寸为1×N,N为大于或等于16的整数,则确定所述当前块的重建系数绝对值可划分为(N/16)个系数组,且所述系数组的尺寸为1×16;If the size of the current block is 1×N, and N is an integer greater than or equal to 16, it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/16) coefficient groups, and the coefficient groups of the Dimensions are 1×16;
    若所述当前块的尺寸为N×1,N为大于或等于16的整数,则确定所述当前块的重建系数绝对值可划分为(N/16)个系数组,且所述系数组的尺寸为16×1;If the size of the current block is N×1, and N is an integer greater than or equal to 16, it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/16) coefficient groups, and the coefficient groups of the Dimensions are 16×1;
    若所述当前块的尺寸为2×N,N为大于或等于8的整数,则确定所述当前块的重建系数绝对值可划分为(N/8)个系数组,且所述系数组的尺寸为2×8;If the size of the current block is 2×N, and N is an integer greater than or equal to 8, it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/8) coefficient groups, and the coefficient groups of the Dimensions are 2×8;
    若所述当前块的尺寸为N×2,N为大于或等于8的整数,则确定所述当前块的重建系数绝对值可划分为(N/8)个系数组,且所述系数组的尺寸为8×2;If the size of the current block is N×2, and N is an integer greater than or equal to 8, it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (N/8) coefficient groups, and the coefficient groups of the Dimensions are 8×2;
    若所述当前块的尺寸为M×N,M和N均为大于或等于4的整数,则确定所述当前块的重建系数绝对值可划分为(M×N/16)个系数组,且所述系数组的尺寸为4×4。If the size of the current block is M×N, and both M and N are integers greater than or equal to 4, then it is determined that the absolute value of the reconstruction coefficient of the current block can be divided into (M×N/16) coefficient groups, and The size of the coefficient group is 4x4.
  5. 根据权利要求4所述的方法,其中,在所述当前块的尺寸为M×N,M和N均为大于或等于4的整数情况下,所述方法还包括:The method according to claim 4, wherein, when the size of the current block is M×N, and both M and N are integers greater than or equal to 4, the method further comprises:
    确定所述当前块中处于左上角位置的第一区域;determining the first area in the upper left corner of the current block;
    根据所述第一区域内的重建系数绝对值确定所述最后一个系数组;其中,所述最后一个系数组中的重建系数绝对值个数为2L个,且L为大于或等于零的数。The last coefficient group is determined according to the absolute values of reconstruction coefficients in the first area; wherein, the number of absolute values of reconstruction coefficients in the last coefficient group is 2L, and L is a number greater than or equal to zero.
  6. 根据权利要求1所述的方法,其中,所述对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值,包括:The method according to claim 1, wherein said performing sign prediction on said last coefficient group and determining a sign prediction value of said last coefficient group comprises:
    若所述当前块处于所属对象的上边界,则根据所述当前块的左侧边对应的第一相邻像素值,计算所述最后一个系数组在多种候选符号组合下的代价值;If the current block is at the upper boundary of the object to which it belongs, calculating the cost value of the last coefficient group under various candidate symbol combinations according to the first adjacent pixel value corresponding to the left side of the current block;
    根据所述多种候选符号组合下的代价值,确定所述最后一个系数组对应的符号预测值;determining a symbol prediction value corresponding to the last coefficient group according to the cost values under the various candidate symbol combinations;
    其中,所述第一相邻像素值是由所述当前块的左侧边相邻两列的参考像素值组成的。Wherein, the first adjacent pixel value is composed of reference pixel values of two adjacent columns on the left side of the current block.
  7. 根据权利要求1所述的方法,其中,所述对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值,包括:The method according to claim 1, wherein said performing sign prediction on said last coefficient group and determining a sign prediction value of said last coefficient group comprises:
    若所述当前块处于所属对象的左边界,则根据所述当前块的上侧边对应的第二相邻像素值,计算所述最后一个系数组在多种候选符号组合下的代价值;If the current block is at the left boundary of the object to which it belongs, calculating the cost value of the last coefficient group under various candidate symbol combinations according to the second adjacent pixel value corresponding to the upper side of the current block;
    根据所述多种候选符号组合下的代价值,确定所述最后一个系数组对应的符号预测值;determining a symbol prediction value corresponding to the last coefficient group according to the cost values under the various candidate symbol combinations;
    其中,所述第二相邻像素值是由所述当前块的上侧边相邻两行的参考像素值组成的。Wherein, the second adjacent pixel values are composed of reference pixel values of two adjacent rows on the upper side of the current block.
  8. 根据权利要求1所述的方法,其中,所述对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值,包括:The method according to claim 1, wherein said performing sign prediction on said last coefficient group and determining a sign prediction value of said last coefficient group comprises:
    若所述当前块处于所属对象的上边界,则根据所述当前块的左侧边对应的第一相邻像素值和所述当前块的上侧边对应的第二相邻像素值,计算所述最后一个系数组在多种候选符号组合下的代价值;If the current block is at the upper boundary of the object to which it belongs, the calculated value is calculated according to the first adjacent pixel value corresponding to the left side of the current block and the second adjacent pixel value corresponding to the upper side of the current block. Describe the cost value of the last coefficient group under various candidate symbol combinations;
    根据所述多种候选符号组合下的代价值,确定所述最后一个系数组对应的符号预测值;determining a symbol prediction value corresponding to the last coefficient group according to the cost values under the various candidate symbol combinations;
    其中,所述第一相邻像素值是由所述当前块的左侧边相邻两列的参考像素值组成的,所述第二相邻像素值是由所述当前块的上侧边相邻一行的参考像素值组成的。Wherein, the first adjacent pixel value is composed of the reference pixel values of the two columns adjacent to the left side of the current block, and the second adjacent pixel value is composed of the upper side of the current block. It is composed of the reference pixel values of the adjacent row.
  9. 根据权利要求6至8任一项所述的方法,其中,所述所属对象包括下述至少之一:图像和编码树单元。The method according to any one of claims 6 to 8, wherein the belonging object includes at least one of the following: a picture and a coding tree unit.
  10. 根据权利要求6至8任一项所述的方法,其中,所述根据所述多种候选符号组合下的代价值,确定所述最后一个系数组对应的符号预测值,包括:The method according to any one of claims 6 to 8, wherein, according to the cost values under the various candidate symbol combinations, determining the symbol prediction value corresponding to the last coefficient group includes:
    从所述多种候选符号组合下的代价值中确定最小代价值;determining a minimum cost value from the cost values under the plurality of candidate symbol combinations;
    根据所述最小代价值对应的候选符号组合,确定所述最后一个系数组对应的符号预测值。A symbol prediction value corresponding to the last coefficient group is determined according to the candidate symbol combination corresponding to the minimum cost value.
  11. 根据权利要求1所述的方法,其中,所述对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值,包括:The method according to claim 1, wherein said performing sign prediction on said last coefficient group and determining a sign prediction value of said last coefficient group comprises:
    若所述最后一个系数组中非零重建系数绝对值的个数大于K,则从所述最后一个系数组中选取K个非零重建系数绝对值;其中,K为大于零的整数;If the number of absolute values of non-zero reconstruction coefficients in the last coefficient group is greater than K, then select K absolute values of non-zero reconstruction coefficients from the last coefficient group; wherein, K is an integer greater than zero;
    利用所述K个非零重建系数绝对值进行符号预测,确定所述K个非零重建系数绝对值的符号预测值。Sign prediction is performed by using the K absolute values of non-zero reconstruction coefficients, and a sign prediction value of the K absolute values of non-zero reconstruction coefficients is determined.
  12. 根据权利要求11所述的方法,其中,所述从所述最后一个系数组中选取K个非零重建系数绝对值,包括:The method according to claim 11, wherein said selecting K absolute values of non-zero reconstruction coefficients from said last coefficient group comprises:
    利用光栅扫描顺序对所述最后一个系数组进行扫描,将最先扫描到的K个非零重建系数绝对值确定为所述K个非零重建系数绝对值;Scanning the last coefficient group in a raster scanning order, and determining the absolute values of K non-zero reconstruction coefficients scanned first as the absolute values of the K non-zero reconstruction coefficients;
    或者,or,
    确定所述最后一个系数组中非零重建系数的绝对值;determining the absolute value of the non-zero reconstruction coefficients in said last coefficient group;
    从所述非零重建系数的绝对值中确定最大的K个绝对值,根据所述K个绝对值确定所述K个非零重建系数绝对值;determining the largest K absolute values from the absolute values of the non-zero reconstruction coefficients, and determining the K absolute values of the K non-zero reconstruction coefficients according to the K absolute values;
    或者,or,
    确定所述最后一个系数组中非零重建系数的能量值;determining energy values for non-zero reconstruction coefficients in said last coefficient group;
    从所述非零重建系数的能量值中确定最大的K个能量值,根据所述K个能量值确定所述K个非零重建系数绝对值。The largest K energy values are determined from the energy values of the non-zero reconstruction coefficients, and the absolute values of the K non-zero reconstruction coefficients are determined according to the K energy values.
  13. 根据权利要求12所述的方法,其中,所述确定所述最后一个系数组中非零重建系数的能量值,包括:The method of claim 12, wherein said determining the energy values of the non-zero reconstruction coefficients in said last coefficient group comprises:
    确定所述最后一个系数组中非零重建系数在所述当前块的左侧边的反变换值和在所述当前块的上侧边的反变换值;determining an inverse transform value of the non-zero reconstruction coefficients in the last coefficient group on the left side of the current block and an inverse transform value on the upper side of the current block;
    若所述当前块处于所属对象的上边界,则根据所述非零重建系数在所述当前块的左侧边的反变换值,计算所述非零重建系数的能量值;If the current block is at the upper boundary of the object to which it belongs, calculate the energy value of the non-zero reconstruction coefficient according to the inverse transformation value of the non-zero reconstruction coefficient on the left side of the current block;
    若所述当前块处于所属对象的左边界,则根据所述非零重建系数在所述当前块的上侧边的反变换值,计算所述非零重建系数的能量值。If the current block is at the left boundary of the object to which it belongs, calculating an energy value of the non-zero reconstruction coefficient according to an inverse transform value of the non-zero reconstruction coefficient on the upper side of the current block.
  14. 根据权利要求1所述的方法,其中,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    若所述当前块处于所属对象的左上角位置,则确定所述当前块的重建系数绝对值不进行符号预测。If the current block is at the upper left corner of the object to which it belongs, it is determined that the absolute value of the reconstruction coefficient of the current block does not perform sign prediction.
  15. 一种编码方法,应用于编码器,所述方法包括:An encoding method applied to an encoder, the method comprising:
    确定当前块的变换系数;determining transform coefficients for the current block;
    按照预设扫描顺序对所述当前块的变换系数进行扫描,确定所述当前块在所述预设扫描顺序上的最后一个系数组;Scan the transform coefficients of the current block according to a preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
    对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值。Sign prediction is performed on the last coefficient group, and a sign prediction value of the last coefficient group is determined.
  16. 根据权利要求15所述的方法,其中,所述方法还包括:The method according to claim 15, wherein said method further comprises:
    根据所述最后一个系数组的符号预测值,确定所述最后一个系数组的符号残差值;determining a sign residual value of the last coefficient group based on the sign prediction value of the last coefficient group;
    对所述符号残差值进行编码,将所得到的编码比特写入码流。Encoding the symbol residual value, and writing the obtained coded bits into a code stream.
  17. 根据权利要求16所述的方法,其中,所述根据所述最后一个系数组的符号预测值,确定所述最后一个系数组的符号残差值,包括:The method according to claim 16, wherein said determining the sign residual value of the last coefficient group according to the sign prediction value of the last coefficient group comprises:
    根据所述当前块的变换系数,确定所述最后一个系数组的符号原始值;Determining the signed original value of the last coefficient group according to the transform coefficient of the current block;
    根据所述最后一个系数组的符号原始值和所述最后一个系数组的符号预测值,确定所述最后一个系数组的符号残差值。A sign residual value of the last coefficient group is determined based on the sign original value of the last coefficient group and the sign predicted value of the last coefficient group.
  18. 根据权利要求17所述的方法,其中,所述根据所述最后一个系数组的符号原始值和所述最后一个系数组的符号预测值,确定所述最后一个系数组的符号残差值,包括:The method according to claim 17, wherein said determining the sign residual value of the last coefficient group according to the sign original value of the last coefficient group and the sign predicted value of the last coefficient group comprises :
    对所述最后一个系数组的符号原始值和所述最后一个系数组的符号预测值进行异或运算,确定所述最后一个系数组的符号残差值。Performing an XOR operation on the original sign value of the last coefficient group and the predicted sign value of the last coefficient group to determine a sign residual value of the last coefficient group.
  19. 根据权利要求15所述的方法,其中,所述方法还包括:The method according to claim 15, wherein said method further comprises:
    若所述当前块的尺寸为1×N,N为大于或等于16的整数,则确定所述当前块的变换系数可划分为(N/16)个系数组,且所述系数组的尺寸为1×16;If the size of the current block is 1×N, and N is an integer greater than or equal to 16, then it is determined that the transform coefficients of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient groups is 1×16;
    若所述当前块的尺寸为N×1,N为大于或等于16的整数,则确定所述当前块的变换系数可划分为(N/16)个系数组,且所述系数组的尺寸为16×1;If the size of the current block is N×1, and N is an integer greater than or equal to 16, then it is determined that the transform coefficients of the current block can be divided into (N/16) coefficient groups, and the size of the coefficient groups is 16×1;
    若所述当前块的尺寸为2×N,N为大于或等于8的整数,则确定所述当前块的变换系数可划分为(N/8)个系数组,且所述系数组的尺寸为2×8;If the size of the current block is 2×N, and N is an integer greater than or equal to 8, it is determined that the transform coefficients of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient groups is 2×8;
    若所述当前块的尺寸为N×2,N为大于或等于8的整数,则确定所述当前块的变换系数可划分为(N/8)个系数组,且所述系数组的尺寸为8×2;If the size of the current block is N×2, and N is an integer greater than or equal to 8, it is determined that the transform coefficients of the current block can be divided into (N/8) coefficient groups, and the size of the coefficient groups is 8×2;
    若所述当前块的尺寸为M×N,M和N均为大于或等于4的整数,则确定所述当前块的变换系数可划分为(M×N/16)个系数组,且所述系数组的尺寸为4×4。If the size of the current block is M×N, and both M and N are integers greater than or equal to 4, it is determined that the transform coefficients of the current block can be divided into (M×N/16) coefficient groups, and the The size of the coefficient group is 4×4.
  20. 根据权利要求19所述的方法,其中,在所述当前块的尺寸为M×N,M和N均为大于或等于4的整数情况下,所述方法还包括:The method according to claim 19, wherein, when the size of the current block is M×N, and both M and N are integers greater than or equal to 4, the method further comprises:
    确定所述当前块中处于左上角位置的第一区域;determining the first area in the upper left corner of the current block;
    根据所述第一区域内的变换系数确定所述最后一个系数组;其中,所述最后一个系数组中的变换系数个数为2 L个,且L为大于或等于零的个数。 The last coefficient group is determined according to the transformation coefficients in the first area; wherein, the number of transformation coefficients in the last coefficient group is 2 L , and L is a number greater than or equal to zero.
  21. 根据权利要求15所述的方法,其中,所述对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值,包括:The method according to claim 15, wherein said performing sign prediction on said last coefficient group and determining a sign prediction value of said last coefficient group comprises:
    若所述当前块处于所属对象的上边界,则根据所述当前块的左侧边对应的第一相邻像素值,计算所述最后一个系数组在多种候选符号组合下的代价值;If the current block is at the upper boundary of the object to which it belongs, calculating the cost value of the last coefficient group under various candidate symbol combinations according to the first adjacent pixel value corresponding to the left side of the current block;
    根据所述多种候选符号组合下的代价值,确定所述最后一个系数组对应的符号预测值;determining a symbol prediction value corresponding to the last coefficient group according to the cost values under the various candidate symbol combinations;
    其中,所述第一相邻像素值是由所述当前块的左侧边相邻两列的参考像素值组成的。Wherein, the first adjacent pixel value is composed of reference pixel values of two adjacent columns on the left side of the current block.
  22. 根据权利要求15所述的方法,其中,所述对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值,包括:The method according to claim 15, wherein said performing sign prediction on said last coefficient group and determining a sign prediction value of said last coefficient group comprises:
    若所述当前块处于所属对象的左边界,则根据所述当前块的上侧边对应的第二相邻像素值,计算所述最后一个系数组在多种候选符号组合下的代价值;If the current block is at the left boundary of the object to which it belongs, calculating the cost value of the last coefficient group under various candidate symbol combinations according to the second adjacent pixel value corresponding to the upper side of the current block;
    根据所述多种候选符号组合下的代价值,确定所述最后一个系数组对应的符号预测值;determining a symbol prediction value corresponding to the last coefficient group according to the cost values under the various candidate symbol combinations;
    其中,所述第二相邻像素值是由所述当前块的上侧边相邻两行的参考像素值组成的。Wherein, the second adjacent pixel values are composed of reference pixel values of two adjacent rows on the upper side of the current block.
  23. 根据权利要求15所述的方法,其中,所述对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值,包括:The method according to claim 15, wherein said performing sign prediction on said last coefficient group and determining a sign prediction value of said last coefficient group comprises:
    若所述当前块处于所属对象的上边界,则根据所述当前块的左侧边对应的第一相邻像素值和所述当前块的上侧边对应的第二相邻像素值,计算所述最后一个系数组在多种候选符号组合下的代价值;If the current block is at the upper boundary of the object to which it belongs, the calculated value is calculated according to the first adjacent pixel value corresponding to the left side of the current block and the second adjacent pixel value corresponding to the upper side of the current block. Describe the cost value of the last coefficient group under various candidate symbol combinations;
    根据所述多种候选符号组合下的代价值,确定所述最后一个系数组对应的符号预测值;determining a symbol prediction value corresponding to the last coefficient group according to the cost values under the various candidate symbol combinations;
    其中,所述第一相邻像素值是由所述当前块的左侧边相邻两列的参考像素值组成的,所述第二相邻像素值是由所述当前块的上侧边相邻一行的参考像素值组成的。Wherein, the first adjacent pixel value is composed of the reference pixel values of the two columns adjacent to the left side of the current block, and the second adjacent pixel value is composed of the upper side of the current block. It is composed of the reference pixel values of the adjacent row.
  24. 根据权利要求21至23任一项所述的方法,其中,所述所属对象包括下述至少之一:图像和编码树单元。The method according to any one of claims 21 to 23, wherein the belonging object includes at least one of the following: a picture and a coding tree unit.
  25. 根据权利要求21至23任一项所述的方法,其中,所述根据所述多种候选符号组合下的代价值,确定所述最后一个系数组对应的符号预测值,包括:The method according to any one of claims 21 to 23, wherein the determining the predicted symbol value corresponding to the last coefficient group according to the cost values under the various candidate symbol combinations includes:
    从所述多种候选符号组合下的代价值中确定最小代价值;determining a minimum cost value from the cost values under the plurality of candidate symbol combinations;
    根据所述最小代价值对应的候选符号组合,确定所述最后一个系数组对应的符号预测值。A symbol prediction value corresponding to the last coefficient group is determined according to the candidate symbol combination corresponding to the minimum cost value.
  26. 根据权利要求1所述的方法,其中,所述对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值,包括:The method according to claim 1, wherein said performing sign prediction on said last coefficient group and determining a sign prediction value of said last coefficient group comprises:
    若所述最后一个系数组中非零变换系数的个数大于K,则从所述最后一个系数组中选取K个非零变换系数;其中,K为大于零的整数;If the number of non-zero transform coefficients in the last coefficient group is greater than K, select K non-zero transform coefficients from the last coefficient group; where K is an integer greater than zero;
    利用所述K个非零变换系数进行符号预测,确定所述K个非零变换系数的符号预测值。Perform sign prediction by using the K non-zero transform coefficients, and determine sign prediction values of the K non-zero transform coefficients.
  27. 根据权利要求26所述的方法,其中,所述从所述最后一个系数组中选取K个非零变换系数,包括:The method according to claim 26, wherein said selecting K non-zero transform coefficients from said last coefficient group comprises:
    利用光栅扫描顺序对所述最后一个系数组进行扫描,将最先扫描到的K个非零变换系数确定为所述K个非零变换系数;Scanning the last coefficient group in a raster scanning order, and determining the first scanned K non-zero transform coefficients as the K non-zero transform coefficients;
    或者,or,
    确定所述最后一个系数组中非零变换系数的绝对值;determining the absolute values of the non-zero transform coefficients in said last coefficient group;
    从所述非零变换系数的绝对值中确定最大的K个绝对值,根据所述K个绝对值确定所述K个非零变换系数;determining the largest K absolute values from the absolute values of the non-zero transform coefficients, and determining the K non-zero transform coefficients according to the K absolute values;
    或者,or,
    确定所述最后一个系数组中非零变换系数的能量值;determining energy values for non-zero transform coefficients in said last coefficient group;
    从所述非零变换系数的能量值中确定最大的K个能量值,根据所述K个能量值确定所述K个非零变换系数。The largest K energy values are determined from the energy values of the non-zero transform coefficients, and the K non-zero transform coefficients are determined according to the K energy values.
  28. 根据权利要求27所述的方法,其中,所述确定所述最后一个系数组中非零变换系数的能量值,包括:The method of claim 27, wherein said determining energy values of non-zero transform coefficients in said last coefficient group comprises:
    确定所述最后一个系数组中非零变换系数在所述当前块的左侧边的反变换值和在所述当前块的上侧边的反变换值;determining an inverse transform value of the non-zero transform coefficients in the last coefficient group on the left side of the current block and an inverse transform value on the upper side of the current block;
    若所述当前块处于所属对象的上边界,则根据所述非零变换系数在所述当前块的左侧边的反变换值,计算所述非零变换系数的能量值;If the current block is at the upper boundary of the object to which it belongs, calculate the energy value of the non-zero transform coefficient according to the inverse transform value of the non-zero transform coefficient on the left side of the current block;
    若所述当前块处于所属对象的左边界,则根据所述非零变换系数在所述当前块的上侧边的反变换值,计算所述非零变换系数的能量值。If the current block is at the left boundary of the object to which it belongs, calculating an energy value of the non-zero transform coefficient according to an inverse transform value of the non-zero transform coefficient on the upper side of the current block.
  29. 根据权利要求15所述的方法,其中,所述方法还包括:The method according to claim 15, wherein said method further comprises:
    若所述当前块处于所属对象的左上角位置,则确定所述当前块的变换系数不进行符号预测。If the current block is at the upper left corner of the object to which it belongs, it is determined that no sign prediction is performed on the transform coefficients of the current block.
  30. 一种码流,所述码流是根据待编码信息进行比特编码生成的;其中,所述待编码信息包括下述至少之一:重建系数绝对值和符号残差值。A bit stream is generated by performing bit coding according to the information to be encoded; wherein the information to be encoded includes at least one of the following: an absolute value of a reconstruction coefficient and a symbol residual value.
  31. 一种编码器,包括第一确定单元和第一预测单元;其中,An encoder, comprising a first determination unit and a first prediction unit; wherein,
    所述第一确定单元,配置为确定当前块的变换系数;The first determining unit is configured to determine a transform coefficient of a current block;
    所述第一确定单元,还配置为按照预设扫描顺序对所述当前块的变换系数进行扫描,确定所述当前块在所述预设扫描顺序上的最后一个系数组;The first determining unit is further configured to scan the transform coefficients of the current block according to a preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
    所述第一预测单元,配置为对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值。The first prediction unit is configured to perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
  32. 一种编码器,所述编码器包括第一存储器和第一处理器;其中,An encoder comprising a first memory and a first processor; wherein,
    所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;The first memory is used to store a computer program capable of running on the first processor;
    所述第一处理器,用于在运行所述计算机程序时,执行如权利要求15至29任一项所述的方法。The first processor is configured to execute the method according to any one of claims 15 to 29 when running the computer program.
  33. 一种解码器,包括解码单元、第二确定单元和第二预测单元;其中,A decoder, including a decoding unit, a second determination unit, and a second prediction unit; wherein,
    所述解码单元,配置为解析码流,确定当前块的重建系数绝对值;The decoding unit is configured to analyze the code stream and determine the absolute value of the reconstruction coefficient of the current block;
    所述第二确定单元,配置为按照预设扫描顺序对所述当前块的重建系数绝对值进行扫描,确定所述当前块在所述预设扫描顺序上的最后一个系数组;The second determining unit is configured to scan the absolute value of the reconstruction coefficient of the current block according to a preset scanning order, and determine the last coefficient group of the current block in the preset scanning order;
    所述第一预测单元,配置为对所述最后一个系数组进行符号预测,确定所述最后一个系数组的符号预测值。The first prediction unit is configured to perform sign prediction on the last coefficient group, and determine a sign prediction value of the last coefficient group.
  34. 一种解码器,所述解码器包括第二存储器和第二处理器;其中,A decoder comprising a second memory and a second processor; wherein,
    所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;The second memory is used to store a computer program capable of running on the second processor;
    所述第二处理器,用于在运行所述计算机程序时,执行如权利要求1至14任一项所述的方法。The second processor is configured to execute the method according to any one of claims 1 to 14 when running the computer program.
  35. 一种计算机存储介质,其中,所述计算机存储介质存储有计算机程序,所述计算机程序被执行时实现如权利要求1至14任一项所述的方法、或者实现如权利要求15至29任一项所述的方法。A computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed, the method according to any one of claims 1 to 14 is realized, or the method according to any one of claims 15 to 29 is realized. method described in the item.
PCT/CN2021/143688 2021-12-31 2021-12-31 Encoding and decoding methods, code stream, encoder, decoder, and storage medium WO2023123358A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/143688 WO2023123358A1 (en) 2021-12-31 2021-12-31 Encoding and decoding methods, code stream, encoder, decoder, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/143688 WO2023123358A1 (en) 2021-12-31 2021-12-31 Encoding and decoding methods, code stream, encoder, decoder, and storage medium

Publications (1)

Publication Number Publication Date
WO2023123358A1 true WO2023123358A1 (en) 2023-07-06

Family

ID=86997251

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/143688 WO2023123358A1 (en) 2021-12-31 2021-12-31 Encoding and decoding methods, code stream, encoder, decoder, and storage medium

Country Status (1)

Country Link
WO (1) WO2023123358A1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190208225A1 (en) * 2018-01-02 2019-07-04 Qualcomm Incorporated Sign prediction in video coding
CN111819853A (en) * 2018-03-07 2020-10-23 华为技术有限公司 Signaling residual symbols for prediction in transform domain

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190208225A1 (en) * 2018-01-02 2019-07-04 Qualcomm Incorporated Sign prediction in video coding
CN111819853A (en) * 2018-03-07 2020-10-23 华为技术有限公司 Signaling residual symbols for prediction in transform domain

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
M. G. SARWER (ALIBABA-INC), Y. YAN (ALIBABA-INC), J. CHEN (ALIBABA-INC), R. -L. LIAO (ALIBABA): "AHG12: On sign prediction", 24. JVET MEETING; 20211006 - 20211015; TELECONFERENCE; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 7 October 2021 (2021-10-07), XP030298003 *
X. XIU (KWAI), Y.-W. CHEN, N. YAN, C.-W. KUO, H.-J. JHU, W. CHEN, X. WANG (KWAI): "AHG12: Enhanced sign prediction", 24. JVET MEETING; 20211006 - 20211015; TELECONFERENCE; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 7 October 2021 (2021-10-07), XP030298086 *
Y.-W. CHEN, W.-J. CHIEN, H.-C. CHUANG, M. COBAN, J. DONG, H. E. EGILMEZ, N. HU, M. KARCZEWICZ, A. RAMASUBRAMONIAN, D. RUSANOVSKYY,: "Description of SDR, HDR and 360° video coding technology proposal by Qualcomm and Technicolor – low and high complexity versions", 10. JVET MEETING; 20180410 - 20180420; SAN DIEGO; (THE JOINT VIDEO EXPLORATION TEAM OF ISO/IEC JTC1/SC29/WG11 AND ITU-T SG.16 ), 3 April 2018 (2018-04-03), XP030151183 *

Similar Documents

Publication Publication Date Title
CN110024392B (en) Low complexity symbol prediction for video coding
JP6931690B2 (en) How to encode content and arithmetic units
CN1812576B (en) Deblocking filters for performing horizontal and vertical filtering of video data simultaneously and methods of operating the same
CN110933411A (en) Selection of adjacent neighboring blocks for intra-coding
GB2531003A (en) Method and apparatus for vector encoding in video coding and decoding
US20160373767A1 (en) Encoding and Decoding Methods and Apparatuses
WO2015052273A1 (en) Method and apparatus for displacement vector component prediction in video coding and decoding
CN111327904B (en) Image reconstruction method and device
MX2012013263A (en) Methods and apparatus for intra coding a block having pixels assigned to groups.
US11558608B2 (en) On split prediction
CN111448798A (en) Method and apparatus for block shape based video encoding and decoding
WO2021238396A1 (en) Inter-frame prediction methods, encoder, decoder, and computer storage medium
CN114600455A (en) Image encoding/decoding method and apparatus, and recording medium storing bit stream
EP3910951A1 (en) Image component prediction method, encoder, decoder and storage medium
WO2023123358A1 (en) Encoding and decoding methods, code stream, encoder, decoder, and storage medium
CN111327894B (en) Block division method, video coding and decoding method and video coder and decoder
WO2020258052A1 (en) Image component prediction method and device, and computer storage medium
CN113545090A (en) Method and apparatus for intra sub-partition coding and decoding mode
WO2023193260A1 (en) Encoding/decoding method, code stream, encoder, decoder, and storage medium
WO2023044916A1 (en) Intra prediction method, encoder, decoder, and encoding and decoding system
WO2023044918A1 (en) Intra prediction method, coder, decoder, and coding/decoding system
WO2023044917A1 (en) Intra prediction method, coder, decoder, and coding and decoding system
CN116546217A (en) Decoding prediction method, device and computer storage medium
WO2024077553A1 (en) Video encoding method and apparatus, video decoding method and apparatus, device, system, and storage medium
WO2024077562A1 (en) Coding method and apparatus, decoding method and apparatus, coder, decoder, code stream, and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21969709

Country of ref document: EP

Kind code of ref document: A1