Encoding method, decoding method and related apparatus

WO2026179666A1PCT designated stage Publication Date: 2026-09-03HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2026/077240
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-02-28
Filing Date
2026-02-05
Publication Date
2026-09-03

Smart Images

  • Figure CN2026077240_03092026_PF_FP_ABST
    Figure CN2026077240_03092026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are an encoding method, a decoding method and a related apparatus. The encoding method comprises: acquiring N bins of an intra prediction mode of a block to be encoded, wherein N is an integer greater than 1, and the N bins indicate the intra prediction mode; acquiring a context index of each bin among the N bins, wherein the context index of an ith bin is obtained on the basis of the value of at least one bin among the preceding (i-1) bins, and i is an integer greater than 1 but less than or equal to N; and on the basis of context indices of the N bins, encoding the N bins, so as to acquire a bitstream of an image to be encoded, wherein the bitstream comprises encoded data of the N bins, and the image to be encoded comprises the block to be encoded. Therefore, the encoding and decoding complexity is reduced, and the encoding efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Encoding methods, decoding methods and related devices

[0001] This application claims priority to Chinese patent application filed on February 28, 2025, with application number 202510239268.9 and 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. The method includes: obtaining N binary bins of the intra-prediction mode of the block to be encoded, where N is an integer greater than 1, and the N bins indicate the intra-prediction mode. Obtaining the context index of each of the N bins, wherein the context index of the i-th bin is obtained based on the value of at least one bin from the previous (i-1) bins, where i is an integer greater than 1 and less than or equal to N. Encoding the N bins based on their context indices to obtain a bitstream of the image to be encoded; wherein the bitstream includes encoded data for the N bins, and the image to be encoded includes the block to be encoded. Thus, when encoding bins of the intra-prediction mode, the context index of a bin depends on previous bins, without relying on other encoded pixels, effectively reducing encoding complexity and improving encoding efficiency.

[0007] In one possible implementation, N is 2. Obtaining the context index for each bin includes: assigning a first context index to the first bin out of the N bins; and assigning a second context index to the second bin out of the N bins. Wherein, if the value of the first bin is 0, the second context index is the first value; if the value of the first bin is 1, the second context index is the second value, and the first and second values ​​are different. In this way, the context index of each bin depends only on the value of at least one previous bin, which can effectively reduce the encoding and decoding complexity of intra-frame prediction modes, thereby improving overall coding efficiency.

[0008] In one possible implementation, the N bins are encoded based on their context indices, including: obtaining the context probability model corresponding to each bin's context index; and encoding the bin's value based on the context probability model.

[0009] In one possible implementation, the block to be encoded includes a chroma component and a luma component. The intra-frame prediction mode of the luma component is a first intra-frame prediction mode, and the intra-frame prediction mode of the chroma component is a second intra-frame prediction mode. The intra-frame prediction mode of the block to be encoded includes both the first intra-frame prediction mode and the second intra-frame prediction mode.

[0010] In one possible implementation, the first intra-frame prediction mode is one of the following: horizontal mode, vertical mode, DC mode, and planar mode; the second intra-frame prediction mode is one of the following: horizontal mode, vertical mode, DC mode, and cross-component linear model (CCLM) mode.

[0011] In one possible implementation, the N bins are either the N bins corresponding to the first intra-frame mode or the N bins corresponding to the second intra-frame mode, wherein the N value of the first intra-frame mode is the same as or different from the N value of the second intra-frame mode.

[0012] In one possible implementation, obtaining N bins of the intra-prediction mode of the block to be encoded includes: obtaining mode information of the intra-prediction mode; performing a binarization operation on the mode information to obtain N bins.

[0013] 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, the bitstream including encoded data of N binary bins, the N bins indicating the intra-prediction mode of the block to be decoded, where N is an integer greater than 1; decoding the bitstream based on the context index of each of the N bins to acquire the intra-prediction mode of the block to be decoded; wherein the context index of the i-th bin is obtained based on the value of at least one bin in the previous (i-1) bins, where i is an integer greater than 1 and less than or equal to N; and acquiring reconstructed data of the block to be decoded based on the intra-prediction mode. Thus, when decoding the bins of the intra-prediction mode, the context index of the bin depends on the previous bins, without relying on other decoded pixels, saving storage space on the decoding side. It can also effectively reduce decoding complexity and improve decoding speed.

[0014] In one possible implementation, N is 2. The bitstream is decoded based on the context indices of N bins, including: decoding the bitstream based on the first context index to obtain the value of the first bin among the N bins; obtaining the second context index based on the value of the first bin, the second context index corresponding to the second bin among the N bins, wherein if the value of the first bin is 0, the second context index is the first value; if the value of the first bin is 1, the second context index is the second value; the first value and the second value are different; and decoding the bitstream based on the second context index to obtain the value of the second bin.

[0015] In one possible implementation, the bitstream is decoded based on the context index of each of the N bins, including: obtaining the context probability model corresponding to the context index based on the context index of each of the N bins; and decoding the bitstream based on the context probability model.

[0016] In one possible implementation, the block to be decoded includes a chroma component and a luma component. The intra-frame prediction mode of the luma component is a first intra-frame prediction mode, and the intra-frame prediction mode of the chroma component is a second intra-frame prediction mode. The intra-frame prediction mode of the block to be decoded includes the first intra-frame prediction mode and the second intra-frame prediction mode.

[0017] In one possible implementation, the first intra-frame prediction mode is one of the following: horizontal mode, vertical mode, DC mode, and planar mode; the second intra-frame prediction mode is one of the following: horizontal mode, vertical mode, DC mode, and cross-component linear model (CCLM) mode.

[0018] In one possible implementation, the N bins are either the N bins corresponding to the first intra-frame mode or the N bins corresponding to the second intra-frame mode, wherein the N value of the first intra-frame mode is the same as or different from the N value of the second intra-frame mode.

[0019] In one possible implementation, obtaining the intra-prediction mode of the block to be decoded includes: obtaining N bins; performing an inverse binarization operation on the values ​​of the N bins to obtain the mode information of the intra-prediction mode.

