CN112543324B - Video decoding method, encoding method, codec and storage medium - Google Patents

Video decoding method, encoding method, codec and storage medium Download PDF

Info

Publication number
CN112543324B
CN112543324B CN202011419564.0A CN202011419564A CN112543324B CN 112543324 B CN112543324 B CN 112543324B CN 202011419564 A CN202011419564 A CN 202011419564A CN 112543324 B CN112543324 B CN 112543324B
Authority
CN
China
Prior art keywords
block
sub
transformation
transform
current
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011419564.0A
Other languages
Chinese (zh)
Other versions
CN112543324A (en
Inventor
洪珠
江东
林聚财
殷俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202011419564.0A priority Critical patent/CN112543324B/en
Publication of CN112543324A publication Critical patent/CN112543324A/en
Application granted granted Critical
Publication of CN112543324B publication Critical patent/CN112543324B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/109Selection of coding mode or of prediction mode among a plurality of temporal predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/18Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a set of transform coefficients
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/625Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding using discrete cosine transform [DCT]

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • Discrete Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention relates to the technical field of coding and decoding, in particular to a video decoding method, a coding method, a coder-decoder and a storage medium, wherein the video decoding method comprises the following steps: acquiring a code stream of a current block; acquiring a first quantity from the code stream of the current block, wherein the first quantity is the number of nonzero coefficients in the coding coefficients of the current block; and judging whether the sub-block transformation related syntactic elements need to be analyzed according to the parity of the first quantity according to a preset rule. The video decoding method can improve the decoding efficiency.

Description

Video decoding method, encoding method, codec and storage medium
Technical Field
The present invention relates to the field of encoding and decoding technologies, and in particular, to a video decoding method, an encoding method, an encoder/decoder, and a storage medium.
Background
Since the amount of video image data is large, it is generally necessary to compress video pixel data (RGB, YUV, etc.) to reduce the amount of video data. The compressed data is called as video code stream, the video code stream is transmitted to a user side through a wired or wireless network, and then decoding and watching are carried out, so that the purposes of reducing network bandwidth and reducing storage space in the transmission process can be achieved.
The whole video coding system mainly comprises video acquisition, prediction, transformation quantization, entropy coding and the like, wherein the prediction comprises an intra-frame prediction part and an inter-frame prediction part. Respectively, in order to remove spatial and temporal redundancy of the video images. Intra-frame prediction uses spatial correlation within one image frame to compress the image, and inter-frame prediction uses temporal correlation between image frames to compress the image. The existing inter-frame transformation usually traverses selectable inter-frame transformation modes, the transformation mode with the minimum cost is selected as the optimal transformation mode, and the existing inter-frame transformation mode is only used for inter-frame prediction transformation, so that the code stream length is large, and the application of the transformation mode is limited; the decoding end has low decoding efficiency.
Disclosure of Invention
The invention mainly solves the technical problem of providing a video decoding method, a video encoding method, a video encoder/decoder and a storage medium, which can improve the decoding efficiency.
In order to solve the technical problems, the first technical scheme adopted by the invention is as follows: there is provided a video decoding method including: acquiring a code stream of a current block; acquiring a first quantity from a code stream of a current block, wherein the first quantity is the number of nonzero coefficients in coding coefficients of the current block; and judging whether the sub-block transformation related syntactic elements need to be analyzed according to the parity of the first quantity according to a preset rule.
In order to solve the above technical problems, the second technical solution adopted by the present invention is: there is provided a video encoding method including: acquiring a current residual block; determining a final transform mode for the current block based on the residual; if the final transformation mode is sub-block transformation, adaptively adjusting the parity of a first quantity to meet the requirement of a preset rule, wherein the first quantity is the number of nonzero coefficients obtained after the current residual block is transformed and quantized, and the parity of the first quantity is used for a decoding end to judge whether the sub-block transformation related syntactic elements need to be analyzed; and coding the residual block to obtain a code stream of the current block, and coding the first quantity into the code stream.
In order to solve the technical problems, the third technical scheme adopted by the invention is as follows: there is provided a codec comprising a processor coupled to a memory, the memory for storing a program, and a memory for executing the program to implement the method of any one of the above.
In order to solve the technical problems, the fourth technical scheme adopted by the invention is as follows: there is provided a computer readable storage medium storing a program which, when executed, is capable of implementing any of the above methods.
The invention has the beneficial effects that: different from the situation of the prior art, the method can judge whether the sub-block transformation related syntax elements need to be analyzed by judging whether the sub-block transformation related syntax elements need to be analyzed, and correspondingly, if the sub-block transformation related syntax elements do not need to be analyzed, the sub-block transformation related syntax elements do not need to be analyzed; and if the sub-block needs to be analyzed, analyzing the relevant syntax elements of the sub-block transformation. By setting the judging step, the decoding complexity of all sub-block transformation related syntax elements to be analyzed by the decoding end can be improved, the analysis desirability can be fully considered, and the decoding efficiency can be improved.
Drawings
FIG. 1 is a schematic diagram of the location and size of non-zero residuals in sub-blocks;
FIG. 2 is a flowchart illustrating an exemplary embodiment of a video decoding method of the present application;
FIG. 3 is a schematic flow chart diagram illustrating a video decoding method according to another embodiment of the present application;
FIG. 4 is a schematic flowchart of another embodiment of a video decoding method of the present application;
FIG. 5 is a flowchart illustrating a video decoding method according to still another embodiment of the present application;
FIG. 6 is a flowchart illustrating a video decoding method according to still another embodiment of the present application;
FIG. 7 is a flowchart illustrating an embodiment of a video encoding method of the present application;
FIG. 8 is a flowchart illustrating a video encoding method according to another embodiment of the present application;
FIG. 9 is a block diagram of an embodiment of a codec of the present application;
FIG. 10 is a block diagram of an apparatus according to an embodiment of the present application.
Detailed Description
In order to make the purpose, technical solution and effect of the present application clearer and clearer, the present application is further described in detail below with reference to the accompanying drawings and examples.
The present disclosure provides a method for encoding and decoding, wherein an execution main body of the method for encoding is an encoding end, and an execution main body of the method for decoding can be a decoding end, wherein the encoding end or the decoding end can be a server, a computer, a mobile phone, and other devices capable of encoding and/or decoding video data.
Before carrying out the implementation, first, a concept that may be involved in the embodiments of the present disclosure is explained: video coding mainly comprises prediction, transformation, quantization and entropy coding, and video decoding mainly comprises entropy decoding, inverse quantization, inverse transformation and the like.
Intra-frame prediction: in the intra prediction, a video frame is divided into small blocks, and the intra prediction is performed in units of the small blocks. In general, intra-frame prediction is to obtain reconstructed pixel values around a current block by using a certain intra-frame prediction method as predicted values of the current block pixels, subtract a real pixel value of the current block from the predicted values to obtain a residual block, the residual block represents the difference between the real pixel and the predicted pixel of the current block, and then transform the residual.
And (3) inter-frame prediction: in general, inter prediction refers to searching a block which is most matched with a current block in a reference frame image of the current block by using a certain inter prediction method to serve as a prediction value of the current block, and subtracting the prediction value from an actual value of the current block to obtain a residual block.
The transformation technology comprises the following steps: the transformation greatly utilizes the spatial correlation of data, and adopts a mathematical transformation method, so that a large amount of time domain continuous signals can be represented by few discrete signals, namely, the energy is concentrated in a low-frequency region, and the energy of the signals can be more concentrated. The transformation coefficient with smaller energy can be removed through quantization, thereby achieving the purpose of compressing data. After an extremely sparse residual block is obtained through prediction, energy can be concentrated in the upper left corner region by carrying out transformation operation on the residual.
Implicit transformation: IST (Implicit selection of transforms), when Implicit transform techniques are selected, DST7 is used as the transform kernel for both horizontal and vertical transforms.
Implicit transform skipping: and (3) ISTS (Implicit selection of transform skip, when the residual performs Implicit transform skip, the residual is not transformed, the residual is directly shifted and scaled, and then quantization entropy coding and other operations are performed.
The Transform technology of DCT (Discrete Cosine Transform)/DST (Discrete sine Transform) has been the mainstream Transform technology of video coding. The DCT and DST are further classified into various transformation kernels, such as DCT2, DST7, DCT8, according to the difference of the basis functions.
Syntax elements: is a flag for indicating some parameters configured by the encoding end or the encoding technique and method used, etc. At the encoding end, the syntax element needs to be encoded, that is, the value of the syntax element is converted into a string of characters consisting of "0" and "1" which can be read and understood by a computer by using a specific encoding mode. And encoding the syntax element into the code stream and then transmitting the code stream to a decoding end. The decoding end can know the coding information of the coding end and adopt corresponding operation by analyzing the meaning represented by the syntactic element read by the coded characters. For example, one syntax element EstTuFlag represents whether the current TU is encoded using EST (quadratic transform) techniques, and EST is used when EstTuFlag =1 and not when EstTuFlag = 0. During encoding, the value corresponding to the EstTuFlag needs to be encoded into a code stream and transmitted to a decoding end. The decoding end can know whether the encoding end adopts the EST technology or not by analyzing the value corresponding to the EstTuFlag, and if the EST technology is adopted, the decoding end can decode through the operation related to the EST.
Sub-block transformation: SBT (Sub-Block Transform) technique, sub-Block Transform, is a Transform technique in an inter-frame prediction mode, and its main content is to divide a residual into two Sub-blocks, where the residual of one Sub-Block defaults to 0, and the residual of the other Sub-Block defaults to not 0, and only Transform this Sub-Block containing the residual. Wherein, the size (1/2 or 1/4 of the current block) and position (up/down/left/right sub-block of the current block) of the non-0 residual sub-block have 8 choices (these information are transmitted in the code stream), as shown in fig. 1, (a), (b), (c), (d) are that the size of the non-zero residual sub-block 100 is different position of 1/2 of the current block, and (e), (f), (g), (h) are that the size of the non-zero residual sub-block 100 is different position of 1/4 of the current block. The transformation of the non-zero residual subblock 100 adaptively selects horizontal transformation and vertical transformation according to the positions of the subblocks, such as (a), (b), (c) and (d) sequentially adopting DCT8/DST7, DST7/DST8 and DST7/DST7 transformation as horizontal transformation and vertical transformation, and (e), (f), (g) and (h) sequentially adopting DCT8/DST7, DST7/DST8 and DST7/DST7 transformation as horizontal transformation and vertical transformation. Where only the non-zero residual block 100 is transformed, the residual of the sub-block 200 defaults to 0.
Sub-block transform syntax elements: the SBT residual error has 8 size and position combinations, the decoding end needs 1 syntax element to judge the dividing mode of the sub-block (1/4 or 1/2 division of the current block), and the method is represented by SBT _ quad _ flag (SBT _ quad _ flag =1 represents 1/4 division); one syntax element is needed to judge whether the partition is horizontal or vertical, represented by sbt _ dir _ flag (sbt _ dir _ flag =1 represents horizontal partition); one syntax element is needed to determine the specific position of the non-zero residual sub-block (which position is specific up, down, left, right), denoted by sbt _ pos _ flag (sbt _ pos _ flag =1 for right/down); a syntax is also required to determine whether the current transform type is SBT, denoted by SBT _ cu _ flag (SBT _ cu _ flag =1 denotes that SBT is used); a total of 4 syntax elements are required to determine the use of SBT techniques.
The inter-frame transform type: the inter-frame transform types are mainly location-based transform (PBT), sub-block transform (SBT), DCT2 transform, and implicit transform (IST). For the transformation mode meeting the condition, the current block selects the transformation mode with the minimum cost as the best transformation mode by traversing the selectable transformation modes, the corresponding syntax element of the change (PBT) based on the position and the sub-block transformation (SBT) needs to be transmitted to a decoding end, if the decoding end analyzes that PBTflag is not 0, the current transformation type is the change (PBT) based on the position, if the decoding end analyzes that SBT flag is not 0, the current transformation type is the sub-block transformation (SBT), and the implicit transformation (IST) is judged by implicitly deriving the index.
The implicit derivation of the index refers to that the current transform mode is judged by the parity of the number of even nonzero coefficients after the current block is quantized, wherein 1 represents an odd number, and 0 represents an even number. The purpose of this is to reduce the syntax transmission of the IstTuflag, and the decoding end can know whether the current transform mode is an implicit transform (IST) by implicitly deriving an index.
As shown in fig. 2, an embodiment of the present application provides a video decoding method, including:
s110: and acquiring the code stream of the current block.
Generally, in encoding and decoding, a small block is processed, and the small block may be referred to as a current block. For example, one frame of video data is divided into 4 small blocks, and each small block may be referred to as a current block when being encoded or decoded.
When the decoding end has encoded data to decode, the encoded data can be obtained (either from the encoding end or from the storage device). For example, when playing video data, the terminal may obtain encoded data of the video data from the server, decode the video data, and then play the video data.
S120: and acquiring a first quantity from the code stream of the current block, wherein the first quantity is the number of nonzero coefficients in the coding coefficients of the current block.
And analyzing the value of the first quantity from the code stream data of the current block, and judging the parity of the value of the first quantity.
S130: and judging whether the sub-block transform (SBT) related syntax element needs to be analyzed according to the parity of the first quantity according to a preset rule.
According to the embodiment of the application, whether the relevant syntax elements of the subblock transformation are required to be analyzed or not can be judged by judging whether the relevant syntax elements of the subblock transformation are required to be analyzed or not, and correspondingly, if the relevant syntax elements of the subblock transformation are not required to be analyzed, the relevant syntax elements of the subblock transformation are not required to be analyzed; if the sub-block is needed to be analyzed, the sub-block is analyzed again to transform the relevant syntactic elements. By setting the judging step, the decoding complexity of all sub-block transform (SBT) related syntax elements to be analyzed at the decoding end can be improved, the analysis desirability can be fully considered, and the decoding efficiency can be improved.
As shown in fig. 3, in an embodiment of the present application, determining whether the sub-block transform related syntax element needs to be parsed according to the first number of parities includes:
if the first number is odd, S231: parsing the sub-block transforms the relevant syntax elements. If the first number is even, S232: sub-block transform related syntax elements are not parsed.
In the embodiment of the present application, the preset rule that the first number is an odd number indicates that the current transform type is a sub-block transform (SBT) mode; even, the current transform type is not a sub-block transform (SBT) mode. If the first number is odd, the current transformation type is a sub-block transformation (SBT) mode, and the syntax elements related to the sub-block transformation are analyzed; if the first number is even, indicating that the current transform type is not a sub-block transform (SBT) mode, for example, may be a DCT2 transform mode or an implicit transform (IST) mode, the sub-block transform related syntax elements are not parsed.
As shown in fig. 4, in another embodiment of the present application, the determining whether the sub-block transform related syntax elements need to be parsed according to the first number of parities includes:
if the first number is even, S232: parsing the sub-block transforms the relevant syntax elements. If the first number is odd, S231: sub-block transform related syntax elements are not parsed.
In the embodiment of the present application, the preset rule that the first number is an even number indicates that the current transform type is a sub-block transform (SBT) mode; odd, the current transform type is not a sub-block transform (SBT) mode. If the first number is even, the current transformation type is a sub-block transformation (SBT) mode, and analyzing the syntax elements related to the sub-block transformation; if the first number is odd, indicating that the current transform type is not a sub-block transform (SBT) mode, for example, it may be a DCT2 transform, or an implicit transform skip (IST) transform mode, then the sub-block transform related syntax elements are not parsed.
As shown in fig. 5, in a preferred embodiment of the present application, parsing sub-block transform related syntax elements includes:
s331: the sub-block transform flag is read.
In the embodiment of the present application, after acquiring the encoded data of the current block, the decoding end may acquire the stored parsing condition, and check whether the current block satisfies the parsing condition. If the analysis condition is satisfied, the sub-block transformation flag can be obtained by analysis in the encoded data of the current block.
Since the syntax specifies the position of the sub-block transform flag, the decoding side can analyze the flag.
As a possible implementation, the parsing condition is that the size information of the current block satisfies the size condition, the current block is a luminance block, and the number of non-zero coefficients in the coding coefficients of the current block is an odd number.
If the sub-block transform flag is a preset value, S332: and determining that the current block adopts the sub-block transform as a final transform mode.
For example, in the embodiment of the present application, if the sub-block transform flag is preset to 1,1, which indicates that the number of non-zero coefficients in the encoded coefficients of the current block is odd, the size information of the current block satisfies the size condition, the current block is a luminance block, and SBT other conditions, the best mode of sub-block transform is the sub-block transform mode, and the sub-block transform is used as the final transform mode. According to the embodiment of the application, the conversion mode can be directly determined through the sub-block conversion mark, and the analysis efficiency can be improved.
As shown in fig. 6, in a preferred embodiment of the present application, parsing the sub-block transform related syntax elements further includes:
if the sub-block transform flag is not a preset value, S333: and acquiring a second number, wherein the second number is the number of even nonzero coefficients obtained after the coding inverse quantization of the current residual block.
If the sub-block transformation flag is a non-preset value, for example, the sub-block transformation flag is 0, which indicates that the number of non-zero coefficients in the coding coefficient of the current block is an even number, a second number is obtained from the code stream of the current block, and the second number is the number of non-zero coefficients in the coding coefficient of the current block.
If the second number is odd, S334: determining that the current block adopts (DCT 2 ) as a final transform mode. If the second number is even, S335: determining that the current block employs an implicit transform (IST) as a final transform mode.
In the embodiment of the present application, 1 represents an odd number, 0 represents an even number, if the second number is 1, it is determined that the current block adopts (DCT 2 ) as the final transform mode, and if the second number is 0, it is determined that the current block adopts implicit transform (IST) as the final transform mode.
As shown in fig. 7, an embodiment of the present application further includes a second technical solution, where the video encoding method includes:
s410: and acquiring the current residual block.
When encoding video data, the encoding end can perform inter-frame prediction or obtain residual data.
S420: a final transform mode for the current block is determined based on the current residual block.
The inter-frame transform types are mainly location-based transform (PBT), sub-block transform (SBT), DCT2 transform, and implicit transform (IST). For the transformation mode meeting the condition, the current block selects the transformation mode with the minimum cost as the best transformation mode by traversing the selectable transformation modes and the transformation modes meeting the condition based on the residual error.
If the final transform mode is the sub-block transform, S430: and adaptively adjusting the parity of a first quantity to meet the requirement of a preset rule, wherein the first quantity is the number of nonzero coefficients obtained after the current residual block is transformed, and the parity of the first quantity is used for a decoding end to judge whether the related syntactic elements of the sub-block transformation need to be analyzed.
For example, the encoding end needs to ensure that the coefficient distribution after SBT transform coefficient quantization conforms, for example, when the preset rule is that the number of non-zero coefficients in the encoded coefficients after transform quantization is odd, the transform mode is sub-block transform. If the number of the non-zero coefficients obtained after the transformation and quantization of the current residual block is an even number, the encoding end needs to adjust the parity of the first number, so that the number of the non-zero coefficients obtained after the transformation of the current residual block is an odd number, and the decoding end can analyze the transformation mode of the decoding end as sub-block transformation according to a preset rule that the number of the non-zero coefficients is an odd number. If the number of the nonzero coefficients obtained after the current residual block is obtained and transformed is an odd number, the preset rule is met.
In a specific embodiment of the present application, the parity of the first number is adaptively adjusted to meet the requirement of the preset rule, at this time, the number of the non-zero coefficients obtained after the current residual block is transformed is an even number, and at this time, one of the non-zero coefficients obtained after the residual block of the previous block is transformed may be set to be zero, so that the number of the non-zero coefficients is an odd number, and the preset rule is met.
More specifically, the last non-zero coefficient is set to zero, so that the number of the non-zero coefficients is an odd number, and the preset rule is satisfied. When the preset rule changes, the method of the embodiment of the application is still applicable. And will not be described in detail herein.
S440: and coding the residual block to obtain a code stream of the current block, and coding the first quantity into the code stream.
According to the method and the device, the final transformation mode is a sub-block transformation mode, residual error data of the non-zero sub-blocks of the current block can be transformed according to the sub-block transformation mode to obtain transformation coefficients, the transformation coefficients are quantized to obtain quantized data, and the quantized data are subjected to entropy coding to form a code stream of the current block. Meanwhile, the encoding end adds the first number of values, the encoded data of the sub-block transformation flag bit and the encoded data of the position of the non-zero sub-block to the encoded data of the current block.
If the final transform mode is non-sub-block transform, in the embodiment of the present application, the encoding end does not need syntax related to coded sub-block transform (SBT), so that the encoding end needs to transmit syntax related to sub-block transform (SBT) and syntax related to coded sub-block transform (SBT) only when the optimal transform type is sub-block transform, thereby achieving the purpose of reducing transmission of syntax related to sub-block transform (SBT). The video coding method of the embodiment of the application can reduce the transmission of syntax elements, reduce the length of code streams and reduce unnecessary bit transmission.
As shown in fig. 8, a video encoding method according to another embodiment of the present application includes:
step 511: and determining a final prediction mode of the current block, wherein the final prediction mode is an intra-frame block copying method or intra-frame prediction.
In the embodiment of the present application, the final prediction mode of the current block may be an intra block copy method (IBC) or intra prediction or inter prediction.
In the embodiment of the application, the current frame to which the current block belongs to a natural image scene or a mixed scene of the natural image scene and screen content, so that the encoding method of the embodiment of the application can be applied to various scenes and has a wide application range.
Step 512: the current residual block is calculated based on the final prediction mode.
In the embodiment of the application, the actual value and the predicted value of the current block are subtracted to obtain the current residual block.
S520: a final transform mode for the current block is determined based on the current residual block.
For example, the final prediction mode of the current block is an Intra Block Copy (IBC) method, and a sub-block transform (SBT) is introduced into the Intra Block Copy (IBC) mode such that a transform type satisfying a condition is traversed to select an optimal transform type.
Taking AVS3 as an example, the SBT is introduced based on the existing conversion technique of IBC, and the conversion process in the IBC mode is: initializing a horizontal vertical transformation type DCT2, judging whether the ISTS condition is met, if so, traversing DCT2 transformation and ISTS, and if not, only performing DCT2 transformation; and judging whether the SBT condition is met or not, and traversing the SBT if the SBT condition is met. And finally, replacing the transformation type with the minimum price as the optimal transformation. The SBT condition is that the size information of the current block meets the size condition and the current block is a brightness block.
In another embodiment, for the encoding side, if the current best transform mode is ISTS, there is no need to transmit SBT related syntax, and the decoding side determines whether the transform mode is ISTS by implicitly deriving the index. If the syntax is ISTS, the syntax related to the SBT does not need to be analyzed, otherwise, the syntax related to the SBT needs to be analyzed. For example, the sub-block transform implicitly derives indices to represent parity at a first number, 1 to odd, 0 to even; the sub-block transform (SBT) transform mode may be selected in case that the sub-block transform implicit lead index is 1 and the sub-block transform flag is 1; selecting a (DCT 2 ) transformation mode when the sub-block transformation implied derivation index is 1, the sub-block transformation flag is 0, and the DCT implied derivation index is 1; implicit transform skip (ISTS) transform mode is selected when the sub-block transform implicitly derives an index of 1, the sub-block transform flag is 0, and the DCT implicitly derives an index of 1.
If the final transform mode is the sub-block transform, S530: and adaptively adjusting the parity of a first quantity to meet the requirement of a preset rule, wherein the first quantity is the number of nonzero coefficients obtained after the current residual block is transformed, and the parity of the first quantity is used for a decoding end to judge whether the related syntactic elements of the sub-block transformation need to be analyzed. If the first number of parities satisfies the requirement of the predetermined rule, S540 may be directly performed without performing S530.
S540: and coding the current block according to the final transformation mode to obtain the code stream of the current block.
As shown in fig. 9, in this embodiment, a codec 10 includes a processor 11 and a memory 12, where the processor 11 is coupled to the memory 12, the memory 12 is used for storing a program, and the processor 11 is used for executing the program to implement the video encoding method and the video decoding method of any of the above embodiments.
The computer device 110 may be a codec. The processor 11 may also be referred to as a CPU (Central Processing Unit). The processor 11 may be an integrated circuit chip having signal processing capabilities. The processor 11 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
As shown in fig. 10, which is a schematic structural diagram of a computer-readable storage medium in an embodiment of the present application, in this embodiment, a program 21 is stored in the computer-readable storage medium 20, and when the program 21 is executed, the video encoding method and the video decoding method in any of the embodiments described above can be implemented.
The program 21 may be stored in the computer-readable storage medium 20 in the form of a software product, and includes several instructions for causing a device or a processor to execute all or part of the steps of the method according to the embodiments of the present application.
The computer-readable storage medium 20 is a medium in computer memory for storing some discrete physical quantity. And the aforementioned computer-readable storage medium 20 includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application.
The above description is only an embodiment of the present application, and not intended to limit the scope of the present application, and all equivalent structures or equivalent processes performed by the present application and the contents of the attached drawings, which are directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (11)

1. A video decoding method, comprising:
acquiring a code stream of a current block;
acquiring a first quantity from the code stream of the current block, wherein the first quantity is the number of nonzero coefficients in the coding coefficients of the current block;
and judging whether sub-block transform related syntax elements need to be analyzed according to the parity of the first quantity according to a preset rule, wherein the sub-block transform related syntax elements comprise sub-block transform flags, and the sub-block transform flags are used for indicating whether the current block adopts sub-block transform as a final transform mode.
2. The video decoding method of claim 1,
the determining whether parsing of sub-block transform related syntax elements is required according to the first number of parities may include:
if the first number is an odd number, analyzing the syntax elements related to the sub-block transformation, otherwise, not analyzing the syntax elements related to the sub-block transformation; or
If the first number is an even number, parsing the sub-block transform related syntax elements, otherwise, not parsing the sub-block transform related syntax elements.
3. The video decoding method of claim 2,
the parsing the sub-block transform related syntax elements comprises:
reading a sub-block transformation flag;
and if the sub-block transformation flag is a preset value, determining that the current block adopts sub-block transformation as a final transformation mode.
4. The video decoding method of claim 2, further comprising:
if the sub-block transformation flag is a non-preset value, acquiring a second number, wherein the second number is the number of even nonzero coefficients in the current block coding coefficient;
and if the second number is an odd number, determining that the current block adopts (DCT 2 ) as a final transformation mode, and if the second number is an even number, determining that the current block adopts implicit transformation as the final transformation mode.
5. A video encoding method, comprising:
acquiring a current residual block;
determining a final transform mode for the current block based on the current residual block;
if the final transformation mode is subblock transformation, adaptively adjusting parity of a first quantity to meet the requirement of a preset rule, wherein the first quantity is the number of nonzero coefficients obtained after the current residual block is transformed and quantized, the parity of the first quantity is used for a decoding end to judge whether a subblock transformation related syntax element needs to be analyzed, the subblock transformation related syntax element comprises a subblock transformation flag, and the subblock transformation flag is used for indicating whether subblock transformation is adopted by the current block as the final transformation mode;
and coding the residual block to obtain a code stream of the current block, and coding the first quantity into the code stream.
6. The video encoding method of claim 5,
the adaptively adjusting the parity of the first number to meet the requirement of the preset rule comprises:
and setting one nonzero coefficient in the coefficients after the current block is transformed and quantized to be zero.
7. The video coding method of claim 6, wherein setting any non-zero coefficient of the non-zero coefficients obtained after transform quantization of the current residual block to zero comprises:
and setting the last non-zero coefficient in the non-zero coefficients obtained after the residual block transform quantization as zero.
8. The video coding method of claim 5, wherein the obtaining the current residual block comprises:
determining a final prediction mode of the current block, wherein the final prediction mode is an intra-frame block copying method or intra-frame prediction;
and calculating the current residual block based on the final prediction mode.
9. The video coding method of claim 5, wherein the current frame to which the current block belongs to a natural image scene or a mixed scene of a natural image scene and screen content.
10. A codec comprising a processor coupled to a memory and a memory for storing a program, the processor being configured to execute the program to implement the method of any one of claims 1-9.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a program which, when executed, is capable of implementing the method according to any one of claims 1-9.
CN202011419564.0A 2020-12-06 2020-12-06 Video decoding method, encoding method, codec and storage medium Active CN112543324B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011419564.0A CN112543324B (en) 2020-12-06 2020-12-06 Video decoding method, encoding method, codec and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011419564.0A CN112543324B (en) 2020-12-06 2020-12-06 Video decoding method, encoding method, codec and storage medium

Publications (2)

Publication Number Publication Date
CN112543324A CN112543324A (en) 2021-03-23
CN112543324B true CN112543324B (en) 2023-02-28

Family

ID=75016331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011419564.0A Active CN112543324B (en) 2020-12-06 2020-12-06 Video decoding method, encoding method, codec and storage medium

Country Status (1)

Country Link
CN (1) CN112543324B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023184250A1 (en) * 2022-03-30 2023-10-05 Oppo广东移动通信有限公司 Video coding/decoding method, apparatus and system, device and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105898300B (en) * 2016-05-06 2019-03-26 西安电子科技大学 A kind of improvement transformation coefficient sign bit hidden method based on recovery transformation coefficient
US10225562B1 (en) * 2017-08-21 2019-03-05 Google Llc Embedding information about EOB positions
SI3764649T1 (en) * 2018-04-01 2023-12-29 Lg Electronics Inc. Processing video signal by using reduced secondary transform
WO2020182213A1 (en) * 2019-03-13 2020-09-17 Beijing Bytedance Network Technology Co., Ltd. Sub-block transform in transform skip mode
CN111988618B (en) * 2019-05-22 2022-05-20 杭州海康威视数字技术股份有限公司 Decoding and encoding method, decoding end and encoding end

Also Published As

Publication number Publication date
CN112543324A (en) 2021-03-23

Similar Documents

Publication Publication Date Title
US9503729B2 (en) Encoding or decoding method and apparatus
RU2720975C2 (en) Method of encoding and decoding images, an encoding and decoding device and corresponding computer programs
TWI407798B (en) Motion prediction methods and video codecs
CN104041039B (en) Method and coding and decoding equipment for coding and decoding image
RU2007106081A (en) METHOD AND DEVICE FOR TRANSFORMING WITH INCREASING FRAME RATE BY USING A CODER (EA-FRUC) FOR COMPRESSING A VIDEO IMAGE
US20120275522A1 (en) Method and apparatus for motion vector encoding/decoding using spatial division, and method and apparatus for image encoding/decoding using same
US20120307904A1 (en) Partial frame utilization in video codecs
US10368071B2 (en) Encoding data arrays
US8594189B1 (en) Apparatus and method for coding video using consistent regions and resolution scaling
CN101663895B (en) Video coding mode selection using estimated coding costs
WO2013067949A1 (en) Matrix encoding method and device thereof, and matrix decoding method and device thereof
US20130114684A1 (en) Electronic devices for selective run-level coding and decoding
CN113497937B (en) Image encoding method, image decoding method and related devices
CN112543324B (en) Video decoding method, encoding method, codec and storage medium
CN112995671B (en) Video encoding and decoding method and device, computer readable medium and electronic equipment
CN106028031A (en) Video coding device, video coding method, video decoding device and video decoding method
WO2021056575A1 (en) Low-delay joint source-channel coding method, and related device
US10536697B2 (en) Method for re-encoding image and apparatus therefor
CN113132731A (en) Video decoding method, device, equipment and storage medium
CN108605131B (en) Method and apparatus for encoding and decoding data, and corresponding recording medium
CN116982262A (en) State transition for dependent quantization in video coding
CN109672889A (en) The method and device of the sequence data head of constraint
US11930163B2 (en) Methods and systems for combined lossless and lossy coding
RU2782400C2 (en) Method of encoding and decoding images, device for encoding and decoding and corresponding software
CN113132734B (en) Encoding and decoding method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant