Encoding method, decoding method, and related apparatus
Patent Information
- Application Number
- PCT/CN2026/076053
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-07-10
- Filing Date
- 2026-01-30
- Publication Date
- 2026-09-03
Smart Images

Figure CN2026076053_03092026_PF_FP_ABST
Abstract
Description
Encoding methods, decoding methods and related devices
[0001] This application claims priority to Chinese patent applications filed on February 28, 2025, with application number 202510246569.4, entitled "Encoding Method, Decoding Method and Related Apparatus", and filed on July 10, 2025, with application number 202510956980.0, also entitled "Encoding Method, Decoding Method and Related Apparatus", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of image processing, and in particular to an encoding method, a decoding method, and related apparatus. Background Technology
[0003] Digital video capabilities can be applied to a wide variety of digital video devices, including digital television, digital live broadcasting systems, wireless broadcasting systems, personal digital assistants (PDAs), laptops or desktop computers, tablet computers, e-book readers, digital cameras, digital recording devices, digital media players, video game devices, video game consoles, cellular or satellite radio phones (i.e., "smartphones"), video conferencing devices, video streaming devices, and the like. Digital video devices implement video compression technologies, such as those described in standards defined by MPEG-2, MPEG-4, ITU-T H.263, ITU-T H.264 / MPEG-4 Part 10 Advanced Video Coding (AVC), the H.265 / HEVC video coding standard, and extensions to such standards. By implementing such video compression technologies, digital video devices can transmit, receive, encode, decode, and / or store digital video information more efficiently.
[0004] Current encoding and decoding technologies suffer from high complexity. Summary of the Invention
[0005] This application provides an encoding method, a decoding method, and related apparatus to improve the compression ratio while reducing the encoding and decoding complexity.
[0006] Firstly, this application provides an encoding method, comprising: obtaining a scanning result of a quantization coefficient block corresponding to a block to be encoded, wherein the quantization coefficient block includes N quantization coefficients, and the N quantization coefficients include non-zero quantization coefficients, where N is an integer greater than 1, and the scanning result is one-dimensional data; based on the position of a specific non-zero quantization coefficient in the scanning result, skipping L quantization coefficients in the scanning result, and encoding indication information corresponding to M quantization coefficients other than the L quantization coefficients, to obtain the bitstream of the image to be encoded; where M is an integer greater than or equal to 0, L is an integer greater than 0, and the sum of M and L is less than or equal to N, and the image to be encoded includes the block to be encoded. Thus, this application can skip the encoding process of the indication information of some quantization coefficients based on the position of a specific non-zero quantization coefficient, thereby reducing encoding and decoding complexity, improving encoding efficiency, and increasing decoding speed.
[0007] In one possible implementation, the scan result is obtained by scanning from the DC quantization coefficients of the quantization coefficient block to the last quantization coefficient of the quantization coefficient block, with the specific non-zero quantization coefficient being the last non-zero quantization coefficient scanned. In this way, the encoder and decoder agree on the same scan order, allowing the decoder to determine the position of each quantization coefficient within the quantization coefficient block based on the scan order.
[0008] In one possible implementation, based on the scan results, the encoded data of the block to be encoded is obtained, including: obtaining a regular stop position based on the position of a specific quantization coefficient in the scan results, where the regular stop position corresponds to the first quantization coefficient in the scan results; wherein: L quantization coefficients include quantization coefficients in the scan results before the first quantization coefficient, and M quantization coefficients include the first quantization coefficient, a specific non-zero quantization coefficient, and quantization coefficients between the first quantization coefficient and the specific non-zero quantization coefficient. Thus, this application determines the regular stop position based on the position of the last non-zero quantization coefficient to determine the stop position of the indication information that needs to be encoded using regular methods, thereby enabling the encoding of indication information that skips some quantization coefficients, reducing encoding / decoding complexity, improving encoding efficiency, and increasing decoding speed.
[0009] In one possible implementation, regular stop positions are obtained based on the positions of specific quantization coefficients in the scan result. This includes: obtaining regular stop positions based on the positions of specific quantization coefficients in the scan result and a regular stop position table. The regular stop position table includes N regular stop positions, each corresponding one-to-one with one of the N positions of the specific quantization coefficient in the scan result. In the N regular stop positions in the table, the preceding regular stop position is not greater than the following regular stop position, or the preceding regular stop position is not less than the following regular stop position. In this way, the encoder can determine which quantization coefficients do not require encoding indication information based on the position of the last non-zero quantization coefficient and the regular stop position table, thus skipping these quantization coefficients during encoding. This reduces encoding / decoding complexity, improves encoding efficiency, and increases decoding speed.
[0010] In one possible implementation, the bitstream also includes: encoded data of the residual values of the absolute values of L quantization coefficients; and encoded data of the residual values of the absolute values of M quantization coefficients.
[0011] In one possible implementation, the indication information includes at least one of the following: a syntax element indicating whether the absolute value of the corresponding quantization coefficient is greater than a first value; or a syntax element indicating whether the corresponding quantization coefficient is 0.
[0012] In one possible implementation, the first value is 1.
[0013] In one possible implementation, encoding the indication information corresponding to the M quantization coefficients (excluding the L quantization coefficients) includes: encoding the indication information corresponding to the M quantization coefficients using arithmetic coding. This arithmetic coding method effectively improves encoding efficiency.
[0014] In one possible implementation, the encoded data of the residual values of the absolute values of L quantization coefficients and the encoded data of the residual values of the absolute values of M quantization coefficients are obtained using variable-length coding (VLC). Thus, encoding the residual values of the absolute values using VLC encoding can effectively improve encoding efficiency.
[0015] In one possible implementation, the bitstream also includes position information for specific non-zero quantization coefficients, which indicates the position of the specific non-zero quantization coefficient in the scan result. Thus, by encoding the position information, the decoder can obtain the position of the last non-zero quantization coefficient.
[0016] In one possible implementation, the L quantization coefficients include a DC quantization coefficient. Thus, this application skips the encoding process of at least one quantization coefficient's indication information during encoding.
[0017] Secondly, this application provides a decoding method, comprising: acquiring a bitstream of an image to be decoded, the image to be decoded including a block to be decoded; decoding the bitstream to obtain position information of specific non-zero quantization coefficients, the position information indicating the position of the specific non-zero quantization coefficients in the scanning order; based on the position information, skipping L quantization coefficients in the scanning order, and decoding indication information corresponding to M quantization coefficients other than the L quantization coefficients; based on the indication information of the M quantization coefficients, decoding the bitstream to obtain M quantization coefficients; decoding the bitstream to obtain L quantization coefficients; based on the M quantization coefficients and L quantization coefficients, obtaining a quantization coefficient block of the block to be decoded; wherein: the quantization coefficient block includes N quantization coefficients, and the N quantization coefficients include non-zero quantization coefficients, N is an integer greater than 1, M is an integer greater than or equal to 0, L is an integer greater than 0, and the sum of M and L is less than or equal to N; and acquiring reconstructed data of the block to be decoded based on the quantization coefficient block. In this way, this application can skip the encoding process of the indication information of some quantization coefficients based on the position of specific non-zero quantization coefficients, thereby reducing the encoding and decoding complexity, improving encoding efficiency, and increasing decoding speed.
[0018] In one possible implementation, the scanning order is from the DC quantization coefficients of the quantization coefficient block to the last quantization coefficient of the quantization coefficient block, and the specific non-zero quantization coefficient is the last non-zero quantization coefficient in the scanning order.
[0019] In one possible implementation, decoding the indication information corresponding to the M quantization coefficients other than the L quantization coefficients includes: obtaining a regular stop position based on position information, the regular stop position corresponding to the first quantization coefficient in the scanning sequence; wherein: the L quantization coefficients include the quantization coefficients in the scanning result before the first quantization coefficient, and the M quantization coefficients include the first quantization coefficient, a specific non-zero quantization coefficient, and the quantization coefficients between the first quantization coefficient and the specific non-zero quantization coefficient.
[0020] In one possible implementation, obtaining the regular stop position based on the location information includes: obtaining the regular stop position based on the location information and a regular stop position table, wherein the regular stop position table includes N regular stop positions, and the N regular stop positions correspond one-to-one with the N positions of a specific quantization coefficient in the scanning sequence, and the preceding regular stop position in the N regular stop positions in the regular stop position table is not greater than the following regular stop position, or the preceding regular stop position in the N regular stop positions in the regular stop position table is not less than the following regular stop position.
[0021] In one possible implementation, the indication information includes at least one of the following: a syntax element indicating whether the absolute value of the corresponding quantization coefficient is greater than a first value; or a syntax element indicating whether the corresponding quantization coefficient is 0.
[0022] In one possible implementation, the first value is 1.
[0023] In one possible implementation, decoding the indication information corresponding to the M quantization coefficients (excluding the L quantization coefficients) includes: decoding the bitstream using arithmetic coding to obtain the indication information corresponding to the M quantization coefficients.
[0024] In one possible implementation, decoding the bitstream includes decoding the bitstream using variable-length encoding (VLC).
[0025] Thirdly, this application provides an encoding apparatus, comprising: an acquisition module, configured to acquire a scanning result of a quantization coefficient block corresponding to a block to be encoded, the quantization coefficient block comprising N quantization coefficients, wherein the N quantization coefficients include non-zero quantization coefficients, N being an integer greater than 1, and the scanning result being one-dimensional data; and an encoding module, configured to, based on the position of a specific non-zero quantization coefficient in the scanning result, skip L quantization coefficients in the scanning result, and encode indication information corresponding to M quantization coefficients other than the L quantization coefficients, to acquire a bitstream of an image to be encoded; M being an integer greater than or equal to 0, L being an integer greater than 0, and the sum of M and L being less than or equal to N, and the image to be encoded comprising a block to be encoded.
[0026] In one possible implementation, the scan result is obtained by scanning from the DC quantization coefficients of the quantization coefficient block to the last quantization coefficient of the quantization coefficient block, where the specific non-zero quantization coefficient is the last non-zero quantization coefficient scanned.
[0027] In one possible implementation, the acquisition module is specifically used to: acquire a regular stop position based on the position of a specific quantization coefficient in the scan result, the regular stop position corresponding to the first quantization coefficient in the scan result; wherein: L quantization coefficients include quantization coefficients in the scan result before the first quantization coefficient, and M quantization coefficients include the first quantization coefficient, a specific non-zero quantization coefficient, and quantization coefficients between the first quantization coefficient and the specific non-zero quantization coefficient.
[0028] Fourthly, this application provides a decoding apparatus, comprising: an acquisition module for acquiring a bitstream of an image to be decoded, the image to be decoded including a block to be decoded; a decoding module for: decoding the bitstream to obtain position information of specific non-zero quantization coefficients, the position information indicating the position of the specific non-zero quantization coefficients in the scanning order; based on the position information, skipping L quantization coefficients in the scanning order, and decoding indication information corresponding to M quantization coefficients other than the L quantization coefficients; based on the indication information of the M quantization coefficients, decoding the bitstream to obtain M quantization coefficients; decoding the bitstream to obtain L quantization coefficients; and based on the M quantization coefficients and L quantization coefficients, obtaining a quantization coefficient block of the block to be decoded; wherein: the quantization coefficient block includes N quantization coefficients, and the N quantization coefficients include non-zero quantization coefficients, N is an integer greater than 1, M is an integer greater than or equal to 0, L is an integer greater than 0, and the sum of M and L is less than or equal to N; and a reconstruction module for acquiring reconstructed data of the block to be decoded based on the quantization coefficient block.
[0029] In one possible implementation, the scanning order is from the DC quantization coefficients of the quantization coefficient block to the last quantization coefficient of the quantization coefficient block, and the specific non-zero quantization coefficient is the last non-zero quantization coefficient in the scanning order.
[0030] In one possible implementation, the decoding module is specifically used to: obtain a regular stop position based on position information, the regular stop position corresponding to the first quantization coefficient in the scanning sequence; wherein: L quantization coefficients include quantization coefficients in the scanning result before the first quantization coefficient, and M quantization coefficients include the first quantization coefficient, a specific non-zero quantization coefficient, and quantization coefficients between the first quantization coefficient and the specific non-zero quantization coefficient.
[0031] Fifthly, this application provides an encoder, including: a memory and a processor, the memory being coupled to the processor; the memory storing program instructions, which, when executed by the processor, cause the encoder to perform the method in the first aspect or any possible implementation thereof.
[0032] In a sixth aspect, this application provides a decoder, comprising: a memory and a processor, the memory being coupled to the processor; the memory storing program instructions, which, when executed by the processor, cause the decoder to perform the method in the second aspect or any possible implementation thereof.
[0033] In a seventh aspect, this application provides a chip including one or more interface circuits and one or more processors; the one or more processors receive or transmit data through the one or more interface circuits, and when the one or more processors execute computer instructions, cause the electronic device to perform the method in the first aspect or any possible implementation of the first aspect.
[0034] Eighthly, this application provides a chip including one or more interface circuits and one or more processors; the one or more processors receive or transmit data through the one or more interface circuits, and when the one or more processors execute computer instructions, cause the electronic device to perform the method in the second aspect or any possible implementation of the second aspect.
[0035] Ninthly, this application provides a computer-readable storage medium storing a computer program that, when run on a computer or processor, causes the computer or processor to perform the method of the first aspect or any possible implementation thereof.
[0036] In a tenth aspect, this application provides a computer-readable storage medium storing a computer program that, when run on a computer or processor, causes the computer or processor to perform the method of the second aspect or any possible implementation thereof.
[0037] In one aspect, this application provides a computer program product, which includes computer instructions that, when executed by a computer or processor, cause the computer or processor to perform the method in the first aspect or any possible implementation thereof.
[0038] In a twelfth aspect, this application provides a computer program product including computer instructions that, when executed by a computer or processor, cause the computer or processor to perform the method in the second aspect or any possible implementation thereof.
[0039] In a thirteenth aspect, this application provides a computer-readable storage medium that stores a bitstream from the first aspect or any possible implementation thereof.
[0040] In a fourteenth aspect, this application provides an encoder including processing circuitry that can be used to perform the methods in the first aspect or any possible implementation thereof.
[0041] In a fifteenth aspect, this application provides a decoder including processing circuitry that can be used to perform the methods in the second aspect or any possible implementation thereof.
[0042] In a sixteenth aspect, this application provides a bitstream generated according to the first aspect and any implementation thereof.
[0043] The electronic devices, computer-readable storage media, computer program products, chips, or codecs provided in this application are all used to perform the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above. Attached Figure Description
[0044] Figure 1A is a schematic block diagram of an exemplary video encoding and decoding system;
[0045] Figure 1B is a schematic block diagram of an exemplary video decoding system;
[0046] Figure 2 is a schematic block diagram of an encoder as an example;
[0047] Figure 3 is a schematic block diagram of an exemplary decoder;
[0048] Figure 4 is a schematic block diagram of an encoder based on wavelet transform, which is an example shown.
[0049] Figure 5 is an exemplary schematic diagram of subgraph partitioning;
[0050] Figure 6 is an exemplary schematic diagram of wavelet transform;
[0051] Figures 7A and 7B are schematic block diagrams of an exemplary decoder;
[0052] Figure 8 is a schematic diagram of the structure of a code stream as an example;
[0053] Figure 9 is a flowchart illustrating an exemplary encoding method;
[0054] Figure 10 is a schematic diagram of a quantization coefficient block as an example;
[0055] Figure 11 is an exemplary scanning diagram;
[0056] Figure 12 is an exemplary schematic diagram of the scan results;
[0057] Figure 13A is an exemplary schematic diagram of the scan results;
[0058] Figure 13B is an exemplary schematic diagram of the scan results;
[0059] Figure 14 is an exemplary diagram illustrating the remaining value;
[0060] Figure 15 is a flowchart illustrating an exemplary encoding method;
[0061] Figure 16 is a flowchart illustrating an exemplary encoding method;
[0062] Figure 17 is an exemplary schematic diagram of RegularStopPos;
[0063] Figure 18 is a flowchart illustrating an exemplary decoding method;
[0064] Figure 19 is a schematic diagram of the structure of an exemplary video decoding device;
[0065] Figure 20 is a schematic diagram of the structure of an exemplary device;
[0066] Figure 21 is a schematic diagram of the structure of an exemplary device;
[0067] Figure 22 is a schematic diagram of the structure of an exemplary device. Detailed Implementation
[0068] The following is a brief introduction to some concepts that may be involved in the embodiments of this application. These concepts are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0069] The residual is the difference between the reconstructed value and the predicted value of a sample or data element.
[0070] A residual block is a residual matrix composed of the residuals corresponding to the coded blocks.
[0071] Dequantization is the process of scaling the quantized residual to obtain the reconstructed residual value.
[0072] A partition divides a set into subsets. Each element in the set belongs to one and only one subset.
[0073] Partition type: The way the subsets obtained from the partition are organized.
[0074] A decoded picture is an image reconstructed by the decoder based on the bitstream.
[0075] Prediction is the specific implementation of the prediction process.
[0076] The prediction process uses previously decoded samples to obtain the predicted value for the current sample.
[0077] Syntax element: The result of parsing data units in a bitstream.
[0078] A bitstream is a binary data stream that encodes all or part of an image sample.
[0079] Video coding generally refers to the processing of a sequence of images that form a video or video sequence. In the field of video coding, the terms "picture," "frame," or "image" can be used synonymously. Video coding is performed on the source side and typically involves processing (e.g., by compression) the raw video images to reduce the amount of data required to represent them, thus enabling more efficient storage and / or transmission. Video decoding is performed on the destination side and typically involves inverse processing relative to the encoder to reconstruct the video images. The combination of encoding and decoding is also known as encoding and decoding.
[0080] A video sequence consists of a series of images, which are further divided into slices, and slices into blocks. Video coding is performed on a block-by-block basis. In some newer video coding standards, the concept of a block has been further expanded. For example, the H.264 standard uses macroblocks (MBs), which can be further divided into multiple prediction blocks (partitions) for predictive coding. The High Efficiency Video Coding (HEVC) standard employs fundamental concepts such as coding units (CUs), prediction units (PUs), and transform units (TUs), described using a novel tree-based structure. A TU corresponds to a transform block and is the basic unit for transforming the prediction residual.
[0081] In this paper, for ease of description and understanding, the image block to be processed in the current image is referred to as the current block. For example, in encoding, it refers to the block currently being encoded; in decoding, it refers to the block currently being decoded. The decoded image block in the reference image used to predict the current block is called the reference block. That is, the reference block is the block that provides a reference signal for the current block, where the reference signal represents the pixel value within the image block. The block in the reference image that provides a prediction signal for the current block is called the prediction block, where the prediction signal represents the pixel value, sampled value, or sampled signal within the prediction block. For example, after traversing multiple reference blocks, an optimal reference block is found. This optimal reference block will provide prediction for the current block; this block is called the prediction block.
[0082] In lossless video coding, the original video image can be reconstructed, meaning the reconstructed video image has the same quality as the original (assuming no transmission loss or other data loss during storage or transmission). In lossy video coding, further compression is performed, for example, through quantization, to reduce the amount of data required to represent the video image. However, the decoder cannot fully reconstruct the video image, meaning the quality of the reconstructed video image is lower or worse than the original video image.
[0083] YUV is a color space model used to represent colors, widely used in image encoding and decoding, video encoding and decoding, digital image processing, television broadcasting, and other fields. YUV separates the luminance information from the chrominance information of an image.
[0084] The three components of YUV:
[0085] Y (luminance) component: Y represents the luminance information of an image, that is, the brightness or darkness of the image. It is obtained by weighting the red, green, and blue color channels according to certain weights. The Y component plays an important role in the sharpness and detail of an image.
[0086] U (chromaticity) component: U represents the chromaticity information of the image, indicating the offset of the blue channel relative to the luminance Y. It measures the change in the blue component.
[0087] V (chromaticity) component: V represents the chromaticity information of the image, indicating the offset of the red channel relative to the luminance Y.
[0088] The encoding / decoding method of this application embodiment encodes and decodes images or videos on a block-by-block basis.
[0089] In some embodiments, the block to be encoded or the block to be decoded may be an image block or a video block obtained from an image or video.
[0090] In some embodiments, the block to be encoded or the block to be decoded may be an image block or video block within a subgraph obtained by dividing the image or video into subgraphs.
[0091] In some embodiments, the block to be encoded or the block to be decoded can be a block obtained from the transformed data of the image or video to be encoded after transformation processing (e.g., wavelet transform (also known as wavelet forward transform, etc., without limitation).
[0092] This application does not restrict the specific division method of the blocks to be encoded or decoded in an image or video, nor does it restrict the method of obtaining the blocks.
[0093] On the encoding side, the image to be encoded can be a frame from an image or video, a sub-image obtained by dividing a frame from an image or video, an image obtained after transformation (such as wavelet transform), or a sub-image from the transformed image; there are no restrictions here. On the encoding side, "current frame" can represent "image to be encoded," and "current block" can represent "block to be encoded." A frame is a frame of image to be displayed.
[0094] Similarly, the decoding side corresponds to the encoding side. On the decoding side, the image to be decoded can be the original image in an image or video, or an image obtained after processing the original image (e.g., left shifting), or a sub-image obtained by dividing the original image or video, or an image obtained after transformation (e.g., wavelet transform), or a sub-image in the transformed image; there are no restrictions here. On the decoding side, "current image" can be used to represent "image to be decoded," and "current block" can be used to represent "block to be decoded."
[0095] Whether on the encoding or decoding side, the reconstructed data (also called the reconstructed value) of a block can be described as a reconstructed block, and the already encoded or decoded block referenced when encoding or decoding the current block can be described as a "reference block".
[0096] Whether on the encoding or decoding side, the reference image, also known as the reference frame, can be an image that has been encoded before the current image in the video sequence, or, when the current image is a sub-image, the reference image is a sub-image that has been encoded before the current image, without any restrictions.
[0097] Whether on the encoding or decoding side, the prediction data for the current block is also referred to as the prediction block or the prediction value for the current block.
[0098] Whether on the encoding or decoding side, reconstruction can also be described as remodeling.
[0099] Whether on the encoding or decoding side, the bitstream is also described as a bitstream, etc.
[0100] Whether on the encoding or decoding side, the residual is also referred to as a residual block.
[0101] The embodiments of this application are described below with reference to the accompanying drawings.
[0102] Referring to Figure 1A, Figure 1A provides an exemplary block diagram of a video encoding and decoding system 10 used in an embodiment of this application. As shown in Figure 1A, the video encoding and decoding system 10 may include a source device 12 and a destination device 14. The source device 12 generates encoded video data; therefore, the source device 12 may be referred to as a video encoding device. The destination device 14 can decode the encoded video data generated by the source device 12; therefore, the destination device 14 may be referred to as a video decoding device. Various embodiments of the source device 12, the destination device 14, or both may include one or more processors and memory coupled to the one or more processors. The memory may include, but is not limited to, RAM, ROM, EEPROM, flash memory, or any other media that can be used to store desired program code in the form of computer-accessible instructions or data structures. The source device 12 and the destination device 14 may include a variety of devices, including desktop computers, mobile computing devices, notebook (e.g., laptop) computers, tablet computers, set-top boxes, handsets, televisions, cameras, display devices, digital media players, video game consoles, in-vehicle computers, wireless communication devices, or the like.
[0103] Source device 12 and destination device 14 can communicate via link 13, through which destination device 14 can receive encoded video data from source device 12. Link 13 may include one or more media or devices capable of transmitting encoded video data from source device 12 to destination device 14. In one example, link 13 may include one or more communication media enabling source device 12 to transmit encoded video data to destination device 14 in real time. In this example, source device 12 may modulate the encoded video data according to a communication standard (e.g., a wireless communication protocol) and transmit the modulated video data to destination device 14. The one or more communication media may include wireless and / or wired communication media, such as radio frequency (RF) spectrum or one or more physical transmission lines. The one or more communication media may form part of a packet-based network, such as a local area network, wide area network, or global network (e.g., the Internet). The one or more communication media may include routers, switches, base stations, or other devices facilitating communication from source device 12 to destination device 14.
[0104] The source device 12 includes an encoder 20. Optionally, the source device 12 may also include an image source 16, an image preprocessor 18, and a communication interface 22. In specific implementations, the encoder 20, image source 16, image preprocessor 18, and communication interface 22 may be hardware components or software programs within the source device 12. These are described below:
[0105] Image source 16 may include or be any type of image capture device for, for example, capturing real-world images, and / or any type of image or commentary (for screen content encoding, some text on the screen is also considered as an image to be encoded or part of an image) generation device, such as a computer graphics processor for generating computer-animated images, or any type of device for acquiring and / or providing real-world images, computer-animated images (e.g., screen content, virtual reality (VR) images), and / or any combination thereof (e.g., augmented reality (AR) images). Image source 16 may be a camera for capturing images or a memory for storing images. Image source 16 may also include any type of (internal or external) interface for storing previously captured or generated images and / or acquiring or receiving images. When image source 16 is a camera, image source 16 may be, for example, a local or integrated camera integrated into a source device; when image source 16 is a memory, image source 16 may be a local or integrated memory integrated into a source device. When the image source 16 includes an interface, the interface may be, for example, an external interface for receiving images from an external video source, such as an external image capture device, like a camera, external storage, or an external image generation device, such as an external computer graphics processor, computer, or server. The interface can be any type of interface according to any proprietary or standardized interface protocol, such as a wired or wireless interface, or an optical interface.
[0106] An image can be viewed as a two-dimensional array or matrix of pixels. Pixels in the array are also called sampling points. The number of sampling points in the array or image along the horizontal and vertical directions (or axes) defines the image's size and / or resolution. To represent color, three color components are typically used; that is, an image can be represented as or contain three sampling arrays. For example, in RBG format or color space, an image includes corresponding red, green, and blue sampling arrays. However, in video coding, each pixel is typically represented in a luma / chroma format or color space. For example, for a YUV format image, this includes a luma component indicated by Y (sometimes also indicated by L) and two chroma components indicated by U and V. The luma component Y represents the brightness or grayscale level intensity (e.g., both are the same in a grayscale image), while the two chroma components U and V represent chroma or color information components. Accordingly, a YUV format image includes a luma sampling array of luma sample values (Y) and two chroma sampling arrays of chroma values (U and V). An RGB format image can be converted or transformed to YUV format, and vice versa; this process is also called color transformation or conversion. If the image is black and white, it may only include a luminance sampling array. In this embodiment, the image transmitted from image source 16 to image processor can also be referred to as raw image data 17.
[0107] Image preprocessor 18 is configured to receive raw image data 17 and perform preprocessing on the raw image data 17 to obtain a preprocessed image 19 or preprocessed image data 19. For example, the preprocessing performed by image preprocessor 18 may include retouching, color format conversion (e.g., from RGB format to YUV format), color correction, or noise reduction.
[0108] Encoder 20 (or video encoder 20) is used to receive preprocessed image data 19 and process the preprocessed image data 19 using a relevant prediction mode (such as the prediction mode in the various embodiments herein) to provide encoded image data 21.
[0109] Communication interface 22 can be used to receive encoded image data 21 and transmit the encoded image data 21 via link 13 to destination device 14 or any other device (such as a memory) for storage or direct reconstruction. The other device can be any device used for decoding or storage. Communication interface 22 can, for example, be used to encapsulate the encoded image data 21 into a suitable format, such as data packets, for transmission over link 13.
[0110] Destination device 14 includes decoder 30. Optionally, destination device 14 may also include communication interface 28, image post-processor 32, and display device 34. These are described below:
[0111] Communication interface 28 can be used to receive encoded image data 21 from source device 12 or any other source, such as a storage device, for example, an encoded image data storage device. Communication interface 28 can be used to transmit or receive encoded image data 21 via link 13 between source device 12 and destination device 14 or via any type of network, such as a wired or wireless connection, any type of network, such as a wired or wireless network or any combination thereof, or any type of private and public network, or any combination thereof. Communication interface 28 can be used, for example, to decapsulate data packets transmitted by communication interface 22 to obtain encoded image data 21.
[0112] Both communication interface 28 and communication interface 22 can be configured as unidirectional or bidirectional communication interfaces, and can be used, for example, to send and receive messages to establish connections, acknowledge and exchange any other information related to the communication link and / or data transmission, such as encoded image data transmission.
[0113] Decoder 30 (or video decoder 30) is used to receive encoded image data 21 and provide decoded image data 31 or decoded image 31 (the structural details of decoder 30 will be further described below based on Figure 3, Figure 4 or Figure 5).
[0114] Image post-processor 32 is used to perform post-processing on decoded image data 31 (also known as reconstructed image data) to obtain post-processed image data 33.
[0115] Display device 34 is used to receive post-processed image data 33 to display an image to, for example, a user or viewer. Display device 34 can be or may include any class of displays for presenting reconstructed images, such as integrated or external displays or monitors. For example, displays may include liquid crystal displays (LCDs), organic light emitting diode (OLED) displays, plasma displays, projectors, micro-LED displays, liquid crystal on silicon (LCoS), digital light processors (DLP), or any other class of displays.
[0116] Both encoder 20 and decoder 30 can be implemented as any of a variety of suitable circuits, such as one or more microprocessors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), discrete logic, hardware, or any combination thereof. If the technology is implemented in part in software, the device can store the software instructions in a suitable non-transitory computer-readable storage medium, and one or more processors can be used to execute the instructions in hardware to perform the technology of this disclosure. Any of the foregoing (including hardware, software, combinations of hardware and software, etc.) can be considered as one or more processors.
[0117] Referring to FIG1B, FIG1B is an illustrative diagram of an example of a video decoding system 40 including the encoder 20 of FIG2 and / or the decoder 30 of FIG3 according to an exemplary embodiment. The video decoding system 40 can implement various combinations of technologies of the embodiments of this application. In the illustrated embodiment, the video decoding system 40 may include an imaging device 41, an encoder 20, a decoder 30 (and / or a video encoder / decoder implemented by logic circuitry of a processing unit 46), an antenna 42, one or more processors 43, one or more memories 44, and a display device 45.
[0118] As shown in Figure 1B, the imaging device 41, antenna 42, processing unit 46, logic circuit, encoder 20, decoder 30, processor 43, memory 44, and display device 45 are capable of communicating with each other. As discussed, although encoder 20 and decoder 30 are used as examples to describe the video decoding system 40, in different instances, the video decoding system 40 may contain only encoder 20 or only decoder 30.
[0119] In some instances, antenna 42 can be used to transmit or receive encoded video data streams. Additionally, in some instances, display device 45 can be used to present video data. In some instances, logic circuitry can be implemented using processing unit 46. Processing unit 46 can include an ASIC, graphics processor, general-purpose processor, etc. Video decoding system 40 can also include an optional processor 43, which can similarly include an ASIC, graphics processor, general-purpose processor, etc. In some instances, logic circuitry can be implemented in hardware, such as dedicated video encoding hardware, while processor 43 can be implemented in general-purpose software, operating system, etc. Furthermore, memory 44 can be any type of memory, such as volatile memory (e.g., static random access memory (SRAM), dynamic random access memory (DRAM), etc.) or non-volatile memory (e.g., flash memory, etc.). In a non-limiting instance, memory 44 can be implemented using cache memory. In some instances, logic circuitry can access memory 44 (e.g., for implementing an image buffer). In other instances, the logic circuitry and / or processing unit 46 may include memory (e.g., cache, etc.) for implementing image buffers, etc.
[0120] In some instances, the encoder 20 implemented via logic circuitry may include (e.g., implemented via processing unit 46 or memory 44) an image buffer and (e.g., implemented via processing unit 46) a graphics processing unit. The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include the encoder 20 implemented via logic circuitry to implement various modules discussed with reference to Figure 2 and / or any other encoder system or subsystem described herein. The logic circuitry may be used to perform various operations discussed herein.
[0121] In some instances, decoder 30 may be implemented via logic circuitry in a similar manner to implement the various modules discussed in reference to decoder 30 of Figure 3 and / or any other decoder system or subsystem described herein. In some instances, the logic circuitry-implemented decoder 30 may include an image buffer (implemented via processing unit 46 or memory 44) and a graphics processing unit (e.g., implemented via processing unit 46). The graphics processing unit may be communicatively coupled to the image buffer. The graphics processing unit may include decoder 30 implemented via logic circuitry to implement the various modules discussed in reference to Figure 3 and / or any other decoder system or subsystem described herein.
[0122] In some instances, antenna 42 can be used to receive an encoded stream of video data. As discussed herein, the encoded stream may contain data related to encoded video frames, indicators, index values, mode selection data, etc., such as data related to code segmentation (e.g., transform coefficients or quantized transform coefficients, optional indicators, and / or data defining code segmentation). Video decoding system 40 may also include a decoder 30 coupled to antenna 42 for decoding the encoded stream. Display device 45 is used to display the video frames.
[0123] It should be understood that, referring to the examples described for encoder 20 in the embodiments of this application, decoder 30 can be used to perform the reverse process. Regarding signaling syntax elements, decoder 30 can be used to receive and parse such syntax elements, and accordingly decode the associated video data. In some examples, encoder 20 can entropy-encode syntax elements into an encoded video stream. In such instances, decoder 30 can parse such syntax elements and accordingly decode the associated video data.
[0124] It should be noted that the encoding and decoding method described in the embodiments of this application is mainly used for the encoding and decoding process of video or images. This process exists in both encoder 20 and decoder 30. The encoder 20 and decoder 30 in the embodiments of this application can be, for example, the encoding / decoder corresponding to video standard protocols such as H.263, H.264, HEVV, MPEG-2, MPEG-4, VP8, VP9, H.266, or next-generation video standard protocols (such as H.267).
[0125] Referring to Figure 2, which is a schematic / conceptual block diagram of an exemplary example of encoder 20, encoder 20 includes a residual calculation unit 204, a transform processing unit 206, a quantization unit 208, an inverse quantization unit 210, an inverse transform processing unit 212, a reconstruction unit 214, a buffer 216, a loop filter unit 220, a decoded picture buffer (DPB) 230, a prediction processing unit 260, and an entropy coding unit 270. Prediction processing unit 260 may include inter-frame prediction unit 244, intra-frame prediction unit 254, and mode selection unit 262. Inter-frame prediction unit 244 may include a motion estimation unit and a motion compensation unit (not shown). Encoder 20 shown in Figure 2 may also be referred to as a hybrid video encoder or a video encoder based on a hybrid video codec.
[0126] Specifically, encoder 20 receives image 201 or image blocks 203 of image 201 via, for example, input 202. Encoder 20 is used to encode image 201 block by block, for example, by performing encoding and prediction for each image block 203.
[0127] The residual calculation unit 204 is used to calculate the residual block 205 based on the image block 203 and the prediction block 265. The transform processing unit 206 is used to apply a transform, such as a discrete cosine transform (DCT) or a discrete sine transform (DST), to the sample values of the residual block 205 to obtain transform coefficients 207 in the transform domain. The transform coefficients 207 can also be called transform residual coefficients.
[0128] The quantization unit 208 is used to quantize the transform coefficients 207, for example, by applying scalar quantization or vector quantization, to obtain the quantized transform coefficients 209.
[0129] The inverse quantization unit 210 is used to apply the inverse quantization of the quantization unit 208 to the quantized coefficients to obtain the inverse quantization coefficients 211.
[0130] The inverse transformation processing unit 212 is used to apply the inverse transformation of the transformation applied by the transformation processing unit 206 to obtain the inverse transformation block 213.
[0131] Reconstruction unit 214 (e.g., summer 214) is used to add inverse transform block 213 (i.e. reconstructed residual block 213) to prediction block 265 to obtain reconstructed block 215.
[0132] The loop filter unit 220 (or simply "loop filter" 220) is used to filter the reconstructed block 215 to obtain the filtered block 221.
[0133] The decoded image buffer 230 can be used as a reference image memory to store reference image data for the encoder 20 to encode video data.
[0134] The prediction processing unit 260, also known as the block prediction processing unit 260, is used to receive or acquire image block 203 (current image block 203 of current image 201) and reconstructed image data, and to process such data to make predictions, i.e., to provide prediction block 265 which can be either inter-frame prediction block 245 or intra-frame prediction block 255.
[0135] The mode selection unit 262 can be used to select a prediction mode (e.g., intra-frame or inter-frame prediction mode) and / or the corresponding prediction block 245 or 255 used as prediction block 265 to compute residual block 205 and reconstructed block 215.
[0136] Specifically, the intra-frame prediction unit 254 can transmit syntax elements to the entropy coding unit 270. The entropy coding unit 270 is used to apply an entropy coding algorithm or scheme (e.g., variable length coding (VLC) scheme, context adaptive VLC (CAVLC) scheme, arithmetic coding scheme, context adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or other entropy coding methods or techniques) to one or all (or not apply) of the quantized residual coefficients 209, inter-frame prediction parameters, intra-frame prediction parameters, and / or loop filter parameters to obtain encoded image data 21 that can be output by output 272 in the form of, for example, an encoded bitstream 21.
[0137] Referring to Figure 3, which is a schematic / conceptual block diagram of an example of a decoder 30, the decoder 30 is used to receive, for example, encoded image data (e.g., encoded bitstream) 21 encoded by encoder 20 to obtain a decoded image 331. During the decoding process, the decoder 30 receives video data from encoder 20, such as encoded video bitstreams representing image blocks of encoded video stripes and associated syntax elements.
[0138] In the example of Figure 3, decoder 30 includes an entropy decoding unit 304, an inverse quantization unit 310, an inverse transform processing unit 312, a reconstruction unit 314 (e.g., a summer 314), a buffer 316, a loop filter 320, a decoded image buffer 330, and a prediction processing unit 360. Prediction processing unit 360 may include an inter-frame prediction unit 344, an intra-frame prediction unit 354, and a mode selection unit 362. In some instances, decoder 30 may perform a decoding process that is generally the inverse of the encoding process described in video encoder 20 of Figure 2.
[0139] Specifically, the entropy decoding unit 304 is used to perform entropy decoding on the encoded image data 21 to obtain, for example, quantization coefficients 309 and / or decoded encoding parameters (not shown in Figure 3).
[0140] The inverse quantization unit 310 can function the same as the inverse quantization unit 110, the inverse transform processing unit 312 can function the same as the inverse transform processing unit 212, the reconstruction unit 314 can function the same as the reconstruction unit 214, the buffer 316 can function the same as the buffer 216, the loop filter 320 can function the same as the loop filter 220, and the decoded image buffer 330 can function the same as the decoded image buffer 230.
[0141] The prediction processing unit 360 is typically used to perform block prediction and / or obtain prediction blocks 365 from the encoded data 21, and to receive or obtain prediction-related parameters and / or information about the selected prediction mode from, for example, the entropy decoding unit 304 (explicitly or implicitly).
[0142] The inverse quantization unit 310 can be used to inverse quantize (i.e., dequantize) the quantized transform coefficients provided in the bitstream and decoded by the entropy decoding unit 304. The inverse transform processing unit 312 is used to apply an inverse transform (e.g., inverse DCT, inverse integer transform, or a conceptually similar inverse transform process) to the transform coefficients to generate a residual block in the pixel domain.
[0143] Reconstruction unit 314 (e.g., summer 314) is used to add inverse transform block 313 (i.e. reconstructed residual block 313) to prediction block 365 to obtain reconstructed block 315 in the sample domain.
[0144] The loop filter unit 320 (during or after the encoding loop) is used to filter the reconstructed block 315 to obtain the filtered block 321.
[0145] Decoder 30 is used, for example, to output decoded image 31 via output 332 for presentation to or viewing by the user.
[0146] For example, commonly used transform methods in image coding include discrete cosine transform and wavelet transform. Wavelet transform is a local transform method that can perform localized, multi-scale analysis of images, focusing on the details of signal changes, making it very suitable for image coding tasks.
[0147] This application provides a wavelet transform-based codec that can independently encode and decode low-frequency and high-frequency sub-bands, effectively reducing encoding and decoding complexity and improving efficiency. For example, an image undergoes wavelet transform to obtain low-frequency and high-frequency sub-bands, which are then encoded to generate low-frequency and high-frequency sub-band bitstreams, respectively. The low-frequency sub-band can be understood as a sub-image representing the low-frequency signal (or low-frequency information) of the original image, and the high-frequency sub-band can be understood as a sub-image representing the high-frequency signal (or high-frequency information) of the original image.
[0148] Referring to Figure 4, which is a schematic / conceptual block diagram of an encoder as an example, the encoder in the example of Figure 4 includes, but is not limited to, a sub-graph partitioning unit 410, a wavelet forward transform unit 420, a low-frequency sub-band processing path 430, and a high-frequency sub-band processing path 440.
[0149] The sub-image partitioning unit 410 is used to acquire the current image and partition it to obtain at least one sub-image. Specifically, the sub-image partitioning unit 410 partitions the current image into N sub-images according to a sub-image partitioning method, where N is an integer greater than 0 (or an integer greater than 1). The sub-image partitioning method can include, but is not limited to, at least one of the following:
[0150] The width and / or height of the subgraph are multiples of 128;
[0151] The maximum width of the subimage is 1024 pixels;
[0152] The minimum height and / or width of the subimage is 256 pixels;
[0153] The original image resolution is less than or equal to 1080p, and N is an integer greater than 1 and less than or equal to 8; or,
[0154] The original image has a length greater than or equal to 4320 pixels, a width greater than or equal to 2160 pixels, and N is an integer greater than 1 and less than or equal to 16; or,
[0155] The original image has a length greater than or equal to 7680 pixels, a width greater than or equal to 4320 pixels, and N is an integer greater than 1 and less than or equal to 32.
[0156] The values mentioned above are merely illustrative examples and can be set according to actual needs.
[0157] Referring to Figure 5, which is an exemplary schematic diagram of sub-image partitioning, in the example of Figure 5, the sub-image partitioning unit 410 can partition the image 401 into m multiplied by n sub-images according to the sub-image partitioning method. Optionally, in this example, the width and height of each sub-image satisfy a multiple of 128.
[0158] The sub-image partitioning unit 410 can partition the image into m multiplied by n sub-images according to the sub-image partitioning method. Among them, for sub-images whose width and height are not multiples of 128, the sub-image partitioning unit 410 can pad these sub-images so that the height and width of each padded sub-image can be multiples of 16.
[0159] The wavelet forward transform unit 420 is used to perform wavelet transform (also called wavelet forward transform) on the subgraph to obtain low-frequency subband and high-frequency subband. The low-frequency subband includes low-frequency signals in the subgraph that satisfy the low-frequency filter coefficients, and the high-frequency subband includes high-frequency signals in the subgraph that have been decomposed by the high-frequency filter in the wavelet transform.
[0160] Referring to Figure 6, which is an exemplary schematic diagram of wavelet transform, in the example of Figure 6, the wavelet forward transform unit 420 acquires the current sub-image, for example, sub-image 1_1. The wavelet forward transform unit 420 performs a wavelet transform on the current sub-image, wherein the wavelet transform includes one horizontal wavelet transform and one vertical wavelet transform to obtain the wavelet coefficients of the low-low (LL) sub-band (abbreviated as LL sub-band), the wavelet coefficients of the low-high (LH) sub-band (abbreviated as LH sub-band), the wavelet coefficients of the high-high (HH) sub-band (abbreviated as HH sub-band), and the wavelet coefficients of the high-low (HL) sub-band (abbreviated as HL sub-band).
[0161] In this embodiment, the low-frequency subband includes an LL subband, and the high-frequency subband includes an LH subband, an HH subband, and an HL subband. Optionally, the LL subband, LH subband, HH subband, and HL subband have the same dimensions (including width and height).
[0162] Referring again to Figure 4, the low-frequency subband processing path 430 is used to obtain the wavelet coefficients 403 of the low-frequency subband to obtain the low-frequency subband encoded data 413. The low-frequency subband processing path 430 includes, but is not limited to: a block partitioning unit 431 (also called a low-frequency subband block partitioning unit 431), a residual calculation unit 432, a prediction unit 437, a control unit 438, a transform / quantization unit (also called a low-frequency subband transform / quantization unit 433), an inverse quantization / inverse transform unit 434 (also called a low-frequency subband inverse quantization / inverse transform unit 434), a low-frequency subband reconstruction unit 435, a low-frequency subband splicing unit 436, and a low-frequency subband entropy coding unit 439, etc.
[0163] The high-frequency subband processing path 440 is used to obtain the wavelet coefficients 414 of the high-frequency subband in order to obtain the high-frequency subband encoded data 417. The high-frequency subband processing path 440 includes, but is not limited to: block partitioning unit 431 (also called high-frequency subband block partitioning unit 431 or second block partitioning unit 431), transform / quantization unit (also called transform / quantization unit 442 or second transform / quantization unit), high-frequency subband entropy coding unit 443, etc.
[0164] Alternatively, in some instances, the encoder may include more or fewer units or modules than in the structure shown in Figure 4.
[0165] The image 401 encoding method provided in this application will be described in detail below with reference to the encoder shown in Figure 4:
[0166] The codec receives image 401. A description of image 401 can be found above and will not be repeated here.
[0167] Sub-image partitioning unit 410 partitions image 401 into sub-images and outputs N sub-images. N is an integer greater than 0. In this embodiment, each sub-image is encoded and decoded independently. During the encoding process, sub-image 402 can be referred to as the current sub-image or the sub-image to be encoded.
[0168] Wavelet forward transform unit 420 performs wavelet forward transform on the current sub-image to obtain wavelet coefficients 403 (hereinafter referred to as low-frequency sub-band) and wavelet coefficients 414 (hereinafter referred to as high-frequency sub-band) of the current sub-image. The wavelet coefficients 403 of the low-frequency sub-band include the wavelet coefficients of the LL sub-band, and the wavelet coefficients of the LH, HL, and HH sub-bands are included in the high-frequency sub-band. In this embodiment, each sub-image of the image can be independently encoded and decoded, and the high-frequency sub-band and low-frequency sub-band of each sub-image are independently encoded and decoded. The LH, HL, and HH sub-bands in the high-frequency sub-band can also be independently encoded and decoded.
[0169] The block partitioning unit 431 (which may be called the low-frequency sub-band block partitioning unit) is used to obtain the wavelet coefficients 403 of the low-frequency sub-band of the current sub-graph 402, so as to obtain at least one macroblock 404 of the low-frequency sub-band of the sub-graph 402. The macroblock can also be understood as a set of partial coefficients in the wavelet coefficients of the low-frequency sub-band.
[0170] Specifically, the block partitioning unit 431 partitions the wavelet coefficients 403 of the low-frequency sub-band of the current subgraph 402 into blocks based on the block partitioning method, obtaining at least one macroblock 404 of the low-frequency sub-band of the current subgraph, for example, M macroblocks, where M is an integer greater than 0 (or greater than 1). The low-frequency block partitioning unit 431 outputs the macroblocks 404 of the wavelet coefficients 403 of the current low-frequency sub-band one by one to the residual calculation unit 432 and the control unit 438.
[0171] In the embodiments of this application, macroblock 404 is a basic encoding / decoding unit. During the encoding process, macroblock 404 may also be referred to as the current block, current image block 401, macroblock 404 to be encoded, block to be encoded, image block 404 to be encoded, etc.
[0172] Alternatively, the block partitioning method includes, but is not limited to:
[0173] The wavelet coefficients 403 of both the high-frequency subband and the low-frequency subband are divided into basic coding units of 8x8 macroblocks 404 (unit is pixels).
[0174] For example, as described above, each subband uses macroblock 404 as the basic coding unit. The macroblock 404 currently to be encoded is referred to as the current macroblock 404. Specifically, the low-frequency subband processing path 430 encodes each macroblock 404 of the wavelet coefficients 403 of the low-frequency subband block by block. For example, encoding and prediction are performed on each macroblock 404. The encoding process for the current macroblock 404 will be described below; the processing flow for other macroblocks is the same, and will not be illustrated individually in this application. For example, in encoding, it refers to the macroblock currently being encoded; in decoding, it refers to the macroblock currently being decoded. The decoded macroblock in the reference image used for predicting the current macroblock 404 is called the reference block (i.e., the low-frequency subband reconstruction block 409 in the figure). The reference block is the block that provides the reference signal for the current block, where the reference signal represents the pixel value within the macroblock 404. The block in the reference image that provides the prediction signal for the current block can be called prediction block 405, where the prediction signal represents the pixel value, sample value, or sample signal within prediction block 405. For example, after traversing multiple reference blocks, an optimal reference block is found, and this optimal reference block will provide the prediction for the current block; this block is called prediction block 405.
[0175] Specifically, referring to Figure 4, the residual calculation unit 432 is used to obtain the current macroblock 404 and the prediction block 405 (further details of the prediction block 405 are provided below) to obtain the residual block 406. Specifically, the residual calculation unit performs residual calculation on the current macroblock 404 and the prediction block 405 to obtain the residual block 406. The residual calculation unit 432 outputs the residual block 406 to the transform / quantization unit 433.
[0176] The transform / quantization unit 433 is used to obtain the residual block 406 to obtain the residual quantized block 407. Specifically, the transform / quantization unit 433 performs transform and / or quantization processing on the residual block 406 to obtain the residual quantized block 407, which can also be called the quantized residual block. The residual quantized block 407 includes the quantization coefficients of the residual block 406.
[0177] The transform / quantization unit 433 outputs the residual quantization block 407 to the inverse quantization single / inverse transform unit 434 and the low-frequency subband entropy coding unit 439.
[0178] The inverse quantization / inverse transform unit 434, also known as the inverse quantization / inverse transform unit, is used to obtain the residual coefficients 407 to obtain the residual reconstruction block 408. Specifically, the inverse quantization / inverse transform unit 434 performs inverse quantization and / or inverse transform processing on the residual quantization block 407 to obtain the residual reconstruction block 408, which can also be called the inverse quantization residual block, etc. The residual reconstruction block 408 includes the inverse quantization coefficients of the residual block 406. The inverse quantization / inverse transform unit 434 outputs the residual reconstruction block 408 to the low-frequency subband splicing unit 436.
[0179] The dequantization / inverse transform unit 434 may include a dequantization unit and an inverse transform unit (not shown in the figure). The dequantization unit is used to dequantize the input coefficients, and the inverse transform unit is used to inverse transform the input coefficients.
[0180] The low-frequency subband reconstruction unit 435 is used to obtain a low-frequency subband reconstruction block 409 based on the prediction block 405 and the residual reconstruction block 408. Specifically, the low-frequency subband reconstruction unit 435 adds the residual reconstruction block 408 to the prediction block 405 to obtain the low-frequency subband reconstruction block 409, which can also be called a reconstructed low-frequency subband macroblock. Optionally, the low-frequency subband reconstruction unit 435 outputs the low-frequency subband reconstruction block 409 to the prediction unit 437 and the low-frequency subband splicing unit 436. Optionally, the low-frequency subband reconstruction unit 435 outputs the low-frequency subband reconstruction block 409 to the control unit 438.
[0181] The low-frequency subband stitching unit 436 is used to obtain the reconstructed low-frequency subband 411 based on the low-frequency subband reconstruction block 409, which can also be referred to as the reconstructed value of the low-frequency subband or the reconstructed data of the low-frequency subband. Optionally, the low-frequency subband stitching unit 436 outputs the reconstructed low-frequency subband 411 to the prediction unit 437. Optionally, the low-frequency subband stitching unit 436 outputs the reconstructed low-frequency subband 411 to the control unit 438.
[0182] Specifically, as described above, the low-frequency subband uses macroblocks as the basic coding unit, and the low-frequency subband splicing unit 436 can obtain M low-frequency subband reconstruction blocks of a low-frequency subband. The low-frequency subband splicing unit 436 can reconstruct the corresponding low-frequency subband based on the M low-frequency subband reconstruction blocks, that is, obtain the reconstructed low-frequency subband 411.
[0183] The control unit 438 is used to acquire control information 418 and output the control information 418 to the low-frequency subband entropy coding unit 439. For example, the control information 418 may include, but is not limited to, mode information 412. The control unit may determine the mode information 412 based on macroblock 404 (i.e., the current block); or it may determine the mode information 412 based on the current macroblock 404, the low-frequency subband reconstruction block 409, and the reconstructed low-frequency subband 411.
[0184] The mode information, also known as prediction mode information, is used to indicate the prediction mode (or prediction method) of the prediction unit 437, such as inter-frame or intra-frame prediction mode. The control unit 438 can output mode information 412 to the prediction unit 437.
[0185] Prediction unit 437, also known as prediction processing unit, is used to acquire mode information 412 and perform prediction processing based on mode information 412. Specifically, prediction unit 437 can select a prediction mode based on mode information 412. In one example, prediction unit 437 can acquire low-frequency sub-band reconstruction block 409 based on mode information 412 to obtain prediction block 405. Specifically, prediction unit 437 can perform intra-frame prediction based on low-frequency sub-band reconstruction block 409 to obtain prediction block 405. In another example, prediction unit 437 can acquire reconstructed low-frequency sub-band 411 based on mode information 412 to obtain prediction block 405.
[0186] The prediction unit 437 outputs prediction block 405 to the residual calculation unit 432 and the low-frequency sub-band splicing unit 436.
[0187] The low-frequency subband entropy coding unit 439 is used to obtain low-frequency subband encoded data 413, also known as encoded low-frequency subband, based on the residual quantization block 407 and mode information 412. Specifically, the low-frequency subband entropy coding unit 439 uses an entropy coding algorithm or scheme (e.g., variable length coding (VLC), context adaptive VLC (CAVLC), arithmetic coding, context adaptive binary arithmetic coding (CABAC), syntax-based context-adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or other entropy coding methods or techniques) to entropy code the residual quantization block 407 and mode information 412 to obtain low-frequency subband encoded data 413 output in the form of, for example, an encoded bitstream.
[0188] Table 1 shows a schematic diagram of low-frequency subband coded data.
[0189] Table 1
[0190] Where ae(v) indicates that the corresponding data uses arithmetic coding, se(v) indicates that the corresponding data uses exponential Golomb coding, ll_mb_qp_delta indicates the difference between the current macroblock quantization parameter and the predicted quantization parameter, mb_mode indicates the prediction mode of the currently encoded unit (e.g., macroblock), and inter_no_residual_flag indicates whether the quantization residual system of the inter-frame coding mode is all zero. Exponential Golomb coding is a type of VLC coding scheme.
[0191] The control information includes at least the luma transform block size (tb_size_luma), the first flag of the luma intra-prediction mode (intra_pred_mode_luma_first_flag), the second flag of the luma intra-prediction mode (intra_pred_mode_luma_second_flag), the first flag of the chroma intra-prediction mode (intra_pred_mode_chroma_first_flag), and the second flag of the chroma intra-prediction mode (intra_pred_mode_chroma_second_flag). Specifically, intra_pred_mode_luma_first_flag and intra_pred_mode_luma_second_flag together represent the luma component intra-prediction mode, and intra_pred_mode_chroma_first_flag and intra_pred_mode_chroma_second_flag together represent the chroma component intra-prediction mode.
[0192] The low-frequency subband coded data is decoded to obtain the low-frequency subband macroblock quantization coefficients (decode_coefficients). Table 2 shows a schematic diagram of the low-frequency subband macroblock quantization coefficients.
[0193] Table 2 Format of Quantization Coefficients for Low-Frequency Subband Macroblocks
[0194] Among them, `coded_block_flag` indicates whether the transform block includes non-zero coefficients; a value of "1" indicates that the transform block contains non-zero coefficients, and a value of "0" indicates that all coefficients in the transform block are 0. `last_coeff_nz_flag` indicates whether it is the last position in the scanning order during encoding; a value of "0" indicates that the last position in the scanning order during encoding is a non-zero coefficient, and a value of "1" indicates the position of the last non-zero coefficient to be decoded. `last_nz_pos` indicates the position of the last non-zero coefficient, and the position of the last non-zero coefficient is related to the transform block size. `significant_coeff_flag` indicates whether the absolute value of the current quantization coefficient is greater than 0; a value of "0" indicates that the absolute value is equal to 0, and a value of "1" indicates that the absolute value is greater than 0. `coeff_abs_level_greater1_flag` indicates whether the absolute value of the current quantization coefficient is greater than 1; a value of "0" indicates that the absolute value is greater than 1, and a value of "1" indicates that the absolute value is less than or equal to 1. `coeff_abs_level_remaining` indicates the remaining value of the current quantization coefficient, and `coeff_sign_flag` indicates whether the current quantization coefficient is an integer or a negative number.
[0195] Referring again to Figure 4, block partitioning unit 441, also known as high-frequency subband block partitioning unit, is used to obtain the high-frequency subband of the current subgraph 402 to obtain at least one macroblock 415 of the high-frequency subband of the subgraph 402. For a detailed description, please refer to the low-frequency subband section; it will not be repeated here. Specifically, block partitioning unit 441 partitions the high-frequency subband 414 of the current subgraph 402 (hereinafter referred to as the current high-frequency subband) into blocks based on the block partitioning method, obtaining at least one macroblock 415 of the current subgraph 402, for example, M macroblocks, where M is an integer greater than 0 (or an integer greater than 1). Other undescribed parts can be referred to the relevant description of block partitioning unit 431; it will not be repeated here.
[0196] Block partitioning unit 441 outputs the macroblocks of the current high-frequency subband one by one to quantization / conversion unit 442.
[0197] The transform / quantization unit 442 is used to transform and / or quantize the macroblock 415 to obtain the quantization coefficients 416 of the high-frequency subband block (i.e., the quantization coefficients of the current macroblock). The transform / quantization unit 442 outputs the quantization coefficients 416 of the high-frequency subband block to the high-frequency subband entropy coding unit 443.
[0198] The high-frequency subband entropy coding unit 443 is used to perform entropy coding on the data to be encoded to obtain high-frequency subband encoded data 417. The data to be encoded may include, but is not limited to, the quantization coefficients and syntax elements of each high-frequency subband block. The high-frequency subband encoded data 417 includes, but is not limited to, HH subband encoded data, HL subband encoded data, and LH subband encoded data.
[0199] Table 3 shows a schematic diagram of one format of high-frequency subband encoded data.
[0200] Table 3
[0201] Among them, mb_has_coef_flag is the macroblock all-zero flag, with a value of "0" indicating that all coefficients of the macroblock are zero, and a value of "1" indicating that the macroblock has at least one non-zero coefficient; mb_all_one_flag is the macroblock all-one flag, with a value of "1" indicating that all 4x4 blocks in the macroblock contain non-zero coefficients, and a value of "0" indicating that at least one 4x4 block in the macroblock is an all-zero block; transform_skip_flag is the macroblock transform skip flag, with a value of "1" indicating that the macroblock skips the 2x2 Hadamard transform, and a value of "0" indicating that the macroblock performs the 2x2 Hadamard transform. If the bitstream does not have transform_skip_flag, the value of transform_skip_flag for the macroblock is 0, and the value of transform_skip_flag for the chroma macroblock is 0; significance_flag is the block importance flag, with a value of "0" indicating that all coefficients in the 4x4 block are zero, and a value of "1" indicating that the 4x4 block contains non-zero coefficients.
[0202] The high-frequency subband encoded data is decoded to obtain the high-frequency subband macroblock quantization coefficients decode_hf_coef. Table 4 shows a schematic diagram of the high-frequency subband macroblock quantization coefficients.
[0203] Table 4
[0204] Among them, `block_mode_flag` is the block sparsity flag; a value of "0" indicates that the corresponding 4x4 block coefficients are sparse, and a special mode is used to parse the coefficient values; a value of "1" indicates that the block coefficients are dense, and the 16 coefficient values are parsed using direct mode. `table_idx_flag` is the block code table flag; a value of "0" indicates that the offset of the code table index number is 0, and a value of "1" indicates that the offset of the code table index number is 1. `coeff_level` represents the current quantization coefficient value. `sub_significance_flag` is the sub-block importance flag; a value of "0" indicates that the current sub-block has 4... All coefficients are zero; a value of "1" indicates that the four coefficients include a non-zero coefficient. `pattern_0001_flag` is the special pattern flag for the sub-block coefficients; a value of "0" indicates that the four coefficients are not in a special pattern, and a value of "1" indicates that the four coefficients are in a special pattern. `pattern_0001_code` is the special pattern value for the sub-block coefficients, representing the pattern index value of the four coefficient values in the current sub-block. `max_grt1_flag` is the absolute value flag for the sub-block coefficients; a value of "0" indicates that the absolute values of the four coefficients in the current sub-block are all less than or equal to 1, and a value of "1" indicates that the absolute value of at least one of the four coefficients is greater than 1.
[0205] The high-frequency subband entropy coding unit 443 uses an entropy coding algorithm or scheme to encode the data to be coded. The aforementioned entropy coding scheme can be, for example, at least one of the following: VLC scheme, CAVLC scheme, arithmetic coding scheme, and CABAC.
[0206] The encoding and decoding method provided in this application supports two scenarios: full I-frame configuration and I / P frame alternating encoding configuration. The encoder architecture shown in Figure 4 adds relevant modules required for the prediction process on the basis of the wavelet transform architecture, which can improve the compression efficiency of I / P frame alternating encoding for scenarios such as fixed camera positions and slow camera movement.
[0207] Optionally, encoder 40 may also include, but is not limited to, a combining unit (not shown in the figure), also known as a multiplexer (MUX). The combining unit is used to generate a bitstream based on low-frequency subband coded data and high-frequency subband coded data.
[0208] Specifically, the combining unit writes low-frequency subband coded data 413 into the bitstream and writes high-frequency subband coded data 417 into the bitstream. In this embodiment, by encoding the low-frequency subband and high-frequency subband separately, the low-frequency subband coded data and high-frequency subband coded data can be decoded independently. That is, at the decoding end, it can independently decode the low-frequency subband coded data and high-frequency subband coded data in the bitstream, thereby improving decoding efficiency.
[0209] Referring to Figure 7A, which is a schematic / conceptual block diagram of an exemplary decoder, in the example of Figure 7A, the decoder receives, for example, a bitstream encoded by an encoder to obtain a decoded image of the original image, also referred to as a decoded image, reconstructed image, etc. During the decoding process, the decoder receives the bitstream from the encoder, including, but not limited to, image header information and image data.
[0210] In the example shown in Figure 7A, the decoder includes, but is not limited to: low-frequency subband processing path 710, high-frequency subband processing path 720, wavelet inverse transform unit 730, image combination unit 740 (also known as image stitching unit), etc.
[0211] For example, the low-frequency subband processing path 710 is used to acquire low-frequency subband encoded data to obtain reconstructed low-frequency subband 706 (also known as decoded low-frequency subband). The low-frequency subband processing path includes, but is not limited to: low-frequency subband entropy decoding unit 711, inverse quantization / inverse transform unit 74 (also known as low-frequency subband inverse quantization / inverse transform unit), low-frequency subband reconstruction unit 713, low-frequency subband splicing unit 715, prediction unit 714, etc.
[0212] The high-frequency subband processing path 720 is used to acquire high-frequency subband encoded data to obtain reconstructed high-frequency subband 731, which can also be called the reconstructed value of high-frequency subband or the reconstructed data of high-frequency subband, including but not limited to: high-frequency subband entropy decoding unit 721, inverse quantization / inverse transform unit 721 (also called high-frequency subband inverse quantization / inverse transform unit), high-frequency subband reconstruction unit 731, etc.
[0213] In some instances, the decoder shown in Figure 7A can perform a decoding process that is largely the reverse of the encoding process described with reference to the encoder in Figure 4.
[0214] The decoding method in the embodiments of this application will be described in detail below with reference to the decoder 70 shown in Figure 7A.
[0215] For example, decoder 70 can obtain high-frequency subband encoded data and low-frequency subband encoded data in the bitstream based on the image header information in the bitstream. Furthermore, as described above, during the encoding process, the encoder uses macroblocks as the basic encoding unit, and correspondingly, during the decoding process, the decoder also uses macroblocks (e.g., encoded macroblocks) as the basic decoding unit for decoding.
[0216] For example, the low-frequency subband entropy decoding unit 711 performs entropy decoding on the low-frequency subband encoded data 701 in the bitstream, using macroblocks as the basic decoding unit, to obtain the quantization coefficients 702 (i.e., the quantization coefficients of the current macroblock) and syntax elements 707 of the low-frequency subband block. The description of the quantization coefficients 702 of the low-frequency subband can be found on the encoder side and will not be repeated here. Specifically, the low-frequency subband entropy decoding unit 711 obtains the encoded macroblocks (i.e., the encoded data of the macroblocks) of the low-frequency subbands (e.g., LL subbands) of each subgraph in the bitstream, and performs entropy decoding on each encoded macroblock to obtain the quantization coefficients 702 (which can be simply referred to as the quantization coefficients of the macroblock of the low-frequency subband) and syntax elements 707 of the corresponding low-frequency subband for each encoded macroblock. During the decoding process, the currently decoded encoded macroblock can be called the current block.
[0217] The low-frequency subband decoding unit is used to output the quantization coefficients 702 of the low-frequency subband block to the inverse quantization / inverse transform unit 712, and to output the mode information 707 to the prediction unit 714.
[0218] The inverse quantization / inverse transform unit 712 is used to obtain the quantization coefficients 702 of the low-frequency subband block to obtain the inverse quantization coefficients 703 of the low-frequency subband block. Alternatively, it can be the inverse transform coefficients of the current block of the low-frequency subband (depending on whether inverse transform processing was performed). Specifically, the inverse quantization / inverse transform unit 712 performs inverse quantization on the quantization coefficients of the current block of the low-frequency subband, or performs both inverse quantization and inverse transform, to obtain the inverse quantization coefficients of the current block of the low-frequency subband. The inverse quantization / inverse transform unit 712 outputs the inverse quantization coefficients 703 of the low-frequency subband block to the low-frequency subband reconstruction unit 713, for example, the inverse quantization coefficients of the current block of the low-frequency subband.
[0219] The low-frequency subband reconstruction unit 713 is used to obtain the low-frequency subband reconstruction block 704, which can also be called the reconstruction coefficient of the low-frequency subband block, based on the quantization coefficients 703 and the prediction block 705 of the low-frequency subband. Specifically, the low-frequency subband reconstruction unit 713 adds the prediction block to the inverse quantization coefficients of the current block of the low-frequency subband to obtain the low-frequency subband reconstruction block 704 corresponding to the current macroblock.
[0220] The prediction unit 714 is used to acquire mode information 412 and perform corresponding prediction processing according to the mode information 412. For example, it can perform intra-frame prediction based on the low-frequency subband reconstruction block 704, or perform inter-frame prediction based on the reconstructed low-frequency subband 706. Its execution method can be referred to the coding side, and will not be repeated here. The prediction unit 714 outputs prediction block 705 to the low-frequency subband reconstruction block 704 unit.
[0221] For example, the high-frequency subband entropy decoding unit 721 acquires the high-frequency subband encoded data 707 in the bitstream, and, using macroblocks as the basic decoding unit, acquires the quantization coefficients 708 of each high-frequency subband block (which are the quantization coefficients of the current macroblock). Specifically, the high-frequency subband entropy decoding unit 721 performs entropy decoding on the current block of the high-frequency subband encoded data 707 to obtain the quantization coefficients of the current block of the high-frequency subband. Optionally, based on entropy decoding, control information corresponding to the current block can also be acquired, such as mode information 412. The high-frequency subband entropy decoding unit 721 outputs the quantization coefficients 708 of the high-frequency subband block to the inverse quantization / inverse transform unit 722.
[0222] The inverse quantization / inverse transform unit 722, also known as the high-frequency subband inverse quantization / inverse transform unit, is used to obtain the quantization coefficients 708 of the high-frequency subband block to obtain the reconstruction coefficients 709 of the high-frequency subband block. The reconstruction coefficients can be either inverse quantization coefficients after inverse quantization processing, or inverse transform coefficients after inverse quantization and inverse transform processing.
[0223] The high-frequency subband reconstruction unit 723 (also known as the high-frequency subband splicing unit) is used to obtain the reconstruction coefficients 709 of the high-frequency subband block to obtain the reconstructed high-frequency subband 731, which can also be referred to as the reconstructed value or reconstructed data of the high-frequency subband. Specifically, the high-frequency subband reconstruction unit 723 can obtain the reconstruction coefficients corresponding to each macroblock of the high-frequency subband, that is, reconstruct the high-frequency subband block. The high-frequency subband reconstruction unit 723 can splice the obtained multiple macroblocks to obtain the corresponding high-frequency subband. Among them, the reconstructed high-frequency subband may optionally include reconstructing the HL subband (e.g., the reconstruction coefficients of the HL subband), reconstructing the HH subband (e.g., the reconstruction coefficients of the HH subband), and reconstructing the LH subband (e.g., the reconstruction coefficients of the LH subband).
[0224] The inverse wavelet transform unit 730 is used to acquire the reconstructed high-frequency subband 731 and the reconstructed low-frequency subband 706 to obtain the reconstructed sub-image 732. Specifically, the inverse wavelet transform unit 730 acquires the reconstructed low-frequency subband 706 output by the low-frequency subband stitching unit 715 and the reconstructed high-frequency subband 731 output by the high-frequency subband reconstruction unit 723, and performs an inverse wavelet transform on the reconstructed low-frequency subband 706 and the reconstructed high-frequency subband 731 to obtain the reconstructed sub-image 732. The inverse wavelet transform unit 730 outputs the reconstructed sub-image 732 to the image combining unit (also known as the image stitching unit, etc.).
[0225] Image combining unit 740 is used to acquire reconstructed sub-images 732 to obtain a reconstructed image 733 of the original image, which can also be called a decoded image or a decoded image, etc. Specifically, image combining unit 740 can acquire N reconstructed sub-images (N is an integer greater than 0) of the image (referring to the original image), and stitch (or combine) the N reconstructed sub-images according to the division method (including size and position) of each reconstructed sub-image during encoding to obtain the reconstructed image 733.
[0226] Optionally, after acquiring the reconstructed image, the image combining unit 740 can determine whether the reconstructed image contains a padding portion based on the image size information in the image header information and the size information of the current reconstructed image. In one example, if the size of the current reconstructed image is the same as the size indicated by the image size information (i.e., the same as the original image size), the image combining unit 740 can send the reconstructed image to the display device. In this case, the sizes of the displayed image, the original image, and the reconstructed image are all the same. In another example, if the size of the current reconstructed image is different from the size indicated by the image size information (e.g., larger than the original image size), the image combining unit 740 can remove the padding portion of the current reconstructed image based on the size indicated by the image size information to obtain the displayed image. The size of the displayed image is the same as the size of the original image. Optionally, the decoder is used, for example, to output the reconstructed image through the decoder's output port (or output interface) for presentation to the user or for the user to view.
[0227] Other variations of the decoder can be used to decode compressed bitstreams.
[0228] Referring to Figure 7B, which is an exemplary schematic / conceptual block diagram of a decoder, in this example, the wavelet inverse transform unit 730 is used to obtain the reconstruction coefficients 709 of the high-frequency subband block, i.e., the high-frequency subband reconstruction block, and the low-frequency subband reconstruction block 704 output by the low-frequency subband reconstruction block unit 713. The wavelet inverse transform is then performed on the high-frequency subband reconstruction block (e.g., including HH subband reconstruction blocks, HL subband reconstruction blocks, and LH subband reconstruction blocks) and the low-frequency subband reconstruction block 704 to obtain the reconstruction block 734, which is the reconstruction block of the current subgraph, and can also be referred to as the reconstruction data of the current block of the current subgraph or the reconstruction value of the current block of the current subgraph, etc.
[0229] The wavelet inverse transform unit 730 outputs a reconstructed block 734 to the sub-image combination unit 750. The sub-image combination unit 750 can obtain a reconstructed sub-image 732 of the current sub-image based on at least one reconstructed block corresponding to the current sub-image; this can also be referred to as the reconstructed value or reconstructed data of the current sub-image. The undescribed parts of Figure 7B can be referred to Figure 7A, and will not be elaborated here.
[0230] The bitstream output by the encoder in the embodiments of this application will be described in detail below. The bitstream structure described below can be applied to the encoder shown in Figure 4, and of course, it can also be applied to other encoder variations based on Figure 4.
[0231] Referring to Figure 8, which is an exemplary schematic diagram of the bitstream structure, the bitstream in the example of Figure 8 includes, but is not limited to, image header information and image data.
[0232] For example, the image data includes at least one image data region (also referred to as an image data sub-region), such as, but not limited to, a first image data region and a second image data region. During the encoding process, the encoder (e.g., through a combination unit) writes high-frequency subband encoded data and low-frequency subband encoded data into the bitstream. Specifically, the encoder writes high-frequency subband encoded data into the first image data region and low-frequency subband encoded data into the second image data region. The order in which the encoded data is written is merely illustrative and will not be repeated below.
[0233] For example, image header information includes, but is not limited to, offset information and image size information.
[0234] For example, image size information is used to indicate the size of the original image. As mentioned above, during the encoding process, some sub-images may be padded during sub-image partitioning to ensure that the length and width of each sub-image are multiples of 16. Thus, during decoding, the size of the reconstructed image obtained by the decoder may be larger than the original image size. The decoder can process the reconstructed image based on the image size information to remove the padded portions.
[0235] For example, offset information is used to indicate the position of a data region in the bitstream, and can also be understood as indicating the position of independently decodeable coded data in the bitstream. When decoding coded data (i.e., the bitstream) according to this application, the offset information in the image header information can be used to obtain independently decodeable coded data, and decoding operations can be performed on the coded data. The independently decodeable coded data (e.g., low-frequency subband coded data and high-frequency subband coded data) can be decoded synchronously during decoding to improve decoding efficiency.
[0236] In one example, the offset information can be the length of the image data region containing adjacent, independently decodeable encoded data in the bitstream.
[0237] In another example, the offset information can be the offset (i.e., the difference) between the starting position of the image data region where the independently decoded encoded data is located and the ending position of the image header information.
[0238] It should be noted that the embodiments in this application only use a single image stream as an example for illustration, that is, the stream includes only one image data. During the encoding of video images, the encoder can generate a bitstream after encoding each image, that is, the bitstream includes multiple image data, and each image data carries the encoded data of the corresponding image.
[0239] Specifically, in the example shown in Figure 8, the high-frequency subband encoded data (including LH subband encoded data, HH subband encoded data and HL subband encoded data) of each sub-image of the image are continuously written into the first image data area.
[0240] For example, as shown in Figure 8, sub-images 1-HL-MB0, 1-HH-MB0, and 1-LH-MB0 are consecutively written into the first image data region. Here, 1-HL-MB0 represents the encoded macroblock MB0 of the HL subband of sub-image 1, 1-HH-MB0 represents the encoded macroblock MB0 of the HH subband of sub-image 1, and 1-LH-MB0 represents the encoded macroblock MB0 of the LH subband of sub-image 1. The figure only shows the encoded data structure of sub-image 1 in the bitstream; the other sub-images are similar and will not be illustrated individually here.
[0241] In this example, during decoding, the decoding end can decode the high-frequency subband encoded data according to the sub-image order, that is, each sub-image in the first image data region is decoded independently. The low-frequency subband encoded data is also decoded according to the sub-image order, that is, each sub-image in the second image data region is decoded independently. When decoding the first image data region, the decoding end can decode each coded macroblock one by one according to the coded macroblock order of each sub-image in the region. That is, the three high-frequency subband encoded data of sub-image 1 are written continuously into the first image data region; therefore, during decoding, the three high-frequency subband encoded data of sub-image 1 can be decoded one by one to obtain the decoded high-frequency subband. The structure of the LL subband encoded data is also based on each sub-image as the granularity, and the encoded data of each sub-image includes the LL subband encoded data of each macroblock in the sub-image.
[0242] In the embodiments of this application, multiple independently decoded encoded data can be decoded simultaneously, or one or more high-frequency subbands can be decoded simultaneously, and the number of simultaneous decodes depends on the decoder hardware performance.
[0243] Referring to Figure 9, which is a flowchart illustrating an exemplary encoding method, the specific steps include, but are not limited to, the following:
[0244] S901, obtain the scanning result of the quantization coefficient block corresponding to the block to be encoded. The quantization coefficient block includes N quantization coefficients, and the N quantization coefficients include non-zero quantization coefficients. N is an integer greater than 1. The scanning result is one-dimensional data.
[0245] For example, the block to be encoded can be a macroblock, such as an 8x8 block (unit: pixels). The block to be encoded can include chroma components and luminance components.
[0246] For example, the quantization coefficient block corresponding to the block to be encoded described in the embodiments of this application can be a quantization coefficient block of the chroma component or a quantization coefficient block of the luminance component. In some instances, the quantization coefficient block can also be called a transform block or a residual quantization block, etc. For example, in the wavelet architecture shown in Figure 4, the residual quantization block 407 can optionally be the quantization coefficient block corresponding to the block to be encoded described in the embodiments of this application, which can be a residual quantization block of the chroma component or a residual quantization block of the luminance component.
[0247] Wherein, the size of the quantization coefficient block for the chroma component and the quantization coefficient block for the luma component can be the same or different, and both are less than or equal to the size of the macroblock. For example, the size of the quantization coefficient block for the luma component can be 4x4, meaning that the quantization coefficients of the macroblock include four 4x4 quantization coefficient blocks corresponding to the chroma component. Accordingly, the quantization coefficients of the block to be encoded in this embodiment include the quantization coefficients in the quantization coefficient block for the chroma component and the quantization coefficients in the quantization coefficient block for the luma component. The quantization coefficient block is a matrix containing multiple quantization coefficients.
[0248] Specifically, taking the chroma component as an example, as shown in Figure 4, the encoder can obtain the residual block of the chroma component based on the current block (i.e., macroblock 404) and the prediction block. The encoder quantizes the residual block to obtain the residual quantization block 407 (which can also be called the quantization coefficient block of the chroma component).
[0249] In another example, the quantization coefficient block of the block to be encoded can be the quantization coefficient block composed of quantization coefficient 209 in Figure 2.
[0250] Referring to Figure 10, which is a schematic diagram of an exemplary quantization coefficient block, a 4x4 (pixel) quantization coefficient block is used as an example. In this embodiment, the quantization coefficient block can be either a chroma component quantization coefficient block or a luminance component quantization coefficient block, which will not be repeated below. As shown in Figure 10, a 4x4 quantization coefficient block includes 16 coefficients (each cell represents one coefficient). The quantization coefficient in the upper left corner is a direct current (DC) quantization coefficient, and the quantization coefficient in the lower right corner is referred to in this embodiment as the last quantization coefficient in the quantization coefficient block.
[0251] The encoding and decoding methods in this application embodiment are applied to the encoding and decoding process of quantization coefficient blocks including non-zero quantization coefficients. That is, the quantization coefficient blocks involved in this application embodiment are all non-all-zero quantization coefficient blocks, meaning they include at least one non-zero quantization coefficient. Optionally, the encoder can encode a `coded_block_flag` syntax element corresponding to each quantization coefficient block during encoding. This syntax element is used to indicate whether the corresponding quantization coefficient block includes non-zero coefficients. `coded_block_flag` being 0 indicates that the quantization coefficient block does not include non-zero coefficients, i.e., the quantization coefficients in the quantization coefficient block are all zeros. `coded_block_flag` being 1 indicates that the quantization coefficient block includes non-zero coefficients. Thus, the decoding end can determine whether the corresponding quantization coefficient block includes non-zero quantization coefficients by decoding the `coded_block_flag` syntax element. If non-zero quantization coefficients are included, decoding can continue according to the decoding method in this application embodiment.
[0252] For example, the encoder scans the quantization coefficient block of the block to be encoded to obtain the scan result of the quantization coefficient block. The encoder scans the quantization coefficient block to obtain the scan result of the quantization coefficient block. Wherein: the scan result is one-dimensional data.
[0253] Referring to Figure 11, which is an exemplary scanning diagram, this example illustrates a 4x4 quantization coefficient block, comprising 16 quantization coefficients, where each square represents one quantization coefficient. After acquiring the quantization coefficient block, the encoder scans it according to the scanning order to obtain the scanning result of the current quantization coefficient block. In this embodiment, the scanning order may optionally start from the direct current (DC) quantization coefficient of the quantization coefficient block (i.e., the quantization coefficient in the upper left corner) and end at the last quantization coefficient of the current quantization coefficient block (i.e., the quantization coefficient in the lower right corner).
[0254] Optionally, the scanning method in Figure 11 is a horizontal scanning method. This method is only an illustrative example. In other embodiments, other scanning sequences such as vertical scanning method and sawtooth scanning method can also be used to scan the quantization coefficient block to obtain the corresponding scanning results. The scanning sequence can be set according to actual needs.
[0255] In this embodiment, the scanning result is one-dimensional data. That is, the encoder can obtain the one-dimensional quantization coefficients corresponding to the quantization coefficient block by scanning the quantization coefficient block.
[0256] For example, referring to Figure 12, which is an exemplary schematic diagram of the scanning result, the encoder scans the quantization coefficient block in Figure 12 in the order shown in Figure 11 to obtain a one-dimensional scanning result. In this example, the quantization coefficient block includes 16 quantization coefficients, namely X_0, X_1, ..., X15. The one-dimensional data in the scanning result is arranged in the order of scanning; that is, the first quantization coefficient in the scanning result is the first quantization coefficient scanned, which in this example is the DC quantization coefficient, and the 16th quantization coefficient in the scanning result is the last quantization coefficient scanned, which in this example is the last quantization coefficient located at the lower right corner of the quantization coefficient block.
[0257] In one possible implementation, this application can represent the corresponding quantization coefficient as the i-th quantization coefficient in the scan coefficients using the number information. The i-th quantization coefficient in the scan result refers to its order in the scan sequence; correspondingly, the value of i is an integer greater than 0, i.e., counting from 1. As shown in Figure 12, the DC quantization coefficient is the first quantization coefficient in the scan result (also called the first quantization coefficient), and the last quantization coefficient in the quantization coefficient block (i.e., X_15) is the 16th quantization coefficient in the scan result.
[0258] In another possible implementation, this application can use a position value to represent the position of the corresponding quantization coefficient in the scan result. The position value is (number - 1), and in this embodiment, the position value starts counting from 0. As shown in Figure 12, the position information of the DC quantization coefficient in the scan result is 0, which is position 0, also known as the 0th bit. The position value of the last quantization coefficient in the quantization coefficient block, i.e., the last quantization coefficient scanned, is 15, which is the number of quantization coefficients in the quantization coefficient block, and its value is N (in this embodiment, it can be denoted as MaxNumCoeff, for example, 16) minus 1. The position of the quantization coefficient in the scan result described in this embodiment can be described using any of the above methods. Typically, the second position indication method is used during encoding and decoding.
[0259] S902, based on the position of a specific non-zero quantization coefficient in the scanning result, skips L quantization coefficients in the scanning result and encodes the indication information corresponding to M quantization coefficients other than L quantization coefficients to obtain the bitstream of the image to be encoded; M is an integer greater than or equal to 0, L is an integer greater than 0, and the sum of M and L is less than or equal to N, and the image to be encoded includes the block to be encoded.
[0260] For example, after the encoder obtains the scan result of the quantization coefficient block of the block to be encoded, it can determine the position of a specific non-zero quantization coefficient in the scan result. The position of the specific non-zero quantization coefficient block in the scan result can also be used to represent the position of the specific non-zero quantization coefficient block within the quantization coefficient block. This can be understood as the decoding side, based on the same scan order as the encoding side, determining the position of the specific non-zero quantization coefficient in the quantization coefficient block based on its position in the scan result.
[0261] For example, a specific non-zero quantization coefficient can be either the first non-zero quantization coefficient in the scan result after scanning the quantization coefficients, or it can be the last non-zero quantization coefficient.
[0262] In one possible implementation, the scanning order is from the DC quantization coefficient to the last quantization coefficient. In this example, a specific non-zero quantization coefficient refers to the last non-zero quantization coefficient scanned, hereinafter referred to as the last non-zero quantization coefficient.
[0263] The encoding / decoding method in this embodiment takes the scanning order shown in Figure 11 as an example to encode and decode the position information of the last non-zero quantization coefficient. In another possible implementation, the scanning order is from the last quantization coefficient of the quantization coefficient block to the DC quantization coefficient. In this example, the specific non-zero quantization coefficient indicates the first non-zero quantization coefficient scanned, and its position information is encoded in a similar way to the encoding method of the last non-zero quantization coefficient. This application will not repeat the example.
[0264] In the embodiments of this application, the last non-zero quantization coefficient refers to the last non-zero quantization coefficient detected during scanning. For example:
[0265] Referring to Figure 13A, which is an exemplary schematic diagram of the scan result, this example still uses a 4x4 block of quantization coefficients. Based on the scan result, the encoder determines the last non-zero quantization coefficient in the scan result as X_15 (e.g., a value of -9, which is only an illustrative example), and further determines the position value of the last non-zero quantization coefficient as 15 (i.e., position 15).
[0266] Referring to Figure 13B, which is an exemplary schematic diagram of the scan result, this example still uses a 4x4 block of quantization coefficients. Based on the scan result, the encoder determines the last non-zero quantization coefficient in the scan result as X_14 (e.g., a value of -9, for illustrative purposes only), where the value of the last quantization coefficient in the scan result is 0. The encoder further determines the position value of the last non-zero quantization coefficient as 14 (i.e., position 14).
[0267] In this embodiment, the encoder can describe the position of a specific non-zero quantization coefficient within the quantization coefficient block using position information. Thus, during decoding, the decoder can determine the position of the specific non-zero quantization coefficient within the quantization coefficient block based on the position information, and thereby determine the positions of other decoded quantization coefficients within the quantization coefficient block, thereby obtaining the quantization coefficient block.
[0268] For example, the encoder encodes position information to obtain encoded position information data. The encoder writes the encoded position information data into the bitstream of the image to be encoded. The image to be encoded includes blocks to be encoded. In this embodiment, the block to be encoded can also be referred to as the current block, which will not be elaborated further below.
[0269] In this embodiment, after the encoder determines the position of the last non-zero quantization coefficient in the scan result, it can skip L quantization coefficients in the scan result based on the position of the specific non-zero quantization coefficient, and encode the indication information corresponding to M quantization coefficients other than the L quantization coefficients to obtain the encoded data of the indication information of the M quantization coefficients. The encoded data of the indication information of the M quantization coefficients is then written into the bitstream. Here, M is an integer greater than or equal to 0, L is an integer greater than 0, and the sum of M and L is less than or equal to N.
[0270] In this embodiment of the application, the indication information includes at least one of the following: a syntax element for indicating whether the absolute value of the corresponding quantization coefficient is greater than a first value; a syntax element for indicating whether the corresponding quantization coefficient is 0 (e.g., denoted as significant_coeff_flag).
[0271] Optionally, the first value can be 1, and the corresponding syntax element can be denoted as: coeff_abs_level_greater1_flag, which indicates whether the corresponding quantization coefficient is greater than 1. The value of the first value can be set according to actual needs; this application is only an illustrative example.
[0272] Optionally, a significant_coeff_flag value of 0 indicates that the corresponding quantization coefficient is 0, and a significant_coeff_flag value of 1 indicates that the corresponding quantization coefficient is non-zero. The specific value can be set according to actual needs.
[0273] Specifically, after the encoder determines the position of the last non-zero coefficient (referring to its position in the scan result), it can determine the L quantization coefficients that need to be skipped and the M quantization coefficients that need to be encoded with indication information based on the position of the last non-zero coefficient.
[0274] In this embodiment, skipping L quantization coefficients can be understood as the encoder not encoding the indication information of the L quantization coefficients during encoding. The encoder may optionally encode the remaining absolute values of the L quantization coefficients and the sign bit. Wherein: the remaining absolute values of the L quantization coefficients are equal to the absolute values of the L quantization coefficients.
[0275] In one possible implementation, if the L quantization coefficients include the last non-zero quantization coefficient, then the remainder of the absolute value of the last non-zero quantization coefficient is the absolute value of the last non-zero quantization coefficient minus 1.
[0276] For the M quantization coefficients that are not skipped, the encoder encodes the indication information of the M quantization coefficients, the remaining value of the absolute value of the quantization coefficients, and the sign bit during encoding.
[0277] The following is a brief explanation of the encoding method for the residual values of the absolute values of the M quantization coefficients and their indication information:
[0278] Referring to Figure 14, which is an exemplary illustration of the residual value, the syntax element for the residual value of the absolute value of a quantization coefficient is represented as `coeff_abs_level_remaining`. The residual value of the absolute value of a quantization coefficient is the portion (or numerical value) greater than a given value. Referring to Figure 14, assuming the given value is B0, the residual value of the absolute value of the quantization coefficient is the portion greater than B0, with an initial value of B0+1.
[0279] Optionally, the given value can be at least one numerical value such as 0, 1, or 2, which can be set according to actual needs.
[0280] For example, taking a given value of 1, in one example, if the quantization coefficient to be encoded is 0, the encoder can encode `significant_coeff_flag`, a syntax element used to indicate whether the corresponding quantization coefficient is 0. Specifically, `significant_coeff_flag` being 0 indicates that the corresponding quantization coefficient is 0, and `significant_coeff_flag` being 1 indicates that the corresponding quantization coefficient is not 0. Correspondingly, the bitstream includes encoded data where `significant_coeff_flag` = 0 to indicate that the corresponding quantization coefficient is 0, but does not include encoded data for that quantization coefficient itself. In other words, during decoding, the decoder can determine that the corresponding quantization coefficient is 0 based on `significant_coeff_flag` being 0.
[0281] Of course, in some instances, significant_coeff_flag can also be considered as one of the encoded data of the quantization coefficient. Accordingly, in this example, it can also be understood as the encoded data of the quantization coefficient included in the bitstream. The encoded data of the quantization coefficient includes the encoded data of significant_coeff_flag=0, but does not include the encoded data of the residual value of the absolute value of the quantization coefficient.
[0282] In another example, if the quantization coefficient to be encoded is 1, the encoder can encode `significant_coeff_flag` and `coeff_abs_level_greater1_flag`. Here, `coeff_abs_level_greater1_flag` indicates whether the absolute value of the corresponding quantization coefficient is greater than a first value (e.g., 1). `coeff_abs_level_greater1_flag` being 0 indicates that the absolute value of the corresponding quantization coefficient is 1. `coeff_abs_level_greater1_flag` being 1 indicates that the absolute value of the corresponding quantization coefficient is greater than 1. Optionally, in this example (i.e., the absolute value of the quantization coefficient is 1), the encoder can encode the `significant_coeff_flag` and `coeff_abs_level_greater1_flag` of that quantization coefficient, where `significant_coeff_flag` is 1 and `coeff_abs_level_greater1_flag` is 0. Accordingly, the bitstream includes encoded data where significant_coeff_flag = 1 and coeff_abs_level_greater1_flag = 0 for the quantization coefficient, indicating that the absolute value of the corresponding quantization coefficient is 1, but does not include the encoded data of the quantization coefficient itself. In other words, during decoding, the decoder can determine that the absolute value of the corresponding quantization coefficient is 1 based on significant_coeff_flag and coeff_abs_level_greater1_flag.
[0283] In another example, if the quantization factor to be encoded is greater than 1, the encoder can encode the quantization factor's significance_coeff_flag, coeff_abs_level_greater1_flag, and coeff_abs_level_remaining. Here, significance_coeff_flag being 1 indicates that the corresponding quantization factor is non-zero; coeff_abs_level_greater1_flag being 1 indicates that the corresponding quantization factor is greater than 1; and coeff_abs_level_remaining is the portion (or value) whose absolute value is greater than a given value.
[0284] In this embodiment, the encoder may use arithmetic encoding to encode the indication information and VLC encoding to encode the residual value of the absolute value of the quantization coefficient and the sign bit.
[0285] In this embodiment, during encoding, quantization coefficients with a value of 0 after the last non-zero quantization coefficient in the scan result are not encoded by the encoder. For example, X_15 in Figure 13B, which is after the last non-zero quantization coefficient, has a value of 0 and is not encoded by the encoder. Thus, during decoding, the decoder, based on the position of the last non-zero quantization coefficient in the scan sequence, can determine that all quantization coefficients after the last non-zero quantization coefficient in the scan sequence are 0, thereby eliminating the need to encode and decode these 0-value quantization coefficients, reducing encoding and decoding complexity, improving encoding efficiency, and saving resources occupied by the bitstream transmission. Accordingly, in this embodiment, M quantization coefficients are those after the skipped L quantization coefficients and before the last non-zero quantization coefficient (including the last non-zero quantization coefficient). That is, the sum of L and M is less than or equal to N. Here, N is the number of quantization coefficients included in the quantization coefficient block.
[0286] The encoding method in the embodiments of this application will be described in detail below in conjunction with the wavelet architecture. Of course, the encoding and decoding methods in the embodiments of this application can also be applied to other architectures, and their implementation is similar. This application will not provide examples of each one.
[0287] Referring to Figure 15, which is a schematic flowchart illustrating an exemplary encoding method, S901, exemplaryly, also includes, but is not limited to, the following steps:
[0288] The encoder acquires the image to be encoded. The image to be encoded can be the original image, or it can be the image to be encoded after processing the original image (e.g., a left shift operation), or it can be the sub-image shown in Figure 4.
[0289] The encoder performs wavelet transform on the image to be encoded to obtain the wavelet coefficients of the low-frequency subband of the image to be encoded, such as wavelet coefficient 403 of the low-frequency subband in Figure 4.
[0290] The encoder divides the image into blocks based on the wavelet coefficients of the low-frequency sub-bands of the image to be encoded, and obtains the wavelet coefficients of the low-frequency sub-bands of the block to be encoded, such as macroblock 404 in Figure 4.
[0291] The encoder quantizes the wavelet coefficients of the low-frequency subband of the block to be encoded to obtain the quantized coefficient block of the block, which can also be called the quantized coefficient block of the low-frequency subband of the block to be encoded, such as the residual quantization block 407 in Figure 4. Undescribed parts can be referred to in Figure 4 and will not be elaborated here.
[0292] The encoder scans the quantization coefficient block to obtain the scan result. The scan result is one-dimensional data. Based on the scan result, the encoder acquires the bitstream. A specific non-zero quantization coefficient is either the first or the last non-zero quantization coefficient in the scan result. The scanning method is described above and will not be repeated here.
[0293] Referring to Figure 16, which is a schematic flowchart illustrating an exemplary encoding method, S902, exemplaryly, also includes, but is not limited to, the following steps:
[0294] The one-dimensional quantization coefficients in the scan result obtained by the encoder can be used to determine the position of the last non-zero quantization coefficient. The description of the position is as described above and will not be repeated here.
[0295] The encoder obtains position information representing the position of a specific non-zero quantization coefficient based on the position of the last non-zero quantization coefficient. Specifically, after determining the position of the last non-zero quantization coefficient in the scan result, the encoder can obtain the corresponding position value (the concept is explained above and will not be repeated here). The encoder can obtain position information based on the position value. This can be understood as a binarization process, which yields a binary value representing the position value (e.g., position 7).
[0296] In one possible implementation, the scanning order is from the DC quantization coefficient to the last quantization coefficient. In this example, a specific non-zero quantization coefficient refers to the last non-zero quantization coefficient scanned, hereinafter referred to as the last non-zero quantization coefficient.
[0297] The encoding / decoding method in this embodiment takes the scanning order shown in Figure 11 as an example to encode and decode the position information of the last non-zero quantization coefficient. In another possible implementation, the scanning order is from the last quantization coefficient of the quantization coefficient block to the DC quantization coefficient. In this example, the specific non-zero quantization coefficient indicates the first non-zero quantization coefficient scanned, and its encoding and decoding method is similar to that described in this application, and will not be illustrated in detail here.
[0298] It should be noted that the non-zero quantization coefficients (e.g., the last non-zero quantization coefficient) mentioned in this application are quantization coefficients whose values are not 0. The quantization coefficients mentioned in this application can be 0 or non-zero values (i.e., non-zero quantization coefficients).
[0299] The encoder encodes the position information to obtain the encoded position data, and writes it into the bitstream.
[0300] Referring again to Figure 16, the encoder determines the regular stop position (denoted as RegularStopPos) based on the position of the last non-zero quantization coefficient. In this embodiment, the regular stop position corresponds to the first quantization coefficient in the scan result. Wherein: L quantization coefficients include quantization coefficients in the scan result preceding the first quantization coefficient, and M quantization coefficients include the first quantization coefficient, a specific non-zero quantization coefficient, and quantization coefficients between the first quantization coefficient and the specific non-zero quantization coefficient (if any).
[0301] In this embodiment, the encoder has a preset regular stop position table (denoted as RegularStopPos Table), which includes N regular stop positions. The N regular stop positions correspond one-to-one with the N positions of a specific quantization coefficient in the scan result. In the N regular stop positions in the regular stop position table, the previous regular stop position is not greater than the next regular stop position (i.e., monotonically non-increasing), or the previous regular stop position is not less than the next regular stop position (i.e., monotonically non-decreasing).
[0302] Optionally, the encoder can preset a corresponding conventional stop position table for quantization coefficient blocks of different sizes. For example, for a 4x4 quantization coefficient block, the corresponding N value is 16. The conventional stop position table for this size quantization coefficient block can optionally be {14,9,6,4,3,2,1,1,1,1,1,1,1,1,1,1}. Each parameter in the table corresponds to a position in a scan result, and the value of each coefficient indicates which quantization coefficients need to be skipped. The values in the tables involved in this application are only illustrative examples and can be set according to actual needs.
[0303] In this embodiment, the encoding and decoding order is the reverse of the scanning result (it can also be the same order in other embodiments), and the parameters in the regular stop position table also correspond to the reverse order in the scanning result. For example, position 15 in the scanning result corresponds to the first parameter in the table. That is, if the last non-zero quantization coefficient is position 15 in the scanning result (i.e., the 16th scanned quantization coefficient), the encoder determines the corresponding RegularStopPos based on the first parameter in the table.
[0304] Optionally, in this embodiment, the L quantization coefficients include DC quantization coefficients. This can be understood as the encoder skipping the indication information of at least one quantization coefficient; that is, the indication information of DC quantization coefficients is not encoded in the bitstream.
[0305] Optionally, this embodiment uses a standard stop position table with a length of N, i.e., including N parameters, as an example for illustration. In practical applications, the length of the standard stop position table can also be other values, such as 6. In this example, starting from the 7th parameter, the default parameter value is 1.
[0306] In one possible implementation, the values of each parameter in the table can be understood as the position value of the first quantization parameter corresponding to the normal stop position. During encoding, as mentioned above, the encoding order is the reverse of the scanning order. The encoder starts from the last non-zero quantization coefficient and encodes the indication information corresponding to each quantization coefficient one by one in the reverse order of the scanning results, until the first quantization coefficient (including the quantization coefficient) corresponding to the normal stop position.
[0307] For example, referring to Figure 17, which is an exemplary schematic diagram of RegularStopPos, taking the value of the first parameter in the table (i.e., 14) as an example, assuming the last non-zero quantization coefficient is located at position 15 in the scan result, the encoder, based on this position value (i.e., 15), looks up the corresponding parameter in the table as the first parameter, whose value is 14. The encoder can determine that RegularStopPos is position 14 in the scan result, and quantization coefficient X_14 is the first quantization coefficient corresponding to RegularStopPos. As mentioned above, the encoding order is the reverse order of the scan result. That is, during encoding, the encoder obtains the last non-zero quantization coefficient, the quantization coefficients between the last non-zero quantization coefficient and quantization coefficient X_14 (which may not exist, depending on the value of the parameter in the table), and the indication information of quantization coefficient X_14, and encodes the indication information. That is, after the encoder encodes the indication information of quantization coefficient X_15, and then encodes the indication information of quantization coefficient X_14, it stops encoding the indication information. Subsequent quantization coefficients do not encode indication information; instead, they encode the residual value of the absolute value of each quantization coefficient.
[0308] In another possible implementation, the values of each parameter in the table can also be understood as the number of quantization coefficients to be skipped. For example, still using Figure 17, the encoder can determine, based on the value of the corresponding parameter in the table (e.g., 14), to skip 14 quantization coefficients (i.e., L = 14) from the first quantization coefficient in the scan result, including quantization coefficients X_0 to X_13 corresponding to positions 0 to 13. The encoder can then determine RegularStopPos as the quantization coefficient X_14.
[0309] Please refer to Figure 16. The encoder can obtain the indication information of M quantization coefficients, the remaining value of the absolute value of M quantization coefficients, and the remaining value of the absolute value of L quantization coefficients based on RegularStopPos and the scan results.
[0310] For example, after the encoder determines RegularStopPos, it can encode from the last non-zero quantization coefficient in the reverse order of the scan sequence.
[0311] Specifically, during the encoding of the M quantization coefficients, the encoder acquires indication information for each of the M quantization coefficients. This indication information includes, but is not limited to, at least one of the following: significant_coeff_flag and coeff_abs_level_greater1_flag. The acquisition method is described above and will not be repeated here. Following the reverse scan order, the encoder encodes the indication information for each of the M quantization coefficients using arithmetic coding to obtain the encoded data of the indication information, which is then written into the bitstream.
[0312] After the encoder completes the encoding of the indication information of the first quantization coefficient corresponding to RegularStopPos, it has completed the encoding of the indication information of the quantization coefficients of the quantization coefficient block.
[0313] The encoder encodes the residual values of the absolute values of the M quantization coefficients using VLC encoding in reverse order of the scan sequence. Furthermore, the encoder encodes the sign bits of the M quantization coefficients. The encoder then writes the corresponding encoded data into the bitstream. Optionally, the encoding of the residual values of the absolute values of the quantization coefficients and the encoding of the indication information can be parallel or serial.
[0314] Furthermore, the encoder continues in reverse order of the scan sequence, using the conventional VLC encoding method to encode the remaining values of the absolute values of the L quantization coefficients. The encoder also encodes the sign bits of the L quantization coefficients. In this embodiment, the encoder directly obtains the remaining values of the absolute values of the L quantization coefficients, where the remaining absolute values of the L quantization coefficients are the absolute values of the quantization coefficients themselves. Alternatively, this step can be understood as directly encoding the absolute values and sign bits of the L quantization coefficients. Specifically, if any of the L quantization coefficients has a value of 0, the encoder also encodes it. That is, if any of the M quantization coefficients has a value of 0, the encoder can indicate that the quantization coefficient is 0 via `significant_coeff_flag`, without needing to encode the corresponding absolute value of the quantization coefficient. In other words, the bitstream includes the encoded data of the `significant_coeff_flag` of the quantization coefficient, but not the encoded data of the remaining absolute value of the quantization coefficient. If there is a quantization coefficient with a value of 0 among the L quantization coefficients, the encoder encodes that quantization coefficient. That is, the bitstream includes the coded data of the absolute value of the quantization coefficient (i.e., 0), but does not include the indication information of the quantization coefficient (significant_coeff_flag and coeff_abs_level_greater1_flag).
[0315] Referring to Figure 18, which is a schematic flowchart of an exemplary decoding method, the specific steps include, but are not limited to, the following:
[0316] S1801, Obtain the bitstream of the image to be decoded, the image to be decoded includes the block to be decoded.
[0317] For example, the decoder acquires a bitstream generated by, for instance, the encoder. The bitstream includes the encoded data of the image to be decoded. For example, the image to be decoded can also be called the current image. The image to be decoded includes blocks to be decoded, also called the current block. That is, the encoded data of the image to be decoded includes the encoded data of the blocks to be decoded. During the decoding process, decoding is also performed using macroblocks (i.e., the blocks to be decoded) as the basic decoding unit.
[0318] In an optional embodiment, the image to be decoded can be the original image, or a sub-image after the original image has been divided, etc.
[0319] For example, the bitstream includes encoded data of the image to be decoded, including but not limited to: encoded data of position information, encoded data of indication information of M quantization coefficients, encoded data of the remaining values of the absolute values of M quantization coefficients, encoded data of the remaining values of the absolute values of L quantization coefficients, etc. S1802, the bitstream is decoded to obtain position information of specific non-zero quantization coefficients, the position information being used to indicate the position of the specific non-zero quantization coefficients in the scanning sequence.
[0320] For example, the decoder decodes the bitstream to obtain position information. The decoder has a preset scan order, which is consistent with the scan order on the encoding side. The description of the position information can be found on the encoding side and will not be repeated here. Thus, the decoder can determine the position of the last non-zero quantization coefficient in the scan order based on the position information. After determining the position of the last non-zero quantization coefficient, the decoder can determine the positions of the subsequent quantization coefficients to be decoded in the scan order.
[0321] S1803, based on position information, skips L quantization coefficients in the scanning sequence and decodes the indication information corresponding to M quantization coefficients other than the L quantization coefficients.
[0322] For example, the decoder can determine the position of the last non-zero quantization coefficient in the scan sequence based on the position information. Specifically, the decoder performs an inverse binarization operation on the position information to obtain the position value corresponding to the position information, thereby determining the position of the last non-zero quantization coefficient in the scan sequence.
[0323] For example, the decoder can determine the regular stop position (RegularStopPos) based on the position of the last non-zero quantization coefficient in the scan sequence. Specifically, the decoder looks up the corresponding parameter in the regular stop position table based on the position of the last non-zero quantization coefficient in the scan sequence. Based on the value of this parameter, the first quantization coefficient corresponding to RegularStopPos in the scan sequence can be obtained. For specific implementation details, please refer to the encoding side; they will not be elaborated here.
[0324] For example, the decoder skips the quantization coefficients before the first quantization coefficient (i.e., L quantization coefficients), and decodes the first quantization coefficient, the quantization coefficients between the first quantization coefficient and the last non-zero quantization coefficient (if any), and the indication information of the last non-zero quantization coefficient (i.e., M quantization coefficients). The indication information includes, but is not limited to, significant_coeff_flag and coeff_abs_level_greater1_flag. That is, the decoder determines which coefficients need to have coeff_abs_level_greater1_flag and significant_coeff_flag decoded; otherwise, it directly decodes the value and sign bit of the remaining absolute value of the quantization coefficient (coeff_abs_level_remaining).
[0325] S1804 decodes the bitstream based on the indication information of M quantization coefficients to obtain M quantization coefficients.
[0326] Specifically, for M quantization coefficients, the decoder can determine whether there is encoded data in the bitstream containing the residual value of the absolute value of the corresponding quantization coefficient, based on significant_coeff_flag and coeff_abs_level_greater1_flag.
[0327] In one example, if the bitstream does not contain encoded data of the residual absolute value of a certain quantization coefficient, the encoder can directly decode the corresponding quantization coefficient based on syntax elements such as significant_coeff_flag and coeff_abs_level_greater1_flag.
[0328] In another example, if the bitstream contains encoded data of the residual absolute value of a certain quantization coefficient, the decoder decodes the bitstream to obtain the residual absolute value of the quantization coefficient of the block to be decoded.
[0329] For example, after the decoder decodes the remainder of the absolute value of a quantization coefficient, it can also obtain the numerical value of the quantization coefficient based on other syntax elements corresponding to that quantization coefficient. Other syntax elements include, but are not limited to, the sign bit and `coeff_abs_level_greater1_flag`. For instance, if a quantization coefficient corresponds to `coeff_abs_level_greater1_flag`, then the absolute value of its quantization coefficient is the sum of the remainder of the absolute value of the quantization coefficient and (the given value + 1). Here, `coeff_abs_level_greater1_flag` indicates whether the remainder of the absolute value of the quantization coefficient is greater than 1, and the corresponding given value is 1. The decoder can obtain the corresponding quantization coefficient by obtaining the sign bit and the absolute value of the quantization coefficient.
[0330] S1805 decodes the bitstream to obtain L quantization coefficients.
[0331] Specifically, for L quantization coefficients, the decoder decodes the bitstream to obtain the residual values of the absolute values of the L quantization coefficients and the sign bit, thereby obtaining the L quantization coefficients.
[0332] Furthermore, in this embodiment, during encoding, the encoder encodes the quantization coefficients before the last non-zero quantization coefficient in the scan result; that is, the bitstream does not include encoded data of quantization coefficients with a value of 0 after the last non-zero quantization coefficient. Correspondingly, during decoding, after the decoder obtains the position of the last non-zero quantization coefficient, it can determine that the values of all quantization coefficients after the last non-zero quantization coefficient in the scan order are 0. Based on the scan order, it determines the position of these quantization coefficients with a value of 0 within the quantization coefficient block.
[0333] S1806, based on M quantization coefficients and L quantization coefficients, obtain the quantization coefficient block of the block to be decoded; wherein: the quantization coefficient block includes N quantization coefficients, and the N quantization coefficients include non-zero quantization coefficients, N is an integer greater than 1, M is an integer greater than or equal to 0, L is an integer greater than 0, and the sum of M and L is less than or equal to N.
[0334] For example, after the decoder obtains the quantization coefficients and determines the position of each quantization coefficient in the quantization coefficient block, it can obtain the corresponding quantization coefficient block.
[0335] Specifically, the decoder decodes M and L quantization coefficients by determining the position of each quantization coefficient within the quantization coefficient block based on the scan order, thus obtaining the quantization coefficient block of the block to be decoded. This can be viewed as the inverse operation of the scan operation; a detailed description can be found on the encoding side and will not be repeated here.
[0336] S1807, based on the quantization coefficient block, obtains the reconstructed data of the block to be decoded.
[0337] For example, the decoder can obtain the reconstructed data of the low-frequency subband of the block to be decoded based on the quantization coefficient block of the block to be decoded. Then, it performs an inverse wavelet transform based on the reconstructed data of the low-frequency subband to obtain the reconstructed data of the block to be decoded.
[0338] Specifically, the decoder obtains the quantization coefficient block of the block to be decoded, such as the quantization coefficient 702 of the low-frequency subband block in Figure 7A or Figure 7B.
[0339] The decoder obtains the reconstructed low-frequency subband data of the block to be decoded based on the quantization coefficient block of the block to be decoded, such as the low-frequency subband reconstruction block 704 in Figure 7A or Figure 7B.
[0340] Next, the decoder can perform an inverse wavelet transform based on the reconstructed data of the low-frequency subband of the block to be decoded to obtain the reconstructed data of the block to be decoded, such as reconstructed block 734 in Figure 7B. Based on the reconstructed data of the block to be decoded, the decoder can obtain the reconstructed data of the image to be decoded, such as reconstructed image 733 in Figure 7B.
[0341] In the example shown in Figure 7A, the decoder can obtain the reconstructed low-frequency subband data of the image to be decoded based on the reconstructed low-frequency subband data of the block to be decoded, such as the reconstructed low-frequency subband 706 in Figure 7A. The decoder can perform inverse wavelet transform based on the reconstructed low-frequency subband data of the image to be decoded to obtain the reconstructed data of the image to be decoded, such as the reconstructed sub-image 732.
[0342] Referring to Figure 19, Figure 19 is a schematic structural diagram of a video decoding device 1900 provided in an embodiment of this application. The video decoding device 1900 is suitable for implementing the embodiments described herein. In one embodiment, the video decoding device 1900 may be a video decoder (e.g., the decoder shown in Figures 3, 7A, and 7B) or a video encoder (e.g., the encoder shown in Figures 2 and 4). In another embodiment, the video decoding device 1900 may be one or more components of the aforementioned decoder or encoder.
[0343] The video decoding device 1900 includes: an input port 1910 and a receiving unit (Rx) 1920 for receiving data; a processor, logic unit, or central processing unit (CPU) 1930 for processing data; a transmitter unit (Tx) 1940 and an output port 1950 for transmitting data; and a memory 1960 for storing data. The video decoding device 1900 may also include photoelectric conversion components and electro-optic (EO) components coupled to the input port 1910, the receiver unit 1920, the transmitter unit 1940, and the output port 1950 for the input or output of optical or electrical signals.
[0344] Processor 1930 is implemented in both hardware and software. Processor 1930 can be implemented as one or more CPU chips, cores (e.g., multi-core processors), FPGAs, ASICs, and DSPs. Processor 1930 communicates with ingress port 1910, receiver unit 1920, transmitter unit 1940, egress port 1950, and memory 1960. Processor 1930 includes encoding module 1970 or decoding module 1970. Encoding / decoding module 1970 implements the embodiments disclosed herein to implement the encoding or decoding methods provided by the embodiments of this application. For example, encoding / decoding module 1970 implements, processes, or provides various encoding operations. Therefore, encoding / decoding module 1970 provides substantial improvements to the functionality of video decoding device 1900 and affects the transitions of video decoding device 1900 to different states. Alternatively, encoding / decoding module 1970 can be implemented with instructions stored in memory 1960 and executed by processor 1930.
[0345] Memory 1960 includes one or more disks, tape drives, and solid-state drives, which can be used as overflow data storage devices to store programs while they are selectively executed, and to store instructions and data read during program execution. Memory 1960 can be volatile and / or non-volatile, and can be read-only memory (ROM), random access memory (RAM), ternary content-addressable memory (TCAM), and / or static random access memory (SRAM).
[0346] Referring to FIG20, FIG20 is a simplified block diagram of an apparatus 2000 that can be used as either or both of the source device 12 and destination device 14 in FIG1A according to an exemplary embodiment. The apparatus 2000 can implement the technology of this application. In other words, FIG20 is a schematic block diagram of an implementation of an encoder or decoder (referred to as decoding apparatus 2000) according to an embodiment of this application. The apparatus 2000 may include a processor 2010, a memory 2030, and a bus system 2050. The processor 2010 and the memory 2030 are connected via the bus system 2050. The memory 2030 is used to store instruction / program code, and the processor 2010 is used to execute the instruction / program code stored in the memory 2030. The memory 2030 of the decoding apparatus 2000 stores instruction / program code, and the processor 2010 can call the program code stored in the memory 2030 to execute various video encoding or decoding methods described in this application. To avoid repetition, detailed descriptions are omitted here.
[0347] In this embodiment, the processor 2010 may be a central processing unit (CPU), or it may be other general-purpose processors, DSPs, ASICs, FPGAs, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0348] The memory 2030 may include read-only memory (ROM) or random access memory (RAM). Any other suitable type of storage device may also be used as memory 2030. Memory 2030 may include program code and data 2031 accessed by processor 2010 using bus 2050. Memory 2030 may further include an operating system 2033 and an application program 2035, which includes at least one program that allows processor 2010 to execute the encoding or decoding methods described in this application. For example, application program 2035 may include applications 1 to N, which further include video encoding or decoding applications that execute the encoding or decoding methods described in this application.
[0349] In addition to the data bus, the bus system 2050 may also include a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as bus system 2050 in the diagram.
[0350] Optionally, the decoding device 2000 may also include one or more output devices, such as a display 2070. In one example, the display 2070 may be a haptic display that combines a display with a haptic unit capable of operatively sensing touch input. The display 2070 may be connected to the processor 2010 via a bus 2050.
[0351] Based on the same inventive concept as the above method, this embodiment of the invention also provides an encoding device 2100, which includes: an acquisition module 2101 and an encoding module 2102. The acquisition module 2101 is used to acquire the scanning result of the quantization coefficient block corresponding to the block to be encoded. The quantization coefficient block includes N quantization coefficients, and the N quantization coefficients include non-zero quantization coefficients. N is an integer greater than 1, and the scanning result is one-dimensional data. The encoding module 2102 is used to skip L quantization coefficients in the scanning result based on the position of a specific non-zero quantization coefficient in the scanning result, and encode the indication information corresponding to M quantization coefficients other than the L quantization coefficients, to acquire the bitstream of the image to be encoded. M is an integer greater than or equal to 0, L is an integer greater than 0, and the sum of M and L is less than or equal to N. The image to be encoded includes the block to be encoded.
[0352] This application embodiment also provides a decoding device 2200, which includes: an acquisition module 2201, a decoding module 2202, and a reconstruction module 2203. The module comprises: an acquisition module 2201, used to acquire the bitstream of the image to be decoded, the image to be decoded including the block to be decoded; a decoding module 2202, used to: decode the bitstream to obtain the position information of specific non-zero quantization coefficients, the position information indicating the position of the specific non-zero quantization coefficients in the scanning order; based on the position information, skipping L quantization coefficients in the scanning order, and decoding the indication information corresponding to M quantization coefficients other than L quantization coefficients; based on the indication information of M quantization coefficients, decoding the bitstream to obtain M quantization coefficients; decoding the bitstream to obtain L quantization coefficients; and based on the M quantization coefficients and L quantization coefficients, obtaining the quantization coefficient block of the block to be decoded; wherein: the quantization coefficient block includes N quantization coefficients, and the N quantization coefficients include non-zero quantization coefficients, N is an integer greater than 1, M is an integer greater than or equal to 0, L is an integer greater than 0, and the sum of M and L is less than or equal to N; and a reconstruction module 2203, used to acquire the reconstructed data of the block to be decoded based on the quantization coefficient block.
[0353] All relevant content of each step involved in the above method embodiments can be referenced from the functional description of the corresponding functional module, and will not be repeated here.
[0354] This application also provides a chip, including one or more interface circuits and one or more processors; the one or more processors receive or send data through the one or more interface circuits, and when the one or more processors execute computer instructions, the steps of the above-described related method steps that implement the method in the above embodiments are executed.
[0355] This embodiment also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on an electronic device, the electronic device performs the aforementioned method steps to implement the methods described in the above embodiments.
[0356] This embodiment also provides a computer program product comprising computer instructions that, when executed by a computer or processor, cause the computer to perform the aforementioned steps to implement the methods described in the above embodiments. Exemplarily, the computer program product may be stored in a computer-readable storage medium.
[0357] The computer-readable storage medium in this application includes random access memory (RAM), flash memory, read-only memory (ROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, read-only optical discs (CD-ROMs), or any other form of storage medium known in the art.
[0358] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component, or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the methods in the above-described method embodiments.
[0359] In this embodiment, the device, computer-readable storage medium, computer program product, or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can be referred to the beneficial effects in the corresponding methods provided above.
[0360] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0361] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0362] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0363] Furthermore, the functional units in the various embodiments of this application 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 can be implemented in hardware or as a software functional unit.
[0364] Any content in the various embodiments of this application, as well as any content in the same embodiment, can be freely combined. Any combination of the above content is within the scope of this application.
[0365] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
Claims
1. An encoding method, characterized in that, include: Obtain the scanning result of the quantization coefficient block corresponding to the block to be encoded. The quantization coefficient block includes N quantization coefficients, and the N quantization coefficients include non-zero quantization coefficients. N is an integer greater than 1. The scanning result is one-dimensional data. Based on the position of a specific non-zero quantization coefficient in the scan result, skip L quantization coefficients in the scan result and encode the indication information corresponding to M quantization coefficients other than the L quantization coefficients to obtain the bitstream of the image to be encoded; M is an integer greater than or equal to 0, L is an integer greater than 0, and the sum of M and L is less than or equal to N. The image to be encoded includes the block to be encoded.
2. The method according to claim 1, characterized in that, The scan result is obtained by scanning from the DC quantization coefficients of the quantization coefficient block to the last quantization coefficient of the quantization coefficient block, wherein the specific non-zero quantization coefficient is the last non-zero quantization coefficient scanned.
3. The method according to claim 2, characterized in that, The step of obtaining the encoded data of the block to be encoded based on the scanning results includes: Based on the position of the specific quantization coefficient in the scan result, a regular stop position is obtained, the regular stop position corresponding to the first quantization coefficient in the scan result; wherein: the L quantization coefficients include the quantization coefficients in the scan result before the first quantization coefficient, and the M quantization coefficients include the first quantization coefficient, the specific non-zero quantization coefficient, and the quantization coefficients between the first quantization coefficient and the specific non-zero quantization coefficient.
4. The method according to claim 3, characterized in that, The step of obtaining the conventional stop position based on the position of the specific quantization coefficient in the scan result includes: Based on the position of the specific quantization coefficient in the scan result and the regular stop position table, the regular stop position is obtained. The regular stop position table includes N regular stop positions, and the N regular stop positions correspond one-to-one with the N positions of the specific quantization coefficient in the scan result. In the N regular stop positions in the regular stop position table, the preceding regular stop position is not greater than the following regular stop position, or the preceding regular stop position is not less than the following regular stop position.
5. The method according to any one of claims 1 to 4, characterized in that, The bitstream also includes: Encoded data of the residual values of the absolute values of the L quantization coefficients; and The encoded data of the residual values of the absolute values of the M quantization coefficients.
6. The method according to any one of claims 1 to 5, characterized in that, The indication information includes at least one of the following: Syntax element used to indicate whether the absolute value of the corresponding quantization coefficient is greater than the first value; Syntax element used to indicate whether the corresponding quantization coefficient is 0.
7. The method according to claim 6, characterized in that, The first value is 1.
8. The method according to any one of claims 1 to 7, characterized in that, The encoding includes indication information corresponding to the M quantization coefficients other than the L quantization coefficients, including: The conventional encoding method of context-adaptive binary encoding CABAC is used to encode the indication information corresponding to the M quantization coefficients.
9. The method according to claim 5, characterized in that: The encoded data of the residual values of the absolute values of the L quantization coefficients and the encoded data of the residual values of the absolute values of the M quantization coefficients are obtained by using CABAC bypass coding or variable length coding (VLC).
10. The method according to any one of claims 1 to 9, characterized in that, The bitstream also includes: The location information of the specific non-zero quantization coefficient is used to indicate the position of the specific non-zero quantization coefficient in the scan result.
11. The method according to any one of claims 1 to 10, characterized in that, The L quantization coefficients include DC quantization coefficients.
12. A decoding method, characterized in that, include: Obtain the bitstream of the image to be decoded, wherein the image to be decoded includes blocks to be decoded; The bitstream is decoded to obtain the position information of a specific non-zero quantization coefficient, which is used to indicate the position of the specific non-zero quantization coefficient in the scanning order; Based on the location information, skip L quantization coefficients in the scanning order and decode the indication information corresponding to M quantization coefficients other than the L quantization coefficients; Based on the indication information of the M quantization coefficients, the bitstream is decoded to obtain the M quantization coefficients; The bitstream is decoded to obtain the L quantization coefficients; Based on the M quantization coefficients and the L quantization coefficients, a quantization coefficient block of the block to be decoded is obtained; wherein: the quantization coefficient block includes N quantization coefficients, and the N quantization coefficients include non-zero quantization coefficients, N is an integer greater than 1, M is an integer greater than or equal to 0, L is an integer greater than 0, and the sum of M and L is less than or equal to N. Based on the quantization coefficient block, the reconstructed data of the block to be decoded is obtained.
13. The method according to claim 12, characterized in that, The scanning order is to scan from the DC quantization coefficients of the quantization coefficient block to the last quantization coefficient of the quantization coefficient block, and the specific non-zero quantization coefficient is the last non-zero quantization coefficient in the scanning order.
14. The method according to claim 13, characterized in that, The decoding of the indication information corresponding to the M quantization coefficients other than the L quantization coefficients includes: Based on the location information, a regular stop position is obtained, which corresponds to the first quantization coefficient in the scanning sequence; wherein: the L quantization coefficients include the quantization coefficients in the scanning result before the first quantization coefficient, and the M quantization coefficients include the first quantization coefficient, the specific non-zero quantization coefficient, and the quantization coefficients between the first quantization coefficient and the specific non-zero quantization coefficient.
15. The method according to claim 14, characterized in that, The step of obtaining a regular stop position based on the location information includes: Based on the location information and the regular stop position table, the regular stop position is obtained. The regular stop position table includes N regular stop positions, and the N regular stop positions correspond one-to-one with the N positions of the specific quantization coefficient in the scanning sequence. In the N regular stop positions in the regular stop position table, the preceding regular stop position is not greater than the following regular stop position, or the preceding regular stop position is not less than the following regular stop position.
16. The method according to any one of claims 12 to 15, characterized in that, The indication information includes at least one of the following: Syntax element used to indicate whether the absolute value of the corresponding quantization coefficient is greater than the first value; Syntax element used to indicate whether the corresponding quantization coefficient is 0.
17. The method according to claim 16, characterized in that, The first value is 1.
18. The method according to any one of claims 12 to 17, characterized in that, The decoding of the indication information corresponding to the M quantization coefficients other than the L quantization coefficients includes: The bitstream is decoded using arithmetic coding to obtain the indication information corresponding to M quantization coefficients.
19. The method according to any one of claims 12 to 18, characterized in that, Decoding the bitstream includes: The bitstream is decoded using Variable Length Coding (VLC).
20. An encoding method, characterized in that, include: Obtain the number of blocks to be encoded from the original image, wherein the data to be encoded includes the quantization coefficients and control information of the blocks to be encoded; Based on the data to be encoded, the bitstream of the original image is obtained; wherein, the bitstream includes arithmetic encoded data and variable length encoded (VLC) data, the arithmetic encoded data includes the control information and indication information of quantization coefficients whose absolute value is less than a first value, the VLC encoded data includes the remaining values of quantization coefficients whose absolute value is greater than or equal to the first value, and the control information is used to decode the bitstream.
21. A decoding method, characterized in that, include: Acquire a bitstream, which includes arithmetic-coded data and variable-length coded (VLC) data; Decoding the arithmetic-coded data yields control information for the block to be decoded and indication information for quantization coefficients whose absolute values are less than a first value in the quantization coefficients of the block to be decoded. Decode the VLC encoded data to obtain the remaining values of the quantization coefficients of the block to be decoded whose absolute values are greater than or equal to the first value; Based on the control information, the instruction information, and the remaining value, the bitstream is decoded to obtain a reconstructed image of the original image.
22. The encoding method according to claim 20 or 21, characterized in that, include: The indication information includes significant_coeff_flag and coeff_abs_level_greater1_flag, where the first value is any one of 0, 1, or 2.
23. An encoder, characterized in that, include: A memory and a processor, wherein the memory is coupled to the processor; The memory stores program instructions that, when executed by the processor, cause the decoder to perform the method as described in any one of claims 1 to 11.
24. A decoder, characterized in that, include: A memory and a processor, wherein the memory is coupled to the processor; The memory stores program instructions that, when executed by the processor, cause the decoder to perform the method as described in any one of claims 12 to 19.
25. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed on a computer or processor, causes the computer or processor to perform the method as described in any one of claims 1 to 19.
26. A computer program product, characterized in that, The computer program product includes computer instructions that, when executed by a computer or processor, cause the steps of the method as described in any one of claims 1 to 19 to be performed.
27. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a bitstream generated according to the encoding method described in any one of claims 1 to 11, 20 to 21.