[0020] Thirdly, this application provides an encoding apparatus, comprising: an acquisition module, configured to acquire N binary bins of an intra-prediction mode of a block to be encoded, where N is an integer greater than 1, and the N bins indicate the intra-prediction mode; an encoding module, configured to acquire the context index of each of the N bins, wherein the context index of the i-th bin is obtained based on the value of at least one of the previous (i-1) bins, where i is an integer greater than 1 and less than or equal to N; the encoding module is further configured to encode the N bins based on the context indexes of the N bins to acquire a bitstream of an image to be encoded; wherein the bitstream includes the encoded data of the N bins, and the image to be encoded includes the block to be encoded.

[0021] In one possible implementation, N is 2, and the encoding module is specifically used to: allocate a first context index to the first bin among the N bins; allocate a second context index to the second bin among the N bins; wherein, if the value of the first bin is 0, the second context index is the first value; if the value of the first bin is 1, the second context index is the second value, and the first value and the second value are different.

[0022] In one possible implementation, the encoding module is specifically used to: obtain the context probability model corresponding to the context index based on the context index of bin; and encode the value of bin based on the context probability model.

[0023] 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, the bitstream including encoded data obtained by encoding N binary bins based on the intra-prediction mode of the block to be decoded, where N is an integer greater than 1; a decoding module for decoding the bitstream based on the context index of each of the N bins to acquire the intra-prediction mode of the block to be decoded; wherein the context index of the i-th bin is obtained based on the value of at least one bin in the previous (i-1) bins, where i is an integer greater than 1 and less than or equal to N; and a reconstruction module for acquiring reconstructed data of the block to be decoded based on the intra-prediction mode.

[0024] In one possible implementation, N is 2. The decoding module is specifically used for: decoding the bitstream based on a first context index to obtain the value of the first bin among N bins; obtaining a second context index based on the value of the first bin, the second context index corresponding to the value of the second bin among N bins, wherein if the value of the first bin is 0, the second context index is the first value; if the value of the first bin is 1, the second context index is the second value; the first value and the second value are different; and decoding the bitstream based on the second context index to obtain the value of the second bin.

[0025] In one possible implementation, the decoding module is specifically used to: obtain the context probability model corresponding to the context index of each of the N bins; and decode the bitstream based on the context probability model.

[0026] 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.

[0027] 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.

[0028] 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.

[0029] 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.

[0030] 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.

[0031] 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.

[0032] 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.

[0033] 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.

[0034] 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.

[0035] 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.

[0036] 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.

[0037] In a sixteenth aspect, this application provides a bitstream generated according to the first aspect and any implementation thereof.

[0038] 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

[0039] Figure 1A is a schematic block diagram of an exemplary video encoding and decoding system;

[0040] Figure 1B is a schematic block diagram of an exemplary video decoding system;

[0041] Figure 2 is a schematic block diagram of an encoder as an example;

[0042] Figure 3 is a schematic block diagram of an exemplary decoder;

[0043] Figure 4 is a schematic block diagram of an encoder based on wavelet transform, which is an example shown.

[0044] Figure 5 is an exemplary schematic diagram of subgraph partitioning;

[0045] Figure 6 is an exemplary schematic diagram of wavelet transform;

[0046] Figures 7A and 7B are schematic block diagrams of an exemplary decoder;

[0047] Figure 8 is a schematic diagram of the structure of a code stream as an example;

[0048] Figure 9 is a flowchart illustrating an exemplary encoding method;

[0049] Figure 10 is an exemplary schematic diagram of context index retrieval;

[0050] Figure 11 is an exemplary schematic diagram of intra-frame prediction mode coding;

[0051] Figure 12 is a schematic diagram of an exemplary encoding method flow;

[0052] Figure 13 is a schematic flowchart illustrating an exemplary decoding method;

[0053] Figure 14 is a schematic diagram of an exemplary decoding process;

[0054] Figure 15 is an exemplary flowchart illustrating the decoding process of bin values;

[0055] Figure 16 is a schematic diagram of an exemplary reconstruction process;

[0056] Figure 17 is a schematic diagram of the structure of an exemplary video decoding device;

[0057] Figure 18 is a schematic diagram of the structure of an exemplary device;

[0058] Figure 19 is a schematic diagram of the structure of an exemplary device;

[0059] Figure 20 is a schematic diagram of the structure of an exemplary device. Detailed Implementation

[0060] 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.

[0061] The residual is the difference between the reconstructed value and the predicted value of a sample or data element.

[0062] A residual block is a residual matrix composed of the residuals corresponding to the coded blocks.

[0063] Dequantization is the process of scaling the quantized residual to obtain the reconstructed residual value.

[0064] A partition divides a set into subsets. Each element in the set belongs to one and only one subset.

[0065] Partition type: The way the subsets obtained from the partition are organized.

[0066] A decoded picture is an image reconstructed by the decoder based on the bitstream.

[0067] Prediction is the specific implementation of the prediction process.

[0068] The prediction process uses previously decoded samples to obtain the predicted value for the current sample.

[0069] Syntax element: The result of parsing data units in a bitstream.

[0070] A bitstream is a binary data stream that encodes all or part of an image sample.

[0071] 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.

[0072] 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) that can be used for predictive coding. In the High Efficiency Video Coding (HEVC) standard, basic concepts such as coding units (CUs), prediction units (PUs), and transform units (TUs) are used to functionally divide various block units, and a new tree-based structure is used for description.

[0073] 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.

[0074] 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.

[0075] 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.

[0076] The three components of YUV:

[0077] 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.

[0078] 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.

[0079] V (chromaticity) component: V represents the chromaticity information of the image, indicating the offset of the red channel relative to the luminance Y.

[0080] The encoding / decoding method of this application embodiment encodes and decodes images or videos on a block-by-block basis.

[0081] 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.

[0082] 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.

[0083] 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).

[0084] 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.

[0085] 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.

[0086] 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."

[0087] 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".

[0088] 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.

[0089] 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.

[0090] Whether on the encoding or decoding side, reconstruction can also be described as remodeling.

[0091] Whether on the encoding or decoding side, the bitstream is also described as a bitstream, etc.

[0092] Whether on the encoding or decoding side, the residual is also referred to as a residual block.

[0093] The embodiments of this application are described below with reference to the accompanying drawings.

[0094] 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.

[0095] 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.

[0096] 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:

[0097] 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.

[0098] 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.

[0099] 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.

[0100] 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.

[0101] 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.

[0102] 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:

[0103] 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.

[0104] 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.

[0105] 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).

[0106] 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.

[0107] 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.

[0108] 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.

