Coding method, decoding method, code stream, coder, decoder, and storage medium

By hiding the coefficient parity characteristics in video encoding, the problem of excessive encoding information in coefficient encoding technology based on scanning areas is solved, and the code rate saving and encoding and codec efficiency are achieved.

WO2025118289A1PCT designated stage expired Publication Date: 2025-06-12GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/137574
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-12-08
Publication Date
2025-06-12

AI Technical Summary

Technical Problem

In the coefficient encoding technology based on the scanning area, the encoder and the decoder encode and decode the coefficients in the scanning area one by one, resulting in too much encoding information required to write to the code stream, which reduces the encoding and decoding efficiency.

Method used

By hiding the parity characteristics of coefficients, saving code rate and improving codec performance. The specific method includes determining the absolute value of the target coefficient of the preset position in the current scanning area of ​​the current block when the hidden mode parameter indicates that the parity hidden mode is turned on, and determining the absolute value of the initial coefficient of the preset position based on the value for encoding processing.

Benefits of technology

Effectively save code rate, improve encoding and decoding efficiency, and improve encoding and decoding performance, so that video data can be processed efficiently on both the encoding and decoding ends.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023137574_12062025_PF_FP_ABST
    Figure CN2023137574_12062025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a coding method, a decoding method, a code stream, a coder, a decoder, and a storage medium. The method comprises: determining a hiding mode parameter of a current block; when the hiding mode parameter indicates that the current block enables a parity hiding mode, determining the sum of coefficient absolute values in the current scan region of the current block, except for a preset position, and determining a coefficient parity value of the preset position on the basis of the sum of coefficient absolute values; decoding a code stream, and determining an initial coefficient absolute value of the preset position; and on the basis of the initial coefficient absolute value of the preset position and the coefficient parity value of the preset position, determining a target coefficient absolute value of the preset position. In this way, by means of hiding coefficient parity characteristics, the code rate can be reduced, thereby improving the coding and decoding performance.
Need to check novelty before this filing date? Find Prior Art

Description

Coding and decoding method, code stream, encoder, decoder and storage medium Technical Field

[0001] The embodiments of the present application relate to the field of video coding and decoding technology, and in particular to a coding and decoding method, a bit stream, an encoder, a decoder, and a storage medium. Background Art

[0002] As demand for video display quality increases, high-resolution videos typically contain more information and therefore require more bandwidth. To reduce bandwidth requirements, video coding, which involves video compression, has been introduced. On the encoder side, the input data to be encoded undergoes transformation and quantization. The resulting quantization coefficients are then entropy-coded and transmitted to the decoder via a bitstream. The bitstream is then parsed, and after dequantization and inverse transformation, the original input data can be restored.

[0003] However, in the Scan Region-based Coefficient Coding (SRCC) technology, the encoder and decoder will encode and decode the coefficients in the scan region position by position, resulting in a large amount of coding information to be written into the bitstream, which reduces the encoding and decoding efficiency.

[0004] Summary of the Invention

[0005] The embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium, which can save bit rate and improve coding and decoding performance by hiding the parity characteristics of coefficients.

[0006] The technical solution of the embodiment of the present application can be implemented as follows:

[0007] In a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, the method comprising:

[0008] Determine the hidden mode parameters of the current block;

[0009] When the concealment mode parameter indicates that the current block starts the parity concealment mode, determining the absolute value and value of the coefficients in the current scanning area of ​​the current block except for the preset position, and determining the parity value of the coefficients at the preset position according to the absolute value and value of the coefficients;

[0010] Decode the code stream and determine the absolute value of the initial coefficient at the preset position;

[0011] The target coefficient absolute value of the preset position is determined according to the initial coefficient absolute value of the preset position and the coefficient parity value of the preset position.

[0012] In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, the method comprising:

[0013] Determine the hidden mode parameters of the current block;

[0014] When the concealment mode parameter indicates that the current block starts the parity concealment mode, determining the absolute value of the target coefficient at a preset position in the current scanning area of ​​the current block;

[0015] Determine the initial coefficient absolute value of the preset position according to the target coefficient absolute value;

[0016] The absolute value of the initial coefficient at the preset position is coded, and the obtained coded bits are written into the bit stream.

[0017] In a third aspect, an embodiment of the present application provides a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: an absolute value of an initial coefficient at a preset position in a current scanning area of ​​a current block, a residual absolute value of the initial coefficient at a preset position, a value of first syntax identification information, a value of second syntax identification information, a value of third syntax identification information, a value of fourth syntax identification information, a value of fifth syntax identification information, a value of sixth syntax identification information, a value of seventh syntax identification information, and a value of eighth syntax identification information;

[0018] Among them, the value of the first syntax identification information indicates whether the current sequence allows the use of parity hiding mode, the value of the second syntax identification information indicates whether the current image allows the use of parity hiding mode, the value of the third syntax identification information indicates whether the current sequence allows the use of coefficient coding mode based on the scanning area, the value of the fourth syntax identification information indicates whether the absolute value of the initial coefficient of the preset position is equal to 0, the value of the fifth syntax identification information indicates whether the absolute value of the initial coefficient of the preset position is greater than 1, the value of the sixth syntax identification information indicates whether the absolute value of the initial coefficient of the preset position is greater than 2, the value of the seventh syntax identification information indicates the positive or negative sign of the coefficient at the preset position when the absolute value of the initial coefficient at the preset position is not equal to 0, and the value of the eighth syntax identification information indicates the positive or negative sign of the coefficient at the preset position when the parity hiding mode is turned on for the current block and the absolute value of the target coefficient at the preset position is equal to 1.

[0019] In a fourth aspect, an embodiment of the present application provides an encoder, comprising a first determining unit and an encoding unit, wherein:

[0020] a first determining unit configured to determine a concealment mode parameter of a current block; determine an absolute value of a target coefficient at a preset position within a current scanning area of ​​the current block when the concealment mode parameter indicates that the current block turns on an even-odd concealment mode; and further configured to determine an absolute value of an initial coefficient at the preset position based on the absolute value of the target coefficient;

[0021] The encoding unit is configured to perform encoding processing on the absolute value of the initial coefficient at the preset position and write the obtained encoding bits into the bit stream.

[0022] In a fifth aspect, an embodiment of the present application provides an encoder, comprising a first memory and a first processor, wherein:

[0023] a first memory for storing a computer program capable of running on the first processor;

[0024] The first processor is configured to execute the method according to the second aspect when running the computer program.

[0025] In a sixth aspect, an embodiment of the present application provides a decoder, comprising a second determining unit and a decoding unit, wherein:

[0026] a second determining unit configured to determine a concealment mode parameter of the current block; when the concealment mode parameter indicates that the current block turns on the parity concealment mode, determine the absolute values ​​and values ​​of coefficients in the current scanning area of ​​the current block except for a preset position, and determine the parity value of the coefficients at the preset position according to the absolute values ​​and values ​​of the coefficients;

[0027] a decoding unit configured to decode the bit stream and determine an absolute value of an initial coefficient at a preset position;

[0028] The second determining unit is further configured to determine a target coefficient absolute value at the preset position according to the initial coefficient absolute value at the preset position and the coefficient parity value at the preset position.

[0029] In a seventh aspect, an embodiment of the present application provides a decoder, comprising a second memory and a second processor, wherein:

[0030] a second memory for storing a computer program capable of running on the second processor;

[0031] The second processor is configured to execute the method according to the first aspect when running the computer program.

[0032] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by at least one processor, it implements the method described in the first aspect or the method described in the second aspect.

[0033] The embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium. At the encoding end, the hidden mode parameters of the current block are determined; when the hidden mode parameters indicate that the current block turns on the parity hiding mode, the target coefficient absolute value of a preset position in the current scanning area of ​​the current block is determined; based on the target coefficient absolute value, the initial coefficient absolute value of the preset position is determined; the initial coefficient absolute value of the preset position is encoded, and the resulting encoded bits are written into the code stream. At the decoding end, the hidden mode parameters of the current block are determined; when the hidden mode parameters indicate that the current block turns on the parity hiding mode, the absolute values ​​and values ​​of the coefficients in the current scanning area of ​​the current block other than the preset position are determined, and the coefficient parity value of the preset position is determined based on the absolute values ​​and values ​​of the coefficients; the code stream is decoded to determine the initial coefficient absolute value of the preset position; based on the initial coefficient absolute value of the preset position and the coefficient parity value of the preset position, the target coefficient absolute value of the preset position is determined. In this way, both the encoding end and the decoding end can first determine the hidden mode parameters of the current block, and then, when the hidden mode parameters indicate that the current block turns on the parity hiding mode, the parity characteristics of the coefficients at the preset positions in the current scanning area can be hidden. At this time, the actual coefficient absolute value of the preset position is no longer encoded, and only the initial coefficient absolute value of the preset position (for example, half of the actual coefficient absolute value) needs to be encoded and decoded. Then, the decoding end can derive the complete actual coefficient absolute value based on the hidden coefficient parity characteristics. This not only saves bit rate and improves encoding and decoding efficiency, but also improves encoding and decoding performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] FIG1 is a flow chart diagram of a hybrid coding framework;

[0035] FIG2A is a schematic diagram of using coordinates (SRx, SRy) to determine a rectangular coefficient coding area;

[0036] FIG2B is a schematic diagram of encoding and decoding coefficients in a reverse Zig-zag order;

[0037] FIG3A is a first schematic diagram of a residual sub-block of a transformation mode and position;

[0038] FIG3B is a second schematic diagram of a residual sub-block of a transformation mode and position;

[0039] FIG3C is a third schematic diagram of a residual sub-block of a transformation mode and position;

[0040] FIG3D is a fourth schematic diagram of a residual sub-block of a transformation mode and position;

[0041] FIG4A is a schematic diagram of the division of a horizontal derivative mode;

[0042] FIG4B is a schematic diagram of the division of a vertical derivative mode;

[0043] FIG5 is a schematic diagram of a network architecture of a video codec provided in an embodiment of the present application;

[0044] FIG6 is a schematic block diagram of a system composition of an encoder provided in an embodiment of the present application;

[0045] FIG7 is a schematic block diagram of a system composition of a decoder provided in an embodiment of the present application;

[0046] FIG8 is a flowchart diagram of a decoding method provided in an embodiment of the present application;

[0047] FIG9 is a second flow chart of a decoding method provided in an embodiment of the present application;

[0048] FIG10 is a third flow chart of a decoding method provided in an embodiment of the present application;

[0049] FIG11 is a fourth flow chart of a decoding method provided in an embodiment of the present application;

[0050] FIG12 is a fifth flow chart of a decoding method provided in an embodiment of the present application;

[0051] FIG13 is a sixth flow chart of a decoding method provided in an embodiment of the present application;

[0052] FIG14 is a flowchart diagram 1 of an encoding method provided in an embodiment of the present application;

[0053] FIG15 is a second flow chart of an encoding method provided in an embodiment of the present application;

[0054] FIG16 is a schematic diagram of the structure of an encoder provided in an embodiment of the present application;

[0055] FIG17 is a schematic diagram of a specific hardware structure of an encoder provided in an embodiment of the present application;

[0056] FIG18 is a schematic diagram of the structure of a decoder provided in an embodiment of the present application;

[0057] FIG19 is a schematic diagram of a specific hardware structure of a decoder provided in an embodiment of the present application;

[0058] FIG20 is a schematic diagram of the composition structure of a coding and decoding coefficient provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] In order to enable a more detailed understanding of the features and technical contents of the embodiments of the present application, the implementation of the embodiments of the present application is described in detail below with reference to the accompanying drawings. The attached drawings are for reference only and are not used to limit the embodiments of the present application.

[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0061] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0062] It should also be pointed out that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0063] In video images, a coding block (CB) is generally represented by a first color component, a second color component, and a third color component. These three color components are a luminance component, a blue chrominance component, and a red chrominance component. Specifically, the luminance component is typically represented by the symbol Y, the blue chrominance component is typically represented by the symbols Cb or U, and the red chrominance component is typically represented by the symbols Cr or V. Thus, video images can be represented in either the YCbCr or YUV format.

[0064] Before further explaining the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained first. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:

[0065] Audio Video coding Standard (AVS);

[0066] 3rd Audio Video coding Standard (AVS3);

[0067] 4th Audio Video coding Standard (AVS4);

[0068] AVS3 Phase II reference software / AVS4 Exploration reference software (Explore Video Model, EVM);

[0069] Sign Data Hiding (SDH);

[0070] Scan Region-based Coefficient Coding (SRCC);

[0071] Implicit selection of transform (IST);

[0072] Sub Block Transform (SBT)

[0073] Implicit Selection of Transform Skip (ISTS);

[0074] Intra Derived Tree (Intra DT) mode.

[0075] Coding Unit (CU);

[0076] Coding Tree Unit (CTU);

[0077] Largest Coding Unit (LCU);

[0078] Prediction Unit (PU);

[0079] Transform Unit (TU);

[0080] Discrete Cosine Transform (DCT);

[0081] Discrete Sine Transform (DST).

[0082] It is understood that common video codec standards all adopt a block-based hybrid coding framework. Each image, sub-image, or frame in a video is divided into square maximum coding units or coding tree units of the same size (e.g., 256×256, 128×128, 64×64, etc.). Each maximum coding unit or coding tree unit can be divided into rectangular coding units according to a rule. Coding units may also be divided into prediction units, transform units, etc. Specifically, as shown in Figure 1, the hybrid coding framework includes a prediction module 11, a transform and quantization module 12, an entropy coding module 13, an inverse quantization and inverse transform module 14, a loop filtering module 15, and a decoded picture cache module 16. The prediction module 11 may include an intra-frame prediction module 11a and an inter-frame prediction module 11b. The inter-frame prediction module 11b may include a motion estimation module and a motion compensation module. Because there is a strong correlation between adjacent pixels in a video image, intra-frame prediction is used in video codec technology to eliminate spatial redundancy between adjacent pixels. In addition, since there is a strong similarity between adjacent images in a video, the inter-image prediction method is used in video coding and decoding technology to eliminate the temporal redundancy between adjacent images, thereby improving coding efficiency.

[0083] The basic process of a video codec is as follows: On the encoder side, an image is divided into blocks. Intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block for the current block. The prediction block is subtracted from the original block to obtain a residual block. The residual block is transformed and quantized to obtain a quantization coefficient matrix. This quantization coefficient matrix is ​​entropy-encoded and output to the bitstream. On the decoder side, intra-frame prediction or inter-frame prediction is used on the current block to generate a prediction block for the current block. The bitstream is then parsed to obtain a quantization coefficient matrix. This quantization coefficient matrix is ​​inversely quantized and inversely transformed to obtain a residual block. The prediction block and residual block are added together to obtain a reconstructed block. The reconstructed blocks form a reconstructed image, which is then subjected to image-based or block-based loop filtering to obtain a decoded image. The encoder side also performs similar operations as the decoder side to obtain a decoded image. The decoded image can serve as a reference image for inter-frame prediction of subsequent images. Block division information, prediction, transform, quantization, entropy coding, loop filtering, and other mode or parameter information determined by the encoder are output to the bitstream if necessary. The decoding end determines the same block division information as the encoding end by parsing the bit stream and analyzing the existing information, as well as the mode information or parameter information such as prediction, transformation, quantization, entropy coding, and loop filtering, thereby ensuring that the decoded image obtained by the encoding end is the same as the decoded image obtained by the decoding end. The decoded image obtained by the encoding end is also usually called a reconstructed image. The current block can be divided into prediction units during prediction, and the current block can be divided into transformation units during transformation. The division of prediction units and transformation units can be different. The above is the basic process of the video codec under the block-based hybrid coding framework. With the development of technology, some modules or steps of the framework or process may be optimized. The embodiment of the present application is applicable to the basic process of the video codec under the block-based hybrid coding framework, but is not limited to the framework and process.

[0084] In addition, in the embodiment of the present application, the current block (CB) may be a current coding unit, a current prediction unit, or a current transform unit, etc., which is not specifically limited here.

[0085] The following will be described in detail in conjunction with the coefficient encoding part in the related art.

[0086] For quantization and rate-distortion optimization quantization, quantization, dequantization and coefficient encoding are closely related. The purpose of quantization is to scale the transform coefficients so that the number of bits consumed when encoding the coefficients is reduced. The quantization and dequantization process is shown in the following formula: t′ i =q i qstep (2)

[0087] Here, t i Indicates the transform coefficient, qstep indicates the quantization step size (related to the quantization parameter set in the configuration file), qi Indicates the quantization coefficient, round(·) indicates the rounding process, which is not limited to rounding up or rounding down, etc. The quantization process is controlled by the encoder. In addition, t′ i Represents the reconstructed transform coefficient. Due to the loss of precision caused by the rounding process, t′ i With t i are different.

[0088] It should be noted that quantization will reduce the accuracy of the transform coefficients, and the loss of accuracy is irreversible. Encoders usually measure the cost of quantization through the rate-distortion cost function, as shown in the following formula: J = D + λ·R = (t i -t′ i ) 2 +λ·B(q i ) (3)

[0089] Here, B(·) represents the encoder’s estimated code q i The number of bits consumed is calculated.

[0090] It should also be noted that, in theory, no matter how the encoder determines q i The value of q is constant, so the encoder can decide q more freely. i . Usually, the encoder will take the principle of minimizing the total cost of the current block as the basis for each q i Adjustments are made to achieve overall cost optimization. This process is called rate-distortion optimized quantization and is also widely used in video coding.

[0091] For coefficient coding based on scan area, AVS3 adopts coefficient coding technology based on scan area. SRCC technology uses coordinate position (SRx, SRy) to determine the quantized coefficient area that needs to be scanned and encoded in the current block. Among them, SRx is the horizontal coordinate of the rightmost non-zero coefficient in the coefficient matrix, and SRy is the vertical coordinate of the bottom non-zero coefficient in the coefficient matrix. As shown in Figure 2A, an example of using coordinates (SRx, SRy) to determine a rectangular coefficient coding area. In addition, only the coefficients within the scan area determined by (SRx, SRy) need to be encoded. The encoding scan order is a reverse zig-zag scan from the lower right corner to the upper left corner, as shown in Figure 2B, an example of encoding and decoding coefficients in a reverse zig-zag order.

[0092] For the coefficients in the scan area, the encoder and decoder will encode and decode position by position, and each coefficient will be represented by significant flag, greater than 1 flag, greater than 2 flag and remainder.

[0093] Significant flag indicates whether the coefficient of the current scan position is 0. When the flag is 1, it means that the current position is non-zero, otherwise it is zero;

[0094] The greater than 1 flag indicates whether the absolute value of the coefficient at the current scan position is greater than 1. This flag is only further encoded and decoded when the significant flag is 1. If the significant flag is 0, the greater than 1 flag is also 0. If the greater than 1 flag is 1, it indicates that the absolute value of the coefficient at the current scan position is greater than 1; otherwise, it indicates that the absolute value of the coefficient at the current scan position is 1.

[0095] The greater than 2 flag indicates whether the absolute value of the coefficient at the current scan position is greater than 2. This flag is only further encoded and decoded when the greater than 1 flag is 1. If the greater than 1 flag is 0, the greater than 2 flag is also 0. If the greater than 2 flag is 1, it indicates that the absolute value of the coefficient at the current scan position is greater than 2; otherwise, it indicates that the absolute value of the coefficient at the current scan position is 2.

[0096] Remainder indicates the part of the coefficient at the current scan position whose absolute value is greater than 2, and exists only when greater than 2 flag is 1.

[0097] In addition, when the absolute value of the coefficient at the current scanning position is non-zero, a sign indicating the positive or negative sign of the coefficient will also be encoded and decoded.

[0098] The above syntax identification information is divided into groups of 16 for encoding and decoding. When encoding and decoding each group of coefficients,

[0099] In the first round, encode and decode the significant flag;

[0100] In the second round, the coefficients with significant flag set to 1 are encoded and decoded as greater than 1 and greater than 2 flags.

[0101] In the third round, encode and decode the remainder and sign of the coefficient with significant flag 1.

[0102] For implicit transform selection, AVS3 adopts three transform type technologies based on the parity of the number of even quantized coefficients in the current block as information to determine the transform mode. These three transform type technologies are IST, ISTS and SBT.

[0103] Implicit Transform Selection (IST) technology allows the current block to use both DCT-II and DST-VII transform modes to transform and inversely transform the residual of the current block. Specifically, when the current block meets the conditions for enabling the implicit transform selection technology (the enabling conditions here may specifically include: the size of the current block, the type of the current block, the range of the coefficient scanning area (SRCC) within the current block, whether the current block is a luminance block, etc.), the selection between DCT-II and DST-VII transforms will be based on the characteristics of the quantization coefficients in the current block. Specifically, when the number of even quantized coefficients in the current block is even, the current block is transformed and inversely transformed using the DCT-II transform mode; when the number of even quantized coefficients in the current block is odd, the current block is transformed and inversely transformed using the DST-VII transform mode. In addition, when the current sequence or current image allows the use of Implicit Transform Skip Selection (ISTS) technology, this parity characteristic of the even number of coefficients will be used to determine whether the current block uses the implicit transform skip selection technology.

[0104] In addition to being used in the selection of basic transforms, implicit transform selection can also be used for the selection of sub-block partitioning technology (SBT). The second phase of AVS3 adopted SBT technology. The inter residual is divided into two sub-blocks, where the residual of one sub-block defaults to 0 and the residual of the other sub-block defaults to non-zero. There are 8 options for the size and position of the non-zero residual sub-block (this information is transmitted in the bitstream), and the transform of the non-zero residual sub-block can adaptively select DCT8 / DST7 transform as the horizontal transform and vertical transform according to the position of the sub-block. Among them, SBT is used for the luminance residual block of the inter mode CU whose width and height are both less than or equal to 64.

[0105] For example, Figures 3A, 3B, 3C, and 3D each provide a transform mode and position. As shown in Figure 3A, the transform mode is SBT-V and the position is position 0; as shown in Figure 3B, the transform mode is SBT-V and the position is position 1; as shown in Figure 3C, the transform mode is SBT-H and the position is position 0; as shown in Figure 3D, the transform mode is SBT-H and the position is position 1. In Figures 3A and 3B, w represents the width of the residual block, w1 represents the width of the grid-filled area, w-w1 represents the width of the white-filled area, and w1 = 1 / 2 × w or w1 = 1 / 4 × w; in Figures 3C and 3D, h represents the height of the residual block, h1 represents the height of the grid-filled area, h-h1 represents the height of the white-filled area, and h1 = 1 / 2 × h or h1 = 1 / 4 × h. 3A , 3B, 3C, and 3D , white-filled areas indicate areas with all zero coefficients, and grid-filled areas indicate areas containing non-zero coefficients.

[0106] That is to say, there are four sizes of non-zero residual sub-blocks:

[0107] 1) SBT-V-1 type: The width of the sub-block is 1 / 2 of the width of the residual block, and the height is the height of the residual block;

[0108] 2) SBT-V-2 type: The width of the sub-block is 1 / 4 of the width of the residual block, and the height is the height of the residual block;

[0109] 3) SBT-H-1 type: The height of the sub-block is 1 / 2 of the height of the residual block, and the width is the width of the residual block;

[0110] 4) SBT-H-2 type: The height of the sub-block is 1 / 4 of the height of the residual block, and the width is the width of the residual block.

[0111] There are two positions of non-zero residual sub-blocks:

[0112] 1) The left side (for SBT-V) / top side (for SBT-H) of the residual block;

[0113] 2) The right side (for SBT-V) / bottom side (for SBT-H) of the residual block.

[0114] Therefore, there are a total of 8 sub-block size and position combinations here. Two flag bits are used to describe the sub-block size, and the parity of the even number of quantized coefficients is used to indicate the sub-block position. In addition, a flag bit is used to indicate whether the SBT technique is used.

[0115] The three technologies mentioned above can only be enabled when the sequence-level flag of IST is 1. Specifically, when the sequence-level flag of IST is enabled, block-level IST can be used; ISTS can only be used at the block level when the IST flag in both the sequence header and the image header is 1; SBT can only indicate the sub-block division position through the parity feature when the SBT flag in the sequence header is 1. Otherwise, SBT uses an additional coded flag to indicate the sub-block division position.

[0116] For the intra-frame derivative mode, it can be abbreviated as Intra DT. This method mainly adds the concept of PU on the basis of the coding unit. This method supports a total of six PU divisions, such as three in the horizontal direction and three in the vertical direction. Among them, the division of the horizontal derivative mode is shown in Figure 4A, and the division of the vertical derivative mode is shown in Figure 4B. In Figures 4A and 4B, there are three horizontal derivative modes in the horizontal direction and three vertical derivative modes in the vertical direction. In addition, the conditions for using Intra DT include that the maximum size of the coding unit is 64×64 and the minimum is 16×16, and the aspect ratio of the coding unit is less than 4.

[0117] Based on this, an embodiment of the present application provides an encoding method for determining a hidden mode parameter of a current block; when the hidden mode parameter indicates that the current block turns on the parity hiding mode, determining the target coefficient absolute value of a preset position in the current scanning area of ​​the current block; determining the initial coefficient absolute value of the preset position based on the target coefficient absolute value; encoding the initial coefficient absolute value of the preset position, and writing the obtained coded bits into a bitstream. An embodiment of the present application also provides a decoding method for determining a hidden mode parameter of a current block; when the hidden mode parameter indicates that the current block turns on the parity hiding mode, determining the absolute value and value of the coefficients in the current scanning area of ​​the current block except for the preset position, and determining the coefficient parity value of the preset position based on the absolute value and value of the coefficients; decoding the bitstream to determine the initial coefficient absolute value of the preset position; determining the target coefficient absolute value of the preset position based on the initial coefficient absolute value and the coefficient parity value of the preset position.

