Coding method, encoder, decoder and computer storage medium for coefficients

CN119728975BActive Publication Date: 2026-06-26GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
Filing Date
2021-04-15
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing video encoding and decoding methods fail to fully utilize the statistical characteristics between quantization coefficients, resulting in poor encoding performance.

Method used

An adaptive binary arithmetic coding mode and an exponential Golomb coding algorithm are adopted. The quantization coefficients are entropy encoded through a context model, and the coding mode is adjusted to utilize the residual absolute value of the quantization coefficients, thereby improving the encoding and decoding performance.

Benefits of technology

By fully utilizing the statistical properties between quantization coefficients, bitrate is reduced and encoding/decoding performance is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119728975B_ABST
    Figure CN119728975B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a coefficient coding and decoding method, an encoder, a decoder and a computer storage medium, which are applied to the decoder, and the method comprises the following steps: based on the position of a to-be-decoded quantization coefficient, a first context model adaptive binary arithmetic coding mode is used to analyze a code stream to obtain the value of non-zero identification information; in the case that the value of the non-zero identification information is a first value, a second context model adaptive binary arithmetic coding mode is used to analyze the code stream to obtain the value of X preset identification information; in the case that the value of the Xth preset identification information is the first value, the target order of the exponential golomb code is determined, and the code stream is analyzed by using the exponential golomb decoding algorithm of the target order to obtain the residual value of the reconstructed quantization coefficient absolute value; and the value of the non-zero identification information, the value of the X preset identification information and the residual value of the reconstructed quantization coefficient absolute value are used to determine the reconstructed quantization coefficient absolute value corresponding to the quantization coefficient position.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Cross-references to related applications

[0002] This application is a divisional application of the Chinese patent application No. 202180095577.3, filed on April 15, 2021, for PCT international patent application PCT / CN2021 / 087499, which entered the Chinese national phase and is entitled "Coefficient Encoding and Decoding Method, Encoder, Decoder and Computer Storage Medium". Technical Field

[0003] This application relates to the field of video encoding and decoding technology, and in particular to a coefficient encoding and decoding method, encoder, decoder and computer storage medium. Background Technology

[0004] With increasing demands for video display quality, the field of computer vision has received growing attention. In recent years, image processing technology has been successfully applied across various industries. In the video image encoding and decoding process, at the encoding end, the image data to be encoded undergoes transformation and quantization processing, followed by compression encoding via entropy coding units. The resulting bitstream is then transmitted to the decoding end; after parsing the bitstream and performing inverse quantization and inverse transform processing, the original input image data can be recovered.

[0005] In related technologies, to further compress the data, the encoder can transform the residual data from the pixel domain to the transform domain to obtain transform coefficients. These coefficients can then be quantized by a two-dimensional array according to the coefficient scanning order to generate quantized coefficients for a one-dimensional vector, which can be used to achieve more compression. However, there are many statistical characteristics among the quantized coefficients at different positions on the scan line, but current encoding methods are relatively simple and do not fully utilize these statistical characteristics, resulting in poor encoding performance. Summary of the Invention

[0006] This application proposes a coefficient encoding / decoding method, encoder, decoder, and computer storage medium, which can save bit rate and thus improve encoding / decoding performance.

[0007] To achieve the above objectives, the technical solution of this application is implemented as follows:

[0008] In a first aspect, embodiments of this application provide a method for decoding coefficients, applied to a decoder, the method comprising:

[0009] Based on the position of the quantization coefficients to be decoded, the bitstream is parsed using the adaptive binary arithmetic coding mode of the first context model to obtain the value of the non-zero identifier information.

[0010] When the non-zero identifier information takes the first value, the bitstream is parsed using the adaptive binary arithmetic coding mode of the second context model to obtain the values ​​of X preset identifier information; where X is a natural number greater than zero.

[0011] When the value of the Xth preset identifier information is the first value, the target order of the exponential Golomb code is determined, and the code stream is parsed using the exponential Golomb decoding algorithm of the target order to obtain the remaining value of the absolute value of the reconstructed quantization coefficient; wherein, the target order is an integer greater than zero;

[0012] Based on the values ​​of the non-zero identifier information, the values ​​of X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient, the absolute value of the reconstructed quantization coefficient corresponding to the position of the quantization coefficient is determined.

[0013] Secondly, embodiments of this application provide a coefficient encoding method applied to an encoder, the method comprising:

[0014] Determine the quantization coefficients to be encoded;

[0015] The value of the non-zero identifier information is determined based on the quantization coefficient, and the value of the non-zero identifier information is entropy encoded using the adaptive binary arithmetic coding mode of the first context model.

[0016] When the non-zero identifier information takes the first value, the values ​​of X preset identifier information are determined according to the quantization coefficient, and the values ​​of the X preset identifier information are sequentially entropy encoded using the adaptive binary arithmetic encoding mode of the second context model; where X is a natural number greater than zero.

[0017] When the value of the Xth preset identifier information is the first value, the absolute value of the quantization coefficient and the target order of the exponential Golomb code are determined, and the absolute value of the quantization coefficient is entropy encoded using the exponential Golomb coding algorithm of the target order.

[0018] The encoded bit information is written into the bitstream.

[0019] Thirdly, embodiments of this application provide an encoder, which includes a first determining unit, an entropy encoding unit, and a writing unit; wherein,

[0020] The first determining unit is configured to determine the quantization coefficients to be encoded;

[0021] An entropy coding unit is configured to determine the value of non-zero identifier information based on the quantization coefficient, and entropy code the value of the non-zero identifier information using an adaptive binary arithmetic coding mode of a first context model; and, when the value of the non-zero identifier information is a first value, determine the values ​​of X preset identifier information based on the quantization coefficient, and entropy code the values ​​of the X preset identifier information sequentially using an adaptive binary arithmetic coding mode of a second context model; wherein X is a natural number greater than zero;

[0022] The entropy coding unit is further configured to, when the value of the Xth preset identifier information is the first value, determine the absolute value of the quantization coefficient and the target order of the exponential Golomb code, and use the exponential Golomb coding algorithm of the target order to entropy code the absolute value of the quantization coefficient.

[0023] The writing unit is configured to write the encoded bit information into the bit stream.

[0024] Fourthly, embodiments of this application provide an encoder, which includes a first memory and a first processor; wherein,

[0025] A first memory is used to store computer programs that can run on the first processor;

[0026] A first processor is configured to execute the method described in the second aspect when the computer program is running.

[0027] Fifthly, embodiments of this application provide a decoder, which includes a parsing unit and a second determining unit; wherein,

[0028] The parsing unit is configured to parse the bitstream based on the position of the quantization coefficients to be decoded, using the adaptive binary arithmetic coding mode of the first context model, and obtain the value of the non-zero identifier information.

[0029] The parsing unit is further configured to, when the non-zero identifier information takes a first value, parse the bitstream using the adaptive binary arithmetic coding mode of the second context model to obtain the values ​​of X preset identifier information; wherein X is a natural number greater than zero; and when the X preset identifier information takes a first value, determine the target order of the exponential Golomb code, and parse the bitstream using the exponential Golomb decoding algorithm of the target order to obtain the residual value of the absolute value of the reconstructed quantization coefficient; wherein the target order is an integer greater than zero.

[0030] The second determining unit is configured to determine the absolute value of the reconstructed quantization coefficient corresponding to the quantization coefficient position based on the value of the non-zero identifier information, the value of the X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient.

[0031] Sixthly, embodiments of this application provide a decoder, which includes a second memory and a second processor; wherein,

[0032] The second memory is used to store computer programs that can run on the second processor;

[0033] A second processor is configured to execute the method described in the first aspect when the computer program is running.

[0034] In a seventh aspect, embodiments of this application provide a computer storage medium storing a computer program that, when executed, implements the method described in the first aspect or the method described in the second aspect.

[0035] The present application provides a coefficient encoding / decoding method, encoder, decoder, and computer storage medium. On the encoder side, firstly, the quantization coefficient to be encoded is determined; then, the value of non-zero identifier information is determined based on the quantization coefficient, and entropy encoding is performed on the value of the non-zero identifier information using an adaptive binary arithmetic encoding mode of a first context model; when the value of the non-zero identifier information is a first value, the values ​​of X preset identifier information are determined based on the quantization coefficient, and entropy encoding is performed sequentially on the values ​​of the X preset identifier information using an adaptive binary arithmetic encoding mode of a second context model; where X is a natural number greater than zero; when the value of the Xth preset identifier information is a first value, the absolute value residue of the quantization coefficient and the target order of the exponential Golomb code are determined, and entropy encoding is performed on the absolute value residue of the quantization coefficient using an exponential Golomb code algorithm of the target order; finally, the encoded bit information is written into the bitstream. On the decoder side, firstly, based on the position of the quantization coefficient to be decoded, the bitstream is parsed using the adaptive binary arithmetic coding mode of the first context model to obtain the value of the non-zero identifier information. Then, with the non-zero identifier information value being the first value, the bitstream is parsed using the adaptive binary arithmetic coding mode of the second context model to obtain the values ​​of X preset identifier information, where X is a natural number greater than zero. With the Xth preset identifier information value being the first value, the target order of the exponential Golomb code is determined, and the bitstream is parsed using the exponential Golomb decoding algorithm of the target order to obtain the residual value of the reconstructed absolute value of the quantization coefficient, where the target order is an integer greater than zero. Finally, based on the non-zero identifier information value, the X preset identifier information values, and the residual value of the reconstructed absolute value of the quantization coefficient, the absolute value of the reconstructed quantization coefficient corresponding to that quantization coefficient position is determined. In this way, by fully utilizing the statistical characteristics between the quantization coefficients at various positions, not only is the newly introduced preset identifier information entropy encoded through the context model, but the coding mode is also adjusted based on the residual value of the absolute value of the quantization coefficient. This allows for better utilization of adaptive coding characteristics during the encoding and decoding process, thereby saving bitrate and improving encoding and decoding performance. Attached Figure Description

[0036] Figure 1 An application diagram illustrating a coding framework provided for related technologies;

[0037] Figure 2 This application provides a schematic diagram of the system composition of an encoder according to an embodiment of the present application.

[0038] Figure 3 This application provides a schematic diagram of the system composition of a decoder according to an embodiment of the present application;

[0039] Figure 4 A flowchart illustrating a coefficient decoding method provided in an embodiment of this application;

[0040] Figure 5 A schematic diagram of a coefficient scanning order provided for related technologies;

[0041] Figure 6 A schematic diagram of another coefficient scanning order provided for related technologies;

[0042] Figure 7 A flowchart illustrating a coefficient encoding method provided in an embodiment of this application;

[0043] Figure 8 A schematic diagram of the composition structure of an encoder provided in an embodiment of this application;

[0044] Figure 9 This is a schematic diagram of the specific hardware structure of an encoder provided in an embodiment of this application;

[0045] Figure 10 A schematic diagram of the composition structure of a decoder provided in an embodiment of this application;

[0046] Figure 11 This is a schematic diagram of the specific hardware structure of a decoder provided in an embodiment of this application. Detailed Implementation

[0047] In order to gain a more detailed understanding of the features and technical content of the embodiments of this application, the implementation of the embodiments of this application will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for reference and illustration only and are not intended to limit the embodiments of this application.

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0049] In the following description, references to "some embodiments" refer to a subset of all possible embodiments. It is understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict. It should also be noted that the terms "first, second, third" used in the embodiments of this application are merely for distinguishing similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0050] In video images, a coding block (CB) is typically represented by a first image component, a second image component, and a third image component. These three image components are a luma component, a blue chroma component, and a red chroma component, respectively. Specifically, the luma component is usually represented by the symbol Y, the blue chroma component is usually represented by the symbol Cb or U, and the red chroma component is usually represented by the symbol Cr or V. Thus, video images can be represented in YCbCr format or YUV format.

[0051] Before providing a further detailed description of the embodiments of this application, the nouns and terms used in the embodiments of this application will be explained. The nouns and terms used in the embodiments of this application shall be interpreted as follows:

[0052] Moving Picture Experts Group (MPEG)

[0053] International Organization for Standardization (ISO)

[0054] International Electrotechnical Commission (IEC)

[0055] Joint Video Experts Team (JVET)

[0056] Alliance for Open Media (AOM)

[0057] The next-generation video coding standard H.266 / Versatile Video Coding (VVC)

[0058] VVC Reference Software Testing Platform (VVC Test Model, VTM)

[0059] Audio Video Standard (AVS)

[0060] AVS High-Performance Model (HPM)

[0061] Transform coefficients

[0062] Quantization parameter

[0063] Context-based Adaptive Variable-Length Code (CAVLC)

[0064] Context-based Adaptive Binary Arithmetic Coding (CABAC)

[0065] Scan Region Based Coefficient Coding (SRCC)

[0066] It's understandable that digital video compression technology primarily compresses massive amounts of digital video data to facilitate transmission and storage. With the surge in internet video and increasing demands for video clarity, while existing digital video compression standards can save considerable video data, there is still a need to pursue better digital video compression technologies to reduce the bandwidth and traffic pressure on digital video transmission.

[0067] Video compression includes multiple steps such as intra-frame prediction (spatial domain) and / or inter-frame prediction (temporal domain) to reduce or remove inherent redundancy in the video, transformation / quantization and inverse quantization / inverse transformation of residual information, and loop filtering and entropy coding to improve the quality of subjective and objective reconstruction. Specifically, ... Figure 1 As shown, mainstream video compression standards are basically block-based compression techniques. A video slice, a frame, or a series of images is divided into basic units called Coding Tree Units (CTUs), which are further divided into blocks called Coding Units (CUs). Intra-frame blocks are predicted using surrounding pixels as references, while inter-frame blocks reference spatial neighboring blocks and reference information from other frames. Residual information, relative to the predicted signal, is transformed, quantized, and entropy-coded on a block-by-block basis to generate the bitstream. These techniques are described in standards and implemented in various fields related to video compression. Internationally, mainstream standards include H.264 / Advanced Video Coding (AVC), H.265 / High Efficiency Video Coding (HEVC), H.266 / Versatile Video Coding (VVC), and their extensions. Video devices can implement these techniques to achieve more efficient video encoding / decoding, transmission, and storage.

[0068] Spatial or temporal prediction yields the predicted block of the block to be decoded. Residual data represents the pixel difference between the original block and the predicted block. For further compression, the residual data can be transformed from the pixel domain to the transform domain to obtain residual transform coefficients. These coefficients can then be quantized in a two-dimensional array according to the coefficient scanning order to generate a one-dimensional vector of quantized coefficients. Entropy coding can be applied to these coefficients to achieve further compression. Here, the block to be decoded can refer to either the block to be encoded or the block to be decoded.

[0069] Specifically, on the encoder side, there may be a transform unit and a quantization unit. First, the block to be decoded, such as the prediction residual (which can be represented as residual), is transformed by the transform unit to obtain a transform coefficient matrix (or "transform block"). Then, the transform coefficient matrix is ​​quantized by the quantization unit, and the final quantized coefficients are written into the video bitstream.

[0070] On the decoder side, it can include an inverse quantization unit and an inverse transform unit. First, by parsing the bitstream, the quantization coefficients corresponding to the transform coefficient matrix can be obtained. The inverse quantization unit performs inverse quantization processing (also known as "scaling") on these quantization coefficients to obtain the reconstructed values ​​of the transform coefficient matrix, thus obtaining the coefficient matrix. Then, the inverse transform unit performs the inverse transform on the coefficient matrix corresponding to the transform unit on the encoder side, finally obtaining the residual reconstruction block.