[0109] 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.

[0110] 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.

[0111] 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.

[0112] 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.

[0113] 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.

[0114] 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.

[0115] 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.

[0116] 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).

[0117] 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.

[0118] 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.

[0119] 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.

[0120] 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.

[0121] 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.

[0122] 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.

[0123] 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.

[0124] The loop filter unit 220 (or simply "loop filter" 220) is used to filter the reconstructed block 215 to obtain the filtered block 221.

[0125] 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.

[0126] 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.

[0127] 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.

[0128] 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.

[0129] 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.

[0130] 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.

[0131] 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).

[0132] 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.

[0133] 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).

[0134] 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.

[0135] 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.

[0136] 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.

[0137] Decoder 30 is used, for example, to output decoded image 31 via output 332 for presentation to or viewing by the user.

[0138] 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.

[0139] 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.

[0140] 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.

[0141] 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:

[0142] The width and / or height of the subgraph are multiples of 128;

[0143] The maximum width of the subimage is 1024 pixels;

[0144] The minimum height and / or width of the subimage is 256 pixels;

[0145] 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,

[0146] 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,

[0147] 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.

[0148] The values ​​mentioned above are merely illustrative examples and can be set according to actual needs.

[0149] 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*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.

[0150] The sub-image partitioning unit 410 can partition the image into m*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.

[0151] 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.

[0152] 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).

[0153] 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).

[0154] 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.

[0155] The high-frequency subband processing path 440 is used to acquire high-frequency subbands to obtain high-frequency subband encoded data. The high-frequency subband processing path 440 includes, but is not limited to: a block partitioning unit 431 (also referred to as a high-frequency subband block partitioning unit 431 or a second block partitioning unit 431), a transform / quantization unit (also referred to as a transform / quantization unit 442 or a second transform / quantization unit), and a high-frequency subband entropy coding unit 443, etc.

[0156] Alternatively, in some instances, the encoder may include more or fewer units or modules than in the structure shown in Figure 4.

[0157] The image 401 encoding method provided in this application will be described in detail below with reference to the encoder shown in Figure 4:

[0158] The codec receives image 401. A description of image 401 can be found above and will not be repeated here.

[0159] 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.

[0160] 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.

[0161] 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.

[0162] 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.

[0163] 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.

[0164] Alternatively, the block partitioning method includes, but is not limited to:

[0165] 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).

[0166] 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.

[0167] 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.

[0168] 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.

[0169] 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.

[0170] 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.

[0171] 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.

[0172] 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.

[0173] 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.

[0174] 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.

[0175] 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.

[0176] 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.

[0177] 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.

[0178] The prediction unit 437 outputs prediction block 405 to the residual calculation unit 432 and the low-frequency sub-band splicing unit 436.

[0179] 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.

[0180] 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.

[0181] Block partitioning unit 441 outputs the macroblocks of the current high-frequency subband one by one to quantization / conversion unit 442.

[0182] 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.

[0183] 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.

[0184] 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.

[0185] 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.

[0186] 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.

[0187] 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.

[0188] 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.

[0189] 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.

[0190] 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.

[0191] 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.

[0192] 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.

[0193] 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.

[0194] 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.

[0195] 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.

[0196] 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.

[0197] 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.

[0198] 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.

[0199] 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.

[0200] 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.

[0201] 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.

[0202] 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).

[0203] 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.).

[0204] 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.

[0205] 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.

[0206] Other variations of the decoder can be used to decode compressed bitstreams.

[0207] 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.

[0208] 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.

[0209] 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.

[0210] 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.

[0211] 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.

[0212] For example, image header information includes, but is not limited to, offset information and image size information.

[0213] 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.

[0214] 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.

[0215] In one example, the offset information can be the length of the image data region containing adjacent, independently decodeable encoded data in the bitstream.

[0216] 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.

[0217] 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.

[0218] 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 region. The description of the second image data region can be found in Figure 15, and will not be repeated here.

[0219] 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.

[0220] 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.

[0221] 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.

[0222] Referring to Figure 9, which is a flowchart illustrating an exemplary encoding method, the specific steps include, but are not limited to, the following:

[0223] S901, obtain N bins of the intra-prediction mode of the block to be encoded, where N is an integer greater than 1, and the N bins indicate the intra-prediction mode.

[0224] For example, the encoder determines the intra-prediction mode (e.g., mode information 412 in FIG4) and performs intra-prediction on the block to be coded (also referred to as the current block) based on the intra-prediction mode to obtain the prediction data of the current block (e.g., prediction block 405 in FIG4).

[0225] During the encoding process, the encoder obtains the intra-prediction mode of the current block, encodes the intra-prediction mode to obtain the encoded data of the intra-prediction mode, and writes it into the bitstream.

[0226] Specifically, the encoder obtains N binary bits (bins) of the intra-prediction mode for the current block. Here, N is an integer greater than 1. The N bins can be used to represent the intra-prediction mode used by the current block.

[0227] For example, the block to be encoded can be macroblock 404 in Figure 4 or image block 203 in Figure 2.

[0228] For example, the block to be encoded includes a chroma component and a luma component. Accordingly, the intra-prediction module of the block to be encoded includes: a first intra-prediction mode for the luma component and a second intra-prediction mode for the chroma component. That is, the intra-prediction mode for the luma component of the block to be encoded is the first intra-prediction mode, and the intra-prediction mode for the chroma component is the second intra-prediction mode.

[0229] In one example, the first intra-frame prediction mode for the luminance component is one of the following: horizontal mode, vertical mode, direct current (DC) mode, or planar mode.

[0230] In another example, the second intra-frame prediction mode for the chroma component is one of the following: horizontal mode, vertical mode, DC mode, or Cross-Component Linear Model (CCLM) mode.

[0231] The number and types of selectable intra-prediction modes for the luma and chroma components described above are merely illustrative examples; other embodiments may include more selectable intra-prediction modes. For instance, the luma component may include six selectable intra-prediction modes, and the chroma component may include eight selectable intra-prediction modes. The number of selectable prediction modes is related to the length of the bin (i.e., the N value) of the intra-prediction mode.