[0118] In this way, both the encoding end and the decoding end can first determine the hidden mode parameters of the current block, and then, when the hidden mode parameters indicate that the current block turns on the parity hiding mode, the parity characteristics of the coefficients at the preset positions in the current scanning area can be hidden. At this time, the actual coefficient absolute value of the preset position is no longer encoded, and only the initial coefficient absolute value of the preset position (for example, half of the actual coefficient absolute value) needs to be encoded and decoded. Then, the decoding end can derive the complete actual coefficient absolute value based on the hidden coefficient parity characteristics. This not only saves bit rate and improves encoding and decoding efficiency, but also improves encoding and decoding performance.

[0119] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0120] FIG5 is a schematic diagram of a network architecture for video encoding and decoding provided in an embodiment of the present application. As shown in FIG5 , the network architecture includes one or more electronic devices 31 to 3N and a communication network 01, wherein electronic devices 31 to 3N can perform video interaction via the communication network 01. During implementation, the electronic devices can be various types of devices with video encoding and decoding capabilities. For example, the electronic devices can include mobile phones, tablet computers, personal computers, personal digital assistants, navigation devices, digital phones, video phones, televisions, sensor devices, servers, etc., without limitation herein.

[0121] In an embodiment of the present application, a network architecture of a video encoding and decoding system including a decoding method and an encoding method is provided. The decoder or encoder in the embodiment of the present application can be the aforementioned electronic device. In other words, the electronic device in the embodiment of the present application has video encoding and decoding capabilities and can generally include a video encoder (i.e., an encoder) and a video decoder (i.e., a decoder).

[0122] FIG6 is a block diagram of the system composition of an encoder provided in an embodiment of the present application. As shown in FIG6 , the encoder 100 may include: a segmentation unit 101, a prediction unit 102, a first adder 107, a transform unit 108, a quantization unit 109, an inverse quantization unit 110, an inverse transform unit 111, a second adder 112, a filtering unit 113, a decoded picture buffer (DPB) unit 114, and an entropy coding unit 115. Here, the input of the encoder 100 may be a video consisting of a series of pictures or a single still picture, and the output of the encoder 100 may be a bitstream (also referred to as a "codestream") used to represent a compressed version of the input video.

[0123] Among them, the segmentation unit 101 segments the picture in the input video into one or more Coding Tree Units (CTUs). The segmentation unit 101 divides the picture into multiple tiles (or tiles), and can further divide a tile into one or more bricks. Here, a tile or a brick may include one or more complete and / or partial CTUs. In addition, the segmentation unit 101 can form one or more slices, where a slice can include one or more tiles arranged in a grid order in the picture, or one or more tiles covering a rectangular area in the picture. The segmentation unit 101 can also form one or more sub-pictures, where a sub-picture can include one or more slices, tiles or bricks.

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

[0125] The prediction unit 102 outputs the prediction block of the CU, and the first adder 107 calculates the difference between the CU in the output of the segmentation unit 101 and the prediction block of the CU, i.e., the residual CU. The transform unit 108 reads the residual CU and performs one or more transform operations on the residual CU to obtain coefficients. The quantization unit 109 quantizes the coefficients and outputs the quantized coefficients (i.e., levels). The inverse quantization unit 110 performs a scaling operation on the quantized coefficients to output reconstructed coefficients. The inverse transform unit 111 performs one or more inverse transforms corresponding to the transform in the transform unit 108 and outputs the reconstructed residual. The second adder 112 calculates the reconstructed CU by adding the reconstructed residual and the prediction block of the CU from the prediction unit 102. The second adder 112 also sends its output to the prediction unit 102 for use as an intra-frame prediction reference. After all CUs in the picture or sub-picture are reconstructed, the filtering unit 113 performs loop filtering on the reconstructed picture or sub-picture. Here, the filtering unit 113 includes one or more filters, such as a deblocking filter, a sample adaptive offset (SAO) filter, an adaptive loop filter (ALF), a luma mapping and chroma scaling (LMCS) filter, and a neural network-based filter. Alternatively, when the filtering unit 113 determines that a CU is not used as a reference for encoding other CUs, the filtering unit 113 performs loop filtering on one or more target pixels in the CU.

[0126] The output of the filtering unit 113 is a decoded picture or sub-picture, which is cached to the DPB unit 114. The DPB unit 114 outputs the decoded picture or sub-picture based on the timing and control information. Here, the picture stored in the DPB unit 114 can also be used as a reference for the prediction unit 102 to perform inter-frame prediction or intra-frame prediction. Finally, the entropy coding unit 115 converts the parameters required for decoding the picture from the encoder 100 (such as control parameters and supplementary information, etc.) into binary form and writes this binary form into the code stream according to the syntax structure of each data unit. That is, the encoder 100 finally outputs the code stream.

[0127] Furthermore, encoder 100 may include a first processor and a first memory storing a computer program. When the first processor reads and executes the computer program, encoder 100 reads the input video and generates a corresponding bitstream. Alternatively, encoder 100 may be a computing device comprising one or more chips. These units implemented as integrated circuits on the chip have similar connectivity and data exchange functions as the corresponding units in FIG6 .

[0128] Figure 7 is a block diagram of the system components of a decoder provided in an embodiment of the present application. As shown in Figure 7, the decoder 200 may include a decoding unit 201, a prediction unit 202, an inverse quantization unit 205, an inverse transform unit 206, an adder 207, a filter unit 208, and a decoded image buffer unit 209. The input of the decoder 200 is a bitstream representing a compressed version of a video or a still image, and the output of the decoder 200 may be a decoded video consisting of a series of images or a decoded still image.

[0129] The input codestream to decoder 200 may be the codestream generated by encoder 100. Decoding unit 201 parses the input codestream and obtains syntax element values ​​from the input codestream. Decoding unit 201 converts the binary representation of the syntax elements into digital values ​​and sends the digital values ​​to units within decoder 200 to obtain one or more decoded pictures. Decoding unit 201 may also parse one or more syntax elements from the input codestream to display decoded pictures.

[0130] During the decoding process of the decoder 200 , the decoding unit 201 sends the values ​​of the syntax elements and one or more variables set or determined according to the values ​​of the syntax elements and used to obtain one or more decoded pictures to the units in the decoder 200 .

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

[0132] The inverse quantization unit 205 has the same functionality as the inverse quantization unit 110 in the encoder 100. The inverse quantization unit 205 performs a scaling operation on the quantized coefficients (i.e., levels) from the decoding unit 201 to obtain reconstructed coefficients. The inverse transform unit 206 has the same functionality as the inverse transform unit 111 in the encoder 100. The inverse transform unit 206 performs one or more transform operations (i.e., the inverse of the one or more transform operations performed by the inverse transform unit 111 in the encoder 100) to obtain a reconstructed residual. The adder 207 adds its inputs (the prediction block from the prediction unit 202 and the reconstructed residual from the inverse transform unit 206) to obtain a reconstructed block for the currently decoded block. The reconstructed block is also sent to the prediction unit 202 to be used as a reference for other blocks encoded in intra-frame prediction mode.

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

[0134] Furthermore, the decoder 200 can be a second memory having a second processor and a computer program. When the first processor reads and executes the computer program, the decoder 200 reads the input bit stream and generates the corresponding decoded video. In addition, the decoder 200 can also be a computing device having one or more chips. These units implemented as integrated circuits on the chip have similar connection and data exchange functions as the corresponding units in Figure 7.

[0135] It should also be noted that when the embodiment of the present application is applied to the encoder 100, the "current block" specifically refers to the current block to be encoded in the video image (which can also be simply referred to as the "encoding block"); when the embodiment of the present application is applied to the decoder 200, the "current block" specifically refers to the current block to be decoded in the video image (which can also be simply referred to as the "decoding block").

[0136] In one embodiment of the present application, FIG8 is a flowchart of a decoding method provided by the embodiment of the present application. As shown in FIG8 , the method may include:

[0137] S801: Determine the hidden mode parameters of the current block.

[0138] It should be noted that in the embodiments of the present application, the method is applied to a decoder. Specifically, the method can be a decoding method for coefficient parity hiding, which mainly hides the parity characteristics of the absolute values ​​of coefficients at preset positions in the current block, thereby saving bit rate and improving encoding and decoding performance.

[0139] It should also be noted that in the embodiments of the present application, whether the parity concealment mode is enabled for the current block, that is, whether the current block uses the parity concealment technology, can be determined by the concealment mode parameters of the current block. In some embodiments, determining the concealment mode parameters of the current block can include at least one of the following:

[0140] Determine whether the current sequence allows the use of parity hiding mode;

[0141] Determine whether the current image allows the use of odd-even hiding mode;

[0142] Determining whether the transformation mode information of the current block meets a first preset usage condition;

[0143] It is determined whether the number of non-zero coefficients in a current scanning area of ​​the current block except for a preset position exceeds a first threshold.

[0144] The current sequence may include the current picture, which in turn may include the current block. In terms of high-level syntax, the parity concealment mode may have independent sequence-level or picture-level identification information. In some embodiments, a first syntax identification information may be used as a sequence-level syntax element to indicate whether the current sequence allows the use of the parity concealment mode; and / or a second syntax identification information may be used as a picture-level syntax element to indicate whether the current picture allows the use of the parity concealment mode.

[0145] It should be noted that, in the embodiment of the present application, the first syntax identification information can be represented by ph_enable_flag. Determining whether the current sequence allows the use of the parity concealment mode may include: decoding the code stream and determining the value of the first syntax identification information; when the value of the first syntax identification information is a first value, determining that the current sequence allows the use of the parity concealment mode; and when the value of the first syntax identification information is a second value, determining that the current sequence does not allow the use of the parity concealment mode.

[0146] Here, the first value and the second value are different, and the first value and the second value can be in parameter form or in numeric form. For example, the first value can be set to 1 and the second value can be set to 0; or the first value can be set to true and the second value can be set to false; however, this is not a specific limitation.

[0147] That is, in this embodiment of the present application, ph_enable_flag serves as a binary variable, serving as a flag for enabling sequence-level parity hiding. For example, assuming the first value is set to 1 and the second value is set to 0, a value of 1 indicates that the current sequence can use parity hiding mode, i.e., the parity hiding flag in the current sequence header is enabled; a value of 0 indicates that the current sequence should not use parity hiding mode, i.e., the parity hiding flag in the current sequence header is disabled. It is also important to note that the value of the variable PhEnableFlag is equal to the value of ph_enable_flag.

[0148] For example, for a sequence header identifier, a syntax example similar to the AVS standard text is shown in Table 1.

[0149] Table 1

[0150] It should also be noted that, in the embodiment of the present application, the second syntax identification information can be represented by picture_ph_enable_flag. Determining whether the current picture allows the use of the even-parity concealment mode may include: decoding the code stream and determining the value of the second syntax identification information; determining that the current picture allows the use of the even-parity concealment mode when the value of the second syntax identification information is a first value; and determining that the current picture does not allow the use of the even-parity concealment mode when the value of the second syntax identification information is a second value.

[0151] Here, the first value and the second value are different, and the first value and the second value can be in parameter form or in numeric form. For example, the first value can be set to 1 and the second value can be set to 0; or the first value can be set to true and the second value can be set to false; however, this is not a specific limitation.

[0152] That is to say, in the embodiment of the present application, picture_ph_enable_flag serves as a flag for allowing the image-level parity hiding technology, which is a binary variable. For example, assuming that the first value is set to 1 and the second value is set to 0, then a value of 1 indicates that the current image can use the parity hiding mode, that is, the parity hiding flag of the current image header is turned on; a value of 0 indicates that the current image should not use the parity hiding mode, that is, the parity hiding flag of the current image header is turned off. It should also be noted that the value of the variable PicturePhEnableFlag is equal to the value of picture_ph_enable_flag. If picture_ph_enable_flag does not exist in the code stream, then it can be determined that the value of PicturePhEnableFlag is 0.

[0153] For example, in AVS, picture headers can be divided into intra-frame picture headers and inter-frame picture headers. Since the even-odd hiding mode can be used on any type of decoded frame, both intra-frame picture headers and inter-frame picture headers can have picture header identifiers for the even-odd hiding mode. Table 2 shows an example syntax for an intra-frame picture header, and Table 3 shows an example syntax for an inter-frame picture header.

[0154] Table 2

[0155] Table 3

[0156] It should also be noted that both the first syntax identification information and the second syntax identification information are high-level syntax elements. If you need to determine whether the current sequence allows the use of even-parity concealment mode, you can use the first syntax identification information to determine this; if you need to determine whether the current image allows the use of even-parity concealment mode, you can use the second syntax identification information to determine this.

[0157] It should also be noted that, in some embodiments, there may be no parity hiding enable flag at the picture level. In this case, when high-level syntax elements are used to limit whether each block can use the parity hiding mode, the PicturePhEnableFlag is no longer obtained based on the picture_ph_enable_flag syntax element. Instead, a variable PhEnableFlag is determined based on the ph_enable_flag syntax element at the sequence level to limit whether the parity hiding mode is allowed at the block level.

[0158] Regarding whether the parity concealment mode is enabled for the current block, in some embodiments, the method further includes: determining, when the current sequence allows the use of the parity concealment mode or the current image allows the use of the parity concealment mode, and when the transform mode information of the current block satisfies a first preset usage condition, and the number of non-zero coefficients in a current scanning area of ​​the current block except for a preset position exceeds a first threshold, determining that the concealment mode parameter indicates that the parity concealment mode is enabled for the current block.

[0159] In one possible implementation, the transformation mode information of the current block satisfies a first preset usage condition, which may include: the current block is a first color component block; or, at least one side length of the current scanning area of ​​the current block is greater than or equal to a second threshold and the current block does not use a sub-block transformation mode; or, the current block uses an intra-frame derivative mode.

[0160] In the embodiment of the present application, the first color component block may be a chroma block; the second threshold may be 16, but is not specifically limited thereto.

[0161] Exemplarily, the conditions for starting the parity hiding mode of the current block (i.e., using the parity hiding technology for the current block) may include:

[0162] (1) The parity hiding flag of the current sequence header / image header should be turned on; and

[0163] (2) The current block is a chroma block, or at least one side (SRx or SRy) of the current scanning area of ​​the current block is greater than or equal to 16 and the current block does not use the SBT mode, or the current block uses a partitioning technique that partitions the CU into multiple PUs (intra DT mode); and (3) There are more than N non-zero coefficients in the current scanning area of ​​the current block except for the preset position. Here, N represents the first threshold and is a positive integer. For example, in the embodiment of the present application, the value of N is equal to 3.

[0164] In another possible implementation, the transformation mode information of the current block satisfies the first preset usage condition, which may include: the current block does not use the implicit transformation selection mode; the current block does not use the implicit transformation skip selection mode; the current block does not use the sub-block transformation mode.

[0165] In the embodiment of the present application, since there is IST technology in AVS and reference software EVM, the parity hiding technology here is only used on blocks and components to which IST mode, ISTS mode, and SBT mode are not applicable.

[0166] Exemplarily, the conditions for starting the parity hiding mode of the current block (i.e., using the parity hiding technology for the current block) may include:

[0167] (1) The parity hiding flag of the current sequence header / image header should be turned on; and

[0168] (2) The current block does not use the IST mode, ISTS mode, and SBT mode; and

[0169] (3) The number of non-zero coefficients in the current scanning area of ​​the current block, excluding the preset position, exceeds N. Here, N represents the first threshold value, and N is a positive integer. For example, in the embodiment of the present application, the value of N is equal to 3.

[0170] It is understood that in the embodiments of the present application, regarding whether the current block uses the IST mode, in some embodiments, when the current block does not meet at least one of the second preset use conditions, it is determined that the current block does not use the IST mode. The second preset use condition may include:

[0171] The current sequence allows the use of the IST mode, but the current sequence or current image does not allow the use of the ISTS mode;

[0172] When the current block is an intra-frame decoding block, the size of the current block satisfies a first size condition;

[0173] When the current block is a non-intra-frame decoding block, the size of the current block satisfies a second size condition;

[0174] The current block is a second color component block;

[0175] The current block does not use intra-frame derivation mode;

[0176] The size of the current scanning area of ​​the current block satisfies the third size condition.

[0177] In an embodiment of the present application, the second color component block can be a luminance block, the first size condition can be that the size of the current block is less than 64×64, the second size condition can be that the size of the current block is less than 32×32, and the third size condition can be that the size of the current scanning area is less than 16×16, but this is not specifically limited here.

[0178] Exemplarily, the conditions for the current block to use the IST mode include:

[0179] (1) The sequence-level IST flag is 1, and the sequence-level or image-level transform skip flag is 0; and

[0180] (2) When the current block is an intra block, the block size is less than 64×64, otherwise it is less than 32×32; and

[0181] (3) The current block is a luminance block; and

[0182] (4) The current block does not use the (intra DT) partitioning technique of partitioning the CU into multiple PUs; and

[0183] (5) The current scanning area of ​​the current block is smaller than 16×16.

[0184] In the embodiment of the present application, if all the above five conditions are met, it can be determined that the current block uses the IST mode; otherwise, as long as one condition is not met, it is determined that the current block does not use the IST mode.

[0185] It can also be understood that in the embodiments of the present application, the parity hiding technique is performed in a scan region based coefficient coding (SRCC) mode. In some embodiments, the method further includes: decoding the bitstream, determining a value of third syntax identification information; when the value of the third syntax identification information indicates that the current sequence allows the use of the scan region based coefficient coding mode, performing a step of determining a hiding mode parameter for the current block; wherein the current sequence includes the current image, and the current image includes the current block.

[0186] It should be noted that, for the value of the third grammar identification information, when the value of the third grammar identification information is the first value, it is determined that the current sequence is allowed to use the coefficient coding mode based on the scanning area; when the value of the third grammar identification information is the second value, it is determined that the current sequence is not allowed to use the coefficient coding mode based on the scanning area.

[0187] Here, the first value is different from the second value, and the first value and the second value can be in parameter form or in numerical form. For example, the first value can be set to 1 and the second value can be set to 0. In this case, if the value of the third syntax identification information is 1, it can be determined that the current sequence allows the use of the SRCC mode; if the value of the third syntax identification information is 0, it can be determined that the current sequence does not allow the use of the SRCC mode.

[0188] In some embodiments, the method further includes: when the value of the third syntax identification information indicates that the current sequence does not allow the use of a coefficient coding technology based on a scan area, determining that the parity concealment mode is turned off for the current block.

[0189] That is, when the SRCC identifier of the sequence header is 0, it may indicate that the parity hiding mode proposed in the embodiment of the present application should be turned off.

[0190] In some embodiments, the method further includes: when the value of the third syntax identification information indicates that the current sequence allows the use of a coefficient coding mode based on a scan area, if the current sequence does not allow the use of an implicit transform selection mode, executing the step of determining the hidden mode parameters of the current block.

[0191] That is, when the SRCC identifier of the sequence header is 1, if the current sequence does not allow the use of the IST mode, then the step of determining the concealment mode parameters of the current block is performed to determine whether the parity concealment mode is turned on for the current block.

[0192] In some embodiments, the method further includes: when the value of the third syntax identification information indicates that the current sequence allows the use of a coefficient coding mode based on a scan area, if the current sequence allows the use of an implicit transform selection mode and the current image does not allow the use of an implicit transform skip selection mode, then executing the step of determining the hidden mode parameters of the current block.

[0193] That is, when the SRCC identifier of the sequence header is 1, if the current sequence allows the use of the IST mode and the current image does not allow the use of the ISTS mode, then the step of determining the concealment mode parameters of the current block is performed to determine whether the parity concealment mode is turned on for the current block.

[0194] In some embodiments, the method further includes: when the value of the third syntax identification information indicates that the current sequence allows the use of a coefficient coding mode based on a scan area, if the current sequence allows the use of an implicit transform selection mode and the current image allows the use of an implicit transform skip selection mode, then determining that the current block turns off the parity hiding mode.

[0195] That is, when the SRCC identifier of the sequence header is 1, if the current sequence allows the use of the IST mode and the current image allows the use of the ISTS mode, it can be indicated that the parity hiding mode proposed in the embodiment of the present application should be turned off.

[0196] It should be noted that in the embodiments of the present application, the IST mode identification information, the ISTS mode identification information, and the SBT mode identification information are all high-level syntax elements. The IST mode identification information and the SBT mode identification information may be sequence-level syntax elements, and the ISTS mode identification information may be sequence-level or picture-level syntax elements. However, the IST mode identification information and the SBT mode identification information may also exist as picture-level syntax elements, which are not specifically limited here.

[0197] It should also be noted that in this embodiment of the present application, for sequence-level IST mode identification information, the following steps may be performed: decoding the bitstream and determining the value of the IST mode identification information; if the value of the IST mode identification information is a first value, it indicates that the current sequence allows the use of the implicit transform selection mode; if the value of the IST mode identification information is a second value, it indicates that the current sequence does not allow the use of the implicit transform selection mode. Similarly, the determination of the IST mode identification information at the picture level is the same as that at the sequence level and will not be detailed here.

[0198] It should also be noted that, in the embodiment of the present application, for the sequence-level SBT mode identification information, the following can be done: decoding the bitstream to determine the value of the SBT mode identification information; if the value of the SBT mode identification information is the first value, it indicates that the current sequence allows the use of the sub-block transform mode; if the value of the SBT mode identification information is the second value, it indicates that the current sequence does not allow the use of the sub-block transform mode. Similarly, the determination of the SBT mode identification information at the picture level is the same as that at the sequence level and will not be described in detail here.

[0199] It should also be noted that, in the embodiment of the present application, for the ISTS mode identification information at the sequence level, the following steps may be performed: decoding the code stream and determining the value of the ISTS mode identification information; if the value of the ISTS mode identification information is the first value, it indicates that the current sequence allows the use of the implicit transform skip selection mode; if the value of the ISTS mode identification information is the second value, it indicates that the current sequence does not allow the use of the implicit transform skip selection mode. Similarly, the determination of the ISTS mode identification information at the picture level is the same as that at the sequence level and will not be described in detail here.

[0200] For example, whether the parity hiding mode is enabled for the current block and the enabling conditions of other technologies may specifically include:

[0201] (1) When the SRCC identifier of the sequence header is 0, the parity hiding mode proposed in this embodiment should be disabled.

[0202] (2) When the SRCC identifier of the sequence header is 1 and the IST identifier of the sequence header or picture header is 0, the parity concealment mode proposed in this embodiment can be determined whether to be enabled according to the concealment mode parameters of the current block.

[0203] (3) When the SRCC identifier of the sequence header is 1, the IST identifier of the sequence header or picture header is 1, and the ISTS identifier of the sequence header or picture header is 0, the parity concealment mode proposed in this embodiment can be determined whether to be enabled according to the concealment mode parameters of the current block.

[0204] (4) When the SRCC identifier of the sequence header is 1, the IST identifier of the sequence header or picture header is 1, and the ISTS identifier of the sequence header or picture header is 1, the parity hiding mode proposed in this embodiment should be disabled.

[0205] It should also be noted that, in some embodiments, for the IST identifier, ISTS identifier and SBT identifier, some may not have a picture-level parity hiding enable flag. In this case, when high-level syntax elements are used to limit whether each block can use the parity hiding mode, it is no longer based on the picture-level syntax elements, but on the sequence-level syntax elements to determine a variable to limit whether the block level is allowed to use the parity hiding mode.

[0206] S802, when the concealment mode parameter indicates that the current block starts the parity concealment mode, determine the absolute value and value of the coefficients in the current scanning area of ​​the current block except the preset position, and determine the parity value of the coefficients in the preset position according to the absolute value and value of the coefficients.

[0207] It should be noted that, in the embodiment of the present application, if the parity hiding mode is turned on for the current block, the parity characteristics of the coefficients at the preset positions can be hidden according to the absolute values ​​of the coefficients at the non-preset positions.

[0208] It should also be noted that in the embodiments of the present application, the parity hiding technology can be based on blocks, that is, each current block can hide the parity value of a coefficient; or it can be based on coefficient groups, that is, each coefficient group can hide the parity value of a coefficient.

[0209] In a possible implementation, as shown in FIG9 , the method may include:

[0210] S901 : When the current scanning area is the entire area of ​​the current block, determine the preset position as the upper left corner position of the current block.

[0211] S902 , performing a sum operation on the absolute values ​​of the coefficients except for the upper left corner position in the current block to determine the sum of the absolute values ​​of the coefficients.

[0212] S903: Determine the coefficient parity value of the preset position according to the coefficient absolute value and value.

[0213] In the embodiment of the present application, the parity value of the coefficient at the upper left corner of the current block can be hidden in units of blocks. When hidden, the parity value of the coefficient can be derived from the absolute values ​​of the coefficients other than the upper left corner in the current block.

[0214] In another possible implementation, as shown in FIG10 , the method may include:

[0215] S1001: When the current scanning area is the current coefficient group of the current block, determine the preset position as the last position of the current coefficient group in the scanning order.

[0216] S1002: performing a sum operation on the absolute values ​​of the coefficients except the last position in the current coefficient group to determine the sum of the absolute values ​​of the coefficients.

[0217] S1003, determining the coefficient parity value of the preset position according to the coefficient absolute value and value.

[0218] In the embodiment of the present application, the parity value of the coefficient at the last position in the scan order of the current coefficient group can be hidden, with the coefficient group being the unit. When hidden, the parity value of the coefficient can be derived from the absolute values ​​of the coefficients other than the last position in the scan order in the current coefficient group.

[0219] It should also be noted that, in an embodiment of the present application, the method further includes: dividing the current block into coefficient groups to determine at least two coefficient groups of the current block; wherein the current coefficient group is any one of the at least two coefficient groups.

[0220] Here, each coefficient group may include a preset number of coefficients, for example, the preset number may be 4, 8, 32, 64, etc. In other words, the coefficient groups may be divided into groups of 4, 8, 32, 64, etc. coefficients.