[0071] In related technologies, quantization processing can utilize the correlation between coefficients and the characteristics of quantized coefficients to select a better quantization method, thereby achieving the goal of optimizing quantization. To facilitate video bitrate generation, a specific scanning order can transform a two-dimensional coefficient block into a one-dimensional coefficient stream. This scanning order can be Zigzag, horizontal, vertical, or any other scanning order. In most existing video coding standards, unbinarized quantized coefficients need to be further binarized to obtain bits (bins), and the binarized quantized coefficients are then used to generate the final bitstream through model-based binary arithmetic coding. However, due to the many statistical characteristics existing between quantized coefficients at different positions on the scan line, current coding methods are relatively simple, and context-based adaptive binary arithmetic coding does not fully utilize these statistical characteristics, resulting in poor coding performance.

[0072] This application provides a coefficient encoding method applied to an encoder. The method involves: determining the quantization coefficient to be encoded; determining the value of non-zero identifier information based on the quantization coefficient, and entropy encoding the value of the non-zero identifier information using an adaptive binary arithmetic encoding mode of a first context model; when the value of the non-zero identifier information is a first value, determining the values ​​of X preset identifier information based on the quantization coefficient, and entropy encoding the values ​​of the X preset identifier information sequentially using an adaptive binary arithmetic encoding mode of a second context model; where X is a natural number greater than zero; when the value of the Xth preset identifier information is a first value, determining the absolute residual value of the quantization coefficient and the target order of the exponential Golomb code, and entropy encoding the absolute residual value of the quantization coefficient using an exponential Golomb code algorithm of the target order; and writing the encoded bit information into the bitstream.

[0073] This application also provides a method for decoding coefficients, applied to a decoder. Based on the position of the quantization coefficient to be decoded, the code stream is parsed using an adaptive binary arithmetic coding mode of a first context model to obtain the value of non-zero identifier information. If the value of the non-zero identifier information is a first value, the code stream is parsed using an adaptive binary arithmetic coding mode of a second context model to obtain the values ​​of X preset identifier information; where X is a natural number greater than zero. If the value of the Xth preset identifier information is a first value, the target order of the exponential Golomb code is determined, and the code stream is parsed using an exponential Golomb decoding algorithm of the target order to obtain the remaining value of the reconstructed absolute value of the quantization coefficient; where the target order is an integer greater than zero. Based on the value of the non-zero identifier information, the values ​​of the X preset identifier information, and the remaining value of the reconstructed absolute value of the quantization coefficient, the reconstructed absolute value of the quantization coefficient corresponding to the quantization coefficient position is determined.

[0074] In this way, by making full use of the statistical characteristics between the quantization coefficients at each position, not only is the newly introduced preset identification information entropy encoded through the context model, but the encoding mode is also adjusted according to the absolute residual value of the quantization coefficient. This allows for better utilization of adaptive encoding characteristics during the encoding and decoding process, thereby saving bit rate and improving encoding and decoding performance.

[0075] The embodiments of this application will now be described in detail with reference to the accompanying drawings.

[0076] See Figure 2 This illustrates a system composition block diagram example of an encoder provided in an embodiment of this application. Figure 2As shown, 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 (DPB) unit 114, and an entropy coding unit 115. Here, the input of the encoder 100 can be a video consisting of a series of images or a single still image, and the output of the encoder 100 can be a bitstream (also called a "bitstream") representing a compressed version of the input video.

[0077] The segmentation unit 101 segments the images in the input video into one or more Coding Tree Units (CTUs). The segmentation unit 101 divides the image into multiple tiles, and can further divide a tile into one or more bricks. Here, a tile or a brick can include one or more complete and / or partial CTUs. Additionally, the segmentation unit 101 can form one or more slices, where a slice can include one or more tiles arranged in raster order in the image, or one or more tiles covering a rectangular area of ​​the image. The segmentation unit 101 can also form one or more sub-images, where a sub-image can include one or more slices, tiles, or bricks.

[0078] During the encoding process of encoder 100, segmentation unit 101 transmits the CTU to prediction unit 102. Typically, prediction unit 102 may consist of block segmentation unit 103, motion estimation (ME) unit 104, motion compensation (MC) unit 105, and intra-prediction unit 106. Specifically, block segmentation unit 103 iteratively uses quadtree segmentation, binary tree segmentation, and ternary tree segmentation to further divide the input CTU into smaller coding units (CUs). Prediction unit 102 can use ME unit 104 and MC unit 105 to obtain inter-frame prediction blocks of the CUs. Intra-prediction unit 106 can use various intra-prediction modes, including MIP modes, to obtain intra-frame prediction blocks of the CUs. In the example, rate-distortion optimized motion estimation can be invoked by ME unit 104 and MC unit 105 to obtain inter-frame prediction blocks, and rate-distortion optimized mode determination can be invoked by intra-prediction unit 106 to obtain intra-frame prediction blocks.

[0079] Prediction unit 102 outputs the predicted block of the CU. First adder 107 calculates the difference between the CU in the output of segmentation unit 101 and the predicted block of the CU, i.e., the residual CU. Transform unit 108 reads the residual CU and performs one or more transform operations on the residual CU to obtain coefficients. Quantization unit 109 quantizes the coefficients and outputs quantization coefficients (i.e., levels). Inverse quantization unit 110 performs a scaling operation on the quantization coefficients to output reconstructed coefficients. Inverse transform unit 111 performs one or more inverse transforms corresponding to the transforms in transform unit 108 and outputs the reconstructed residual. Second adder 112 calculates the reconstructed CU by adding the reconstructed residual to the predicted block of the CU from prediction unit 102. Second adder 112 also sends its output to prediction unit 102 as an intra-frame prediction reference. After all CUs in the image or sub-image are reconstructed, filtering unit 113 performs loop filtering on the reconstructed image or sub-image. Here, the filtering unit 113 includes one or more filters, such as a deblocking filter, a Sample Adaptive Offset (SAO) filter, an Adaptive Loop Filter (ALF), a Luma Mapping with Chroma Scaling (LMCS) filter, and a neural network-based filter. 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.

[0080] The output of filtering unit 113 is a decoded image or sub-image, which is buffered in DPB unit 114. DPB unit 114 outputs the decoded image or sub-image according to timing and control information. Here, the image stored in DPB unit 114 can also be used as a reference for prediction unit 102 to perform inter-frame prediction or intra-frame prediction. Finally, entropy coding unit 115 converts the parameters (such as control parameters and supplementary information) necessary for decoding the image from encoder 100 into binary form, and writes such binary form into the bitstream according to the syntax structure of each data unit, which is the final output bitstream of encoder 100.

[0081] Furthermore, the encoder 100 may be a first memory having a first processor and a computer program for recording. When the first processor reads and runs the computer program, the encoder 100 reads the input video and generates a corresponding bitstream. Additionally, the encoder 100 may also be a computing device having one or more chips. These units, implemented as integrated circuits on the chips, have... Figure 2 Similar connection and data exchange functions to the corresponding units in the middle.

[0082] See Figure 3This illustrates a system block diagram example of a decoder provided in an embodiment of this application. Figure 3 As shown, the decoder 200 may include: a parsing unit 201, a prediction unit 202, an inverse quantization unit 205, an inverse transform unit 206, an adder 207, a filtering unit 208, and a decoded image buffer unit 209. Here, the input of the decoder 200 is a bitstream representing a compressed version of a video or a still image, and the output of the decoder 200 may be a decoded video consisting of a series of images or a decoded still image.

[0083] The input bitstream to the decoder 200 can be the bitstream generated by the encoder 100. The parsing unit 201 parses the input bitstream and obtains the values ​​of the syntax elements. The parsing unit 201 converts the binary representation of the syntax elements into numerical values ​​and sends these values ​​to units in the decoder 200 to obtain one or more decoded images. The parsing unit 201 can also parse one or more syntax elements from the input bitstream to display the decoded images.

[0084] During the decoding process of decoder 200, 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 for obtaining one or more decoded images to the unit in decoder 200.

[0085] Prediction unit 202 determines the prediction block of the current decoded block (e.g., CU). Here, prediction unit 202 may include motion compensation unit 203 and intra-prediction unit 204. Specifically, when an inter-frame decoding mode is indicated for decoding the current decoded block, prediction unit 202 passes relevant parameters from parsing unit 201 to motion compensation unit 203 to obtain inter-frame prediction blocks; when an intra-frame prediction mode (including MIP mode indicated by MIP mode index value) is indicated for decoding the current decoded block, prediction unit 202 passes relevant parameters from parsing unit 201 to intra-prediction unit 204 to obtain intra-frame prediction blocks.

[0086] The dequantization unit 205 has the same function as the dequantization unit 110 in the encoder 100. The dequantization unit 205 performs a scaling operation on the quantization coefficients (i.e., levels) from the parsing unit 201 to obtain the reconstruction coefficients.

[0087] 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 (i.e., the inverse operation of one or more transform operations performed by the inverse transform unit 111 in the encoder 100) to obtain the reconstructed residual.

[0088] Adder 207 performs an addition operation on its inputs (the predicted block from prediction unit 202 and the reconstructed residual from inverse transform unit 206) to obtain the reconstructed block of the current decoded block. The reconstructed block is also sent to prediction unit 202 as a reference for other blocks encoded in intra-frame prediction mode.

[0089] After all CUs in an image or sub-image are reconstructed, filtering unit 208 performs loop filtering on the reconstructed image or sub-image. Filtering unit 208 includes one or more filters, such as deblocking filters, sampling adaptive compensation filters, adaptive loop filters, luminance mapping and chroma scaling filters, and neural network-based filters. Alternatively, when filtering unit 208 determines that a reconstructed block is not used as a reference for decoding other blocks, filtering unit 208 performs loop filtering on one or more target pixels in the reconstructed block. Here, the output of filtering unit 208 is a decoded image or sub-image, which is buffered in DPB unit 209. DPB unit 209 outputs the decoded image or sub-image based on timing and control information. The image stored in DPB unit 209 can also be used as a reference for performing inter-frame prediction or intra-frame prediction by prediction unit 202.

[0090] Furthermore, the decoder 200 can be a second memory having a second processor and a computer program for recording. When the second processor reads and runs the computer program, the decoder 200 reads the input bitstream and generates the corresponding decoded video. Alternatively, the decoder 200 can also be a computing device having one or more chips. These units, implemented as integrated circuits on the chips, have... Figure 3 Similar connection and data exchange functions to the corresponding units in the middle.

[0091] It should also be noted that when the embodiments of this application are applied to the encoder 100, the "current block" specifically refers to the block to be encoded in the video image (also known as the "encoded block"); when the embodiments of this application are applied to the decoder 200, the "current block" specifically refers to the block to be decoded in the video image (also known as the "decoded block").

[0092] In one embodiment of this application, see [link to embodiment]. Figure 4 This illustrates a flowchart of a coefficient decoding method provided in an embodiment of this application. Figure 4 As shown, the method may include:

[0093] S401: Based on the position of the quantization coefficients to be decoded, the bitstream is parsed using the adaptive binary arithmetic coding mode of the first context model to obtain the value of the non-zero identifier information.

[0094] S402: When the non-zero identifier information takes the first value, the code stream is parsed using the adaptive binary arithmetic coding mode of the second context model to obtain the values ​​of X preset identifier information; where X is a natural number greater than zero.

[0095] S403: When the value of the Xth preset identifier information is the first value, determine the target order of the exponential Golomb code, and use the exponential Golomb decoding algorithm of the target order to parse the code stream and obtain the remaining value of the absolute value of the reconstructed quantization coefficient; wherein, the target order is an integer greater than zero.

[0096] S404: Determine the absolute value of the reconstructed quantization coefficient corresponding to the position of the quantization coefficient based on the value of the non-zero identifier information, the value of the X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient.

[0097] It should be noted that the decoding method in this application embodiment is mainly applied to the decoder. Specifically, based on Figure 3 The decoder 200 shown in the embodiment of this application mainly applies to the "parse unit 201" part of the decoder 200. For the parse unit 201, the adaptive binary arithmetic coding mode based on the context model can be used to decode to obtain the value of the preset identification information. Then, the exponential Columbus decoding algorithm of the target order is used to decode to obtain the residual value of the absolute value, and then the reconstructed quantization coefficient can be obtained.

[0098] Specifically, in this embodiment, after intra-frame or inter-frame prediction processing, the video signal yields the residual of the block to be decoded. This residual signal may be further transformed to obtain transform coefficients (also simply referred to as "coefficients"). For ease of description, both the untransformed residual signal and the transformed residual signal can be collectively referred to as transform coefficients. For effective compression, the transform coefficients also need to be quantized. Quantization is typically used to reduce the dynamic range of the transform coefficients, thereby achieving the goal of representing video with fewer codewords. The quantized value can be called a "quantization coefficient," and is also commonly referred to as a level, quantization level, or quantization grade. Quantization is typically performed by dividing the transform coefficient by the quantization step size, which is determined by the quantization factor transmitted in the bitstream. In the encoder, the quantization coefficients also need to be entropy encoded to be written into the bitstream; thus, in the decoder, the bitstream needs to be parsed to obtain the reconstructed quantization coefficients. Therefore, the inverse quantization operation is achieved by multiplying the reconstructed quantization coefficients by the quantization step size to obtain the reconstructed transform coefficients. For an N×M block, the quantization of all transform coefficients can be performed independently. This technique is also widely used in many international video compression standards, such as H.264 and HEVC.

[0099] Understandably, in the latest international video compression standards, quantization operations can leverage the correlation between transform coefficients and the characteristics of quantized coefficients to select a better quantization method, thereby optimizing quantization. To facilitate video bitrate generation, a specific scanning order can transform a two-dimensional coefficient block into a one-dimensional coefficient stream. The scanning order can be Zigzag, horizontal, vertical, or any other scanning order. In most existing international video coding standards, the non-binarized levels are further binarized to obtain bins, and the binarized levels are then processed by a model-based binarization arithmetic encoder to produce the final bitstream.

[0100] In related technologies, current entropy coding methods for coefficients mainly include two types: Context-Based Adaptive Variable-Length Coding (CAVLC) and Context-Based Adaptive Binary Arithmetic Coding (CABAC). CABAC is a typical entropy coding technique, currently supported in some coding standards. CABAC can involve several stages, including binarization, context model selection, and binary arithmetic coding. In binarization, any non-binary symbol is mapped to a binary sequence. In the context model, a model probability distribution is assigned to the element being encoded (also called a "binary symbol"). Then, in the subsequent binary arithmetic coding stage, the assigned probability distribution model is used to perform coding to produce a bit sequence that forms the encoded representation of the element based on the assigned model probability distribution.

[0101] For the CABAC encoding process, encoding data symbols using CABAC at this point involves one or more of the following steps:

[0102] (1) Binarization: If the data to be encoded is not a binary value, it needs to be mapped to a series of so-called "binary numbers". Each binary number can have a value of "0" or "1" and is usually called a bin.

[0103] (2) Context Modeling (Determining the Index Number of the Context Model): The data to be encoded has contextual relevance. Utilizing the contextual information provided by the encoded data, a suitable probability model is selected for the data to be encoded; this is context modeling (i.e., determining the context model). By constructing the context model, the basic probability model can adapt to the changing statistical characteristics of video images, reduce data redundancy, and decrease computational overhead. Typically, there are many context models, each with its own context index number, denoted by ctxIdx. Each different symbol indexes its own probability lookup table based on its corresponding context model. That is, upon receiving a symbol, the index number (ctxIdx) of the context model corresponding to that symbol is first found, and then its corresponding probability lookup table is found based on ctxIdx.

[0104] (3) Binary Encoding: An adaptive binary arithmetic encoder is constructed using the probability estimation method of the probability model found through context modeling. This arithmetic encoder requires the probability of the bin value (i.e., the probability that the binary number is equal to "0" and the probability that the binary number is equal to "1") as input. Its principle is the same as that of general arithmetic encoding. The difference is that the binary arithmetic encoding sequence only has two symbols, "0" and "1", and the probabilities involved are only P(0) and P(1).

[0105] (4) State update: During the arithmetic encoding process, although it is the same context model, the probability is not fixed. Each time a new symbol is input, the probability of the corresponding context model will change. That is, the probability of the selected context model is updated based on the actual encoded value of the binary number (for example, if the binary value is "1", the probability of "1" is increased).

[0106] It should be noted that for syntax elements with an approximately uniform distribution, selecting the bypass mode during encoding and decoding can eliminate the need for context modeling and improve the speed of encoding and decoding.

[0107] It should also be noted that Exponential-Golomb coding is a lossless data compression method. Among them, k-order Exp-Golomb coding is a variable-length prefix code. Its hardware implementation is simple, and it does not require the prior creation and storage of code tables. Not only can codewords be generated quickly through hardware calculation, but the order k can also be flexibly adjusted according to the source, thus achieving high coding efficiency.

[0108] Here, the k-th order exponent Golomb code used to represent non-negative integers can be generated according to the following steps:

[0109] (1) Write the number in binary form, remove the lowest k bits, and then add one;

[0110] (2) Calculate the number of bits left, and subtract one from this number. This is the number of leading zeros that need to be added.

[0111] (3) Replace the lowest k bits removed in the first step with the end of the bit string.

[0112] In one specific implementation, taking VVC as an example, the transform coefficients in a transform block can be divided into multiple non-overlapping coefficient groups. The size of the coefficient group depends on the size of the transform block, and generally includes 1×16, 2×8, 8×2, 2×4, 4×2, 16×1, etc. Figure 5 A schematic diagram of a coefficient scanning order provided by related technologies is given. For example... Figure 5As shown, it provides an example of encoding the coefficient groups within the block to be decoded and the coefficients within the coefficient groups in a diagonal scan order in VVC.

[0113] exist Figure 5 In the VVC coefficient encoding, the first non-zero coefficient in the lower right corner is used to scan in a predetermined order until the DC coefficient in the upper left corner is used. For each quantization coefficient, the following possible syntax elements may be written into the bitstream to represent the quantization coefficient, mainly including sig_coeff_flag, abs_level_gtx_flag[0], par_level_flag, abs_level_gtx_flag[1], abs_remainder, dec_abs_level, coeff_sign_flag and other syntax elements. Wherein, coeff_sign_flag indicates whether the quantization coefficient is non-zero, abs_level_gtx_flag[0] indicates whether the absolute value of the quantization coefficient is greater than 1, par_level_flag indicates whether the quantization coefficient is odd or even, abs_level_gtx_flag[1] indicates whether the absolute value of the quantization coefficient is greater than 3, abs_remainder and dec_abs_level indicate the remaining values ​​to be encoded in the absolute value of the quantization coefficient (here, for abs_remainder and dec_abs_level, only one is used; and "the remaining values ​​to be encoded in the absolute value of the quantization coefficient" can be simply referred to as "the remaining values ​​of the absolute value of the quantization coefficient"), and coeff_sign_flag indicates the sign of the non-zero quantization coefficient. The specific encoding process is described as follows:

[0114] The first step is to encode the non-zero flag sig_coeff_flag. If the current quantization coefficient is 0, then encode 0; if the current quantization coefficient is not 0, then encode 1.

[0115] Second step: If sig_coeff_flag is 0, skip to the fifth step below. If sig_coeff_flag is 1, encode abs_level_gtx_flag[0]; if the absolute value of the current quantization coefficient is 1, then encode 0; if the absolute value of the current quantization coefficient is not 1, then encode 1.

[0116] Third step, if abs_level_gtx_flag[0] is 0, skip to the fifth step below. If abs_level_gtx_flag[0] is 1, encode par_level_flag; if the current quantization coefficient is even, encode 0; if the current quantization coefficient is odd, encode 1. Then encode abs_level_gtx_flag[1]; if the absolute value of the current quantization coefficient is less than or equal to 3, encode 0; if the absolute value of the current quantization coefficient is greater than 3, encode 1.

[0117] Fourth step: If abs_level_gtx_flag[1] is 0, the quantization coefficient at this position is encoded. If abs_level_gtx_flag[1] is 1, the absolute value remainder of the current quantization coefficient, abs_remainder and dec_abs_level, is encoded.

[0118] Fifth step: If sig_coeff_flag is 0, the quantization coefficient at this position is encoded. If sig_coeff_flag is 1, the coefficient sign flag coeff_sign_flag is encoded according to the sign of the current quantization coefficient. If the quantization coefficient is positive, it is encoded as 0; if the quantization coefficient is negative, it is encoded as 1.

[0119] The correspondence between each flag bit (i.e., syntax element) and the absolute value of the quantization coefficient is shown in Table 1 below.

[0120] Table 1

[0121]

[0122] In Table 1, |q k | represents the absolute value of the quantization coefficient, sig represents the non-zero flag, represented by the syntax element sig_coeff_flag; gt1 represents whether the absolute value of the quantization coefficient is greater than 1, represented by the syntax element abs_level_gtx_flag[0]; par represents whether the quantization coefficient is odd or even, represented by the syntax element par_level_flag; gt3 represents whether the absolute value of the quantization coefficient is greater than 3, represented by the syntax element abs_level_gtx_flag[1]; rem represents the absolute value of the quantization coefficient, represented by the syntax elements abs_remainder and dec_abs_level.

[0123] The absolute value of the quantization coefficient is calculated as follows: |q k|=sig+gt1+par+2×gt3+2×rem. When a flag bit is missing, its value is treated as 0. It should also be noted that the absolute residual values ​​of the quantization coefficients (abs_remainder and dec_abs_level) and the sign flag (coeff_sign_flag) are entropy encoded using a bypass mode, while all other flag bits are entropy encoded using an adaptive encoding method based on a context model.

[0124] In another specific implementation, taking AVS as an example, in AVS3, the coefficients to be encoded are typically limited to a range using SRCC technology. The coefficient scanning method starts from the bottom right corner of the range and scans in reverse Zigzag order until the DC coefficient at the top left corner ends. The coefficient scanning order based on this scanning area is as follows: Figure 6 As shown.

[0125] For each quantization coefficient, the following possible syntax elements may be written into the bitstream to represent that coefficient: `sig_flag`, `coeff_abs_level_greater1_flag`, `coeff_abs_level_greater2_flag`, `coeff_abs_level_remaining`, and `coeff_sign`. Specifically, `sig_flag` indicates whether the quantization coefficient is non-zero; `coeff_abs_level_greater1_flag` indicates whether the absolute value of the quantization coefficient is greater than 1; `coeff_abs_level_greater2_flag` indicates whether the absolute value of the quantization coefficient is greater than 2; `coeff_abs_level_remaining` indicates that the absolute value of the quantization coefficient is greater than 2, and its value is the absolute value of the quantization coefficient minus 3; `coeff_sign` indicates the sign of the non-zero quantization coefficient. The specific encoding process is described below:

[0126] The first step is to encode the non-zero flag sig_flag. If the current quantization coefficient is 0, then encode 0; if the current quantization coefficient is not 0, then encode 1.

[0127] In the second step, if sig_flag is 0, skip to the fifth step below. If sig_flag is 1, encode coeff_abs_level_greater1_flag; if the absolute value of the current quantization coefficient is 1, encode 0; if the absolute value of the current quantization coefficient is not 1, encode 1.

[0128] Third, if coeff_abs_level_greater1_flag is 0, skip to the fifth step below. If coeff_abs_level_greater1_flag is 1, encode coeff_abs_level_greater2_flag; if the absolute value of the current quantization coefficient is 2, encode 0; if the absolute value of the current quantization coefficient is greater than 2, encode 1.

[0129] Fourth step: If coeff_abs_level_greater2_flag is 0, the quantization coefficient at this position is encoded. If coeff_abs_level_greater2_flag is 1, the absolute value remainder of the current quantization coefficient, coeff_abs_level_remaining, is encoded.

[0130] Fifth step: If sig_flag is 0, the quantization coefficient at this position is encoded. If sig_flag is 1, the coefficient sign flag coeff_sign is encoded according to the sign of the current quantization coefficient. If the quantization coefficient is positive, it is encoded as 0; if the quantization coefficient is negative, it is encoded as 1.

[0131] The correspondence between each flag (i.e., syntax element) and the absolute value of the quantization coefficient is shown in Table 2 below.

[0132] Table 2

[0133]

[0134] In Table 2, |q k | represents the absolute value of the quantization coefficient; sig represents the non-zero flag, indicated by the syntax element sig_flag; gt1 indicates whether the absolute value of the quantization coefficient is greater than 1, indicated by the syntax element coeff_abs_level_greater1_flag; gt2 indicates whether the absolute value of the quantization coefficient is greater than 2, indicated by the syntax element coeff_abs_level_greater2_flag; rem represents the remaining absolute value of the quantization coefficient, indicated by the syntax element coeff_abs_level_remaining.

[0135] The absolute value of the quantization coefficient is calculated as follows: |q k|=sig+gt1+gt2+rem. When a flag bit is missing, its value is treated as 0. It should also be noted that the absolute value remainder of the quantization coefficients (coeff_abs_level_remaining) and the sign flag (coeff_sign) are entropy encoded using bypass mode, while all other flag bits are entropy encoded using an adaptive binary arithmetic encoding method based on the context model.

[0136] It should also be noted that video encoding, as commonly referred to in video standards, can include both encoding and decoding. Therefore, video encoding includes encoding methods on the encoder side and decoding methods on the decoder side. This application's embodiments will first describe the decoding methods on the decoder side.

[0137] In this application embodiment, an entropy encoding method for the quantized coefficients obtained after quantization is mainly proposed. Here, there are no specific restrictions on the scanning method of the quantized coefficients. For example, diagonal, zigzag, horizontal, vertical, 4x4 sub-block scanning or any other scanning method are all valid scanning methods.

[0138] Specifically, for the current quantization coefficient position to be decoded, the bitstream can be parsed using the adaptive binary arithmetic coding mode of the first context model to obtain the value of the non-zero identifier information. In some embodiments, after S401, the method may further include: if the value of the non-zero identifier information is a second value, determining the reconstructed quantization coefficient corresponding to the quantization coefficient position based on the value of the non-zero identifier information.

[0139] It should be noted that non-zero flag information can be represented using the syntax element sig_coeff_flag, or simply sig_flag. Generally speaking, non-zero flag information can also be abbreviated as sig.

[0140] It should also be noted that, in some embodiments, the method may further include: if the value of the non-zero identifier information is a first value, then the reconstructed quantization coefficient is determined to be non-zero; if the value of the non-zero identifier information is a second value, then the reconstructed quantization coefficient is determined to be zero.

[0141] In the embodiments of this application, the first value can be 1, and the second value can be 0.

[0142] It should be noted that in another specific example, the first value can also be set to true, and the second value can also be set to false. Even in yet another specific example, the first value can be set to 0, and the second value can also be set to 1; or, the first value can be set to false, and the second value can also be set to true. No specific limitations are imposed here.

[0143] In other words, taking a first value of 1 and a second value of 0 as an example, if the decoded non-zero flag value is 1, then it can be determined that the reconstructed quantization coefficient is non-zero, and the bitstream needs to be further parsed. If the decoded non-zero flag value is 0, then it can be determined that the reconstructed quantization coefficient is zero, and the position of the next quantization coefficient to be decoded can be determined.

[0144] It should also be noted that the values ​​of the X preset identifiers can be represented by the i-th preset identifier, where i is a natural number greater than zero and less than or equal to X. Here, the i-th preset identifier can be represented by gti, and it is used to indicate whether the absolute value of the reconstructed quantization coefficient is greater than i. In some embodiments, the method may further include:

[0145] If the value of the i-th preset identifier information is the first value, then it is determined that the absolute value of the reconstruction quantization coefficient is greater than i;

[0146] If the value of the i-th preset identifier information is the second value, then the absolute value of the reconstruction quantization coefficient is determined to be less than or equal to i.

[0147] In other words, taking a first value of 1 and a second value of 0 as an example, if the value of the i-th preset identifier information is 1 after decoding, then it can be determined that the absolute value of the reconstructed quantization coefficient is greater than i. In this case, it is necessary to continue parsing the bitstream to obtain the value of the (i+1)-th preset identifier information. If the value of the i-th preset identifier information is 0 after decoding, then it can be determined that the absolute value of the reconstructed quantization coefficient is less than or equal to i. In this case, the absolute value of the reconstructed quantization coefficient corresponding to that quantization coefficient position can be determined based on the decoding result.

[0148] Specifically, when i equals X, for the Xth preset identifier information, the method may further include: if the value of the Xth preset identifier information is a first value, then determine that the absolute value of the reconstructed quantization coefficient is greater than X; if the value of the Xth preset identifier information is a second value, then determine that the absolute value of the reconstructed quantization coefficient is less than or equal to X.

[0149] Thus, after S402, that is, after obtaining the value of the Xth preset identifier information, the method may further include:

[0150] When the value of the Xth preset identifier information is the second value, the absolute value of the reconstructed quantization coefficient corresponding to the quantization coefficient position is determined based on the value of the non-zero identifier information and the values ​​of the X preset identifier information.

[0151] In other words, taking a first value of 1 and a second value of 0 as an example, if the decoded value of the Xth preset identifier is 1, then it can be determined that the absolute value of the reconstructed quantization coefficient is greater than X. In this case, it is also necessary to determine the target order of the exponential Golomb code so that the bitstream can be parsed using the exponential Golomb decoding algorithm of the target order to obtain the remaining value of the absolute value of the reconstructed quantization coefficient. Conversely, if the decoded value of the Xth preset identifier is 0, then it can be determined that the absolute value of the reconstructed quantization coefficient is less than or equal to X. In this case, it is no longer necessary to decode to obtain the remaining value of the absolute value of the reconstructed quantization coefficient; the absolute value of the reconstructed quantization coefficient corresponding to the quantization coefficient position can be determined directly based on the non-zero identifier value and the values ​​of the X preset identifier values.

[0152] It should also be noted that when the value of the Xth preset identifier information is the first value, it is necessary to determine the target order of the exponential Golomb code. In one possible implementation, determining the target order of the exponential Golomb code may include setting the value of the target order to a fixed constant greater than zero.

[0153] In one specific example, the target order is set to 1.