[0232] Taking the first intra-frame prediction mode of the luma component as an example, the second intra-frame prediction mode of the chroma component is similar, and will not be described in detail here. Specifically, in this embodiment, there are four selectable intra-frame prediction modes for the luma component: horizontal mode, vertical mode, DC mode, and Planar mode. These intra-frame prediction modes can be represented using a fixed-length method. When there are four intra-frame prediction modes for the luma component, a fixed-length of 2, i.e., 2 bins (i.e., N=2), is used to represent the corresponding intra-frame prediction mode. For example, the bin value for the horizontal mode is 00, the bin value for the vertical mode is 01, the bin value for the DC mode is 10, and the bin value for the Planar mode is 11. Note: The above values ​​are only illustrative examples and can be set according to actual needs; this application does not limit them.

[0233] Of course, this application embodiment only uses 2-bit bins corresponding to 4 types of intra-frame prediction as an example for illustration. In other embodiments, if there are 6 selectable intra-frame prediction modes for the luminance component, the length needs to be fixed at 3, that is, 3-bit bins represent the intra-frame prediction mode of the luminance component. The specific value can be set according to actual needs.

[0234] During the encoding process, the encoder encodes the first intra-prediction mode of the luma component and the second intra-prediction mode of the chroma component of the current block respectively, to obtain the encoded data of the first intra-prediction mode of the luma component and the encoded data of the second intra-prediction mode of the chroma component. That is, the encoded data of the intra-prediction mode of the current block includes the encoded data of the first intra-prediction mode of the luma component and the encoded data of the second intra-prediction mode of the chroma component.

[0235] In other words, the N bins of the intra-prediction mode of the current block mentioned in this application embodiment can refer to the N bins of the first intra-prediction mode of the luma component or the N bins of the second intra-prediction mode of the chroma component. The N value corresponding to the first intra-prediction mode of the luma component and the N value corresponding to the second intra-prediction mode of the chroma component can be the same or different. For example, if there are 4 selectable intra-prediction modes for the luma component, at least 2 bins (i.e., N = 2) are needed to represent it; if there are 6 selectable intra-prediction modes for the chroma component, at least 3 bins (i.e., N = 3) are needed. Of course, if the number of selectable intra-prediction modes for the chroma component is equal to the number of selectable intra-prediction modes for the luma component, then the N value corresponding to the first intra-prediction mode of the luma component and the N value corresponding to the second intra-prediction mode of the chroma component are equal.

[0236] S902, obtain the context index of each of the N bins, where the context index of the i-th bin is obtained based on the value of at least one of the first (i-1) bins, and i is an integer greater than 1 and less than or equal to N.

[0237] For example, during the encoding of the intra-prediction mode, the encoder assigns a context index (denoted as ctxInx) to each of the N bins of the intra-prediction mode.

[0238] In this embodiment, the first bin of the N bins in the intra-frame prediction mode, i.e., the highest bit (e.g., "0" in "01"), corresponds to a preset context index (e.g., denoted as the first context index). For example, the context index value of the first bin is 0, denoted as ctxInx0. Optionally, the value of the context index mentioned herein can also be understood as the ID of the context index. For example, in ctxInx0, the value "0" can be understood as either the value of ctxInx or the ID of ctxInx. The specific value can be set according to actual needs.

[0239] In the embodiments of this application, during the process of allocating context indexes for bins, the context indexes corresponding to each bin in the N bins of the intra-frame prediction mode, except for the first bin, are all obtained based on the values ​​of at least one bin preceding (i.e., before the current bin to be encoded). That is, the context index of the i-th bin depends on the values ​​of at least one bin in the preceding (i-1) bins.

[0240] Referring to Figure 10, which is an exemplary schematic diagram of context index acquisition, specifically, taking an N value of 2 as an example, the bin corresponding to the intra-frame prediction mode includes a first bin and a second bin. For example, if the value of a bin in the intra-frame prediction mode is "01", the value of the first bin (i.e., the first bin) is "0", and the value of the second bin is "1". Referring to Figure 10, the encoder assigns a first context index to the first bin (i.e., the first bin), for example, ctxInx0. Based on the value of the first bin, the encoder assigns a second context index to the second bin.

[0241] In this embodiment, as described above, the value of the context index of the i-th bin is determined based on the values ​​of the previous (i-1) bins. Specifically, referring to Figure 10, the encoder has a correspondence between the first bin and the second context index. For example, if the value of the first bin is 0, the second context index is the first value, such as ctxInx1; if the value of the first bin is 1, the second context index is the second value, such as ctxInx2. The first and second values ​​are not the same. The correspondence described above is only an illustrative example and can be set according to actual needs.

[0242] For example, referring to Figure 10, if the intra-frame prediction mode of the luma component is the vertical mode, and the value of its corresponding bin is "01", the encoder assigns a first context index of ctxInx0 to the first bin (e.g., "0"). Based on the value of the first bin (i.e., "0"), the encoder determines the second context index of the second bin as ctxInx1.

[0243] In one possible implementation, the encoder can perform a judgment step to allocate a context index for the i-th bin. Taking Figure 10 as an example, during the process of allocating a second context index for the second bin, the encoder determines whether the value of the first bin is 0. If the value of the first bin is 0, the second context index is determined to be ctxInx1. If the value of the first bin is not 0, the second context index is determined to be ctxInx2.

[0244] In this embodiment, the optional ctxInx values ​​for each bin are different; that is, the context indexes assigned to each bin are different. For example, in this embodiment, the value of the first context index of the first bin is different from the value of the second context index of the second bin.

[0245] For example, as described above, N can also be a value greater than 2, such as including 3 bins (i.e., N is 3). The encoder can then determine the context index of the i-th bin based on the value of at least one bin preceding the i-th bin. For instance, if the value of N bins is "010", the encoder assigns a first context index of ctxInx0 to the first bin (i.e., the first "0"). Based on the value of the first bin, the encoder determines the second context index of the second bin (i.e., "1"). For example, if the value of the first bin is 0, the second context index is ctxInx1; if the value of the first bin is 1, the second context index is ctxInx2. Accordingly, the encoder assigns a second context index of ctxInx1 to the second bin. Next, the encoder determines the third context index of the third bin based on the first bin, or the first and second bins, or based solely on the second bin.