[0221] It should be noted that when using coefficient groups as units, in AVS3 or EVM, the coefficient decoding in the current block has been divided into groups of 16 coefficients. Similar to the current block, the coefficient parity value of the last position in the decoding order of every 16 coefficients can be hidden. When it is hidden, the hidden coefficient parity value should be derived from the absolute values ​​of other coefficients in the current coefficient group.

[0222] It should also be noted that when parity hiding is performed in coefficient groups, a group size different from that used in related techniques can be used. For example, a group size of 4, 8, 32, 64, or... coefficients can be used. Alternatively, the group size can be applied only to parity hiding, or it can be applied to both parity hiding and related techniques.

[0223] It is understood that in the embodiment of the present application, the hidden coefficient parity value is derived by using the absolute values ​​of other coefficients. Here, the hidden coefficient parity value can be determined by using the parity property of the sum of the absolute values ​​of other coefficients. In some embodiments, determining the coefficient parity value of a preset position based on the sum of the absolute values ​​of the coefficients may include: determining the coefficient parity value of the preset position based on the parity property of the sum of the absolute values ​​of the coefficients.

[0224] In a specific embodiment, determining the parity value of the coefficient at a preset position based on the parity characteristics of the absolute value and value of the coefficients may include: if the absolute value and value of the coefficients is an odd number, determining the parity value of the coefficient at the preset position to be a third value; if the absolute value and value of the coefficients is an even number, determining the parity value of the coefficient at the preset position to be a fourth value.

[0225] It should be noted that in the embodiment of the present application, the third value is different from the fourth value. For example, the third value can be set to 1, and the fourth value can be set to 0. That is, if the absolute value sum of the coefficients is an odd number, then it can be determined that the coefficient at the preset position is also an odd number, and the parity value of the coefficient at the preset position can be set to 1; if the absolute value sum of the coefficients is an even number, then it can be determined that the coefficient at the preset position is also an even number, and the parity value of the coefficient at the preset position can be set to 0.

[0226] In another specific embodiment, determining the coefficient parity value of the preset position according to the coefficient absolute value sum value may include: performing an AND operation on the coefficient absolute value sum value and 1 to determine the coefficient parity value of the preset position.

[0227] It should be noted that, assuming that the absolute value and value of the coefficients can be expressed by sum_abs_tb, the parity value of the coefficients at the preset position can be obtained by (sum_abs_tb&1).

[0228] It can also be understood that in the embodiment of the present application, the use of the parity hiding technology can be mutually exclusive with the implicit transform selection, and the parity characteristics of one or more coefficients in the current block that is not applicable to the implicit transform selection are hidden. In addition, for the current block using the implicit transform selection, some coefficients are used to adjust the parity characteristics satisfied by the implicit transform selection, while another part of the coefficients are used to hide the parity characteristics of one or more coefficients, so that the parity characteristics of the coefficients in the current block can satisfy both the parity hiding technology and the implicit transform selection.

[0229] In some embodiments, the method may further include: when the current sequence allows the use of the parity concealment mode or the current image allows the use of the parity concealment mode, the transform mode information of the current block does not meet the first preset usage condition, and the number of non-zero coefficients in the current scanning area of ​​the current block except for a preset position exceeds a first threshold, determining that the concealment mode parameter indicates that the parity concealment mode is enabled for the current block.

[0230] In a specific embodiment, the transformation mode information of the current block does not meet the first preset use condition, which may include: the current block uses an implicit transformation selection mode; or the current block uses a sub-block transformation mode.

[0231] That is, in an embodiment of the present application, if the current block uses the IST mode or the SBT mode, the current block can also use the parity hiding technology. When the high-level syntax element indicates that the parity hiding mode is allowed, and the current block uses the IST mode or the SBT mode, and there are more than N non-zero coefficients in the current scanning area of ​​the current block except for the preset position, then it can be determined that the parity hiding mode is enabled for the current block. Where N represents a first threshold, and illustratively, the value of N can be set to 3.

[0232] In some embodiments, as shown in FIG11 , the method may include:

[0233] S1101 , dividing the current block into coefficient groups to determine at least two coefficient groups of the current block.

[0234] S1102, when the current block uses the implicit transform selection mode or the sub-block transform mode, determining that there is at least one candidate coefficient group in the at least two coefficient groups that does not enable the parity hiding mode, and enabling the parity hiding mode for the remaining coefficient groups other than the at least one candidate coefficient group.

[0235] It should be noted that in the embodiment of the present application, the current scanning area is based on coefficient groups. For the current block using the IST mode or the SBT mode, the parity hiding mode can be enabled for only some of the coefficient groups. The parity hiding technology will not be used for the other coefficient groups regardless of whether they meet the conditions for enabling the parity hiding mode.

[0236] It should also be noted that, in the embodiment of the present application, assuming that there is only one coefficient group that does not use the parity hiding technology, the last coefficient group of the current block in the scanning order can be determined as at least one candidate coefficient group.

[0237] That is to say, for the current block using the IST mode or the SBT mode, different operations will be performed on each group of 16 coefficients divided from the current block according to the scanning order when decoding the coefficients. No matter how many non-zero coefficients there are in the last coefficient group in the scanning order, the parity hiding technology will not be used.

[0238] In another possible implementation, the current coefficient group is any one of the remaining coefficient groups other than the at least one candidate coefficient group. For the last position of the current coefficient group in the scan order, the absolute values ​​of the other coefficients in the current coefficient group may also be used to derive the hidden coefficient parity value. Here, the hidden coefficient parity value may be determined by using the parity property of the sum of the absolute values ​​of the other coefficients. In some embodiments, determining the sum of the absolute values ​​of the coefficients in the current scan area of ​​the current block, excluding a preset position, may include: when the current scan area is the current coefficient group of the current block, determining the preset position as the last position of the current coefficient group in the scan order; and summing the absolute values ​​of the coefficients in the current coefficient group, excluding the last position, to determine the sum of the absolute values ​​of the coefficients.

[0239] It should also be noted that in an embodiment of the present application, the absolute values ​​of the coefficients except the last position in the current coefficient group are summed to determine the absolute value and value of the coefficients. Alternatively, the absolute values ​​of the non-zero coefficients except the last position in the current coefficient group are summed to determine the absolute value and value of the coefficients.

[0240] It should also be noted that, in the embodiment of the present application, determining the coefficient parity value of the preset position based on the coefficient absolute value sum value may include: determining the coefficient parity value of the preset position based on the parity characteristic of the coefficient absolute value sum value. Alternatively, performing an AND operation on the coefficient absolute value sum value and 1 to determine the coefficient parity value of the preset position.

[0241] In a specific embodiment, determining the parity value of the coefficient at a preset position based on the parity characteristics of the absolute value and value of the coefficients may include: if the absolute value and value of the coefficients is an odd number, determining the parity value of the coefficient at the preset position to be a third value; if the absolute value and value of the coefficients is an even number, determining the parity value of the coefficient at the preset position to be a fourth value.

[0242] In the embodiment of the present application, the third value is different from the fourth value. For example, the third value can be set to 1, and the fourth value can be set to 0. That is, if the absolute value sum of the coefficients is an odd number, then it can be determined that the coefficient at the preset position is also an odd number, and the parity value of the coefficient at the preset position can be set to 1; if the absolute value sum of the coefficients is an even number, then it can be determined that the coefficient at the preset position is also an even number, and the parity value of the coefficient at the preset position can be set to 0.

[0243] S803: Decode the code stream and determine the absolute value of the initial coefficient at the preset position.

[0244] It should be noted that in an embodiment of the present application, for the absolute value of the initial coefficient at the preset position, a decoding operation of the fourth grammar identification information, the fifth grammar identification information, the sixth grammar identification information and the residual absolute value of the initial coefficient at the preset position is introduced here to determine the absolute value of the initial coefficient at the preset position.

[0245] In some embodiments, as shown in FIG12 , the method may include:

[0246] S1201: Decode a code stream and determine a value of fourth syntax identification information.

[0247] S1202: When the value of the fourth syntax identification information is equal to 0, determine that the absolute value of the initial coefficient at the preset position is equal to 0.

[0248] S1203: When the value of the fourth syntax identification information is equal to 1, decode the code stream and determine the value of the fifth syntax identification information.

[0249] S1204: When the value of the fifth syntax identification information is equal to 0, determine that the absolute value of the initial coefficient at the preset position is equal to 1.

[0250] S1205: When the value of the fifth syntax identification information is equal to 1, decode the code stream and determine the value of the sixth syntax identification information.

[0251] S1206: When the value of the sixth syntax identification information is equal to 0, determine that the absolute value of the initial coefficient of the preset position is equal to 2.

[0252] S1207: When the value of the sixth syntax identification information is equal to 1, decode the code stream and determine the residual absolute value of the initial coefficient at the preset position.

[0253] S1208 , performing an addition operation on the residual absolute value of the initial coefficient at the preset position and 2 to determine the absolute value of the initial coefficient at the preset position.

[0254] It should be noted that, in the embodiment of the present application, the fourth syntax identification information can be represented by sig_flag_ph, and sig_flag_ph indicates whether the absolute value of the initial coefficient at the preset position is equal to 0. If the value of the fourth syntax identification information is equal to 0, it can indicate that the absolute value of the initial coefficient at the preset position is equal to 0; if the value of the fourth syntax identification information is equal to 1, it can indicate that the absolute value of the initial coefficient at the preset position is not equal to 0. At this time, the code stream is further decoded to determine the value of the fifth syntax identification information.

[0255] It should be noted that, in the embodiment of the present application, the fifth syntax identification information can be represented by coeff_abs_level_greater1_flag_ph, and coeff_abs_level_greater1_flag_ph indicates whether the absolute value of the initial coefficient at the preset position is greater than 1. If the value of the fifth syntax identification information is equal to 0, it can indicate that the absolute value of the initial coefficient at the preset position is equal to 1; if the value of the fifth syntax identification information is equal to 1, it can indicate that the absolute value of the initial coefficient at the preset position is greater than 1. At this time, the code stream is further decoded to determine the value of the sixth syntax identification information.

[0256] It should be noted that, in the embodiment of the present application, the sixth syntax identification information can be represented by coeff_abs_level_greater2_flag_ph, and coeff_abs_level_greater2_flag_ph indicates whether the absolute value of the initial coefficient at the preset position is greater than 2. If the value of the sixth syntax identification information is equal to 0, it can indicate that the absolute value of the initial coefficient at the preset position is equal to 2; if the value of the sixth syntax identification information is equal to 1, it can indicate that the absolute value of the initial coefficient at the preset position is greater than 2. At this time, the code stream is further decoded to determine the residual absolute value of the initial coefficient at the preset position.

[0257] It should be noted that, in the embodiment of the present application, the remaining absolute value of the initial coefficient can be represented by coeff_abs_level_remaining, where coeff_abs_level_remaining represents the part where the absolute value of the initial coefficient is greater than 2, and exists only when the value of coeff_abs_level_greater2_flag_ph is 1.

[0258] Thus, in the embodiment of the present application, determining the absolute value of the initial coefficient at the preset position may include: decoding a bitstream to determine a value of fourth syntax identification information; when the value of the fourth syntax identification information indicates that the absolute value of the initial coefficient at the preset position is not equal to 0, decoding the bitstream to determine a value of fifth syntax identification information; when the value of the fifth syntax identification information indicates that the absolute value of the initial coefficient at the preset position is greater than 1, decoding the bitstream to determine a value of sixth syntax identification information; when the value of the sixth syntax identification information indicates that the absolute value of the initial coefficient at the preset position is greater than 2, decoding the bitstream to determine a residual absolute value of the initial coefficient at the preset position; and performing an addition operation on the residual absolute value of the initial coefficient at the preset position and 2 to determine the absolute value of the initial coefficient at the preset position.

[0259] In some embodiments, the same context model may be used to encode and decode sig_flag_ph, coeff_abs_level_greater1_flag_ph, and coeff_abs_level_greater2_flag_ph for each coefficient. Taking the absolute value of the initial coefficient at a preset position as an example, the method may further include: decoding the bitstream based on the preset context model to determine a value of fourth syntax identification information; when the value of the fourth syntax identification information indicates that the absolute value of the initial coefficient at the preset position is not equal to 0, decoding the bitstream based on the preset context model to determine a value of fifth syntax identification information; and when the value of the fifth syntax identification information indicates that the absolute value of the initial coefficient at the preset position is greater than 1, decoding the bitstream based on the preset context model to determine a value of sixth syntax identification information.

[0260] It should also be noted that in this embodiment of the present application, both the initial coefficient absolute value at a preset position within the current scanning area and the coefficient absolute value at other positions can be decoded from sig_flag_ph, coeff_abs_level_greater1_flag_ph, and coeff_abs_level_greater2_flag_ph. Here, the same series of context models can be used to encode and decode sig_flag_ph, coeff_abs_level_greater1_flag_ph, and coeff_abs_level_greater2_flag_ph for each coefficient.

[0261] In some embodiments, different context models may also be used to encode and decode sig_flag_ph, coeff_abs_level_greater1_flag_ph, and coeff_abs_level_greater2_flag_ph for each coefficient. Still taking the absolute value of the initial coefficient at a preset position as an example, the method may further include: decoding the bitstream based on the first context model to determine a value of fourth syntax identification information; when the value of the fourth syntax identification information indicates that the absolute value of the initial coefficient at the preset position is not equal to 0, decoding the bitstream based on the second context model to determine a value of fifth syntax identification information; when the value of the fifth syntax identification information indicates that the absolute value of the initial coefficient at the preset position is greater than 1, decoding the bitstream based on the third context model to determine a value of sixth syntax identification information; wherein the first context model, the second context model, and the third context model are different.

[0262] It should also be noted that, in the embodiment of the present application, regardless of the initial coefficient absolute value at a preset position in the current scanning area or the coefficient absolute value at other positions, due to the presence of hidden coefficient parity values, the encoded and decoded absolute value of the coefficient with the parity characteristics hidden is actually half of that without hiding, which makes the size distribution of the coefficient absolute values ​​of the hidden and non-hidden coefficient parity values ​​change a lot, so different context models can also be used here to encode and decode the sig_flag_ph, coeff_abs_level_greater1_flag_ph and coeff_abs_level_greater2_flag_ph of each coefficient.

[0263] In some embodiments, the method may also include: determining a first context index number, a second context index number, and a third context index number; and determining, based on a context model candidate list, a first context model corresponding to the first context index number, a second context model corresponding to the second context index number, and a third context model corresponding to the third context index number.

[0264] It should be noted that, in the embodiment of the present application, the context model candidate list may include multiple candidate context models, such as 8 candidate context models, 16 candidate context models, etc., which is not specifically limited here. In addition, the first context index number represents the number of the first context model in the context model candidate list, the second context index number represents the number of the second context model in the context model candidate list, and the third context index number represents the number of the third context model in the context model candidate list.

[0265] It should also be noted that, in an embodiment of the present application, determining the first context index number may include: determining the color component type of the current block and a first preset array; wherein the first preset array represents the absolute values ​​of the first p coefficients at a preset position in the scanning order within the current scanning area, and p is an integer greater than zero; determining the first context index number based on the color component type of the current block, the first preset array, and the position of the preset position within the current scanning area.

[0266] It should also be noted that, in an embodiment of the present application, determining the second context index number and the third context index number may include: determining the color component type of the current block and a second preset array; wherein the second preset array represents the absolute values ​​of the first q non-zero coefficients at a preset position in the scanning order within the current scanning area, and q is an integer greater than zero; determining the second context index number and the third context index number based on the color component type of the current block, the second preset array, and the position of the preset position within the current scanning area.

[0267] In the embodiment of the present application, the preset position is used as the current coefficient position in the scanning order. The first preset value can be represented by PreGt0[·], and the second preset value can be represented by PreGtX[·]. Assuming that the values ​​of p and q are equal to 5, then Pre5Gt0 is an array that is updated as the position changes, and stores whether the 5 positions before the preset position in the scanning order are non-zero coefficients. If they are non-zero, 1 is stored, and if they are zero, 0 is stored; Pre5GtX is an array that is updated as the position changes, and stores the absolute values ​​of the coefficients obtained at the 5 non-zero positions before the preset position in the scanning order. For example, if the absolute value of the non-zero coefficients obtained at the 5 non-zero positions is 1, 1 is stored, and if it is 2, 2 is stored.

[0268] In a possible implementation, assuming that the context model candidate list includes 8 candidate context models, for the first context index number, the following steps may be performed in sequence to determine the ctxIdxInc of sig_flag_ph:

[0269] --Set the value of ctxIdxInc to 0.

[0270] --If the current block is a chroma block, ctxIdxInc=ctxIdxInc+4.

[0271] --Let num_gt0 be the number of coefficients whose value of Pre5Gt0[j] is not zero in Pre5Gt0[j] (j=0-4), and ctxIdxInc be:

[0272] num_gt0 = Min(num_gt0, 3);

[0273] ctxIdxInc=ctxIdxInc+num_gt0.

[0274] For the second context index number and the third context index number, the following steps may be performed in sequence to determine the ctxIdxInc of coeff_abs_level_greater1_flag or coeff_abs_level_greater2_flag:

[0275] --Set the value of ctxIdxInc to 0.

[0276] --If the current block is a chroma block, ctxIdxInc=ctxIdxInc+4.

[0277] --Let the number of non-zero coefficients of Pre5GtX[j] (j=0~4) whose absolute values ​​are greater than k be num_gtX, k=1,2.

[0278] If what needs to be determined is ctxIndexInc of coeff_abs_level_greater1_flag, k is equal to 1.

[0279] If what needs to be determined is ctxIndexInc of coeff_abs_level_greater2_flag, k is equal to 2.

[0280] Among them, ctxIdxInc is:

[0281] num_gtX=Min(num_gtX,3);

[0282] ctxIdxInc=ctxIdxInc+num_gtX.

[0283] In another possible implementation, assuming that the context model candidate list includes 16 candidate context models, for the first context index number, the following steps may be performed in sequence to determine ctxIdxInc of sig_flag_ph:

[0284] --Set the value of ctxIdxInc to 0.

[0285] --If the current block is a chroma block, ctxIdxInc=ctxIdxInc+8.

[0286] --If the current coefficient position is not the upper left corner, ctxIdxInc=ctxIdxInc+4.

[0287] --Let num_gt0 be the number of coefficients whose value of Pre5Gt0[j] is not zero in Pre5Gt0[j] (j=0-4), and ctxIdxInc be:

[0288] num_gt0 = Min(num_gt0, 3);

[0289] ctxIdxInc=ctxIdxInc+num_gt0.

[0290] For the second context index number and the third context index number, the following steps may be performed in sequence to determine the ctxIdxInc of coeff_abs_level_greater1_flag or coeff_abs_level_greater2_flag:

[0291] --Set the value of ctxIdxInc to 0.

[0292] --If the current block is a chroma block, ctxIdxInc=ctxIdxInc+8.

[0293] --If the current coefficient position is not the upper left corner, ctxIdxInc=ctxIdxInc+4.

[0294] --Let the number of non-zero coefficients of Pre5GtX[j] (j=0~4) whose absolute values ​​are greater than k be num_gtX, k=1,2.

[0295] If what needs to be determined is ctxIndexInc of coeff_abs_level_greater1_flag, k is equal to 1.

[0296] If what needs to be determined is ctxIndexInc of coeff_abs_level_greater2_flag, k is equal to 2.

[0297] Among them, ctxIdxInc is:

[0298] num_gtX=Min(num_gtX,3);

[0299] ctxIdxInc=ctxIdxInc+num_gtX.

[0300] S804 , determining a target coefficient absolute value at the preset position according to the initial coefficient absolute value at the preset position and the coefficient parity value at the preset position.

[0301] In the embodiment of the present application, after obtaining the initial coefficient absolute value of the preset position and the coefficient parity value of the preset position, the target coefficient absolute value of the preset position can be further determined. In some embodiments, as shown in FIG13 , after step S803, the method further includes:

[0302] S1301 , performing a left shift operation on the absolute value of the initial coefficient at the preset position to determine the absolute value of the intermediate coefficient at the preset position.

[0303] It should be noted that, in the embodiment of the present application, the absolute value of the intermediate coefficient at the preset position can be obtained by shifting the absolute value of the initial coefficient at the preset position by one position to the left; or it can be said that the absolute value of the intermediate coefficient at the preset position is set to twice the absolute value of the initial coefficient at the preset position.

[0304] It should also be noted that in the embodiment of the present application, after determining the absolute value of the intermediate coefficient of the preset position, the absolute value of the target coefficient of the preset position can be determined based on the absolute value of the intermediate coefficient of the preset position and the coefficient parity value of the preset position.

[0305] S1302 , performing a sum operation on the absolute value of the intermediate coefficient at the preset position and the coefficient parity value at the preset position to determine the absolute value of the target coefficient at the preset position.

[0306] It should also be noted that in the embodiment of the present application, the absolute value of the initial coefficient of the preset position can be expressed as absCoef b The absolute value of the target coefficient at the preset position (i.e., the actual coefficient absolute value) can be represented by (absCoef), and the coefficient parity value at the preset position can be represented by p. The initial coefficient absolute value absCoef obtained from the decoded bitstream b The process of deriving the absolute value of the actual coefficient (absCoef) is: (absCoef) = (absCoef b <<1)+p (4)

[0307] It should also be noted that, in the embodiment of the present application, the absolute value of the coefficient here specifically refers to the absolute value of the quantized coefficient. For the coefficients in the current scanning area of ​​the current block, the parity characteristics of some coefficients can be used to represent the parity characteristics of another part of the coefficients, which means that for the coefficients represented by the parity characteristics, only a part of it needs to be decoded to derive the complete coefficients, as shown in the above formula (4).

[0308] In some embodiments, the method may further include: determining the sign of the coefficient of the preset position; and determining the target coefficient of the preset position according to the absolute value of the target coefficient of the preset position and the sign of the coefficient of the preset position.

[0309] In one possible implementation, determining the sign of the coefficient at the preset position may include: when the absolute value of the initial coefficient at the preset position is not equal to 0, decoding the bitstream and determining the value of the seventh syntax identification information; and determining the sign of the coefficient at the preset position based on the value of the seventh syntax identification information.

[0310] It should be noted that in the embodiment of the present application, the seventh syntax identification information can be represented by coeff_sign. If the absolute value of the currently decoded coefficient is non-zero, then coeff_sign indicating the sign of the coefficient will also be decoded, so that the target quantization coefficient at the preset position can be determined.

[0311] In another possible implementation, determining the sign of the coefficient at the preset position may include: when the parity hiding mode is turned on in the current block and the absolute value of the target coefficient at the preset position is equal to 1, decoding the code stream and determining the value of the eighth syntax identification information; and determining the sign of the coefficient at the preset position based on the value of the eighth syntax identification information.

[0312] It should also be noted that, in an embodiment of the present application, the eighth syntax identification information can be represented by coeff_sign_dc or coeff_sign_ph. Here, the eighth syntax identification information is used to indicate the positive and negative values ​​of the coefficients when the coefficients at the preset position are parsed as hidden parity characteristics and the absolute value of the actual coefficients is equal to 1. When the value of the symbol is 1, it indicates a positive value, otherwise when the value of the symbol is 0, it indicates a negative value. When this syntax element does not exist in the code stream, it means that the coefficient at the upper left corner is 0 or its positive and negative values ​​have been fully parsed.

[0313] In this way, after determining the quantization coefficient of the current block in the above manner, the quantization coefficient can be inversely quantized and inversely transformed to obtain the residual block of the current block; after determining the prediction block of the current block, the reconstructed block of the current block can be obtained based on the residual block and the prediction block of the current block, thereby completing the reconstruction of the current block.

[0314] The embodiment of the present application provides a decoding method for determining a hidden mode parameter of a current block; when the hidden mode parameter indicates that the current block is in parity hiding mode, determining the absolute values ​​and values ​​of the coefficients in the current scanning area of ​​the current block except for a preset position, and determining the parity value of the coefficients at the preset position based on the absolute values ​​and values ​​of the coefficients; decoding the bitstream to determine the initial absolute value of the coefficients at the preset position; and then determining the target absolute value of the coefficients at the preset position based on the initial absolute value of the coefficients at the preset position and the parity value of the coefficients at the preset position. In this way, when the hidden mode parameter indicates that the current block is in parity hiding mode, the parity characteristics of the coefficients at the preset position in the current scanning area can be hidden. In this case, the actual absolute value of the coefficients at the preset position is no longer encoded. Only the initial absolute value of the coefficients at the preset position (e.g., half of the actual absolute value of the coefficients) need be encoded and decoded. Then, the decoding end can derive the complete actual absolute value of the coefficients based on the hidden parity characteristics of the coefficients. This not only saves bit rate and improves encoding and decoding efficiency, but also improves encoding and decoding performance.

[0315] In another embodiment of the present application, FIG14 is a flow chart of a coding method provided in an embodiment of the present application. As shown in FIG14 , the method may include:

[0316] S1401: Determine the hidden mode parameters of the current block.

[0317] It should be noted that in the embodiments of the present application, the method is applied to an encoder. Specifically, the method can be a coding method for coefficient parity hiding, which mainly hides the parity characteristics of the absolute values ​​of coefficients at preset positions in the current block, thereby saving bit rate and improving encoding and decoding performance.

[0318] It should also be noted that in the embodiments of the present application, whether the parity concealment mode is enabled for the current block, that is, whether the current block uses the parity concealment technology, can be determined by the concealment mode parameters of the current block. In some embodiments, determining the concealment mode parameters of the current block can include at least one of the following:

[0319] Determine whether the current sequence allows the use of parity hiding mode;

[0320] Determine whether the current image allows the use of odd-even hiding mode;

[0321] Determining whether the transformation mode information of the current block meets a first preset usage condition;

[0322] It is determined whether the number of non-zero coefficients in a current scanning area of ​​the current block except for a preset position exceeds a first threshold.

[0323] The current sequence may include the current picture, which in turn may include the current block. In terms of high-level syntax, the parity concealment mode may have independent sequence-level or picture-level identification information. In some embodiments, a first syntax identification information may be used as a sequence-level syntax element to indicate whether the current sequence allows the use of the parity concealment mode; and / or a second syntax identification information may be used as a picture-level syntax element to indicate whether the current picture allows the use of the parity concealment mode.

[0324] It should be noted that in embodiments of the present application, the first syntax identification information can be represented by ph_enable_flag. The value of the first syntax identification information indicates whether the current sequence allows the use of the parity hiding mode. In some embodiments, the method further includes: determining the value of the first syntax identification information; encoding the value of the first syntax identification information, and writing the resulting coded bits into the bitstream.

[0325] In an embodiment of the present application, for determining the value of the first syntax identification information, when the current sequence allows the use of the parity hiding mode, the value of the first syntax identification information can be determined to be the first value; when the current sequence does not allow the use of the parity hiding mode, the value of the first syntax identification information can be determined to be the second value.

[0326] In the embodiments of the present application, the first value and the second value are different, and the first value and the second value can be in parameter form or in numerical form. For example, the first value can be set to 1 and the second value can be set to 0; or the first value can be set to true and the second value can be set to false; however, this is not a specific limitation.

[0327] That is to say, ph_enable_flag is a binary variable as a flag for enabling sequence-level parity hiding technology. For example, assuming that the first value is set to 1 and the second value is set to 0, then a value of 1 indicates that the current sequence can use the parity hiding mode, that is, the parity hiding flag of the current sequence header is turned on; a value of 0 indicates that the current sequence should not use the parity hiding mode, that is, the parity hiding flag of the current sequence header is turned off. It should also be noted that the value of the variable PhEnableFlag is equal to the value of ph_enable_flag. Among them, for the sequence header identifier, a syntax example similar to the AVS standard text is shown in Table 1.

[0328] It should also be noted that in this embodiment of the present application, the second syntax flag information can be represented by picture_ph_enable_flag. The value of the second syntax flag information indicates whether the parity concealment mode is enabled for the current picture. In some embodiments, the method further includes: determining the value of the second syntax flag information; encoding the value of the second syntax flag information, and writing the resulting coded bits into the bitstream.

[0329] In an embodiment of the present application, for determining the value of the second grammar identification information, when the current image allows the use of the even-odd hiding mode, the value of the second grammar identification information can be determined to be the first value; when the current image does not allow the use of the even-odd hiding mode, the value of the second grammar identification information can be determined to be the second value.

[0330] In the embodiments of the present application, the first value and the second value are different, and the first value and the second value can be in parameter form or in numerical form. For example, the first value can be set to 1 and the second value can be set to 0; or the first value can be set to true and the second value can be set to false; however, this is not a specific limitation.

[0331] That is, picture_ph_enable_flag is a binary variable that serves as a flag for enabling the image-level parity hiding technology. For example, assuming that the first value is set to 1 and the second value is set to 0, a value of 1 indicates that the current image can use the parity hiding mode, that is, the parity hiding flag of the current image header is turned on; a value of 0 indicates that the current image should not use the parity hiding mode, that is, the parity hiding flag of the current image header is turned off. It should also be noted that the value of the variable PicturePhEnableFlag is equal to the value of picture_ph_enable_flag. If picture_ph_enable_flag does not exist in the code stream, then it can be determined that the value of PicturePhEnableFlag is 0.

[0332] For example, in AVS, picture headers can be divided into intra-frame picture headers and inter-frame picture headers. Since the even-odd hiding mode can be used on any type of decoded frame, both intra-frame picture headers and inter-frame picture headers can have picture header identifiers for the even-odd hiding mode. Table 2 shows an example syntax for an intra-frame picture header, and Table 3 shows an example syntax for an inter-frame picture header.

[0333] It should also be noted that both the first syntax identification information and the second syntax identification information are high-level syntax elements. If you need to determine whether the current sequence allows the use of even-parity concealment mode, you can use the first syntax identification information to determine this; if you need to determine whether the current image allows the use of even-parity concealment mode, you can use the second syntax identification information to determine this.

[0334] It should also be noted that, in some embodiments, there may be no parity hiding enable flag at the picture level. In this case, when high-level syntax elements are used to limit whether each block can use the parity hiding mode, the PicturePhEnableFlag is no longer obtained based on the picture_ph_enable_flag syntax element. Instead, a variable PhEnableFlag is determined based on the ph_enable_flag syntax element at the sequence level to limit whether the parity hiding mode is allowed at the block level.

[0335] Regarding whether the parity concealment mode is enabled for the current block, in some embodiments, the method further includes: determining, when the current sequence allows the use of the parity concealment mode or the current image allows the use of the parity concealment mode, and when the transform mode information of the current block satisfies a first preset usage condition, and the number of non-zero coefficients in a current scanning area of ​​the current block except for a preset position exceeds a first threshold, determining that the concealment mode parameter indicates that the parity concealment mode is enabled for the current block.

[0336] In one possible implementation, the transformation mode information of the current block satisfies a first preset usage condition, which may include: the current block is a first color component block; or, at least one side length of the current scanning area of ​​the current block is greater than or equal to a second threshold and the current block does not use a sub-block transformation mode; or, the current block uses an intra-frame derivative mode.

[0337] In the embodiment of the present application, the first color component block may be a chroma block; the second threshold may be 16, but is not specifically limited thereto.

[0338] Exemplarily, the conditions for starting the parity hiding mode of the current block (i.e., using the parity hiding technology for the current block) may include:

[0339] (1) The parity hiding flag of the current sequence header / image header should be turned on; and

[0340] (2) The current block is a chroma block, or at least one side (SRx or SRy) of the current scanning area of ​​the current block is greater than or equal to 16 and the current block does not use the SBT mode, or the current block uses a partitioning technique that partitions the CU into multiple PUs (intra DT mode); and (3) There are more than N non-zero coefficients in the current scanning area of ​​the current block except for the preset position. Here, N represents the first threshold and is a positive integer. For example, in the embodiment of the present application, the value of N is equal to 3.

[0341] In another possible implementation, the transformation mode information of the current block satisfies the first preset usage condition, which may include: the current block does not use the implicit transformation selection mode; the current block does not use the implicit transformation skip selection mode; the current block does not use the sub-block transformation mode.

[0342] In the embodiment of the present application, since there is IST technology in AVS and reference software EVM, the parity hiding technology here is only used on blocks and components to which IST mode, ISTS mode, and SBT mode are not applicable.

[0343] Exemplarily, the conditions for starting the parity hiding mode of the current block (i.e., using the parity hiding technology for the current block) may include:

[0344] (1) The parity hiding flag of the current sequence header / image header should be turned on; and

[0345] (2) The current block does not use the IST mode, ISTS mode, and SBT mode; and

[0346] (3) The number of non-zero coefficients in the current scanning area of ​​the current block, excluding the preset position, exceeds N. Here, N represents the first threshold value, and N is a positive integer. For example, in the embodiment of the present application, the value of N is equal to 3.

[0347] It is understood that in the embodiments of the present application, regarding whether the current block uses the IST mode, in some embodiments, when the current block does not meet at least one of the second preset use conditions, it is determined that the current block does not use the IST mode. The second preset use condition may include:

[0348] The current sequence allows the use of the IST mode, but the current sequence or current image does not allow the use of the ISTS mode;

[0349] When the current block is an intra-coded block, the size of the current block satisfies a first size condition;

[0350] When the current block is a non-intra-coded block, the size of the current block satisfies a second size condition;

[0351] The current block is a second color component block;

[0352] The current block does not use intra-frame derivation mode;

[0353] The size of the current scanning area of ​​the current block satisfies the third size condition.

[0354] In an embodiment of the present application, the second color component block can be a luminance block, the first size condition can be that the size of the current block is less than 64×64, the second size condition can be that the size of the current block is less than 32×32, and the third size condition can be that the size of the current scanning area is less than 16×16, but this is not specifically limited here.

[0355] Exemplarily, the conditions for the current block to use the IST mode include:

[0356] (1) The sequence-level IST flag is 1, and the sequence-level or image-level transform skip flag is 0; and

[0357] (2) When the current block is an intra block, the block size is less than 64×64, otherwise it is less than 32×32; and

[0358] (3) The current block is a luminance block; and

[0359] (4) The current block does not use the (intra DT) partitioning technique of partitioning the CU into multiple PUs; and

[0360] (5) The current scanning area of ​​the current block is smaller than 16×16.

[0361] In the embodiment of the present application, if all the above five conditions are met, it can be determined that the current block uses the IST mode; otherwise, as long as one condition is not met, it is determined that the current block does not use the IST mode.

[0362] It is also understood that in the embodiments of the present application, the parity hiding technique is performed in a scan region based coefficient coding (SRCC) mode. In some embodiments, the method further includes: determining a value of third syntax identification information; encoding the value of the third syntax identification information, and writing the resulting coded bits into the bitstream.

[0363] It should be noted that, in the embodiment of the present application, the third syntax identification information may be represented by a sequence-level SRCC identifier, the value of which may indicate whether the current sequence allows the use of a scan region-based coefficient coding mode. In some embodiments, when the current sequence allows the use of a scan region-based coefficient coding mode, the step of determining the concealment mode parameters of the current block may be performed, i.e., step S1401 in FIG. 14 may be performed; wherein the current sequence includes the current image, and the current image includes the current block.

[0364] It should also be noted that, in an embodiment of the present application, for the value of the third grammar identification information, when the current sequence allows the use of a coefficient coding mode based on a scan area, the value of the third grammar identification information can be determined to be a first value; when the current sequence does not allow the use of a coefficient coding mode based on a scan area, the value of the third grammar identification information can be determined to be a second value.

[0365] Here, the first value is different from the second value, and the first value and the second value can be in parameter form or in numerical form. For example, the first value can be set to 1 and the second value can be set to 0. In this case, if the value of the third syntax identification information is 1, it can be determined that the current sequence allows the use of the SRCC mode; if the value of the third syntax identification information is 0, it can be determined that the current sequence does not allow the use of the SRCC mode.

[0366] In some embodiments, the method further comprises: when the current sequence does not allow the use of the coefficient coding technology based on the scanning area, determining that the parity concealment mode is turned off for the current block.

[0367] That is, when the SRCC identifier of the sequence header is 0, it may indicate that the parity hiding mode proposed in the embodiment of the present application should be turned off.

[0368] In some embodiments, the method further comprises: when the current sequence allows the use of the coefficient coding mode based on the scanning area, if the current sequence does not allow the use of the implicit transform selection mode, performing the step of determining the hidden mode parameters of the current block.

[0369] That is, when the SRCC identifier of the sequence header is 1, if the current sequence does not allow the use of the IST mode, then the step of determining the concealment mode parameters of the current block is performed to determine whether the parity concealment mode is turned on for the current block.

[0370] In some embodiments, the method further includes: when the current sequence allows the use of a coefficient coding mode based on a scan area, if the current sequence allows the use of an implicit transform selection mode and the current image does not allow the use of an implicit transform skip selection mode, then executing a step of determining the hidden mode parameters of the current block.

[0371] That is, when the SRCC identifier of the sequence header is 1, if the current sequence allows the use of the IST mode and the current image does not allow the use of the ISTS mode, then the step of determining the concealment mode parameters of the current block is performed to determine whether the parity concealment mode is turned on for the current block.

[0372] In some embodiments, the method further includes: when the current sequence allows the use of a coefficient coding mode based on a scan area, if the current sequence allows the use of an implicit transform selection mode and the current image allows the use of an implicit transform skip selection mode, determining that the current block turns off the parity hiding mode.

[0373] That is, when the SRCC identifier of the sequence header is 1, if the current sequence allows the use of the IST mode and the current image allows the use of the ISTS mode, it can be indicated that the parity hiding mode proposed in the embodiment of the present application should be turned off.

[0374] It should also be noted that in the embodiments of the present application, the IST mode identification information, the ISTS mode identification information, and the SBT mode identification information are all high-level syntax elements. The IST mode identification information and the SBT mode identification information can be sequence-level syntax elements, and the ISTS mode identification information can be sequence-level or picture-level syntax elements. However, the IST mode identification information and the SBT mode identification information can also exist as picture-level syntax elements, which are not specifically limited here.

[0375] For example, whether the parity hiding mode is enabled for the current block and the enabling conditions of other technologies may specifically include:

[0376] (1) When the SRCC identifier of the sequence header is 0, the parity hiding mode proposed in this embodiment should be disabled.

[0377] (2) When the SRCC identifier of the sequence header is 1 and the IST identifier of the sequence header or picture header is 0, the parity concealment mode proposed in this embodiment can be determined whether to be enabled according to the concealment mode parameters of the current block.

[0378] (3) When the SRCC identifier of the sequence header is 1, the IST identifier of the sequence header or picture header is 1, and the ISTS identifier of the sequence header or picture header is 0, the parity concealment mode proposed in this embodiment can be determined whether to be enabled according to the concealment mode parameters of the current block.

[0379] (4) When the SRCC identifier of the sequence header is 1, the IST identifier of the sequence header or picture header is 1, and the ISTS identifier of the sequence header or picture header is 1, the parity hiding mode proposed in this embodiment should be disabled.

[0380] It should also be noted that, in some embodiments, for the IST identifier, ISTS identifier and SBT identifier, some may not have a picture-level parity hiding enable flag. In this case, when high-level syntax elements are used to limit whether each block can use the parity hiding mode, it is no longer based on the picture-level syntax elements, but on the sequence-level syntax elements to determine a variable to limit whether the block level is allowed to use the parity hiding mode.

[0381] S1402 : When the concealment mode parameter indicates that the current block starts the parity concealment mode, determine the absolute value of the target coefficient at a preset position in the current scanning area of ​​the current block.

[0382] S1403: Determine the absolute value of the initial coefficient at the preset position according to the absolute value of the target coefficient.

[0383] It should be noted that, in the embodiment of the present application, if the parity hiding mode is turned on for the current block, the parity characteristics of the coefficients at the preset positions can be hidden according to the absolute values ​​of the coefficients at the non-preset positions.

[0384] After determining the absolute value of the target coefficient at the preset position, it is first necessary to determine the absolute value of the initial coefficient at the preset position.

[0385] In a possible implementation, the method may include: performing a right shift operation on the absolute value of the target coefficient to determine the absolute value of the initial coefficient at a preset position.

[0386] In another possible implementation, the method may include determining absolute values ​​and values ​​of coefficients in a current scanning area of ​​the current block except for a preset position, and determining parity values ​​of the coefficients at the preset position according to the absolute values ​​and values ​​of the coefficients.

[0387] In an embodiment of the present application, determining the absolute value of the initial coefficient of the preset position based on the absolute value of the target coefficient may include: determining the absolute value of the intermediate coefficient of the preset position based on the absolute value of the target coefficient and the parity value of the coefficient of the preset position; and setting the initial absolute value of the preset position to half of the absolute value of the intermediate coefficient of the preset position.

[0388] In the embodiment of the present application, the absolute value of the initial coefficient of the preset position can be expressed as absCoef b Indicates that the absolute value of the target coefficient at the preset position (ie, the actual coefficient absolute value) can be expressed as (absCoef), then the absolute value of the initial coefficient encoded in the bitstream (absCoef b ) is half of the actual absolute value (absCoef), as shown below: absCoef b =absCoef>>1 (5)

[0389] In the embodiment of the present application, the absolute value of the actual coefficient can be an odd number or an even number. Here, the coefficient parity value is represented by p. In fact, absCoef b =(absCoef-p) / 2. In this way, since the current block uses the parity hiding technology, during the encoding process of the preset position, the absolute value of the initial coefficient absCoef is written into the code stream. b , thus saving bit rate.

[0390] It should also be noted that in the embodiments of the present application, the parity hiding technology can be based on blocks, that is, each current block can hide the parity value of a coefficient; or it can be based on coefficient groups, that is, each coefficient group can hide the parity value of a coefficient.

[0391] In one possible implementation, the method may include: when the current scanning area is the entire area of ​​the current block, determining the preset position as the upper left corner position of the current block; performing a sum operation on the absolute values ​​of the coefficients in the current block except the upper left corner position to determine the sum of the absolute values ​​of the coefficients; and determining the parity value of the coefficients at the preset position based on the absolute value of the coefficients.

[0392] In the embodiment of the present application, the parity value of the coefficient at the upper left corner of the current block can be hidden in units of blocks. When hidden, the parity value of the coefficient can be derived from the absolute values ​​of the coefficients other than the upper left corner in the current block.

[0393] In another possible implementation, the method may include: when the current scanning area is the current coefficient group of the current block, determining the preset position as the last position of the current coefficient group in the scanning order; performing a sum operation on the absolute values ​​of the coefficients in the current coefficient group except the last position to determine the sum of the absolute values ​​of the coefficients; and determining the parity value of the coefficients at the preset position based on the sum of the absolute values ​​of the coefficients.

[0394] In the embodiment of the present application, the parity value of the coefficient at the last position in the scan order of the current coefficient group can be hidden, with the coefficient group being the unit. When hidden, the parity value of the coefficient can be derived from the absolute values ​​of the coefficients other than the last position in the scan order in the current coefficient group.

[0395] It should also be noted that, in an embodiment of the present application, the method further includes: dividing the current block into coefficient groups to determine at least two coefficient groups of the current block; wherein the current coefficient group is any one of the at least two coefficient groups.

[0396] Here, each coefficient group may include a preset number of coefficients, for example, the preset number may be 4, 8, 32, 64, etc. In other words, the coefficient groups may be divided into groups of 4, 8, 32, 64, etc. coefficients.

[0397] It should be noted that when using coefficient groups as units, in AVS3 or EVM, the coefficient coding in the current block has been divided into groups of 16 coefficients. Similar to using the current block as a unit, the coefficient parity value of the last position in the coding order of every 16 coefficients can be hidden. When it is hidden, the hidden coefficient parity value should be derived from the absolute values ​​of other coefficients in the current coefficient group.

[0398] It should also be noted that when parity hiding is performed in coefficient groups, a group size different from that used in related techniques can be used. For example, a group size of 4, 8, 32, 64, or... coefficients can be used. Alternatively, the group size can be applied only to parity hiding, or it can be applied to both parity hiding and related techniques.

[0399] It is understood that in the embodiment of the present application, the hidden coefficient parity value is derived by using the absolute values ​​of other coefficients. Here, the hidden coefficient parity value can be determined by using the parity property of the sum of the absolute values ​​of other coefficients. In some embodiments, determining the coefficient parity value of a preset position based on the sum of the absolute values ​​of the coefficients may include: determining the coefficient parity value of the preset position based on the parity property of the sum of the absolute values ​​of the coefficients.

[0400] In a specific embodiment, determining the parity value of the coefficient at a preset position based on the parity characteristics of the absolute value and value of the coefficients may include: if the absolute value and value of the coefficients is an odd number, determining the parity value of the coefficient at the preset position to be a third value; if the absolute value and value of the coefficients is an even number, determining the parity value of the coefficient at the preset position to be a fourth value.

[0401] It should be noted that in the embodiment of the present application, the third value is different from the fourth value. For example, the third value can be set to 1, and the fourth value can be set to 0. That is, if the absolute value sum of the coefficients is an odd number, then it can be determined that the coefficient at the preset position is also an odd number, and the parity value of the coefficient at the preset position can be set to 1; if the absolute value sum of the coefficients is an even number, then it can be determined that the coefficient at the preset position is also an even number, and the parity value of the coefficient at the preset position can be set to 0.

[0402] In another specific embodiment, determining the coefficient parity value of the preset position according to the coefficient absolute value sum value may include: performing an AND operation on the coefficient absolute value sum value and 1 to determine the coefficient parity value of the preset position.

[0403] It should be noted that, assuming that the absolute value and value of the coefficients can be expressed by sum_abs_tb, the parity value of the coefficients at the preset position can be obtained by (sum_abs_tb&1).

[0404] It can also be understood that in the embodiment of the present application, the use of the parity hiding technology can be mutually exclusive with the implicit transform selection, and the parity characteristics of one or more coefficients in the current block that is not applicable to the implicit transform selection are hidden. In addition, for the current block using the implicit transform selection, some coefficients are used to adjust the parity characteristics satisfied by the implicit transform selection, while another part of the coefficients are used to hide the parity characteristics of one or more coefficients, so that the parity characteristics of the coefficients in the current block can satisfy both the parity hiding technology and the implicit transform selection.

[0405] In some embodiments, the method may further include: when the current sequence allows the use of the parity concealment mode or the current image allows the use of the parity concealment mode, the transform mode information of the current block does not meet the first preset usage condition, and the number of non-zero coefficients in the current scanning area of ​​the current block except for a preset position exceeds a first threshold, determining that the concealment mode parameter indicates that the parity concealment mode is enabled for the current block.

[0406] In a specific embodiment, the transformation mode information of the current block does not meet the first preset use condition, which may include: the current block uses an implicit transformation selection mode; or the current block uses a sub-block transformation mode.

[0407] That is, in an embodiment of the present application, if the current block uses the IST mode or the SBT mode, the current block can also use the parity hiding technology. When the high-level syntax element indicates that the parity hiding mode is allowed, and the current block uses the IST mode or the SBT mode, and there are more than N non-zero coefficients in the current scanning area of ​​the current block except for the preset position, then it can be determined that the parity hiding mode is enabled for the current block. Where N represents a first threshold, and illustratively, the value of N can be set to 3.

[0408] In some embodiments, when the current block uses an implicit transform selection mode or a sub-block transform mode, the method may further include: dividing the current block into coefficient groups to determine at least two coefficient groups of the current block; determining that there is at least one candidate coefficient group in the at least two coefficient groups and the parity hiding mode is not enabled, and enabling the parity hiding mode for the remaining coefficient groups other than the at least one candidate coefficient group.

[0409] It should be noted that in the embodiment of the present application, the current scanning area is based on coefficient groups. For the current block using the IST mode or the SBT mode, the parity hiding mode can be enabled for only some of the coefficient groups. The parity hiding technology will not be used for the other coefficient groups regardless of whether they meet the conditions for enabling the parity hiding mode.

[0410] It should also be noted that, in the embodiment of the present application, assuming that there is only one coefficient group that does not use the parity hiding technology, the last coefficient group of the current block in the scanning order can be determined as at least one candidate coefficient group.

[0411] That is to say, for the current block using the IST mode or the SBT mode, different operations will be performed on each group of 16 coefficients divided from the current block according to the scanning order when decoding the coefficients. No matter how many non-zero coefficients there are in the last coefficient group in the scanning order, the parity hiding technology will not be used.

[0412] In another possible implementation, the current coefficient group is any one of the remaining coefficient groups other than the at least one candidate coefficient group. For the last position of the current coefficient group in the scan order, the absolute values ​​of the other coefficients in the current coefficient group may also be used to derive the hidden coefficient parity value. Here, the hidden coefficient parity value may be determined by using the parity property of the sum of the absolute values ​​of the other coefficients. In some embodiments, determining the sum of the absolute values ​​of the coefficients in the current scan area of ​​the current block, excluding a preset position, may include: when the current scan area is the current coefficient group of the current block, determining the preset position as the last position of the current coefficient group in the scan order; and summing the absolute values ​​of the coefficients in the current coefficient group, excluding the last position, to determine the sum of the absolute values ​​of the coefficients.

[0413] It should also be noted that in an embodiment of the present application, the absolute values ​​of the coefficients except the last position in the current coefficient group are summed to determine the absolute value and value of the coefficients. Alternatively, the absolute values ​​of the non-zero coefficients except the last position in the current coefficient group are summed to determine the absolute value and value of the coefficients.

[0414] It should also be noted that, in the embodiment of the present application, determining the coefficient parity value of the preset position based on the coefficient absolute value sum value may include: determining the coefficient parity value of the preset position based on the parity characteristic of the coefficient absolute value sum value. Alternatively, performing an AND operation on the coefficient absolute value sum value and 1 to determine the coefficient parity value of the preset position.

[0415] In a specific embodiment, determining the parity value of the coefficient at a preset position based on the parity characteristics of the absolute value and value of the coefficients may include: if the absolute value and value of the coefficients is an odd number, determining the parity value of the coefficient at the preset position to be a third value; if the absolute value and value of the coefficients is an even number, determining the parity value of the coefficient at the preset position to be a fourth value.

[0416] In the embodiment of the present application, the third value is different from the fourth value. For example, the third value can be set to 1, and the fourth value can be set to 0. That is, if the absolute value sum of the coefficients is an odd number, then it can be determined that the coefficient at the preset position is also an odd number, and the parity value of the coefficient at the preset position can be set to 1; if the absolute value sum of the coefficients is an even number, then it can be determined that the coefficient at the preset position is also an even number, and the parity value of the coefficient at the preset position can be set to 0.

[0417] S1404: Encode the absolute value of the initial coefficient at the preset position, and write the obtained coded bits into the bitstream.

[0418] It should be noted that in an embodiment of the present application, for the absolute value of the initial coefficient at the preset position, the encoding operation of the fourth grammar identification information, the fifth grammar identification information, the sixth grammar identification information and the residual absolute value of the initial coefficient at the preset position is introduced here to realize the encoding processing of the absolute value of the initial coefficient at the preset position.

[0419] In some embodiments, as shown in FIG15 , the method may include:

[0420] S1501: Determine whether the absolute value of the initial coefficient of the preset position is equal to 0.

[0421] S1502: Determine a value of fourth syntax identification information according to the absolute value of the initial coefficient at the preset position, perform encoding processing on the value of the fourth syntax identification information, and write the obtained encoding bits into the bitstream.

[0422] S1503 : When the absolute value of the initial coefficient at the preset position is not equal to 0, determine whether the absolute value of the initial coefficient at the preset position is equal to 1.

