CN112543324A - Video decoding method, encoding method, coder-decoder and storage device - Google Patents
Video decoding method, encoding method, coder-decoder and storage device Download PDFInfo
- Publication number
- CN112543324A CN112543324A CN202011419564.0A CN202011419564A CN112543324A CN 112543324 A CN112543324 A CN 112543324A CN 202011419564 A CN202011419564 A CN 202011419564A CN 112543324 A CN112543324 A CN 112543324A
- Authority
- CN
- China
- Prior art keywords
- block
- transform
- sub
- current
- transformation
- 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.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/103—Selection of coding mode or of prediction mode
- H04N19/109—Selection of coding mode or of prediction mode among a plurality of temporal predictive coding modes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/17—Methods 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/176—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/18—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/50—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
- H04N19/503—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/625—Methods 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 device, 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
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 device.
Background
Since the amount of video image data is large, it is generally necessary to compress video pixel data (RGB, YUV, etc.), thereby reducing 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. The intra-frame prediction uses spatial correlation within one image frame to compress the image, and the 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 video storage device, 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 above technical problems, the third technical solution adopted by the present invention is: there is provided a codec comprising a processor coupled to a 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 device having a storage function, the device storing a program, the program being capable of implementing any one of the above methods when executed.
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; 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 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 embodiment of a video decoding method according to 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 flow chart diagram illustrating another embodiment of a video decoding method according to 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 schematic flow chart diagram 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 schematic structural diagram of an apparatus according to an embodiment of the present application having a storage function.
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.
Inter-frame prediction: in general, interframe prediction is to search a block which is most matched with a current block in a reference frame image of the current block by using a certain interframe prediction method to serve as a predicted value of the current block, and then subtract an actual value of the current block from the predicted value 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, both horizontal and vertical transforms use DST7 as the transform kernel.
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 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 employs EST (quadratic transform) coding, which is employed when EstTuFlag is 1 and not employed when EstTuFlag is 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 inter-prediction mode, and its main content is to divide the 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) and position (up/down/left/right sub-block of the current block) of the non-0 residual sub-block are 8 choices (these information are transmitted in the code stream), as shown in fig. 1, (a), (b), (c), (d) are different positions of 1/2 of the current block for the size of the non-zero residual sub-block 100, and (e), (f), (g), (h) are different positions of 1/4 of the current block for the size of the non-zero residual sub-block 100. The transform of the non-zero residual subblock 100 adaptively selects a horizontal transform and a vertical transform according to the positions of the subblocks, such as (a), (b), (c), and (d) sequentially adopting DCT8/DST7, DST7/DST7, DST7/DST8, DST7/DST7 transforms as the horizontal transform and the vertical transform, and (e), (f), (g), and (h) sequentially adopting DCT8/DST7, DST7/DST7, DST7/DST8, DST7/DST7 transforms as the horizontal transform and the vertical transform. 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 has 8 size and position combinations in total, and the decoding side needs 1 syntax element to determine the sub-block division mode (1/4 or 1/2 division of the current block), and represents it by SBT _ quad _ flag (SBT _ quad _ flag is 1 represents 1/4 division); one syntax element is needed to judge whether the partition is horizontal or vertical, and the syntax element is represented by sbt _ dir _ flag (sbt _ dir _ flag ═ 1 represents horizontal partition); one syntax element is needed to determine the specific position (which is specific up, down, left, right) of the non-zero residual sub-block, denoted by sbt _ pos _ flag (sbt _ pos _ flag 1 denotes 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 elements need to be analyzed according to the first number of parities according to a preset rule.
According to the embodiment of the application, whether the sub-block transformation (SBT) related syntax elements need to be analyzed or not can be judged by judging whether the SBT related syntax elements need to be analyzed or not, and correspondingly, if the SBT related syntax elements do not need to be analyzed, the SBT related syntax elements do not need 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 by the decoding end can be improved, the analysis desirability can be fully considered, and the decoding efficiency is 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, it may be a DCT2 transform mode or an implicit transform (IST) mode, then 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, possibly a DCT2 transform, or an implicit transform skip (IST) transform mode, 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, the sub-block transform flag is set to a preset value of 1, where 1 indicates that the number of non-zero coefficients in the coding coefficients of the current block is odd, and the size information of the current block satisfies the size condition, the current block is a luminance block, and other conditions are SBT, which indicates that the optimal mode of sub-block transform is a sub-block transform mode, and 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: it is determined that the current block adopts (DCT 2) as the 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 denotes an odd number, 0 denotes an even number, and 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 an 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 the encoding end encodes the video data, inter-frame prediction can be performed or residual data can be obtained.
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 sub-block transform related syntactic elements need to be analyzed.
For example, the encoding end needs to ensure that the coefficient distribution of the SBT after the transform coefficient quantization conforms, for example, when the preset rule is that the number of non-zero coefficients in the transform quantized encoding coefficient 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 sub-block transform (SBT), so that the encoding end only needs to transmit syntax related to sub-block transform (SBT) and syntax related to SBT when the optimal transform type is sub-block transform, thereby achieving the purpose of reducing the 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 an 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, SBT is introduced on the basis of the existing conversion technology of IBC, and the conversion process in IBC mode is: initializing a horizontal-vertical transformation type DCT2, judging whether ISTS conditions are met, if so, traversing DCT2 transformation and ISTS, and if not, only performing DCT2 transformation; and judging whether the SBT condition is met, and traversing the SBT if the SBT condition is met. And finally, replacing the transformation type with the minimum price as the optimal transformation. Wherein, 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 (DCT 2) transformation mode when the sub-block transformation implicit derivation index is 1, the sub-block transformation flag is 0, and the DCT implicit derivation index is 1; when the sub-block transformation implicit derived index is 1, the sub-block transformation flag is 0, the DCT implicit derived index is 1, and the implicit transformation skip (ISTS) transformation mode is selected.
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 sub-block transform related syntactic elements 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, the present embodiment is a schematic configuration diagram of an apparatus having a storage function, in which an apparatus 20 having a storage function stores a program 21, and when the program 21 is executed, the video encoding method and the video decoding method according to any one of the embodiments described above can be implemented.
The program 21 may be stored in the apparatus 20 with a storage function in the form of a software product, and includes several instructions to make a device or a processor execute all or part of the steps of the methods according to the embodiments of the present application.
The storage-capable device 20 is a medium in computer memory for storing some discrete physical quantity. The aforementioned device 20 with storage function 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.
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 place, 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 can be realized in a form of hardware, and can also be realized in a 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 embodiments are merely examples and are not intended to limit the scope of the present disclosure, and all modifications, equivalents, and flow changes made by the following claims and drawings, or directly or indirectly applied to other related technical fields, are intended to be included within the scope of the present disclosure.
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 the sub-block transformation related syntactic elements need to be analyzed according to the parity of the first quantity according to a preset rule.
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 not a preset value, acquiring a second number, wherein the second number is the number of even nonzero coefficients in the current block coding coefficient;
determining that the current block adopts (DCT 2) as a final transform mode if the second number is an odd number, and determining that the current block adopts an implicit transform as a final transform mode if the second number is an even number.
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 transform mode is subblock transform, adaptively adjusting parity of a first number to meet the requirement of a preset rule, wherein the first number is the number of nonzero coefficients obtained after the current residual block is quantized, and the parity of the first number is used for a decoding end to judge whether related syntactic elements of subblock transform 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.
6. The video encoding method of claim 5,
the adaptively adjusting the first number of parities to meet the requirement of the preset rule includes:
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. An apparatus having a storage function, wherein the apparatus stores a program which, when executed, is capable of implementing the method of any one of claims 1-9.
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 true CN112543324A (en) | 2021-03-23 |
CN112543324B 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) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023184747A1 (en) * | 2022-03-30 | 2023-10-05 | Oppo广东移动通信有限公司 | Video encoding method, video decoding method, apparatus, device, system, and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105898300A (en) * | 2016-05-06 | 2016-08-24 | 西安电子科技大学 | Improved transformation coefficient sign data hiding method based on recovered transformation coefficient |
WO2019194504A1 (en) * | 2018-04-01 | 2019-10-10 | 엘지전자 주식회사 | Method and device for processing video signal by using reduced secondary transform |
CN110710208A (en) * | 2017-08-21 | 2020-01-17 | 谷歌有限责任公司 | Embedding information about EOB location |
WO2020182207A1 (en) * | 2019-03-13 | 2020-09-17 | Beijing Bytedance Network Technology Co., Ltd. | Partitions on sub-block transform mode |
CN111988618A (en) * | 2019-05-22 | 2020-11-24 | 杭州海康威视数字技术股份有限公司 | Decoding and encoding method, decoding end and encoding end |
-
2020
- 2020-12-06 CN CN202011419564.0A patent/CN112543324B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105898300A (en) * | 2016-05-06 | 2016-08-24 | 西安电子科技大学 | Improved transformation coefficient sign data hiding method based on recovered transformation coefficient |
CN110710208A (en) * | 2017-08-21 | 2020-01-17 | 谷歌有限责任公司 | Embedding information about EOB location |
WO2019194504A1 (en) * | 2018-04-01 | 2019-10-10 | 엘지전자 주식회사 | Method and device for processing video signal by using reduced secondary transform |
WO2020182207A1 (en) * | 2019-03-13 | 2020-09-17 | Beijing Bytedance Network Technology Co., Ltd. | Partitions on sub-block transform mode |
WO2020182213A1 (en) * | 2019-03-13 | 2020-09-17 | Beijing Bytedance Network Technology Co., Ltd. | Sub-block transform in transform skip mode |
CN111988618A (en) * | 2019-05-22 | 2020-11-24 | 杭州海康威视数字技术股份有限公司 | Decoding and encoding method, decoding end and encoding end |
Non-Patent Citations (1)
Title |
---|
YUHUAI ZHANG等: ""IMPLICIT-SELECTED TRANSFORM IN VIDEO CODING"", 《2020 IEEE INTERNATIONAL CONFERENCE ON MULTIMEDIA & EXPO WORKSHOPS (ICMEW)》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023184747A1 (en) * | 2022-03-30 | 2023-10-05 | Oppo广东移动通信有限公司 | Video encoding method, video decoding method, apparatus, device, system, and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112543324B (en) | 2023-02-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9215463B2 (en) | Image encoding/decoding method and device | |
JP3118237B1 (en) | Picture prediction decoding method | |
RU2720975C2 (en) | Method of encoding and decoding images, an encoding and decoding device and corresponding computer programs | |
CN1893666B (en) | Video encoding and decoding methods and apparatuses | |
KR101730639B1 (en) | Video coding with coding of the locations of significant coefficients in a block of coefficients | |
TWI407798B (en) | Motion prediction methods and video codecs | |
RU2608682C2 (en) | Image encoding and decoding method, device for encoding and decoding and corresponding software | |
US20120275522A1 (en) | Method and apparatus for motion vector encoding/decoding using spatial division, and method and apparatus for image encoding/decoding using same | |
RU2007106081A (en) | METHOD AND DEVICE FOR TRANSFORMING WITH INCREASING FRAME RATE BY USING A CODER (EA-FRUC) FOR COMPRESSING A VIDEO IMAGE | |
US20120307904A1 (en) | Partial frame utilization in video codecs | |
US8594189B1 (en) | Apparatus and method for coding video using consistent regions and resolution scaling | |
US20030133512A1 (en) | Spatially transcoding a video stream | |
CN113497937B (en) | Image encoding method, image decoding method and related devices | |
WO2013067949A1 (en) | Matrix encoding method and device thereof, and matrix decoding method and device thereof | |
CN101663895B (en) | Video coding mode selection using estimated coding costs | |
US20130114684A1 (en) | Electronic devices for selective run-level coding and decoding | |
JP2022548354A (en) | Video decoding method, video encoding method, apparatus, equipment and storage medium | |
CN112543324B (en) | Video decoding method, encoding method, codec and storage medium | |
WO2020181504A1 (en) | Video encoding method and apparatus, and video decoding method and apparatus | |
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 | |
JP4762486B2 (en) | Multi-resolution video encoding and decoding |
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 |