[0246] Taking the encoder determining the third context index based on the first and second bins as an example, the following are examples: If the value of the first bin is 0 and the value of the second bin is 0, that is, the bin combination of the first and second bins is "00", the third context index is ctxInx3; if the value of the first bin is 0 and the value of the second bin is 1, that is, the bin combination of the first and second bins is "01", the third context index is ctxInx4; if the value of the first bin is 1 and the value of the second bin is 0, that is, the bin combination of the first and second bins is "10", the third context index is ctxInx5; if the value of the first bin is 1 and the value of the second bin is 1, that is, the bin combination of the first and second bins is "11", the third context index is ctxInx6.

[0247] Correspondingly, in the example where the bin value in the intra-prediction mode is "010", the third context index assigned by the encoder to the third bin (i.e., the second "0") is ctxInx4.

[0248] S903, based on the context index of N bins, encode the N bins to obtain the bitstream of the image to be encoded; wherein, the bitstream includes the encoded data of the N bins, and the image to be encoded includes the block to be encoded.

[0249] For example, each time the encoder obtains the context index of a bin, it can encode the bin based on the context index to obtain the encoded data of the intra-prediction mode for the current block. As mentioned above, the encoded data of the intra-prediction mode for the current block includes the encoded data of the first intra-prediction mode for the luma component and the encoded data of the second intra-prediction mode for the chroma component.

[0250] Referring to Figure 11, which is an exemplary schematic diagram of intra-frame prediction mode encoding, S903 may include, but is not limited to, context modeling and encoding. Specifically, taking the encoding process of any one of the N bins (hereinafter referred to as the current bin) as an example, the encoder obtains the current bin, also known as the bin to be encoded. Furthermore, the encoder obtains the context index of the current bin. The encoder performs context modeling based on the context index of the current bin to obtain the context probability model corresponding to that context index. For example, the context probability models for different context indices are different.

[0251] Referring again to Figure 11, specifically, the encoder encodes the value of the current bin based on the context probability model of the current bin (that is, the context probability model corresponding to the context index of the current bin) to obtain the encoded data of the current bin. Optionally, the encoding method of S903 may also include an update step (not shown in the figure). Specifically, the encoder may update the context probability model corresponding to the context index of the current bin based on the encoded data of the current bin.

[0252] In this embodiment, the encoder can use CABAC encoding to encode N bins of the intra-frame prediction mode.

[0253] In one possible implementation, the encoder can be used in a serial manner, encoding bins one by one in the order of bins.

[0254] In another possible implementation, the encoder can use a parallel approach to encode two or more bins in parallel.

[0255] For example, the encoder writes the encoded data of the intra-prediction mode of the current block into the bitstream of the image to be encoded. The image to be encoded includes blocks to be encoded (i.e., the current block). Specifically, the image to be encoded includes multiple blocks to be encoded, such as multiple macroblocks, and the bitstream includes encoded data of the intra-prediction mode for the chroma component and the intra-prediction mode for the luma component of each macroblock.

[0256] Referring to Figure 12, which is an exemplary flowchart of the encoding method, in one possible implementation, S901 includes an acquisition step and a binarization step. For example, the encoder acquires the mode information of the intra-prediction mode of the luminance component of the current block (the processing method for the chrominance component is the same and will not be repeated here), such as mode information 412 in Figure 4. The mode information is used to indicate the intra-prediction mode adopted by the current block. Specifically, taking a wavelet architecture as an example, referring to Figure 4, the encoder can determine the mode information (e.g., mode information 412 in Figure 4) of the intra-prediction mode corresponding to the luminance component of the current block from the optional intra-prediction modes of the luminance component of the current block, based on the current block (e.g., macroblock 404) or based on the current block and a reference block (e.g., low-frequency sub-band reconstruction block 409 in Figure 4). The optional intra-prediction modes of the luminance component include, but are not limited to: horizontal mode, vertical mode, DC mode, and Planar mode.

[0257] The encoder performs a binarization operation on the mode information of the intra-prediction mode of the current block to obtain N bins corresponding to the mode information of the intra-prediction mode. In this embodiment, the intra-prediction mode of the current block adopts fixed-length coding, that is, a fixed-length coding method is used in the binarization process. The value of N is related to the number of selectable intra-prediction modes of the current block, as described above.

[0258] For example, the encoder can perform intra-frame prediction on the luminance component of the current block based on the mode information of the intra-frame prediction mode of the luminance component of the current block to obtain the prediction data of the luminance component of the current block, such as prediction block 405 in Figure 4. The encoder can obtain the encoded data of the chrominance component of the current block based on the prediction data of the chrominance component of the current block. Specific details can be found in Figure 4, and will not be elaborated here.

[0259] The method in this embodiment may include steps such as wavelet transform before S901 to obtain the block to be encoded and to obtain the corresponding intra-frame prediction mode based on the block to be encoded. For a detailed description, please refer to the relevant content in Figure 4, which will not be repeated here.

[0260] Referring to Figure 13, which is a schematic flowchart of an exemplary decoding method, the specific steps include, but are not limited to, the following:

[0261] S1301, Obtain the bitstream of the image to be decoded. The bitstream includes encoded data of N bins. The N bins are used to indicate the intra-prediction mode of the block to be decoded. N is an integer greater than 1. The image to be decoded includes the block to be decoded.

[0262] For example, the decoder acquires a bitstream generated by, for instance, the encoder. The bitstream includes encoded data of the image to be decoded. The image to be decoded includes a block to be decoded (hereinafter referred to as the current block), that is, the image to be decoded includes encoded data of the block to be decoded. The encoded data of the block to be decoded further includes encoded data of N bins of the intra-frame prediction mode of that block.

[0263] S1302, based on the context index of each bin in N bins, decode the bitstream to obtain the intra-prediction mode of the block to be decoded; where the context index of the i-th bin is obtained based on the value of at least one bin in the previous (i-1) bins, and i is an integer greater than 1 and less than or equal to N.

[0264] For example, the decoder can decode the bitstream based on the context index corresponding to each bin to decode the value of the corresponding bin. The decoder can determine the intra-prediction mode corresponding to the current block based on the obtained values ​​of N bins.

[0265] Specifically, similar to the encoding side, the block to be decoded also includes chroma and luma components. The intra-frame prediction mode of the current block during decoding includes a first intra-frame prediction mode for the luma component and a second intra-frame prediction mode for the chroma component. The decoder can decode the second intra-frame prediction mode of the chroma component and the first intra-frame prediction mode of the luma component of the current block respectively to obtain the first intra-frame prediction mode of the luma component and the second intra-frame prediction mode of the chroma component.