[0423] S1504: Determine a value of the fifth syntax identification information according to the absolute value of the initial coefficient at the preset position, perform encoding processing on the value of the fifth syntax identification information, and write the obtained encoding bits into the bitstream.

[0424] S1505 : When the absolute value of the initial coefficient at the preset position is greater than 1, determine whether the absolute value of the initial coefficient at the preset position is equal to 2.

[0425] S1506 , determining a value of the sixth syntax identification information according to the absolute value of the initial coefficient at the preset position, encoding the value of the sixth syntax identification information, and writing the obtained encoding bits into the bitstream.

[0426] S1507: When the absolute value of the initial coefficient at the preset position is greater than 2, determine the residual absolute value of the initial coefficient at the preset position according to the absolute value of the initial coefficient at the preset position, encode the residual absolute value of the initial coefficient at the preset position, and write the obtained coded bits into the bitstream.

[0427] It should be noted that, in an embodiment of the present application, whether the absolute value of the initial coefficient of the preset position is equal to 0, the value of the fifth grammar identification information indicates whether the absolute value of the initial coefficient of the preset position is greater than 1, and the value of the sixth grammar identification information indicates whether the absolute value of the initial coefficient of the preset position is greater than 2.

[0428] It should also be noted that, in the embodiment of the present application, determining the residual absolute value of the initial coefficient at the preset position based on the absolute value of the initial coefficient at the preset position may include: performing a subtraction operation on the absolute value of the initial coefficient at the preset position and 2 to determine the residual absolute value of the initial coefficient at the preset position. In other words, when the absolute value of the initial coefficient at the preset position is greater than 2, the portion of the initial coefficient absolute value exceeding 2 (i.e., the residual absolute value of the initial coefficient) may be encoded.

[0429] It should also be noted that, in the embodiment of the present application, the fourth syntax identification information can be represented by sig_flag_ph, and the value of the fourth syntax identification information indicates whether the absolute value of the initial coefficient at the preset position is equal to 0. If the absolute value of the initial coefficient at the preset position is equal to 0, then the value of the fourth syntax identification information can be determined to be equal to 0; if the absolute value of the initial coefficient at the preset position is not equal to 0, then the value of the fourth syntax identification information can be determined to be equal to 1, and the value of the fifth syntax identification information is further determined at this time.

[0430] It should also be noted that, in the embodiment of the present application, the fifth syntax identification information can be represented by coeff_abs_level_greater1_flag_ph, and the value of the fifth syntax identification information indicates whether the absolute value of the initial coefficient at the preset position is greater than 1. If the absolute value of the initial coefficient at the preset position is equal to 1, then the value of the fifth syntax identification information can be determined to be equal to 0; if the absolute value of the initial coefficient at the preset position is greater than 1, then the value of the fifth syntax identification information can be determined to be equal to 1, and the value of the sixth syntax identification information is further determined.

[0431] It should also be noted that, in the embodiment of the present application, the sixth syntax identification information can be represented by coeff_abs_level_greater2_flag_ph, and the value of the sixth syntax identification information indicates whether the absolute value of the initial coefficient at the preset position is greater than 2. If the absolute value of the initial coefficient at the preset position is equal to 2, then the value of the sixth syntax identification information can be determined to be equal to 0; if the absolute value of the initial coefficient at the preset position is greater than 2, then the value of the sixth syntax identification information can be determined to be equal to 1, and at this time, the residual absolute value of the initial coefficient at the preset position is further determined.

[0432] It should also be noted that, in the embodiment of the present application, the remaining absolute value of the initial coefficient can be represented by coeff_abs_level_remaining, which represents the part of the initial coefficient whose absolute value is greater than 2, and only exists when the value of coeff_abs_level_greater2_flag_ph is 1.

[0433] In some embodiments, the same context model can be used to encode sig_flag_ph, coeff_abs_level_greater1_flag_ph and coeff_abs_level_greater2_flag_ph of each coefficient. Taking the initial coefficient absolute value at a preset position as an example:

[0434] Encoding the value of the fourth syntax identification information and writing the obtained coded bits into the bitstream may include: encoding the value of the fourth syntax identification information based on a preset context model and writing the obtained coded bits into the bitstream.

[0435] Encoding the value of the fifth syntax identification information and writing the obtained coded bits into the bitstream may include: encoding the value of the fifth syntax identification information based on a preset context model and writing the obtained coded bits into the bitstream.

[0436] Encoding the value of the sixth syntax identification information and writing the obtained coded bits into the bitstream may include: encoding the value of the sixth syntax identification information based on a preset context model and writing the obtained coded bits into the bitstream.

[0437] It should also be noted that in this embodiment of the present application, both the initial coefficient absolute value at a preset position within the current scan area and the coefficient absolute value at other positions can be encoded into the bitstream using sig_flag_ph, coeff_abs_level_greater1_flag_ph, and coeff_abs_level_greater2_flag_ph. Here, the same series of context models can be used to encode sig_flag_ph, coeff_abs_level_greater1_flag_ph, and coeff_abs_level_greater2_flag_ph for each coefficient.

[0438] In some embodiments, different context models may also be used to encode and decode sig_flag_ph, coeff_abs_level_greater1_flag_ph, and coeff_abs_level_greater2_flag_ph of each coefficient. Still taking the initial coefficient absolute value at a preset position as an example:

[0439] Encoding the value of the fourth syntax identification information and writing the obtained coded bits into the bitstream includes: encoding the value of the fourth syntax identification information based on the first context model and writing the obtained coded bits into the bitstream.

[0440] Encoding the value of the fifth syntax identification information and writing the obtained coded bits into the bitstream includes: encoding the value of the fifth syntax identification information based on the second context model and writing the obtained coded bits into the bitstream.

[0441] Encoding the value of the sixth syntax identification information and writing the obtained coded bits into the bitstream includes: encoding the value of the sixth syntax identification information based on the third context model and writing the obtained coded bits into the bitstream.

[0442] The first context model, the second context model and the third context model are different.

[0443] It should also be noted that, in the embodiment of the present application, regardless of the initial coefficient absolute value at a preset position in the current scanning area or the coefficient absolute value at other positions, due to the presence of hidden coefficient parity values, the encoded and decoded absolute value of the coefficient with the parity characteristics hidden is actually half of that without hiding, which makes the size distribution of the coefficient absolute values ​​of the hidden and non-hidden coefficient parity values ​​change a lot, so different context models can also be used here to encode and decode the sig_flag_ph, coeff_abs_level_greater1_flag_ph and coeff_abs_level_greater2_flag_ph of each coefficient.

[0444] In some embodiments, the method may also include: determining a first context index number, a second context index number, and a third context index number; and determining, based on a context model candidate list, a first context model corresponding to the first context index number, a second context model corresponding to the second context index number, and a third context model corresponding to the third context index number.

[0445] It should be noted that, in the embodiment of the present application, the context model candidate list may include multiple candidate context models, such as 8 candidate context models, 16 candidate context models, etc., which is not specifically limited here. In addition, the first context index number represents the number of the first context model in the context model candidate list, the second context index number represents the number of the second context model in the context model candidate list, and the third context index number represents the number of the third context model in the context model candidate list.

[0446] It should also be noted that, in an embodiment of the present application, determining the first context index number may include: determining the color component type of the current block and a first preset array; wherein the first preset array represents the absolute values ​​of the first p coefficients at a preset position in the scanning order within the current scanning area, and p is an integer greater than zero; determining the first context index number based on the color component type of the current block, the first preset array, and the position of the preset position within the current scanning area.

[0447] It should also be noted that, in an embodiment of the present application, determining the second context index number and the third context index number may include: determining the color component type of the current block and a second preset array; wherein the second preset array represents the absolute values ​​of the first q non-zero coefficients at a preset position in the scanning order within the current scanning area, and q is an integer greater than zero; determining the second context index number and the third context index number based on the color component type of the current block, the second preset array, and the position of the preset position within the current scanning area.

[0448] In the embodiment of the present application, the preset position is used as the current coefficient position in the scanning order. The first preset value can be represented by PreGt0[·], and the second preset value can be represented by PreGtX[·]. Assuming that the values ​​of p and q are equal to 5, then Pre5Gt0 is an array that is updated as the position changes, and stores whether the 5 positions before the preset position in the scanning order are non-zero coefficients. If they are non-zero, 1 is stored, and if they are zero, 0 is stored; Pre5GtX is an array that is updated as the position changes, and stores the absolute values ​​of the coefficients obtained at the 5 non-zero positions before the preset position in the scanning order. For example, if the absolute value of the non-zero coefficients obtained at the 5 non-zero positions is 1, 1 is stored, and if it is 2, 2 is stored.

[0449] In a possible implementation, assuming that the context model candidate list includes 8 candidate context models, for the first context index number, the following steps may be performed in sequence to determine the ctxIdxInc of sig_flag_ph:

[0450] --Set the value of ctxIdxInc to 0.

[0451] --If the current block is a chroma block, ctxIdxInc=ctxIdxInc+4.

[0452] --Let num_gt0 be the number of coefficients whose value of Pre5Gt0[j] is not zero in Pre5Gt0[j] (j=0-4), and ctxIdxInc be:

[0453] num_gt0 = Min(num_gt0, 3);

[0454] ctxIdxInc=ctxIdxInc+num_gt0.

[0455] For the second context index number and the third context index number, the following steps may be performed in sequence to determine the ctxIdxInc of coeff_abs_level_greater1_flag or coeff_abs_level_greater2_flag:

[0456] --Set the value of ctxIdxInc to 0.

[0457] --If the current block is a chroma block, ctxIdxInc=ctxIdxInc+4.

[0458] --Let the number of non-zero coefficients of Pre5GtX[j] (j=0~4) whose absolute values ​​are greater than k be num_gtX, k=1,2.

[0459] If what needs to be determined is ctxIndexInc of coeff_abs_level_greater1_flag, k is equal to 1.

[0460] If what needs to be determined is ctxIndexInc of coeff_abs_level_greater2_flag, k is equal to 2.

[0461] Among them, ctxIdxInc is:

[0462] num_gtX=Min(num_gtX,3);

[0463] ctxIdxInc=ctxIdxInc+num_gtX.

[0464] In another possible implementation, assuming that the context model candidate list includes 16 candidate context models, for the first context index number, the following steps may be performed in sequence to determine ctxIdxInc of sig_flag_ph:

[0465] --Set the value of ctxIdxInc to 0.

[0466] --If the current block is a chroma block, ctxIdxInc=ctxIdxInc+8.

[0467] --If the current coefficient position is not the upper left corner, ctxIdxInc=ctxIdxInc+4.

[0468] --Let num_gt0 be the number of coefficients whose value of Pre5Gt0[j] is not zero in Pre5Gt0[j] (j=0-4), and ctxIdxInc be:

[0469] num_gt0 = Min(num_gt0, 3);

[0470] ctxIdxInc=ctxIdxInc+num_gt0.

[0471] For the second context index number and the third context index number, the following steps may be performed in sequence to determine the ctxIdxInc of coeff_abs_level_greater1_flag or coeff_abs_level_greater2_flag:

[0472] --Set the value of ctxIdxInc to 0.

[0473] --If the current block is a chroma block, ctxIdxInc=ctxIdxInc+8.

[0474] --If the current coefficient position is not the upper left corner, ctxIdxInc=ctxIdxInc+4.

[0475] --Let the number of non-zero coefficients of Pre5GtX[j] (j=0~4) whose absolute values ​​are greater than k be num_gtX, k=1,2.

[0476] If what needs to be determined is ctxIndexInc of coeff_abs_level_greater1_flag, k is equal to 1.

[0477] If what needs to be determined is ctxIndexInc of coeff_abs_level_greater2_flag, k is equal to 2.

[0478] Among them, ctxIdxInc is:

[0479] num_gtX=Min(num_gtX,3);

[0480] ctxIdxInc=ctxIdxInc+num_gtX.

[0481] After encoding the absolute value of the initial coefficient at the preset position, the sign of the coefficient at the preset position may be determined, and then encoding may be performed on the sign of the coefficient.

[0482] In some embodiments, the method further includes: determining the sign of the coefficient at a preset position; when the absolute value of the initial coefficient at the preset position is not equal to 0, determining the value of the seventh grammar identification information based on the sign of the coefficient at the preset position; encoding the value of the seventh grammar identification information, and writing the obtained coded bits into the bitstream.

[0483] It should be noted that in this embodiment of the present application, the seventh syntax identification information can be represented by coeff_sign. If the absolute value of the coefficient currently being encoded is non-zero, then coeff_sign, which indicates the sign of the coefficient, will also be encoded into the bitstream. If the coefficient at the preset position is positive, the value of the seventh syntax identification information can be determined to be the first value; if the coefficient at the preset position is negative, the value of the seventh syntax identification information can be determined to be the second value.

[0484] In some embodiments, the method further includes: determining the sign of the coefficient at a preset position; determining the value of the eighth syntax identification information according to the sign of the coefficient at the preset position when the parity hiding mode is turned on for the current block and the absolute value of the target coefficient at the preset position is equal to 1; encoding the value of the eighth syntax identification information and writing the obtained coded bits into the bitstream.

[0485] It should also be noted that, in the embodiment of the present application, the eighth syntax identification information can be represented by coeff_sign_dc or coeff_sign_ph. Here, the eighth syntax identification information is used to indicate the positive or negative value of the coefficient at the preset position when the coefficient has a hidden parity characteristic and the absolute value of the actual coefficient is equal to 1. If the coefficient at the preset position is positive, the value of the eighth syntax identification information can be determined to be the first value; if the coefficient at the preset position is negative, the value of the eighth syntax identification information can be determined to be the second value.

[0486] For example, taking the case where the first value is set to 1 and the second value is set to 0, when the value of this symbol is 1, it indicates that the coefficient at the preset position is positive, otherwise when the value of this symbol is 0, it indicates a negative value. When this syntax element does not exist in the bitstream, it means that the coefficient at the preset position is 0 or its positive and negative values ​​have been completely encoded.

[0487] In another embodiment of the present application, a code stream is further provided, wherein the code stream is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following: the absolute value of the initial coefficient at a preset position in the current scanning area of ​​the current block, the residual absolute value of the initial coefficient at the preset position, the value of the first grammar identification information, the value of the second grammar identification information, the value of the third grammar identification information, the value of the fourth grammar identification information, the value of the fifth grammar identification information, the value of the sixth grammar identification information, the value of the seventh grammar identification information, and the value of the eighth grammar identification information.

[0488] In an embodiment of the present application, the value of the first syntax identification information indicates whether the current sequence allows the use of the parity hiding mode, the value of the second syntax identification information indicates whether the current image allows the use of the parity hiding mode, the value of the third syntax identification information indicates whether the current sequence allows the use of the coefficient coding mode based on the scanning area, the value of the fourth syntax identification information indicates whether the absolute value of the initial coefficient of the preset position is equal to 0, the value of the fifth syntax identification information indicates whether the absolute value of the initial coefficient of the preset position is greater than 1, the value of the sixth syntax identification information indicates whether the absolute value of the initial coefficient of the preset position is greater than 2, the value of the seventh syntax identification information indicates the positive or negative sign of the coefficient at the preset position when the absolute value of the initial coefficient at the preset position is not equal to 0, and the value of the eighth syntax identification information indicates the positive or negative sign of the coefficient at the preset position when the parity hiding mode is turned on for the current block and the absolute value of the target coefficient at the preset position is equal to 1.

[0489] An embodiment of the present application provides an encoding method for determining a hidden mode parameter for a current block; when the hidden mode parameter indicates that the current block is in parity hiding mode, determining a target coefficient absolute value for a preset position within a current scanning area of ​​the current block; determining an initial coefficient absolute value for the preset position based on the target coefficient absolute value; encoding the initial coefficient absolute value for the preset position, and writing the resulting encoded bits into a bitstream. Thus, when the hidden mode parameter indicates that the current block is in parity hiding mode, the parity characteristics of the coefficients at the preset position within the current scanning area can be hidden. In this case, the actual coefficient absolute value at the preset position is no longer encoded, and only the initial coefficient absolute value (e.g., half of the actual coefficient absolute value) at the preset position needs to be encoded. This method not only saves bit rate and improves encoding and decoding efficiency, but also improves encoding and decoding performance.

[0490] In another embodiment of the present application, based on the coding and decoding method described in the aforementioned embodiment, it is proposed to use the parity characteristics of some coefficients to represent the parity of another part of the coefficients in the case of SRCC coefficient encoding. This means that the coefficients represented by parity only need to encode and decode part of them to derive the complete coefficients.

[0491] For example, if the parity represented by the partial coefficients is p, then the absolute value of the coefficients encoded and decoded in the bitstream (absCoef b ) is half of the absolute value of the actual coefficient (absCoef), as follows: absCoef b =absCoef>>1 (6)

[0492] The absolute value of the coefficients encoded and decoded in the code stream (absCoef b ) The process of deriving the absolute value of the actual coefficient (absCoef) is: (absCoef) = (absCoef b <<1)+p (7)

[0493] In encoding and decoding absCoef b When , you can still use significant flag, greater than 1 flag, greater than 2 flag and remainder to represent it, and whether to encode and decode the sign depends on whether absCoef is non-zero instead of judging based on the value of significant flag.

[0494] (1) Parity hiding in units of transform blocks or coefficient groups.

[0495] Parity hiding can be performed on a per-block basis, meaning the parity of one coefficient can be hidden within each block, or on a per-coefficient group basis, meaning the parity of one coefficient can be hidden within each coefficient group. When using a per-block basis, the parity of the coefficient in the upper-left corner of the block can be hidden under certain conditions. When hidden, the hidden parity should be derived from the characteristics of the other coefficients within the block, for example, by using the parity of the sum of the absolute values ​​of the other coefficients to represent the hidden parity. When using a per-coefficient group basis, in AVS3 or EVM, the encoding and decoding of coefficients within a block are divided into groups of 16 coefficients. Similar to using a per-block basis, the parity of the last coefficient in decoding order of each of the 16 coefficients can be hidden under certain conditions. When hidden, the hidden parity should be derived from the characteristics of the other coefficients in the current coefficient group, for example, by using the parity of the sum of the absolute values ​​of the other coefficients to represent the hidden parity. When hiding parity by coefficient group, a group size different from the existing grouping can also be used, for example, every 4, or 8, or 32, or 64... coefficients as a group. The group size can be applied only to parity hiding, or it can be used for parity hiding and the original coefficient coding group at the same time.

[0496] (2) High-level syntax of parity hiding technology.

[0497] In terms of high-level syntax, the parity hiding technology proposed here can have independent sequence-level or image-level identification. An example similar to the AVS3 second-stage standard text is shown in Table 1.

[0498] The parity hiding technology enable flag ph_enable_flag in the sequence header is a binary variable. A value of '1' indicates that the current sequence can use the parity hiding technology; a value of '0' indicates that the current sequence should not use the parity hiding technology. The value of PhEnableFlag is equal to ph_enable_flag.

[0499] Regarding the parity hiding enable flag picture_ph_enable_flag of the picture header, in AVS, the picture header is divided into intra-frame picture header and inter-frame picture header. Since the parity hiding technology can be used on any type of coded frame, both intra-frame and inter-frame picture headers can have the picture header identifier of the parity hiding technology. The intra-frame picture header is shown in Table 2, and the inter-frame picture header is shown in Table 3.

[0500] Here, the picture-level parity hiding enable flag, picture_ph_enable_flag, is also a binary variable. A value of '1' indicates that parity hiding can be used for the current picture; a value of '0' indicates that parity hiding should not be used for the current picture. The value of PicturePhEnableFlag is equal to the value of picture_ph_enable_flag. If picture_ph_enable_flag is not present in the bitstream, the value of PicturePhEnableFlag is 0.

[0501] In addition, in some embodiments, there may be no picture-level parity hiding technology enable flag. In this case, when using high-level syntax elements to limit whether each block can use parity hiding technology, the PicturePhEnableFlag is no longer obtained based on the picture_ph_enable_flag syntax element, but a variable is determined based on the value of the sequence-level identifier to limit whether the block level is allowed to use parity hiding technology.

[0502] (3) Enabling and disabling parity hiding technology and other technologies.

[0503] (1) When the SRCC identifier of the sequence header is 0, the parity hiding technology proposed in the embodiment of the present application is not enabled.

[0504] (2) When the SRCC identifier of the sequence header is 1 and the IST identifier of the sequence header or the picture header is 0, the parity hiding technology proposed in the embodiment of the present application can judge and hide the parity of each transform block or each coefficient group. For example, when there are more than N non-zero coefficients in each transform block or coefficient group, or the scanning position distance between the first non-zero coefficient and the last non-zero coefficient is greater than N, the parity value of the coefficient at the upper left corner of the transform block or the last position in the scanning order in the coefficient group is hidden.

[0505] (3) When the SRCC identifier of the sequence header is 1, the IST identifier of the sequence header or picture header is 1, and the sequence header or picture header identifier associated with the ISTS is 0, the parity hiding technology can be enabled using the methods described in the following implementations 1, 2, and 3. It should be noted that this content refers to the tool activation status under CTC, with SRCC and IST enabled and ISTS disabled.

[0506] (4) When the SRCC identifier of the sequence header is 1, the IST identifier of the sequence header or picture header is 1, and the sequence header or picture header identifier associated with the ISTS is 1, the parity hiding technology should be turned off.

[0507] (4) Implementation plan

[0508] For (2) and (3) above, the parity hiding technology can be enabled in the manner of Implementation Options 1, 2, and 3. Each implementation option may include encoding and decoding using a separate context model for hiding parity coefficients, and encoding and decoding using a separate context model.

[0509] Implementation Plan 1.

[0510] Since AVS3 and the reference software EVM include the IST technology, the parity hiding technology is only used on blocks and components to which IST, ISTS, and SBT are not applicable.

[0511] For example, on AVS3 and EVM, the conditions for using IST are:

[0512] (1) The sequence-level IST flag is 1, and the sequence-level and image-level transform skip flags are 0.

[0513] (2) When the current block is an intra block, the block size is less than 64×64, otherwise it is less than 32×32.

[0514] (3) and the current block is a luminance block,

[0515] (4) and the current block does not use the (intra DT) partitioning technique of partitioning the CU into multiple PUs,

[0516] (5) And the scan region of the current block is smaller than 16×16.

[0517] Exemplarily, the conditions for the current block to use the parity hiding technique are as follows:

[0518] (1) The parity hiding technique of the current sequence header / image header should be turned on and

[0519] (2) The current block is a chroma block, or at least one side of the scan region of the current block (SRx or SRy) is greater than or equal to 16 and the current block has no

[0520] Use sub-block partitioning (SBT), or the current block uses the (intra DT) partitioning technology that divides the CU into multiple PUs,

[0521] (3) The current block has more than N non-zero coefficients (N is equal to 3 in this scheme) at positions other than the upper left corner.

[0522] In one possible implementation, when it is confirmed that the parity hiding technology is turned on in the current block, the current block can hide the parity of the coefficient at the upper left corner, and the parity of the sum of the absolute values ​​of the coefficients at positions other than the upper left corner will be used to represent the parity of the coefficient at the upper left corner.

[0523] In some embodiments, the specific process of parsing the current block is shown in Table 4. The current block here is the transform block.

[0524] Table 4

[0525] It should be noted that isPhApply is a variable for determining whether the current block can use the parity hiding technology. When its value is 1 and the number of non-zero coefficients num_nz_tb also meets the requirements, the current block hides the parity of the coefficient at the upper left corner.

[0526] It should also be noted that isIstApply is a variable indicating whether parity is used for implicit transformation selection mode in the current block. 0 indicates that parity is not used for implicit transformation selection mode, otherwise parity is used for implicit transformation selection mode. tbPart is a variable indicating whether intraDT is used. 0 indicates that the transformation block does not use intraDT, otherwise it indicates that intraDT is used. SbtCuFlag is a variable indicating whether SBT is used. 0 indicates that SBT is not used, otherwise it indicates that SBT is used. In addition, (!isIstApply&&!SbtCuFlag) indicates that the coefficient parity of the embodiment of the present application is mutually exclusive with the activation of Ist and Sbt; N in Table 4 is a condition for confirming whether the parity hiding technology is used in the embodiment of the present application. When there are more than N non-zero coefficients in non-upper left corner positions, the parity of the upper left corner coefficient is hidden.

[0527] It should also be noted that for the positive and negative flag coeff_sign_dc of the upper left corner coefficient, coeff_sign_dc is used to resolve the positive and negative values ​​of the coefficient when the upper left corner coefficient is a hidden parity coefficient and the absolute value of the actual coefficient is equal to 1. The parsing process is shown in Table 4 above. When the sign is 1, it is positive, and when it is 0, it is negative. When this syntax element does not exist in the bitstream, it means that the upper left corner coefficient is 0 or its positive and negative values ​​have been fully resolved. Then, the quantized coefficients are decoded in the above manner and then inversely transformed to obtain the residual coefficients, and the reconstruction process is completed subsequently.

[0528] In the above description, regardless of whether the coefficient in the top-left corner of the current block contains a hidden coefficient parity value, the same set of context models is used to encode and decode the sig flag, gt1 flag, and gt2 flag for each coefficient. However, in some embodiments, because the absolute value of the encoded and decoded top-left coefficient when containing a hidden parity value is actually half that of the unhidden coefficient, this significantly changes the distribution of coefficient sizes between those with and without hidden parity values. Therefore, different context models can be used to encode and decode the sig flag, gt1 flag, and gt2 flag for coefficients with hidden parity values. For example, eight context models can be used to encode and decode the sig flag for coefficients with hidden parity values, and eight context models can be used to encode and decode the gt1 flag and gt2 flag for coefficients with hidden parity values. The process for decoding the coefficients is shown in Table 5.

[0529] Table 5