[0154] It should be noted that, assuming the target order can be represented by k, the exponential Golomb code of the target order can be denoted as EGK(k), where k is a positive integer. For example, a first-order exponential Golomb code can be represented by EGK(1).

[0155] Furthermore, regarding the target order, in related technologies, the target order is zero. However, in the embodiments of this application, the target order can be 1st, 2nd, 3rd, etc. That is, the value of the target order can be a pre-set fixed constant, such as 1, 2, 3, etc. Typically, the target order is 1st, which means that the 1st-order exponential Golomb decoding algorithm can be used for decoding, thereby obtaining the residual value of the absolute value of the reconstructed quantization coefficients.

[0156] It should also be noted that the target order can be flexibly adjusted during the encoding and decoding process. In another possible implementation, determining the target order of the exponential Golomb code may include:

[0157] The mode identifier information used to determine the position of the quantization coefficient to be decoded;

[0158] Based on the pattern identification information, the target order of the exponential Golomb code is determined.

[0159] In a specific example, determining the target order of the exponential Golomb code based on the pattern identification information may include:

[0160] If the mode identification information indicates the use of the transform skip mode, then the value of the target order is determined to be 1;

[0161] If the mode identification information indicates that the transform skip mode is not used, then the target order is determined to be set to 0.

[0162] It should be noted that the target order can be determined based on other identification information, such as mode identification information. In the decoder, the mode identification information used for the quantization coefficients to be decoded can be determined by parsing the bitstream; then, based on this mode identification information, the target order of the exponential Golomb code can be determined.

[0163] For example, suppose the mode identifier information is used to indicate whether a transform skip mode is used. Thus, after determining the mode identifier information used, if the mode identifier information indicates the use of a transform skip mode, then the target order can be set to 1, meaning the first-order exponential Golomb decoding algorithm is used to parse the bitstream; if the mode identifier information indicates that a transform skip mode is not used, then the target order can be set to 0, meaning the zero-order exponential Golomb decoding algorithm is used to parse the bitstream, thereby obtaining the residual values ​​of the reconstructed absolute values ​​of the quantization coefficients.

[0164] In other words, the target order can be a fixed constant set in advance, or it can be flexibly adjusted during the encoding and decoding process, such as determining how to adjust the target order based on other identification information; the embodiments of this application do not make specific limitations.

[0165] Thus, after determining the target order of the exponential Golomb code, the code stream is parsed using the exponential Golomb decoding algorithm of the target order, thereby obtaining the remaining value of the absolute value of the reconstructed quantization coefficients; then, based on the values ​​of the non-zero identifier information, the values ​​of X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficients, the absolute value of the reconstructed quantization coefficients can be determined.

[0166] Furthermore, in this embodiment of the application, for the X preset identifier information, in a specific example, the value of X can be equal to 4. Thus, the four preset identifier information may include: a first preset identifier information, a second preset identifier information, a third preset identifier information, and a fourth preset identifier; wherein,

[0167] The first preset identification information is used to indicate whether the absolute value of the reconstructed quantization coefficient is greater than 1;

[0168] The second preset identification information is used to indicate whether the absolute value of the reconstructed quantization coefficient is greater than 2;

[0169] The third preset identification information is used to indicate whether the absolute value of the reconstructed quantization coefficient is greater than 3;

[0170] The fourth preset identification information is used to indicate whether the absolute value of the reconstruction quantization coefficient is greater than 4.

[0171] It should be noted that the first preset identifier information can be represented by gt1, the second preset identifier information can be represented by gt2, the third preset identifier information can be represented by gt3, and the fourth preset identifier information can be represented by gt4. Here, gt1, gt2, gt3, and gt4 can use the same context model, or gt1 and gt2 can share a context model, and gt3 and gt4 can share a context model; this application embodiment does not make specific limitations.

[0172] In some embodiments, if gt1, gt2, gt3, and gt4 can use the same context model (i.e., the second context model), then when the non-zero identifier information takes the first value, the step of parsing the bitstream using the adaptive binary arithmetic coding mode of the second context model to obtain the values ​​of X preset identifier information may include:

[0173] The bitstream is parsed using the adaptive binary arithmetic coding mode of the second context model to obtain the value of the first preset identifier information;

[0174] If the value of the first preset identifier information is the first value, then the code stream is parsed using the adaptive binary arithmetic encoding mode of the second context model to obtain the value of the second preset identifier information.

[0175] If the value of the second preset identifier information is the first value, then the code stream is parsed using the adaptive binary arithmetic encoding mode of the second context model to obtain the value of the third preset identifier information.

[0176] If the value of the third preset identifier information is the first value, then the code stream is parsed using the adaptive binary arithmetic encoding mode of the second context model to obtain the value of the fourth preset identifier information.

[0177] In some embodiments, the second context model may include a second first context model and a second second context model. If gt1 and gt2 share a common context model (i.e., the second first context model), and gt3 and gt4 share a common context model (i.e., the second second context model), then when the non-zero identifier information takes the first value, the step of parsing the bitstream using the adaptive binary arithmetic coding mode of the second context model to obtain the values ​​of X preset identifier information may include:

[0178] The code stream is parsed using the adaptive binary arithmetic coding mode of the second context model to obtain the value of the first preset identifier information;

[0179] If the value of the first preset identifier information is the first value, then the code stream is parsed using the adaptive binary arithmetic encoding mode of the second context model to obtain the value of the second preset identifier information.

[0180] If the value of the second preset identifier information is the first value, then the code stream is parsed using the adaptive binary arithmetic encoding mode of the second context model to obtain the value of the third preset identifier information.

[0181] If the value of the third preset identifier information is the first value, then the code stream is parsed using the adaptive binary arithmetic encoding mode of the second context model to obtain the value of the fourth preset identifier information.

[0182] In other words, in one specific example, the first context model, the second first context model, and the second second second context model are different. That is, non-zero identifier information can use one set of context models (i.e., the first context model), gt1 and gt2 share one set of context models (i.e., the second first context model), and gt3 and gt4 share one set of context models (i.e., the second second second context model). Alternatively, in another specific example, the second first context model and the second second second context model are completely corresponding; that is, gt1, gt2, gt3, and gt4 can share one set of context models (i.e., the second context model).

[0183] It is important to note that there is no specific limit to the number of context models in each set, nor is there a specific limit to the method for determining the index number of the context models. Typically, existing solutions in related technologies can be used to determine the index number of the context models by default.

[0184] Furthermore, if gt4 equals 1, it means the absolute value of the reconstructed quantization coefficients is greater than 4, and there must still be residual values ​​of the absolute values ​​of the reconstructed quantization coefficients. In some embodiments, determining the target order of the exponential Golomb code when the value of the Xth preset identifier information is the first value may include:

[0185] When the value of the fourth preset identifier information is the first value, the target order of the exponential Golomb code is determined, and the step of parsing the code stream using the exponential Golomb decoding algorithm of the target order is performed to obtain the remaining value of the absolute value of the reconstructed quantization coefficient is executed.

[0186] In a specific example, for S404, determining the absolute value of the reconstructed quantization coefficient corresponding to the quantization coefficient position based on the value of the non-zero identifier information, the values ​​of the X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient may include:

[0187] The values ​​of the non-zero identifier information, the first preset identifier information, the second preset identifier information, the third preset identifier information, the fourth preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient are added together to obtain the absolute value of the reconstructed quantization coefficient corresponding to the position of the quantization coefficient.

[0188] It should be noted that when the value of the fourth preset identifier information is the first value, specifically when the value of gt4 is equal to 1, the bitstream can be parsed using the exponential Columbus decoding algorithm of the target order to obtain the residual value (represented by rem) of the absolute value of the reconstructed quantization coefficient; then, the values ​​of sig, gt1, gt2, gt3, gt4 and rem are added together to obtain the absolute value of the reconstructed quantization coefficient corresponding to the position of the quantization coefficient.

[0189] Furthermore, after obtaining the absolute values ​​of the reconstructed quantization coefficients, the method can continue to decode to obtain the values ​​of symbol identification information, which are used to determine the positive or negative characteristics of the reconstructed quantization coefficients. In some embodiments, the method may further include:

[0190] The bypass mode is used to parse the bitstream and obtain the values ​​of the symbol identification information;

[0191] Based on the value of the symbol identification information and the absolute value of the reconstructed quantization coefficient, the reconstructed quantization coefficient corresponding to the position of the quantization coefficient is determined.

[0192] It should be noted that the bypass mode here refers to entropy decoding using an equal probability model. In some embodiments, regarding the positive or negative characteristics of the reconstructed quantization coefficients, the method may further include: if the symbol identification information takes a first value, then the reconstructed quantization coefficient is determined to be negative; if the symbol identification information takes a second value, then the reconstructed quantization coefficient is determined to be positive.

[0193] In other words, taking a first value of 1 and a second value of 0 as an example, if the value of the decoded symbol identification information is 1, then the reconstructed quantization coefficient can be determined to be negative; if the value of the decoded symbol identification information is 0, then the reconstructed quantization coefficient can be determined to be positive.

[0194] Furthermore, it should be noted that the order of the above decoding process is relative and can be adjusted according to specific standards in actual situations. In one possible implementation, the method may further include:

[0195] Determine the coefficient block and the preset scanning order of the coefficient block; wherein, the coefficient block includes at least one quantization coefficient position to be decoded;

[0196] According to the preset scanning order, the values ​​of non-zero identifier information corresponding to at least one quantization coefficient position to be decoded and the values ​​of X preset identifier information are obtained sequentially by parsing the bit stream.

[0197] According to the preset scanning order, the remaining value of the absolute value of the reconstructed quantization coefficient corresponding to at least one position of the quantization coefficient to be decoded is obtained by parsing the bit stream.

[0198] Based on the values ​​of non-zero identifier information, the values ​​of X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient, determine the absolute value of the reconstructed quantization coefficient corresponding to at least one position of the quantization coefficient to be decoded.

[0199] It should be noted that the preset scanning order can be diagonal, zigzag, horizontal, vertical, 4×4 sub-block scanning, or any other scanning order. This application embodiment does not impose any specific limitations.

[0200] It should also be noted that this implementation method uses the VVC standard as an example. In VVC, the decoding order in related technologies is to first decode the absolute values ​​of each reconstructed quantization coefficient (sig, gt1, par, gt3) sequentially according to a preset scan order; then, to decode the rem values ​​of each reconstructed quantization coefficient sequentially according to the preset scan order. In the embodiment of this application, the decoding order of the above process is to first decode the absolute values ​​of each reconstructed quantization coefficient (sig, gt1, gt2, gt3, gt4) sequentially according to a preset scan order; then, to decode the rem values ​​of each reconstructed quantization coefficient sequentially according to the preset scan order.

[0201] In another possible implementation, the method may further include:

[0202] Determine the coefficient block and the preset scanning order of the coefficient block; wherein, the coefficient block includes at least one quantization coefficient position to be decoded;

[0203] According to the preset scanning order, the values ​​of non-zero identifier information corresponding to at least one quantization coefficient position to be decoded are obtained sequentially by parsing the bit stream;

[0204] According to the preset scanning order, the values ​​of X preset identifier information corresponding to at least one quantization coefficient position to be decoded are obtained sequentially by parsing the bit stream;

[0205] According to the preset scanning order, the remaining value of the absolute value of the reconstructed quantization coefficient corresponding to at least one position of the quantization coefficient to be decoded is obtained by parsing the bit stream.

[0206] Based on the values ​​of non-zero identifier information, the values ​​of X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient, determine the absolute value of the reconstructed quantization coefficient corresponding to at least one position of the quantization coefficient to be decoded.

[0207] It should be noted that this implementation method uses the AVS standard as an example. In AVS, the decoding order is as follows: first, decode the sig of each reconstructed quantization coefficient absolute value sequentially according to the preset scan order; then, decode gt1 and gt2 of each reconstructed quantization coefficient absolute value sequentially according to the preset scan order; and finally, decode rem of each reconstructed quantization coefficient absolute value sequentially according to the preset scan order. In the embodiment of this application, the decoding order of the above process is as follows: first, decode the sig of each reconstructed quantization coefficient absolute value sequentially according to the preset scan order; then, decode gt1, gt2, gt3, and gt4 of each reconstructed quantization coefficient absolute value sequentially according to the preset scan order; and finally, decode rem of each reconstructed quantization coefficient absolute value sequentially according to the preset scan order.

[0208] In addition, in some embodiments, the method may further include:

[0209] After dequantizing all the reconstruction quantization coefficients of the decoded block, the reconstruction transform block is determined based on the obtained reconstruction transform coefficients.

[0210] The reconstruction transform block is subjected to inverse transformation to obtain the reconstruction residual block.

[0211] Furthermore, in some embodiments, the method may further include:

[0212] Parse the bitstream to obtain prediction mode parameters;

[0213] The current block is predicted using the prediction mode parameters to obtain the predicted block of the decoded block;

[0214] The reconstruction block of the decoding block is determined based on the reconstructed residual block and the prediction block.

[0215] It should be noted that after dequantizing all reconstructed quantization coefficients of the decoded block, the resulting reconstructed transform coefficients can be assembled into a reconstructed transform block with a size parameter of M1×M2. Then, performing an inverse transform on this reconstructed transform block yields the reconstructed residual block. This inverse transform is the reverse process of the transform process in the encoder. It is important to note that if some coefficients were not transformed during the encoder's transform process, then those coefficients do not need to undergo inverse transform processing.

[0216] In short, the quantization coefficients, referred to as levels below, are provided in this application embodiment as a new entropy encoding method for quantized levels, which specifically improves the encoding method for quantized levels. Here, the scanning method for quantized levels is not specifically limited; diagonal, zigzag, horizontal, vertical, 4×4 sub-block scanning, or any other scanning method are all valid scanning methods.

[0217] The level coding in this application mainly includes the following four parts:

[0218] The first part is the non-zero flag for the level (denoted by sig), which indicates whether the level is a non-zero coefficient.

[0219] The second part is a level absolute value greater than X flag (denoted by gtx), used to indicate whether the level is greater than X, where X is a natural number greater than 0. This part contains at least one level absolute value greater than X flag; specifically, in the embodiments of this application, it may include: a level absolute value greater than 1 flag (denoted by gt1), a level absolute value greater than 2 flag (denoted by gt2), a level absolute value greater than 3 flag (denoted by gt3), and a level absolute value greater than 4 flag (denoted by gt4).

[0220] The third part is the residual value of the level absolute value (denoted by rem), and the order k of the exponential Golomb code used to encode this residual value can be flexibly adjusted according to the level flag. In the embodiments of this application, the value of k can be 1, that is, a first-order exponential Golomb code is used, denoted by EGK(1).

[0221] The fourth part is the level sign flag (represented by coeff_sign), which is used to indicate the positive or negative nature of the level.

[0222] Furthermore, in the embodiments of the application, the encoding method of the level absolute value is shown in Table 3.

[0223] Table 3

[0224]

[0225] In Table 3, |q k | represents the absolute value of the level; sig represents the non-zero flag, i.e., non-zero identification information; gt1 indicates whether the absolute value of the level is greater than 1; gt2 indicates whether the absolute value of the level is greater than 2; gt3 indicates whether the absolute value of the level is greater than 3; gt4 indicates whether the absolute value of the level is greater than 4; rem represents the remaining value of the absolute value of the level. The calculation method for the absolute value of the level is as follows:

[0226] |q k |=sig+gt1+gt2+gt3+gt4+rem (1)

[0227] In the CABAC process, sig can use a single context model, namely the first context model described in this application embodiment; gt1 and gt2 can share a single context model, namely the second first context model described in this application embodiment; and gt3 and gt4 can share a single context model, namely the second second context model described in this application embodiment. The number of each context model is not specifically limited, nor is the method for determining the index number of the context model specifically limited. This application embodiment defaults to determining the index number of the context model according to existing solutions in related technologies.

[0228] In a specific example, the method of this application embodiment is implemented in the decoder as follows:

[0229] First, the decoder acquires the bitstream information and parses the current decoding block. It parses levels according to a preset scan order. Second, after determining the position of the quantization coefficient to be decoded, the decoder begins decoding the current coefficient. The specific process is as follows:

[0230] The first step is to parse the non-zero flag bit sig at the parsing level. The first context model is selected for decoding, and the index number of the context model is determined based on the position of the coefficients and previously decoded coefficient information. The context model is then determined based on this index number, and the bitstream is parsed according to CABAC mode.

[0231] The second step is to skip to the third step if sig is 1; otherwise, skip to the eleventh step.

[0232] The third step is to resolve the flag gt1 indicating that the absolute value of the resolution level is greater than 1. Then, select the second context model for decoding and determine the index number of the context model based on the position of the coefficients and previously decoded coefficient information. Use this index number to determine the context model and parse the bitstream according to CABAC mode.

[0233] Fourth step: If gt1 is 1, skip to the fifth step; otherwise, skip to the eleventh step.

[0234] Fifth, resolve the flag gt2 indicating that the absolute value of the parsing level is greater than 2. Select the second context model for decoding, and determine the index number of the context model based on the position of the coefficients and the previously decoded coefficient information. Determine the context model based on this index number, and parse the bitstream according to CABAC mode.

[0235] Step 6: If gt2 is 1, skip to step 5; otherwise, skip to step 11.

[0236] Step 7: Set the absolute value of the parsing level to greater than 3 (gt3). Select the second context model for decoding, and determine the index number of the context model based on the position of the coefficients and previously decoded coefficient information. Use this index number to determine the context model and parse the bitstream according to CABAC mode.

[0237] Step 8: If gt3 is 1, skip to step 5; otherwise, skip to step 11.

[0238] Step 9: Set the absolute value of the parsing level to greater than 4 (gt4). Select the second context model for decoding, and determine the index number of the context model based on the position of the coefficients and the previously decoded coefficient information. Determine the context model based on this index number, and parse the bitstream according to CABAC mode.

[0239] Step 10: If gt4 is 1, use the first-order exponential Columbus decoding algorithm to resolve the residual value rem of the level absolute value; otherwise, jump to step 11.

[0240] Step 11: Derive the absolute value of the level based on the decoding results above. Then, determine the position of the next quantization coefficient to be decoded according to the scanning order.

[0241] It should be noted that the order of the above processes is relative, and the actual order may be adjusted according to specific standards. Specifically, in the VVC standard, the decoding order is to first decode the absolute values ​​of each level (sig, gt1, par, gt3) sequentially according to the scan order; then decode the absolute values ​​of each level (rem) sequentially according to the scan order. In this embodiment, the decoding order is to first decode the absolute values ​​of each level (sig, gt1, gt2, gt3, gt4) sequentially according to the scan order; then decode the absolute values ​​of each level (rem) sequentially according to the scan order. In the AVS standard, the decoding order is to first decode the absolute values ​​of each level (sig) sequentially according to the scan order; then decode the absolute values ​​of each level (gt1, gt2) sequentially according to the scan order; finally decode the absolute values ​​of each level (rem) sequentially according to the scan order. In this embodiment, the decoding order is to first decode the absolute values ​​of each level (sig) sequentially according to the scan order; then decode the absolute values ​​of each level (gt1, gt2, gt3, gt4) sequentially according to the scan order; finally decode the absolute values ​​of each level (rem) sequentially according to the scan order.

[0242] It should also be noted that the second context model used by gt3 and gt4 can completely correspond to the second context model used by gt1 and gt2. In other words, at this point, it is equivalent to gt1, gt2, gt3, and gt4 all using the same second context model. In addition, the first-order exponential Golomb code mentioned above can also be of order zero, second, third, etc., and can be preset or flexibly adjusted to other orders.

[0243] It should also be noted that the coefficient entropy coding in this application embodiment is not specifically targeted at any particular video coding standard, but rather is a universal coefficient entropy coding method. Thus, because this application embodiment provides a new coefficient entropy coding method that introduces gt3 and gt4 identification information, constructs a corresponding context model, and adjusts the corresponding residual value encoding / decoding method based on this model, it improves upon the original transform coefficient entropy coding method. This allows for better utilization of the characteristics of adaptive coding, effectively saving bitrate and thereby improving overall encoding and decoding performance.

[0244] Furthermore, the technical solutions of this application embodiment can also be extended to other standards, such as MPEG, AOM, or any custom coefficient entropy coding method.

[0245] This application provides a method for decoding coefficients, applied to a decoder. Based on the position of the quantization coefficient to be decoded, the bitstream is parsed using an adaptive binary arithmetic coding mode of a first context model to obtain the value of non-zero identifier information; if the value of the non-zero identifier information is a first value, the bitstream is parsed using an adaptive binary arithmetic coding mode of a second context model to obtain the values ​​of X preset identifier information; where X is a natural number greater than zero; if the value of the Xth preset identifier information is a first value, the target order of the exponential Golomb code is determined, and the bitstream is parsed using the exponential Golomb decoding algorithm of the target order to obtain the remaining value of the absolute value of the reconstructed quantization coefficient; where the target order is an integer greater than zero; based on the value of the non-zero identifier information, the values ​​of the X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient, the absolute value of the reconstructed quantization coefficient corresponding to the quantization coefficient position is determined. In this way, by making full use of the statistical characteristics between the quantization coefficients at each position, not only is the newly introduced preset identification information entropy encoded through the context model, but the encoding mode is also adjusted according to the absolute residual value of the quantization coefficient. This allows for better utilization of adaptive encoding characteristics during the encoding and decoding process, thereby saving bit rate and improving encoding and decoding performance.

[0246] In another embodiment of this application, see Figure 7 This illustrates a flowchart of a coefficient encoding method provided in an embodiment of this application. Figure 7 As shown, the method may include:

[0247] S701: Determine the quantization coefficients to be encoded.

[0248] S702: Determine the value of the non-zero identifier information based on the quantization coefficient, and entropy encode the value of the non-zero identifier information using the adaptive binary arithmetic coding mode of the first context model.

[0249] S703: When the value of the non-zero identifier information is the first value, the values ​​of X preset identifier information are determined according to the quantization coefficient, and the values ​​of the X preset identifier information are sequentially entropy encoded using the adaptive binary arithmetic encoding mode of the second context model; where X is a natural number greater than zero.

[0250] S704: When the value of the Xth preset identifier information is the first value, determine the absolute value of the quantization coefficient and the target order of the exponential Golomb code, and use the exponential Golomb coding algorithm of the target order to entropy encode the absolute value of the quantization coefficient.

[0251] S705: Writes the encoded bit information into the bit stream.

[0252] It should be noted that the encoding method in this application embodiment is mainly applied to the encoder. Specifically, based on Figure 2 The encoder 100 shown in the embodiment of this application has an encoding method applied to the "entropy encoding unit 115" part of the encoder 100. For the entropy encoding unit 115, an adaptive binary arithmetic encoding mode based on the context model can be used to entropy encode the quantization coefficients, and then the exponential Golomb encoding algorithm of the target order can be used to entropy encode the absolute value residue of the quantization coefficients.

[0253] It should also be noted that video encoding, as commonly referred to in video standards, can include both encoding and decoding. Therefore, video encoding includes encoding methods on the encoder side and decoding methods on the decoder side. This application describes the encoding methods on the encoder side.

[0254] In this application embodiment, an entropy encoding method for the quantized coefficients obtained after quantization is mainly proposed. Here, there are no specific restrictions on the scanning method of the quantized coefficients. For example, diagonal, zigzag, horizontal, vertical, 4×4 sub-block scanning or any other scanning method are all valid scanning methods.

[0255] Specifically, after intra-frame or inter-frame prediction processing, the video signal yields the residual of the block to be decoded. This residual signal may be further transformed to obtain transform coefficients (or simply "coefficients"). For ease of description, both the untransformed and transformed residual signals can be collectively referred to as transform coefficients. For effective compression, the transform coefficients also need to be quantized. Quantization is typically used to reduce the dynamic range of the transform coefficients, thereby achieving the goal of representing video with fewer codewords. The quantized value can be called a "quantization coefficient," and is also commonly referred to as a level, quantization level, or quantization grade. Quantization is usually performed by dividing the transform coefficient by the quantization step size, which is determined by the quantization factor transmitted in the bitstream.

[0256] In some embodiments, after determining the quantization coefficients to be encoded, the method may further include:

[0257] If the quantization coefficient is non-zero, then the value of the non-zero identifier information is determined to be the first value;

[0258] If the quantization coefficient is zero, then the value of the non-zero identifier information is determined to be the second value.

[0259] In the embodiments of this application, the first value can be 1, and the second value can be 0.

[0260] It should be noted that in another specific example, the first value can also be set to true, and the second value can also be set to false. Even in yet another specific example, the first value can be set to 0, and the second value can also be set to 1; or, the first value can be set to false, and the second value can also be set to true. No specific limitations are imposed here.

[0261] Furthermore, the method may also include: when the non-zero identifier information takes the second value, writing the encoded bit information into the bit stream.

[0262] In other words, taking a first value of 1 and a second value of 0 as an example, if the quantization coefficient is non-zero, then the value of the non-zero identifier information can be determined to be 1. At this point, it is necessary to continue to determine other identifier information (such as the values ​​of X preset identifier information). If the quantization coefficient is zero, then the value of the non-zero identifier information can be determined to be 0, which means that the encoding of the quantization coefficient is complete. After writing the encoded bit information into the bit stream, the next quantization coefficient to be encoded can be determined.

[0263] It should also be noted that the values ​​of the X preset identifiers can be represented by the i-th preset identifier, where i is a natural number greater than zero and less than or equal to X. Here, the i-th preset identifier can be represented by gti, and it is used to indicate whether the absolute value of the quantization coefficient is greater than i. In some embodiments, determining the values ​​of the X preset identifiers based on the quantization coefficient may include:

[0264] If the absolute value of the quantization coefficient is greater than i, then the value of the i-th preset identifier information is determined to be the first value;

[0265] If the absolute value of the quantization coefficient is less than or equal to i, then the value of the i-th preset identifier information is determined to be the second value.

[0266] In other words, taking a first value of 1 and a second value of 0 as an example, if the absolute value of the quantization coefficient is greater than i, then the value of the i-th preset identifier information can be determined to be 1, and in this case, the value of the (i+1)-th preset identifier information needs to be determined. If the absolute value of the quantization coefficient is less than or equal to i, then the value of the i-th preset identifier information can be determined to be 0, and in this case, the value of the (i+1)-th preset identifier information will not be determined.

[0267] Specifically, when i equals X, for the Xth preset identifier information, determining the value of the X preset identifier information based on the quantization coefficient may include: if the absolute value of the quantization coefficient is greater than X, then the value of the Xth preset identifier information is determined to be a first value; if the absolute value of the quantization coefficient is less than or equal to X, then the value of the Xth preset identifier information is determined to be a second value.

[0268] Thus, in some embodiments, after determining the value of the Xth preset identifier information, the method may further include: if the value of the Xth preset identifier information is a second value, writing the encoded bit information into the code stream.

[0269] In other words, taking a first value of 1 and a second value of 0 as an example, if the absolute value of the quantization coefficient is greater than X, then the value of the Xth preset identifier information can be determined to be 1. At this point, it is necessary to further determine the absolute value remainder of the quantization coefficient and the target order of the exponential Golomb code so that the exponential Golomb coding algorithm of the target order can be used to entropy encode the absolute value remainder of the quantization coefficient. If the absolute value of the quantization coefficient is less than or equal to X, then the value of the Xth preset identifier information can be determined to be 0, meaning that it is no longer necessary to determine the absolute value remainder of the quantization coefficient and the target order of the exponential Golomb code. The encoding of this quantization coefficient is completed. After writing the encoded bit information into the bit stream, the next quantization coefficient to be encoded can be determined.

[0270] It should also be noted that when the value of the Xth preset identifier information is the first value, it is necessary to determine the target order of the exponential Golomb code. In one possible implementation, determining the target order of the exponential Golomb code may include setting the value of the target order to a fixed constant greater than zero.

[0271] In one specific example, the target order is set to 1.

[0272] It should be noted that, assuming the target order can be represented by k, the exponential Golomb code of the target order can be denoted as EGK(k), where k is a positive integer. For example, a first-order exponential Golomb code can be represented by EGK(1).

[0273] Furthermore, regarding the target order, in related technologies, the target order is zero. However, in the embodiments of this application, the target order can be 1st, 2nd, 3rd, etc. That is, the value of the target order can be a pre-set fixed constant, such as 1, 2, 3, etc. Typically, the target order is 1st, which means that the 1st-order exponential Golomb coding algorithm can be used for entropy coding, thereby obtaining the absolute residual value of the quantization coefficients.

[0274] It should also be noted that the target order can be flexibly adjusted during the encoding and decoding process. In another possible implementation, determining the target order of the exponential Golomb code may include:

[0275] Determine the mode identifier information used for the quantization coefficients;

[0276] Based on the pattern identification information, the target order of the exponential Golomb code is determined.

[0277] In a specific example, determining the target order of the exponential Golomb code based on the pattern identification information may include:

[0278] If the mode identification information indicates the use of the transform skip mode, then the value of the target order is determined to be 1;

[0279] If the mode identification information indicates that the transform skip mode is not used, then the target order is determined to be set to 0.

[0280] It should be noted that the target order can be determined based on other identification information, such as pattern identification information. In the encoder, the pattern identification information used by the quantization coefficients to be encoded can be determined based on the coding block; then, based on this pattern identification information, the target order of the exponential Golomb code can be determined.

[0281] For example, assume that the pattern identifier information is used to indicate whether a transform skip mode is used. Thus, after determining the pattern identifier information used, if the pattern identifier information indicates the use of a transform skip mode, then the target order can be set to 1, i.e., the 1st order exponential Golomb coding algorithm is used to entropy encode the absolute value of the remaining quantization coefficient; if the pattern identifier information indicates that a transform skip mode is not used, then the target order can be set to 0, i.e., the 0th order exponential Golomb coding algorithm is used to entropy encode the absolute value of the remaining quantization coefficient.

[0282] In other words, the target order can be a fixed constant set in advance, or it can be flexibly adjusted during the encoding process, such as determining how to adjust the target order based on other identification information; the embodiments of this application do not make specific limitations.

[0283] Thus, after determining the target order of the exponential Golomb code, the absolute residual value of the quantization coefficient can be calculated based on the values ​​of the quantization coefficient, the non-zero identifier information, and the values ​​of X preset identifier information. Then, the absolute residual value of the quantization coefficient is entropy encoded using the exponential Golomb coding algorithm of the target order.

[0284] Furthermore, in this embodiment of the application, for the X preset identifier information, in a specific example, the value of X can be equal to 4. Thus, the four preset identifier information may include: a first preset identifier information, a second preset identifier information, a third preset identifier information, and a fourth preset identifier; wherein,

[0285] The first preset identification information is used to indicate whether the absolute value of the quantization coefficient is greater than 1;

[0286] The second preset identification information is used to indicate whether the absolute value of the quantization coefficient is greater than 2;

[0287] The third preset identification information is used to indicate whether the absolute value of the quantization coefficient is greater than 3;

[0288] The fourth preset identification information is used to indicate whether the absolute value of the quantization coefficient is greater than 4.

[0289] In a specific example, determining the values ​​of X preset identifier information based on the quantization coefficient may include:

[0290] If the absolute value of the quantization coefficient is greater than 1, then the value of the first preset identifier information is determined to be the first value;

[0291] If the absolute value of the quantization coefficient is less than or equal to 1, then the value of the first preset identifier information is determined to be the second value; and

[0292] If the absolute value of the quantization coefficient is greater than 2, then the value of the second preset identification information is determined to be the first value;

[0293] If the absolute value of the quantization coefficient is less than or equal to 2, then the value of the second preset identifier information is determined to be the second value; and

[0294] If the absolute value of the quantization coefficient is greater than 3, then the value of the third preset identification information is determined to be the first value;

[0295] If the absolute value of the quantization coefficient is less than or equal to 3, then the value of determining the third preset identifier information is the second value; and

[0296] If the absolute value of the quantization coefficient is greater than 4, then the value of the fourth preset identification information is determined to be the first value;

[0297] If the absolute value of the quantization coefficient is less than or equal to 4, then the value of the fourth preset identifier information is the second value.

[0298] It should be noted that the first preset identifier information can be represented by gt1, the second preset identifier information can be represented by gt2, the third preset identifier information can be represented by gt3, and the fourth preset identifier information can be represented by gt4.

[0299] It should also be noted that gt1, gt2, gt3, and gt4 can use the same set of context models, or gt1 and gt2 can share a set of context models, and gt3 and gt4 can share a set of context models; the embodiments of this application do not impose specific limitations.

[0300] In some embodiments, if gt1, gt2, gt3, and gt4 can use the same context model (i.e., the second context model), then the step of using the adaptive binary arithmetic coding mode of the second context model to sequentially entropy encode the values ​​of the X preset identifier information may include:

[0301] The values ​​of the first preset identifier information, the second preset identifier information, the third preset identifier information, and the fourth preset identifier information are sequentially entropy encoded using the adaptive binary arithmetic encoding mode of the second context model.

[0302] In some embodiments, the second context model may include a second first context model and a second second context model. If gt1 and gt2 share a common context model (i.e., the second first context model), and gt3 and gt4 share a common context model (i.e., the second second context model), then the step of using the adaptive binary arithmetic encoding mode of the second context model to sequentially entropy encode the values ​​of the X preset identifier information may include:

[0303] The values ​​of the first preset identifier information and the second preset identifier information are sequentially entropy encoded using the adaptive binary arithmetic encoding mode of the second context model;

[0304] The values ​​of the third preset identifier information and the fourth preset identifier information are sequentially entropy encoded using the adaptive binary arithmetic encoding mode of the second two-context model.

[0305] In other words, in one specific example, the first context model, the second first context model, and the second second second context model are different. That is, non-zero identifier information can use one set of context models (i.e., the first context model), gt1 and gt2 share one set of context models (i.e., the second first context model), and gt3 and gt4 share one set of context models (i.e., the second second second context model). Alternatively, in another specific example, the second first context model and the second second second context model are completely corresponding; that is, gt1, gt2, gt3, and gt4 can share one set of context models (i.e., the second context model).

[0306] It is important to note that there is no specific limit to the number of context models in each set, nor is there a specific limit to the method for determining the index number of the context models. Typically, existing solutions in related technologies can be used to determine the index number of the context models by default.

[0307] Furthermore, if the absolute value of the quantization coefficient is greater than 4, then on the one hand, it can be determined that the value of gt4 is equal to 1, and on the other hand, it can be determined that there must still be a residual absolute value of the quantization coefficient. In some embodiments, when the value of the Xth preset identifier information is the first value, determining the residual absolute value of the quantization coefficient and the target order of the exponential Golomb code may include:

[0308] When the value of the fourth preset identifier information is the first value, the absolute value of the quantization coefficient and the target order of the exponential Golomb code are determined, so as to perform the step of entropy encoding of the absolute value of the quantization coefficient using the exponential Golomb coding algorithm of the target order.

[0309] In one specific example, determining the absolute residual value of the quantization coefficient may include:

[0310] The absolute value of the quantization coefficient is used to subtract the values ​​of the non-zero identifier information, the first preset identifier information, the second preset identifier information, the third preset identifier information, and the fourth preset identifier information to obtain the remaining absolute value of the quantization coefficient.

[0311] It should be noted that when the fourth preset identifier information takes the first value, specifically when gt4 equals 1, then the absolute value of the quantization coefficient (using |q) is used. k | represents the absolute value of the quantization coefficients (denoted by rem), and the values ​​of sig, gt1, gt2, gt3, and gt4 are used to determine the absolute residual value of the quantization coefficients. The calculation method is as follows:

[0312] rem = |q k |-sig-gt1-gt2-gt3-gt4 (2)

[0313] Furthermore, embodiments of this application can also determine the value of the symbol identification information based on the quantization coefficients, used to determine the positive or negative characteristics of the quantization coefficients. In some embodiments, the method may further include:

[0314] The value of the symbol identification information is determined based on the quantization coefficient;

[0315] The absolute residual value of the quantization coefficient is entropy encoded using a bypass mode, and the encoded bit information is written into the bit stream.

[0316] In a specific example, determining the value of the symbol identification information based on the quantization coefficient may include:

[0317] If the quantization coefficient is negative, then the value of the symbol identification information is determined to be the first value;

[0318] If the quantization coefficient is positive, then the value of the symbol identification information is determined to be the second value.

[0319] Here, taking a first value of 1 and a second value of 0 as an example, if the quantization coefficient is negative, then it can be determined that the value of the symbol identification information is 1, and entropy encoding is performed on 1; if the quantization coefficient is positive, then it can be determined that the value of the symbol identification information is 0, and entropy encoding is performed on 0.

[0320] Furthermore, the order of the above encoding process is relative, and can be adjusted according to specific standards in actual situations. In one possible implementation, the method may further include:

[0321] Determine the coefficient blocks and the preset scanning order of the coefficient blocks; wherein, the coefficient block includes at least one quantization coefficient to be encoded;

[0322] According to the preset scanning order, the values ​​of the non-zero identifier information corresponding to the at least one quantization coefficient to be encoded and the values ​​of the X preset identifier information are sequentially entropy encoded;

[0323] According to the preset scanning order, the absolute value residue corresponding to the at least one quantization coefficient to be encoded is sequentially entropy encoded.

[0324] It should be noted that this implementation method uses the VVC standard as an example. In VVC, the encoding order in related technologies is to first entropy encode the sig, gt1, par, and gt3 corresponding to each quantization coefficient in a preset scanning order; then, entropy encode the rem corresponding to each quantization coefficient in the same preset scanning order. In the embodiment of this application, the encoding order of the above process is to first entropy encode the sig, gt1, gt2, gt3, and gt4 corresponding to each quantization coefficient in a preset scanning order; then, entropy encode the rem corresponding to each quantization coefficient in the same preset scanning order.

[0325] In another possible implementation, the method may further include:

[0326] Determine the coefficient block and the preset scan order of the coefficient block; wherein, the coefficient block includes at least one quantization coefficient to be encoded;

[0327] According to the preset scanning order, the values ​​of non-zero identifier information corresponding to at least one quantization coefficient to be encoded are sequentially entropy encoded;

[0328] According to the preset scanning order, the values ​​of X preset identifier information corresponding to at least one quantization coefficient to be encoded are sequentially entropy encoded;

[0329] According to the preset scanning order, the absolute residual values ​​corresponding to at least one quantization coefficient to be encoded are sequentially entropy encoded.

[0330] It should be noted that this implementation method uses the AVS standard as an example. In AVS, the encoding order is as follows: first, entropy encoding is performed on the sig corresponding to each quantization coefficient according to a preset scan order; then, entropy encoding is performed on gt1 and gt2 corresponding to each quantization coefficient according to a preset scan order; and finally, entropy encoding is performed on rem corresponding to each quantization coefficient according to a preset scan order. In the embodiment of this application, the encoding order of the above process is as follows: first, entropy encoding is performed on the sig corresponding to each quantization coefficient according to a preset scan order; then, entropy encoding is performed on gt1, gt2, gt3, and gt4 corresponding to each quantization coefficient according to a preset scan order; and finally, entropy encoding is performed on rem corresponding to each quantization coefficient according to a preset scan order.

[0331] It should also be noted that the preset scanning order can be diagonal, zigzag, horizontal, vertical, 4×4 sub-block scanning, or any other scanning order. This application embodiment does not specifically limit the order.

[0332] The encoding of the quantization coefficients in this application embodiment mainly includes the following four parts:

[0333] The first part is the non-zero flag of the quantization coefficient (denoted by sig), which is used to indicate whether the quantization coefficient is a non-zero coefficient.

[0334] The second part is a flag indicating whether the absolute value of the quantization coefficient is greater than X (denoted by gtx), used to indicate whether the quantization coefficient is greater than X, where X is a natural number greater than 0. This part contains at least one flag indicating that the absolute value of the quantization coefficient is greater than X; specifically, in the embodiments of this application, it may include: a flag indicating that the absolute value of the quantization coefficient is greater than 1 (denoted by gt1), a flag indicating that the absolute value of the quantization coefficient is greater than 2 (denoted by gt2), a flag indicating that the absolute value of the quantization coefficient is greater than 3 (denoted by gt3), and a flag indicating that the absolute value of the quantization coefficient is greater than 4 (denoted by gt4).

[0335] The third part is the absolute value of the quantization coefficient (represented by rem), and the order k of the exponential Golomb code used to encode this residual value can be flexibly adjusted according to the level flag. In the embodiments of this application, the value of k can be 1, that is, a first-order exponential Golomb code is used, represented by EGK(1).

[0336] The fourth part is the sign flag of the quantization coefficient (represented by coeff_sign), which is used to indicate the positive or negative sign of the quantization coefficient.

[0337] Furthermore, in the embodiments of the application, the absolute value encoding method of the quantization coefficients is as shown in Table 3 above. It should be noted that the absolute residual value (rem) of the quantization coefficients can be encoded using the exponential Golomb coding algorithm of the target order, the sign flag (coeff_sign) can be encoded using the bypass mode, and all other flags (such as sig, gt1, gt2, gt3, gt4, etc.) are encoded using the context-based adaptive binary arithmetic coding mode.

[0338] In addition, in some embodiments, prior to S701, the method may further include:

[0339] Determine the coded blocks in the video image and the prediction mode parameters of the coded blocks;

[0340] The predicted block is determined by using the predicted mode parameters to perform prediction processing on the coded block.

[0341] Based on the coded block and the prediction block, the residual block of the coded block is obtained;

[0342] The residual block is transformed and quantized to obtain the coefficient block of the coded block; wherein the coefficient block includes at least one quantization coefficient.

[0343] In this embodiment of the application, the method may further include: writing the prediction mode parameters into the bitstream.

[0344] It should be noted that the prediction mode parameters here are used to indicate the prediction mode adopted by the coding block, and different prediction modes correspond to different prediction mode parameters. The determination of the prediction mode parameters can be based on the magnitude of the distortion value or on the results of Rate Distortion Optimization (RDO), and this application embodiment does not impose any limitations. Generally, RDO can be used to determine the prediction mode parameters of the coding block. Specifically, in some embodiments, determining the prediction mode parameters of the coding block may include: precoding the coding block using multiple prediction modes to obtain the rate distortion cost values ​​corresponding to the multiple prediction modes; selecting the optimal rate distortion cost value from the obtained rate distortion cost values, and determining the prediction mode corresponding to the optimal rate distortion cost value as the prediction mode parameter of the coding block.

[0345] In other words, the encoder can employ multiple prediction modes to pre-encode the coded blocks. These multiple prediction modes typically include inter-frame prediction modes, traditional intra-frame prediction modes, and non-traditional intra-frame prediction modes. Traditional intra-frame prediction modes can include Direct Current (DC) mode, Planar mode, and angular intra-frame prediction mode, etc. Non-traditional intra-frame prediction modes can include MIP mode, Cross-component Linear Model Prediction (CCLM) mode, Intra Block Copy (IBC) mode, and PLT (Palette) mode, etc. Inter-frame prediction modes can include traditional inter-frame prediction modes and Geometrical Partitioning for Inter Blocks (GEO) mode, etc.

[0346] For example, after precoding the coded block using multiple prediction modes, the rate-distortion values ​​corresponding to these multiple prediction modes can be obtained. Then, the optimal rate-distortion value (typically the minimum rate-distortion value) is selected from the obtained rate-distortion values, and the prediction mode corresponding to this optimal rate-distortion value is determined as the prediction mode parameter of the coded block. In this way, the encoder uses the prediction mode indicated by the prediction mode parameter to predict and encode the coded block, resulting in a smaller prediction residual and improved coding efficiency. It is important to note that the prediction mode parameter needs to be written into the bitstream so that the decoder can obtain the prediction mode parameter by parsing the bitstream and then obtain the corresponding prediction block through prediction processing.

[0347] Furthermore, the transform block for the coded block can be obtained by subtracting the current block from the predicted block obtained using the prediction mode parameters to determine the residual block, and then transforming the residual block. Here, the residual block can undergo a complete two-dimensional transformation, a partial two-dimensional transformation, or even no two-dimensional transformation. In this embodiment, the block after transformation or without transformation is collectively referred to as the transform block. Then, the transform block is quantized to obtain the coefficient block of the coded block.

[0348] In this way, after obtaining the coefficient block of the coded block, entropy encoding can be performed on at least one quantization coefficient using a preset scanning order, and the encoded bit information can be written into the bit stream.

[0349] It should also be noted that the second context model used by gt3 and gt4 can completely correspond to the second context model used by gt1 and gt2. In other words, at this point, it is equivalent to gt1, gt2, gt3, and gt4 all using the same second context model. In addition, the first-order exponential Golomb code mentioned above can also be of order zero, second, third, etc., and can be preset or flexibly adjusted to other orders.

[0350] It should also be noted that the coefficient entropy coding in this application embodiment is not specifically targeted at any particular video coding standard, but rather is a universal coefficient entropy coding method. Thus, because this application embodiment provides a new coefficient entropy coding method that introduces gt3 and gt4 identification information, constructs a corresponding context model, and adjusts the corresponding residual value coding method based on this, it can improve the original transform coefficient entropy coding method, better utilize the characteristics of adaptive coding, effectively save bitrate, and thereby improve overall encoding and decoding performance.

[0351] Furthermore, the technical solutions of this application embodiment can also be extended to other standards, such as MPEG, AOM, or any custom coefficient entropy coding method.

[0352] Specifically, for encoding the absolute value remainder, the order of the exponential Golomb code encoding the absolute value remainder needs to be determined. This order can be preset to a fixed constant, such as 1, 2, 3, ..., etc. Alternatively, the order of the exponential Golomb code encoding the absolute value remainder can be flexibly adjusted during the encoding process. For example, the order can be adjusted based on other flag bits. A concrete example is that if the current coded block uses a transform skip mode, the absolute value remainder can be encoded using the 1st order exponential Golomb code algorithm; if the current coded block does not use a transform skip mode, the absolute value remainder can be encoded using the 0th order exponential Golomb code algorithm.

[0353] This application provides a coefficient encoding method applied to an encoder. The method involves: determining the quantization coefficient to be encoded; determining the value of non-zero identifier information based on the quantization coefficient, and entropy encoding the value of the non-zero identifier information using an adaptive binary arithmetic encoding mode of a first context model; when the value of the non-zero identifier information is a first value, determining the values ​​of X preset identifier information based on the quantization coefficient, and entropy encoding the values ​​of the X preset identifier information sequentially using an adaptive binary arithmetic encoding mode of a second context model; where X is a natural number greater than zero; when the value of the Xth preset identifier information is a first value, determining the absolute value residue of the quantization coefficient and the target order of the exponential Golomb code, and entropy encoding the absolute value residue of the quantization coefficient using an exponential Golomb code algorithm of the target order; and writing the encoded bit information into a bitstream. In this way, by making full use of the statistical characteristics between the quantization coefficients at each position, not only is the newly introduced preset identification information entropy encoded through the context model, but the encoding mode is also adjusted according to the absolute residual value of the quantization coefficient. This allows for better utilization of adaptive encoding characteristics during the encoding and decoding process, thereby saving bit rate and improving encoding and decoding performance.

[0354] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, see [link to previous embodiment]. Figure 8 This illustrates a schematic diagram of the composition structure of an encoder 80 provided in an embodiment of this application. Figure 8 As shown, the encoder 80 may include: a first determining unit 801, an entropy encoding unit 802, and a writing unit 803; wherein,

[0355] The first determining unit 801 is configured to determine the quantization coefficients to be encoded;

[0356] Entropy coding unit 802 is configured to determine the value of non-zero identifier information based on the quantization coefficient, and entropy code the value of non-zero identifier information using the adaptive binary arithmetic coding mode of the first context model; and when the value of non-zero identifier information is a first value, determine the values ​​of X preset identifier information based on the quantization coefficient, and entropy code the values ​​of the X preset identifier information sequentially using the adaptive binary arithmetic coding mode of the second context model; wherein X is a natural number greater than zero;

[0357] The entropy coding unit 802 is further configured to, when the value of the Xth preset identifier information is the first value, determine the absolute value of the quantization coefficient and the target order of the exponential Golomb code, and use the exponential Golomb coding algorithm of the target order to entropy code the absolute value of the quantization coefficient.

[0358] The writing unit 803 is configured to write the encoded bit information into the bit stream.

[0359] In some embodiments, the first determining unit 801 is further configured to determine the value of the non-zero identifier information as a first value if the quantization coefficient is non-zero, and to determine the value of the non-zero identifier information as a second value if the quantization coefficient is zero.

[0360] In some embodiments, the writing unit 803 is further configured to write the encoded bit information into the code stream when the value of the non-zero identifier information is a second value.

[0361] In some embodiments, the writing unit 803 is further configured to write the encoded bit information into the code stream when the value of the Xth preset identifier information is a second value.

[0362] In some embodiments, the first value is 1 and the second value is 0.

[0363] In some embodiments, the first determining unit 801 is further configured to set the value of the target order to a fixed constant greater than zero.

[0364] In some embodiments, the target order is set to 1.

[0365] In some embodiments, the first determining unit 801 is further configured to determine mode identification information used by the quantization coefficients; and to determine the target order of the exponential Golomb code based on the mode identification information.

[0366] In some embodiments, the first determining unit 801 is further configured to determine the target order as 1 if the mode identification information indicates that the transform skip mode is used, and to determine the target order as 0 if the mode identification information indicates that the transform skip mode is not used.

[0367] In some embodiments, the first determining unit 801 is further configured to determine the value of the Xth preset identification information as a first value if the absolute value of the quantization coefficient is greater than X; and to determine the value of the Xth preset identification information as a second value if the absolute value of the quantization coefficient is less than or equal to X.

[0368] In some embodiments, X is equal to 4, and the four preset identifiers include: a first preset identifier, a second preset identifier, a third preset identifier, and a fourth preset identifier; wherein, the first preset identifier is used to indicate whether the absolute value of the quantization coefficient is greater than 1; the second preset identifier is used to indicate whether the absolute value of the quantization coefficient is greater than 2; the third preset identifier is used to indicate whether the absolute value of the quantization coefficient is greater than 3; and the fourth preset identifier is used to indicate whether the absolute value of the quantization coefficient is greater than 4.

[0369] In some embodiments, the first determining unit 801 is further configured to: determine the value of the first preset identifier information as a first value if the absolute value of the quantization coefficient is greater than 1; determine the value of the first preset identifier information as a second value if the absolute value of the quantization coefficient is less than or equal to 1; determine the value of the second preset identifier information as a first value if the absolute value of the quantization coefficient is greater than 2; determine the value of the second preset identifier information as a second value if the absolute value of the quantization coefficient is less than or equal to 2; determine the value of the third preset identifier information as a first value if the absolute value of the quantization coefficient is greater than 3; determine the value of the third preset identifier information as a second value if the absolute value of the quantization coefficient is less than or equal to 3; determine the value of the third preset identifier information as a second value if the absolute value of the quantization coefficient is greater than 4; determine the value of the fourth preset identifier information as a first value if the absolute value of the quantization coefficient is less than or equal to 4.

[0370] In some embodiments, the entropy coding unit 802 is further configured to use the adaptive binary arithmetic coding mode of the second context model to sequentially entropy code the values ​​of the first preset identifier information, the second preset identifier information, the third preset identifier information, and the fourth preset identifier information.

[0371] In some embodiments, the second context model includes a second first context model and a second second context model; correspondingly, the entropy coding unit 802 is further configured to entropy code the value of the first preset identifier information and the value of the second preset identifier information in sequence using the adaptive binary arithmetic coding mode of the second first context model; and to entropy code the value of the third preset identifier information and the value of the fourth preset identifier information in sequence using the adaptive binary arithmetic coding mode of the second second context model.

[0372] In some embodiments, the first determining unit 801 is further configured to, when the value of the fourth preset identification information is a first value, determine the absolute value residual of the quantization coefficient and the target order of the exponential Golomb code, so as to perform the step of entropy encoding of the absolute value residual of the quantization coefficient using the exponential Golomb coding algorithm of the target order.

[0373] In some embodiments, see Figure 8 The encoder 80 may further include a first calculation unit 804, configured to perform subtraction calculations on the values ​​of non-zero identifier information, first preset identifier information, second preset identifier information, third preset identifier information, and fourth preset identifier information using the absolute value of the quantization coefficient, to obtain the remaining absolute value of the quantization coefficient.

[0374] In some embodiments, the first determining unit 801 is further configured to determine the value of the symbol identification information based on the quantization coefficient;

[0375] The entropy coding unit 802 is further configured to entropy code the absolute value residue of the quantization coefficient using a bypass mode;

[0376] The writing unit 803 is also configured to write the encoded bit information into the bit stream.

[0377] In some embodiments, the first determining unit 801 is further configured to determine the symbol identification information as a first value if the quantization coefficient is negative, and to determine the symbol identification information as a second value if the quantization coefficient is positive.

[0378] In some embodiments, the first determining unit 801 is further configured to determine a coefficient block and a preset scanning order of the coefficient block; wherein the coefficient block includes at least one quantization coefficient to be encoded;

[0379] The entropy encoding unit 802 is further configured to entropy encode the values ​​of the non-zero identifier information corresponding to the at least one quantization coefficient to be encoded and the values ​​of the X preset identifier information in sequence according to the preset scanning order; and to entropy encode the absolute value residue corresponding to the at least one quantization coefficient to be encoded in sequence according to the preset scanning order.

[0380] In some embodiments, the first determining unit 801 is further configured to determine a coefficient block and a preset scanning order of the coefficient block; wherein the coefficient block includes at least one quantization coefficient to be encoded;

[0381] The entropy encoding unit 802 is further configured to entropy encode the values ​​of the non-zero identifier information corresponding to the at least one quantization coefficient to be encoded in sequence according to the preset scanning order; and to entropy encode the values ​​of the X preset identifier information corresponding to the at least one quantization coefficient to be encoded in sequence according to the preset scanning order; and to entropy encode the absolute value residue corresponding to the at least one quantization coefficient to be encoded in sequence according to the preset scanning order.

[0382] Understandably, in the embodiments of this application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular one. Furthermore, the components in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit described above can be implemented in hardware or as a software functional module.

[0383] If the integrated unit is implemented as a software functional module and 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, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0384] Therefore, this application provides a computer storage medium applied to an encoder 80, the computer storage medium storing a computer program that, when executed by a first processor, implements the method described in any of the foregoing embodiments.

[0385] Based on the composition of the encoder 80 and the computer storage medium described above, see [link to documentation]. Figure 9 This illustrates a schematic diagram of the specific hardware structure of the encoder 80 provided in an embodiment of this application. Figure 9 As shown, it may include: a first communication interface 901, a first memory 902, and a first processor 903; the various components are coupled together through a first bus system 904. It is understood that the first bus system 904 is used to realize the connection and communication between these components. In addition to a data bus, the first bus system 904 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 9 The general designated all buses as the first bus system 904. Among them,

[0386] The first communication interface 901 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0387] The first memory 902 is used to store computer programs that can run on the first processor 903;

[0388] The first processor 903 is configured to, when running the computer program, perform:

[0389] Determine the quantization coefficients to be encoded;

[0390] The value of the non-zero identifier information is determined based on the quantization coefficient, and the value of the non-zero identifier information is entropy encoded using the adaptive binary arithmetic coding mode of the first context model.

[0391] When the non-zero identifier information takes the first value, the values ​​of X preset identifier information are determined according to the quantization coefficient, and the values ​​of the X preset identifier information are sequentially entropy encoded using the adaptive binary arithmetic encoding mode of the second context model; where X is a natural number greater than zero.

[0392] When the value of the Xth preset identifier information is the first value, the absolute value of the quantization coefficient and the target order of the exponential Golomb code are determined, and the absolute value of the quantization coefficient is entropy encoded using the exponential Golomb coding algorithm of the target order.

[0393] The encoded bit information is written into the bitstream.

[0394] It is understood that the first memory 902 in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate Synchronous DRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The first memory 902 of the system and method described in this application is intended to include, but is not limited to, these and any other suitable types of memory.

[0395] The first processor 903 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the first processor 903 or by instructions in software form. The first processor 903 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the first memory 902. The first processor 903 reads the information in the first memory 902 and, in conjunction with its hardware, completes the steps of the above method.

[0396] It is understood that the embodiments described in this application can be implemented using 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 (ASICs), digital signal processors (DSPs), DSP devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this application, or combinations thereof. For software implementation, the technology described in this application can be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in this application. Software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0397] Alternatively, as another embodiment, the first processor 903 is further configured to perform the method described in any of the foregoing embodiments when running the computer program.

[0398] This embodiment provides an encoder, which may include a first determining unit, an entropy encoding unit, and a writing unit. By fully utilizing the statistical characteristics between the quantization coefficients at various positions, it not only performs entropy encoding on newly introduced preset identification information through a context model, but also adjusts the encoding mode based on the absolute residual value of the quantization coefficients. This allows for better utilization of adaptive encoding characteristics during encoding and decoding, thereby saving bitrate and improving encoding and decoding performance.

[0399] In another embodiment of this application, based on the same inventive concept as the foregoing embodiments, see [link to previous embodiment]. Figure 10 This illustrates a schematic diagram of the composition structure of a decoder 100 provided in an embodiment of this application. Figure 10 As shown, the decoder 100 may include: a parsing unit 1001 and a second determining unit 1002; wherein,

[0400] The parsing unit 1001 is configured to parse the bitstream based on the position of the quantization coefficient to be decoded using the adaptive binary arithmetic coding mode of the first context model to obtain the value of the non-zero identifier information.

[0401] The parsing unit 1001 is further configured to, when the non-zero identifier information takes a first value, parse the bitstream using the adaptive binary arithmetic coding mode of the second context model to obtain the values ​​of X preset identifier information; wherein X is a natural number greater than zero; and when the Xth preset identifier information takes a first value, determine the target order of the exponential Golomb code, and parse the bitstream using the exponential Golomb decoding algorithm of the target order to obtain the residual value of the absolute value of the reconstructed quantization coefficient; wherein the target order is an integer greater than zero.

[0402] The second determining unit 1002 is configured to determine the absolute value of the reconstructed quantization coefficient corresponding to the position of the quantization coefficient based on the value of the non-zero identifier information, the value of the X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient.

[0403] In some embodiments, the second determining unit 1002 is further configured to determine the reconstructed quantization coefficient corresponding to the quantization coefficient position based on the value of the non-zero identifier information when the value of the non-zero identifier information is a second value.

[0404] In some embodiments, the second determining unit 1002 is further configured to determine the absolute value of the reconstructed quantization coefficient corresponding to the quantization coefficient position based on the value of the non-zero identifier information and the value of the X preset identifier information when the value of the X preset identifier information is a second value.

[0405] In some embodiments, the first value is 1 and the second value is 0.

[0406] In some embodiments, the second determining unit 1002 is further configured to set the value of the target order to a fixed constant greater than zero.

[0407] In some embodiments, the target order is set to 1.

[0408] In some embodiments, the second determining unit 1002 is further configured to determine mode identification information used to determine the position of the quantization coefficients to be decoded; and to determine the target order of the exponential Golomb code based on the mode identification information.

[0409] In some embodiments, the second determining unit 1002 is further configured to determine the target order as 1 if the mode identification information indicates that the transform skip mode is used; and to determine the target order as 0 if the mode identification information indicates that the transform skip mode is not used.

[0410] In some embodiments, X is equal to 4, and the four preset identifiers include: a first preset identifier, a second preset identifier, a third preset identifier, and a fourth preset identifier; wherein,

[0411] The first preset identification information is used to indicate whether the absolute value of the reconstructed quantization coefficient is greater than 1;

[0412] The second preset identification information is used to indicate whether the absolute value of the reconstructed quantization coefficient is greater than 2;

[0413] The third preset identification information is used to indicate whether the absolute value of the reconstructed quantization coefficient is greater than 3;

[0414] The fourth preset identification information is used to indicate whether the absolute value of the reconstruction quantization coefficient is greater than 4.

[0415] In some embodiments, the parsing unit 1001 is further configured to parse the bitstream using the adaptive binary arithmetic coding mode of the second context model to obtain the value of the first preset identifier information; and if the value of the first preset identifier information is a first value, then parse the bitstream using the adaptive binary arithmetic coding mode of the second context model to obtain the value of the second preset identifier information; and if the value of the second preset identifier information is a first value, then parse the bitstream using the adaptive binary arithmetic coding mode of the second context model to obtain the value of the third preset identifier information; and if the value of the third preset identifier information is a first value, then parse the bitstream using the adaptive binary arithmetic coding mode of the second context model to obtain the value of the fourth preset identifier information.

[0416] In some embodiments, the second context model includes a second first context model and a second second context model. Correspondingly, the parsing unit 1001 is further configured to parse the code stream using the adaptive binary arithmetic coding mode of the second first context model to obtain the value of the first preset identifier information; and if the value of the first preset identifier information is a first value, then parse the code stream using the adaptive binary arithmetic coding mode of the second first context model to obtain the value of the second preset identifier information; and if the value of the second preset identifier information is a first value, then parse the code stream using the adaptive binary arithmetic coding mode of the second second context model to obtain the value of the third preset identifier information; and if the value of the third preset identifier information is a first value, then parse the code stream using the adaptive binary arithmetic coding mode of the second second context model to obtain the value of the fourth preset identifier information.

[0417] In some embodiments, the second determining unit 1002 is further configured to determine the target order of the exponential Golomb code when the value of the fourth preset identification information is a first value, so as to perform the step of parsing the code stream using the exponential Golomb decoding algorithm of the target order and obtaining the remaining value of the absolute value of the reconstructed quantization coefficient.

[0418] In some embodiments, see Figure 10 The decoder 100 may further include a second calculation unit 1003, configured to perform addition calculations on the value of the non-zero identifier information, the value of the first preset identifier information, the value of the second preset identifier information, the value of the third preset identifier information, the value of the fourth preset identifier information, and the residual value of the absolute value of the reconstructed quantization coefficient, to obtain the absolute value of the reconstructed quantization coefficient corresponding to the position of the quantization coefficient.

[0419] In some embodiments, the parsing unit 1001 is further configured to parse the bitstream using a bypass mode to obtain the value of the symbol identification information;

[0420] The second determining unit 1002 is further configured to determine the reconstructed quantization coefficient corresponding to the position of the quantization coefficient based on the value of the symbol identification information and the absolute value of the reconstructed quantization coefficient.

[0421] In some embodiments, the second determining unit 1002 is further configured to determine the reconstruction quantization coefficient as negative if the value of the symbol identification information is a first value, and to determine the reconstruction quantization coefficient as positive if the value of the symbol identification information is a second value.

[0422] In some embodiments, the second determining unit 1002 is further configured to determine that if the value of the Xth preset identifier information is a first value, the absolute value of the reconstructed quantization coefficient is greater than X; and if the value of the Xth preset identifier information is a second value, the absolute value of the reconstructed quantization coefficient is less than or equal to X.

[0423] In some embodiments, the second determining unit 1002 is further configured to determine a coefficient block and a preset scanning order of the coefficient block; wherein the coefficient block includes at least one quantization coefficient position to be decoded;

[0424] The parsing unit 1001 is further configured to, according to the preset scanning order, sequentially obtain the value of the non-zero identifier information corresponding to the position of the at least one quantization coefficient to be decoded and the value of the X preset identifier information through the parsing bitstream; and sequentially obtain the remaining value of the reconstructed quantization coefficient absolute value corresponding to the position of the at least one quantization coefficient to be decoded through the parsing bitstream according to the preset scanning order.

[0425] The second determining unit 1002 is further configured to determine the absolute value of the reconstructed quantization coefficient corresponding to at least one position of the quantization coefficient to be decoded based on the value of the non-zero identifier information, the value of the X preset identifier information and the remaining value of the absolute value of the reconstructed quantization coefficient.

[0426] In some embodiments, the second determining unit 1002 is further configured to determine a coefficient block and a preset scanning order of the coefficient block; wherein the coefficient block includes at least one quantization coefficient position to be decoded;

[0427] The parsing unit 1001 is further configured to: sequentially obtain the values ​​of the non-zero identifier information corresponding to the position of the at least one quantization coefficient to be decoded through the parsing bitstream according to the preset scanning order; and sequentially obtain the values ​​of the X preset identifier information corresponding to the position of the at least one quantization coefficient to be decoded through the parsing bitstream according to the preset scanning order; and sequentially obtain the remaining values ​​of the reconstructed quantization coefficient absolute values ​​corresponding to the position of the at least one quantization coefficient to be decoded through the parsing bitstream according to the preset scanning order.

[0428] The second determining unit 1002 is further configured to determine the absolute value of the reconstructed quantization coefficient corresponding to at least one position of the quantization coefficient to be decoded based on the value of the non-zero identifier information, the value of the X preset identifier information and the remaining value of the absolute value of the reconstructed quantization coefficient.

[0429] Understandably, in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular component. Furthermore, the components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The integrated unit can be implemented in hardware or as a software functional module. If the integrated unit is implemented as a software functional 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, this embodiment provides a computer storage medium applied to the decoder 100, which stores a computer program that, when executed by a second processor, implements the method described in any of the foregoing embodiments.

[0430] Based on the composition of the decoder 100 and the computer storage medium described above, see [link to documentation]. Figure 11 This illustrates a schematic diagram of the specific hardware structure of the decoder 100 provided in an embodiment of this application. Figure 11 As shown, it may include: a second communication interface 1101, a second memory 1102, and a second processor 1103; the various components are coupled together via a second bus system 1104. It is understood that the second bus system 1104 is used to implement communication between these components. In addition to a data bus, the second bus system 1104 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in... Figure 11 The various buses are all labeled as the second bus system 1104. Among them,

[0431] The second communication interface 1101 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

[0432] The second memory 1102 is used to store computer programs that can run on the second processor 1103;

[0433] The second processor 1103 is configured to, when running the computer program, perform:

[0434] Based on the position of the quantization coefficients to be decoded, the bitstream is parsed using the adaptive binary arithmetic coding mode of the first context model to obtain the value of the non-zero identifier information.

[0435] When the non-zero identifier information takes the first value, the bitstream is parsed using the adaptive binary arithmetic coding mode of the second context model to obtain the values ​​of X preset identifier information; where X is a natural number greater than zero.

[0436] When the value of the Xth preset identifier information is the first value, the target order of the exponential Golomb code is determined, and the code stream is parsed using the exponential Golomb decoding algorithm of the target order to obtain the remaining value of the absolute value of the reconstructed quantization coefficient; wherein, the target order is an integer greater than zero;

[0437] Based on the values ​​of the non-zero identifier information, the values ​​of the X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient, the absolute value of the reconstructed quantization coefficient corresponding to the quantization coefficient position is determined.

[0438] Alternatively, as another embodiment, the second processor 1103 is also configured to perform the method described in any of the foregoing embodiments when running the computer program.

[0439] It is understood that the second memory 1102 has similar hardware functions to the first memory 902, and the second processor 1103 has similar hardware functions to the first processor 903; these will not be described in detail here.

[0440] This embodiment provides a decoder, which may include a parsing unit and a second determining unit. By fully utilizing the statistical characteristics between quantization coefficients at various positions, it not only performs entropy encoding on newly introduced preset identification information through a context model, but also adjusts the encoding mode based on the absolute residual value of the quantization coefficients. This allows for better utilization of adaptive encoding characteristics during encoding and decoding, thereby saving bitrate and improving encoding and decoding performance.

[0441] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0442] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0443] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0444] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0445] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.

[0446] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0447] Industrial applicability

[0448] In this embodiment, on the encoder side, the quantization coefficient to be encoded is first determined; then, the value of the non-zero identifier information is determined according to the quantization coefficient, and the value of the non-zero identifier information is entropy encoded using the adaptive binary arithmetic coding mode of the first context model; when the value of the non-zero identifier information is the first value, the values ​​of X preset identifier information are determined according to the quantization coefficient, and the values ​​of the X preset identifier information are entropy encoded sequentially using the adaptive binary arithmetic coding mode of the second context model; when the value of the Xth preset identifier information is the first value, the absolute value residue of the quantization coefficient and the target order of the exponential Golomb code are determined, and the absolute value residue of the quantization coefficient is entropy encoded using the exponential Golomb coding algorithm of the target order; finally, the encoded bit information is written into the bitstream. On the decoder side, firstly, based on the position of the quantization coefficient to be decoded, the bitstream is parsed using the adaptive binary arithmetic coding mode of the first context model to obtain the value of the non-zero identifier information. Then, with the non-zero identifier information value being the first value, the bitstream is parsed using the adaptive binary arithmetic coding mode of the second context model to obtain the values ​​of X preset identifier information. With the Xth preset identifier information value being the first value, the target order of the exponential Golomb code is determined, and the bitstream is parsed using the exponential Golomb decoding algorithm of the target order to obtain the remaining value of the reconstructed absolute value of the quantization coefficient. Finally, based on the value of the non-zero identifier information, the values ​​of the X preset identifier information, and the remaining value of the reconstructed absolute value of the quantization coefficient, the reconstructed absolute value of the quantization coefficient corresponding to the quantization coefficient position is determined. In this way, by fully utilizing the statistical characteristics between the quantization coefficients at each position, not only is the newly introduced preset identifier information entropy encoded through the context model, but the coding mode is also adjusted according to the remaining absolute value of the quantization coefficient. This allows for better utilization of adaptive coding characteristics during the encoding and decoding process, thereby saving bitrate and improving encoding and decoding performance.

Claims

1. A method for decoding coefficients, applied to a decoder, the method comprising: Based on the position of the quantization coefficients to be decoded, the bitstream is parsed using the adaptive binary arithmetic coding mode of the first context model to obtain the value of the non-zero identifier information. When the non-zero identifier information takes the first value, the bitstream is parsed using the adaptive binary arithmetic coding mode of the second context model to obtain the values ​​of X preset identifier information; where X is a natural number greater than zero. When the value of the Xth preset identifier information is the first value, the target order of the exponential Golomb code is determined, and the code stream is parsed using the exponential Golomb decoding algorithm of the target order to obtain the remaining value of the absolute value of the reconstructed quantization coefficient; wherein, the target order is an integer greater than zero; Based on the values ​​of the non-zero identifier information, the values ​​of the X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient, the absolute value of the reconstructed quantization coefficient corresponding to the quantization coefficient position is determined.

2. The method according to claim 1, wherein, The method further includes: When the non-zero identifier information takes the second value, the reconstructed quantization coefficient corresponding to the quantization coefficient position is determined based on the value of the non-zero identifier information; or, When the value of the Xth preset identifier information is the second value, the absolute value of the reconstructed quantization coefficient corresponding to the quantization coefficient position is determined based on the value of the non-zero identifier information and the value of the X preset identifier information.

3. The method according to claim 2, wherein, The first value is 1, and the second value is 0.

4. The method according to claim 1, wherein, Determining the target order of the exponential Golomb code includes setting the value of the target order to a fixed constant greater than zero.

5. The method according to claim 1, wherein, The determination of the target order of the exponential Columbus code includes: The mode identifier information used to determine the position of the quantization coefficient to be decoded; Based on the pattern identifier information, determine the target order of the exponential Golomb code. The step of determining the target order of the exponential Golomb code based on the pattern identifier information includes: If the mode identification information indicates the use of the transform skip mode, then the value of the target order is determined to be 1; If the mode identification information indicates that the transform skip mode is not used, then the target order is determined to be set to 0.

6. The method according to claim 1, wherein, The method further includes: The bypass mode is used to parse the bitstream and obtain the values ​​of the symbol identification information; Based on the value of the symbol identification information and the absolute value of the reconstructed quantization coefficient, the reconstructed quantization coefficient corresponding to the position of the quantization coefficient is determined. The method further includes: If the value of the symbol identification information is the first value, then the reconstruction quantization coefficient is determined to be negative; If the value of the symbol identification information is the second value, then the reconstruction quantization coefficient is determined to be positive.

7. The method according to claim 1, wherein, The method further includes: If the value of the Xth preset identifier information is the first value, then it is determined that the absolute value of the reconstructed quantization coefficient is greater than X; If the value of the Xth preset identifier information is the second value, then the absolute value of the reconstructed quantization coefficient is determined to be less than or equal to X.

8. The method according to any one of claims 1 to 7, wherein, The method further includes: Determine the coefficient block and the preset scanning order of the coefficient block; wherein, the coefficient block includes at least one quantization coefficient position to be decoded; According to the preset scanning order, the values ​​of the non-zero identifier information corresponding to the position of the at least one quantization coefficient to be decoded and the values ​​of the X preset identifier information are obtained sequentially by parsing the bit stream; According to the preset scanning order, the remaining values ​​of the absolute values ​​of the reconstructed quantization coefficients corresponding to the positions of at least one quantization coefficient to be decoded are obtained sequentially by parsing the bitstream; Based on the values ​​of the non-zero identifier information, the values ​​of the X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient, the absolute value of the reconstructed quantization coefficient corresponding to the position of the at least one quantization coefficient to be decoded is determined.

9. The method according to any one of claims 1 to 7, wherein, The method further includes: Determine the coefficient block and the preset scanning order of the coefficient block; wherein, the coefficient block includes at least one quantization coefficient position to be decoded; According to the preset scanning order, the values ​​of the non-zero identifier information corresponding to the position of the at least one quantization coefficient to be decoded are obtained sequentially by parsing the bit stream; According to the preset scanning order, the values ​​of the X preset identifier information corresponding to the position of the at least one quantization coefficient to be decoded are obtained sequentially by parsing the bit stream; According to the preset scanning order, the remaining values ​​of the absolute values ​​of the reconstructed quantization coefficients corresponding to the positions of at least one quantization coefficient to be decoded are obtained sequentially by parsing the bitstream; Based on the values ​​of the non-zero identifier information, the values ​​of the X preset identifier information, and the remaining value of the absolute value of the reconstructed quantization coefficient, the absolute value of the reconstructed quantization coefficient corresponding to the position of the at least one quantization coefficient to be decoded is determined.

10. A coefficient encoding method applied to an encoder, the method comprising: Determine the quantization coefficients to be encoded; The value of the non-zero identifier information is determined based on the quantization coefficient, and the value of the non-zero identifier information is entropy encoded using the adaptive binary arithmetic coding mode of the first context model. When the non-zero identifier information takes the first value, the values ​​of X preset identifier information are determined according to the quantization coefficient, and the values ​​of the X preset identifier information are sequentially entropy encoded using the adaptive binary arithmetic encoding mode of the second context model; where X is a natural number greater than zero. When the value of the Xth preset identifier information is the first value, the absolute value of the quantization coefficient and the target order of the exponential Golomb code are determined, and the absolute value of the quantization coefficient is entropy encoded using the exponential Golomb coding algorithm of the target order. The encoded bit information is written into the bitstream.

11. An encoder, the encoder comprising a first determining unit, an entropy encoding unit, and a writing unit; wherein, The first determining unit is configured to determine the quantization coefficients to be encoded; The entropy coding unit is configured to determine the value of the non-zero identifier information based on the quantization coefficient, and to entropy code the value of the non-zero identifier information using the adaptive binary arithmetic coding mode of the first context model. And when the non-zero identifier information takes the first value, the values ​​of X preset identifier information are determined according to the quantization coefficient, and the values ​​of the X preset identifier information are sequentially entropy encoded using the adaptive binary arithmetic encoding mode of the second context model; where X is a natural number greater than zero. The entropy coding unit is further configured to, when the value of the Xth preset identifier information is the first value, determine the absolute value of the quantization coefficient and the target order of the exponential Golomb code, and use the exponential Golomb coding algorithm of the target order to entropy code the absolute value of the quantization coefficient. The writing unit is configured to write the encoded bit information into the bit stream.