[0266] Optionally, the N bins mentioned on the decoding side of this application can be the N bins corresponding to the first intra-prediction mode of the luma component of the current block, or the N bins corresponding to the second intra-prediction mode of the chroma component. The N value corresponding to the first intra-prediction mode of the luma component and the N value corresponding to the second intra-prediction mode of the chroma component can be the same or different. For example, if there are 4 selectable intra-prediction modes for the luma component, at least 2 bins (i.e., N = 2) are needed to represent it; if there are 6 selectable intra-prediction modes for the chroma component, at least 3 bins (i.e., N = 3) are needed. Of course, if the number of selectable intra-prediction modes for the chroma component is equal to the number of selectable intra-prediction modes for the luma component, then the N value corresponding to the first intra-prediction mode of the luma component and the N value corresponding to the second intra-prediction mode of the chroma component are equal.

[0267] In this embodiment of the application, similar to the encoding side, the context index of the i-th bin used during decoding on the decoding side is obtained based on the value of at least one bin among the previous (i-1) bins.

[0268] Referring to Figure 14, which is an exemplary decoding process diagram, this example uses N=2 as an example, meaning that the N bins include a first bin (also called the first bin) and a second bin, where the first bin is the highest bit of the N bins. As shown in Figure 14, the decoder obtains the first context index, which is used to decode the first bin. Specifically, similar to the encoding side, the value of the first context index is a preset value, such as ctxInx0. The decoder can decode the bitstream based on the first context index to obtain the value of the first bin.

[0269] Based on the method shown in Figure 10, the decoder can determine the second context index based on the value of the first bin. The specific method can be found in the relevant description in Figure 10, and will not be repeated here. As shown in Figure 14, after obtaining the second context index (e.g., ctxInx1) based on the value of the first bin, the decoder can decode the bitstream based on the second context index to obtain the value of the second bin.

[0270] Please refer to Figure 14. For example, the decoder obtains the first bin and the second bin, and can obtain the intra-prediction mode based on the first bin and the second bin. Specifically, the decoder can debinarize the N bins composed of the first bin and the second bin, for example, "01", to obtain the corresponding intra-prediction mode. For example, the intra-prediction mode corresponding to "01" is the vertical mode. The specific correspondence can be found in the description on the encoding side.

[0271] Of course, in some instances, N can be any value greater than 2, and the specific processing method is similar to that in Figure 14. This application will not provide examples for each instance.

[0272] Referring to Figure 15, which is an exemplary flowchart of decoding a bin, in this embodiment, during the decoding process, the decoder can determine the context probability model corresponding to the context index of each bin. Based on the context probability model, the decoder decodes the bitstream to obtain the value of the corresponding bin. Specifically, as shown in Figure 15, the decoder obtains the context index required for decoding the current bin, such as the first context index (ctxIdx0). The decoder determines the context probability model (e.g., the first context index) corresponding to the context index based on the context index (e.g., the first context index). The decoder can decode the bitstream based on the first context probability model to obtain the value of the corresponding bin, such as the value of the first bin. For example, the decoder can update the context probability model corresponding to the context index used when decoding the bin based on the bin value (the update process is not shown in the figure). Thus, each time the decoder obtains a bin, it can determine the context index corresponding to the next bin based on the current bin value. As shown in Figure 10, after obtaining the context index, decoding can be performed according to the method in Figure 15 to obtain the corresponding bin value.

[0273] S1303, based on intra-frame prediction mode, acquires the reconstructed data of the block to be decoded.

[0274] For example, the decoder obtains the intra-prediction mode of the current block, and can perform intra-prediction on the current block based on the intra-prediction mode to obtain the predicted value (also known as the prediction data) of the current block. The decoder can then obtain the reconstructed data of the current block based on the prediction data of the current block.

[0275] Specifically, as described above, the current block includes a chroma component and a luma component. During the decoding process, the decoder can perform intra-frame prediction and reconstruction on the chroma component and luma component respectively to obtain the reconstructed values ​​of the chroma component and luma component of the current block. That is, the reconstructed value of the current block includes the reconstructed values ​​of the chroma component and the luma component of the current block.

[0276] The reconstruction process of the luminance component Y is described below as an example. The reconstruction process of the chrominance component is similar and will not be repeated in this application.

[0277] Referring to Figure 16, which is an exemplary reconstruction process diagram, the decoder decodes the bitstream to obtain mode information (e.g., mode information 412 in Figure 7A or 7B, or syntax elements in Figure 3) of the intra-prediction mode (e.g., the first intra-prediction mode) of the Y component of the current block. Furthermore, in step S103, the decoder may also decode the bitstream to obtain the residual of the Y component of the current block (e.g., the inverse quantization coefficients 703 of the low-frequency subband in Figure 7A or 7B, or the reconstructed residual block 313 in Figure 3).

[0278] Referring again to Figure 16, after the decoder obtains the reconstructed value of the Y component of the reference block (e.g., the low-frequency subband reconstruction block 704 in Figure 7A or 7B, or the reference sample 317 in Figure 3), it performs intra-frame prediction on the Y component of the current block based on the mode information of the first intra-frame prediction mode to obtain the predicted value of the Y component of the current block (also called prediction data, e.g., prediction block 705 in Figure 7A or 7B, or prediction block 365 in Figure 3). The decoder obtains the residual based on the Y component of the current block and the predicted value of the Y component of the current block to determine the reconstructed data of the Y component of the current block (e.g., the low-frequency subband reconstruction block 704 in Figure 7A or 7B, or the reconstruction block 315 in Figure 3). For example, the decoder determines the reconstructed data of the Y component of the current block by summing the residual and the predicted value.

[0279] For example, in a wavelet architecture, the decoder can also obtain the reconstructed data of the image to be decoded based on the reconstructed data of the current block. See Figure 7A or Figure 7B for details.

[0280] Referring to Figure 17, Figure 17 is a schematic structural diagram of a video decoding device 1700 provided in an embodiment of this application. The video decoding device 1700 is suitable for implementing the embodiments described herein. In one embodiment, the video decoding device 1700 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 1700 may be one or more components of the aforementioned decoder or encoder.

[0281] The video decoding device 1700 includes: an input port 1710 and a receiving unit (Rx) 1720 for receiving data; a processor, logic unit, or central processing unit (CPU) 1730 for processing data; a transmitter unit (Tx) 1740 and an output port 1750 for transmitting data; and a memory 1760 for storing data. The video decoding device 1700 may also include photoelectric conversion components and electro-optical (EO) components coupled to the input port 1710, receiver unit 1720, transmitter unit 1740, and output port 1750 for the input or output of optical or electrical signals.

[0282] Processor 1730 is implemented in both hardware and software. Processor 1730 can be implemented as one or more CPU chips, cores (e.g., multi-core processors), FPGAs, ASICs, and DSPs. Processor 1730 communicates with ingress port 1710, receiver unit 1720, transmitter unit 1740, egress port 1750, and memory 1760. Processor 1730 includes encoding module 1770 or decoding module 1770. Encoding / decoding module 1770 implements the embodiments disclosed herein to implement the encoding or decoding methods provided in the embodiments of this application. For example, encoding / decoding module 1770 implements, processes, or provides various encoding operations. Therefore, encoding / decoding module 1770 provides a substantial improvement to the functionality of video decoding device 1700 and affects the transitions of video decoding device 1700 to different states. Alternatively, encoding / decoding module 1770 can be implemented with instructions stored in memory 1760 and executed by processor 1730.

[0283] Memory 1760 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 1760 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).

[0284] Referring to FIG18, FIG18 is a simplified block diagram of an apparatus 1800 that can be used as either or both of the source device 12 and destination device 14 in FIG1A according to an exemplary embodiment. Apparatus 1800 can implement the techniques of this application. In other words, FIG18 is a schematic block diagram of an implementation of an encoder or decoder (referred to as decoding apparatus 1800) according to an embodiment of this application. Apparatus 1800 may include a processor 1810, a memory 1830, and a bus system 1850. The processor 1810 and the memory 1830 are connected via the bus system 1850. The memory 1830 is used to store instruction / program code, and the processor 1810 is used to execute the instruction / program code stored in the memory 1830. The memory 1830 of the decoding apparatus 1800 stores instruction / program code, and the processor 1810 can call the program code stored in the memory 1830 to execute various video encoding or decoding methods described in this application. To avoid repetition, detailed descriptions are omitted here.

[0285] In this embodiment, the processor 1810 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.

[0286] The memory 1830 may include read-only memory (ROM) or random access memory (RAM). Any other suitable type of storage device may also be used as memory 1830. Memory 1830 may include program code and data 1831 accessed by processor 1810 using bus 1850. Memory 1830 may further include an operating system 1833 and an application program 1835, which includes at least one program that allows processor 1810 to execute the encoding or decoding methods described in this application. For example, application program 1835 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.

[0287] In addition to the data bus, the 1850 bus system may also include a power bus, a control bus, and a status signal bus. However, for clarity, all buses are labeled as Bus System 1850 in the diagram.

[0288] Optionally, the decoding device 1800 may also include one or more output devices, such as a display 1870. In one example, the display 1870 may be a haptic display that combines a display with a haptic unit capable of operatively sensing touch input. The display 1870 may be connected to the processor 1810 via a bus 1850.

[0289] Based on the same inventive concept as the above method, this embodiment of the invention also provides an encoding device 1900, which includes: an acquisition module 1901 and an encoding module 1902. The acquisition module 1901 is used to acquire N binary bins of the intra-prediction mode of the block to be encoded, where N is an integer greater than 1, and the N bins indicate the intra-prediction mode. The encoding module 1902 is used for the context index of each of the N bins, where the context index of the i-th bin is obtained based on the value of at least one bin in the previous (i-1) bins, and i is an integer greater than 1 and less than or equal to N. The encoding module 1902 is also used to encode the N bins based on their context indices to acquire the encoded data of the intra-prediction mode of the block to be encoded. The encoding module 1902 is also used to write the encoded data of the intra-prediction mode into the bitstream of the image to be encoded, where the image to be encoded includes the block to be encoded.

[0290] This application embodiment also provides a decoding device 2000, which includes: an acquisition module 2001, a decoding module 2002, and a reconstruction module 2003. The acquisition module 2001 is used to acquire the bitstream of an image to be decoded, the image to be decoded including a block to be decoded, and the bitstream including encoded data obtained by encoding N binary bins based on the intra-frame prediction mode of the block to be decoded, where N is an integer greater than 1; the decoding module 2002 is used to decode the bitstream based on the context index of each of the N bins to acquire the intra-frame prediction mode of the block to be decoded; wherein the context index of the i-th bin is obtained based on the value of at least one bin in the previous (i-1) bins, and i is an integer greater than 1 and less than or equal to N; the reconstruction module 2003 is used to acquire the reconstructed data of the block to be decoded based on the intra-frame prediction mode.

[0291] 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.

[0292] 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 to implement the methods in the above embodiments are executed. This embodiment also provides a computer-readable storage medium storing computer instructions, which, when executed on an electronic device, cause the electronic device to perform the above-described related method steps to implement the methods in the above embodiments. This embodiment also provides a computer program product containing computer instructions, which, when executed by a computer or processor, cause the computer to perform the above-described related steps to implement the methods in the above embodiments. Exemplarily, the computer program product may be stored in a computer-readable storage medium.

[0293] 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.

[0294] 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.

[0295] 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.

[0296] 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.

[0297] 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.

[0298] 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.

[0299] 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.

[0300] 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.

[0301] 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 N binary bins of the intra-prediction mode of the block to be encoded, where N is an integer greater than 1, and the N bins indicate the intra-prediction mode; Obtain the context index of each of the N bins, where the context index of the i-th bin is obtained based on the value of at least one of the first (i-1) bins, and i is an integer greater than 1 and less than or equal to N; Based on the context indexes of the N bins, the N bins are encoded to obtain the bitstream of the image to be encoded; wherein the bitstream includes the encoded data of the N bins, and the image to be encoded includes the block to be encoded.

2. The method according to claim 1, characterized in that, When N is 2, obtaining the context index of each bin includes: Assign a first context index to the first bin among the N bins; Assign a second context index to the second bin among the N bins; wherein, if the value of the first bin is 0, the second context index is a first value; if the value of the first bin is 1, the second context index is a second value, and the first value is different from the second value.

3. The method according to claim 1 or 2, characterized in that, The encoding of the N bins based on their context indices includes: Based on the context index of the bin, obtain the context probability model corresponding to the context index; The value of bin is encoded based on the context probability model.