[0530] It should be noted that SbtCuFlag is a variable indicating whether the current block uses the SBT technology, and isIstApply is a variable indicating whether the current block uses the IST technology.

[0531] It should also be noted that in Table 5, the syntax elements sig_flag_ph, coeff_abs_level_greater1_flag_ph, and coeff_abs_level_greater2_flag_ph are introduced to indicate the upper left corner coefficient for hiding the parity value. The sigflag, gt1flag, and gt2flag here are the syntax elements used in encoding and decoding. They and the original sig_flag, coeff_abs_level_greater1_flag, and coeff_abs_level_greater2_flag use different upper and lower module models for encoding and decoding. The process of deriving the context model index is as follows:

[0532] Follow these steps to determine the ctxIdxInc of sig_flag_ph:

[0533] ——Let the value of ctxIdxInc be 0.

[0534] If the current block is a chroma coded block, ctxIdxInc = ctxIdxInc + 4.

[0535] ——Let the number of non-zero values ​​of Pre5Gt0[j] in Pre5Gt0[j] (j=0-4) be num_gt0, then ctxIdxInc is calculated as follows:

[0536] num_gt0 = Min(num_gt0, 3);

[0537] ctxIdxInc=ctxIdxInc+num_gt0.

[0538] Follow these steps to determine the ctxIdxInc of coeff_abs_level_greater1_flag or coeff_abs_level_greater2_flag:

[0539] ——Let the value of ctxIdxInc be 0.

[0540] - If the current block is a chroma block, ctxIdxInc=ctxIdxInc+4.

[0541] Let the number of Pre5GtX[j] (j=0~4) whose absolute value is greater than k be num_gtX, k=1,2.

[0542] ——If ctxIndexInc of coeff_abs_level_greater1_flag needs to be determined, k is equal to 1.

[0543] ——If the ctxIndexInc of coeff_abs_level_greater2_flag needs to be determined, k is equal to 2.

[0544] The calculation of ctxIdxInc is as follows:

[0545] num_gtX=Min(num_gtX,3);

[0546] ctxIdxInc=ctxIdxInc+num_gtX.

[0547] Here, the aforementioned Pre5Gt0 is an array that is updated as the position changes, and stores whether the 5 positions before the current scan position in the current scan order are non-zero coefficients. If non-zero, it stores 1, and if zero, it stores 0. The aforementioned Pre5GtX is an array that is updated as the position changes, and stores the absolute values ​​of the 5 non-zero coefficients before the current position in the current scan order. For example, if the absolute value of the non-zero coefficient obtained at the 5 positions is 1, 1 is stored, and if it is 2, 2 is stored.

[0548] Implementation Plan 2.

[0549] Among them, Implementation Plan 1 describes a method for hiding the parity value of the upper left corner coefficient of the current block. In addition to hiding the parity value of only one coefficient, the parity of one coefficient can also be hidden for each coefficient group consisting of 16 coefficients according to the structure of AVS or EVM. The activation conditions are similar to Implementation Plan 1.

[0550] Exemplarily, the conditions for using the parity hiding technique for the current block are as follows:

[0551] (1) The parity hiding technique of the current sequence header / image header should be turned on and

[0552] (2) The current block is a chroma block, or at least one side of the scan region of the current block (SRx or SRy) is greater than or equal to 16 and the current block has no

[0553] Use sub-block transform (SBT), or the current block uses the (intra DT) partitioning technique that divides the CU into multiple PUs,

[0554] (3) The current coefficient group has more than N non-zero coefficients (N is equal to 3 in this scheme) in a non-last position in the scanning order.

[0555] In another possible implementation, when it is confirmed that the parity hiding technology is turned on in the current transform block, the current block can hide the parity of the coefficient at the last position in the scanning order in each coefficient group, and its parity is equal to the parity of the sum of the absolute values ​​of the coefficients at other positions in the group.

[0556] In some embodiments, the specific process of parsing the current block is shown in Table 6.

[0557] Table 6

[0558] It should be noted that isPhApply is a variable for determining whether the current block can use the parity hiding technology. When it is 1 and the number of non-zero coefficients num_nz_cg also meets the requirements, the current coefficient group contains a coefficient with hidden parity, and its position is at the end of the coefficient group scanning order.

[0559] It should also be noted that isIstApply is a variable indicating whether parity is used for implicit transformation selection mode in the current block. 0 indicates that parity is not used for implicit transformation selection mode, otherwise parity is used for implicit transformation selection mode. tbPart is a variable indicating whether intraDT is used. 0 indicates that the transformation block does not use intraDT, otherwise it indicates that intraDT is used. SbtCuFlag is a variable indicating whether SBT is used. 0 indicates that SBT is not used, otherwise it indicates that SBT is used. In addition, N in Table 6 is a condition for confirming whether parity hiding technology is used in an embodiment of the present application. When there are more than N non-zero coefficients in the last position of the non-scanning order, the parity of the coefficient in the last position of the scanning order is hidden.

[0560] In the above description, regardless of whether the last coefficient in the scan order of each coefficient in the current block contains a hidden parity value, the same set of context models is used to encode and decode the sig flag, gt1 flag, and gt2 flag for each coefficient. However, in some embodiments, when parity is hidden, the absolute value of the last coefficient in the scan order of the current coefficient group being encoded and decoded is actually half of that when parity is not hidden. This significantly changes the size distribution of coefficients with and without hidden parity values. Therefore, different context models can be used to encode and decode the sig flag, gt1 flag, and gt2 flag for coefficients with hidden parity values. For example, 16 context models can be used to encode and decode the sig flag of coefficients with hidden parity values, and 16 context models can be used to encode and decode the gt1 and gt2 flags of coefficients with hidden parity values. The process of decoding the coefficients is shown in Table 7.

[0561] Table 7

[0562] It should be noted that SbtCuFlag is a variable indicating whether the current block uses the SBT technology, and isIstApply is a variable indicating whether the current block uses the IST technology.

[0563] It should also be noted that in Table 7, the syntax elements sig_flag_ph, coeff_abs_level_greater1_flag_ph, and coeff_abs_level_greater2_flag_ph are introduced to indicate the coefficient at the last position in the scanning order for hiding the parity value. The sigflag, gt1flag, and gt2flag here are the syntax elements used in encoding and decoding. They and the original sig_flag, coeff_abs_level_greater1_flag, and coeff_abs_level_greater2_flag use different upper and lower module models for encoding and decoding. The process of deriving the context model index is as follows:

[0564] Follow these steps to determine the ctxIdxInc of sig_flag_ph:

[0565] ——Let the value of ctxIdxInc be 0.

[0566] ——If the current block is a chroma block, ctxIdxInc=ctxIdxInc+8.

[0567] ——If the current coefficient position is not the upper left corner, ctxIdxInc=ctxIdxInc+4.

[0568] ——Let the number of non-zero values ​​of Pre5Gt0[j] in Pre5Gt0[j] (j=0-4) be num_gt0, then ctxIdxInc is calculated as follows:

[0569] num_gt0 = Min(num_gt0, 3);

[0570] ctxIdxInc=ctxIdxInc+num_gt0.

[0571] Follow these steps to determine the ctxIdxInc of coeff_abs_level_greater1_flag or coeff_abs_level_greater2_flag:

[0572] ——Let the value of ctxIdxInc be 0.

[0573] - If the current block is a chroma block, ctxIdxInc=ctxIdxInc+8.

[0574] ——If the current coefficient position is not the upper left corner, ctxIdxInc=ctxIdxInc+4.

[0575] Let the number of Pre5GtX[j] (j=0~4) whose absolute value is greater than k be num_gtX, k=1,2.

[0576] ——If ctxIndexInc of coeff_abs_level_greater1_flag needs to be determined, k is equal to 1.

[0577] ——If the ctxIndexInc of coeff_abs_level_greater2_flag needs to be determined, k is equal to 2.

[0578] The calculation of ctxIdxInc is as follows:

[0579] num_gtX=Min(num_gtX,3);

[0580] ctxIdxInc=ctxIdxInc+num_gtX.

[0581] Implementation Plan 3.

[0582] Among them, implementation plans 1 and 2 mutually exclude the use of parity hiding technology and implicit transform selection, and hide the potential parity value of one or more coefficients on the transform block where implicit transform selection is not applicable. In implementation plan 3, based on implementation plans 1 and 2, for the current block using implicit transform selection, some coefficients are used to adjust the parity satisfied by the implicit transform selection, while the other part of the coefficients are used to hide the parity of one or more coefficients, so that the parity characteristics of the coefficients in the current block satisfy both the parity hiding technology and the implicit transform selection. This is not limited to implicit transform selection IST, it can also be sub-block transform SBT. However, no matter under what circumstances the ISTS mode is turned on, it cannot coexist with the parity hiding mode.

[0583] Exemplarily, implementation scheme 3 performs different operations on the current block selected using implicit transformation, based on the scanning order of the decoded coefficients, on each group of 16 coefficients divided from the current block. No matter how many non-zero coefficients there are in the last coefficient group in the scanning order, parity hiding technology will not be used.

[0584] In some embodiments, the specific process of parsing the current block is shown in Table 8.

[0585] Table 8

[0586] It should be noted that isPhApply is a variable that determines whether the current block can use the parity hiding technology. When it is 1 and the number of non-zero coefficients num_nz_cg also meets the requirements and the current coefficient group is not the last coefficient group in the case of IST and SBT, the current block hides the parity of the last coefficient in the scanning order within the current coefficient group.

[0587] It should also be noted that (IstApply||SbtCuflag)&&i==0) is different from Implementation 2 and is used to determine whether the coefficient group is the last group and whether IST or SBT is used. In addition, N in Table 8 is a condition for determining whether the parity hiding technology is used in this embodiment of the application. When there are more than N non-zero coefficients that are not in the last position in the scan order, the parity of the coefficient in the last position in the scan order is hidden.

[0588] In the above description, regardless of whether the last coefficient in the scan order of each coefficient in the current block contains a hidden parity value, the same set of context models is used to encode and decode the sig flag, gt1 flag, and gt2 flag for each coefficient. However, in some embodiments, because the absolute value of the encoded and decoded coefficients with hidden parity values ​​is actually half that of the coefficients without hidden parity values, this significantly changes the distribution of the coefficient sizes between those with and without hidden parity values. Therefore, different context models can be used to encode and decode the sig flag, gt1 flag, and gt2 flag for coefficients with hidden parity values. For example, 16 context models can be used to encode and decode the sig flag for coefficients with hidden parity values, and 16 context models can be used to encode and decode the gt1 and gt2 flags for coefficients with hidden parity values. The process of decoding the coefficients is shown in Table 9.

[0589] Table 9

[0590] It should be noted that in Table 9, the syntax elements sig_flag_ph, coeff_abs_level_greater1_flag_ph, and coeff_abs_level_greater2_flag_ph are introduced to indicate the coefficient at the last position in the scanning order for hiding the parity value. The sigflag, gt1flag, and gt2flag here are the syntax elements used in encoding and decoding. They and the original sig_flag, coeff_abs_level_greater1_flag, and coeff_abs_level_greater2_flag use different upper and lower module models for encoding and decoding. The process of deriving the context model index is as follows:

[0591] Follow these steps to determine the ctxIdxInc of sig_flag_ph:

[0592] ——Let the value of ctxIdxInc be 0.

[0593] ——If the current block is a chroma block, ctxIdxInc=ctxIdxInc+8.

[0594] ——If the current coefficient position is not the upper left corner, ctxIdxInc=ctxIdxInc+4.

[0595] ——Let the number of non-zero values ​​of Pre5Gt0[j] in Pre5Gt0[j] (j=0-4) be num_gt0, then ctxIdxInc is calculated as follows:

[0596] num_gt0 = Min(num_gt0, 3);

[0597] ctxIdxInc=ctxIdxInc+num_gt0.

[0598] Follow these steps to determine the ctxIdxInc of coeff_abs_level_greater1_flag or coeff_abs_level_greater2_flag:

[0599] ——Let the value of ctxIdxInc be 0.

[0600] - If the current block is a chroma block, ctxIdxInc=ctxIdxInc+8.

[0601] ——If the current coefficient position is not the upper left corner, ctxIdxInc=ctxIdxInc+4.

[0602] Let the number of Pre5GtX[j] (j=0~4) whose absolute value is greater than k be num_gtX, k=1,2.

[0603] ——If ctxIndexInc of coeff_abs_level_greater1_flag needs to be determined, k is equal to 1.

[0604] ——If the ctxIndexInc of coeff_abs_level_greater2_flag needs to be determined, k is equal to 2.

[0605] The calculation of ctxIdxInc is as follows:

[0606] num_gtX=Min(num_gtX,3);

[0607] ctxIdxInc=ctxIdxInc+num_gtX.

[0608] It should also be noted that in some implementation processes, when the transform block using IST or SBT technology further uses parity hiding technology, size limits can be further set. For example, when the SRCC area using IST or SBT block is larger than M (M is a positive integer), parity hiding technology can be turned on, and the parity of the coefficients for the last coefficient group is still not hidden.

[0609] In an embodiment of the present application, the method further includes: when the current sequence allows the use of the parity concealment mode or the current image allows the use of the parity concealment mode; and the current block does not use IST and the current block does not use SBT, or the current block uses IST or SBT and the current scanning area of ​​the current block is greater than M; and the number of non-zero coefficients in the current scanning area of ​​the current block except for a preset position exceeds a first threshold, it can be determined that the parity concealment mode is turned on for the current block.

[0610] In some embodiments, the specific process of parsing the current block is shown in Table 10.

[0611] Table 10

[0612] In the embodiment of the present application, in some cases, the size limitation of the SRCC may also be limited according to the width and / or height of the scanning area.

[0613] In some embodiments, the above implementations can be tested on the EVM reference software. Taking Implementation 1 as an example, when using separate context model groups to encode and decode the coefficients of the hidden parity, the performance in the All-intra configuration is shown in Table 11, and the performance in the Random-access configuration is shown in Table 12.

[0614] Table 11

[0615] Table 12

[0616] The test results show that since Implementation 1 mostly uses parity hiding technology on chroma blocks, the overall BD-rate improvement also appears in the UV component of chroma, while the encoding EncT and decoding DecT times are not much different from the reference software.

[0617] Taking Implementation 2 as an example, using a separate context model group to encode and decode coefficients for parity concealment, the performance achieved in the all-intra configuration is shown in Table 13. The test results show that, similar to Implementation 1, parity concealment is mostly used on chroma blocks, so the overall BD-rate improvement also occurs in the chroma UV component.

[0618] Table 13

[0619] In the embodiments of the present application, the specific implementation of the aforementioned embodiments is described in detail through the above embodiments. It can be seen that according to the technical solutions of the aforementioned embodiments, on the one hand, this technical solution proposes a method for using parity hiding technology in the SRCC encoding and decoding mode, specifically how to use parity hiding technology when SRCC, IST, and ISTS are turned on or off. On the other hand, when parity hiding technology is allowed, according to the methods of implementation schemes 1, 2, and 3, the parity values ​​of one or more coefficients can be hidden in units of transform blocks or coefficient groups, and the same or different context model groups can be used to encode and decode the sigflag, gt1flag, and gt2flag of the hidden parity coefficients. Therefore, for the parity characteristics of the coefficients at the hidden position, the actual absolute value of the coefficients at the hidden position is no longer encoded. Only the initial absolute value of the coefficients at the hidden position (for example, half of the actual absolute value of the coefficients) needs to be encoded and decoded. Then, the decoding end can derive the complete actual absolute value of the coefficients based on the hidden coefficient parity characteristics. This not only saves bit rate and improves encoding and decoding efficiency, but also improves encoding and decoding performance.

[0620] In yet another embodiment of the present application, based on the same inventive concept as the aforementioned embodiment, FIG16 is a schematic diagram of the composition structure of an encoder provided in an embodiment of the present application. As shown in FIG16 , the encoder 160 includes a first determination unit 1601 and an encoding unit 1602, wherein:

[0621] A first determining unit 1601 is configured to determine a concealment mode parameter of a current block; when the concealment mode parameter indicates that the current block enables an even-odd concealment mode, determine an absolute value of a target coefficient at a preset position within a current scanning area of ​​the current block; and further configured to determine an absolute value of an initial coefficient at the preset position based on the absolute value of the target coefficient;

[0622] The encoding unit 1602 is configured to perform encoding processing on the absolute value of the initial coefficient at a preset position, and write the obtained encoding bits into the bit stream.

[0623] In some embodiments, the first determining unit 1601 is further configured to perform a right shift operation on the absolute value of the target coefficient to determine the absolute value of the initial coefficient at a preset position.

[0624] In some embodiments, the first determining unit 1601 is further configured to determine the absolute values ​​and values ​​of coefficients in the current scanning area of ​​the current block except for a preset position, and determine the parity value of the coefficients at the preset position according to the absolute values ​​and values ​​of the coefficients.

[0625] In some embodiments, the first determination unit 1601 is further configured to determine the absolute value of the intermediate coefficient of the preset position based on the absolute value of the target coefficient and the parity value of the coefficient of the preset position; and set the initial absolute value of the preset position to half of the absolute value of the intermediate coefficient of the preset position.

[0626] In some embodiments, the first determining unit 1601 is further configured to determine a concealment mode parameter of the current block, including at least one of the following: determining whether the current sequence allows the use of the parity concealment mode; determining whether the current image allows the use of the parity concealment mode; determining whether the transform mode information of the current block meets a first preset usage condition; determining whether the number of non-zero coefficients in a current scanning area of ​​the current block, excluding a preset position, exceeds a first threshold; wherein the current sequence includes the current image, and the current image includes the current block.

[0627] In some embodiments, the first determining unit 1601 is further configured to, when the current sequence allows the use of the parity concealment mode or the current image allows the use of the parity concealment mode, the transform mode information of the current block meets the first preset usage condition, and the number of non-zero coefficients in the current scanning area of ​​the current block except for the preset position exceeds the first threshold, determine that the concealment mode parameter indicates that the parity concealment mode is enabled for the current block.

[0628] In some embodiments, the transformation mode information of the current block satisfies a first preset usage condition, including: the type of the current block is a first color component block; or, at least one side length of the current scanning area of ​​the current block is greater than or equal to a second threshold and the current block does not use a sub-block transformation mode; or, the current block uses an intra-frame derivative mode.

[0629] In some embodiments, the transformation mode information of the current block meets the first preset usage condition, including: the current block does not use the implicit transformation selection mode; the current block does not use the implicit transformation skip selection mode; the current block does not use the sub-block transformation mode.

[0630] In some embodiments, the first determination unit 1601 is further configured to determine that the value of the first syntax identification information is a first value when the current sequence allows the use of the parity hiding mode; and to determine that the value of the first syntax identification information is a second value when the current sequence does not allow the use of the parity hiding mode.

[0631] In some embodiments, the encoding unit 1602 is further configured to perform encoding processing on the value of the first syntax identification information, and write the obtained encoding bits into the bitstream.

[0632] In some embodiments, the first determination unit 1601 is further configured to determine that the value of the second grammar identification information is a first value when the current image allows the use of the parity hiding mode; and to determine that the value of the second grammar identification information is a second value when the current image does not allow the use of the parity hiding mode.

[0633] In some embodiments, the encoding unit 1602 is further configured to perform encoding processing on the value of the second syntax identification information, and write the obtained encoding bits into the bitstream.

[0634] In some embodiments, the first determination unit 1601 is further configured to determine a value of third grammar identification information; wherein the value of the third grammar identification information indicates whether the current sequence allows the use of a coefficient coding mode based on a scan area; and encode the value of the third grammar identification information, and write the obtained coded bits into the bitstream.

[0635] In some embodiments, the first determination unit 1601 is further configured to determine that the value of the third grammar identification information is a first value when the current sequence allows the use of a coefficient coding mode based on a scan area; and to determine that the value of the third grammar identification information is a second value when the current sequence does not allow the use of a coefficient coding mode based on a scan area.

[0636] In some embodiments, the first determination unit 1601 is further configured to perform a step of determining hidden mode parameters of the current block when the current sequence allows the use of a coefficient coding mode based on a scan area; wherein the current sequence includes the current image, and the current image includes the current block.

[0637] In some embodiments, the first determination unit 1601 is further configured to, when the current sequence allows the use of a coefficient coding mode based on a scan area, if the current sequence does not allow the use of an implicit transform selection mode, execute the step of determining hidden mode parameters of the current block.

[0638] In some embodiments, the first determination unit 1601 is further configured to, when the current sequence allows the use of a coefficient coding mode based on a scan area, if the current sequence allows the use of an implicit transform selection mode and the current image does not allow the use of an implicit transform skip selection mode, perform the step of determining the hidden mode parameters of the current block.

[0639] In some embodiments, the first determination unit 1601 is further configured to, when the current sequence allows the use of a coefficient coding mode based on a scan area, if the current sequence allows the use of an implicit transform selection mode and the current image allows the use of an implicit transform skip selection mode, determine that the current block turns off the parity hiding mode.

[0640] In some embodiments, the first determining unit 1601 is further configured to determine whether to disable the parity concealment mode for the current block when the current sequence does not allow the use of the coefficient coding technology based on the scan area.

[0641] In some embodiments, the first determination unit 1601 is further configured to determine the preset position as the upper left corner position of the current block when the current scanning area is the entire area of ​​the current block; and perform a sum operation on the absolute values ​​of the coefficients in the current block except the upper left corner position to determine the sum of the absolute values ​​of the coefficients.

[0642] In some embodiments, the first determination unit 1601 is further configured to, when the current scanning area is the current coefficient group of the current block, determine the preset position as the last position of the current coefficient group in the scanning order; and perform a sum operation on the absolute values ​​of the coefficients in the current coefficient group except the last position to determine the sum of the absolute values ​​of the coefficients.

[0643] In some embodiments, the first determining unit 1601 is further configured to divide the current block into coefficient groups to determine at least two coefficient groups of the current block; wherein the current coefficient group is any one of the at least two coefficient groups.

[0644] In some embodiments, the first determining unit 1601 is further configured to, when the current sequence allows the use of the parity concealment mode or the current image allows the use of the parity concealment mode, the transform mode information of the current block does not meet the first preset usage condition, and the number of non-zero coefficients in the current scanning area of ​​the current block except for the preset position exceeds the first threshold, determine that the concealment mode parameter indicates that the parity concealment mode is enabled for the current block.

[0645] In some embodiments, the transformation mode information of the current block does not meet the first preset use condition, including: the current block uses an implicit transformation selection mode; or the current block uses a sub-block transformation mode.

[0646] In some embodiments, the first determination unit 1601 is further configured to divide the current block into coefficient groups to determine at least two coefficient groups of the current block; and if there is at least one candidate coefficient group in the at least two coefficient groups and the parity hiding mode is not enabled, the parity hiding mode is enabled for the remaining coefficient groups other than the at least one candidate coefficient group.

[0647] In some embodiments, the first determining unit 1601 is further configured to determine the last coefficient group of the current block in the scanning order as the at least one candidate coefficient group.

[0648] In some embodiments, the first determination unit 1601 is further configured to, when the current scanning area is the current coefficient group of the current block, determine the preset position as the last position of the current coefficient group in the scanning order; perform a sum operation on the absolute values ​​of the coefficients in the current coefficient group except the last position to determine the sum of the absolute values ​​of the coefficients; wherein the current coefficient group is any one of the remaining coefficient groups other than at least one candidate coefficient group.

[0649] In some embodiments, the first determining unit 1601 is further configured to determine the parity value of the coefficient at a preset position according to the parity characteristics of the coefficient absolute value and value.

[0650] In some embodiments, the first determination unit 1601 is further configured to determine the coefficient parity value of the preset position as a third value if the absolute value sum of the coefficients is an odd number; and to determine the coefficient parity value of the preset position as a fourth value if the absolute value sum of the coefficients is an even number.

[0651] In some embodiments, the first determining unit 1601 is further configured to perform an AND operation on the absolute value of the coefficient and 1 to determine the parity value of the coefficient at a preset position.

[0652] In some embodiments, the first determination unit 1601 is further configured to determine a value of the fourth grammar identification information based on the absolute value of the initial coefficient at the preset position; wherein the value of the fourth grammar identification information indicates whether the absolute value of the initial coefficient at the preset position is equal to 0; the encoding unit 1602 is further configured to encode the value of the fourth grammar identification information and write the obtained coded bits into the bitstream.

[0653] In some embodiments, the first determination unit 1601 is further configured to determine the value of the fifth grammar identification information based on the absolute value of the initial coefficient at the preset position when the absolute value of the initial coefficient at the preset position is not equal to 0; wherein the value of the fifth grammar identification information indicates whether the absolute value of the initial coefficient at the preset position is greater than 1; the encoding unit 1602 is further configured to encode the value of the fifth grammar identification information and write the obtained coded bits into the bitstream.

[0654] In some embodiments, the first determination unit 1601 is further configured to determine the value of the sixth grammar identification information based on the absolute value of the initial coefficient at the preset position when the absolute value of the initial coefficient at the preset position is greater than 1; wherein the value of the sixth grammar identification information indicates whether the absolute value of the initial coefficient at the preset position is greater than 2; the encoding unit 1602 is further configured to encode the value of the sixth grammar identification information and write the obtained coded bits into the bitstream.

[0655] In some embodiments, the first determination unit 1601 is further configured to determine the residual absolute value of the initial coefficient at the preset position based on the absolute value of the initial coefficient at the preset position when the absolute value of the initial coefficient at the preset position is greater than 2; the encoding unit 1602 is further configured to encode the residual absolute value of the initial coefficient at the preset position and write the obtained encoded bits into the bitstream.

[0656] In some embodiments, the first determining unit 1601 is further configured to perform a subtraction operation based on the absolute value of the initial coefficient at the preset position and 2 to determine the residual absolute value of the initial coefficient at the preset position.

[0657] In some embodiments, the encoding unit 1602 is further configured to encode the value of the fourth grammar identification information based on a preset context model, and write the obtained coded bits into the bitstream; encode the value of the fifth grammar identification information based on the preset context model, and write the obtained coded bits into the bitstream; and encode the value of the sixth grammar identification information based on the preset context model, and write the obtained coded bits into the bitstream.

[0658] In some embodiments, the encoding unit 1602 is further configured to encode the value of the fourth grammar identification information based on the first context model, and write the obtained coded bits into the bitstream; and encode the value of the fifth grammar identification information based on the second context model, and write the obtained coded bits into the bitstream; and encode the value of the sixth grammar identification information based on the third context model, and write the obtained coded bits into the bitstream; wherein the first context model, the second context model, and the third context model are different.

[0659] In some embodiments, the first determination unit 1601 is also configured to determine the first context index number, the second context index number and the third context index number; and determine the first context model corresponding to the first context index number, the second context model corresponding to the second context index number and the third context model corresponding to the third context index number based on the context model candidate list.

[0660] In some embodiments, the first determination unit 1601 is further configured to determine the color component type of the current block and a first preset array; wherein the first preset array represents the absolute values ​​of the first p coefficients located at a preset position in the scanning order within the current scanning area, and p is an integer greater than zero; and determine the first context index number based on the color component type of the current block, the first preset array, and the position of the preset position within the current scanning area.

[0661] In some embodiments, the first determination unit 1601 is further configured to determine the color component type of the current block and a second preset array; wherein the second preset array represents the absolute values ​​of the first q non-zero coefficients located at a preset position in the scanning order within the current scanning area, and q is an integer greater than zero; and determine the second context index number and the third context index number based on the color component type of the current block, the second preset array, and the position of the preset position within the current scanning area.

[0662] In some embodiments, the first determination unit 1601 is further configured to determine the sign of the coefficient at a preset position; and when the absolute value of the initial coefficient at the preset position is not equal to 0, determine the value of the seventh grammar identification information based on the sign of the coefficient at the preset position; the encoding unit 1602 is further configured to encode the value of the seventh grammar identification information and write the obtained coded bits into the bitstream.

[0663] In some embodiments, the first determination unit 1601 is further configured to determine the sign of the coefficient at a preset position; and when the parity hiding mode is turned on in the current block and the absolute value of the target coefficient at the preset position is equal to 1, the value of the eighth syntax identification information is determined according to the sign of the coefficient at the preset position; the encoding unit 1602 is further configured to encode the value of the eighth syntax identification information and write the obtained coded bits into the bitstream.

[0664] It is understandable that in the embodiments of the present application, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and of course it can also be a module, or it can be non-modular. Moreover, the various components in this embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional modules.

[0665] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, or the portion that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0666] Therefore, an embodiment of the present application provides a computer-readable storage medium, which is applied to the encoder 160. The computer-readable storage medium stores a computer program, and when the computer program is executed by the first processor, it implements the method described in any one of the aforementioned embodiments.

[0667] Based on the composition of the above-mentioned encoder 160 and the computer-readable storage medium, Figure 17 is a schematic diagram of the specific hardware structure of the encoder provided in an embodiment of the present application. As shown in Figure 17, the encoder 160 may include: a first communication interface 1701, a first memory 1702 and a first processor 1703; each component is coupled together through a first bus system 1704. It can be understood that the first bus system 1704 is used to achieve connection and communication between these components. In addition to the data bus, the first bus system 1704 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the first bus system 1704 in Figure 17. Among them,

[0668] The first communication interface 1701 is used to receive and send signals when sending and receiving information with other external network elements;

[0669] A first memory 1702 is used to store computer programs that can be run on the first processor 1703;

[0670] The first processor 1703 is configured to, when running the computer program, execute:

[0671] Determine a concealment mode parameter for the current block; when the concealment mode parameter indicates that the current block turns on the parity concealment mode, determine the absolute value of a target coefficient at a preset position within the current scanning area of ​​the current block; determine the absolute value of an initial coefficient at the preset position based on the absolute value of the target coefficient; encode the absolute value of the initial coefficient at the preset position, and write the obtained coded bits into a bitstream.

[0672] It is understood that the first memory 1702 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The first memory 1702 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0673] The first processor 1703 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by hardware integrated logic circuits or software instructions in the first processor 1703. The above-mentioned first processor 1703 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the first memory 1702 , and the first processor 1703 reads the information in the first memory 1702 and completes the steps of the above method in combination with its hardware.

[0674] It is to be understood that these embodiments described in the present application can be implemented with hardware, software, firmware, middleware, microcode or its combination.For hardware implementation, the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing equipment (DSP Device, DSPD), programmable logic device (Programmable Logic Device, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, other electronic units for performing functions described in the present application or its combination.For software implementation, the technology described in the present application can be realized by the module (such as process, function etc.) that performs functions described in the present application. The software code can be stored in a memory and executed by a processor. The memory can be implemented in a processor or outside a processor.

[0675] Optionally, as another embodiment, the first processor 1703 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.

[0676] This embodiment provides an encoder. For this encoder, when the hidden mode parameter indicates that the current block turns on the parity hiding mode, the parity characteristics of the coefficients at the preset positions in the current scanning area can be hidden. At this time, the actual coefficient absolute value of the preset position is no longer encoded. Only the initial coefficient absolute value of the preset position (for example, half of the actual coefficient absolute value) needs to be encoded and decoded. Then, the decoding end can derive the complete actual coefficient absolute value in combination with the hidden coefficient parity characteristics. This not only saves bit rate and improves encoding and decoding efficiency, but also improves encoding and decoding performance.

[0677] In yet another embodiment of the present application, based on the same inventive concept as the aforementioned embodiment, FIG18 is a schematic diagram of the composition structure of a decoder provided in an embodiment of the present application. As shown in FIG18 , the decoder 180 includes a second determination unit 1801 and a decoding unit 1802, wherein:

[0678] The second determining unit 1801 is configured to determine a concealment mode parameter of the current block; when the concealment mode parameter indicates that the current block turns on the parity concealment mode, determine the absolute values ​​and values ​​of the coefficients in the current scanning area of ​​the current block except for the preset position, and determine the parity value of the coefficients in the preset position according to the absolute values ​​and values ​​of the coefficients;

[0679] The decoding unit 1802 is configured to decode the code stream and determine the absolute value of the initial coefficient at a preset position;

[0680] The second determining unit 1801 is further configured to determine a target coefficient absolute value at the preset position according to the initial coefficient absolute value at the preset position and the coefficient parity value at the preset position.

[0681] In some embodiments, the second determining unit 1801 is further configured to determine the concealment mode parameters of the current block, including at least one of the following: determining whether the current sequence allows the use of the parity concealment mode; determining whether the current image allows the use of the parity concealment mode; determining whether the transform mode information of the current block meets a first preset usage condition; determining whether the number of non-zero coefficients in the current scanning area of ​​the current block except for a preset position exceeds a first threshold; wherein the current sequence includes the current image, and the current image includes the current block.

[0682] In some embodiments, the second determining unit 1801 is further configured to, when the current sequence allows the use of the parity concealment mode or the current image allows the use of the parity concealment mode, the transform mode information of the current block meets the first preset usage condition, and the number of non-zero coefficients in the current scanning area of ​​the current block except for the preset position exceeds the first threshold, determine that the concealment mode parameter indicates that the parity concealment mode is enabled for the current block.

[0683] In some embodiments, the transformation mode information of the current block satisfies a first preset usage condition, including: the current block is a first color component block; or, at least one side length of the current scanning area of ​​the current block is greater than or equal to a second threshold and the current block does not use a sub-block transformation mode; or, the current block uses an intra-frame derivative mode.

[0684] In some embodiments, the transformation mode information of the current block meets the first preset usage condition, including: the current block does not use the implicit transformation selection mode; the current block does not use the implicit transformation skip selection mode; the current block does not use the sub-block transformation mode.

[0685] In some embodiments, the decoding unit 1802 is further configured to decode the code stream and determine the value of the first syntax identification information; the second determination unit 1801 is further configured to determine that the current sequence allows the use of the parity hiding mode when the value of the first syntax identification information is the first value; and determine that the current sequence part allows the use of the parity hiding mode when the value of the first syntax identification information is the second value.

[0686] In some embodiments, the decoding unit 1802 is further configured to decode the code stream and determine the value of the second syntax identification information; the second determination unit 1801 is further configured to determine that the current image allows the use of the parity hiding mode when the value of the second syntax identification information is a first value; and determine that the current image part allows the use of the parity hiding mode when the value of the second syntax identification information is a second value.

[0687] In some embodiments, the decoding unit 1802 is further configured to decode the code stream and determine the value of the third syntax identification information; the second determination unit 1801 is further configured to perform the step of determining the hidden mode parameters of the current block when the value of the third syntax identification information indicates that the current sequence allows the use of a coefficient coding mode based on a scan area; wherein the current sequence includes the current image, and the current image includes the current block.

[0688] In some embodiments, the second determination unit 1801 is further configured to, when the value of the third syntax identification information indicates that the current sequence allows the use of a coefficient coding mode based on a scan area, if the current sequence does not allow the use of an implicit transform selection mode, perform the step of determining the hidden mode parameters of the current block.

[0689] In some embodiments, the second determination unit 1801 is further configured to, when the value of the third syntax identification information indicates that the current sequence allows the use of a coefficient coding mode based on a scan area, if the current sequence allows the use of an implicit transform selection mode and the current image does not allow the use of an implicit transform skip selection mode, perform the step of determining the hidden mode parameters of the current block.

[0690] In some embodiments, the second determination unit 1801 is further configured to, when the value of the third syntax identification information indicates that the current sequence allows the use of a coefficient coding mode based on a scan area, if the current sequence allows the use of an implicit transform selection mode and the current image allows the use of an implicit transform skip selection mode, determine that the current block turns off the parity hiding mode.

[0691] In some embodiments, the second determining unit 1801 is further configured to determine whether the parity concealment mode is disabled for the current block when the value of the third syntax identification information indicates that the current sequence does not allow the use of the coefficient coding technology based on the scan area.

[0692] In some embodiments, the second determination unit 1801 is further configured to determine that the current sequence allows the use of a coefficient coding mode based on a scan area when the value of the third grammar identification information is a first value; and to determine that the current sequence does not allow the use of a coefficient coding mode based on a scan area when the value of the third grammar identification information is a second value.

[0693] In some embodiments, the second determination unit 1801 is further configured to determine the preset position as the upper left corner position of the current block when the current scanning area is the entire area of ​​the current block; and to perform a sum operation on the absolute values ​​of the coefficients in the current block except the upper left corner position to determine the sum of the absolute values ​​of the coefficients.

[0694] In some embodiments, the second determination unit 1801 is further configured to, when the current scanning area is the current coefficient group of the current block, determine the preset position as the last position of the current coefficient group in the scanning order; and perform a sum operation on the absolute values ​​of the coefficients in the current coefficient group except the last position to determine the sum of the absolute values ​​of the coefficients.

[0695] In some embodiments, the second determining unit 1801 is further configured to divide the current block into coefficient groups to determine at least two coefficient groups of the current block; wherein the current coefficient group is any one of the at least two coefficient groups.

[0696] In some embodiments, the second determining unit 1801 is further configured to, when the current sequence allows the use of the parity concealment mode or the current image allows the use of the parity concealment mode, the transform mode information of the current block does not meet the first preset usage condition, and the number of non-zero coefficients in the current scanning area of ​​the current block except for the preset position exceeds the first threshold, determine that the concealment mode parameter indicates that the parity concealment mode is enabled for the current block.

[0697] In some embodiments, the transformation mode information of the current block does not meet the first preset use condition, including: the current block uses an implicit transformation selection mode; or the current block uses a sub-block transformation mode.

[0698] In some embodiments, the second determination unit 1801 is further configured to divide the current block into coefficient groups to determine at least two coefficient groups of the current block; and if there is at least one candidate coefficient group in the at least two coefficient groups and the parity hiding mode is not enabled, the parity hiding mode is enabled for the remaining coefficient groups other than the at least one candidate coefficient group.

[0699] In some embodiments, the second determining unit 1801 is further configured to determine the last coefficient group of the current block in the scanning order as the at least one candidate coefficient group.

[0700] In some embodiments, the second determination unit 1801 is further configured to, when the current scanning area is the current coefficient group of the current block, determine the preset position as the last position of the current coefficient group in the scanning order; and perform a sum operation on the absolute values ​​of the coefficients in the current coefficient group except the last position to determine the sum of the absolute values ​​of the coefficients; wherein the current coefficient group is any one of the remaining coefficient groups other than the at least one candidate coefficient group.

[0701] In some embodiments, the second determining unit 1801 is further configured to determine the parity value of the coefficient at a preset position according to the parity characteristics of the coefficient absolute value and value.

[0702] In some embodiments, the second determination unit 1801 is further configured to determine the parity value of the coefficient at the preset position as a third value if the absolute value sum of the coefficients is an odd number; and to determine the parity value of the coefficient at the preset position as a fourth value if the absolute value sum of the coefficients is an even number.

[0703] In some embodiments, the second determining unit 1801 is further configured to perform an AND operation on the absolute value of the coefficient and 1 to determine the parity value of the coefficient at a preset position.

[0704] In some embodiments, the decoding unit 1802 is further configured to decode the code stream and determine a value of fourth syntax identification information; when the value of the fourth syntax identification information indicates that the absolute value of the initial coefficient at the preset position is not equal to 0, decode the code stream and determine a value of the fifth syntax identification information; when the value of the fifth syntax identification information indicates that the absolute value of the initial coefficient at the preset position is greater than 1, decode the code stream and determine a value of the sixth syntax identification information; and when the value of the sixth syntax identification information indicates that the absolute value of the initial coefficient at the preset position is greater than 2, decode the code stream and determine a residual absolute value of the initial coefficient at the preset position; the second determining unit 1801 is further configured to perform an addition operation based on the residual absolute value of the initial coefficient at the preset position and 2 to determine the absolute value of the initial coefficient at the preset position.

[0705] In some embodiments, the decoding unit 1802 is further configured to decode the bitstream based on a preset context model to determine a value of the fourth grammar identification information; when the value of the fourth grammar identification information indicates that the absolute value of the initial coefficient at the preset position is not equal to 0, decode the bitstream based on the preset context model to determine a value of the fifth grammar identification information; and when the value of the fifth grammar identification information indicates that the absolute value of the initial coefficient at the preset position is greater than 1, decode the bitstream based on the preset context model to determine a value of the sixth grammar identification information.

[0706] In some embodiments, the decoding unit 1802 is further configured to decode the code stream based on the first context model to determine a value of fourth grammar identification information; when the value of the fourth grammar identification information indicates that the absolute value of the initial coefficient at the preset position is not equal to 0, decode the code stream based on the second context model to determine a value of fifth grammar identification information; and when the value of the fifth grammar identification information indicates that the absolute value of the initial coefficient at the preset position is greater than 1, decode the code stream based on the third context model to determine a value of sixth grammar identification information; wherein the first context model, the second context model, and the third context model are different.

[0707] In some embodiments, the second determination unit 1801 is further configured to determine the first context index number, the second context index number, and the third context index number; and determine the first context model corresponding to the first context index number, the second context model corresponding to the second context index number, and the third context model corresponding to the third context index number according to the context model candidate list.

[0708] In some embodiments, the second determination unit 1801 is further configured to determine the color component type of the current block and a first preset array; wherein the first preset array represents the absolute values ​​of the first p coefficients located at a preset position in the scanning order within the current scanning area, and p is an integer greater than zero; and determine the first context index number based on the color component type of the current block, the first preset array, and the position of the preset position within the current scanning area.

[0709] In some embodiments, the second determination unit 1801 is further configured to determine the color component type of the current block and a second preset array; wherein the second preset array represents the absolute values ​​of the first q non-zero coefficients located at a preset position in the scanning order within the current scanning area, and q is an integer greater than zero; and determine the second context index number and the third context index number based on the color component type of the current block, the second preset array, and the position of the preset position within the current scanning area.

[0710] In some embodiments, the second determining unit 1801 is further configured to perform a left shift operation on the initial coefficient absolute value of the preset position to determine the intermediate coefficient absolute value of the preset position; and determine the target coefficient absolute value of the preset position according to the intermediate coefficient absolute value of the preset position and the coefficient parity value of the preset position.

[0711] In some embodiments, the second determining unit 1801 is further configured to set the absolute value of the intermediate coefficient of the preset position to twice the absolute value of the initial coefficient of the preset position.

[0712] In some embodiments, the second determining unit 1801 is further configured to perform a sum operation on the absolute value of the intermediate coefficient at the preset position and the coefficient parity value at the preset position to determine the absolute value of the target coefficient at the preset position.

[0713] In some embodiments, the second determining unit 1801 is further configured to determine the sign of the coefficient of the preset position; and determine the target coefficient of the preset position according to the absolute value of the target coefficient of the preset position and the sign of the coefficient of the preset position.

[0714] In some embodiments, the decoding unit 1802 is further configured to decode the code stream and determine the value of the seventh grammar identification information when the absolute value of the initial coefficient at the preset position is not equal to 0; the second determination unit 1801 is further configured to determine the positive or negative sign of the coefficient at the preset position based on the value of the seventh grammar identification information.

[0715] In some embodiments, the decoding unit 1802 is further configured to decode the code stream and determine the value of the eighth syntax identification information when the parity hiding mode is turned on for the current block and the absolute value of the target coefficient at the preset position is equal to 1; the second determination unit 1801 is further configured to determine the positive or negative sign of the coefficient at the preset position according to the value of the eighth syntax identification information.

[0716] It is understood that in this embodiment, a "unit" can be a portion of a circuit, a portion of a processor, a portion of a program or software, etc., and can also be a module or a non-modular system. Furthermore, the various components in this embodiment can be integrated into a single processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The aforementioned integrated units can be implemented in the form of hardware or software functional modules.

[0717] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, this embodiment provides a computer-readable storage medium for use in decoder 180. The computer-readable storage medium stores a computer program that, when executed by a second processor, implements any of the methods described in the aforementioned embodiments.

[0718] Based on the composition of the above-mentioned decoder 180 and the computer-readable storage medium, Figure 19 is a schematic diagram of the specific hardware structure of the decoder provided in an embodiment of the present application. As shown in Figure 19, the decoder 180 may include: a second communication interface 1901, a second memory 1902 and a second processor 1903; each component is coupled together through a second bus system 1904. It can be understood that the second bus system 1904 is used to achieve connection and communication between these components. In addition to the data bus, the second bus system 1904 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as the second bus system 1904 in Figure 19. Among them,

[0719] The second communication interface 1901 is used for sending and receiving signals during the process of sending and receiving information between other external network elements;

[0720] The second memory 1902 is used to store computer programs that can be run on the second processor 1903;

[0721] The second processor 1903 is configured to, when running the computer program, execute:

[0722] Determine the hidden mode parameters of the current block; when the hidden mode parameters indicate that the current block turns on the parity hidden mode, determine the absolute values ​​and values ​​of the coefficients in the current scanning area of ​​the current block except for the preset position, and determine the parity value of the coefficients at the preset position according to the absolute values ​​and values ​​of the coefficients; decode the code stream, determine the initial absolute value of the coefficients at the preset position; determine the target absolute value of the coefficients at the preset position according to the initial absolute value of the coefficients at the preset position and the parity value of the coefficients at the preset position.

[0723] Optionally, as another embodiment, the second processor 1903 is further configured to execute any one of the methods described in the foregoing embodiments when running the computer program.

[0724] It can be understood that the hardware functions of the second memory 1902 are similar to those of the first memory 1702, and the hardware functions of the second processor 1903 are similar to those of the first processor 1703; they will not be described in detail here.

[0725] This embodiment provides a decoder. For this decoder, when the hidden mode parameter indicates that the current block turns on the parity hiding mode, the parity characteristics of the coefficients at the preset positions in the current scanning area can be hidden. At this time, the actual coefficient absolute value of the preset position is no longer encoded. Only the initial coefficient absolute value of the preset position (for example, half of the actual coefficient absolute value) needs to be encoded and decoded. Then, the decoding end can derive the complete actual coefficient absolute value in combination with the hidden coefficient parity characteristics. This not only saves bit rate and improves encoding and decoding efficiency, but also improves encoding and decoding performance.

[0726] In yet another embodiment of the present application, FIG20 is a schematic diagram of the composition structure of a coding and decoding system provided in an embodiment of the present application. As shown in FIG20 , the coding and decoding system 2000 may include an encoder 2001 and a decoder 2002 .

[0727] In the embodiment of the present application, the encoder 2001 may be the encoder described in any one of the aforementioned embodiments, and the decoder 2002 may be the decoder described in any one of the aforementioned embodiments.

[0728] It should be noted that, in this application, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0729] The serial numbers of the above embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

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

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

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

[0733] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims. Industrial Applicability

[0734] In an embodiment of the present application, at the encoding end, the concealment mode parameters of the current block are determined; when the concealment mode parameters indicate that the current block turns on the parity concealment mode, the target coefficient absolute value of a preset position within the current scanning area of ​​the current block is determined; based on the target coefficient absolute value, the initial coefficient absolute value of the preset position is determined; the initial coefficient absolute value of the preset position is encoded, and the resulting encoded bits are written into the bitstream. At the decoding end, the concealment mode parameters of the current block are determined; when the concealment mode parameters indicate that the current block turns on the parity concealment mode, the absolute values ​​and values ​​of the coefficients within the current scanning area of ​​the current block other than the preset position are determined, and the coefficient parity value of the preset position is determined based on the absolute values ​​and values ​​of the coefficients; the bitstream is decoded to determine the initial coefficient absolute value of the preset position; and the target coefficient absolute value of the preset position is determined based on the initial coefficient absolute value of the preset position and the coefficient parity value of the preset position. In this way, both the encoding end and the decoding end can first determine the hidden mode parameters of the current block, and then, when the hidden mode parameters indicate that the current block turns on the parity hiding mode, the parity characteristics of the coefficients at the preset positions in the current scanning area can be hidden. At this time, the actual coefficient absolute value of the preset position is no longer encoded, and only the initial coefficient absolute value of the preset position (for example, half of the actual coefficient absolute value) needs to be encoded and decoded. Then, the decoding end can derive the complete actual coefficient absolute value based on the hidden coefficient parity characteristics. This not only saves bit rate and improves encoding and decoding efficiency, but also improves encoding and decoding performance.

Claims

1. A decoding method, applied to a decoder, the method comprises: Determine the hidden mode parameter of the current block; When the hidden mode parameter indicates that the current block enables the parity hidden mode, determine the sum of absolute values of coefficients in the current scan area of the current block except for the preset position, and determine the parity value of the coefficient at the preset position according to the sum of absolute values of coefficients; Decode the bitstream to determine the initial absolute value of the coefficient at the preset position; Determine the target absolute value of the coefficient at the preset position according to the initial absolute value of the coefficient at the preset position and the parity value of the coefficient at the preset position.

2. The method according to claim 1, wherein, The determination of the hidden mode parameter of the current block includes at least one of the following: Determine whether the current sequence allows the use of the parity hidden mode; Determine whether the current image allows the use of the parity hidden mode; Determine whether the transform mode information of the current block meets the first preset usage condition; Determine whether the number of non-zero coefficients in the current scan area of the current block except for the preset position exceeds the first threshold; Wherein, the current sequence includes the current image, and the current image includes the current block.

3. The method according to claim 2, wherein, The method further includes: When the current sequence allows the use of the parity hidden mode or the current image allows the use of the parity hidden mode, and the transform mode information of the current block meets the first preset usage condition, and the number of non-zero coefficients in the current scan area of the current block except for the preset position exceeds the first threshold, determine that the hidden mode parameter indicates that the current block enables the parity hidden mode.

4. The method according to claim 3, wherein, The transform mode information of the current block meets the first preset usage condition, including: The current block is a first color component block; or, At least one side length of the current scan area of the current block is greater than or equal to the second threshold and the current block does not use the sub-block transform mode; or, The current block uses the intra-derived mode.

5. The method according to claim 3, wherein, The transform mode information of the current block meets the first preset usage condition, including: The current block does not use the implicit transform selection mode; The current block does not use the implicit transform skip selection mode; The current block does not use the sub-block transform mode.

6. The method according to claim 2, wherein, The determination of whether the current sequence allows the use of the parity hidden mode includes: Decode the bitstream to determine the value of the first syntax identification information; When the value of the first syntax identification information is the first value, determine that the current sequence allows the use of the parity hidden mode; When the value of the first syntax identification information is the second value, determine that the current sequence does not allow the use of the parity hidden mode.

7. The method according to claim 2, wherein, The determination of whether the current image allows the use of the parity hidden mode includes: Decode the bitstream to determine the value of the second syntax identification information; When the value of the second syntax identification information is the first value, determine that the current image allows the use of the parity hidden mode; When the value of the second syntax identification information is the second value, it is determined that the current image part allows the use of the odd-even hiding mode.

8. The method according to claim 1, wherein, the method further includes: decoding the bitstream to determine the value of the third syntax identification information; when the value of the third syntax identification information indicates that the current sequence allows the use of the coefficient coding mode based on the scanned area, performing the step of determining the hiding mode parameter of the current block; wherein, the current sequence includes the current image, and the current image includes the current block.

9. The method according to claim 8, wherein, the method further includes: when the value of the third syntax identification information indicates that the current sequence allows the use of the coefficient coding mode based on the scanned area, if the current sequence does not allow the use of the implicit transform selection mode, performing the step of determining the hiding mode parameter of the current block.

10. The method according to claim 8, wherein, the method further includes: when the value of the third syntax identification information indicates that the current sequence allows the use of the coefficient coding mode based on the scanned area, if the current sequence allows the use of the implicit transform selection mode and the current image does not allow the use of the implicit transform skip selection mode, performing the step of determining the hiding mode parameter of the current block.

