Video encoding and decoding methods, apparatuses, computer readable medium, and electronic device
Patent Information
- Application Number
- HK42023075134
- Authority / Receiving Office
- HK · HK
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2026-09-11
AI Technical Summary
During video encoding and decoding, the numerical distribution of residual data is complex and diverse, resulting in low encoding and decoding efficiency and affecting the compression performance of the video.
By obtaining the flag combination corresponding to the non-zero coefficients in the coding block of the video image frame, and using the channel information of the coding block, the position information of the non-zero coefficients in the coding block, and the statistical information of the decoded non-zero coefficients, the context index increment is assigned to the absolute value threshold flag of the coefficients, thereby improving the encoding and decoding method and increasing the encoding efficiency.
The binarization and encoding/decoding methods for the absolute values of non-zero coefficients within the scanning area have been improved, increasing the coding efficiency of coefficient encoding and further enhancing video compression performance.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application filed on February 21, 2021, with application number 202110194822.8 and entitled "Video Encoding and Decoding Method, Apparatus, Computer-Readable Medium and Electronic Device". Technical Field
[0002] This application belongs to the field of video encoding and decoding technology, specifically relating to a video decoding method, a video decoding device, a video encoding method, a video encoding device, a computer-readable medium, and an electronic device. Background Technology
[0003] During video encoding and decoding, the encoding end typically needs to transform, quantize, and entropy-encode the residual data between the original video data and the predicted video data before sending it to the decoding end. Because the residual data has a complex and diverse numerical distribution, encoding and decoding of the residual data generally suffers from low efficiency, affecting the video compression performance. Summary of the Invention
[0004] The purpose of this application is to provide a video decoding method, a video decoding device, a video encoding method, a video encoding device, a computer-readable medium, and an electronic device, which at least to some extent overcome the technical problem of low video encoding and decoding efficiency in related technologies.
[0005] According to one aspect of the embodiments of this application, a video decoding method is provided. The method includes: obtaining a flag combination corresponding to non-zero coefficients in a coding block of a video image frame, the flag combination including at least two coefficient absolute value threshold flags, the coefficient absolute value threshold flags being used to indicate whether the absolute value of the non-zero coefficient is greater than a corresponding coefficient absolute value threshold, the flag combination including at least one coefficient absolute value threshold flag with a coefficient absolute value threshold greater than or equal to 2; assigning a context index increment corresponding to the coefficient absolute value threshold flag based on channel information of the coding block, position information of the non-zero coefficient within the coding block, and statistical information of the decoded non-zero coefficients within the coding block; determining a context model corresponding to the coefficient absolute value threshold based on the assigned context index increment, and decoding the coefficient absolute value threshold flag based on the context model to obtain the value of the coefficient absolute value threshold flag; and determining the absolute value of the non-zero coefficient based on the values of each coefficient absolute value threshold flag in the flag combination.
[0006] In some embodiments of this application, based on the above technical solutions, before assigning the context index increment corresponding to the absolute value threshold flag of the coefficients according to the channel information of the coding block, the position information of the non-zero coefficients within the coding block, and the statistical information of the decoded non-zero coefficients within the coding block, the method further includes: determining the model selection method corresponding to the absolute value threshold flag of the coefficients, wherein the model selection method includes single model selection and dynamic model selection; if it is determined that the model selection method corresponding to the absolute value threshold flag of the coefficients is single model selection, then assigning the context index increment corresponding to the absolute value threshold flag of the coefficients with a preset first value; if it is determined that the model selection method corresponding to the absolute value threshold flag of the coefficients is dynamic model selection, then assigning the context index increment corresponding to the absolute value threshold flag of the coefficients according to the channel information of the coding block and the position information of the non-zero coefficients within the coding block.
[0007] In some embodiments of this application, based on the above technical solutions, before decoding the coefficient absolute value threshold flag based on the context model, the method further includes: determining a decoding method corresponding to each coefficient absolute value threshold flag, wherein the decoding method includes at least one of bypass decoding and conventional decoding; if the decoding method corresponding to the coefficient absolute value threshold flag is determined to be bypass decoding, then the coefficient absolute value threshold flag is input into a bypass decoding engine to decode the coefficient absolute value threshold flag through the bypass decoding engine; if the decoding method corresponding to the coefficient absolute value threshold flag is determined to be conventional decoding, then the coefficient absolute value threshold flag is input into a conventional decoding engine based on the context model to decode the coefficient absolute value threshold flag through the conventional decoding engine.
[0008] In some embodiments of this application, based on the above technical solutions, assigning a value to the context index increment corresponding to the absolute value threshold flag of the coefficient according to the channel information of the coding block, the position information of the non-zero coefficient within the coding block, and the statistical information of the decoded non-zero coefficients within the coding block includes: assigning an initial value to the context index increment corresponding to the absolute value threshold flag of the coefficient according to the channel information of the coding block; determining a first increment value according to the position information of the non-zero coefficient within the coding block and the initial value; determining a second increment value according to the statistical information of the decoded non-zero coefficients within the coding block and the first increment value, and assigning the second increment value to the context index increment.
[0009] In some embodiments of this application, based on the above technical solutions, obtaining a flag combination corresponding to a non-zero coefficient in the coding block of a video image frame includes: determining a current coefficient to be decoded in the coding block of the video image frame, wherein the current coefficient is a non-zero coefficient determined sequentially in the scanning order within the coefficient encoding SRCC scanning area of the coding block based on the scanning region; obtaining a flag combination corresponding to the current coefficient, wherein the flag combination includes at least two coefficient absolute value threshold flags, wherein the coefficient absolute value threshold flags are used to indicate whether the absolute value of the current coefficient is greater than the corresponding coefficient absolute value threshold, and the flag combination includes at least one coefficient absolute value threshold flag whose coefficient absolute value threshold is greater than or equal to two.
[0010] According to one aspect of the embodiments of this application, a video decoding apparatus is provided. The apparatus includes: a flag combination acquisition module configured to acquire flag combinations corresponding to non-zero coefficients in a coding block of a video image frame, the flag combination including at least two coefficient absolute value threshold flags, the coefficient absolute value threshold flags being used to indicate whether the absolute value of the non-zero coefficient is greater than a corresponding coefficient absolute value threshold, the flag combination including at least one coefficient absolute value threshold flag with a coefficient absolute value threshold greater than or equal to two; a flag decoding module configured to assign a context index increment corresponding to the coefficient absolute value threshold flag based on channel information of the coding block, position information of the non-zero coefficient within the coding block, and statistical information of the decoded non-zero coefficients within the coding block; determine a context model corresponding to the coefficient absolute value threshold based on the assigned context index increment, and decode the coefficient absolute value threshold flag based on the context model to obtain the value of the coefficient absolute value threshold flag; and a coefficient absolute value determination module configured to determine the absolute value of the non-zero coefficient based on the values of each of the coefficient absolute value threshold flags in the flag combination.
[0011] According to one aspect of the embodiments of this application, a video coding method is provided. The method includes: obtaining a flag combination corresponding to non-zero coefficients in a coding block of a video image frame, the flag combination including at least two coefficient absolute value threshold flags, the coefficient absolute value threshold flags being used to indicate whether the absolute value of the non-zero coefficient is greater than a corresponding coefficient absolute value threshold, the flag combination including at least one coefficient absolute value threshold flag with a coefficient absolute value threshold greater than or equal to 2; assigning values to each coefficient absolute value threshold flag in the flag combination according to the relationship between the absolute value of the non-zero coefficient and each coefficient absolute value threshold; assigning a context index increment corresponding to the coefficient absolute value threshold flag according to channel information of the coding block, position information of the non-zero coefficient within the coding block, and statistical information of the non-zero coefficients already decoded within the coding block; determining a context model corresponding to the coefficient absolute value threshold according to the assigned context index increment, and encoding the coefficient absolute value threshold flag based on the context model.
[0012] According to one aspect of the embodiments of this application, a video encoding apparatus is provided, the apparatus comprising: a flag combination acquisition module configured to acquire flag combinations corresponding to non-zero coefficients in an encoding block of a video image frame, the flag combination including at least two coefficient absolute value threshold flags, the coefficient absolute value threshold flags being used to indicate whether the coefficient absolute value of the non-zero coefficient is greater than a corresponding coefficient absolute value threshold, the flag combination including at least one coefficient absolute value threshold flag with a coefficient absolute value threshold greater than or equal to 2; a flag assignment module configured to assign values to each coefficient absolute value threshold flag in the flag combination according to the relationship between the coefficient absolute value of the non-zero coefficient and each coefficient absolute value threshold; assign values to the context index increment corresponding to the coefficient absolute value threshold flag according to the channel information of the encoding block, the position information of the non-zero coefficient within the encoding block, and statistical information of the non-zero coefficients already decoded within the encoding block; and a flag encoding module configured to determine a context model corresponding to the coefficient absolute value threshold according to the assigned context index increment, and encode the coefficient absolute value threshold flag based on the context model.
[0013] According to one aspect of the embodiments of this application, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the methods described in the above technical solutions.
[0014] According to one aspect of the embodiments of this application, an electronic device is provided, the electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method as described in the above technical solutions by executing the executable instructions.
[0015] According to one aspect of the embodiments of this application, a computer program product or computer program is provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method as described in the above technical solutions.
[0016] In the technical solution provided in this application embodiment, the syntax elements used when encoding and decoding non-zero coefficient absolute values in the scanning area of the coding block are modified by a combination of flags including multiple coefficient absolute value threshold flags. This improves the binarization and encoding / decoding method of non-zero coefficient absolute values in the scanning area, which helps to improve the coding efficiency of coefficient encoding and further improve video compression performance. Attached Figure Description
[0017] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied is shown.
[0018] Figure 2 This diagram illustrates the placement of video encoding and decoding devices in a streaming system.
[0019] Figure 3 A basic flowchart of a video encoder is shown.
[0020] Figure 4 The scanned area marked by SRCC technology is shown.
[0021] Figure 5 A schematic diagram showing the sequence of scanning the marked scanning area is provided.
[0022] Figure 6 A flowchart illustrating the steps of a video decoding method in one embodiment of this application is shown.
[0023] Figure 7 The flowchart illustrates the steps of decoding the absolute value threshold flag of a coefficient using conventional decoding in one embodiment of this application.
[0024] Figure 8 The flowchart illustrates the steps of incrementally assigning values to the context index based on a dynamic model selection method in one embodiment of this application.
[0025] Figure 9 This illustration shows a schematic diagram of the region distribution for scanning regions of a coding block using the normal intra-frame prediction mode, according to one embodiment of this application.
[0026] Figure 10This illustration shows a schematic diagram of the region distribution for scanning regions of a coding block that does not employ the normal intra-frame prediction mode, according to one embodiment of this application.
[0027] Figure 11 A flowchart illustrating the steps of determining the absolute value of a coefficient based on a combination of continuously increasing flags from the beginning, is shown in one embodiment of this application.
[0028] Figure 12 A flowchart illustrating the steps of determining the absolute value of a coefficient based on a combination of non-continuously increasing or partially continuously increasing flags in one embodiment of this application is shown.
[0029] Figure 13 A flowchart illustrating the steps of a video encoding method in one embodiment of this application is shown.
[0030] Figure 14 A structural block diagram of the video decoding apparatus provided in an embodiment of this application is shown.
[0031] Figure 15 A structural block diagram of the video encoding apparatus provided in an embodiment of this application is shown.
[0032] Figure 16 A schematic diagram of a computer system architecture suitable for implementing the embodiments of this application is shown. Detailed Implementation
[0033] Figure 1 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied is shown.
[0034] like Figure 1 As shown, system architecture 100 includes multiple terminal devices that can communicate with each other via, for example, a network 150. For instance, system architecture 100 may include a first terminal device 110 and a second terminal device 120 interconnected via network 150. Figure 1 In one embodiment, the first terminal device 110 and the second terminal device 120 perform unidirectional data transmission.
[0035] For example, the first terminal device 110 can encode video data (e.g., a video image stream captured by the terminal device 110) to transmit it to the second terminal device 120 via the network 150. The encoded video data is transmitted in the form of one or more encoded video streams. The second terminal device 120 can receive the encoded video data from the network 150, decode the encoded video data to recover the video data, and display video images based on the recovered video data.
[0036] In one embodiment of this application, system architecture 100 may include a third terminal device 130 and a fourth terminal device 140 that perform bidirectional transmission of encoded video data, such as during a video conference. For bidirectional data transmission, each of the third terminal device 130 and the fourth terminal device 140 may encode video data (e.g., a video image stream captured by the terminal device) for transmission over network 150 to the other terminal device. Each of the third terminal device 130 and the fourth terminal device 140 may also receive encoded video data transmitted by the other terminal device, decode the encoded video data to recover the video data, and display the video images on an accessible display device based on the recovered video data.
[0037] exist Figure 1 In the embodiments disclosed herein, the first terminal device 110, the second terminal device 120, the third terminal device 130, and the fourth terminal device 140 may be servers, personal computers, and smartphones, but the principles disclosed herein are not limited to these. The embodiments disclosed herein are applicable to laptop computers, tablet computers, media players, and / or dedicated video conferencing equipment. Network 150 refers to any number of networks that transmit encoded video data between the first terminal device 110, the second terminal device 120, the third terminal device 130, and the fourth terminal device 140, including, for example, wired and / or wireless communication networks. Communication network 150 may exchange data in circuit-switched and / or packet-switched channels. This network may include telecommunications networks, local area networks, wide area networks, and / or the Internet. For the purposes of this application, unless explained below, the architecture and topology of network 150 may be irrelevant to the operation of this application.
[0038] In one embodiment of this application, Figure 2 The illustration shows the placement of video encoding and decoding devices in a streaming environment. The subject matter disclosed in this application is equally applicable to other video-enabled applications, including, for example, video conferencing, digital television (television), storing compressed video on digital media including CDs, DVDs, memory sticks, etc.
[0039] The streaming system may include an acquisition subsystem 213, which may include a video source 201 such as a digital camera, which creates an uncompressed video image stream 202. In an embodiment, the video image stream 202 includes samples captured by a digital camera. The video image stream 202 is depicted as a thick line to emphasize the high data volume of the video image stream compared to encoded video data 204 (or encoded video bitstream 204). The video image stream 202 may be processed by an electronic device 220, which includes a video encoding device 203 coupled to the video source 201. The video encoding device 203 may include hardware, software, or a combination of hardware and software to implement or enforce aspects of the disclosed subject matter as described in more detail below. The encoded video data 204 (or encoded video bitstream 204) is depicted as a thin line to emphasize the lower data volume of the encoded video data 204 (or encoded video bitstream 204), which may be stored on a streaming server 205 for future use. One or more streaming client subsystems, such as Figure 2 Client subsystems 206 and 208 can access streaming server 205 to retrieve copies 207 and 209 of encoded video data 204. Client subsystem 206 may include, for example, a video decoding device 210 in electronic device 230. Video decoding device 210 decodes the incoming copy 207 of the encoded video data and produces an output video picture stream 211 that can be displayed on display 212 (e.g., a screen) or another presentation device. In some streaming systems, the encoded video data 204, video data 207, and video data 209 (e.g., video streams) may be encoded according to certain video coding / compression standards. Examples of such standards include ITU-T H.265. In embodiments, the video coding standard under development is informally referred to as Versatile Video Coding (VVC), and this application can be used in the context of the VVC standard.
[0040] It should be noted that electronic devices 220 and 230 may include other components not shown in the figures. For example, electronic device 220 may include a video decoding device, and electronic device 230 may also include a video encoding device.
[0041] In one embodiment of this application, taking the international video coding standards HEVC (High Efficiency Video Coding) and VVC (Versatile Video Coding), as well as the Chinese national video coding standard AVS, as examples, after an input video frame image, the video frame image is divided into several non-overlapping processing units according to a block size. Each processing unit will perform a similar compression operation. This processing unit is called a CTU (Coding Tree Unit) or LCU (Largest Coding Unit). The CTU can be further subdivided into one or more basic coding units (CUs), which are the most basic elements in a coding process. The following introduces some concepts when encoding CUs:
[0042] Predictive coding includes intra-frame prediction and inter-frame prediction. The original video signal is predicted from a selected reconstructed video signal to obtain a residual video signal. The encoder needs to determine which predictive coding mode to choose for the current CU and inform the decoder. Intra-frame prediction refers to predicting a signal from a region within the same image that has already been encoded and reconstructed; inter-frame prediction refers to predicting a signal from another encoded image (called a reference image) that is different from the current image.
[0043] Transform and Quantization: After the residual video signal undergoes transformation operations such as DFT (Discrete Fourier Transform) and DCT (Discrete Cosine Transform), the signal is transformed into the transform domain, and these are called transform coefficients. The transform coefficients are then subjected to lossy quantization, losing some information to make the quantized signal more suitable for compression. In some video coding standards, there may be more than one transform method to choose from; therefore, the encoder needs to select one of the transform methods for the current CU and inform the decoder. The fineness of quantization is usually determined by the quantization parameter (QP). A larger QP value means that coefficients with a wider range of values will be quantized into the same output, which usually results in greater distortion and a lower bit rate; conversely, a smaller QP value means that coefficients with a smaller range of values will be quantized into the same output, which usually results in less distortion and a higher bit rate.
[0044] Entropy coding, or statistical coding, involves statistically compressing the quantized transform-domain signal based on the frequency of each value, ultimately outputting a binary (0 or 1) compressed bitstream. Simultaneously, other information generated during encoding, such as the selected coding mode and motion vector data, also requires entropy coding to reduce the bit rate. Statistical coding is a lossless coding method that effectively reduces the bit rate required to represent the same signal. Common statistical coding methods include Variable Length Coding (VLC) and Content-Adaptive Binary Arithmetic Coding (CABAC).
[0045] Context-Based Adaptive Binary Arithmetic Coding (CABAC) primarily involves three steps: binarization, context modeling, and binary arithmetic coding. After binarizing the input syntax elements, the binary data can be encoded using either a regular coding mode or a bypass coding mode. The bypass coding mode does not require assigning a specific probability model to each binary bit; the input binary bit bin value is directly encoded using a simple bypass encoder, thus accelerating the overall encoding and decoding speed. Generally, different syntax elements are not completely independent, and the same syntax elements themselves possess a certain degree of memory. Therefore, according to conditional entropy theory, using other encoded syntax elements for conditional coding can further improve coding performance compared to independent coding or memoryless coding. This encoded symbol information used as conditions is called the context. In the regular coding mode, the binary bits of the syntax elements sequentially enter the context modeler. The encoder assigns an appropriate probability model to each input binary bit based on the values of previously encoded syntax elements or binary bits; this process is called context modeling. The context model corresponding to a syntax element can be located using `ctxIdxInc(contextindex increment)` and `ctxIdxStart(context index Start)`. After the bin value and the assigned probability model are fed into the binary arithmetic encoder for encoding, the context model needs to be updated based on the bin value, which is the adaptive process in encoding.
[0046] Loop Filtering: The transformed and quantized signal undergoes inverse quantization, inverse transform, and prediction compensation to obtain a reconstructed image. Due to the effects of quantization, the reconstructed image differs from the original image in some aspects, resulting in distortion. Therefore, filtering operations can be performed on the reconstructed image, such as deblocking filters (DB), SAO (Sample Adaptive Offset), or ALF (Adaptive Loop Filter), to effectively reduce the distortion caused by quantization. Since these filtered reconstructed images will serve as a reference for subsequent coded images to predict future image signals, the aforementioned filtering operations are also called loop filtering, i.e., filtering operations within the coding loop.
[0047] In one embodiment of this application, Figure 3 A basic flowchart of a video encoder is shown, illustrating the process using intra-frame prediction as an example. The original image signal s... k [x,y] and the predicted image signal Perform the difference operation to obtain the residual signal u. k [x,y], residual signal u k After transformation and quantization, [x,y] is obtained as quantization coefficients. These coefficients are then used to obtain the encoded bitstream through entropy encoding, and to obtain the reconstructed residual signal u' through inverse quantization and inverse transform. k [x,y], predict image signal With the reconstructed residual signal u' k [x,y] superimposed to generate image signals Image signal On one hand, the signal is input to the intra-frame mode decision module and the intra-frame prediction module for intra-frame prediction processing; on the other hand, the reconstructed image signal s' is output through loop filtering. k [x,y], reconstruct the image signal s' k [x,y] can be used as a reference image for the next frame for motion estimation and motion compensation prediction. Then, based on the result s' of the motion compensation prediction... r [x+m x ,y+m y ] and intra-frame prediction results Obtain the predicted image signal for the next frame. And continue repeating the above process until the encoding is complete.
[0048] Based on the above encoding process, at the decoding end, for each CU, after acquiring the compressed bitstream (i.e., bitstream), entropy decoding is performed to obtain various mode information and quantization coefficients. Then, the quantization coefficients undergo inverse quantization and inverse transform processing to obtain the residual signal. On the other hand, based on the known encoding mode information, the prediction signal corresponding to that CU can be obtained. Then, the residual signal and the prediction signal are added together to obtain the reconstructed signal. The reconstructed signal then undergoes loop filtering and other operations to generate the final output signal.
[0049] In the aforementioned encoding and decoding process, the transformation of the residual signal concentrates its energy in a smaller number of low-frequency coefficients, meaning most coefficient values are small. After subsequent quantization, these smaller coefficient values become zero, significantly reducing the cost of encoding the residual signal. However, due to the diversity of residual distributions, a single DCT transform cannot adapt to all residual characteristics. Therefore, transform cores such as DST7 and DCT8 are introduced into the transformation process, and different transform cores can be used for horizontal and vertical transformations of the residual signal. Taking AMT (Adaptive Multiple Core Transform) technology as an example, possible transform combinations for a residual signal are as follows: (DCT2, DCT2), (DCT8, DCT8), (DCT8, DST7), (DST7, DCT8), and (DST7, DST7). The specific transform combination chosen for the residual signal needs to be decided at the encoding end using RDO (Rate-Distortion Optimization). Furthermore, when the correlation of residual distribution within a residual block is weak, the residual signal can be quantized directly without a transformation process, i.e., transform skipping. Whether the current residual block belongs to transform skipping mode can be identified through explicit encoding or implicit derivation.
[0050] Because the non-zero coefficients in the quantized coefficient block after transformation and quantization of the residual signal are more likely to be concentrated in the left and upper regions of the block, while the right and lower regions are often 0, the SRCC technique is introduced. SRCC marks the upper left region of non-zero coefficients in each quantized coefficient block (size W×H) as (SRx+1)×(SRy+1), where SRx is the x-coordinate of the rightmost non-zero coefficient in the quantized coefficient block, SRy is the y-coordinate of the bottommost non-zero coefficient, and the upper left corner is (0,0), 1≤SRx+1≤W, 1≤SRy+1≤H, and coefficients outside this region are all 0. SRCC uses (SRx, SRy) to determine the quantized coefficient region to be scanned within a quantized coefficient block, such as... Figure 4As shown, only the quantization coefficients within the scan region marked (SRx, SRy) need to be encoded, and the encoding scan order is as follows. Figure 5 As shown, it can be a reverse Z-shaped scan from the bottom right corner to the top left corner.
[0051] The coefficients to be encoded within the SRCC region are encoded using a layered approach. Specifically, first, the coordinates of the SRCC scan area are encoded. Then, within the SRCC region, based on the scan order, a flag indicating whether the coefficient at the current position is 0 is encoded one by one. Simultaneously, the positions of non-zero coefficients are recorded and the number of non-zero coefficients is counted. If the number of non-zero coefficients is greater than 0, the absolute value and sign of the non-zero coefficient at the corresponding position need to be encoded.
[0052] Table 1 illustrates the coefficient encoding process based on SRCC technology in one embodiment of this application. Fields with bold underlines represent syntax elements that need to be decoded, while fields without underscores and with the first letter capitalized represent variables. The values of these variables can be obtained by decoding the syntax elements. Some details irrelevant to this application are omitted from the process in Table 1. For each non-zero coefficient, the syntax elements involved in its encoding include coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, coeff_abs_level_remaining, and coeff_sign.
[0053] Table 1. Coefficient encoding process based on SRCC technology in the embodiments of this application.
[0054]
[0055]
[0056]
[0057] Table 2 shows the relevant descriptors involved in coefficient encoding based on SRCC technology in one embodiment of this application. The descriptors are used to represent the parsing process of different syntax elements.
[0058] Table 2. Relevant descriptors of SRCC technology in the embodiments of this application.
[0059]
[0060] In the above embodiments, scan_region_x and scan_region_y represent the right-hand horizontal coordinate and the bottom vertical coordinate of the scan region, respectively, used to determine the coefficient scan region. The coefficient scan region is a rectangular area with (0, 0) as the upper left corner and (scan_region_x, scan_region_y) as the lower right corner. The values of scan_region_x and scan_region_y are less than or equal to 31.
[0061] `sig_flag` is a non-zero flag used to determine whether the current coefficient is non-zero. A value of '0' indicates that the current coefficient is '0'; a value of '1' indicates that the current coefficient is non-zero.
[0062] `coeff_abs_level_greater1_flag` is a flag indicating whether the absolute value of the coefficient is greater than 1. A value of '0' indicates that the absolute value of the current coefficient is '1'; a value of '1' indicates that the absolute value of the current coefficient is greater than 1.
[0063] `coeff_abs_level_greater2_flag` is a flag indicating whether the absolute value of the coefficient is greater than 2. A value of '0' indicates that the absolute value of the current coefficient is '2'; a value of '1' indicates that the absolute value of the current coefficient is greater than 2.
[0064] `coeff_abs_level_remaining` represents the remaining absolute value of a coefficient, used to determine the remaining absolute value of the current coefficient. If the current coefficient has a remaining absolute value, its absolute value can be 3 + `coeff_abs_level_remaining`.
[0065] In one embodiment of this application, the ctxIdxInc of coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, or coeff_abs_level_greaterx_flag (x greater than or equal to 3) can be determined according to the following logical algorithm. The value of ctxIdxInc is then set to 0.
[0066] If the current block is a chroma block, then ctxIdxInc = ctxIdxInc + 17;
[0067] Let (pos_x,pos_y) be the position of the current coefficient in the current block. The scanning range is the rectangular region defined by (0,0) and (sr_x,sr_y).
[0068] If pos_x equals sr_x and pos_y equals sr_y, and ctxIdxInc is the current value, exit the process and do not execute the remaining steps.
[0069] If the current block is a luminance block, continue executing the following logic;
[0070] If pos_x equals 0 and pos_y equals 0, do not process ctxIdxInc;
[0071] Otherwise, if the current block prediction mode is normal intra-frame prediction,
[0072] Let i be the mapping value of pos_x relative to sr_x, let j be the mapping value of pos_y relative to sr_y, and let s be the sum of mapping values i and j. Then i = (pos_x <= sr_x / 2) ? (pos_x <= sr_x / 4 ? 0 : 1) ? (pos_x <= sr_x * 3 / 4 ? 2 : 3); j = (pos_y <= sr_y / 2) ? (pos_y <= sr_y / 4 ? 0 : 1) ? (pos_y <= sr_y * 3 / 4 ?
[0073] 2:3); then s = i + j;
[0074] If s <= 1, then ctxIdxInc += 4;
[0075] If s > 2, then ctxIdxInc + = 8;
[0076] Otherwise, ctxIdxInc+=12;
[0077] otherwise,
[0078] If pos_x <= sr_x / 2 and pos_y <= sr_y / 2 and pos_x is not equal to 0 and pos_y is not equal to 0, then ctxIdxInc = ctxIdxInc + 4;
[0079] Otherwise, ctxIdxInc = ctxIdxInc + 8.
[0080] If we need to determine the `ctxIdxInc` of `coeff_abs_level_greater1_flag`, let `num_gt1` be the number of non-zero coefficients with an absolute value greater than 1 among the first 5 coefficients decoded in the current block according to the scan order. If there are fewer than 5 non-zero coefficients decoded in the current block according to the scan order, only the number of decoded non-zero coefficients with an absolute value greater than 1 is calculated. `ctxIdxInc += num_gt1 + 1`;
[0081] If we need to determine the `ctxIdxInc` of `coeff_abs_level_greater2_flag`, let `num_gt2` be the number of non-zero coefficients with an absolute value greater than 2 among the first 5 coefficients decoded in the current block according to the scan order. If there are fewer than 5 non-zero coefficients decoded in the current block according to the scan order, only the number of decoded non-zero coefficients with an absolute value greater than 2 is calculated. `ctxIdxInc += num_gt2 + 1`.
[0082] If we need to determine the `ctxIdxInc` of `coeff_abs_level_greaterx_flag`, let `num_gtx` be the number of non-zero coefficients with an absolute value greater than `x` among the first 5 coefficients decoded in the current block according to the scan order. If there are fewer than 5 non-zero coefficients decoded in the current block according to the scan order, only the number of decoded non-zero coefficients with an absolute value greater than `x` is calculated. `ctxIdxInc += num_gtx + 1`.
[0083] Based on the above logical algorithm, the context index increment of multiple coefficient absolute value threshold flags (i.e., the flag coeff_abs_level_greater1_flag indicating that the coefficient absolute value is greater than 1 and the flag coeff_abs_level_greater2_flag indicating that the coefficient absolute value is greater than 2) can be calculated for each non-zero coefficient in the scan region of the coded block. Specifically, the initial value of ctxIdxInc can first be determined based on the image channel information of the coded block. If the coded block is a luma block, the initial value of ctxIdxInc is determined to be 0, while if the coded block is a chroma block, the initial value of ctxIdxInc is determined to be 17. Then, the value of ctxIdxInc is further determined based on the relative position of the current coefficient in the scanning area. Taking a reverse zigzag scanning sequence as an example, if the non-zero coefficient is located in the lower right corner of the scanning area (i.e., the first coefficient to be scanned and decoded), the current value of ctxIdxInc is maintained, that is, ctxIdxInc for the luma block is determined to be 0, and ctxIdxInc for the chroma block is determined to be 17; if the non-zero coefficient is located in the upper left corner of the scanning area (i.e., the last coefficient to be scanned and decoded), and the current coding block is a chroma block, the current value of ctxIdxInc is maintained, that is, it is set to 17; if the current coefficient is in a position other than these two positions, the value of ctxIdxInc is adjusted according to the relative position of the current coefficient in the scanning area. The specific adjustment method is to divide the scanning area into multiple local areas according to the coding prediction mode of the coding block, and then adjust the value of ctxIdxInc according to the local area where the current coefficient is located. Finally, the value of ctxIdxInc is assigned by counting the number of coefficients whose absolute values are greater than the corresponding absolute value threshold x among the first 5 non-zero coefficients decoded, num_gtx, and the adjusted value of ctxIdxInc, i.e., ctxIdxInc += num_gtx + 1. If the non-zero coefficient is located in the upper left corner of the scanning area (i.e., the last coefficient scanned and decoded), and the current encoded block is a luma block or a chroma block, then the value of ctxIdxInc is adjusted according to num_gtx, i.e., ctxIdxInc += num_gtx + 1.
[0084] Taking the AVS3 standard as an example, intra-frame prediction includes ordinary intra-frame prediction, intra-block copy (IBC), and intra-string copy (ISC). Depending on whether the coded block uses ordinary intra-frame prediction, the value of ctxIdxInc can be adjusted in different ways according to the distribution position of the current coefficients, following the logic described above.
[0085] Taking the AVS3 standard as an example, ordinary transforms utilize the correlation of residuals to concentrate energy in the residuals, aiming to concentrate energy in a limited number of low-frequency coefficient positions. Transform coefficients obtained through transforms often have a characteristic of relatively small values, meaning that the absolute values of most non-zero coefficients are concentrated at 1 and 2. Therefore, in the AVS3 standard, the syntax elements `coeff_abs_level_greater1_flag` and `coeff_abs_level_greater2_flag` can be used to encode the absolute values of non-zero coefficients. However, transform skipping, because it does not concentrate energy through transforms, has more complex and diverse residual distribution characteristics. Compared to transformed coefficients, the absolute values of non-zero coefficients in the transformed skipping mode's coded block are not necessarily concentrated only at 1 and 2, but may contain more larger values. Therefore, using only the two syntax elements `coeff_abs_level_greater1_flag` and `coeff_abs_level_greater2_flag` cannot fully utilize the residual distribution characteristics of the transformed skipping mode's coded block, leading to a decrease in coding efficiency.
[0086] Based on the characteristics and diversity of residual distribution under different coding modes, this application proposes a coding method for the absolute value of non-zero coefficients. By modifying the syntax elements used in encoding and decoding the absolute value of non-zero coefficients in the SRCC region, the binarization and encoding / decoding methods of the absolute value of non-zero coefficients in the SRCC region are improved, which helps to improve the coding efficiency of coefficient coding and further enhance video compression performance.
[0087] It should be noted that the coefficient encoding method proposed in this application is not limited to coefficient encoding in transform skip mode. It can also be used in other encoding modes, for example, in coefficient encoding of all blocks, such as when the image-level intra-frame prediction transform skip permission flag is 1; when the image-level inter-frame prediction transform skip permission flag is 1; when both the image-level intra-frame prediction transform skip permission flag and the image-level inter-frame prediction transform skip permission flag are 1, and so on.
[0088] This application embodiment can determine whether a coded block adopts a transform skip mode through explicit encoding or implicit derivation. Explicit encoding involves decoding a flag indicating whether the coded block adopts a transform skip mode before decoding the absolute values of the coefficients, using the decoding result based on the flag to determine whether the current coded block needs to skip the transform process. Implicit derivation (i.e., implicit selection of transform skip) involves statistically analyzing the coefficient decoding results without a corresponding flag, and then determining whether to skip the transform process based on the statistical results. For example, all coefficients can be decoded first, the number of all non-zero coefficients and the number of even coefficients among all coefficients (including zero coefficients) can be calculated, and then, based on the parity of the number of non-zero coefficients or the parity of the number of even coefficients among all coefficients, it can be implicitly deduced whether the current coding block uses transform skipping (for example, if the number of non-zero coefficients is odd, it is determined that the current coding block uses transform skipping; while if the number of non-zero coefficients is even, it is determined that the current coding block does not use transform skipping).
[0089] The image-level intra-frame prediction transform skip permission flag and the image-level inter-frame prediction transform skip permission flag are flags used to control whether implicit transform skipping can be used intra-frame / inter-frame. In the embodiments of this application, the syntax elements related to transform skipping modes are explained as follows.
[0090] Implicit transformation skip enable flag: ist_skip_enable_flag
[0091] A binary variable. A value of '1' indicates that implicit selection transformation can be used to skip; a value of '0' indicates that implicit selection transformation should not be used to skip. The value of the variable IstSkipEnableFlag can be obtained by decoding the syntax element ist_skip_enable_flag. If the syntax element ist_skip_enable_flag does not exist in the bitstream, IstSkipEnableFlag can be assigned the value 0.
[0092] inter-transform skip enable flag:
[0093] A binary variable. A value of '1' indicates that inter-transform skipping can be used; a value of '0' indicates that inter-transform skipping should not be used. The value of the variable `InterTransformSkipEnableFlag` can be obtained by decoding the syntax element `inter_transform_skip_enable_flag`. If the syntax element `inter_transform_skip_enable_flag` does not exist in the bitstream, `InterTransformSkipEnableFlag` can be assigned the value 0.
[0094] Image-level intra-frame prediction transform skip enable flag: picture_ist_skip_enable_flag
[0095] A binary variable. A value of '1' indicates that the transform skip method can be used for the luma intra-prediction residual block and the copy intra-prediction residual block of the luma coding block in the current image; a value of '0' indicates that the transform skip method should not be used for the luma intra-prediction residual block and the copy intra-prediction residual block of the luma coding block in the current image. The value of the variable PictureIstSkipEnableFlag can be obtained by decoding the syntax element picture_ist_skip_enable_flag. If the syntax element picture_ist_skip_enable_flag does not exist in the bitstream, PictureIstSkipEnableFlag can be assigned the value 0.
[0096] Image-level inter-frame prediction transform skip flag: picture_inter_trasform_skip_flag
[0097] A binary variable. A value of '1' indicates that the luma inter-frame prediction residual block of the current image can use the transform skip method; a value of '0' indicates that the luma inter-frame prediction residual block of the current image should not use the transform skip method. The value of PictureInterSkipEnableFlag can be obtained by decoding the syntax element picture_inter_trasform_skip_flag. If the syntax element picture_inter_trasform_skip_flag does not exist in the bitstream, PictureInterSkipEnableFlag can be assigned the value 0.
[0098] Image-level transform skip enable flag: picture_ts_enable_flag
[0099] A binary variable. A value of '1' indicates that the current image can use the transform skip method; a value of '0' indicates that the current image should not use the transform skip method. The value of PictureTsEnableFlag can be obtained by decoding the syntax element picture_ts_enable_flag. If the syntax element picture_ts_enable_flag does not exist in the bitstream, it can be assigned the value 0.
[0100] The implementation details of the technical solutions in the embodiments of this application will be described in detail below with reference to specific application scenarios.
[0101] Figure 6 A flowchart illustrating the steps of a video decoding method according to one embodiment of this application is shown. This video decoding method can be executed by a device with computing processing capabilities, such as a terminal device or a server. Figure 6 As shown, the video decoding method mainly includes the following steps S610 to S640.
[0102] Step S610: Determine the current coefficient to be decoded in the coding block of the video image frame. The current coefficient is a non-zero coefficient determined sequentially in the scanning order within the coefficient encoding SRCC scanning area based on the scanning region of the coding block.
[0103] In one embodiment of this application, the video image frame sequence includes a series of images, each of which can be further divided into slices, and each slice can be further divided into a series of LCUs (or CTUs), with each LCU containing several CUs. Video image frames are encoded in blocks. In some newer video coding standards, such as H.264, there are macroblocks (MBs), which can be further divided into multiple prediction blocks for predictive coding. In the 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 novel tree-based structure is used for description. For example, a CU can be divided into smaller CUs according to a quadtree, and these smaller CUs can be further divided to form a quadtree structure. In the embodiments of this application, the coding block can be a CU, or a block smaller than a CU, such as a smaller block obtained by dividing a CU.
[0104] Step S620: Obtain the flag combination corresponding to the current coefficient. The flag combination includes at least two coefficient absolute value threshold flags. The coefficient absolute value threshold flag is used to indicate whether the absolute value of the current coefficient is greater than the corresponding coefficient absolute value threshold. The flag combination includes at least one coefficient absolute value threshold flag with a coefficient absolute value threshold greater than 2.
[0105] In an embodiment of the present application, the flag combination may include n coefficient absolute value threshold flags corresponding to n successively increasing coefficient absolute value thresholds starting from 1. n is an integer greater than or equal to three. For example, the n successively increasing coefficient absolute value thresholds x starting from 1 are 1, 2, 3, 4, 5, …, n, where n >= 3. The corresponding flag combination includes n coefficient absolute value threshold flags coeff_abs_level_greaterx_flag.
[0106] In an embodiment of the present application, the flag combination includes n coefficient absolute value threshold flags corresponding to n non - continuously increasing or partially continuously increasing coefficient absolute value thresholds. n is an integer greater than or equal to two. For example, the n non - continuously increasing or partially continuously increasing coefficient absolute value thresholds x are x(1), x(2), …, x(k), …, x(n) in sequence, where n >= 2, k = 1, 2, …, n, and 1 <= x(1) < x(2) < … < x(n). The corresponding flag combination includes n coefficient absolute value threshold flags coeff_abs_level_greaterx(k)_flag.
[0107] The flag combination in the embodiment of the present application may, for example, include but is not limited to any one of the following combinations.
[0108] (1) The coefficient absolute value threshold x takes values 2 and 4 in sequence, and the corresponding flag combination is: coeff_abs_level_greater2_flag, coeff_abs_level_greater4_flag;
[0109] (2) The coefficient absolute value threshold x takes values 2 and 6 in sequence, and the corresponding flag combination is: coeff_abs_level_greater2_flag, coeff_abs_level_greater6_flag;
[0110] (3) The coefficient absolute value threshold x takes values 2, 4, and 6 in sequence, and the corresponding flag combination is: coeff_abs_level_greater2_flag, coeff_abs_level_greater4_flag, coeff_abs_level_greater6_flag;
[0111] (4) The absolute value threshold x of the coefficient takes the values 2, 4 and 8 in sequence, and the corresponding flag combinations are: coeff_abs_level_greater2_flag, coeff_abs_level_greater4_flag, coeff_abs_level_greater8_flag;
[0112] (5) The absolute value threshold x of the coefficient takes the values 2, 6 and 8 in sequence, and the corresponding flag combinations are: coeff_abs_level_greater2_flag, coeff_abs_level_greater6_flag, coeff_abs_level_greater8_flag;
[0113] (6) The absolute value threshold x of the coefficient takes the values of 2, 6 and 10 in sequence, and the corresponding flag combinations are: coeff_abs_level_greater2_flag, coeff_abs_level_greater6_flag, coeff_abs_level_greater10_flag;
[0114] (7) The absolute value threshold x of the coefficient takes values of 1, 2, 4, and 6 in sequence, and the corresponding flag combinations are: coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, coeff_abs_level_greater4_flag, and coeff_abs_level_greater6_flag.
[0115] (8) The absolute value threshold x of the coefficient takes values of 1, 2, 4, and 8 in sequence, and the corresponding flag combinations are: coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, coeff_abs_level_greater4_flag, and coeff_abs_level_greater8_flag.
[0116] (9) The absolute value threshold x of the coefficient takes values of 2, 3, 5 and 9 in sequence, and the corresponding flag combinations are: coeff_abs_level_greater2_flag, coeff_abs_level_greater3_flag, coeff_abs_level_greater5_flag and coeff_abs_level_greater9_flag.
[0117] Step S630: Decode each absolute value threshold flag of the coefficient in the flag combination to obtain the value of each absolute value threshold flag.
[0118] In one embodiment of this application, a method for decoding each absolute value threshold flag of a flag combination may include: determining a decoding method corresponding to each absolute value threshold flag, wherein the decoding method includes at least one of bypass decoding and conventional decoding; if the decoding method corresponding to the absolute value threshold flag is determined to be bypass decoding, then the absolute value threshold flag is input into a bypass decoding engine to decode the absolute value threshold flag; if the decoding method corresponding to the absolute value threshold flag is determined to be conventional decoding, then the absolute value threshold flag is input into a conventional decoding engine based on a context model to decode the absolute value threshold flag.
[0119] In this embodiment, the absolute value threshold flags corresponding to different absolute value thresholds can choose the same decoding method or different decoding methods.
[0120] Step S640: Determine the absolute value of the current coefficient based on the value of the absolute value threshold flag of each coefficient.
[0121] The value or range of the absolute value of the current coefficient can be determined by the value of a coefficient absolute value threshold flag. Combining the values of multiple coefficient absolute value threshold flags in the flag combination can gradually narrow the range of coefficient absolute values and finally determine the absolute value of the current coefficient.
[0122] In one embodiment of this application, either bypass decoding or conventional decoding can be selected to decode the coefficient absolute value threshold flag. Conventional decoding requires assigning a suitable probability model to each input binary bit based on the values of previously decoded syntax elements or binary bits; that is, assigning a context model to the coefficient absolute value threshold flag to be decoded.
[0123] Figure 7 This document illustrates a flowchart of the steps involved in decoding a coefficient absolute value threshold flag using conventional decoding methods in one embodiment of this application. Figure 7 As shown, based on the above embodiments, the method for decoding the absolute value threshold flag of the coefficient using a conventional decoding engine can mainly include the following steps S710 to S750.
[0124] Step S710: Determine the model selection method corresponding to the absolute value threshold flag of the coefficients. The model selection method includes single model selection and dynamic model selection.
[0125] Step S720: If the model selection method corresponding to the absolute value threshold flag of the coefficient is single model selection, then the context index increment corresponding to the absolute value threshold flag of the coefficient is assigned with the first value set in advance.
[0126] Step S730: If the model selection method corresponding to the absolute value threshold flag of the coefficient is determined to be dynamic model selection, then the context index corresponding to the absolute value threshold flag of the coefficient is incrementally assigned according to the attribute information related to the coding block and the current coefficient.
[0127] Step S740: Determine the context model corresponding to the absolute value threshold of the coefficient based on the context index increment obtained from the assignment.
[0128] Step S750: Based on the context model, perform arithmetic decoding on the absolute value threshold flag of the coefficient using a conventional decoding engine.
[0129] In the single model selection mode, assigning a pre-set first value as the context index increment ensures that each non-zero coefficient within the scanned region corresponds to the same context index increment. This means that the same context model is used for arithmetic decoding of the absolute value threshold of all non-zero coefficients. However, in the dynamic model selection mode, non-zero coefficients at different positions can have different context index increments. These different increments determine that different context models can be used for algorithmic decoding of the absolute value threshold of each non-zero coefficient. For example, if the first value is 0 (this value is only for illustrative purposes), when the model selection mode is determined to be single model selection, the context index increment ctxIdxInc can be set to 0. This means that without any additional increment, the corresponding context model is directly located using the context start index ctxIdxStart. When the model selection mode is determined to be dynamic model selection, context index increments ctxIdxInc with different values can be determined based on the coding block, scanned region, and the relevant attributes of the non-zero coefficients. By adding different context index increments ctxIdxInc to the context start index ctxIdxStart, different context models can be located.
[0130] Figure 8 The flowchart of the steps for assigning incremental values to the context index based on the dynamic model selection method in one embodiment of this application is shown. Based on the above embodiment, the step S730, which assigns incremental values to the context index corresponding to the absolute value threshold flag of the coefficient according to the attribute information related to the coding block and the current coefficient, may include the following steps S810 to S830.
[0131] Step S810: Assign an initial value to the context index increment based on the channel information of the coded block.
[0132] In one embodiment of this application, if the coded block is a luma block, a pre-set second value is used as the initial value for the context index increment; if the coded block is a chroma block, a third value is added to the second value and then used as the initial value for the context index increment. For example, the second value is set to 0, and the third value is set to 17; if the coded block is a luma block, the initial value for the context index increment is set to 0, i.e., ctxIdxInc = 0; if the coded block is a chroma block, the initial value for the context index increment is set to 0 + 17 = 17, i.e., ctxIdxInc += 17.
[0133] Step S820: Determine the first increment value based on the position information of the current coefficient within the scanning area of the coding block and the initial value.
[0134] In one embodiment of this application, if the current coefficient is the first or last coefficient scanned in the scanning order within the scanning area of the coding block, the initial value is used as the first increment value; if the current coefficient is another coefficient within the scanning area of the coding block besides the first and last coefficients, the initial value is increased according to the relative position of the current coefficient within the scanning area of the coding block to obtain the first increment value. For example, the SRCC scanning area is a rectangular area determined based on the coefficient position (0,0) at the top left corner and the coefficient position (sr_x, sr_y) at the bottom right corner, and the position of the current coefficient in the coding block is (pos_x, pos_y). Taking a reverse Z-shaped scanning order as an example, if pos_x = sr_x and pos_y = sr_y, it means that the current coefficient is the first coefficient scanned in the scanning order, and if pos_x = 0 and pos_y = 0, it means that the current coefficient is the last coefficient scanned in the scanning order; in both cases, the initial value determined in step S810 is directly used as the first increment value. Conversely, if the current coefficient is one of the coefficients other than the first and last coefficients in the scanning area, the initial value is increased to different degrees according to the relative position of the current coefficient in the scanning area to obtain the first increment value.
[0135] In one embodiment of this application, the method for determining the first incremental value based on the relative position of the current coefficient may include dividing the scanning area into multiple different local regions in order from top to bottom right, and increasing the initial value according to the local region where the current coefficient is located to obtain the first incremental value.
[0136] In one embodiment of the present application, for coding blocks using different prediction coding modes, different scanning area division methods can be selected. First, the present application embodiment can determine whether the prediction coding mode of the coding block is the ordinary intra prediction mode; if the prediction coding mode is the ordinary intra prediction mode, the scanning area is divided into local areas with the number of the first area in the order from the upper left to the lower right, and the first increment value is obtained by increasing the initial value according to the local area where the current coefficient is located; if the prediction coding mode is not the ordinary intra prediction mode (such as the inter prediction mode or other coding prediction modes), the scanning area is divided into local areas with the number of the second area in the order from the upper left to the lower right, and the first increment value is obtained by increasing the initial value according to the local area where the current coefficient is located.
[0137] In one embodiment of the present application, the number of the first area is taken as 3. When the prediction coding mode of the coding block is the ordinary intra prediction mode, the scanning area can be divided into three local areas in the order from the upper left to the lower right.
[0138] Figure 9 The figure shows a schematic diagram of the area distribution of the scanning area division for a coding block using the ordinary intra prediction mode in one embodiment of the present application. As Figure 9 shown, the SRCC scanning area in the embodiment of the present application is a rectangular area determined based on the coefficient position (0, 0) in the upper left corner and the coefficient position (sr_x, sr_y) in the lower right corner. The position of the current coefficient in the coding block is denoted as (pos_x, pos_y). The first mapping value i is determined according to the numerical ratio of pos_x to sr_x, and the second mapping value j is determined according to the numerical ratio of pos_y to sr_y.
[0139] i = (pos_x <= sr_x / 2)? (pos_x <= sr_x / 4? 0:1)? (pos_x <= sr_x*3 / 4? 2:3) j = (pos_y <= sr_y / 2)? (pos_y <= sr_y / 4? 0:1)? (pos_y <= sr_y*3 / 4? 2:3)
[0140] When pos_x <= sr_x / 4, i = 0; when sr_x / 4 < pos_x <= sr_x / 2, i = 1; when sr_x / 2 < pos_x <= sr_x*3 / 4, i = 2; when sr_x*3 / 4 < pos_x, i = 3.
[0141] When pos_y <= sr_y / 4, j = 0; when sr_y / 4 < pos_y <= sr_y / 2, j = 1; when sr_y / 2 < pos_y <= sr_y*3 / 4, j = 2; when sr_y*3 / 4 < pos_y, j = 3.
[0142] The sum of the first mapping value i and the second mapping value j is obtained as the third mapping value s, where s = i + j.
[0143] The scanning area is divided into three local areas in the order from the upper left to the lower right, namely the first local area 901, the second local area 902, and the third local area 903. The current coefficient falling in different areas can increase the initial value by different amplitudes to obtain the first increment value.
[0144] For example, if s <= 1, the current coefficient falls in the first local area 901, and the value 4 can be added to the initial value to obtain the first increment value, that is, ctxIdxInc += 4; if s > 2, the current coefficient falls in the third local area 903, and the value 8 can be added to the initial value to obtain the first increment value, that is, ctxIdxInc += 8; if 1 < s <= 2, the current coefficient falls in the second local area 902, and the value 12 can be added to the initial value to obtain the first increment value, that is, ctxIdxInc += 1'2.
[0145] In an embodiment of the present application, the number of the second areas is taken as 2. When the predictive coding mode of the coding block is not the ordinary intra prediction mode, the scanning area can be divided into two local areas in the order from the upper left to the lower right.
[0146] Figure 10 It shows a schematic diagram of the area distribution for dividing the scanning area of a coding block that does not adopt the ordinary intra prediction mode in an embodiment of the present application. As Figure 10 shown, the SRCC scanning area in the embodiment of the present application is a rectangular area determined based on the coefficient position (0, 0) in the upper left corner and the coefficient position (sr_x, sr_y) in the lower right corner. The position of the current coefficient in the coding block is denoted as (pos_x, pos_y).
[0147] The scanning area is divided into two local areas in the order from the upper left to the lower right, namely the fourth local area 1001 and the fifth local area 1002. The current coefficient falling in different areas can increase the initial value by different amplitudes to obtain the first increment value.
[0148] For example, if pos_x <= sr_x / 2 and pos_y <= sr_y / 2, the current coefficient falls in the fourth local area 1001, and the value 4 can be added to the initial value to obtain the first increment value, that is, ctxIdxInc += 4; if pos_x > sr_x / 2 or pos_y > sr_y / 2, the current coefficient falls in the fifth local area 1002, and the value 8 can be added to the initial value to obtain the first increment value, that is, ctxIdxInc += 8.
[0149] Step S830: Determine the second increment value based on the statistical information of the non-zero coefficients decoded within the scanning area of the coded block and the first increment value, and assign the second increment value as the context index increment.
[0150] In one embodiment of this application, among the first m non-zero coefficients decoded within the scanning area, the statistical number of coefficients whose absolute values are greater than a threshold value is determined, where m is a preset integer; a second increment value is obtained by increasing the statistical number by a first increment value. If the number of decoded non-zero coefficients is less than m, the corresponding statistical number is determined among all decoded non-zero coefficients.
[0151] In one embodiment of this application, m is set to 5, which allows for the counting of the number of coefficients whose absolute values are greater than a threshold value (num_gtx) among the first 5 non-zero coefficients decoded within the scanning area. In this embodiment, if the number of non-zero coefficients with absolute values greater than the threshold value is less than or equal to three, then that number is taken as the counting number (num_gtx). If the number of non-zero coefficients with absolute values greater than the threshold value exceeds three, then the counting number (num_gtx) is assigned the value 3, i.e., num_gtx = 3.
[0152] After obtaining the statistical quantity num_gtx, the second increment value can be obtained by increasing the first increment value based on the statistical quantity num_gtx, that is, let ctxIdxInc+=num_gtx+1.
[0153] At this point, the second incremental value is used as the context index increment. Based on the obtained context index increment, the corresponding context model can be located, and the corresponding coefficient absolute value threshold flag is decoded based on the context model to obtain the value of the coefficient absolute value threshold flag.
[0154] After decoding the absolute value threshold flags of each coefficient in the flag combination, the absolute value of the current coefficient can be determined according to the corresponding combination relationship for different flag combination forms.
[0155] In one embodiment of this application, the flag combination includes n absolute value threshold flags corresponding to n consecutively increasing absolute value thresholds, where n is an integer greater than or equal to three. For example, n is 5, and the absolute value thresholds are x = 1, 2, 3, 4, 5; the flag combination includes five absolute value threshold flags: coeff_abs_level_greater1_flag, coeff_abs_level_greater2_flag, coeff_abs_level_greater3_flag, coeff_abs_level_greater4_flag, and coeff_abs_level_greater5_flag.
[0156] Figure 11 A flowchart illustrating the steps of determining the absolute value of a coefficient based on a combination of continuously increasing flags from the beginning, as shown in one embodiment of this application, is provided. Figure 11 As shown, based on the above embodiments, the step S640 of determining the absolute value of the current coefficient according to the value of the absolute value threshold flag of each coefficient may include the following steps S1110 to S1140.
[0157] Step S1110: Obtain the values of the absolute value threshold flags of each coefficient in the order of increasing absolute value threshold.
[0158] The absolute value threshold flag of the coefficient obtained after decoding is either the first flag value or the second flag value. For example, the first flag value can be 0, and the second flag value can be 1.
[0159] Step S1120: If the value of the current coefficient absolute value threshold flag is the preset first flag value, then determine the absolute value of the current coefficient according to the current coefficient absolute value threshold corresponding to the current coefficient absolute value threshold flag.
[0160] For example, if the current coefficient absolute value threshold flag coeff_abs_level_greaterx_flag is 0, the current coefficient absolute value threshold x can be determined as the value of the current coefficient absolute value coeff_abs_level, that is, coeff_abs_level = x.
[0161] Step S1130: If the value of the current coefficient absolute value threshold flag is the value of the second flag corresponding to the value of the first flag, then continue to obtain the value of the next coefficient absolute value threshold flag.
[0162] For example, if the current coefficient absolute value threshold flag coeff_abs_level_greaterx_flag is 1, it can be determined that the range of the current coefficient absolute value coeff_abs_level is greater than the corresponding coefficient absolute value threshold x. At this time, the value of the next coefficient absolute value threshold flag can be obtained, and the value or range of the current coefficient absolute value coeff_abs_level can be determined based on the value of the next coefficient absolute value threshold flag.
[0163] Step S1140: If the values of all coefficient absolute value threshold flags are the second flag values, then determine the base value corresponding to the current coefficient based on the coefficient absolute value threshold corresponding to the last coefficient absolute value threshold flag, and determine the coefficient absolute value of the current coefficient based on the base value and the coefficient absolute value remainder of the current coefficient.
[0164] For example, when all coefficient absolute value threshold flags in the flag combination are 1, it indicates that the range of the current coefficient's absolute value is greater than the coefficient absolute value threshold n corresponding to the last coefficient absolute value threshold flag, `coeff_abs_level_greatern_flag`. In this case, the base value `base_level` corresponding to the current coefficient can be determined based on the coefficient absolute value threshold n, i.e., `base_level = n + 1`. Further, the value of the current coefficient's absolute value `coeff_abs_level` is determined based on the base value and the current coefficient's coefficient absolute value remainder `coeff_abs_level_remaining`.
[0165] In one embodiment of this application, the method for determining the absolute value of the current coefficient based on the base value and the residual absolute value of the current coefficient may include: performing entropy decoding and inverse binarization on the residual absolute value of the current coefficient to obtain the value of the residual absolute value; and adding the value of the residual absolute value to the base value to obtain the absolute value of the current coefficient.
[0166] In one embodiment of this application, the method for entropy decoding and debinarization of the residual absolute value of the current coefficient may include: entropy decoding and debinarization of the residual absolute value of the current coefficient according to the k-order exponential Golomb code.
[0167] In one embodiment of this application, the absolute value threshold of the coefficients corresponding to the flag combination is x = 1, 2, 3, ..., n (n >= 3).
[0168] The logic for determining the absolute value or range of the current coefficient based on the values of the threshold flags for the absolute values of each coefficient in the flag combination is as follows.
[0169] (1) Let x = 1;
[0170] (2) Obtain the value obtained by decoding the coefficient absolute value threshold flag coeff_abs_level_greaterx_flag. If the value of coeff_abs_level_greaterx_flag is 0, let coeff_abs_level = x, and the decoding of the non-zero coefficient absolute value coeff_abs_level is completed;
[0171] (3) If the value of coeff_abs_level_greaterx_flag is 1, it can be determined that the value range is coeff_abs_level >= x + 1; if x < n, then let x = x + 1, and continue to execute step (2);
[0172] (4) If x = n, it can be determined that the value range is coeff_abs_level >= n + 1, and let the base value base_level = n + 1.
[0173] After determining the value range and the base value of the coefficient absolute value of the current coefficient, the remaining value of the coefficient absolute value of the current coefficient, coeff_abs_level_remaining, can be decoded according to the following method logic, and the final non-zero coefficient absolute value coeff_abs_level can be deduced.
[0174] (1) When the value of coeff_abs_level_greatern_flag is 1, it can be determined that the value range is coeff_abs_level >= n + 1 and the base value base_level = n + 1. At this time, the entropy decoding and inverse binarization of coeff_abs_level_remaining can be performed in the manner of the k-order exponential Golomb code, and its value can be deduced. The k-order exponential Golomb code table is shown in Table 3 below.
[0175] (2) Let coeff_abs_level = base_level + coeff_abs_level_remaining, and the decoding of the non-zero coefficient absolute value coeff_abs_level is completed.
[0176] Table 3 k-order exponential Golomb code table
[0177]
[0178]
[0179] In one application scenario of this application, the threshold values of the absolute values of the coefficients corresponding to the flag combinations are x = 1, 2, 3, 4, 5 respectively; the method for decoding the absolute values of the coefficients includes the following steps.
[0180] (1) Decode the first coefficient absolute value threshold flag coeff_abs_level_greater1_flag. If the value of coeff_abs_level_greater1_flag is 0, then coeff_abs_level = 1. The decoding of the non-zero coefficient absolute value coeff_abs_level is complete.
[0181] (2) If the value of coeff_abs_level_greater1_flag is 1, continue decoding coeff_abs_level_greater2_flag; if the value of coeff_abs_level_greater2_flag is 0, then coeff_abs_level = 2, and the decoding of the absolute value of the non-zero coefficient coeff_abs_level is complete.
[0182] (3) If the value of coeff_abs_level_greater2_flag is 1, continue decoding coeff_abs_level_greater3_flag; if the value of coeff_abs_level_greater3_flag is 0, then coeff_abs_level = 3, and the decoding of the absolute value of the non-zero coefficient coeff_abs_level is complete.
[0183] (4) If the value of coeff_abs_level_greater3_flag is 1, continue decoding coeff_abs_level_greater4_flag. If the value of coeff_abs_level_greater4_flag is 0, then coeff_abs_level = 4. The decoding of the absolute value of the non-zero coefficient coeff_abs_level is complete.
[0184] (5) If the value of coeff_abs_level_greater4_flag is 1, continue decoding coeff_abs_level_greater5_flag. If the value of coeff_abs_level_greater5_flag is 0, then coeff_abs_level = 5. The decoding of the absolute value of the non-zero coefficient coeff_abs_level is complete.
[0185] (6) If the value of coeff_abs_level_greater5_flag is 1, the value range coeff_abs_level >= 6 can be determined; let the base value base_level = 6, and continue to decode the remaining value of the coefficient absolute value coeff_abs_level_remaining.
[0186] Based on the above steps, the value range of the coefficient absolute value can be determined as coeff_abs_level >= 6, base_level = 6. Entropy decode and inverse binarize coeff_abs_level_remaining in the manner of the k-th order exponential Golomb code (see Table 3, for example, using the 0-th order exponential Golomb code) to derive its value. Let coeff_abs_level = base_level + coeff_abs_level_remaining, and the decoding of the non-zero coefficient absolute value coeff_abs_level is completed.
[0187] In an embodiment of the present application, the flag combination includes n coefficient absolute value threshold flags corresponding to n non-consecutive increasing or partially consecutive increasing coefficient absolute value thresholds, where n is an integer greater than or equal to two. For example, the n non-consecutive increasing or partially consecutive increasing coefficient absolute value thresholds x are x(1), x(2),..., x(k),..., x(n) in sequence, where n >= 2, k = 1, 2,..., n, and 1 <= x(1) < x(2) <... < x(n). The corresponding flag combination includes n coefficient absolute value threshold flags coeff_abs_level_greaterx(k)_flag.
[0188] Figure 12 The flowchart of the steps for determining the coefficient absolute value based on the non-consecutive increasing or partially consecutive increasing flag combination in an embodiment of the present application is shown. As Figure 12 shown, based on the above embodiment, determining the coefficient absolute value of the current coefficient according to the values of each coefficient absolute value threshold flag in step S640 may include the following steps S1210 to step S1240.
[0189] Step S1210: Obtain the values of each coefficient absolute value threshold flag in sequence according to the increasing order of the coefficient absolute value thresholds
[0190] The value of the coefficient absolute value threshold flag obtained through decoding processing is the first flag value or the second flag value. The first flag value may, for example, take a value of 0, and the second flag value may, for example, take a value of 1.
[0191] Step S1220: If the value of the current coefficient absolute value threshold flag is a preset first flag value, then determine the base value corresponding to the current coefficient based on the current coefficient absolute value threshold corresponding to the current coefficient absolute value threshold flag and the previous coefficient absolute value threshold corresponding to the previous coefficient absolute value threshold flag, and determine the coefficient absolute value of the current coefficient based on the base value and the coefficient absolute value residual value of the current coefficient.
[0192] For example, if the current coefficient absolute value threshold flag `coeff_abs_level_greaterx(k)_flag` is 0, the range of the current coefficient absolute value `coeff_abs_level` can be determined based on the current coefficient absolute value threshold `x(k)` and the previous coefficient absolute value threshold `x(k-1)`, i.e., `x(k-1)+1<=coeff_abs_level<=x(k)` (when k>1) or `1<=coeff_abs_level<=x(k)` (when k=1). If `x(k-1)+1=x(k)` (when k>1) or `x(k)=1` (when k=1), then `coeff_abs_level=x(k)`, and the decoding of the non-zero coefficient absolute value `coeff_abs_level` is complete. Otherwise, the base value `base_level` can be set to `x(k-1)+1` (k>1) or `1` (k=1).
[0193] Step S1230: If the value of the current coefficient absolute value threshold flag is the value of the second flag corresponding to the value of the first flag, then continue to obtain the value of the next coefficient absolute value threshold flag.
[0194] For example, if the current coefficient absolute value threshold flag coeff_abs_level_greaterx(k)_flag is 1, it can be determined that the range of the current coefficient absolute value coeff_abs_level is greater than the corresponding coefficient absolute value threshold x(k), that is, coeff_abs_level>=x(k)+1; at this time, the value of the next coefficient absolute value threshold flag can be obtained, and the value or range of the current coefficient absolute value coeff_abs_level can be determined further based on the value of the next coefficient absolute value threshold flag.
[0195] Step S1240: If the values of all coefficient absolute value threshold flags are the second flag values, then determine the base value corresponding to the current coefficient based on the coefficient absolute value threshold corresponding to the last coefficient absolute value threshold flag, and determine the coefficient absolute value of the current coefficient based on the base value and the coefficient absolute value remainder of the current coefficient.
[0196] For example, when all coefficient absolute value threshold flags in the flag combination are 1, it indicates that the range of the current coefficient's absolute value is greater than the coefficient absolute value threshold x(n) corresponding to the last coefficient absolute value threshold flag coeff_abs_level_greaterx(n)_flag, i.e., coeff_abs_level >= x(n) + 1. At this point, the base value base_level corresponding to the current coefficient can be determined based on the coefficient absolute value threshold x(n), i.e., base_level = x(n) + 1. The value of the current coefficient's absolute value coeff_abs_level is then further determined based on the base value and the current coefficient's coefficient absolute value remainder coeff_abs_level_remaining.
[0197] In one embodiment of this application, the method for determining the absolute value of the current coefficient based on the base value and the residual absolute value of the current coefficient may include: performing entropy decoding and inverse binarization on the residual absolute value of the current coefficient to obtain the value of the residual absolute value; and adding the value of the residual absolute value to the base value to obtain the absolute value of the current coefficient.
[0198] In one embodiment of this application, the method for entropy decoding and debinarization of the residual absolute value of the current coefficient may include: determining the range of the absolute value of the current coefficient based on the values of the absolute value threshold flags of each coefficient; selecting a target decoding method from multiple candidate decoding methods based on the size of the range of the absolute value of the coefficient; and performing entropy decoding and debinarization on the residual absolute value of the current coefficient according to the target decoding method.
[0199] In one embodiment of this application, the available candidate decoding methods include at least one of the following decoding methods: a decoding method based on truncated unary codes; a decoding method based on unary codes; a decoding method based on len-bit fixed-length codes; and a decoding method based on k-order exponential Golomb codes.
[0200] Based on the above embodiments, the absolute value threshold x of the coefficients corresponding to the flag combination are successively discontinuous or partially continuous x(1), x(2), ..., x(k), ..., x(n), where n>=2, k=1,2,...,n, and 1<=x(1). <x(2)<…<x(n)。
[0201] The logic for determining the absolute value or range of the current coefficient based on the values of the threshold flags for the absolute values of each coefficient in the flag combination is as follows.
[0202] (1) Let x = x(k), k = 1;
[0203] (2) Obtain the value obtained after decoding coeff_abs_level_greaterx(k)_flag. If the value of coeff_abs_level_greater x(k)_flag is 0, it can be determined that the value range is x(k - 1)+1 <= coeff_abs_level <= x(k) (when k > 1) or 1 <= coeff_abs_level <= x(k) (when k = 1). If x(k - 1)+1 = x(k) (when k > 1), or x(k) = 1 (when k = 1), then it can be determined that coeff_abs_level = x(k), and the decoding of the non-zero coefficient absolute value coeff_abs_level is completed. Otherwise, let the base value base_level = x(k - 1)+1 (k > 1) or 1 (k = 1);
[0204] (3) If the value of coeff_abs_level_greater x(k)_flag is 1, it can be determined that the value range is coeff_abs_level >= x(k)+1; if k < n, let k = k + 1, and continue to execute step (2);
[0205] (4) If k = n, it can be determined that the value range is coeff_abs_level >= x(n)+1, and let the base value base_level = x(n)+1.
[0206] After determining the value range and base value of the coefficient absolute value of the current coefficient, the remaining value of the coefficient absolute value of the current coefficient, coeff_abs_level_remaining, can be decoded according to the following method logic, and the final non-zero coefficient absolute value coeff_abs_level can be deduced.
[0207] When k = 1 and the value of coeff_abs_level_greater x(1)_flag is 0, it can be determined that the value range is 1 <= coeff_abs_level <= x(1). Let base_level = 1, and entropy decode and inverse binaryize coeff_abs_level_remaining and deduce its value in one of the following ways:
[0208] (1) Inverse binaryize in the manner of the k-th order exponential Golomb code (see Table 3 above);
[0209] (2) Entropy decode len = Ceil(log2(x(1))) bits from the bitstream, and inverse binaryize in the manner of the len-bit fixed-length code (see Table 4 below);
[0210] (3) Inverse binaryize in the manner of the unary code (see Table 5 below);
[0211] (4) Debinarize according to the method of truncating unary codes (see Table 6 below).
[0212] When k = 2 to n, the value of coeff_abs_level_greaterx(k)_flag is 0, and the value of coeff_abs_level_greater x(k-1)_flag is 1, the range of values can be determined as x(k-1)+1 <= coeff_abs_level <= x(k). Let the base value base_level = x(k-1)+1, and derive the value of coeff_abs_level_remaining by performing entropy decoding and debinarization in one of the following ways:
[0213] (1) Perform inverse binarization according to the k-order exponential Golomb code (see Table 3 above);
[0214] (2) Entropy decode len = Ceil(log2(x(k)-x(k-1))) bits from the bitstream and debinarize it according to the len bit fixed-length code (see Table 4 below);
[0215] (3) Debinarize according to the unary code (see Table 5 below);
[0216] (4) Debinarize according to the method of truncating unary codes (see Table 6 below).
[0217] When k = n and the value of coeff_abs_level_greater x(n)_flag is 1, the range of values can be determined as coeff_abs_level >= n. Let the base value base_level = n + 1, and perform entropy decoding and debinarization on coeff_abs_level_remaining according to the k-order exponential Golomb code (see Table 3) to derive its value;
[0218] Let coeff_abs_level = base_level + coeff_abs_level_remaining, then the absolute value of the non-zero coefficient coeff_abs_level is decoded.
[0219] Table 4 shows the relationship between synElVal and binary strings.
[0220] (Fixed-length code of length len)
[0221]
[0222] Table 5 shows the relationship between synElVal and binary strings.
[0223] (Including two unary code forms: Table 5-1 or Table 5-2)
[0224] Table 5-1
[0225]
[0226]
[0227] Table 5-2
[0228]
[0229] Table 6 shows the relationship between synElVal and binary strings.
[0230] (Two forms of truncated unary codes: Table 2-1 or Table 2-2)
[0231] Table 6-1
[0232]
[0233] Table 6-2
[0234]
[0235] In one application scenario of this application, the threshold values of the absolute values of the coefficients corresponding to the flag combinations are x = 1, 2, 4, 8 respectively; the method for decoding the absolute values of the coefficients includes the following steps.
[0236] (1) Decode the first coefficient absolute value threshold flag coeff_abs_level_greater1_flag. If the value of coeff_abs_level_greater1_flag is 0, then 1 <= coeff_abs_level <= 1, so coeff_abs_level = 1. The decoding of the non-zero coefficient absolute value coeff_abs_level is complete.
[0237] (2) If the value of coeff_abs_level_greater1_flag is 1, continue decoding coeff_abs_level_greater2_flag. If the value of coeff_abs_level_greater2_flag is 0, then 2 <= coeff_abs_level <= 2, so coeff_abs_level = 2, and the decoding of the absolute value of the non-zero coefficient coeff_abs_level is complete;
[0238] (3) If the value of coeff_abs_level_greater2_flag is 1, continue decoding coeff_abs_level_greater4_flag. If the value of coeff_abs_level_greater4_flag is 0, then 3 <= coeff_abs_level <= 4, and set the base value base_level = 3;
[0239] (4) If the value of coeff_abs_level_greater4_flag is 1, continue decoding coeff_abs_level_greater8_flag. If the value of coeff_abs_level_greater8_flag is 0, then 5 <= coeff_abs_level <= 8, and set the base value base_level = 5;
[0240] (5) If the value of coeff_abs_level_greater8_flag is 1, then the value range coeff_abs_level>=9 can be determined. Let the base value base_level=9 and continue to decode the absolute value of the coefficient remaining value coeff_abs_level_remaining.
[0241] Based on the value range and base value determined by the above steps, the remaining part of the absolute value of the non-zero coefficient, coeff_abs_level_remaining, can be decoded, and the final absolute value of the non-zero coefficient can be derived. The decoding method in one embodiment of this application is as follows.
[0242] (1) If the value of coeff_abs_level_greater2_flag is 1 and the value of coeff_abs_level_greater4_flag is 0, then 3 <= coeff_abs_level <= 4. Let base_level = 3, entropy decode len = 1 bit from the bitstream, debind coeff_abs_level_remaining in the manner of 1-bit fixed-length code (see Table 2) and derive its value;
[0243] (2) If the value of coeff_abs_level_greater4_flag is 1 and the value of coeff_abs_level_greater8_flag is 0, then 5 <= coeff_abs_level <= 8. Let base_level = 5, entropy decode len = 2 bits from the bitstream, debind coeff_abs_level_remaining according to the 2-bit fixed-length code (see Table 2) and derive its value;
[0244] (3) If the value of coeff_abs_level_greater8_flag is 1, then coeff_abs_level>=9. Let base_level=9, and perform entropy decoding and debinarization on coeff_abs_level_remaining according to the k-order exponential Golomb code (see Table 3, for example, using the 0-order exponential Golomb code) and derive its value.
[0245] (4) Let coeff_abs_level = base_level + coeff_abs_level_remaining, and the absolute value of the non-zero coefficient coeff_abs_level is decoded.
[0246] The above embodiments describe decoding schemes for the absolute values of non-zero coefficients from the decoding side, while encoding schemes corresponding to the above embodiments can be used on the encoding side. Figure 13 A flowchart illustrating the steps of a video encoding method according to one embodiment of this application is shown. This video encoding method can be executed by a device with computing processing capabilities, such as a terminal device or a server. Figure 13 As shown, the video encoding method mainly includes the following steps S1310 to S1330.
[0247] Step S1310: Determine the absolute value of the current coefficient to be encoded in the coding block of the video image frame. The current coefficient is a non-zero coefficient determined sequentially in the scanning order within the coefficient encoding SRCC scanning area based on the scanning region of the coding block.
[0248] Step S1320: Obtain the flag combination corresponding to the current coefficient. The flag combination includes at least two coefficient absolute value threshold flags. The coefficient absolute value threshold flags are used to indicate whether the absolute value of the current coefficient is greater than the corresponding coefficient absolute value threshold. The flag combination includes at least one coefficient absolute value threshold flag with a coefficient absolute value threshold greater than 2.
[0249] Step S1330: Based on the relationship between the current absolute value of the coefficient and the corresponding absolute value threshold of the coefficient, determine the value of each absolute value threshold flag in the flag combination, and encode each absolute value threshold flag in the flag combination.
[0250] In one embodiment of this application, the values of each coefficient absolute value threshold flag in the flag combination can be determined sequentially according to the order of increasing coefficient absolute value threshold, and each coefficient absolute value threshold flag in the flag combination can be encoded respectively.
[0251] The details of the video encoding method in this embodiment correspond to the video decoding method in the above embodiments, and will not be repeated here.
[0252] Based on the above embodiments, this application proposes an encoding and decoding method for non-zero coefficient absolute values according to the residual distribution characteristics and diversity under different encoding modes. By modifying the syntax elements used when encoding and decoding non-zero coefficient absolute values in the SRCC region, the binarization and encoding / decoding methods of non-zero coefficient absolute values in the SRCC region are improved, which helps to improve the encoding efficiency of coefficient encoding and further improve video compression performance.
[0253] It should be noted that although the steps of the method in this application are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0254] The following describes an apparatus embodiment of this application, which can be used to execute the video decoding method described in the above embodiments of this application. Figure 14 A structural block diagram of a video decoding apparatus provided in an embodiment of this application is shown. Figure 14As shown, the video decoding device 1400 mainly includes: a current coefficient determination module 1410, configured to determine the current coefficient to be decoded in the coding block of a video image frame, wherein the current coefficient is a non-zero coefficient determined sequentially in the scanning order within the coefficient coding SRCC scanning area of the coding block based on the scanning region; a flag combination acquisition module 1420, configured to acquire the flag combination corresponding to the current coefficient, wherein the flag combination includes at least two coefficient absolute value threshold flags, wherein the coefficient absolute value threshold flags are used to indicate whether the absolute value of the current coefficient is greater than the corresponding coefficient absolute value threshold, and the flag combination includes at least one coefficient absolute value threshold flag with a coefficient absolute value threshold greater than 2; a flag decoding module 1430, configured to decode each coefficient absolute value threshold flag in the flag combination to obtain the value of each coefficient absolute value threshold flag; and a coefficient absolute value determination module 1440, configured to determine the absolute value of the current coefficient based on the value of each coefficient absolute value threshold flag.
[0255] In some embodiments of this application, based on the above technical solutions, the flag combination includes n absolute value threshold flags corresponding to n coefficient absolute value thresholds that increase continuously from the beginning, where n is an integer greater than or equal to three.
[0256] In some embodiments of this application, based on the above technical solutions, the coefficient absolute value determination module 1440 includes: a first value acquisition unit, configured to sequentially acquire the values of each coefficient absolute value threshold flag in order of increasing coefficient absolute value threshold; a first absolute value determination unit, configured to determine the coefficient absolute value of the current coefficient based on the current coefficient absolute value threshold corresponding to the current coefficient absolute value threshold flag if the value of the current coefficient absolute value threshold flag is a preset first flag value; a second value acquisition unit, configured to continue acquiring the value of the next coefficient absolute value threshold flag if the value of the current coefficient absolute value threshold flag is a second flag value corresponding to the first flag value; and a second absolute value determination unit, configured to determine a base value corresponding to the current coefficient based on the coefficient absolute value threshold corresponding to the last coefficient absolute value threshold flag if the values of each coefficient absolute value threshold flag are all the second flag values, and determine the coefficient absolute value of the current coefficient based on the base value and the remaining coefficient absolute value of the current coefficient.
[0257] In some embodiments of this application, based on the above technical solutions, the second absolute value determination unit includes: a residual value decoding subunit, configured to perform entropy decoding and inverse binarization processing on the residual absolute value of the current coefficient to obtain the value of the residual absolute value of the coefficient; and an absolute value determination subunit, configured to add the value of the residual absolute value of the coefficient to the base value to obtain the absolute value of the current coefficient.
[0258] In some embodiments of this application, based on the above technical solutions, the residual value decoding subunit is further configured to perform entropy decoding and debinarization processing on the residual value of the absolute value of the current coefficient according to the k-order exponential Golomb code.
[0259] In some embodiments of this application, based on the above technical solutions, the flag combination includes n absolute value threshold flags corresponding to n non-continuously increasing or partially continuously increasing absolute value thresholds of coefficients, where n is an integer greater than or equal to two.
[0260] In some embodiments of this application, based on the above technical solutions, the coefficient absolute value determination module 1440 includes: a third value acquisition unit, configured to sequentially acquire the values of each coefficient absolute value threshold flag in order of increasing coefficient absolute value threshold; and a third absolute value determination unit, configured to, if the value of the current coefficient absolute value threshold flag is a preset first flag value, determine a base value corresponding to the current coefficient based on the current coefficient absolute value threshold corresponding to the current coefficient absolute value threshold flag and the previous coefficient absolute value threshold corresponding to the previous coefficient absolute value threshold flag, and determine a base value corresponding to the current coefficient based on the base value and the coefficient of the current coefficient. The absolute value of the current coefficient is determined by the absolute value remainder; the fourth value acquisition unit is configured to continue acquiring the value of the next coefficient absolute value threshold flag if the value of the current coefficient absolute value threshold flag is the second flag value corresponding to the first flag value; the fourth absolute value determination unit is configured to determine the base value corresponding to the current coefficient based on the coefficient absolute value threshold corresponding to the last coefficient absolute value threshold flag if the values of each coefficient absolute value threshold flag are the second flag value, and determine the coefficient absolute value of the current coefficient based on the base value and the coefficient absolute value remainder of the current coefficient.
[0261] In some embodiments of this application, based on the above technical solutions, the fourth absolute value determination unit includes: a residual value decoding subunit, configured to perform entropy decoding and inverse binarization processing on the residual absolute value of the current coefficient to obtain the value of the residual absolute value of the coefficient; and an absolute value determination subunit, configured to add the value of the residual absolute value of the coefficient to the base value to obtain the absolute value of the current coefficient.
[0262] In some embodiments of this application, based on the above technical solutions, the residual value decoding subunit is further configured to: determine the range of absolute values of the current coefficient according to the values of the absolute value threshold flags of each coefficient; select a target decoding method from multiple candidate decoding methods according to the size of the range of absolute values of the coefficient; and perform entropy decoding and debinarization processing on the residual absolute value of the current coefficient according to the target decoding method.
[0263] In some embodiments of this application, based on the above technical solutions, the plurality of candidate decoding methods include at least one of the following decoding methods: a decoding method based on truncated unary codes; a decoding method based on unary codes; a decoding method based on len-bit fixed-length codes; and a decoding method based on k-order exponential Golomb codes.
[0264] In some embodiments of this application, based on the above technical solutions, the flag decoding module 1430 includes: a decoding method determination unit, configured to determine the decoding method corresponding to each of the coefficient absolute value threshold flags, wherein the decoding method includes at least one of bypass decoding and conventional decoding; a bypass decoding unit, configured to input the coefficient absolute value threshold flag into a bypass decoding engine if the decoding method corresponding to the coefficient absolute value threshold flag is determined to be bypass decoding, so as to perform decoding processing on the coefficient absolute value threshold flag through the bypass decoding engine; and a conventional decoding unit, configured to input the coefficient absolute value threshold flag into a context model-based conventional decoding engine if the decoding method corresponding to the coefficient absolute value threshold flag is determined to be conventional decoding, so as to perform decoding processing on the coefficient absolute value threshold flag through the conventional decoding engine.
[0265] In some embodiments of this application, based on the above technical solutions, the conventional decoding unit includes: a model selection method determination subunit, configured to determine a model selection method corresponding to the absolute value threshold flag of the coefficient, wherein the model selection method includes single model selection and dynamic model selection; a first assignment subunit, configured to assign a pre-set first value as the context index increment corresponding to the absolute value threshold flag of the coefficient if the model selection method corresponding to the absolute value threshold flag of the coefficient is determined to be single model selection; a second assignment subunit, configured to assign a pre-set first value as the context index increment corresponding to the absolute value threshold flag of the coefficient according to attribute information related to the coding block and the current coefficient if the model selection method corresponding to the absolute value threshold flag of the coefficient is determined to be dynamic model selection; a model determination subunit, configured to determine the context model corresponding to the absolute value threshold of the coefficient according to the assigned context index increment; and an arithmetic decoding subunit, configured to perform arithmetic decoding on the absolute value threshold flag of the coefficient based on the context model and through the conventional decoding engine.
[0266] In some embodiments of this application, based on the above technical solutions, the second assignment subunit is further configured to: assign an initial value to the context index increment according to the channel information of the coding block; determine a first increment value according to the position information of the current coefficient in the scanning area of the coding block and the initial value; determine a second increment value according to the statistical information of the non-zero coefficients decoded in the scanning area of the coding block and the first increment value, and assign the second increment value to the context index increment.
[0267] In some embodiments of this application, based on the above technical solutions, the second assignment subunit is further configured to: if the coded block is a luma block, then assign a pre-set second value as the initial value of the context index increment; if the coded block is a chroma block, then assign the initial value of the context index increment by increasing a third value based on the second value.
[0268] In some embodiments of this application, based on the above technical solutions, the second assignment subunit is further configured to: if the current coefficient is the first or last coefficient scanned in the scanning region of the coding block according to the scanning order, then the initial value is used as the first increment value; if the current coefficient is another coefficient in the scanning region of the coding block other than the first and last coefficients, then the initial value is increased according to the relative position of the current coefficient in the scanning region of the coding block to obtain the first increment value.
[0269] In some embodiments of this application, based on the above technical solutions, the second assignment subunit is further configured to: determine whether the prediction coding mode of the coding block is a normal intra-frame prediction mode; if the prediction coding mode is a normal intra-frame prediction mode, divide the scanning area into a first number of local regions in order from top left to bottom right, and increase the initial value according to the local region where the current coefficient is located to obtain a first increment value; if the prediction coding mode is not a normal intra-frame prediction mode, divide the scanning area into a second number of local regions in order from top left to bottom right, and increase the initial value according to the local region where the current coefficient is located to obtain a first increment value.
[0270] In some embodiments of this application, based on the above technical solutions, the second assignment subunit is further configured to: among the first m non-zero coefficients decoded in the scanning area, count the number of coefficients whose absolute values are greater than the coefficient absolute value threshold, where m is a preset integer; and increase the first incremental value according to the statistical number to obtain a second incremental value.
[0271] Figure 15A structural block diagram of a video encoding apparatus according to one embodiment of this application is shown. Figure 15 As shown, the video encoding device 1500 mainly includes:
[0272] The current coefficient determination module 1510 is configured to determine the absolute value of the current coefficient to be encoded in the coding block of the video image frame. The current coefficient is a non-zero coefficient determined sequentially in the scanning order within the coefficient encoding SRCC scanning area based on the scanning region of the coding block.
[0273] The flag combination acquisition module 1520 is configured to acquire the flag combination corresponding to the current coefficient. The flag combination includes at least two coefficient absolute value threshold flags. The coefficient absolute value threshold flags are used to indicate whether the absolute value of the current coefficient is greater than the corresponding coefficient absolute value threshold. The flag combination includes at least one coefficient absolute value threshold flag with a coefficient absolute value threshold greater than 2.
[0274] The flag encoding module 1530 is configured to determine the value of each coefficient absolute value threshold flag in the flag combination based on the relationship between the current coefficient absolute value and the corresponding coefficient absolute value threshold, and to encode each coefficient absolute value threshold flag in the flag combination respectively.
[0275] The specific details of the video decoding apparatus provided in the various embodiments of this application have been described in detail in the corresponding method embodiments, and will not be repeated here.
[0276] Figure 16 A schematic block diagram of a computer system architecture for implementing an electronic device according to embodiments of the present application is shown.
[0277] It should be noted that, Figure 16 The computer system 1600 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0278] like Figure 16As shown, the computer system 1600 includes a central processing unit (CPU) 1601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 1602 or programs loaded from storage section 1608 into random access memory (RAM). The RAM 1603 also stores various programs and data required for system operation. The CPU 1601, ROM 1602, and RAM 1603 are interconnected via a bus 1604. An input / output interface 1605 (I / O interface) is also connected to the bus 1604.
[0279] The following components are connected to the input / output interface 1605: an input section 1606 including a keyboard, mouse, etc.; an output section 1607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1608 including a hard disk, etc.; and a communication section 1609 including a network interface card such as a local area network card, modem, etc. The communication section 1609 performs communication processing via a network such as the Internet. A drive 1610 is also connected to the input / output interface 1605 as needed. Removable media 1611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on the drive 1610 as needed so that computer programs read from them can be installed into the storage section 1608 as needed.
[0280] Specifically, according to embodiments of this application, the processes described in the various method flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1609, and / or installed from removable medium 1611. When the computer program is executed by central processing unit 1601, it performs various functions defined in the system of this application.
[0281] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0282] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0283] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
Claims
1. A video decoding method, characterized in that, include: Obtain a flag combination corresponding to the non-zero coefficients in the coded block of the video image frame. The flag combination includes n absolute value threshold flags corresponding to n non-continuously increasing or partially continuously increasing absolute value thresholds of coefficients, where n is an integer greater than or equal to two. The absolute value threshold flags are used to indicate whether the absolute value of the non-zero coefficient is greater than the corresponding absolute value threshold. The flag combination includes at least one absolute value threshold flag with an absolute value threshold greater than or equal to 2. The context index increment corresponding to the absolute value threshold flag of the coefficient is assigned based on the channel information of the coding block, the position information of the non-zero coefficient within the coding block, and the statistical information of the non-zero coefficients that have been decoded within the coding block; The context model corresponding to the absolute value threshold of the coefficient is determined based on the context index increment obtained by the assignment, and the absolute value threshold flag of the coefficient is decoded based on the context model to obtain the value of the absolute value threshold flag of the coefficient. The absolute value of the non-zero coefficient is determined based on the value of each absolute value threshold flag in the flag combination; The n absolute value threshold flags include four absolute value threshold flags, which are: coeff_abs_level_greater1_flag; coeff_abs_level_greater2_flag; coeff_abs_level_greater4_flag; coeff_abs_level_greater8_flag.
2. The video decoding method according to claim 1, characterized in that, Before assigning a value to the context index increment corresponding to the absolute value threshold flag of the coefficient based on the channel information of the coding block, the position information of the non-zero coefficient within the coding block, and the statistical information of the decoded non-zero coefficients within the coding block, the method further includes: Determine the model selection method corresponding to the absolute value threshold flag of the coefficient, wherein the model selection method includes single model selection and dynamic model selection; If it is determined that the model selection method corresponding to the absolute value threshold flag of the coefficient is single model selection, then the context index increment corresponding to the absolute value threshold flag of the coefficient is assigned with a pre-set first value. If it is determined that the model selection method corresponding to the absolute value threshold flag of the coefficient is dynamic model selection, then the context index increment corresponding to the absolute value threshold flag of the coefficient is assigned according to the channel information of the coding block and the position information of the non-zero coefficient within the coding block.
3. The video decoding method according to claim 1, characterized in that, Before decoding the absolute value threshold flag of the coefficient based on the context model, the method further includes: Determine the decoding method corresponding to the absolute value threshold flag of each coefficient, wherein the decoding method includes at least one of bypass decoding and conventional decoding; If it is determined that the decoding method corresponding to the absolute value threshold flag of the coefficient is bypass decoding, then the absolute value threshold flag of the coefficient is input into the bypass decoding engine so that the absolute value threshold flag of the coefficient is decoded by the bypass decoding engine. If it is determined that the decoding method corresponding to the absolute value threshold flag of the coefficient is conventional decoding, then the absolute value threshold flag of the coefficient is input into the conventional decoding engine based on the context model, so that the absolute value threshold flag of the coefficient is decoded by the conventional decoding engine.
4. The video decoding method according to any one of claims 1 to 3, characterized in that, The context index increment corresponding to the absolute value threshold flag of the coefficient is assigned based on the channel information of the coding block, the position information of the non-zero coefficient within the coding block, and the statistical information of the decoded non-zero coefficients within the coding block, including: The initial value of the context index increment corresponding to the absolute value threshold flag of the coefficient is assigned according to the channel information of the coded block; The first increment value is determined based on the position information of the non-zero coefficient within the coding block and the initial value. The second increment value is determined based on the statistical information of the non-zero coefficients decoded within the encoded block and the first increment value, and the second increment value is used as the context index increment.
5. The video decoding method according to claim 4, characterized in that, Assigning an initial value to the context index increment corresponding to the absolute value threshold flag of the coefficient based on the channel information of the coded block includes: If the coded block is a luma block, then the initial value of the context index increment is assigned as a pre-set second value; If the encoded block is a chroma block, then the initial value of the context index increment is assigned after increasing the second value by the third value.
6. The video decoding method according to claim 4, characterized in that, Determining the first increment value based on the position information of the non-zero coefficient within the scan area of the coded block and the initial value includes: If the non-zero coefficient is the first or last coefficient scanned in the scanning order within the scanning area of the coded block, then the initial value is used as the first increment value; If the non-zero coefficient is any coefficient other than the first coefficient and the last coefficient within the scanning area of the coding block, then the initial value is increased according to the relative position of the non-zero coefficient within the scanning area of the coding block to obtain a first increment value.
7. The video decoding method according to claim 6, characterized in that, The first increment value is obtained by increasing the initial value based on the relative position of the non-zero coefficient within the scan area of the coded block, including: Determine whether the predictive coding mode of the coded block is a normal intra-frame prediction mode; If the predictive coding mode is a normal intra-frame prediction mode, the scanning area is divided into a first number of local regions in order from top left to bottom right, and the initial value is increased according to the local region where the non-zero coefficient is located to obtain the first increment value. If the predictive coding mode is not a normal intra-frame prediction mode, the scanning area is divided into a second number of local regions in order from top left to bottom right, and the initial value is increased according to the local region where the non-zero coefficient is located to obtain a first increment value. The number of the second region is different from the number of the first region.
8. The video decoding method according to claim 4, characterized in that, The step of determining the second increment value based on the statistical information of the non-zero coefficients decoded within the scanned area of the coded block and the first increment value includes: Among the first m non-zero coefficients decoded within the scanning area, the statistical number of coefficients whose absolute values are greater than the absolute value threshold is defined, where m is a preset integer. The second incremental value is obtained by increasing the first incremental value based on the statistical quantity.
9. The video decoding method according to any one of claims 1 to 3, characterized in that, Obtain the flag combinations corresponding to the non-zero coefficients in the coded block of the video image frame, including: In the coding block of a video image frame, the current coefficient to be decoded is determined. The current coefficient is a non-zero coefficient determined sequentially in the scanning order within the coefficient encoding SRCC scanning area based on the scanning region of the coding block. Obtain the flag combination corresponding to the current coefficient. The flag combination includes at least two coefficient absolute value threshold flags. The coefficient absolute value threshold flags are used to indicate whether the absolute value of the current coefficient is greater than the corresponding coefficient absolute value threshold. The flag combination includes at least one coefficient absolute value threshold flag with a coefficient absolute value threshold greater than or equal to two.
10. The video decoding method according to claim 9, characterized in that, The flag combination includes n absolute value threshold flags corresponding to n consecutively increasing absolute value thresholds of coefficients, where n is an integer greater than or equal to three.
11. The video decoding method according to claim 10, characterized in that, Determining the absolute value of the non-zero coefficient based on the values of the absolute value threshold flags of each coefficient in the flag combination includes: The values of each absolute value threshold flag are obtained sequentially according to the order of increasing absolute value threshold of the coefficients; If the value of the current coefficient absolute value threshold flag is a preset first flag value, then the absolute value of the current coefficient is determined according to the current coefficient absolute value threshold corresponding to the current coefficient absolute value threshold flag. If the value of the current coefficient absolute value threshold flag is the value of the second flag corresponding to the value of the first flag, then continue to obtain the value of the next coefficient absolute value threshold flag; If the values of all the absolute value threshold flags of the coefficients are the values of the second flag, then the base value corresponding to the current coefficient is determined according to the absolute value threshold of the coefficient corresponding to the last absolute value threshold flag, and the absolute value of the current coefficient is determined according to the base value and the residual value of the absolute value of the current coefficient.
12. The video decoding method according to claim 11, characterized in that, Determining the absolute value of the current coefficient based on the base value and the remaining absolute value of the current coefficient includes: Entropy decoding and inverse binarization are performed on the residual absolute value of the current coefficient to obtain the value of the residual absolute value of the coefficient; The absolute value of the current coefficient is obtained by adding the remaining value of the absolute value of the coefficient to the base value.
13. The video decoding method according to claim 12, characterized in that, The entropy decoding and debinarization of the residual absolute value of the current coefficient includes: The absolute value of the current coefficient is entropy-decoded and debinarized according to the k-order exponential Golomb code.
14. The video decoding method according to claim 1, characterized in that, Determining the absolute value of the non-zero coefficient based on the values of the absolute value threshold flags of each coefficient in the flag combination includes: The values of each absolute value threshold flag are obtained sequentially according to the order of increasing absolute value threshold of the coefficients; If the value of the current coefficient absolute value threshold flag is a preset first flag value, then the base value corresponding to the non-zero coefficient is determined according to the current coefficient absolute value threshold corresponding to the current coefficient absolute value threshold flag and the previous coefficient absolute value threshold corresponding to the previous coefficient absolute value threshold flag, and the coefficient absolute value of the non-zero coefficient is determined according to the base value and the coefficient absolute value residual value of the non-zero coefficient. If the value of the current coefficient absolute value threshold flag is the value of the second flag corresponding to the value of the first flag, then continue to obtain the value of the next coefficient absolute value threshold flag; If the values of all the absolute value threshold flags of the coefficients are the values of the second flag, then the base value corresponding to the non-zero coefficient is determined according to the absolute value threshold of the last absolute value threshold flag, and the absolute value of the non-zero coefficient is determined according to the base value and the residual value of the absolute value of the non-zero coefficient.
15. The video decoding method according to claim 14, characterized in that, The step of determining the absolute value of the non-zero coefficient based on the base value and the residual value of the absolute value of the non-zero coefficient includes: Entropy decoding and inverse binarization are performed on the residual absolute values of the non-zero coefficients to obtain the values of the residual absolute values of the coefficients. The absolute value of the non-zero coefficient is obtained by adding the residual value of the absolute value of the coefficient to the base value.
16. The video decoding method according to claim 15, characterized in that, Entropy decoding and inverse binarization are performed on the residual absolute values of the non-zero coefficients, including: The range of absolute values of the non-zero coefficients is determined based on the values of the absolute value threshold flags for each coefficient. The target decoding method is selected from multiple candidate decoding methods based on the range of the absolute values of the coefficients. The residual absolute values of the non-zero coefficients are subjected to entropy decoding and inverse binarization processing according to the target decoding method.
17. The video decoding method according to claim 16, characterized in that, The plurality of candidate decoding methods includes at least one of the following decoding methods: Decoding methods based on truncated unary codes; Decoding methods based on unary codes; Decoding method based on len-bit fixed-length code; Decoding method based on k-order exponential Golomb code.
18. The video decoding method according to any one of claims 1 to 3, characterized in that, The method is applied to coded blocks that satisfy any one of the following conditions: Transform the coded blocks that skip the mode; Image-level intra-frame prediction transform skips coding blocks with an allow flag value of 1; Image-level inter-frame prediction transform skips coding blocks with an allow flag value of 1; Coded blocks in which both the image-level intra-frame prediction transform skip allow flag and the image-level inter-frame prediction transform skip allow flag are 1.
19. A video coding method, characterized in that, include: Obtain a flag combination corresponding to the non-zero coefficients in the coded block of the video image frame. The flag combination includes n absolute value threshold flags corresponding to n non-continuously increasing or partially continuously increasing absolute value thresholds of coefficients, where n is an integer greater than or equal to two. The absolute value threshold flags are used to indicate whether the absolute value of the non-zero coefficient is greater than the corresponding absolute value threshold. The flag combination includes at least one absolute value threshold flag with an absolute value threshold greater than or equal to 2. Based on the relationship between the absolute value of the non-zero coefficient and the absolute value threshold of each coefficient, a value is assigned to each absolute value threshold flag in the flag combination; The context index increment corresponding to the absolute value threshold flag of the coefficient is assigned based on the channel information of the coding block, the position information of the non-zero coefficient within the coding block, and the statistical information of the non-zero coefficients that have been decoded within the coding block; The context model corresponding to the absolute value threshold of the coefficient is determined based on the context index increment obtained by the assignment, and the absolute value threshold flag of the coefficient is encoded based on the context model; The n absolute value threshold flags include four absolute value threshold flags, which are: coeff_abs_level_greater1_flag; coeff_abs_level_greater2_flag; coeff_abs_level_greater4_flag; coeff_abs_level_greater8_flag.
20. A video decoding device, characterized in that, include: The flag combination acquisition module is configured to acquire flag combinations corresponding to non-zero coefficients in the coded block of a video image frame. The flag combination includes n absolute value threshold flags corresponding to n non-continuously increasing or partially continuously increasing absolute value thresholds of coefficients, where n is an integer greater than or equal to two. The absolute value threshold flags are used to indicate whether the absolute value of the non-zero coefficient is greater than the corresponding absolute value threshold. The flag combination includes at least one absolute value threshold flag with an absolute value threshold greater than or equal to 2. The flag decoding module is configured to assign a context index increment corresponding to the absolute value threshold flag of the coefficient based on the channel information of the coding block, the position information of the non-zero coefficient within the coding block, and the statistical information of the non-zero coefficients already decoded within the coding block; determine the context model corresponding to the absolute value threshold of the coefficient based on the assigned context index increment, and decode the absolute value threshold flag of the coefficient based on the context model to obtain the value of the absolute value threshold flag of the coefficient; The coefficient absolute value determination module is configured to determine the absolute value of the non-zero coefficient based on the values of each coefficient absolute value threshold flag in the flag combination; The n absolute value threshold flags include four absolute value threshold flags, which are: coeff_abs_level_greater1_flag; coeff_abs_level_greater2_flag; coeff_abs_level_greater4_flag; coeff_abs_level_greater8_flag.
21. A video encoding device, characterized in that, include: The flag combination acquisition module is configured to acquire flag combinations corresponding to non-zero coefficients in the coded block of a video image frame. The flag combination includes n absolute value threshold flags corresponding to n non-continuously increasing or partially continuously increasing absolute value thresholds of coefficients, where n is an integer greater than or equal to two. The absolute value threshold flags are used to indicate whether the absolute value of the non-zero coefficient is greater than the corresponding absolute value threshold. The flag combination includes at least one absolute value threshold flag with an absolute value threshold greater than or equal to 2. The flag assignment module is configured to assign values to each coefficient absolute value threshold flag in the flag combination based on the relationship between the absolute value of the non-zero coefficient and each coefficient absolute value threshold; and to assign values to the context index increment corresponding to the coefficient absolute value threshold flag based on the channel information of the coding block, the position information of the non-zero coefficient within the coding block, and the statistical information of the non-zero coefficients that have been decoded within the coding block. The flag encoding module is configured to determine the context model corresponding to the absolute value threshold of the coefficient based on the context index increment obtained by the assignment, and to encode the absolute value threshold flag of the coefficient based on the context model; The n absolute value threshold flags include four absolute value threshold flags, which are: coeff_abs_level_greater1_flag; coeff_abs_level_greater2_flag; coeff_abs_level_greater4_flag; coeff_abs_level_greater8_flag.
22. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method of any one of claims 1 to 19.
23. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 19 by executing the executable instructions.
24. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 19.