4. The method according to any one of claims 1 to 3, characterized in that, The block to be encoded includes a chroma component and a luma component. The intra-frame prediction mode of the luma component is a first intra-frame prediction mode, and the intra-frame prediction mode of the chroma component is a second intra-frame prediction mode. The intra-frame prediction mode of the block to be encoded includes the first intra-frame prediction mode and the second intra-frame prediction mode.

5. The method according to claim 4, characterized in that, The first intra-frame prediction mode is one of the following: horizontal mode, vertical mode, DC mode, and planar mode. The second intra-frame prediction mode is one of the following: horizontal mode, vertical mode, DC mode, and cross-component linear model (CCLM) mode.

6. The method according to claim 4, characterized in that, The N bins are either the N bins corresponding to the first intra-frame mode or the N bins corresponding to the second intra-frame mode, wherein the N value of the first intra-frame mode is the same as or different from the N value of the second intra-frame mode.

7. The method according to any one of claims 1-6, characterized in that, The acquisition of N bins of the intra-prediction mode of the block to be encoded includes: Obtain the mode information of the intra-frame prediction mode; The pattern information is binarized to obtain the values ​​of the N bins.

8. A decoding method, characterized in that, include: Obtain the bitstream of the image to be decoded, wherein the image to be decoded includes a block to be decoded, and the bitstream includes encoded data of N binary bins, wherein the N bins indicate the intra-frame prediction mode of the block to be decoded, and N is an integer greater than 1; Based on the context index of each of the N bins, the bitstream is decoded to obtain the intra-prediction mode of the block to be decoded; wherein, the context index of the i-th bin is obtained based on the value of at least one of the first (i-1) bins, and i is an integer greater than 1 and less than or equal to N; Based on the intra-frame prediction mode, the reconstructed data of the block to be decoded is obtained.

9. The method according to claim 8, characterized in that, When N is 2, the decoding of the bitstream based on the context indices of the N bins includes: Based on the first context index, the bitstream is decoded to obtain the value of the first bin among the N bins; Based on the value of the first bin, a second context index is obtained, which corresponds to the second bin among the N bins. If the value of the first bin is 0, the second context index is a first value; if the value of the first bin is 1, the second context index is a second value; and the first value and the second value are different. Based on the second context index, the bitstream is decoded to obtain the value of the second bin.

10. The method according to claim 8 or 9, characterized in that, Decoding the bitstream based on the context index of each of the N bins includes: Based on the context index of each of the N bins, obtain the context probability model corresponding to the context index; The bitstream is decoded based on the context probability model.

11. The method according to any one of claims 8-10, characterized in that, The block to be decoded includes a chroma component and a luma component. The intra-frame prediction mode of the luma component is a first intra-frame prediction mode, and the intra-frame prediction mode of the chroma component is a second intra-frame prediction mode. The intra-frame prediction mode of the block to be decoded includes the first intra-frame prediction mode and the second intra-frame prediction mode.

12. The method according to claim 11, characterized in that, The first intra-frame prediction mode is one of the following: horizontal mode, vertical mode, DC mode, and planar mode. The second intra-frame prediction mode is one of the following: horizontal mode, vertical mode, DC mode, and cross-component linear model (CCLM) mode.

13. The method according to claim 11, characterized in that, The N bins are either the N bins corresponding to the first intra-frame mode or the N bins corresponding to the second intra-frame mode, wherein the N value of the first intra-frame mode is the same as or different from the N value of the second intra-frame mode.

14. The method according to claim 10, characterized in that, The step of obtaining the intra-frame prediction mode of the block to be decoded includes: Obtain the values ​​of the N bins; Perform inverse binarization on the values ​​of the N bins to obtain the mode information of the intra-frame prediction mode.

15. An encoding device, characterized in that, include: The acquisition module is used to acquire N binary bins of the intra-prediction mode of the block to be encoded, where N is an integer greater than 1, and the N bins indicate the intra-prediction mode. The encoding module is used for the context index of each of the N bins, wherein the context index of the i-th bin is obtained based on the value of at least one of the previous (i-1) bins, and i is an integer greater than 1 and less than or equal to N; The encoding module is further configured to encode the N bins based on the context index of the N bins to obtain the bitstream of the image to be encoded; wherein the bitstream includes the encoded data of the N bins, and the image to be encoded includes the block to be encoded.

16. The apparatus according to claim 15, characterized in that, When N is 2, the encoding module is specifically used for: Assign a first context index to the first bin among the N bins; Assign a second context index to the second bin among the N bins; wherein, if the value of the first bin is 0, the second context index is a first value; if the value of the first bin is 1, the second context index is a second value, and the first value is different from the second value.

17. The apparatus according to claim 15 or 16, characterized in that, The encoding module is specifically used for: Based on the context index of the bin, obtain the context probability model corresponding to the context index; The value of bin is encoded based on the context probability model.

18. A decoding device, characterized in that, include: The acquisition module is used to acquire the bitstream of the image to be decoded. The image to be decoded includes a block to be decoded. The bitstream includes encoded data obtained by encoding N binary bins based on the intra-frame prediction mode of the block to be decoded, where N is an integer greater than 1. The decoding module is used to decode the bitstream based on the context index of each of the N bins to obtain the intra-prediction mode of the block to be decoded; wherein the context index of the i-th bin is obtained based on the value of at least one of the first (i-1) bins, and i is an integer greater than 1 and less than or equal to N; A reconstruction module is used to obtain reconstruction data of the block to be decoded based on the intra-frame prediction mode.

19. The apparatus according to claim 18, characterized in that, When N is 2, the decoding module is specifically used for: Based on the first context index, the bitstream is decoded to obtain the value of the first bin among the N bins; Based on the value of the first bin, a second context index is obtained, which corresponds to the context index of the second bin among the N bins. If the value of the first bin is 0, the second context index is a first value; if the value of the first bin is 1, the second context index is a second value; the first value and the second value are different. Based on the second context index, the bitstream is decoded to obtain the value of the second bin.

20. The apparatus according to claim 19, characterized in that, The decoding module is specifically used for: Based on the context index of each of the N bins, obtain the context probability model corresponding to the context index; The bitstream is decoded based on the context probability model.

21. 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 encoder to perform the method as described in any one of claims 1 to 7.

22. 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 8 to 14.

23. 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 14.

24. 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 14 to be performed.

25. 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 7.