11. The method according to claim 8, wherein, the method further includes: when the value of the third syntax identification information indicates that the current sequence allows the use of the coefficient coding mode based on the scanned area, if the current sequence allows the use of the implicit transform selection mode and the current image allows the use of the implicit transform skip selection mode, determining that the current block turns off the odd-even hiding mode.

12. The method according to claim 8, wherein, the method further includes: when the value of the third syntax identification information indicates that the current sequence does not allow the use of the coefficient coding technology based on the scanned area, determining that the current block turns off the odd-even hiding mode.

13. The method according to claim 8, wherein, the method further includes: when the value of the third syntax identification information is the first value, determining that the current sequence allows the use of the coefficient coding mode based on the scanned area; when the value of the third syntax identification information is the second value, determining that the current sequence does not allow the use of the coefficient coding mode based on the scanned area.

14. The method according to any one of claims 1 to 13, wherein, the determining of the sum of the absolute values of the coefficients in the current scanned area of the current block except for the preset position includes: when the current scanned area is the entire area of the current block, determining that the preset position is the upper left corner position of the current block; performing a summation operation on the absolute values of the coefficients in the current block except for the upper left corner position to determine the sum of the absolute values of the coefficients.

15. The method according to any one of claims 1 to 13, wherein, the determining of the sum of the absolute values of the coefficients in the current scanned area of the current block except for the preset position includes: When the current scanning area is the current coefficient group of the current block, determine that the preset position is the last position of the current coefficient group in the scanning order; Perform a summation operation on the absolute values of the coefficients in the current coefficient group except for the last position to determine the sum value of the absolute values of the coefficients.

16. The method according to claim 15, wherein, the method further includes: Perform coefficient group partitioning on the current block to determine at least two coefficient groups of the current block; wherein, the current coefficient group is any one of the at least two coefficient groups.

17. The method according to claim 2, wherein, the method further includes: When the current sequence allows the use of the parity hiding mode or the current image allows the use of the parity hiding mode, and the transform mode information of the current block does not meet the first preset usage condition, and the number of non-zero coefficients in the current scanning area of the current block except for the preset position exceeds the first threshold, determine that the hidden mode parameter indicates that the current block enables the parity hiding mode.

18. The method according to claim 17, wherein, the transform mode information of the current block not meeting the first preset usage condition includes: The current block uses the implicit transform selection mode; or, The current block uses the sub-block transform mode.

19. The method according to claim 18, wherein, the method further includes: Perform coefficient group partitioning on the current block to determine at least two coefficient groups of the current block; When at least one of the at least two coefficient groups does not enable the parity hiding mode, enable the parity hiding mode for the remaining coefficient groups other than the at least one candidate coefficient group.

20. The method according to claim 19, wherein, the method further includes: Determine the last coefficient group of the current block in the scanning order as the at least one candidate coefficient group.

21. The method according to claim 19, wherein, the determining the sum value of the absolute values of the coefficients in the current scanning area of the current block except for the preset position includes: When the current scanning area is the current coefficient group of the current block, determine that the preset position is the last position of the current coefficient group in the scanning order; Perform a summation operation on the absolute values of the coefficients in the current coefficient group except for the last position to determine the sum value of the absolute values of the coefficients; wherein, the current coefficient group is any one of the remaining coefficient groups other than the at least one candidate coefficient group.

22. The method according to claim 1, wherein, the determining the parity value of the coefficient at the preset position according to the sum value of the absolute values of the coefficients includes: Determine the parity value of the coefficient at the preset position according to the parity characteristic of the sum value of the absolute values of the coefficients.

23. The method according to claim 22, wherein, the determining the parity value of the coefficient at the preset position according to the parity characteristic of the sum value of the absolute values of the coefficients includes: If the sum value of the absolute values of the coefficients is odd, determine that the parity value of the coefficient at the preset position is the third value; If the sum value of the absolute values of the coefficients is even, determine that the parity value of the coefficient at the preset position is the fourth value.

24. The method according to claim 1, wherein, determining the coefficient parity value of the preset position according to the sum of the absolute values of the coefficients includes: performing an AND operation on the sum of the absolute values of the coefficients and 1 to determine the coefficient parity value of the preset position.

25. The method according to any one of claims 1 to 24, wherein, decoding the code stream to determine the initial absolute value of the coefficient at the preset position includes: decoding the code stream to determine the value of the fourth syntax identification information; when the value of the fourth syntax identification information indicates that the initial absolute value of the coefficient at the preset position is not equal to 0, decoding the code stream to determine the value of the fifth syntax identification information; when the value of the fifth syntax identification information indicates that the initial absolute value of the coefficient at the preset position is greater than 1, decoding the code stream to determine the value of the sixth syntax identification information; when the value of the sixth syntax identification information indicates that the initial absolute value of the coefficient at the preset position is greater than 2, decoding the code stream to determine the remaining absolute value of the initial coefficient at the preset position; performing an addition operation on the remaining absolute value of the initial coefficient at the preset position and 2 to determine the initial absolute value of the coefficient at the preset position.

26. The method according to claim 25, wherein, the method further includes: decoding the code stream based on a preset context model to determine the value of the fourth syntax identification information; when the value of the fourth syntax identification information indicates that the initial absolute value of the coefficient at the preset position is not equal to 0, decoding the code stream based on the preset context model to determine the value of the fifth syntax identification information; when the value of the fifth syntax identification information indicates that the initial absolute value of the coefficient at the preset position is greater than 1, decoding the code stream based on the preset context model to determine the value of the sixth syntax identification information.

27. The method according to claim 25, wherein, the method further includes: decoding the code stream based on a first context model to determine the value of the fourth syntax identification information; when the value of the fourth syntax identification information indicates that the initial absolute value of the coefficient at the preset position is not equal to 0, decoding the code stream based on a second context model to determine the value of the fifth syntax identification information; when the value of the fifth syntax identification information indicates that the initial absolute value of the coefficient at the preset position is greater than 1, decoding the code stream based on a third context model to determine the value of the sixth syntax identification information; wherein the first context model, the second context model, and the third context model are different from each other.

28. The method according to claim 27, wherein, the method further includes: determining a first context index number, a second context index number, and a third context index number; determining the first context model corresponding to the first context index number, the second context model corresponding to the second context index number, and the third context model corresponding to the third context index number according to a context model candidate list.

29. The method according to claim 28, wherein, determining the first context index number includes: Determine the color component type of the current block and a first preset array; wherein, the first preset array represents the absolute values of the first p coefficients in the scanning order in the current scanning area that are located at the preset position, and p is an integer greater than zero; Determine the first context index number according to the color component type of the current block, the first preset array, and the position of the preset position in the current scanning area.

30. The method according to claim 29, wherein, The determining the second context index number and the third context index number includes: Determine the color component type of the current block and a second preset array; wherein, the second preset array represents the absolute values of the first q non-zero coefficients in the scanning order in the current scanning area that are located at the preset position, and q is an integer greater than zero; Determine the second context index number and the third context index number according to the color component type of the current block, the second preset array, and the position of the preset position in the current scanning area.

31. The method according to claim 1, wherein, The determining the target coefficient absolute value of the preset position according to the initial coefficient absolute value of the preset position and the coefficient parity characteristic of the preset position includes: Perform a left shift operation on the initial coefficient absolute value of the preset position to determine the intermediate coefficient absolute value of the preset position; Determine the target coefficient absolute value of the preset position according to the intermediate coefficient absolute value of the preset position and the coefficient parity value of the preset position.

32. The method according to claim 31, wherein, The method further includes: Set the intermediate coefficient absolute value of the preset position to twice the initial coefficient absolute value of the preset position.

33. The method according to claim 31, wherein, The determining the target coefficient absolute value of the preset position according to the intermediate coefficient absolute value of the preset position and the coefficient parity value of the preset position includes: Perform a summation operation on the intermediate coefficient absolute value of the preset position and the coefficient parity value of the preset position to determine the target coefficient absolute value of the preset position.

34. The method according to any one of claims 1 to 33, wherein, The method further includes: Determine the coefficient positive and negative sign of the preset position; Determine the target coefficient of the preset position according to the target coefficient absolute value of the preset position and the coefficient positive and negative sign of the preset position.

35. The method according to claim 34, wherein, The determining the coefficient positive and negative sign of the preset position includes: When the initial coefficient absolute value of the preset position is not equal to 0, decode the code stream to determine the value of the seventh syntax identification information; Determine the coefficient positive and negative sign of the preset position according to the value of the seventh syntax identification information.

36. The method according to claim 34, wherein, The determining the coefficient positive and negative sign of the preset position includes: When the current block enables the parity hiding mode and the target coefficient absolute value of the preset position is equal to 1, decode the code stream to determine the value of the eighth syntax identification information; Determine the sign of the coefficient at the preset position according to the value of the eighth syntax identification information.

37. A coding method, applied to an encoder, the method comprises: Determine the hidden mode parameter of the current block; When the hidden mode parameter indicates that the current block enables the parity hidden mode, determine the absolute value of the target coefficient at the preset position within the current scan area of the current block; Determine the absolute value of the initial coefficient at the preset position according to the absolute value of the target coefficient; Perform coding processing on the absolute value of the initial coefficient at the preset position, and write the obtained coding bits into the code stream.

38. The method according to claim 37, wherein, the determining the absolute value of the initial coefficient at the preset position according to the absolute value of the target coefficient includes: Perform a right shift operation on the absolute value of the target coefficient to determine the absolute value of the initial coefficient at the preset position.

39. The method according to claim 37, wherein, the method further comprises: Determine the sum of the absolute values of the coefficients other than the preset position within the current scan area of the current block, and determine the parity value of the coefficient at the preset position according to the sum of the absolute values of the coefficients.

40. The method according to claim 39, wherein, the determining the absolute value of the initial coefficient at the preset position according to the absolute value of the target coefficient includes: Determine the absolute value of the intermediate coefficient at the preset position according to the absolute value of the target coefficient and the parity value of the coefficient at the preset position; Set the initial absolute value at the preset position to half of the absolute value of the intermediate coefficient at the preset position.

41. The method according to claim 39, wherein, the determining the hidden mode parameter of the current block includes at least one of the following: Determine whether the current sequence allows the use of the parity hidden mode; Determine whether the current image allows the use of the parity hidden mode; Determine whether the transform mode information of the current block meets the first preset use condition; Determine whether the number of non-zero coefficients other than the preset position within the current scan area of the current block exceeds the first threshold; wherein the current sequence includes the current image, and the current image includes the current block.

42. The method according to claim 41, wherein, the method further comprises: When the current sequence allows the use of the parity hidden mode or the current image allows the use of the parity hidden mode, and the transform mode information of the current block meets the first preset use condition, and the number of non-zero coefficients other than the preset position within the current scan area of the current block exceeds the first threshold, determine that the hidden mode parameter indicates that the current block enables the parity hidden mode.

43. The method according to claim 42, wherein, the transform mode information of the current block meets the first preset use condition, including: The type of the current block is the first color component block; or, At least one side length of the current scan area of the current block is greater than or equal to the second threshold and the current block does not use the sub-block transform mode; or, The current block uses the intra-derived mode.

44. The method according to claim 42, wherein, the transform mode information of the current block meets the first preset use condition, including: The current block does not use the implicit transform selection mode; The current block does not use the implicit transform skip selection mode; The current block does not use the sub-block transform mode.

45. The method according to claim 41, wherein, the determining whether the current sequence allows the use of the parity hiding mode includes: when the current sequence allows the use of the parity hiding mode, determining that the value of the first syntax identification information is a first value; when the current sequence does not allow the use of the parity hiding mode, determining that the value of the first syntax identification information is a second value.

46. The method according to claim 45, wherein, the method further includes: performing encoding processing on the value of the first syntax identification information, and writing the obtained encoded bits into the code stream.

47. The method according to claim 41, wherein, the determining whether the current image allows the use of the parity hiding mode includes: when the current image allows the use of the parity hiding mode, determining that the value of the second syntax identification information is a first value; when the current image does not allow the use of the parity hiding mode, determining that the value of the second syntax identification information is a second value.

48. The method according to claim 47, wherein, the method further includes: performing encoding processing on the value of the second syntax identification information, and writing the obtained encoded bits into the code stream.

49. The method according to claim 37, wherein, the method further includes: determining the value of the third syntax identification information; wherein, the value of the third syntax identification information indicates whether the current sequence allows the use of the coefficient coding mode based on the scanning area; performing encoding processing on the value of the third syntax identification information, and writing the obtained encoded bits into the code stream.

50. The method according to claim 49, wherein, the determining the value of the third syntax identification information includes: when the current sequence allows the use of the coefficient coding mode based on the scanning area, determining that the value of the third syntax identification information is a first value; when the current sequence does not allow the use of the coefficient coding mode based on the scanning area, determining that the value of the third syntax identification information is a second value.

51. The method according to claim 37, wherein, the method further includes: when the current sequence allows the use of the coefficient coding mode based on the scanning area, performing the step of determining the hiding mode parameter of the current block; wherein, the current sequence includes the current image, and the current image includes the current block.

52. The method according to claim 51, wherein, the method further includes: when the current sequence allows the use of the coefficient coding mode based on the scanning area, if the current sequence does not allow the use of the implicit transform selection mode, then performing the step of determining the hiding mode parameter of the current block.

53. The method according to claim 51, wherein, the method further includes: when the current sequence allows the use of the coefficient coding mode based on the scanning area, if the current sequence allows the use of the implicit transform selection mode, and the current image does not allow the use of the implicit transform skip selection mode, then performing the step of determining the hiding mode parameter of the current block.

54. The method according to claim 51, wherein, The method further includes: When the current sequence allows the coefficient coding mode based on the scanning region, if the current sequence allows the implicit transform selection mode and the current image allows the implicit transform skip selection mode, determine that the current block turns off the parity hiding mode.

55. The method according to claim 37, wherein, The method further includes: When the current sequence does not allow the coefficient coding technology based on the scanning region, determine that the current block turns off the parity hiding mode.

56. The method according to claim 39, wherein, The determining the sum of absolute values of coefficients in the current scanning region of the current block except for the preset position includes: When the current scanning region is the entire region of the current block, determine the preset position as the upper left corner position of the current block; Perform a summation operation on the absolute values of the coefficients in the current block except for the upper left corner position to determine the sum of the absolute values of the coefficients.

57. The method according to claim 39, wherein, The determining the sum of absolute values of coefficients in the current scanning region of the current block except for the preset position includes: When the current scanning region is the current coefficient group of the current block, determine the preset position as the last position in the scanning order of the current coefficient group; Perform a summation operation on the absolute values of the coefficients in the current coefficient group except for the last position to determine the sum of the absolute values of the coefficients.

58. The method according to claim 57, wherein, The method further includes: Perform coefficient group division on the current block to determine at least two coefficient groups of the current block; wherein, the current coefficient group is any one of the at least two coefficient groups.

59. The method according to claim 41, wherein, The method further includes: When the current sequence allows the parity hiding mode or the current image allows the parity hiding mode, and the transform mode information of the current block does not meet the first preset usage condition, and the number of non-zero coefficients in the current scanning region of the current block except for the preset position exceeds the first threshold, determine that the hiding mode parameter indicates that the current block turns on the parity hiding mode.

60. The method according to claim 59, wherein, The transform mode information of the current block not meeting the first preset usage condition includes: The current block uses the implicit transform selection mode; or, The current block uses the sub-block transform mode.

61. The method according to claim 59, wherein, The method further includes: Perform coefficient group division on the current block to determine at least two coefficient groups of the current block; When at least one of the at least two coefficient groups does not turn on the parity hiding mode, turn on the parity hiding mode for the remaining coefficient groups other than the at least one candidate coefficient group.

62. The method according to claim 61, wherein, The method further includes: Determine the last coefficient group of the current block in the scanning order as the at least one candidate coefficient group.

63. The method according to claim 61, wherein, Determining the sum of absolute values of coefficients within the current scanning region of the current block except for the preset position includes: When the current scanning region is the current coefficient group of the current block, determining the preset position as the last position in the scanning order of the current coefficient group; Performing a summation operation on the absolute values of coefficients in the current coefficient group except for the last position to determine the sum of absolute values of coefficients; Wherein, the current coefficient group is any one of the remaining coefficient groups other than the at least one candidate coefficient group.

64. The method according to claim 39, Wherein, Determining the parity value of the coefficient at the preset position according to the sum of absolute values of coefficients includes: Determining the parity value of the coefficient at the preset position according to the parity characteristic of the sum of absolute values of coefficients.

65. The method according to claim 64, Wherein, Determining the parity value of the coefficient at the preset position according to the parity characteristic of the sum of absolute values of coefficients includes: If the sum of absolute values of coefficients is odd, determining the parity value of the coefficient at the preset position as the third value; If the sum of absolute values of coefficients is even, determining the parity value of the coefficient at the preset position as the fourth value.

66. The method according to claim 39, Wherein, Determining the parity value of the coefficient at the preset position according to the sum of absolute values of coefficients includes: Performing a bitwise AND operation on the sum of absolute values of coefficients and 1 to determine the parity value of the coefficient at the preset position.

67. The method according to any one of claims 37 to 66, Wherein, Encoding the initial absolute value of the coefficient at the preset position and writing the obtained encoded bits into the bitstream includes: Determining the value of the fourth syntax identification information according to the initial absolute value of the coefficient at the preset position; wherein, the value of the fourth syntax identification information indicates whether the initial absolute value of the coefficient at the preset position is equal to 0; Encoding the value of the fourth syntax identification information and writing the obtained encoded bits into the bitstream.

68. The method according to claim 67, Wherein, The method further includes: When the initial absolute value of the coefficient at the preset position is not equal to 0, determining the value of the fifth syntax identification information according to the initial absolute value of the coefficient at the preset position; wherein, the value of the fifth syntax identification information indicates whether the initial absolute value of the coefficient at the preset position is greater than 1; Encoding the value of the fifth syntax identification information and writing the obtained encoded bits into the bitstream.

69. The method according to claim 68, Wherein, The method further includes: When the initial absolute value of the coefficient at the preset position is greater than 1, determining the value of the sixth syntax identification information according to the initial absolute value of the coefficient at the preset position; wherein, the value of the sixth syntax identification information indicates whether the initial absolute value of the coefficient at the preset position is greater than 2; Encoding the value of the sixth syntax identification information and writing the obtained encoded bits into the bitstream.

70. The method according to claim 69, Wherein, The method further includes: When the absolute value of the initial coefficient at the preset position is greater than 2, determine the remaining absolute value of the initial coefficient at the preset position according to the absolute value of the initial coefficient at the preset position; Perform encoding processing on the remaining absolute value of the initial coefficient at the preset position, and write the obtained encoded bits into the code stream.

71. The method according to claim 70, wherein, the determining the remaining absolute value of the initial coefficient at the preset position according to the absolute value of the initial coefficient at the preset position includes: Determine the remaining absolute value of the initial coefficient at the preset position by performing a subtraction operation on the absolute value of the initial coefficient at the preset position and 2.

72. The method according to claim 69, wherein, the performing encoding processing on the value of the fourth syntax identification information and writing the obtained encoded bits into the code stream includes: performing encoding processing on the value of the fourth syntax identification information based on a preset context model, and writing the obtained encoded bits into the code stream; the performing encoding processing on the value of the fifth syntax identification information and writing the obtained encoded bits into the code stream includes: performing encoding processing on the value of the fifth syntax identification information based on the preset context model, and writing the obtained encoded bits into the code stream; the performing encoding processing on the value of the sixth syntax identification information and writing the obtained encoded bits into the code stream includes: performing encoding processing on the value of the sixth syntax identification information based on the preset context model, and writing the obtained encoded bits into the code stream.

73. The method according to claim 69, wherein, the performing encoding processing on the value of the fourth syntax identification information and writing the obtained encoded bits into the code stream includes: performing encoding processing on the value of the fourth syntax identification information based on a first context model, and writing the obtained encoded bits into the code stream; the performing encoding processing on the value of the fifth syntax identification information and writing the obtained encoded bits into the code stream includes: performing encoding processing on the value of the fifth syntax identification information based on a second context model, and writing the obtained encoded bits into the code stream; the performing encoding processing on the value of the sixth syntax identification information and writing the obtained encoded bits into the code stream includes: performing encoding processing on the value of the sixth syntax identification information based on a third context model, and writing the obtained encoded bits into the code stream; wherein the first context model, the second context model, and the third context model are all different.

74. The method according to claim 73, wherein, the method further includes: Determine a first context index number, a second context index number, and a third context index number; According to the context model candidate list, determine the first context model corresponding to the first context index number, the second context model corresponding to the second context index number, and the third context model corresponding to the third context index number.

75. The method according to claim 74, wherein, the determining the first context index number includes: Determine the color component type of the current block and a first preset array; wherein, the first preset array represents the absolute values of the first p coefficients in the scanning order within the current scanning area that are located at the preset position, and p is an integer greater than zero; Determine the first context index number according to the color component type of the current block, the first preset array, and the position of the preset position within the current scanning area.

76. The method according to claim 75, wherein, The determining the second context index number and the third context index number includes: Determine the color component type of the current block and a second preset array; wherein, the second preset array represents the absolute values of the first q non-zero coefficients in the scanning order within the current scanning area that are located at the preset position, and q is an integer greater than zero; Determine the second context index number and the third context index number according to the color component type of the current block, the second preset array, and the position of the preset position within the current scanning area.

77. The method according to any one of claims 37 to 76, wherein, The method further includes: Determine the sign of the coefficient at the preset position; When the absolute value of the initial coefficient at the preset position is not equal to 0, determine the value of the seventh syntax flag information according to the sign of the coefficient at the preset position; Perform encoding processing on the value of the seventh syntax flag information, and write the obtained encoded bits into the bitstream.

78. The method according to any one of claims 37 to 76, wherein, The method further includes: Determine the sign of the coefficient at the preset position; When the current block enables the odd-even hiding mode and the absolute value of the target coefficient at the preset position is equal to 1, determine the value of the eighth syntax flag information according to the sign of the coefficient at the preset position; Perform encoding processing on the value of the eighth syntax flag information, and write the obtained encoded bits into the bitstream.

79. A bitstream, wherein, The bitstream is generated by performing bit encoding on the information to be encoded; wherein, the information to be encoded includes at least one of the following: the absolute value of the initial coefficient at the preset position within the current scanning area of the current block, the remaining absolute value of the initial coefficient at the preset position, the value of the first syntax flag information, the value of the second syntax flag information, the value of the third syntax flag information, the value of the fourth syntax flag information, the value of the fifth syntax flag information, the value of the sixth syntax flag information, the value of the seventh syntax flag information, the value of the eighth syntax flag information; Among them, the value of the first syntax identification information indicates whether the parity hiding mode is allowed for the current sequence, the value of the second syntax identification information indicates whether the parity hiding mode is allowed for the current image, the value of the third syntax identification information indicates whether the coefficient coding mode based on the scanning area is allowed for the current sequence, the value of the fourth syntax identification information indicates whether the absolute value of the initial coefficient at the preset position is equal to 0, the value of the fifth syntax identification information indicates whether the absolute value of the initial coefficient at the preset position is greater than 1, the value of the sixth syntax identification information indicates whether the absolute value of the initial coefficient at the preset position is greater than 2, the value of the seventh syntax identification information indicates the sign of the coefficient at the preset position when the absolute value of the initial coefficient at the preset position is not equal to 0, and the value of the eighth syntax identification information indicates the sign of the coefficient at the preset position when the parity hiding mode of the current block is enabled and the absolute value of the target coefficient at the preset position is equal to 1.

80. An encoder, comprising a first determination unit and an encoding unit, wherein: The first determination unit is configured to determine the hiding mode parameter of the current block; when the hiding mode parameter indicates that the parity hiding mode of the current block is enabled, determine the absolute value of the target coefficient at the preset position within the current scanning area of the current block; and is further configured to determine the absolute value of the initial coefficient at the preset position according to the absolute value of the target coefficient; The encoding unit is configured to perform encoding processing on the absolute value of the initial coefficient at the preset position, and write the obtained encoded bits into the code stream.

81. An encoder, comprising a first memory and a first processor, wherein: The first memory is used to store a computer program that can run on the first processor; The first processor is configured to execute the method according to any one of claims 37 to 78 when running the computer program.

82. A decoder, comprising a second determination unit and a decoding unit, wherein: The second determination unit is configured to determine the hiding mode parameter of the current block; when the hiding mode parameter indicates that the parity hiding mode of the current block is enabled, determine the absolute value and the value of the coefficients other than the preset position within the current scanning area of the current block, and determine the parity value of the coefficient at the preset position according to the absolute value and the value of the coefficients; The decoding unit is configured to decode the code stream and determine the absolute value of the initial coefficient at the preset position; The second determination unit is further configured to determine the absolute value of the target coefficient at the preset position according to the absolute value of the initial coefficient at the preset position and the parity value of the coefficient at the preset position.

83. A decoder, comprising a second memory and a second processor, wherein: The second memory is used to store a computer program that can run on the second processor; The second processor is configured to execute the method according to any one of claims 1 to 36 when running the computer program.

84. A computer-readable storage medium, wherein, The computer-readable storage medium stores a computer program, and when the computer program is executed by at least one processor, it implements the method described in any one of claims 1 to 36, or the method described in any one of claims 37 to 78.

Citation Information

Patent Citations

  • Video coding and decoding method and device, computer readable medium and electronic equipment

    CN112995671A

  • Multi-bit information hiding using overlapping subsets

    EP2675159A1

  • Video coding and decoding method, apparatus, device and system, and storage medium

    WO2023184248A1

  • Video coding / decoding method, apparatus and system, device and storage medium

    WO2023184250A1

  • Encoding / decoding method, code stream, encoder, decoder, and storage medium

    WO2023193260A1