WO2023193260A1 - 编解码方法、码流、编码器、解码器以及存储介质 - Google Patents

编解码方法、码流、编码器、解码器以及存储介质 Download PDF

Info

Publication number
WO2023193260A1
WO2023193260A1 PCT/CN2022/085946 CN2022085946W WO2023193260A1 WO 2023193260 A1 WO2023193260 A1 WO 2023193260A1 CN 2022085946 W CN2022085946 W CN 2022085946W WO 2023193260 A1 WO2023193260 A1 WO 2023193260A1
Authority
WO
WIPO (PCT)
Prior art keywords
quantization coefficient
identification information
current block
absolute value
current
Prior art date
Application number
PCT/CN2022/085946
Other languages
English (en)
French (fr)
Inventor
徐陆航
黄航
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Priority to PCT/CN2022/085946 priority Critical patent/WO2023193260A1/zh
Publication of WO2023193260A1 publication Critical patent/WO2023193260A1/zh

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/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]

Definitions

  • the embodiments of the present application relate to the field of video coding and decoding technology, and in particular, to a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium.
  • the image data to be encoded will be compressed and encoded through the entropy coding unit after transformation and quantization processing, and the code stream generated after the entropy encoding processing will be transmitted to The decoding end then parses the code stream, and after inverse quantization and inverse transformation, the original input image data can be restored.
  • non-zero quantized coefficients can be positive or negative.
  • the related technology is to use sign prediction technology for sign prediction.
  • the encoding and decoding performance is poor.
  • Embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder, and a storage medium, which can hide identification information of non-zero quantized coefficients, thereby saving code rates and improving coding and decoding performance.
  • embodiments of the present application provide a decoding method, which is applied to a decoder.
  • the method includes:
  • identification information corresponding to the target quantization coefficient is determined based on the absolute value of the quantization coefficient included in the current area.
  • inventions of the present application provide an encoding method, which is applied to an encoder.
  • the method includes:
  • identification information corresponding to the target quantization coefficient is determined based on the absolute value of the quantization coefficient included in the current area.
  • embodiments of the present application provide a code stream, which is generated by bit encoding based on information to be encoded; wherein the information to be encoded includes at least one of the following:
  • the preset element identification information is used to indicate whether the current block uses identification hiding technology
  • the first identification information, the second identification information, the third identification information, the fourth identification information and the fifth identification information are used to determine the quantization coefficient of the current block.
  • the preset parameter value includes at least one of the following: a preset number, a first distance threshold, a second distance threshold, a sum threshold, and a preset size value.
  • embodiments of the present application provide an encoder, including a first determination unit and a first judgment unit; wherein,
  • a first determination unit configured to determine the absolute value of the quantization coefficient of the current block
  • the first judgment unit is configured to scan the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient to be hidden in the current area of the current block;
  • the first determination unit is further configured to determine identification information corresponding to the target quantization coefficient based on the absolute value of the quantization coefficient included in the current area when it is determined that the target quantization coefficient exists in the current area.
  • embodiments of the present application provide an encoder, which includes a first memory and a first processor; wherein,
  • a first memory for storing a computer program capable of running on the first processor
  • the first processor is used to perform the method of the second aspect when running the computer program.
  • embodiments of the present application provide a decoder, including a decoding unit, a second determination unit and a second judgment unit; wherein,
  • a decoding unit configured to parse the code stream and determine the absolute value of the quantization coefficient of the current block
  • the second judgment unit is configured to scan the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient with a hidden identifier in the current area of the current block;
  • the second determination unit is configured to determine identification information corresponding to the target quantization coefficient based on the absolute value of the quantization coefficient included in the current area when it is determined that the target quantization coefficient exists in the current area.
  • embodiments of the present application provide a decoder, which includes a second memory and a second processor; wherein,
  • a second memory for storing a computer program capable of running on the second processor
  • the second processor is used to execute the method of the first aspect when running the computer program.
  • embodiments of the present application provide a computer storage medium that stores a computer program. When the computer program is executed, the method of the first aspect is implemented, or the method of the second aspect is implemented.
  • Embodiments of the present application provide a coding and decoding method, a code stream, an encoder, a decoder and a storage medium.
  • the absolute value of the quantization coefficient of the current block is determined; and the absolute value of the quantization coefficient of the current block is determined according to the preset scanning order. Scan the value to determine whether there is a target quantization coefficient to be hidden in the current area of the current block; when it is determined that the target quantization coefficient exists in the current area, determine the target quantization coefficient corresponding to the absolute value of the quantization coefficient included in the current area. Identification information.
  • the absolute value of the quantization coefficient of the current block is determined by parsing the code stream; the absolute value of the quantization coefficient of the current block is scanned according to the preset scanning order to determine whether there is a target quantization coefficient with hidden identification in the current area of the current block; When it is determined that the target quantization coefficient exists in the current area, identification information corresponding to the target quantization coefficient is determined based on the absolute value of the quantization coefficient included in the current area. In this way, both the encoding end and the decoding end can first determine whether there are non-zero quantized coefficients that need to be hidden in the current area, and then determine that there are non-zero quantized coefficients that need to be hidden in the current area.
  • the identification information of the zero quantization coefficient (such as the sign identification information) is hidden, that is, there is no need to encode/decode the identification information of the non-zero quantization coefficient, and it can be directly based on the correlation characteristics of the absolute value of the non-zero quantization coefficient included in the current area. Determine the identification information of the non-zero quantization coefficient; this can not only save the code rate and improve the encoding and decoding efficiency, but also improve the encoding and decoding performance.
  • Figure 1 is a schematic diagram of a block-based coding framework
  • Figure 2A is a schematic block diagram of a system composition of an encoder provided by an embodiment of the present application.
  • Figure 2B is a schematic block diagram of a system composition of a decoder provided by an embodiment of the present application.
  • Figure 3 is a schematic flowchart 1 of a decoding method provided by an embodiment of the present application.
  • Figure 4 is a schematic flow chart 2 of a decoding method provided by an embodiment of the present application.
  • Figure 5 is a schematic diagram of test results under All intra configuration provided by the embodiment of this application.
  • Figure 6 is a schematic diagram of test results under Random access configuration provided by the embodiment of this application.
  • Figure 7 is a schematic flow chart 1 of an encoding method provided by an embodiment of the present application.
  • Figure 8 is a schematic flow chart 2 of an encoding method provided by an embodiment of the present application.
  • Figure 9 is a schematic structural diagram of an encoder provided by an embodiment of the present application.
  • Figure 10 is a schematic diagram of the specific hardware structure of an encoder provided by an embodiment of the present application.
  • Figure 11 is a schematic structural diagram of a decoder provided by an embodiment of the present application.
  • Figure 12 is a schematic diagram of the specific hardware structure of a decoder provided by an embodiment of the present application.
  • Figure 13 is a schematic structural diagram of a coding and decoding system provided by an embodiment of the present application.
  • VVC Very Video Coding
  • LCU Largest Coding Unit
  • AOM's video compression reference software (AOMedia Video Model, AVM)
  • each frame in the video image is divided into square LCUs of the same size (such as 128 ⁇ 128, 64 ⁇ 64, etc.).
  • Each LCU can also be divided into rectangular CUs according to rules; and the CU may also be divided into smaller ones.
  • the coding framework can include steps such as Prediction, Transform, Quantization, Entropy Coding, and In Loop Filter.
  • prediction can be divided into intra prediction (Intra Prediction) and inter prediction (Inter Prediction).
  • Inter prediction can include motion estimation (Motion Estimation) and motion compensation (Motion Compensation).
  • intra-frame prediction in video encoding and decoding technology can eliminate the spatial redundancy between adjacent pixels; however, due to the There is also a strong similarity between frames.
  • inter-frame prediction is used to eliminate temporal redundancy between adjacent frames, thereby improving encoding and decoding efficiency.
  • the basic process is as follows:
  • intra prediction or inter prediction is used for the current block to generate the prediction block of the current block, and the prediction block is subtracted from the original block of the current block.
  • block to obtain a residual block
  • transform and quantize the residual block to obtain a quantized coefficient matrix
  • entropy encode the quantized coefficient matrix and output it to the code stream.
  • intra prediction or inter prediction is used for the current block to generate the prediction block of the current block.
  • the code stream is decoded to obtain the quantization coefficient matrix, and the quantization coefficient matrix is inversely quantized and inversely transformed to obtain the residual block.
  • the prediction block and the residual block are added to obtain the reconstructed block.
  • Reconstruction blocks form a reconstructed image, and loop filtering is performed on the reconstructed image based on images or blocks to obtain a decoded image.
  • the encoder also needs similar operations as the decoder to obtain the decoded image.
  • the decoded image can be used as a reference frame for inter-frame prediction for subsequent frames.
  • the block division information determined by the encoder, prediction, transformation, quantization, entropy coding, loop filtering and other mode information or parameter information need to be output to the code stream if necessary; then the decoder determines and The same block division information, prediction, transformation, quantization, entropy coding, loop filtering and other mode information or parameter information of the encoder ensures that the decoded image obtained by the encoder is the same as the decoded image obtained by the decoder.
  • the decoded image obtained by the encoder is often also called a reconstructed image.
  • the current block can be divided into prediction units during prediction, and the current block can be divided into transformation units during transformation. The divisions of prediction units and transformation units can be different.
  • the current block may be the current coding unit (CU), the current prediction unit (PU), or the current transform block (TU), etc.
  • AOM's reference software is based on the AV1 standard and is an exploration and research on the possible standardization of AV2 encoding tools. Similar to most mainstream video encoding and decoding standards, AOM's reference software (i.e. AVM) is also a traditional encoding and decoding based on blocks. It includes multiple parts, such as: block division, intra-frame prediction, and inter-frame prediction. , transformations, quantization, entropy coding, loop and post-processing filtering, unique coding of screen content, and more. The embodiments of this application mainly improve the quantization and dequantization parts to improve the encoding performance of AVM.
  • AVM AOM's reference software
  • the quantization and inverse quantization parts are closely related to the coefficient encoding part.
  • the purpose of quantization is to reduce the dynamic range of the transform coefficients, thereby reducing the number of bits consumed when encoding coefficients.
  • the process of quantization and inverse quantization is as follows:
  • t i is the transformation coefficient
  • qstep is the quantization step size (related to the quantization parameters set in the configuration file)
  • q i is the quantization coefficient
  • round() is the rounding process, which is not limited to upper rounding or lower rounding, etc.
  • the quantization process is controlled by the encoder.
  • t′ i is the reconstruction transformation coefficient. Due to the accuracy loss caused by the rounding process, t′ i and t i are different.
  • B() is the calculation process of the encoder estimating the bits consumed by encoding q i .
  • multi-symbol arithmetic coding (Multi-symbol arithmetic coding) is used in AVM to encode/decode the quantized coefficients.
  • Each quantized coefficient can be composed of one or more Identified by a multi-symbol logo. Specifically, according to the size of the quantization coefficient, it can be segmented and represented by the following multi-symbol identification bits.
  • -Identification 1 represents the part from 0 to 3, with a total of 4 symbols (0,1,2,3). When the symbol of identification 1 is 3, further encoding/decoding of identification 2 is required;
  • -Identification 2 represents the part from 3 to 6, with a total of 4 symbols (0,1,2,3). When the symbol of identification 2 is 3, further encoding/decoding of identification 3 is required;
  • -Identification 3 represents the part from 6 to 9, with a total of 4 symbols (0,1,2,3). When the symbol of identification 3 is 3, further encoding/decoding of identification 4 is required;
  • -Identification 4 represents the part from 9 to 12, with a total of 4 symbols (0,1,2,3). When the symbol of identification 4 is 3, further encoding/decoding of identification 5 is required;
  • -Identification 5 indicates the part from 12 to 15, with a total of 4 symbols (0,1,2,3). When the symbol of identification 5 is 3, it is necessary to further encode/decode the part greater than or equal to 15.
  • the part greater than or equal to 15 uses the bypass model, such as exponential Columbus encoding/decoding; while the identifiers 1 to 5 use the context model, where the identifier 1 has a separate context model, and the identifiers 2 to 5 share a common context model. .
  • the current coefficient is a non-zero coefficient, the sign needs to be encoded/decoded.
  • the encoding/decoding process of each identifier in the current block is divided into the following two loop processes:
  • Loop 1 First, encode/decode identifiers 1 to 5 in the scanning order from the last non-zero coefficient to the upper left corner of the current block;
  • Loop 2 Then according to the scanning order from the upper left corner of the current block to the last non-zero coefficient, encode/decode the sign of the non-zero coefficient and the part exceeding 15. Among them, if the coefficient in the upper left corner is a non-zero coefficient, The encoding/decoding of the positive and negative signs adopts the context model, and the encoding/decoding of the non-zero coefficients in the remaining positions adopts the bypass model (specifically, it can also be called the "equal probability model").
  • S() is multi-symbol context model encoding/decoding
  • L(1) is bypass model encoding/decoding
  • these non-zero coefficients may be positive or negative.
  • sign identification information of non-zero coefficients currently parity or other features are not used in AVM to hide a certain identification information of a certain non-zero coefficient, resulting in poor encoding and decoding performance.
  • embodiments of the present application provide a decoding method that determines the absolute value of the quantization coefficient of the current block by parsing the code stream; scans the absolute value of the quantization coefficient of the current block according to the preset scanning order to determine the current area of the current block. Whether there is a target quantization coefficient with hidden identification in the current area; when it is determined that the target quantization coefficient exists in the current area, the identification information corresponding to the target quantization coefficient is determined based on the absolute value of the quantization coefficient included in the current area.
  • Embodiments of the present application also provide an encoding method, by determining the absolute value of the quantization coefficient of the current block; scanning the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a mark to be hidden in the current area of the current block the target quantization coefficient; when it is determined that the target quantization coefficient exists in the current area, the identification information corresponding to the target quantization coefficient is determined according to the absolute value of the quantization coefficient included in the current area.
  • both the encoding end and the decoding end can first determine whether there are non-zero quantization coefficients that need to be hidden in the current area, and then when it is determined that there are non-zero quantization coefficients that need to be hidden in the current area, the non-zero quantization
  • the identification information of the coefficient (such as sign identification information) is hidden, that is, there is no need to encode/decode the identification information of the non-zero quantized coefficient, and the identification information of the non-zero quantized coefficient can be determined directly based on the correlation characteristics of the absolute value of the non-zero quantized coefficient included in the current area. Identification information of non-zero quantization coefficients; this can not only save code rate and improve encoding and decoding efficiency, but also improve encoding and decoding performance.
  • the encoder 100 may include: a segmentation unit 111, a prediction unit 112, a first adder 117, a transform unit 118, a quantization unit 119, an inverse quantization unit 120, an inverse transform unit 121, a second adder 122, Filter unit 123, decoded picture buffer (Decoded Picture Buffer, DPB) unit 124 and entropy encoding unit 125.
  • a segmentation unit 111 may include: a segmentation unit 111, a prediction unit 112, a first adder 117, a transform unit 118, a quantization unit 119, an inverse quantization unit 120, an inverse transform unit 121, a second adder 122, Filter unit 123, decoded picture buffer (Decoded Picture Buffer, DPB) unit 124 and entropy encoding unit 125.
  • DPB decoded Picture Buffer
  • the input of the encoder 100 can be a video composed of a series of pictures or a static picture
  • the output of the encoder 100 can be a bit stream (also called a "code stream") used to represent a compressed version of the input video. .
  • the segmentation unit 111 segments the pictures in the input video into one or more Coding Tree Units (CTUs).
  • the segmentation unit 111 divides the picture into multiple tiles (or tiles), and can further divide a tile into one or more bricks (bricks).
  • a tile or a brick can include one or more complete and/or partial CTUs.
  • the segmentation unit 111 may form one or more slices, where one slice may include one or more tiles arranged in a grid order in the picture, or one or more tiles covering a rectangular area in the picture.
  • the segmentation unit 111 may also form one or more sub-pictures, where one sub-picture may include one or more slices, tiles or bricks.
  • the segmentation unit 111 transfers the CTU to the prediction unit 112.
  • the prediction unit 112 may be composed of a block segmentation unit 113, a motion estimation (Motion Estimation, ME) unit 114, a motion compensation (Motion Compensation, MC) unit 115, and an intra prediction unit 116.
  • the block partitioning unit 113 iteratively uses quadtree partitioning, binary tree partitioning, and ternary tree partitioning to further divide the input CTU into smaller coding units (CUs).
  • Prediction unit 112 may obtain the inter prediction block of the CU using ME unit 114 and MC unit 115 .
  • Intra-prediction unit 116 may obtain intra-prediction blocks for a CU using various intra-prediction modes.
  • a rate-distortion optimized motion estimation method may be invoked by ME unit 114 and MC unit 115 to obtain an inter-prediction block
  • a rate-distortion optimized mode determination method may be invoked by intra-prediction unit 116 to obtain an intra-prediction block.
  • the prediction unit 112 outputs the prediction block of the CU, and the first adder 117 calculates the difference between the CU and the prediction block of the CU in the output of the division unit 111, that is, the residual CU.
  • Transform unit 118 reads the residual CU and performs one or more transform operations on the residual CU to obtain coefficients.
  • the quantization unit 119 quantizes the coefficients and outputs quantized coefficients (ie, levels).
  • the inverse quantization unit 120 performs a scaling operation on the quantized coefficients to output reconstruction coefficients.
  • the inverse transform unit 121 performs one or more inverse transforms corresponding to the transform in the transform unit 118 and outputs a reconstruction residual.
  • the second adder 122 calculates the reconstructed CU by adding the reconstruction residual and the prediction block of the CU from the prediction unit 112 .
  • the second adder 122 also sends its output to the prediction unit 112 for use as an intra prediction reference.
  • the filtering unit 123 performs loop filtering on the reconstructed picture or sub-picture.
  • the filtering unit 123 includes one or more filters, such as a deblocking filter, a sample adaptive offset (SAO) filter, a neural network-based filter, etc.
  • the filtering unit 123 determines that the CU is not used as a reference when encoding other CUs, the filtering unit 123 performs loop filtering on one or more target pixels in the CU.
  • the output of the filtering unit 123 is decoded pictures or sub-pictures, and these decoded pictures or sub-pictures are buffered to the DPB unit 124 .
  • the DPB unit 124 outputs decoded pictures or sub-pictures according to timing and control information.
  • the picture stored in the DPB unit 124 may also be used as a reference for the prediction unit 112 to perform inter prediction or intra prediction.
  • the entropy encoding unit 125 converts the parameters necessary for decoding the picture from the encoder 100 (such as control parameters and supplementary information, etc.) into binary form, and writes such binary form into the code stream according to the syntax structure of each data unit. , that is, the encoder 100 finally outputs a code stream.
  • the encoder 100 may be a first memory having a first processor and recording a computer program. When the first processor reads and runs the computer program, the encoder 100 reads the input video and generates a corresponding code stream. Additionally, the encoder 100 may also be a computing device having one or more chips. These units implemented as integrated circuits on the chip have similar connection and data exchange functions as the corresponding units in Figure 2A.
  • the decoder 200 may include: a parsing unit 201 , a prediction unit 202 , an inverse quantization unit 205 , an inverse transform unit 206 , an adder 207 , a filter unit 208 and a decoded picture buffer unit 209 .
  • the input of the decoder 200 is a bit stream representing a compressed version of a video or a still picture
  • the output of the decoder 200 may be a decoded video composed of a series of pictures or a decoded still picture.
  • the input code stream of the decoder 200 may be the code stream generated by the encoder 100 .
  • the parsing unit 201 parses the input code stream and obtains the value of the syntax element from the input code stream.
  • the parsing unit 201 converts the binary representation of the syntax elements into digital values and sends the digital values to the unit in the decoder 200 to obtain one or more decoded pictures.
  • the parsing unit 201 may also parse one or more syntax elements from the input code stream to display the decoded picture.
  • the parsing unit 201 sends the value of the syntax element and one or more variables set or determined according to the value of the syntax element for obtaining one or more decoded pictures to the decoder 200. unit.
  • Prediction unit 202 determines a prediction block for the current decoding block (eg, CU).
  • the prediction unit 202 may include a motion compensation unit 203 and an intra prediction unit 204.
  • the prediction unit 202 passes the relevant parameters from the parsing unit 201 to the motion compensation unit 203 to obtain the inter-frame prediction block; when the intra-frame prediction mode is indicated,
  • the prediction unit 202 transmits the relevant parameters from the parsing unit 201 to the intra prediction unit 204 to obtain the intra prediction block.
  • the inverse quantization unit 205 has the same function as the inverse quantization unit 120 in the encoder 100 .
  • the inverse quantization unit 205 performs a scaling operation on the quantization coefficients (ie, levels) from the parsing unit 201 to obtain reconstruction coefficients.
  • the inverse transform unit 206 has the same function as the inverse transform unit 121 in the encoder 100 .
  • the inverse transform unit 206 performs one or more transform operations (ie, the inverse operation of one or more transform operations performed by the inverse transform unit 121 in the encoder 100) to obtain the reconstruction residual.
  • the adder 207 performs an addition operation on its inputs (the prediction block from the prediction unit 202 and the reconstruction residual from the inverse transform unit 206) to obtain the reconstruction block of the current decoding block.
  • the reconstructed block is also sent to prediction unit 202 for use as a reference for other blocks encoded in intra prediction mode.
  • filtering unit 208 After all CUs in the picture or sub-picture are reconstructed, filtering unit 208 performs loop filtering on the reconstructed picture or sub-picture.
  • the filtering unit 208 includes one or more filters, such as a deblocking filter, a sampling adaptive compensation filter, a neural network-based filter, and the like.
  • filtering unit 208 determines that the reconstructed block is not used as a reference when decoding other blocks, filtering unit 208 performs loop filtering on one or more target pixels in the reconstructed block.
  • the output of the filtering unit 208 is a decoded picture or sub-picture, and the decoded picture or sub-picture is buffered to the DPB unit 209.
  • the DPB unit 209 outputs decoded pictures or sub-pictures according to timing and control information.
  • the picture stored in the DPB unit 209 may also be used as a reference to perform inter prediction or intra prediction by the prediction unit 202.
  • the decoder 200 may be a second memory having a second processor and recording a computer program. When the first processor reads and runs the computer program, the decoder 200 reads the input code stream and generates a corresponding decoded video. Additionally, the decoder 200 may also be a computing device having one or more chips. These units implemented as integrated circuits on the chip have similar connection and data exchange functions as the corresponding units in Figure 2B.
  • the "current block” specifically refers to the block currently to be encoded in the video image
  • the “current block” Specifically refers to the current block to be decoded in the video image.
  • the current block here may be the current coding unit, the current prediction unit, or the current transformation block, etc., and this embodiment of the present application does not make any limitation.
  • FIG. 3 shows a schematic flowchart of a decoding method provided by an embodiment of the present application.
  • the method may include:
  • S301 Analyze the code stream and determine the absolute value of the quantization coefficient of the current block.
  • the decoding method in the embodiment of the present application is applied to decoders, especially to decoders in AVM.
  • the decoding method may specifically be a decoding method regarding sign identification concealment.
  • the sign identification corresponding to the absolute value of the quantization coefficient in the current block is mainly hidden, so as to further improve the encoding and decoding performance.
  • each quantization coefficient may be represented by one or more multi-symbol identification information.
  • the absolute value of each quantization coefficient may be represented by several types of multi-symbol identification information such as first identification information, second identification information, third identification information, fourth identification information and fifth identification information.
  • parsing the code stream and determining the absolute value of the quantization coefficient of the current block may include:
  • the absolute value of the quantization coefficient of the current block satisfies one of the following: 0, 1, 2, or greater than or equal to 3;
  • the absolute value of the quantization coefficient of the current block satisfies one of the following: 3, 4, 5, or greater than or equal to 6;
  • the absolute value of the quantization coefficient of the current block satisfies one of the following: 6, 7, 8, or greater than or equal to 9;
  • the absolute value of the quantization coefficient of the current block satisfies one of the following: 9, 10, 11, or greater than or equal to 12;
  • the absolute value of the quantization coefficient of the current block satisfies one of the following: 12, 13, 14, or greater than or equal to 15;
  • each identification information can include multiple symbols, specifically four symbols (0, 1,2,3).
  • the first identification information can be used to decode the part where the absolute value of the quantization coefficient of the current block is 0-3, the second identification information can be used to decode the part where the absolute value of the quantization coefficient of the current block is 3-6, and the third identification information It can be used to decode the absolute value part of the quantization coefficient of the current block whose absolute value of the quantization coefficient is 6 to 9.
  • the fourth identification information can be used to decode the part of the current block whose absolute value of the quantization coefficient is 9 to 12.
  • the fifth identification information The information can be used to decode the part where the absolute value of the quantization coefficient of the current block is 12 to 15.
  • the first identification information represents the part where the absolute value of the quantization coefficient is 0 to 3, with a total of 4 symbols (0, 1, 2, 3).
  • the second identification information represents the part where the absolute value of the quantization coefficient is 3 to 6, with a total of 4 symbols (0,1,2,3).
  • the third identification information represents the part where the absolute value of the quantization coefficient is 6 to 9, with a total of 4 symbols (0,1,2,3).
  • the fourth identification information represents the part where the absolute value of the quantization coefficient is 9 to 12, with a total of 4 symbols (0, 1, 2, 3).
  • the symbol of the fourth identification information is 3, Then it is necessary to further decode the fifth identification information; the fifth identification information represents the part where the absolute value of the quantization coefficient is 12 to 15, with a total of 4 symbols (0,1,2,3).
  • the symbol of the fifth identification information is 3, Then it is necessary to further decode the part where the absolute value of the quantization coefficient is greater than or equal to 15.
  • the first identification information if the sign of the first identification information is 0, it means that the absolute value of the quantization coefficient of the current block is 0; if the sign of the first identification information is 1, it means that the quantization coefficient of the current block is 0.
  • the absolute value of the coefficient is 1; if the sign of the first identification information is 2, it means that the absolute value of the quantization coefficient of the current block is 2; if the sign of the first identification information is 3, it means that the absolute value of the quantization coefficient of the current block is is greater than or equal to 3, at this time, it is necessary to decode to obtain the second identification information; for the second identification information, if the symbol of the second identification information is 0, it means that the absolute value of the quantization coefficient of the current block is 3; if the second identification information If the sign is 1, it means that the absolute value of the quantization coefficient of the current block is 4; if the sign of the second identification information is 2, it means that the absolute value of the quantization coefficient of the current block is 5; if the sign of the second identification information is
  • the fifth identification information if the fifth identification information If the sign is 0, it means that the absolute value of the quantization coefficient of the current block is 12; if the sign of the fifth identification information is 1, it means that the absolute value of the quantization coefficient of the current block is 13; if the sign of the fifth identification information is 2, Then it means that the absolute value of the quantization coefficient of the current block is 14; if the sign of the fifth identification information is 3, it means that the absolute value of the quantization coefficient of the current block is greater than or equal to 15; when it is determined that the absolute value of the quantization coefficient of the current block is greater than or equals 15, continue to parse the code stream, and further determine the absolute value of the quantization coefficient of the current block.
  • the method may also include:
  • the bypass model is used to analyze the code stream and the absolute value of the quantization coefficient of the current block is determined.
  • the part greater than or equal to 15 can be decoded using the bypass model (such as exponential Golomb decoding); and the part less than 15, the first identification information, the second identification information, the third identification information, the fourth identification information and the fifth identification information (i.e., identification 1 to 5) can be decoded using the context model.
  • the first identification information i.e., identification 1
  • the remaining four identification information i.e., identification 2 to 5
  • decoding the absolute value of the quantization coefficient of the current block may include two loop processes.
  • the method may further include:
  • the code stream is parsed according to the second loop sequence to determine the absolute value of the quantization coefficient of the current block.
  • the part of the absolute value of the quantization coefficient that is less than 15 can be determined according to the first loop sequence decoding, and then the part of the absolute value of the quantization coefficient greater than or equal to 15 can be determined according to the second loop sequence decoding.
  • both the first loop order and the second loop order are the order from the last non-zero quantized coefficient of the current block to the upper left position of the current block; or,
  • the first loop order is the order from the last non-zero quantized coefficient of the current block to the upper left position of the current block
  • the second loop order is the order from the upper left position of the current block to the last non-zero quantized coefficient of the current block.
  • the parts whose absolute value of the quantization coefficient is greater than or equal to 15 are decoded to determine the absolute value of the quantization coefficient of the current block.
  • S302 Scan the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient with a hidden identifier in the current area of the current block.
  • each transformation block can be divided into one or more regions.
  • the current area when scanning the absolute value of the quantization coefficient of the current block according to the preset scanning order, first determine whether there is a target quantization coefficient with a hidden identifier in the current area. If it is determined that the target quantization coefficient exists in the current area, then it is necessary to Hide the identification information corresponding to the target quantization coefficient, that is, no longer encode/decode the identification information corresponding to the target quantization coefficient, and subsequently determine the target quantization coefficient directly based on the relevant characteristics of the absolute value of the non-zero quantization coefficient included in the current area. Corresponding identification information.
  • the preset scanning order may be diagonal, Zigzag, horizontal, vertical, 4 ⁇ 4 sub-block scanning or any other scanning order, which is not limited here.
  • the area division of the current block may include: in the preset scanning order, the current block is divided into areas according to the preset size value, and at least one area is determined; wherein the current area is at least The currently decoded region within a region.
  • the size of the at least one area can be the same or different.
  • dividing the current block into regions according to a preset size value and determining at least one region may include:
  • the current block may be divided into one or more regions, each region contains at least one absolute value of the quantization coefficient, and there may be a target quantization with hidden identification in each region.
  • Coefficient that is, there may be a target quantized coefficient in each area that does not require coding/decoding identification information.
  • the preset size value is the preset size of each area.
  • the preset size value may be a fixed value, or a variable value or a fixed value written in the code stream.
  • the value of the preset size value may be set to 16.
  • the preset size value when written into the code stream, it can be encoded in the sequence header, image header, etc., without any limitation here.
  • the current block includes 2 M pixel values, and each of the multiple divided regions is 2 N pixel values.
  • 2 M divided by 2 N is a positive integer.
  • the 2 N pixel values are 2 N consecutive coefficients in the preset scanning order. These coefficients may include zero or non-zero coefficients (herein referred to as quantization coefficients).
  • quantization coefficients may include zero or non-zero coefficients (herein referred to as quantization coefficients).
  • the sizes of the multiple areas can be the same, that is, each area includes 2 N pixel values; or the sizes of the multiple areas can also be different, that is, the current block can also be divided into multiple areas. Areas that are consecutive in the preset scanning order but have different numbers of pixels in the area.
  • the steps for determining whether there is a target quantization coefficient with hidden identification and how to determine the identification information corresponding to the target quantization coefficient are the same for each region.
  • only the current region is used Take an example to describe it.
  • scanning the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient with hidden identification in the current area of the current block may include:
  • determining whether there is a target quantization coefficient with a hidden identifier in the current area based on the number of non-zero quantization coefficients may include:
  • the preset number is a preset measurement index used to determine whether the identity hiding technology is enabled in the current area.
  • the preset number may be a fixed value, or a variable value or a fixed value written in the code stream.
  • the preset number When the preset number is written into the code stream, it can be encoded in the sequence header, image header, etc., without any limitation here.
  • the preset number may be set to L, and L is an integer greater than zero.
  • the value of L can be set to 4, but there is no limit here.
  • scanning the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient with hidden identification in the current area of the current block may include:
  • the first distance value it is determined whether there is a target quantization coefficient of the hidden identifier in the current area.
  • determining whether there is a target quantization coefficient of a hidden identifier in the current area according to the first distance value may include:
  • the target quantization coefficient exists in the current area
  • the target quantization coefficient does not exist in the current area.
  • the first distance threshold is also a preset measurement index used to determine whether the identity hiding technology is enabled in the current area.
  • the first distance threshold can be set to P, and P is an integer greater than zero.
  • the first distance threshold may be a fixed value, or a variable value or a fixed value written in the code stream.
  • the first distance threshold When the first distance threshold is written into the code stream, it can be encoded in the sequence header, the image header, etc., without any limitation here.
  • the first distance value between the first non-zero quantization coefficient and the last non-zero quantization coefficient of the current area in the preset scanning order if the first distance value is greater than P, then it is determined that in the current area.
  • the existence of a target quantization coefficient that hides the logo means that the logo hiding technology is enabled in the current area.
  • the logo information corresponding to the target quantization coefficient can be determined without parsing the code stream; if the first distance value is less than or equal to P, then the current There is no target quantization coefficient to hide the mark in the area, which means that the mark hiding technology is not enabled in the current area. At this time, it is necessary to determine the mark information corresponding to the absolute value of each quantization coefficient in the current area by parsing the code stream.
  • scanning the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient with hidden identification in the current area of the current block may include:
  • the second distance value it is determined whether there is a target quantization coefficient of the hidden identifier in the current area.
  • determining whether there is a target quantization coefficient of a hidden identifier in the current area according to the second distance value may include:
  • the second distance value is less than or equal to the second distance threshold, it is determined that the target quantization coefficient does not exist in the current area.
  • the second distance threshold is also a preset metric used to determine whether the identity hiding technology is enabled in the current area.
  • the second distance threshold and the first distance threshold can be set to be the same or different.
  • the second distance threshold can also be set to P, where P is an integer greater than zero.
  • the second distance threshold may be a fixed value, or a variable value or a fixed value written in the code stream.
  • the second distance threshold When the second distance threshold is written into the code stream, it can be encoded in the sequence header, the image header, etc., without any limitation here.
  • the second distance value between the first non-zero quantized coefficient and the last quantized coefficient of the current area in the preset scanning order if the second distance value is greater than P, then it is determined that there is a hidden value in the current area.
  • the target quantization coefficient of the logo means that the logo hiding technology is enabled in the current area.
  • the logo information corresponding to the target quantization coefficient can be determined without parsing the code stream; if the second distance value is less than or equal to P, then it is determined that the target quantization coefficient in the current area is There is no target quantization coefficient to hide the logo, which means that the logo hiding technology is not enabled in the current area. At this time, it is necessary to determine the logo information corresponding to the absolute value of each quantization coefficient in the current area by parsing the code stream.
  • scanning the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient with hidden identification in the current area of the current block may include:
  • the first sum value it is determined whether there is a target quantization coefficient of the hidden identity in the current area.
  • determining whether there is a target quantization coefficient of a hidden identifier in the current area according to the first sum value may include:
  • the target quantization coefficient does not exist in the current area.
  • the sum threshold is also a preset metric used to determine whether the identity hiding technology is enabled in the current area.
  • the sum threshold can be set to Q, and Q is an integer greater than zero.
  • the absolute value of the quantization coefficient of the current block is scanned according to the preset scanning order, which may be from the last non-zero quantization coefficient of the current block to the upper left corner of the current block, and the quantization coefficient included in the current area is scanned. All absolute values are added and calculated, or the absolute values of the non-zero quantized coefficients included in the scanned current area can be added and calculated. This embodiment of the present application does not impose any limitation on this.
  • the sum threshold may be a fixed value, or a variable value or a fixed value written in the code stream.
  • the sum threshold When the sum threshold is written into the code stream, it can be encoded in the sequence header, image header, etc., without any limitation here.
  • the identification information corresponding to the target quantization coefficient can be determined without parsing the code stream; if the first sum value is less than or equal to Q, then it is determined that there is no target quantization coefficient with hidden identification in the current area, which means that the current area
  • the logo hiding technology is not turned on, it is necessary to determine the logo information corresponding to the absolute value of each quantization coefficient in the current area by parsing the code stream.
  • the method further includes: parsing the code stream and determining a preset parameter value; wherein the preset parameter value may include at least one of the following: a preset number, a first distance threshold, a second distance threshold, a sum threshold and a preset Set the size value.
  • the preset parameter value can be a fixed value, or a variable value or a fixed value written in the code stream.
  • the preset parameter value can be encoded in the sequence header, image header, etc., without any limitation here.
  • the method may also include: when it is determined that the target quantization coefficient exists in the current area, obtaining the non-zero value at the target position in the current area. Quantization coefficient, determine the non-zero quantization coefficient at the target position as the target quantization coefficient.
  • the non-zero quantization coefficient at the target position is the Kth non-zero quantization coefficient in the current area on the preset scanning order, K is an integer greater than zero and less than or equal to N, and N is The number of non-zero quantization coefficients included in the current area.
  • the non-zero quantized coefficient at the target position is the last non-zero quantized coefficient in the current area in the preset scanning order.
  • the target quantization coefficient of the hidden mark can be any non-zero quantization coefficient in the preset scanning order in the current area, or it can be a fixed non-zero quantization coefficient, such as the current
  • the first non-zero quantization coefficient, the last non-zero quantization coefficient, or the i-th non-zero quantization coefficient (i is less than or equal to L) in the preset scanning order in the area, etc., are not limited here.
  • the quantization coefficient included in the current area is determined.
  • the absolute value determines the identification information corresponding to the target quantization coefficient, which can include:
  • identification information corresponding to the target quantization coefficient is determined.
  • determining the identification information corresponding to the target quantization coefficient according to the parity characteristics of the first sum value may include:
  • the identification information is a negative sign; if the first sum value is an even number, it is determined that the identification information is a positive sign;
  • the identification information is a positive sign; if the identification information is an even number, it is determined that the identification information is a negative sign.
  • the identification information corresponding to the target quantization coefficient of the hidden identification can be determined according to the parity of the sum of the absolute values of the quantization coefficients included in the current area.
  • the identification information that needs to be hidden here can be positive and negative symbol identification information. For example, if the sum of the absolute values of the quantization coefficients included in the current area is an odd number, then it can be determined that the identification information is a negative sign, that is, the target quantization coefficient is a negative value; if the sum of the absolute values of the quantization coefficients included in the current area is an even number, Then it can be determined that the identification information is a positive sign, that is, the target quantization coefficient is a positive value.
  • the identification information is a positive sign, that is, the target quantization coefficient is a positive value; if the sum of the absolute values of the quantization coefficients included in the current area is an even number, then it can be It is determined that the identification information has a negative sign, that is, the target quantization coefficient is a negative value.
  • determining the identification information corresponding to the target quantization coefficient based on the absolute value of the quantization coefficient included in the current region may include:
  • identification information corresponding to the target quantization coefficient is determined.
  • determining the identification information corresponding to the target quantization coefficient according to the parity characteristics of the second sum value may include:
  • the second sum value is an odd number, it is determined that the identification information is a negative sign; if the second sum value is an even number, it is determined that the identification information is a positive sign;
  • the second sum value is an odd number, it is determined that the identification information is a positive sign; if the second sum value is an even number, it is determined that the identification information is a negative sign.
  • the identification information corresponding to the target quantization coefficient of the hidden identification in addition to determining the identification information corresponding to the target quantization coefficient of the hidden identification according to the parity of the sum of the absolute values of the quantization coefficients included in the current area, can also be determined based on the identification information in the current area.
  • the parity of the sum of the absolute values of several quantization coefficients obtained by decoding 1 to 5 is used to determine the identification information corresponding to the target quantization coefficient of the hidden identification.
  • the identification information that needs to be hidden can be positive and negative symbol identification information. For example, if the sum of the absolute values of the quantization coefficients obtained by decoding identifiers 1 to 5 in the current area is an odd number, then it can be determined that the identifier information is a negative sign, that is, the target quantization coefficient is a negative value; if the identifier 1 is used in the current area ⁇ 5The sum of the absolute values of the quantization coefficients obtained by decoding is an even number, then it can be determined that the identification information is a positive sign, that is, the target quantization coefficient is a positive value.
  • the identification information is a positive sign, that is, the target quantization coefficient is a positive value; If the sum of the absolute values of the quantization coefficients obtained by decoding is an even number, it can be determined that the identification information has a negative sign, that is, the target quantization coefficient is a negative value.
  • determining the identification information corresponding to the target quantization coefficient based on the absolute value of the quantization coefficient included in the current region may include:
  • the identification information corresponding to the target quantization coefficient is determined.
  • determining the identification information corresponding to the target quantization coefficient based on the parity characteristics of the number of non-zero quantization coefficients may include:
  • the identification information is determined to be a negative sign; if the number of non-zero quantization coefficients is an even number, the identification information is determined to be a positive sign;
  • the identification information is a positive sign; if the number of non-zero quantization coefficients is an even number, it is determined that the identification information is a negative sign.
  • the identification information corresponding to the target quantization coefficient of the hidden identification can also be determined based on the parity of the number of non-zero quantization coefficients included in the current area. .
  • the identification information that needs to be hidden can be positive and negative symbol identification information. For example, if the number of non-zero quantization coefficients included in the current area is an odd number, then it can be determined that the identification information is a negative sign, that is, the target quantization coefficient is a negative value; if the number of non-zero quantization coefficients included in the current area is an even number, Then it can be determined that the identification information is a positive sign, that is, the target quantization coefficient is a positive value.
  • the identification information is a positive sign, that is, the target quantization coefficient is a positive value; if the number of non-zero quantization coefficients included in the current area is an even number, then it can be It is determined that the identification information has a negative sign, that is, the target quantization coefficient is a negative value.
  • the method may further include: parsing the code stream according to the third loop sequence, and determining identification information corresponding to the non-zero quantization coefficients in each area of the current block except the target quantization coefficient.
  • the third loop sequence is the sequence from the last non-zero quantized coefficient of the current block to the upper left position of the current block; or, the third loop sequence is the sequence from the upper left position of the current block to the last non-zero quantized coefficient of the current block. order.
  • the embodiment of the present application includes three cyclic processes: (1) decoding the first identification information, the second identification information, the third identification information, the fourth identification information and the fifth identification according to the first cycle sequence information (i.e., identifiers 1 to 5), (2) decode the part of the absolute value of the quantization coefficient of the current block that is greater than or equal to 15 according to the second loop sequence, (3) decode the parts of each area of the current block according to the third loop sequence, Identification information corresponding to non-zero quantization coefficients other than the target quantization coefficient.
  • the first cycle sequence information i.e., identifiers 1 to 5
  • the first loop sequence is the sequence from the last non-zero quantized coefficient of the current block to the upper left position of the current block; while the second loop sequence and the third loop sequence are both It can be the order starting from the last non-zero quantization coefficient of the current block to the upper left position of the current block, or it can be the order starting from the upper left position of the current block to the last non-zero quantization coefficient of the current block.
  • the embodiments of this application do not Without any qualification.
  • the method may also include: if the first quantization coefficient at the upper left position of the current block is a non-zero quantization coefficient, Then use the context model to parse the code stream and determine the identification information corresponding to the first quantization coefficient; and use the bypass model to parse the code stream to determine the non-zero values in the current block except the first quantization coefficient and the target quantization coefficient in each region. Identification information corresponding to the quantization coefficient.
  • the decoding sequence will be to first use the context model to decode the first identification information, the second identification information, the third identification information, the fourth identification information and the fifth identification information, and then use the bypass
  • the model decodes the part greater than or equal to 15, then uses the context model to decode the sign corresponding to the non-zero quantized coefficient at the upper left position, and finally uses the bypass model to decode the sign corresponding to the remaining non-zero quantized coefficients. This is done in hardware. Not implementation friendly.
  • the method may further include: using a bypass model to parse the code stream and determine identification information corresponding to non-zero quantization coefficients other than the target quantization coefficient in each area of the current block.
  • the method may also include:
  • the preset element identification information indicates that the current block uses the identification hiding technology
  • the preset element identification information is at least one of the following level identification information: sequence level, image level, slice level and block level. )class.
  • the preset element identification information is used to indicate whether the current block uses identification hiding technology; this application will only be executed when the preset element identification information indicates that the current block uses identification hiding technology.
  • the decoding process described in the embodiment if the preset element identification information is the first value, then the preset element identification information indicates that the current block uses identification hiding technology; if the preset element identification information is the second value, then the preset element identification information Information indicating that the current block does not use identity hiding techniques.
  • the first value and the second value are different, and the first value and the second value may be in parameter form or in numeric form.
  • the preset element identification information may be a parameter written in the profile, or may be the value of a flag, which is not specifically limited here.
  • enable flag bit (enable_flag) and disable flag bit (disable_flag).
  • the value of the enabled flag bit is the first value
  • the value of the non-enabled flag bit is the second value
  • the first value can be set to 1
  • the second value can be Set to 0; alternatively, the first value can also be set to true, and the second value can also be set to false; however, the embodiment of this application does not specifically limit it.
  • the embodiment of this application proposes dividing the current block into multiple areas in AVM; and using certain characteristics in each area to hide the identification information corresponding to a certain non-zero quantization coefficient in the area ( For example, sign identification information); and by modifying the order of coefficient decoding to adapt to the proposed sign identification hiding technology, the decoding performance can be further improved.
  • Embodiments of the present application provide a decoding method that determines the absolute value of the quantization coefficient of the current block by parsing the code stream; scans the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a quantization coefficient in the current area of the current block. Hide the identified target quantization coefficient; when it is determined that the target quantization coefficient exists in the current area, the identification information corresponding to the target quantization coefficient is determined based on the absolute value of the quantization coefficient included in the current area.
  • the identification information (such as sign identification information) of the non-zero quantized coefficient is hidden, that is, there is no need to encode/decode the non-zero quantized coefficient.
  • the identification information of the coefficient can be determined directly based on the correlation characteristics of the absolute value of the non-zero quantization coefficient included in the current area; this can not only save the code rate and improve the encoding and decoding efficiency, but also improve the encoding and decoding efficiency. Decoding performance.
  • FIG. 4 shows a schematic flowchart of another decoding method provided by an embodiment of the present application. As shown in Figure 4, the method may include:
  • S401 Analyze the code stream and determine the absolute value of the quantization coefficient of the current block.
  • S402 Scan the absolute value of the quantization coefficient of the current block according to the preset scanning order to determine the number of non-zero quantization coefficients included in the current area.
  • S403 Based on the number of non-zero quantization coefficients, determine whether there is a target quantization coefficient with a hidden identifier in the current area.
  • S405 Determine the identification information corresponding to the target quantization coefficient according to the parity characteristics of the first sum value.
  • the embodiment of the present application proposes a method in AVM to use the parity or other characteristics of the absolute value of the non-zero quantization coefficient included in the current area to hide the identification information corresponding to a certain non-zero quantization coefficient. You can use For further use to improve encoding and decoding performance.
  • each transformation block into multiple areas in AVM; (2) utilizing the information in each area certain characteristics to hide the identification information corresponding to a certain non-zero quantization coefficient in the area (such as sign identification information); (3) by modifying the order of coefficient encoding and decoding to adapt to the proposed sign identification hiding technology.
  • each transformation block can be divided into one or more regions, each region contains at least one absolute value of a quantization coefficient, and there may be a target quantization coefficient with a hidden identifier in each region.
  • each transformation block can include 2 M pixel values, and each of the divided regions has 2 N pixel values.
  • 2 M divided by 2 N is a positive integer.
  • 2 N pixels are 2 N consecutive coefficients in a preset scanning order, and these coefficients may include zero or non-zero quantization coefficients.
  • it can also be divided into multiple areas that are continuous in the preset scanning order but have different numbers of pixels in the areas.
  • the identification information that needs to be hidden may be sign identification information of positive and negative signs.
  • the absolute values of the decoded quantization coefficients in the current area are summed, and the parity of the sum value is used to represent the positive and negative signs of the non-zero quantization coefficients with hidden signs.
  • Negative here, the sign inferred from the parity is used directly to be able to skip decoding the sign of the non-zero quantized coefficient.
  • non-zero quantization coefficient that hides positive and negative signs can be any non-zero quantization coefficient in the preset scanning order in the current area, or it can be a fixed non-zero quantization coefficient, such as the preset scanning in the area.
  • this decoding method needs to know the parity of the sum of the absolute values of the non-zero quantization coefficients in the current area before decoding the sign of the target quantized coefficient of the hidden identifier, before decoding the hidden identifier It is necessary to decode the absolute value of each quantization coefficient in the current region.
  • the identifiers 1 to 5 are first decoded, and then the part of the absolute value of each quantized coefficient exceeding 15 is decoded in order from the last non-zero coefficient of the transform block to the upper left corner of the transform block, and finally according to each
  • the parity of the sum of the absolute values of the quantization coefficients in a region and whether the preset conditions are met are used to determine the sign of the target quantization coefficient of the hidden identifier and to decode the signs of the remaining non-zero quantization coefficients.
  • the sign of the last non-zero quantization coefficient in the group in the preset scanning sequence using hiding technology can be determined based on the parity of the sum of the absolute values of the quantization coefficients in the group. .
  • variables SUBSIZE and SDHTHRESH respectively represent the size of each region and the threshold that the number of non-zero quantization coefficients in the region required to turn on the sign hiding technology in each region is greater than or equal to.
  • These two variables can be defined fixed values, or variable or fixed values encoded in the code stream. When encoded in the code stream, they can be encoded in the sequence header, image header, etc.
  • the sign hiding technology proposed in the embodiment of this application is implemented in AVM, in which the size of the SUBSIZE area used can be set to 16, and the threshold SDHTHRESH for enabling the sign hiding technology can be set to 4.
  • the sign hiding technology is turned on for the current area, if the sum of the absolute values of the non-zero quantization coefficients in the current area is an odd number, it means that the sign of the last non-zero quantization coefficient in the area in the preset scanning order is negative; if The sum of the absolute values of the non-zero quantization coefficients in the current area is an even number, which means that the sign of the last non-zero quantization coefficient in the area in the preset scanning order is positive.
  • Figure 5 is a schematic diagram of the test results under the All intra configuration provided by the embodiment of the present application
  • Figure 6 is a schematic diagram of the test results under the Random access configuration provided by the embodiment of the present application. It can be seen from Figures 5 and 6 that the technical solution of the embodiment of the present application can save code rate and improve encoding and decoding performance.
  • the identification bit encoding/decoding sequence of the related technology consists of 2 cycles (the first cycle is encoding/decoding identification 1 to 5, and the second cycle
  • the loop is encoding/decoding the sign and the part exceeding 15)) becomes 3 loops (the first loop is encoding/decoding identification 1 to 5, the second loop is encoding/decoding the part exceeding 15, and the third loop is encoding/decoding the part exceeding 15) loops are encoding/decoding signs).
  • the encoding sequence will first use the context model encoding/decoding (identification 1 ⁇ 5)), then use the bypass model encoding/decoding (the part beyond 15), and then use the context model encoding /Decoding (encoding/decoding the sign of the coefficient if the upper left corner coefficient is non-zero), and finally using the bypass model encoding/decoding (the sign of the remaining non-zero quantized coefficients) interspersed, this is a pair of hardware implementations Not friendly. Therefore, the embodiment of the present application can also modify the sign of the upper-left corner coefficient of the transform block from the context model to the bypass model for encoding/decoding.
  • the number of non-zero quantization coefficients in the current area can be greater than L as the sign hiding technology is used for the current block. opening conditions.
  • the distance value between the first non-zero quantization coefficient and the last non-zero quantization coefficient in the preset scanning order is greater than P, and P is a positive integer;
  • the distance value between the first non-zero quantized coefficient and the last coefficient in the preset scanning order is greater than P, and P is a positive integer;
  • the two loops in the related art are modified into three loops, and the loop order in the modified second loop and the third loop can start from the last non-zero quantized coefficient to the upper left of the transform block It can end at the corner, or it can start from the upper left corner and end at the last non-zero quantization coefficient. There is no limit here.
  • the following conditions can also be used to hide the sign of a certain non-zero quantization coefficient. Sign of zero quantization coefficient:
  • the non-zero quantization coefficient when it is determined that there is a non-zero quantization coefficient that needs to be hidden in the current area, the non-zero quantization coefficient will be
  • the identification information of the quantization coefficient (such as sign identification information) is hidden, that is, there is no need to encode/decode the identification information of the non-zero quantization coefficient, which can be determined directly based on the correlation characteristics of the absolute value of the non-zero quantization coefficient included in the current area.
  • the identification information of the non-zero quantization coefficient this can not only save the code rate and improve the encoding and decoding efficiency, but also improve the encoding and decoding performance.
  • FIG. 7 shows a schematic flowchart of an encoding method provided by an embodiment of the present application. As shown in Figure 7, the method may include:
  • S701 Determine the absolute value of the quantization coefficient of the current block.
  • the encoding method in the embodiment of the present application is applied to encoders, especially to encoders in AVM.
  • the coding method may specifically be a coding method for symbol identification concealment.
  • the sign identification corresponding to the absolute value of the quantization coefficient in the current block is mainly hidden, so as to further improve the encoding and decoding performance.
  • the absolute value of the quantization coefficient of the current block needs to be determined first.
  • the absolute value of each quantization coefficient may be represented by one or more multi-symbol identification information. Specifically, according to the size of the absolute value of the quantization coefficient, it can be represented by several types of multi-symbol identification information such as first identification information, second identification information, third identification information, fourth identification information and fifth identification information.
  • the method may further include:
  • five identification information can be set, namely the first identification information (which can be represented by identification 1), the second identification information (which can be represented by identification 2), and the third identification information (which can be represented by identification 3). ), fourth identification information (can be represented by identification 4) and fifth identification information (can be represented by identification 5), and each identification information can include multiple symbols, specifically four symbols (0,1,2,3 ).
  • the first identification information can be used to encode the part where the absolute value of the quantization coefficient of the current block is 0 to 3
  • the second identification information can be used to encode the part of the current block where the absolute value of the quantization coefficient is 3 to 6
  • the third identification information It can be used to encode the absolute value part of the quantization coefficient of the current block where the absolute value of the quantization coefficient of the current block is 6 to 9.
  • the fourth identification information can be used to encode the part of the current block where the absolute value of the quantization coefficient is 9 to 12.
  • the fifth identification information The information can be used to encode the part where the absolute value of the quantization coefficient of the current block is 12 to 15.
  • the absolute value of the quantization coefficient of the current block is 0, it means that the sign of the first identification information is 0; if the absolute value of the quantization coefficient of the current block is 1, it means that the sign of the first identification information is 1; If the absolute value of the quantization coefficient of the current block is 2, it means that the sign of the first identification information is 2; if the sign of the first identification information is 3, it means that the absolute value of the quantization coefficient of the current block is greater than or equal to 3, which means When not only the first identification information needs to be encoded, but also the second identification information needs to be encoded; where, if the absolute value of the quantization coefficient of the current block is 3, it means that the sign of the second identification information is 0; if the absolute value of the quantization coefficient of the current block is 4, then it means that the sign of the second identification information is 1; if the absolute value of the quantization coefficient of the current block is 5, it means that the sign of the second identification information is 2; if the absolute value of the quantization coefficient of the current block
  • the third identification information needs to be continued to be encoded.
  • the fifth identification information needs to be encoded.
  • Information where, if the absolute value of the quantization coefficient of the current block is 12, it means that the sign of the fifth identification information is 0; if the absolute value of the quantization coefficient of the current block is 13, it means that the sign of the fifth identification information is 1; If the absolute value of the quantization coefficient of the current block is 14, it means that the sign of the fifth identification information is 2; if the absolute value of the quantization coefficient of the current block is greater than or equal to 15, it means that the sign of the fifth identification information is 3; if If the absolute value of the quantization coefficient of the current block is greater than or equal to 15, then the absolute value of the quantization coefficient of the current block needs to be further encoded.
  • the method may also include:
  • the bypass model is used to encode the absolute value of the quantization coefficient of the current block, and the resulting coded bits are written into the code stream.
  • the part greater than or equal to 15 can be encoded using the bypass model (such as Exponential Golomb coding); and the part less than 15, the first identification information, the second identification information, the third identification information, the fourth identification information and the fifth identification information (i.e., identification 1 to 5) can be encoded using the context model.
  • the first identification information i.e., identification 1
  • the remaining four identification information i.e., identification 2 to 5
  • encoding the absolute value of the quantization coefficient of the current block may include two cyclic processes: encoding the identifiers 1 to 5 according to the first cyclic sequence, and then encoding the absolute value of the quantization coefficient greater than or equal to 1 in the second cyclic sequence according to the second cyclic sequence. or part equal to 15.
  • both the first loop order and the second loop order are the order from the last non-zero quantized coefficient of the current block to the upper left position of the current block; or,
  • the first loop order is the order from the last non-zero quantized coefficient of the current block to the upper left position of the current block
  • the second loop order is the order from the upper left position of the current block to the last non-zero quantized coefficient of the current block.
  • the encoding identifiers 1 to 5 can be encoded in a cyclic order from the last non-zero quantized coefficient of the current block to the upper left position (i.e., the upper left corner); and then in a cyclic order from the upper left corner of the current block to the last non-zero quantized coefficient.
  • Circular order encoding the part where the absolute value of the quantization coefficient is greater than or equal to 15; alternatively, you can also encode the identifiers 1 to 5 according to the circular order from the last non-zero quantization coefficient of the current block to the upper left corner; and then still follow the order from the current block to the upper left corner.
  • the circular sequence from the last non-zero quantization coefficient to the upper left corner encodes the part where the absolute value of the quantization coefficient is greater than or equal to 15.
  • S702 Scan the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient to be hidden in the current area of the current block.
  • the preset scanning order may be diagonal, Zigzag, horizontal, vertical, 4 ⁇ 4 sub-block scanning or any other scanning order, which is not limited here.
  • the current block may be divided into one or more areas; where the current area is the currently coded area in the one or more areas. Therefore, in some embodiments, the area division of the current block may include: in a preset scanning order, area division of the current block according to the preset size value to determine at least one area; wherein the current area is at least one area The current encoding area in .
  • dividing the current block into regions according to a preset size value and determining at least one region may include:
  • the preset size value is the preset size of each area.
  • the preset size value may be a fixed value, or a variable value or a fixed value written in the code stream.
  • the value of the preset size value may be set to 16.
  • the preset size value when the preset size value is written into the code stream, it can be encoded in the sequence header, image header, etc., without any limitation here.
  • the sizes of the multiple areas when the current block is divided into multiple areas according to the preset size value, the sizes of the multiple areas may be the same or different.
  • scanning the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient to be hidden in the current area of the current block may include:
  • determining whether there is a target quantization coefficient to be hidden in the current area according to the number of non-zero quantization coefficients may include: if the number of non-zero quantization coefficients is greater than a preset number, then determining There is a target quantization coefficient in the current area; if the number of non-zero quantization coefficients is less than or equal to the preset number, it is determined that the target quantization coefficient does not exist in the current area.
  • scanning the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient to be hidden in the current area of the current block may include:
  • the first distance value it is determined whether there is a target quantization coefficient of the identity to be hidden in the current area.
  • determining whether there is a target quantization coefficient of the identity to be hidden in the current area according to the first distance value may include: if the first distance value is greater than the first distance threshold, determining whether there is a target quantization coefficient in the current area. There is a target quantization coefficient; if the first distance value is less than or equal to the first distance threshold, it is determined that the target quantization coefficient does not exist in the current area.
  • scanning the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient to be hidden in the current area of the current block may include:
  • the second distance value it is determined whether there is a target quantization coefficient of the identity to be hidden in the current area.
  • determining whether there is a target quantization coefficient of the identity to be hidden in the current area according to the second distance value may include: if the second distance value is greater than the second distance threshold, determining whether there is a target quantization coefficient in the current area. The target quantization coefficient exists; if the second distance value is less than or equal to the second distance threshold, it is determined that the target quantization coefficient does not exist in the current area.
  • scanning the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient to be hidden in the current area of the current block may include:
  • the first sum value it is determined whether there is a target quantization coefficient of the identity to be hidden in the current area.
  • determining whether there is a target quantization coefficient to be hidden in the current area according to the first sum value may include: if the first sum value is greater than the sum threshold, determining whether there is a target quantization coefficient in the current area. Target quantization coefficient; if the first sum value is less than or equal to the sum threshold, it is determined that the target quantization coefficient does not exist in the current area.
  • whether there is a target quantization coefficient to be hidden in the current area of the current block can be determined based on the number of non-zero quantization coefficients included in the current area being greater than the preset number. It can also be determined based on the distance value between the first non-zero quantized coefficient and the last non-zero quantized coefficient in the current area in the preset scanning order being greater than the first distance threshold, or it can also be determined based on the preset scanning in the current area. The distance value between the first non-zero quantization coefficient and the last quantization coefficient in the sequence is determined to be greater than the second distance threshold. It can even be determined based on the sum of the absolute values of the quantization coefficients included in the current area being greater than the sum threshold. Here No limitation is placed on this.
  • the preset number, the first distance threshold, the second distance threshold, and the sum threshold can all be used as preset measurement indicators for determining whether the identification hiding technology is enabled in the current area.
  • the settings of the preset number, the first distance threshold, the second distance threshold, the sum threshold, etc. may be fixed values, or may be variable values or fixed values written in the code stream. When written into the code stream, it can be encoded in the sequence header, image header, etc., and there is no limit to this here.
  • the method also It includes: encoding the preset parameter value, and writing the obtained encoded bits into the code stream; wherein the preset parameter value includes at least one of the following: preset number, first distance threshold, and second distance threshold. , sum threshold and preset size value.
  • the preset parameter value can be a fixed value, or a variable value or a fixed value written in the code stream.
  • the preset parameter value can be encoded in the sequence header, image header, etc., without any limitation here.
  • the method may also include: when it is determined that the target quantization coefficient exists in the current area, obtain the target quantization coefficient at the target position in the current area. Non-zero quantization coefficient, determine the non-zero quantization coefficient at the target position as the target quantization coefficient.
  • the non-zero quantization coefficient at the target position is the Kth non-zero quantization coefficient in the current area on the preset scanning order, K is an integer greater than zero and less than or equal to N, and N is The number of non-zero quantization coefficients included in the current area.
  • the non-zero quantized coefficient at the target position is the last non-zero quantized coefficient in the current area in the preset scanning order.
  • the target quantization coefficient of the mark to be hidden can be any non-zero quantization coefficient in the preset scanning order in the current area, or it can be a fixed non-zero quantization coefficient, such as the current
  • the first non-zero quantization coefficient, the last non-zero quantization coefficient, or the i-th non-zero quantization coefficient (i is less than or equal to L) in the preset scanning order in the area, etc., are not limited here.
  • the quantization included in the current area is The absolute value of the coefficient determines the identification information corresponding to the target quantization coefficient, which may include:
  • the absolute values of the quantization coefficients included in the current area are added and calculated to obtain the first sum value; according to the parity characteristics of the first sum value, identification information corresponding to the target quantization coefficient is determined.
  • determining the identification information corresponding to the target quantization coefficient according to the parity characteristics of the first sum value may include: if the first sum value is an odd number, then Determine the identification information to be a negative sign; if the first sum value is an even number, determine the identification information to be a positive sign; or, if the first sum value is an odd number, determine the identification information to be a positive sign; if the identification information is an even number, determine the identification information Information has a negative sign.
  • determining the identification information corresponding to the target quantization coefficient based on the absolute value of the quantization coefficient included in the current region may include:
  • determining the identification information corresponding to the target quantization coefficient according to the parity characteristics of the second sum value may include: if the second sum value is an odd number, then Determine the identification information to be a negative sign; if the second sum value is an even number, determine the identification information to be a positive sign; or, if the second sum value is an odd number, determine the identification information to be a positive sign; if the second sum value is an even number, then Make sure the identification information is negative.
  • determining the identification information corresponding to the target quantization coefficient based on the absolute value of the quantization coefficient included in the current region may include:
  • determining the identification information corresponding to the target quantization coefficient according to the parity characteristics of the number of non-zero quantization coefficients may include: if the number of non-zero quantization coefficients is If the number of non-zero quantization coefficients is an even number, then the identification information is determined to be a positive sign; or if the number of non-zero quantization coefficients is an odd number, then the identification information is determined to be a positive sign; if the number of non-zero quantization coefficients is an odd number, the identification information is determined to be a positive sign; If the number is an even number, it is determined that the identification information has a negative sign.
  • the identification information corresponding to the target quantization coefficient that needs to be hidden can be determined based on the parity of the sum of the absolute values of the quantization coefficients included in the current area, or can also be determined based on the current area. It is determined by using the parity of the sum of the absolute values of several quantization coefficients obtained by decoding markers 1 to 5, or it can also be determined based on the parity of the number of non-zero quantization coefficients included in the current area. There is no limit to this here.
  • the identification information that needs to be hidden may be sign identification information of positive and negative signs. For example, taking the determination of the sign based on the parity of the sum of the absolute values of the quantization coefficients included in the current area as an example, if the sum of the absolute values of the quantization coefficients included in the current area is an odd number, then it can be determined that the identification information has a negative sign, That is, the target quantization coefficient is a negative value; if the sum of the absolute values of the quantization coefficients included in the current area is an even number, then it can be determined that the identification information is a positive sign, that is, the target quantization coefficient is a positive value.
  • the identification information is a positive sign, that is, the target quantization coefficient is a positive value; if the sum of the absolute values of the quantization coefficients included in the current area is an even number, then it can be It is determined that the identification information has a negative sign, that is, the target quantization coefficient is a negative value.
  • the method may further include: encoding identification information corresponding to non-zero quantization coefficients in each area of the current block except the target quantization coefficient in a third loop sequence, and writing the resulting encoded bits into the code stream.
  • the third loop sequence is the sequence from the last non-zero quantized coefficient of the current block to the upper left position of the current block; or, the third loop sequence is the sequence from the upper left position of the current block to the last non-zero quantized coefficient of the current block. order.
  • the embodiment of the present application includes three cyclic processes: (1) encoding the first identification information, the second identification information, the third identification information, the fourth identification information and the fifth identification according to the first cycle sequence information (i.e., identifiers 1 to 5), (2) encode the part of the absolute value of the quantization coefficient of the current block that is greater than or equal to 15 according to the second cycle sequence, (3) encode the parts of each area of the current block in the third cycle sequence, Identification information corresponding to non-zero quantization coefficients other than the target quantization coefficient.
  • the first cycle sequence information i.e., identifiers 1 to 5
  • the first loop sequence is the sequence from the last non-zero quantized coefficient of the current block to the upper left position of the current block; while the second loop sequence and the third loop sequence are both It can be the order starting from the last non-zero quantization coefficient of the current block to the upper left position of the current block, or it can be the order starting from the upper left position of the current block to the last non-zero quantization coefficient of the current block.
  • the embodiment of the present application is This does not impose any limitations.
  • the method may also include: if the first quantization coefficient at the upper left position of the current block is non-zero quantization coefficient, use the context model to encode the identification information corresponding to the first quantization coefficient, and use the bypass model to encode the identification information corresponding to the non-zero quantization coefficient in the current block except the first quantization coefficient and the target quantization coefficient in each region. Identification information is encoded.
  • the encoding sequence will first use the context model to encode the first identification information, the second identification information, the third identification information, the fourth identification information and the fifth identification information, and then use the bypass
  • the model encodes the part greater than or equal to 15, then uses the context model to encode the sign corresponding to the non-zero quantized coefficient at the upper left position, and finally uses the bypass model to encode the sign corresponding to the remaining non-zero quantized coefficients. This is done in hardware. Not implementation friendly.
  • the method may further include: using a bypass model to encode identification information corresponding to non-zero quantization coefficients in each area of the current block except the target quantization coefficient, and converting the resulting encoded bits Write code stream.
  • the method may also include:
  • the preset element identification information is encoded, and the obtained encoded bits are written into the code stream.
  • the preset element identification information is at least one of the following level identification information: sequence level, image level, slice level and block level. )class.
  • determining the preset element identification information may include:
  • the preset element identification information is determined to be the second value.
  • the first value and the second value are different, and the first value and the second value may be in parameter form or in numeric form.
  • the preset element identification information may be a parameter written in the profile, or may be the value of a flag, which is not specifically limited here.
  • enable flag bit (enable_flag) and disable flag bit (disable_flag).
  • the value of the enabled flag bit is the first value
  • the value of the non-enabled flag bit is the second value
  • the first value can be set to 1
  • the second value can be Set to 0; alternatively, the first value can also be set to true, and the second value can also be set to false; however, the embodiment of this application does not specifically limit it.
  • the embodiment of this application proposes dividing the current block into multiple areas in AVM; and using certain characteristics in each area to hide the identification information corresponding to a certain non-zero quantization coefficient in the area ( For example, sign identification information); and by modifying the order of coefficient encoding to adapt to the proposed sign identification hiding technology, the coding performance can be further improved.
  • the embodiment of the present application provides an encoding method, by determining the absolute value of the quantization coefficient of the current block; scanning the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a mark to be hidden in the current area of the current block.
  • Target quantization coefficient when it is determined that the target quantization coefficient exists in the current area, the identification information corresponding to the target quantization coefficient is determined based on the absolute value of the quantization coefficient included in the current area.
  • the identification information (such as sign identification information) of the non-zero quantized coefficient is hidden, that is, there is no need to encode/decode the non-zero quantized coefficient.
  • the identification information can be directly determined based on the relevant characteristics of the absolute value of the non-zero quantization coefficient included in the current area; this can not only save the code rate and improve the encoding and decoding efficiency, but also improve the encoding and decoding performance. .
  • FIG. 8 shows a schematic flow chart of another encoding method provided by an embodiment of the present application. As shown in Figure 8, the method may include:
  • S801 Determine the absolute value of the quantization coefficient of the current block.
  • S802 Scan the absolute value of the quantization coefficient of the current block according to the preset scanning order to determine the number of non-zero quantization coefficients included in the current area.
  • S803 Based on the number of non-zero quantization coefficients, determine whether there is a target quantization coefficient to be hidden in the current area.
  • the embodiment of the present application proposes a method in AVM to use the parity or other characteristics of the absolute value of the non-zero quantization coefficient included in the current area to hide the identification information corresponding to a certain non-zero quantization coefficient. You can use For further use to improve encoding and decoding performance.
  • each transformation block into multiple areas in AVM; (2) utilizing the information in each area certain characteristics to hide the identification information corresponding to a certain non-zero quantization coefficient in the area (such as sign identification information); (3) by modifying the order of coefficient encoding to adapt to the proposed sign identification hiding technology.
  • each transformation block can be divided into one or more regions, each region contains at least one absolute value of a quantization coefficient, and there may be a target quantization coefficient to be hidden in each region.
  • each transformation block can include 2 M pixel values, and each of the divided regions has 2 N pixel values.
  • 2 M divided by 2 N is a positive integer.
  • 2 N pixels are 2 N consecutive coefficients in a preset scanning order, and these coefficients may include zero or non-zero quantization coefficients.
  • it can also be divided into multiple areas that are continuous in the preset scanning order but have different numbers of pixels in the areas.
  • the identification information that needs to be hidden may be sign identification information of positive and negative signs.
  • the absolute values of the encoded quantization coefficients in the current area are summed, and the parity of the sum value is used to represent the positive and negative signs of the non-zero quantization coefficients with hidden signs.
  • Negative here, the sign inferred from the parity is used directly to be able to skip encoding the sign of the non-zero quantized coefficient.
  • non-zero quantization coefficient that hides positive and negative signs can be any non-zero quantization coefficient in the preset scanning order in the current area, or it can be a fixed non-zero quantization coefficient, such as the preset scanning in the area.
  • this encoding method can first encode the absolute value of each quantization coefficient in the current region before encoding the sign corresponding to the non-zero quantization coefficient. Therefore, in the embodiment of the present application, the identifiers 1 to 5 are first encoded, and then the part of the absolute value of each quantized coefficient exceeding 15 is encoded in order from the last non-zero coefficient of the transform block to the upper left corner of the transform block, and finally according to each The parity of the sum of the absolute values of the quantization coefficients in a region and whether the preset conditions are met are used to determine the sign of the target quantization coefficient to be hidden and to encode the signs of the remaining non-zero quantization coefficients.
  • the code description of the encoding process may also be as shown in Table 2.
  • Table 2 the process of coding identification 1-5 in the first loop remains unchanged.
  • the quantized coefficients are divided into multiple groups according to each SUBSIZE, and the signs in each group of quantized coefficients are encoded one by one according to the preset scanning order.
  • variables SUBSIZE and SDHTHRESH respectively represent the size of each region and the threshold that the number of non-zero quantization coefficients in the region required to turn on the sign hiding technology in each region is greater than or equal to.
  • These two variables can be defined fixed values, or variable or fixed values encoded in the code stream. When encoded in the code stream, they can be encoded in the sequence header, image header, etc.
  • the sign hiding technology proposed in the embodiment of this application is implemented in AVM, in which the size of the SUBSIZE area used can be set to 16, and the threshold SDHTHRESH for enabling the sign hiding technology can be set to 4.
  • the sign hiding technology is turned on for the current area, if the sum of the absolute values of the non-zero quantization coefficients in the current area is an odd number, it means that the sign of the last non-zero quantization coefficient in the area in the preset scanning order is negative; if The sum of the absolute values of the non-zero quantization coefficients in the current area is an even number, which means that the sign of the last non-zero quantization coefficient in the area in the preset scanning order is positive.
  • the embodiment of the present application also provides a code stream.
  • the code stream is generated by bit encoding based on the information to be encoded.
  • the information to be encoded includes at least one of the following:
  • the preset element identification information is used to indicate whether the current block uses identification hiding technology
  • the first identification information, the second identification information, the third identification information, the fourth identification information and the fifth identification information are used to determine
  • the preset parameter value may include at least one of the following: a preset number, a first distance threshold, a second distance threshold, a sum threshold, and a preset size value.
  • the code stream is transmitted from the encoding end to the decoding end; then at the decoding end, it can be determined whether the current block uses identification concealment technology by parsing the code stream; and by parsing the code
  • the preset number, the first distance threshold, the second distance threshold, the sum threshold and the preset size value can be determined through the flow (if the preset number, the first distance threshold, the second distance threshold, the sum threshold and the preset size value are assuming that the size value is written into the code stream); and by parsing the code stream, the absolute value of the quantization coefficient of the current block can also be determined.
  • the non-zero quantization coefficient when it is determined that there is a non-zero quantization coefficient that needs to be hidden in the current area, the non-zero quantization coefficient will be
  • the identification information of the quantization coefficient (such as sign identification information) is hidden, that is, there is no need to encode/decode the identification information of the non-zero quantization coefficient, which can be determined directly based on the correlation characteristics of the absolute value of the non-zero quantization coefficient included in the current area.
  • the identification information of the non-zero quantization coefficient this can not only save the code rate and improve the encoding and decoding efficiency, but also improve the encoding and decoding performance.
  • FIG. 9 shows a schematic structural diagram of an encoder 90 provided by an embodiment of the present application.
  • the encoder 90 may include: a first determination unit 901 and a first judgment unit 902; wherein,
  • the first determination unit 901 is configured to determine the absolute value of the quantization coefficient of the current block
  • the first judgment unit 902 is configured to scan the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient to be hidden in the current area of the current block;
  • the first determination unit 901 is further configured to determine identification information corresponding to the target quantization coefficient based on the absolute value of the quantization coefficient included in the current region when it is determined that the target quantization coefficient exists in the current region.
  • the first determination unit 901 is further configured to scan the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine the number of non-zero quantization coefficients included in the current area; and according to the non-zero quantization coefficient number to determine whether there is a target quantization coefficient of the identity to be hidden in the current area.
  • the first judgment unit 902 is also configured to determine that the target quantization coefficient exists in the current area if the number of non-zero quantization coefficients is greater than the preset number; if the number of non-zero quantization coefficients is less than or equal to the preset number , then it is determined that the target quantization coefficient does not exist in the current area.
  • the first determination unit 901 is further configured to scan the absolute value of the quantization coefficient of the current block according to a preset scanning order, and determine the first non-zero value in the current area of the current block in the preset scanning order. a first distance value between the quantized coefficient and the last non-zero quantized coefficient; and determining whether there is a target quantized coefficient to be hidden in the current area according to the first distance value.
  • the first judgment unit 902 is further configured to determine that the target quantization coefficient exists in the current area if the first distance value is greater than the first distance threshold; and if the first distance value is less than or equal to the first distance threshold, Then it is determined that the target quantization coefficient does not exist in the current area.
  • the first determination unit 901 is further configured to scan the absolute value of the quantization coefficient of the current block according to a preset scanning order, and determine the first non-zero quantization coefficient in the current area in the preset scanning order and a second distance value between the last quantized coefficients; and based on the second distance value, determine whether there is a target quantized coefficient to be hidden in the current area.
  • the first judgment unit 902 is further configured to determine that the target quantization coefficient exists in the current area if the second distance value is greater than the second distance threshold; if the second distance value is less than or equal to the second distance threshold, then Determine that the target quantization coefficient does not exist in the current area.
  • the first determination unit 901 is further configured to scan the absolute value of the quantization coefficient of the current block according to a preset scanning order, determine the absolute value of the quantization coefficient included in the current area; and determine the absolute value of the quantization coefficient included in the current area. The values are added together to obtain a first sum value; and based on the first sum value, it is determined whether there is a target quantization coefficient of the identity to be hidden in the current area.
  • the first judgment unit 902 is further configured to determine that the target quantization coefficient exists in the current area if the first sum value is greater than the sum threshold; if the first sum value is less than or equal to the sum threshold, determine that the current The target quantization coefficient does not exist in the region.
  • the encoder 90 may further include a first dividing unit 903 configured to divide the current block into regions according to the preset size value in a preset scanning order to determine at least one region; wherein, The current region is the currently coded region in at least one region.
  • the first dividing unit 903 is further configured to divide the current block into equal areas according to the preset size value, and determine at least one area, wherein each area includes the same number of quantization coefficients; or, according to the preset size value, Assume that the size value is used to divide the current block into unequal areas and determine at least one area, where each area includes a different number of quantization coefficients.
  • the encoder 90 may also include an encoding unit 904 configured to encode the preset parameter value and write the resulting encoded bits into the code stream; wherein the preset parameter value includes the following At least one of: the preset number, the first distance threshold, the second distance threshold, the sum threshold and the preset size value.
  • the first determination unit 901 is further configured to obtain the non-zero quantization coefficient at the target position in the current area when it is determined that the target quantization coefficient exists in the current area; and quantize the non-zero quantization coefficient at the target position. The coefficient is determined as the target quantization coefficient.
  • the non-zero quantized coefficient at the target position is the last non-zero quantized coefficient in the current area on the preset scanning order.
  • the non-zero quantization coefficient at the target position is the Kth non-zero quantization coefficient in the current area on the preset scanning order, K is an integer greater than zero and less than or equal to N, and N is the current area. The number of non-zero quantization coefficients included.
  • the first determination unit 901 is further configured to perform an addition calculation on the absolute values of the quantization coefficients included in the current area to obtain the first sum value; and determine the target quantization coefficient corresponding to the parity characteristic of the first sum value. Identification information.
  • the first judgment unit 902 is also configured to determine that the identification information is a negative sign if the first sum value is an odd number when the identification information is a symbol identification information; if the first sum value is an even number, Then it is determined that the identification information is a positive sign; or, if the first sum value is an odd number, it is determined that the identification information is a positive sign; if the identification information is an even number, it is determined that the identification information is a negative sign.
  • the encoding unit 904 is also configured to, after determining the absolute value of the quantization coefficient of the current block, if the absolute value of the quantization coefficient of the current block satisfies one of the following: 0, 1, 2, or greater than or equal to 3, Then determine the first identification information, encode the first identification information, and write the obtained encoded bits into the code stream; if the absolute value of the quantization coefficient of the current block satisfies one of the following: 3, 4, 5 or greater than or If equal to 6, continue to determine the second identification information, encode the second identification information, and write the resulting encoded bits into the code stream; if the absolute value of the quantization coefficient of the current block satisfies one of the following: 6, 7, 8 or greater than or equal to 9, continue to determine the third identification information, encode the third identification information, and write the resulting encoded bits into the code stream; if the absolute value of the quantization coefficient of the current block meets one of the following: 9, 10, 11 or greater than or equal to 12, continue to determine the fourth identification information, encode
  • the encoding unit 904 is further configured to, after determining the absolute value of the quantization coefficient of the current block, when the absolute value of the quantization coefficient of the current block is less than 15, use the context model to identify the first identification information in accordance with the first loop sequence. , the second identification information, the third identification information, the fourth identification information and the fifth identification information are encoded, and the obtained encoded bits are written into the code stream; and when the absolute value of the quantization coefficient of the current block is greater than or equal to 15, according to In the second loop sequence, the bypass model is used to encode the absolute value of the quantization coefficient of the current block, and the resulting encoded bits are written into the code stream.
  • both the first loop order and the second loop order are the order from the last non-zero quantized coefficient of the current block to the upper left position of the current block; or, the first loop order is the order from the last non-zero quantized coefficient of the current block to the upper left position of the current block.
  • the order of the zero quantization coefficient toward the upper left position of the current block, and the second cycle order is the order from the upper left position of the current block to the last non-zero quantization coefficient of the current block.
  • the first determination unit 901 is further configured to obtain several absolute values of quantization coefficients less than 15 in the current area; and perform addition calculations on the absolute values of several quantization coefficients to obtain a second sum value; and according to the first The parity and even characteristics of the two sum values determine the identification information corresponding to the target quantization coefficient.
  • the first judgment unit 902 is also configured to determine that the identification information is a negative sign if the second sum value is an odd number when the identification information is a symbol identification information; if the second sum value is an even number, Then it is determined that the identification information is a positive sign; or, if the second sum value is an odd number, it is determined that the identification information is a positive sign; if the second sum value is an even number, it is determined that the identification information is a negative sign.
  • the first determination unit 901 is further configured to perform non-zero quantization coefficient statistics on the absolute values of the quantization coefficients included in the current region, determine the number of non-zero quantization coefficients included in the current region; and based on the non-zero quantization coefficients The parity and even characteristics of the number determine the identification information corresponding to the target quantization coefficient.
  • the first judgment unit 902 is also configured to determine that the identification information is a negative sign if the number of non-zero quantization coefficients is an odd number when the identification information is symbol identification information; if the number of non-zero quantization coefficients is If the number of non-zero quantization coefficients is an even number, the identification information is determined to be a positive sign; or if the number of non-zero quantization coefficients is an odd number, the identification information is determined to be a positive sign; if the number of non-zero quantization coefficients is an even number, the identification information is determined to be a negative sign.
  • the encoding unit 904 is further configured to encode the identification information corresponding to the non-zero quantization coefficients in each area of the current block except the target quantization coefficient according to the third loop sequence, and convert the resulting encoded bits Write the code stream; wherein, the third loop sequence is from the last non-zero quantized coefficient of the current block to the upper left position of the current block; or, the third loop sequence is from the upper left position of the current block to the last one of the current block.
  • the order of non-zero quantization coefficients is further configured to encode the identification information corresponding to the non-zero quantization coefficients in each area of the current block except the target quantization coefficient according to the third loop sequence, and convert the resulting encoded bits Write the code stream; wherein, the third loop sequence is from the last non-zero quantized coefficient of the current block to the upper left position of the current block; or, the third loop sequence is from the upper left position of the current block to the last one of the current block.
  • the encoding unit 904 is also configured to use the context model to encode the identification information corresponding to the first quantized coefficient if the first quantized coefficient at the upper left position of the current block is a non-zero quantized coefficient, and use the sidebar to encode the identification information corresponding to the first quantized coefficient.
  • the road model encodes identification information corresponding to non-zero quantization coefficients in the current block except the first quantization coefficient and the target quantization coefficient in each region.
  • the encoding unit 904 is also configured to use the bypass model to encode the identification information corresponding to the non-zero quantization coefficients in each area of the current block except the target quantization coefficient, and write the resulting encoding bits into Input code stream.
  • the first determining unit 901 is also configured to determine preset element identification information; wherein the preset element identification information is used to indicate whether the current block uses identification hiding technology;
  • the encoding unit 904 is also configured to encode the preset element identification information and write the resulting encoded bits into the code stream.
  • the first determining unit 901 is also configured to determine that the preset element identification information is the first value if the current block uses identification hiding technology; if the current block does not use identification hiding technology, determine the preset element identification information. Information is the second value.
  • the preset element identification information is identification information at at least one of the following levels: sequence level, image level, slice level, and block level.
  • the "unit" may be part of a circuit, part of a processor, part of a program or software, etc., and of course may also be a module, or may be non-modular.
  • each component in this embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software function modules.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially either The part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes a number of instructions to make a computer device (can It is a personal computer, server, or network device, etc.) or processor that executes all or part of the steps of the method described in this embodiment.
  • the aforementioned storage media include: U disk, mobile hard disk, Read Only Memory (ROM), Random Access Memory (RAM), magnetic disk or optical disk and other media that can store program code.
  • embodiments of the present application provide a computer storage medium for use in the encoder 90 .
  • the computer storage medium stores a computer program.
  • the computer program is executed by the first processor, any one of the foregoing embodiments can be implemented. Methods.
  • the encoder 90 may include: a first communication interface 1001 , a first memory 1002 and a first processor 1003 ; the various components are coupled together through a first bus system 1004 .
  • the first bus system 1004 is used to implement connection communication between these components.
  • the first bus system 1004 also includes a power bus, a control bus and a status signal bus.
  • various buses are labeled as the first bus system 1004 in FIG. 10 . in,
  • the first communication interface 1001 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
  • the first memory 1002 is used to store a computer program capable of running on the first processor 1003;
  • the first processor 1003 is used to execute: when running the computer program:
  • identification information corresponding to the target quantization coefficient is determined based on the absolute value of the quantization coefficient included in the current area.
  • the first memory 1002 in the embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories.
  • non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be Random Access Memory (RAM), which is used as an external cache.
  • RAM static random access memory
  • DRAM dynamic random access memory
  • DRAM synchronous dynamic random access memory
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDRSDRAM
  • enhanced SDRAM ESDRAM
  • Synchlink DRAM SLDRAM
  • Direct Rambus RAM DRRAM
  • the first memory 1002 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
  • the first processor 1003 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the first processor 1003 .
  • the above-mentioned first processor 1003 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or a ready-made programmable gate array (Field Programmable Gate Array, FPGA). or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the steps of the method disclosed in conjunction with the embodiments of the present application can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field.
  • the storage medium is located in the first memory 1002.
  • the first processor 1003 reads the information in the first memory 1002 and completes the steps of the above method in combination with its hardware.
  • the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof.
  • the processing unit can be implemented in one or more Application Specific Integrated Circuits (ASIC), Digital Signal Processing (DSP), Digital Signal Processing Device (DSP Device, DSPD), programmable Logic device (Programmable Logic Device, PLD), Field-Programmable Gate Array (FPGA), general-purpose processor, controller, microcontroller, microprocessor, and other devices used to perform the functions described in this application electronic unit or combination thereof.
  • ASIC Application Specific Integrated Circuits
  • DSP Digital Signal Processing
  • DSP Device Digital Signal Processing Device
  • DSPD Digital Signal Processing Device
  • PLD programmable Logic Device
  • FPGA Field-Programmable Gate Array
  • the technology described in this application can be implemented through modules (such as procedures, functions, etc.) that perform the functions described in this application.
  • Software code may be stored in memory and executed by a processor.
  • the memory can be implemented in the processor or external to the processor.
  • the first processor 1003 is further configured to perform the method described in any one of the preceding embodiments when running the computer program.
  • This embodiment provides an encoder that hides the identification information (such as sign identification information) of the non-zero quantization coefficient when there is a non-zero quantization coefficient that needs to be hidden in the current area, That is, there is no need to encode the identification information of the non-zero quantization coefficient.
  • the identification information of the non-zero quantization coefficient can be determined directly based on the correlation characteristics of the absolute value of the non-zero quantization coefficient included in the current area. This can not only save the code rate, but also improve the coding rate. decoding efficiency, and can also improve encoding and decoding performance.
  • FIG. 11 shows a schematic structural diagram of a decoder 110 provided by an embodiment of the present application.
  • the decoder 110 may include: a decoding unit 1101, a second judgment unit 1102 and a second determination unit 1103; wherein,
  • the decoding unit 1101 is configured to parse the code stream and determine the absolute value of the quantization coefficient of the current block
  • the second judgment unit 1102 is configured to scan the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine whether there is a target quantization coefficient with a hidden identifier in the current area of the current block;
  • the second determination unit 1103 is configured to determine the identification information corresponding to the target quantization coefficient according to the absolute value of the quantization coefficient included in the current area when it is determined that the target quantization coefficient exists in the current area.
  • the second determination unit 1103 is further configured to scan the absolute value of the quantization coefficient of the current block according to a preset scanning order to determine the number of non-zero quantization coefficients included in the current area; and according to the non-zero quantization coefficient number to determine whether there is a target quantization coefficient of hidden identification in the current area.
  • the second judgment unit 1102 is also configured to determine that the target quantization coefficient exists in the current area if the number of non-zero quantization coefficients is greater than the preset number; if the number of non-zero quantization coefficients is less than or equal to the preset number , then it is determined that the target quantization coefficient does not exist in the current area.
  • the second determination unit 1103 is further configured to scan the absolute value of the quantization coefficient of the current block according to a preset scanning order, and determine the first non-zero value in the current area of the current block in the preset scanning order. a first distance value between the quantized coefficient and the last non-zero quantized coefficient; and based on the first distance value, determine whether there is a target quantized coefficient with a hidden identifier in the current area.
  • the second judgment unit 1102 is also configured to determine that the target quantization coefficient exists in the current area if the first distance value is greater than the first distance threshold; if the first distance value is less than or equal to the first distance threshold, then Determine that the target quantization coefficient does not exist in the current area.
  • the second determination unit 1103 is further configured to scan the absolute value of the quantization coefficient of the current block according to the preset scanning order, and determine the first non-zero quantization coefficient in the current area in the preset scanning order and a second distance value between the last quantization coefficients; and based on the second distance value, determine whether there is a target quantization coefficient of the hidden identifier in the current area.
  • the second judgment unit 1102 is further configured to determine that the target quantization coefficient exists in the current area if the second distance value is greater than the second distance threshold; if the second distance value is less than or equal to the second distance threshold, then Determine that the target quantization coefficient does not exist in the current area.
  • the second determination unit 1103 is further configured to scan the absolute value of the quantization coefficient of the current block according to a preset scanning order, and determine the absolute value of the quantization coefficient included in the current area;
  • the absolute values of the quantization coefficients included in the current area are added to obtain a first sum value; and based on the first sum value, it is determined whether there is a target quantization coefficient with a hidden identifier in the current area.
  • the second judgment unit 1102 is further configured to determine that the target quantization coefficient exists in the current region if the first sum value is greater than the sum threshold; if the first sum value is less than or equal to the sum threshold, determine that the current The target quantization coefficient does not exist in the region.
  • the decoder 110 may further include a second dividing unit 1104 configured to divide the current block into regions according to the preset size value in a preset scanning order to determine at least one region; wherein, The current area is a currently decoded area in at least one area.
  • the second dividing unit 1104 is further configured to divide the current block into equal areas according to the preset size value, and determine at least one area, wherein each area includes the same number of quantization coefficients; or, according to the preset size value, Assume that the size value is used to divide the current block into unequal areas and determine at least one area, where each area includes a different number of quantization coefficients.
  • the decoding unit 1101 is also configured to parse the code stream and determine a preset parameter value; wherein the preset parameter value includes at least one of the following: a preset number, a first distance threshold, a second distance threshold , sum threshold and preset size value.
  • the second determination unit 1103 is further configured to obtain the non-zero quantization coefficient at the target position in the current area when it is determined that the target quantization coefficient exists in the current area; and quantize the non-zero quantization coefficient at the target position. The coefficient is determined as the target quantization coefficient.
  • the non-zero quantized coefficient at the target position is the last non-zero quantized coefficient in the current area on the preset scanning order.
  • the non-zero quantization coefficient at the target position is the Kth non-zero quantization coefficient in the current area on the preset scanning order, K is an integer greater than zero and less than or equal to N, and N is the current area. The number of non-zero quantization coefficients included.
  • the second determination unit 1103 is further configured to perform an addition calculation on the absolute values of the quantization coefficients included in the current area to obtain the first sum value; and determine the target quantization coefficient corresponding to the parity characteristic of the first sum value. Identification information.
  • the second judgment unit 1102 is also configured to determine that the identification information is a negative sign if the first sum value is an odd number when the identification information is a symbol identification information; if the first sum value is an even number, Then it is determined that the identification information is a positive sign; or, if the first sum value is an odd number, it is determined that the identification information is a positive sign; if the identification information is an even number, it is determined that the identification information is a negative sign.
  • the decoding unit 1101 is also configured to parse the code stream and obtain the first identification information; determine according to the first identification information that the absolute value of the quantization coefficient of the current block satisfies one of the following: 0, 1, 2, or is greater than or equal to 3; and if the absolute value of the quantization coefficient of the current block is greater than or equal to 3, continue to parse the code stream and obtain the second identification information; according to the second identification information, determine that the absolute value of the quantization coefficient of the current block satisfies one of the following One: 3, 4, 5 or greater than or equal to 6; and if the absolute value of the quantization coefficient of the current block is greater than or equal to 6, continue to parse the code stream to obtain the third identification information; determine the quantization of the current block according to the third identification information The absolute value of the coefficient satisfies one of the following: 6, 7, 8, or greater than or equal to 9; and if the absolute value of the quantization coefficient of the current block is greater than or equal to 9, continue to parse
  • the decoding unit 1101 is also configured to use the context model to parse the code stream and determine the absolute value of the quantization coefficient of the current block when the absolute value of the quantization coefficient of the current block is less than 15; and when the absolute value of the quantization coefficient of the current block When it is greater than or equal to 15, use the bypass model to analyze the code stream and determine the absolute value of the quantization coefficient of the current block.
  • the decoding unit 1101 is also configured to parse the code stream according to the first loop sequence when the absolute value of the quantization coefficient of the current block is less than 15, and determine the absolute value of the quantization coefficient of the current block; and when the absolute value of the quantization coefficient of the current block When the absolute value is greater than or equal to 15, the code stream is parsed according to the second cycle sequence to determine the absolute value of the quantization coefficient of the current block.
  • both the first loop order and the second loop order are the order from the last non-zero quantized coefficient of the current block to the upper left position of the current block; or, the first loop order is the order from the last non-zero quantized coefficient of the current block to the upper left position of the current block.
  • the order of the zero quantization coefficient toward the upper left position of the current block, and the second cycle order is the order from the upper left position of the current block to the last non-zero quantization coefficient of the current block.
  • the second determination unit 1103 is further configured to obtain several quantization coefficients determined according to the first identification information, the second identification information, the third identification information, the fourth identification information and the fifth identification information in the current area. absolute values; and performing an addition calculation on the absolute values of several quantization coefficients to obtain a second sum value; and determining identification information corresponding to the target quantization coefficient according to the parity characteristics of the second sum value.
  • the second judgment unit 1102 is also configured to determine that the identification information is a negative sign if the second sum value is an odd number when the identification information is a symbol identification information; if the second sum value is an even number, Then it is determined that the identification information is a positive sign; or, if the second sum value is an odd number, it is determined that the identification information is a positive sign; if the second sum value is an even number, it is determined that the identification information is a negative sign.
  • the second determination unit 1103 is further configured to perform non-zero quantization coefficient statistics on the absolute values of the quantization coefficients included in the current region, determine the number of non-zero quantization coefficients included in the current region; and based on the non-zero quantization coefficients The parity and even characteristics of the number determine the identification information corresponding to the target quantization coefficient.
  • the second judgment unit 1102 is also configured to determine that the identification information is a negative sign if the number of non-zero quantization coefficients is an odd number when the identification information is symbol identification information; if the number of non-zero quantization coefficients is If the number of non-zero quantization coefficients is an even number, the identification information is determined to be a positive sign; or if the number of non-zero quantization coefficients is an odd number, the identification information is determined to be a positive sign; if the number of non-zero quantization coefficients is an even number, the identification information is determined to be a negative sign.
  • the decoding unit 1101 is also configured to parse the code stream according to the third cycle sequence and determine the identification information corresponding to the non-zero quantization coefficients other than the target quantization coefficient in each area of the current block; wherein, the third The cycle order is the order from the last non-zero quantized coefficient of the current block to the upper left position of the current block; or the third cycle order is the order from the upper left position of the current block to the last non-zero quantized coefficient of the current block.
  • the decoding unit 1101 is also configured to use the context model to parse the code stream and determine the identification information corresponding to the first quantization coefficient if the first quantization coefficient at the upper left position of the current block is a non-zero quantization coefficient; and Use the bypass model to parse the code stream and determine identification information corresponding to the non-zero quantization coefficients in the current block except the first quantization coefficient and the target quantization coefficient in each region.
  • the decoding unit 1101 is further configured to use a bypass model to parse the code stream and determine identification information corresponding to non-zero quantization coefficients other than the target quantization coefficient in each region of the current block.
  • the decoding unit 1101 is also configured to parse the code stream and determine the preset element identification information
  • the second determination unit 1103 is also configured to scan the absolute value of the quantization coefficient of the current block in accordance with the preset scanning order to determine whether the current block exists in the current area when the preset element identification information indicates that the current block uses identification hiding technology. Step to hide the identified target quantization coefficients.
  • the preset element identification information is identification information at at least one of the following levels: sequence level, image level, slice level, and block level.
  • the "unit" may be part of a circuit, part of a processor, part of a program or software, etc., and of course may also be a module, or may be non-modular.
  • each component in this embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software function modules.
  • the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • this embodiment provides a computer storage medium for use in the decoder 110.
  • the computer storage medium stores a computer program.
  • any one of the foregoing embodiments is implemented. the method described.
  • the decoder 110 may include: a second communication interface 1201, a second memory 1202, and a second processor 1203; the various components are coupled together through a second bus system 1204. It can be understood that the second bus system 1204 is used to implement connection communication between these components.
  • the second bus system 1204 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are labeled as second bus system 1204 in FIG. 12 . in,
  • the second communication interface 1201 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;
  • the second memory 1202 is used to store computer programs that can be run on the second processor 1203;
  • the second processor 1203 is used to execute: when running the computer program:
  • identification information corresponding to the target quantization coefficient is determined based on the absolute value of the quantization coefficient included in the current area.
  • the second processor 1203 is further configured to perform the method described in any one of the preceding embodiments when running the computer program.
  • This embodiment provides a decoder that hides the identification information (such as sign identification information) of the non-zero quantization coefficient when there is a non-zero quantization coefficient that needs to be hidden in the current area, That is, there is no need to decode the identification information of the non-zero quantization coefficient.
  • the identification information of the non-zero quantization coefficient can be determined directly based on the correlation characteristics of the absolute value of the non-zero quantization coefficient included in the current area. This can not only save the code rate, but also improve the coding rate. decoding efficiency, and can also improve encoding and decoding performance.
  • FIG. 13 shows a schematic structural diagram of a coding and decoding system provided by an embodiment of the present application.
  • the encoding and decoding system 130 may include an encoding device 1301 and a decoding device 1302.
  • the encoding device 1301 may be the encoder described in any one of the preceding embodiments
  • the decoding device 1302 may be the decoder described in any one of the preceding embodiments.
  • the encoding device 1301 and the decoding device 1302 in the encoding and decoding system 130 can interact with each other.
  • the code stream generated by the encoding device 1301 can be transmitted to the decoding device 1302.
  • the identification information (such as sign identification information) of the non-zero quantized coefficient is hidden, that is, There is no need to encode/decode the identification information of the non-zero quantization coefficient.
  • the identification information of the non-zero quantization coefficient can be determined directly based on the correlation characteristics of the absolute value of the non-zero quantization coefficient included in the current area. This can not only save the code rate, but also improve Encoding and decoding efficiency, and can also improve encoding and decoding performance.
  • the encoding end by determining the absolute value of the quantization coefficient of the current block and scanning the absolute value of the quantization coefficient of the current block according to the preset scanning order, it is determined whether there is a target to be hidden in the current area of the current block.
  • Quantization coefficient when it is determined that the target quantization coefficient exists in the current area, the identification information corresponding to the target quantization coefficient is determined based on the absolute value of the quantization coefficient included in the current area.
  • the absolute value of the quantization coefficient of the current block is determined by parsing the code stream; the absolute value of the quantization coefficient of the current block is scanned according to the preset scanning order to determine whether there is a target quantization coefficient with hidden identification in the current area of the current block; When it is determined that the target quantization coefficient exists in the current area, identification information corresponding to the target quantization coefficient is determined based on the absolute value of the quantization coefficient included in the current area.
  • both the encoding end and the decoding end can hide the identification information (such as sign identification information) of the non-zero quantization coefficient when there is a non-zero quantization coefficient that needs to be hidden in the current area, that is, There is no need to encode/decode the identification information of the non-zero quantization coefficient.
  • the identification information of the non-zero quantization coefficient can be determined directly based on the correlation characteristics of the absolute value of the non-zero quantization coefficient included in the current area. This can not only save the code rate, but also improve Encoding and decoding efficiency, and can also improve encoding and decoding performance.

Landscapes

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

Abstract

本申请实施例公开了一种编解码方法、码流、编码器、解码器以及存储介质,该方法包括:解析码流,确定当前块的量化系数绝对值;按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数;在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。这样,通过对非零量化系数的标识信息进行隐藏,从而能够节省码率,提升编解码性能。

Description

编解码方法、码流、编码器、解码器以及存储介质 技术领域
本申请实施例涉及视频编解码技术领域,尤其涉及一种编解码方法、码流、编码器、解码器以及存储介质。
背景技术
随着人们对视频显示质量要求的提高,计算机视觉相关领域得到了越来越多的关注。近年来,图像处理技术在各行各业都取得了成功地应用。对于视频图像的编解码过程而言,在编码端,针对待编码的图像数据,在经过变换和量化处理之后将通过熵编码单元进行压缩编码,而熵编码处理后所生成的码流将传输到解码端;然后解析码流,再经过反量化和逆变换处理之后,可以恢复出原始输入的图像数据。
然而,对于一个经过变换和量化处理得到的非零量化系数,这些非零量化系数可以是正值也可以是负值。对于非零量化系数的正负号标识信息,相关技术为使用符号预测技术进行正负号预测,但是由于相关技术的不完善性,导致编解码性能较差。
发明内容
本申请实施例提供一种编解码方法、码流、编码器、解码器以及存储介质,可以对非零量化系数的标识信息进行隐藏,从而能够节省码率,提升编解码性能。
本申请实施例的技术方案可以如下实现:
第一方面,本申请实施例提供了一种解码方法,应用于解码器,该方法包括:
解析码流,确定当前块的量化系数绝对值;
按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数;
在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。
第二方面,本申请实施例提供了一种编码方法,应用于编码器,该方法包括:
确定当前块的量化系数绝对值;
按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数;
在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。
第三方面,本申请实施例提供了一种码流,该码流是根据待编码信息进行比特编码生成的;其中,待编码信息包括下述至少之一:
预设元素标识信息、第一标识信息、第二标识信息、第三标识信息、第四标识信息、第五标识信息、当前块的量化系数绝对值中大于或等于15的部分、当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息以及预设参数值;
其中,预设元素标识信息用于指示当前块是否使用标识隐藏技术,第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息用于确定当前块的量化系数绝对值中小于15的部分,预设参数值包括下述至少之一:预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值。
第四方面,本申请实施例提供了一种编码器,包括第一确定单元和第一判断单元;其中,
第一确定单元,配置为确定当前块的量化系数绝对值;
第一判断单元,配置为按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数;
第一确定单元,还配置为在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。
第五方面,本申请实施例提供了一种编码器,该编码器包括第一存储器和第一处理器;其中,
第一存储器,用于存储能够在第一处理器上运行的计算机程序;
第一处理器,用于在运行计算机程序时,执行如第二方面的方法。
第六方面,本申请实施例提供了一种解码器,包括解码单元、第二确定单元和第二判断单元;其中,
解码单元,配置为解析码流,确定当前块的量化系数绝对值;
第二判断单元,配置为按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数;
第二确定单元,配置为在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。
第七方面,本申请实施例提供了一种解码器,该解码器包括第二存储器和第二处理器;其中,
第二存储器,用于存储能够在第二处理器上运行的计算机程序;
第二处理器,用于在运行计算机程序时,执行如第一方面的方法。
第八方面,本申请实施例提供了一种计算机存储介质,该计算机存储介质存储有计算机程序,计算机程序被执行时实现如第一方面的方法、或者实现如第二方面的方法。
本申请实施例提供了一种编解码方法、码流、编码器、解码器以及存储介质,在编码端,通过确定当前块的量化系数绝对值;按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数;在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。在解码端,通过解析码流,确定当前块的量化系数绝对值;按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数;在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。这样,无论是编码端还是解码端,都可以首先确定当前区域中是否存在需要隐藏标识的非零量化系数,然后在确定当前区域中存在需要隐藏标识的非零量化系数的情况下,对该非零量化系数的标识信息(例如正负号标识信息)进行隐藏,即不需要编码/解码该非零量化系数的标识信息,可以直接根据当前区域所包括的非零量化系数绝对值的相关特性来确定该非零量化系数的标识信息;如此不仅能够节省码率,提高编解码效率,而且还能够提升编解码性能。
附图说明
图1为一种基于块的编码框架示意图;
图2A为本申请实施例提供的一种编码器的系统组成框图示意图;
图2B为本申请实施例提供的一种解码器的系统组成框图示意图;
图3为本申请实施例提供的一种解码方法的流程示意图一;
图4为本申请实施例提供的一种解码方法的流程示意图二;
图5为本申请实施例提供的一种在All intra配置下的测试结果示意图;
图6为本申请实施例提供的一种在Random access配置下的测试结果示意图;
图7为本申请实施例提供的一种编码方法的流程示意图一;
图8为本申请实施例提供的一种编码方法的流程示意图二;
图9为本申请实施例提供的一种编码器的组成结构示意图;
图10为本申请实施例提供的一种编码器的具体硬件结构示意图;
图11为本申请实施例提供的一种解码器的组成结构示意图;
图12为本申请实施例提供的一种解码器的具体硬件结构示意图;
图13为本申请实施例提供的一种编解码系统的组成结构示意图。
具体实施方式
为了能够更加详尽地了解本申请实施例的特点与技术内容,下面结合附图对本申请实施例的实现进行详细阐述,所附附图仅供参考说明之用,并非用来限定本申请实施例。
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。还需要指出,本申请实施例所涉及的术语“第一\第二\第三”仅是用于区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里 描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。
对本申请实施例进行进一步详细说明之前,先对本申请实施例中涉及的名词和术语进行说明,本申请实施例中涉及的名词和术语适用于如下的解释:
新一代视频编码标准H.266/多功能视频编码(Versatile Video Coding,VVC)
编码单元(Coding Unit,CU)
编码树单元(Coding Tree Unit,CTU)
最大编码单元(Largest Coding Unit,LCU)
预测单元(Prediction Unit,PU)
变换单元(Transform Unit,TU)
离散余弦变换(Discrete Cosine Transform,DCT)
开放媒体联盟(Alliance for Open Media,AOM)
AOM的视频压缩参考软件(AOMedia Video Model,AVM)
符号标识隐藏(Sign Data Hiding,SDH)
可以理解,目前通用的视频编解码标准(如VVC)都采用基于块的混合编码框架。视频图像中的每一帧被分割成相同大小(如128×128,64×64等)正方形的LCU,每个LCU还可以根据规则划分成矩形的CU;而且CU可能还会划分成更小的PU、TU等。具体地,如图1所示,该编码框架可以包括有预测(Prediction)、变换(Transform)、量化(Quantization)、熵编码(Entropy Coding)、环路滤波(In Loop Filter)等步骤。其中,预测又可以分为帧内预测(Intra Prediction)和帧间预测(Inter Prediction),帧间预测可以包括运动估计(Motion Estimation)和运动补偿(Motion Compensation)。由于视频图像的一个帧内相邻像素之间存在很强的相关性,在视频编解码技术中使用帧内预测方式能够消除相邻像素之间的空间冗余;但是由于视频图像中的相邻帧之间也存在着很强的相似性,在视频编解码技术中使用帧间预测方式消除相邻帧之间的时间冗余,从而能够提高编解码效率。
在视频编解码过程中,基本流程如下:在编码器中,将一帧图像划分成块,对当前块使用帧内预测或帧间预测产生当前块的预测块,当前块的原始块减去预测块得到残差块,对残差块进行变换、量化得到量化系数矩阵,对量化系数矩阵进行熵编码输出到码流中。在解码器中,对当前块使用帧内预测或帧间预测产生当前块的预测块,另一方面解码码流得到量化系数矩阵,对量化系数矩阵进行反量化、逆变换得到残差块,将预测块和残差块相加得到重建块。重建块组成重建图像,基于图像或基于块对重建图像进行环路滤波得到解码图像。编码器同样需要和解码器类似的操作获得解码图像。解码图像可以为后续的帧作为帧间预测的参考帧。编码器确定的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息如果有必要需要输出到码流中;然后解码器通过解析及根据已有信息进行分析确定与编码器相同的块划分信息,预测、变换、量化、熵编码、环路滤波等模式信息或者参数信息,从而保证编码器获得的解码图像和解码器获得的解码图像相同。编码器获得的解码图像通常也叫做重建图像。在预测时可以将当前块划分成预测单元,在变换时可以将当前块划分成变换单元,预测单元和变换单元的划分可以不同。上述是基于块的混合编码框架下的视频编码器和解码器的基本流程,随着技术的发展,该框架或流程的一些模块或步骤可能会被优化,本申请实施例适用于该基于块的混合编码框架下的基本流程,但不限于该框架及流程。
在本申请实施例中,当前块(Current Block)可以是当前编码单元(CU)、当前预测单元(PU)、或者当前变换块(TU)等。
还可以理解,AOM的参考软件是基于AV1标准为基准,对可能进行标准化的AV2做编码工具的探索研究。与大多数主流的视频编解码标准类似,AOM的参考软件(即AVM)也是基于块为基础而进行的传统编解码,它包括多个部分,具体如:块划分,帧内预测,帧间预测,变换,量化,熵编码,环路和后处理滤波,屏幕内容的特有编码等等。本申请实施例主要是在量化和反量化部分进行改进,以提升AVM的编码性能。
其中,对于量化与反量化部分而言,其与系数编码部分关系紧密,量化的目的是将变换系数的动态范围减小,从而使得编码系数时消耗的比特数减少。在一种具体的实现方式中,量化与反量化的过程如下式所示:
Figure PCTCN2022085946-appb-000001
t′ i=q i·qstep        (2)
其中,t i为变换系数,qstep为量化步长(与配置文件中设置的量化参数相关),q i为量化系数,round()为取整过程,不限于上取整或下取整等,量化的过程受编码器控制。t′ i为重建变换系数,由于取整过程中造成的精度损失,t′ i与t i是不同的。
量化会使得变换系数的精度降低,并且精度的损失是不可逆的。编码器通常通过率失真代价函数来 衡量量化的代价。率失真代价函数如下所示:
J=D+λ·R=(t i-t′ i) 2+λ·B(q i)      (3)
其中,B()为编码器估计编码q i所消耗的比特的计算过程。
理论上,无论编码器如何决定q i的取值,解码端的反量化过程都是不变的,所以编码器可以更自由的决定q i。通常情况下,编码器会根据当前块的总代价最小为原则,对每一个q i进行最优化,这样的过程叫做率失真量化,也被广泛使用在视频编码中。
在一种具体的实施例中,对于AVM中的系数编码,AVM中使用多符号的算数编码(Multi-symbol arithmetic coding)方式对量化系数进行编码/解码,每个量化系数都可以由一个或多个多符号的标识来标识。具体地,根据量化系数的大小,可分段由以下几种多符号的标识位表示。
-标识1:表示0~3的部分,共4个符号(0,1,2,3),当标识1的符号为3时,则需要进一步编码/解码标识2;
-标识2:表示3~6的部分,共4个符号(0,1,2,3),当标识2的符号为3时,则需要进一步编码/解码标识3;
-标识3:表示6~9的部分,共4个符号(0,1,2,3),当标识3的符号为3时,则需要进一步编码/解码标识4;
-标识4:表示9~12的部分,共4个符号(0,1,2,3),当标识4的符号为3时,则需要进一步编码/解码标识5;
-标识5:表示12~15的部分,共4个符号(0,1,2,3),当标识5的符号为3时,则需要进一步编码/解码大于或等于15的部分。
在这里,大于或等于15的部分使用旁路模型,例如指数哥伦布编码/解码;而标识1~5则使用上下文模型,其中标识1有一套单独的上下文模型,标识2~5公用一套上下文模型。另外,若当前系数为非零系数时,还需要编码/解码正负号。各个标识在当前块中的编码/解码过程分为如下两个循环过程:
循环1:首先按照从最后一个非零系数至当前块左上角的扫描顺序,编码/解码标识1~5;
循环2:接着分别按照从当前块左上角到最后一个非零系数的扫描顺序,编码/解码非零系数的正负号和超过15的部分,其中,左上角处的系数若为非零系数,其正负号的编码/解码采用上下文模型,其余位置上的非零系数编码/解码采用旁路模型(具体也可称为“等概率模型”)。
在实现中,对于AVM中的系数编码,其代码描述如表1所示。
表1
Figure PCTCN2022085946-appb-000002
Figure PCTCN2022085946-appb-000003
其中,在表1中,S()为多符号的上下文模型编码/解码,L(1)为旁路模型编码/解码。
在相关技术中,对于一个经过变换和量化处理得到的非零系数,这些非零系数可以是正值也可以是负值。对于非零系数的正负号标识信息,目前在AVM中并没有利用奇偶或其他特性去隐藏某一个非零系数的某一个标识信息,导致编解码性能较差。
基于此,本申请实施例提供了一种解码方法,通过解析码流,确定当前块的量化系数绝对值;按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数;在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。
本申请实施例还提供了一种编码方法,通过确定当前块的量化系数绝对值;按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数;在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。
这样,无论是编码端还是解码端,都可以首先确定当前区域中是否存在需要隐藏标识的非零量化系数,然后在确定当前区域中存在需要隐藏标识的非零量化系数时,对该非零量化系数的标识信息(例如正负号标识信息)进行隐藏,即不需要编码/解码该非零量化系数的标识信息,可以直接根据当前区域所包括的非零量化系数绝对值的相关特性来确定该非零量化系数的标识信息;如此不仅能够节省码率,提高编解码效率,而且还能够提升编解码性能。
下面将结合附图对本申请各实施例进行清楚、完整的描述。
参见图2A,其示出了本申请实施例提供的一种编码器的系统组成框图示意图。如图2A所示,编码器100可以包括:分割单元111、预测单元112、第一加法器117、变换单元118、量化单元119、反量化单元120、逆变换单元121、第二加法器122、滤波单元123、解码图片缓存(Decoded Picture Buffer,DPB)单元124和熵编码单元125。这里,编码器100的输入可以是由一系列图片或者一张静态图片组成的视频,编码器100的输出可以是用于表示输入视频的压缩版本的比特流(也可以称为“码流”)。
其中,分割单元111将输入视频中的图片分割成一个或多个编码树单元(Coding Tree Units,CTUs)。分割单元111将图片分成多个图块(或称为瓦片,tiles),还可以进一步将一个tile分成一个或多个砖块(bricks),这里,一个tile或者一个brick中可以包括一个或多个完整的和/或部分的CTUs。另外,分割单元111可以形成一个或多个切片(slices),其中一个slice可以包括图片中按照栅格顺序排列的一个或多个tiles,或者覆盖图片中矩形区域的一个或多个tiles。分割单元111还可形成一个或多个子图片,其中,一个子图片可以包括一个或多个slices、tiles或bricks。
在编码器100的编码过程中,分割单元111将CTU传送到预测单元112。通常,预测单元112可以由块分割单元113、运动估计(Motion Estimation,ME)单元114、运动补偿(Motion Compensation,MC)单元115和帧内预测单元116组成。具体地,块分割单元113迭代地使用四叉树分割、二叉树分割和三叉树分割而进一步将输入CTU划分成更小的编码单元(Coding Units,CUs)。预测单元112可使用ME单元114和MC单元115获取CU的帧间预测块。帧内预测单元116可使用各种帧内预测模式来获取CU的帧内预测块。在示例中,率失真优化的运动估计方式可被ME单元114和MC单元115调用以获取帧间预测块,以及率失真优化的模式确定方式可被帧内预测单元116调用以获取帧内预测块。
预测单元112输出CU的预测块,第一加法器117计算分割单元111的输出中的CU和CU的预测块之间的差值,即残差CU。变换单元118读取残差CU并对残差CU执行一个或多个变换操作以获取系数。量化单元119对系数进行量化并输出量化系数(即levels)。反量化单元120对量化系数执行缩放操作以输出重构系数。逆变换单元121执行对应于变换单元118中的变换的一个或多个逆变换并输出重构残差。第二加法器122通过使重构残差和来自预测单元112的CU的预测块相加而计算出重构CU。第二加法器122还将其输出发送到预测单元112以用作帧内预测参考。在图片或子图片中的所有CU被重构之后,滤波单元123对重构图片或子图片执行环路滤波。这里,滤波单元123包含一个或多个滤波器,例如去方块滤波器、采样自适应补偿(Sample Adaptive Offset,SAO)滤波器、基于神经网络的滤波器等。或者,当滤波单元123确定CU不用作其它CU编码时的参考时,滤波单元123对CU中的一个或多个目标像素执行环路滤波。
滤波单元123的输出是解码图片或子图片,这些解码图片或子图片缓存至DPB单元124。DPB单元124根据时序和控制信息输出解码图片或子图片。这里,存储在DPB单元124中的图片还可用作预测单元112执行帧间预测或帧内预测的参考。最后熵编码单元125将来自编码器100中解码图片所必需的参数(比如控制参数和补充信息等)转换成二进制形式,并根据每个数据单元的语法结构将这样的二进制形式写入码流中,即编码器100最终输出码流。
进一步地,编码器100可以是具有第一处理器和记录计算机程序的第一存储器。当第一处理器读取并运行计算机程序时,编码器100读取输入视频并生成对应的码流。另外,编码器100还可以是具有一个或多个芯片的计算设备。在芯片上实现为集成电路的这些单元具有与图2A中相应单元类似的连接和数据交换功能。
参见图2B,其示出了本申请实施例提供的一种解码器的系统组成框图示意图。如图2B所示,该解码器200可以包括:解析单元201、预测单元202、反量化单元205、逆变换单元206、加法器207、滤波单元208和解码图片缓存单元209。这里,解码器200的输入是用于表示视频或者一张静态图片的压缩版本的比特流,解码器200的输出可以是由一系列图片组成的解码视频或者一张解码的静态图片。
其中,解码器200的输入码流可以是编码器100所生成的码流。解析单元201对输入码流进行解析并从输入码流获取语法元素的值。解析单元201将语法元素的二进制表示转换成数字值并将数字值发送到解码器200中的单元以获取一个或多个解码图片。解析单元201还可从输入码流解析一个或多个语法元素以显示解码图片。
在解码器200的解码过程中,解析单元201将语法元素的值以及根据语法元素的值设置或确定的、用于获取一个或多个解码图片的一个或多个变量发送到解码器200中的单元。
预测单元202确定当前解码块(例如CU)的预测块。这里,预测单元202可以包括运动补偿单元203和帧内预测单元204。具体地,当指示帧间解码模式用于对当前解码块进行解码时,预测单元202将来自解析单元201的相关参数传递到运动补偿单元203以获取帧间预测块;当指示帧内预测模式用于对当前解码块进行解码时,预测单元202将来自解析单元201的相关参数传送到帧内预测单元204以获取帧内预测块。
反量化单元205具有与编码器100中的反量化单元120相同的功能。反量化单元205对来自解析单元201的量化系数(即levels)执行缩放操作以获取重构系数。
逆变换单元206具有与编码器100中的逆变换单元121相同的功能。逆变换单元206执行一个或多个变换操作(即通过编码器100中的逆变换单元121执行的一个或多个变换操作的反操作)以获取重构残差。
加法器207对其输入(来自预测单元202的预测块和来自逆变换单元206的重构残差)执行相加操作以获取当前解码块的重构块。重构块还发送到预测单元202以用作在帧内预测模式下编码的其它块的参考。
在图片或子图片中的所有CU被重构之后,滤波单元208对重构图片或子图片执行环路滤波。滤波单元208包含一个或多个滤波器,例如去方块滤波器、采样自适应补偿滤波器、基于神经网络的滤波器等。或者,当滤波单元208确定重构块不用作对其它块解码时的参考时,滤波单元208对重构块中的一个或多个目标像素执行环路滤波。这里,滤波单元208的输出是解码图片或子图片,解码图片或子图片缓存至DPB单元209。DPB单元209根据时序和控制信息输出解码图片或子图片。存储在DPB单元209中的图片还可用作通过预测单元202执行帧间预测或帧内预测的参考。
进一步地,解码器200可以是具有第二处理器和记录计算机程序的第二存储器。当第一处理器读取并运行计算机程序时,解码器200读取输入码流并生成对应的解码视频。另外,解码器200还可以是具有一个或多个芯片的计算设备。在芯片上实现为集成电路的这些单元具有与图2B中相应单元类似的连接和数据交换功能。
还需要说明的是,当本申请实施例应用于编码器100时,“当前块”具体是指视频图像中的当前待编码的块;当本申请实施例应用于解码器200时,“当前块”具体是指视频图像中的当前待解码的块。另外,这里的当前块可以是当前编码单元、当前预测单元、或者当前变换块等等,本申请实施例并不作任何限定。
本申请的一实施例中,参见图3,其示出了本申请实施例提供的一种解码方法的流程示意图。如图3所示,该方法可以包括:
S301:解析码流,确定当前块的量化系数绝对值。
需要说明的是,本申请实施例的解码方法应用于解码器,尤其是应用于AVM中的解码器。另外,该解码方法具体可以是一种关于符号标识隐藏的解码方法,这里主要是针对当前块中的量化系数绝对值对应的正负号标识进行隐藏,以便进一步提升编解码性能。
还需要说明的是,在本申请实施例中,在确定是否存在隐藏的正负号标识之前,首先需要解码获得当前块的量化系数绝对值。其中,每一个量化系数绝对值可以由一个或多个多符号的标识信息来表示。具体地,根据量化系数绝对值的大小,可以分段由第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息等几种多符号的标识信息来表示。
在一些实施例中,所述解析码流,确定当前块的量化系数绝对值,可以包括:
解析码流,获得第一标识信息;
根据第一标识信息,确定当前块的量化系数绝对值满足下述其中之一:0、1、2或者大于或等于3;
若当前块的量化系数绝对值大于或等于3,则继续解析码流,获得第二标识信息;
根据第二标识信息,确定当前块的量化系数绝对值满足下述其中之一:3、4、5或者大于或等于6;
若当前块的量化系数绝对值大于或等于6,则继续解析码流,获得第三标识信息;
根据第三标识信息,确定当前块的量化系数绝对值满足下述其中之一:6、7、8或者大于或等于9;
若当前块的量化系数绝对值大于或等于9,则继续解析码流,获得第四标识信息;
根据第四标识信息,确定当前块的量化系数绝对值满足下述其中之一:9、10、11或者大于或等于12;
若当前块的量化系数绝对值大于或等于12,则继续解析码流,获得第五标识信息;
根据第五标识信息,确定当前块的量化系数绝对值满足下述其中之一:12、13、14或者大于或等于15;
若当前块的量化系数绝对值大于或等于15,则继续解析码流,确定当前块的量化系数绝对值。
需要说明的是,在本申请实施例中,可以设置有五个标识信息,即第一标识信息(可以用标识1表示)、第二标识信息(可以用标识2表示)、第三标识信息(可以用标识3表示)、第四标识信息(可以用标识4表示)和第五标识信息(可以用标识5表示),而且每一个标识信息可以包括多个符号,具体为四个符号(0,1,2,3)。
其中,第一标识信息可以用于解码当前块的量化系数绝对值为0~3的部分,第二标识信息可以用于解码当前块的量化系数绝对值为3~6的部分,第三标识信息可以用于解码当前块的量化系数绝对值为6~9的当前块的量化系数绝对值部分,第四标识信息可以用于解码当前块的量化系数绝对值为9~12的部分,第五标识信息可以用于解码当前块的量化系数绝对值为12~15的部分。
在一种具体的实施例中,第一标识信息表示量化系数绝对值为0~3的部分,共4个符号(0,1,2,3),当第一标识信息的符号为3时,则需要进一步解码第二标识信息;第二标识信息表示量化系数绝对值为3~6的部分,共4个符号(0,1,2,3),当第二标识信息的符号为3时,则需要进一步解码第三标识信息;第三标识信息表示量化系数绝对值为6~9的部分,共4个符号(0,1,2,3),当第三标识信息的符号为3时,则需要进一步解码第四标识信息;第四标识信息表示量化系数绝对值为9~12的部分,共4个符号(0,1,2,3),当第四标识信息的符号为3时,则需要进一步解码第五标识信息;第五标识信息表示量化系数绝对值为12~15的部分,共4个符号(0,1,2,3),当第五标识信息的符号为3时,则需要进一步解码量化系数绝对值为大于或等于15的部分。
示例性地,对于第一标识信息,如果第一标识信息的符号为0,那么意味着当前块的量化系数绝对值为0;如果第一标识信息的符号为1,那么意味着当前块的量化系数绝对值为1;如果第一标识信息的符号为2,那么意味着当前块的量化系数绝对值为2;如果第一标识信息的符号为3,那么意味着当前块的量化系数绝对值为大于或等于3,这时候需要解码获得第二标识信息;对于第二标识信息,如果第二标识信息的符号为0,那么意味着当前块的量化系数绝对值为3;如果第二标识信息的符号为1,那么意味着当前块的量化系数绝对值为4;如果第二标识信息的符号为2,那么意味着当前块的量化系数绝对值为5;如果第二标识信息的符号为3,那么意味着当前块的量化系数绝对值为大于或等于6,这时候需要解码获得第三标识信息;以此类推,直至解码获得第五标识信息;对于第五标识信息,如果第五标识信息的符号为0,那么意味着当前块的量化系数绝对值为12;如果第五标识信息的符号为1,那么意味着当前块的量化系数绝对值为13;如果第五标识信息的符号为2,那么意味着当前块的量化系数绝对值为14;如果第五标识信息的符号为3,那么意味着当前块的量化系数绝对值为大于或等于15;当确定当前块的量化系数绝对值为大于或等于15时,继续解析码流,进一步确定出当前块的量化系数绝对值。
还需要说明的是,对于解码当前块的量化系数绝对值,在一些实施例中,该方法还可以包括:
在当前块的量化系数绝对值小于15时,使用上下文模型解析码流,确定当前块的量化系数绝对值;
在当前块的量化系数绝对值大于或等于15时,使用旁路模型解析码流,确定当前块的量化系数绝对值。
也就是说,大于或等于15的部分,可以使用旁路模型进行解码(例如指数哥伦布解码);而小于15的部分,第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息(即标识1~5)可以使用上下文模型进行解码,其中,第一标识信息(即标识1)有一套单独的上下文模型,而剩余四个标识信息(即标识2~5)公用一套上下文模型。
还需要说明的是,在本申请实施例中,对于解码当前块的量化系数绝对值,可以包括两个循环过程。在一些实施例中,该方法还可以包括:
在当前块的量化系数绝对值小于15时,按照第一循环顺序解析码流,确定当前块的量化系数绝对值;
在当前块的量化系数绝对值大于或等于15时,按照第二循环顺序解析码流,确定当前块的量化系数绝对值。
也就是说,对于当前块的量化系数绝对值,可以根据第一循环顺序解码确定量化系数绝对值中小于15的部分,再根据第二循环顺序解码确定量化系数绝对值中大于或等于15的部分。
在一些实施例中,第一循环顺序和第二循环顺序均为从当前块的最后一个非零量化系数向当前块的左上位置的顺序;或者,
第一循环顺序为从当前块的最后一个非零量化系数向当前块的左上位置的顺序,第二循环顺序为从当前块的左上位置向当前块的最后一个非零量化系数的顺序。
具体来讲,在一种可能的实现方式中,首先按照从当前块的最后一个非零量化系数至左上位置(即左上角)的循环顺序,解码标识1~5;接着按照从当前块的左上角至最后一个非零量化系数的循环顺序,解码量化系数绝对值大于或等于15的部分,以确定出当前块的量化系数绝对值。
在另一种可能的实现方式中,首先按照从当前块的最后一个非零量化系数至左上角的循环顺序,解码标识1~5;接着仍然按照从当前块的最后一个非零量化系数至左上角的循环顺序,解码量化系数绝对值大于或等于15的部分,以确定出当前块的量化系数绝对值。
S302:按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数。
S303:在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。
需要说明的是,在本申请实施例中,可以将每个变换块划分成1个或多个区域。以当前区域为例,在按照预设扫描顺序对当前块的量化系数绝对值进行扫描时,首先确定当前区域中是否存在隐藏标识的目标量化系数,如果确定当前区域中存在目标量化系数,那么需要隐藏该目标量化系数对应的标识信息,即不再对该目标量化系数对应的标识信息进行编码/解码,后续直接根据当前区域所包括的非零量化系数绝对值的相关特性来确定该目标量化系数对应的标识信息。
还需要说明的是,在本申请实施例中,预设扫描顺序可以是对角线、Zigzag、水平、垂直、4×4子块扫描或者任何其它扫描顺序,这里不作任何限定。
可以理解地,对于当前块的区域划分,在一些实施例中,可以包括:在预设扫描顺序上,根据预设尺寸值对当前块进行区域划分,确定至少一个区域;其中,当前区域为至少一个区域中当前解码的区域。
在这里,这至少一个区域的大小可以相同,也可以不同。具体地,在一些实施例中,所述根据预设尺寸值对当前块进行区域划分,确定至少一个区域,可以包括:
根据预设尺寸值对当前块进行等区域划分,确定至少一个区域,其中,每一个区域包括的量化系数个数相同;或者,
根据预设尺寸值对当前块进行不等区域划分,确定至少一个区域,其中,每一个区域包括的量化系数个数不相同。
需要说明的是,在本申请实施例中,当前块可划分为1个或多个区域,每一个区域中包含至少一个量化系数绝对值,而且在每一个区域中可能存在一个隐藏标识的目标量化系数,即每一个区域中可能存在一个不需要编码/解码标识信息的目标量化系数。
还需要说明的是,在本申请实施例中,预设尺寸值是预先设置的每一个区域的大小。其中,预设尺寸值可以是固定值,也可以是写入码流中的可变值或者固定值。在一种具体的实施例中,预设尺寸值的取值可以设置为16。另外,当预设尺寸值写入码流中时,可以编码在序列头中,图像头中等等,这里均不作任何限定。
这样,在AVM中,假定当前块包括2 M个像素值,划分的多个区域中每一个区域为2 N个像素值。其中,2 M除以2 N为正整数。2 N个像素值为预设扫描顺序上的连续2 N个系数,这些系数可以包括零或者非零的系数(这里指量化系数)。另外,如果当前块划分为多个区域,这多个区域的大小可以相同,即每一个区域包括2 N个像素值;或者这多个区域的大小也可以不同,即当前块也可以划分成多个预设扫描顺序上连续、但区域中像素个数不等的区域。
还可以理解地,在进行区域划分之后,对于得到的至少一个区域,每一个区域确定是否存在隐藏标识的目标量化系数以及如何确定该目标量化系数对应的标识信息的步骤相同,下面仅以当前区域为例进行相关描述。
在一种可能的实现方式中,所述按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数,可以包括:
按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域所包括的非零量化系数个数;
根据非零量化系数个数,确定当前区域中是否存在隐藏标识的目标量化系数。
在一种具体的实施例中,所述根据非零量化系数个数,确定当前区域中是否存在隐藏标识的目标量化系数,可以包括:
若非零量化系数个数大于预设个数,则确定当前区域中存在目标量化系数;
若非零量化系数个数小于或等于预设个数,则确定当前区域中不存在目标量化系数。
需要说明的是,在本申请实施例中,预设个数是预先设置的用于判断当前区域是否开启标识隐藏技术的衡量指标。其中,预设个数可以是固定值,也可以是写入码流中的可变值或者固定值。当预设个数写入码流中时,可以编码在序列头中,图像头中等等,这里不作任何限定。
还需要说明的是,在本申请实施例中,预设个数可以设置为L,L为大于零的整数。在一种具体的 实施例中,L的取值可以设置为4,但是这里也不作任何限定。
这样,在确定出当前区域所包括的非零量化系数个数之后,如果非零量化系数个数大于L,那么确定当前区域中存在隐藏标识的目标量化系数,意味着当前区域开启标识隐藏技术,这时候不需要通过解析码流即可确定该目标量化系数对应的标识信息;如果非零量化系数个数小于或等于L,那么确定当前区域中不存在隐藏标识的目标量化系数,意味着当前区域未开启标识隐藏技术,这时候需要通过解析码流来确定当前区域中每一个量化系数绝对值对应的标识信息。
在另一种可能的实现方式中,所述按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数,可以包括:
按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个非零量化系数之间的第一距离值;
根据第一距离值,确定当前区域中是否存在隐藏标识的目标量化系数。
在一种具体的实施例中,所述根据第一距离值,确定当前区域中是否存在隐藏标识的目标量化系数,可以包括:
若第一距离值大于第一距离阈值,则确定当前区域中存在目标量化系数;
若第一距离值小于或等于第一距离阈值,则确定当前区域中不存在目标量化系数。
需要说明的是,在本申请实施例中,第一距离阈值也是预先设置的用于判断当前区域是否开启标识隐藏技术的衡量指标。其中,第一距离阈值可以设置为P,P为大于零的整数。
还需要说明的是,在本申请实施例中,第一距离阈值可以是固定值,也可以是写入码流中的可变值或者固定值。当第一距离阈值写入码流中时,可以编码在序列头中,图像头中等等,这里不作任何限定。
这样,在确定出当前区域在预设扫描顺序上的第一个非零量化系数与最后一个非零量化系数之间的第一距离值之后,如果第一距离值大于P,那么确定当前区域中存在隐藏标识的目标量化系数,意味着当前区域开启标识隐藏技术,这时候不需要通过解析码流即可确定该目标量化系数对应的标识信息;如果第一距离值小于或等于P,那么确定当前区域中不存在隐藏标识的目标量化系数,意味着当前区域未开启标识隐藏技术,这时候需要通过解析码流来确定当前区域中每一个量化系数绝对值对应的标识信息。
在又一种可能的实现方式中,按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数,可以包括:
按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个量化系数之间的第二距离值;
根据第二距离值,确定当前区域中是否存在隐藏标识的目标量化系数。
在一种具体的实施例中,所述根据第二距离值,确定当前区域中是否存在隐藏标识的目标量化系数,可以包括:
若第二距离值大于第二距离阈值,则确定当前区域中存在目标量化系数;
若第二距离值小于或等于第二距离阈值,则确定当前区域中不存在目标量化系数。
需要说明的是,在本申请实施例中,第二距离阈值也是预先设置的用于判断当前区域是否开启标识隐藏技术的衡量指标。其中,第二距离阈值与第一距离阈值可以设置相同,也可以设置不同。在这里,第二距离阈值也可以设置为P,P为大于零的整数。
还需要说明的是,在本申请实施例中,第二距离阈值可以是固定值,也可以是写入码流中的可变值或者固定值。当第二距离阈值写入码流中时,可以编码在序列头中,图像头中等等,这里不作任何限定。
这样,在确定出当前区域在预设扫描顺序上的第一个非零量化系数与最后一个量化系数之间的第二距离值之后,如果第二距离值大于P,那么确定当前区域中存在隐藏标识的目标量化系数,意味着当前区域开启标识隐藏技术,这时候不需要通过解析码流即可确定该目标量化系数对应的标识信息;如果第二距离值小于或等于P,那么确定当前区域中不存在隐藏标识的目标量化系数,意味着当前区域未开启标识隐藏技术,这时候需要通过解析码流来确定当前区域中每一个量化系数绝对值对应的标识信息。
在再一种可能的实现方式中,按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数,可以包括:
按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域包括的量化系数绝对值;
对当前区域包括的量化系数绝对值进行加法计算,得到第一和值;
根据第一和值,确定当前区域中是否存在隐藏标识的目标量化系数。
在一种具体的实施例中,所述根据第一和值,确定当前区域中是否存在隐藏标识的目标量化系数,可以包括:
若第一和值大于和值阈值,则确定当前区域中存在目标量化系数;
若第一和值小于或等于和值阈值,则确定当前区域中不存在目标量化系数。
需要说明的是,在本申请实施例中,和值阈值也是预先设置的用于判断当前区域是否开启标识隐藏技术的衡量指标。其中,和值阈值可以设置为Q,Q为大于零的整数。另外,按照预设扫描顺序对当前块的量化系数绝对值进行扫描,可以是从当前块的最后一个非零量化系数至当前块左上角位置进行扫描,并将扫描到当前区域所包括的量化系数绝对值全部进行加法计算,或者也可以是将扫描到当前区域所包括的非零量化系数绝对值进行加法计算,本申请实施例对此不作任何限定。
还需要说明的是,在本申请实施例中,和值阈值可以是固定值,也可以是写入码流中的可变值或者固定值。当和值阈值写入码流中时,可以编码在序列头中,图像头中等等,这里不作任何限定。
这样,在确定出当前区域包括的量化系数绝对值之和的第一和值之后,如果第一和值大于Q,那么确定当前区域中存在隐藏标识的目标量化系数,意味着当前区域开启标识隐藏技术,这时候不需要通过解析码流即可确定该目标量化系数对应的标识信息;如果第一和值小于或等于Q,那么确定当前区域中不存在隐藏标识的目标量化系数,意味着当前区域未开启标识隐藏技术,这时候需要通过解析码流来确定当前区域中每一个量化系数绝对值对应的标识信息。
在本申请实施例中,由于预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值等预设参数值可以是写入码流中的;因此,在解码端,该方法还包括:解析码流,确定预设参数值;其中,预设参数值可以包括下述至少之一:预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值。
需要说明的是,预设参数值可以是固定值,也可以是写入码流中的可变值或者固定值。当预设参数值写入码流中时,可以编码在序列头中,图像头中等等,这里不作任何限定。
还可以理解地,对于隐藏标识的目标量化系数而言,在一些实施例中,该方法还可以包括:在确定当前区域中存在目标量化系数的情况下,获取当前区域中目标位置处的非零量化系数,将目标位置处的非零量化系数确定为目标量化系数。
在一种具体的实施例中,目标位置处的非零量化系数为当前区域中在预设扫描顺序上的第K个非零量化系数,K为大于零且小于或等于N的整数,N为当前区域所包括的非零量化系数个数。
在一种更具体的实施例中,目标位置处的非零量化系数为当前区域中在预设扫描顺序上的最后一个非零量化系数。
需要说明的是,在本申请实施例中,隐藏标识的目标量化系数可以是当前区域内预设扫描顺序上的任意一个非零量化系数,也可以是固定的某一个非零量化系数,例如当前区域中预设扫描顺序上的第一个非零量化系数,最后一个非零量化系数,或者第i个非零量化系数(i小于或等于L)等等,这里均不作任何限定。
还可以理解地,在当前区域中存在隐藏标识的目标量化系数的情况下,对于该目标量化系数对应的标识信息的确定,在一种可能的实现方式中,所述根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息,可以包括:
对当前区域包括的量化系数绝对值进行加法计算,得到第一和值;
根据第一和值的奇偶特性,确定目标量化系数对应的标识信息。
在标识信息为符号标识信息的情况下,在一种具体的实施例中,所述根据第一和值的奇偶特性,确定目标量化系数对应的标识信息,可以包括:
若第一和值为奇数,则确定标识信息为负号;若第一和值为偶数,则确定标识信息为正号;
或者,若第一和值为奇数,则确定标识信息为正号;若标识信息为偶数,则确定标识信息为负号。
需要说明的是,在本申请实施例中,可以根据当前区域包括的量化系数绝对值之和的奇偶性来确定隐藏标识的目标量化系数对应的标识信息。
其中,这里需要隐藏的标识信息可以为正负号的符号标识信息。示例性地,如果当前区域包括的量化系数绝对值之和为奇数,那么可以确定标识信息为负号,即该目标量化系数为负值;如果当前区域包括的量化系数绝对值之和为偶数,那么可以确定标识信息为正号,即该目标量化系数为正值。或者,如果当前区域包括的量化系数绝对值之和为奇数,那么可以确定标识信息为正号,即该目标量化系数为正值;如果当前区域包括的量化系数绝对值之和为偶数,那么可以确定标识信息为负号,即该目标量化系数为负值。
在另一种可能的实现方式中,所述根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息,可以包括:
获取当前区域中根据第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息确定的若干个量化系数绝对值;
对若干个量化系数绝对值进行加法计算,得到第二和值;
根据第二和值的奇偶特性,确定目标量化系数对应的标识信息。
在标识信息为符号标识信息的情况下,在一种具体的实施例中,所述根据第二和值的奇偶特性,确 定目标量化系数对应的标识信息,可以包括:
若第二和值为奇数,则确定标识信息为负号;若第二和值为偶数,则确定标识信息为正号;
或者,若第二和值为奇数,则确定标识信息为正号;若第二和值为偶数,则确定标识信息为负号。
需要说明的是,在本申请实施例中,除了根据当前区域包括的量化系数绝对值之和的奇偶性来确定隐藏标识的目标量化系数对应的标识信息之外,还可以根据当前区域中利用标识1~5解码获得的若干个量化系数绝对值之和的奇偶性来确定隐藏标识的目标量化系数对应的标识信息。
在这里,需要隐藏的标识信息可以为正负号的符号标识信息。示例性地,如果当前区域中利用标识1~5解码获得的量化系数绝对值之和为奇数,那么可以确定标识信息为负号,即该目标量化系数为负值;如果当前区域中利用标识1~5解码获得的量化系数绝对值之和为偶数,那么可以确定标识信息为正号,即该目标量化系数为正值。或者,如果当前区域中利用标识1~5解码获得的量化系数绝对值之和为奇数,那么可以确定标识信息为正号,即该目标量化系数为正值;如果当前区域中利用标识1~5解码获得的量化系数绝对值之和为偶数,那么可以确定标识信息为负号,即该目标量化系数为负值。
在又一种可能的实现方式中,所述根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息,可以包括:
对当前区域包括的量化系数绝对值进行非零量化系数统计,确定当前区域所包括的非零量化系数个数;
根据非零量化系数个数的奇偶特性,确定目标量化系数对应的标识信息。
在标识信息为符号标识信息的情况下,在一种具体的实施例中,所述根据非零量化系数个数的奇偶特性,确定目标量化系数对应的标识信息,可以包括:
若非零量化系数个数为奇数,则确定标识信息为负号;若非零量化系数个数为偶数,则确定标识信息为正号;
或者,若非零量化系数个数为奇数,则确定标识信息为正号;若非零量化系数个数为偶数,则确定标识信息为负号。
需要说明的是,在本申请实施例中,除了前述的两种实现方式之外,还可以根据当前区域包括的非零量化系数个数的奇偶性来确定隐藏标识的目标量化系数对应的标识信息。
在这里,需要隐藏的标识信息可以为正负号的符号标识信息。示例性地,如果当前区域包括的非零量化系数个数为奇数,那么可以确定标识信息为负号,即该目标量化系数为负值;如果当前区域包括的非零量化系数个数为偶数,那么可以确定标识信息为正号,即该目标量化系数为正值。或者,如果当前区域包括的非零量化系数个数为奇数,那么可以确定标识信息为正号,即该目标量化系数为正值;如果当前区域包括的非零量化系数个数为偶数,那么可以确定标识信息为负号,即该目标量化系数为负值。
在一些实施例中,对于当前块的每一区域中非零量化系数对应的标识信息,除了隐藏标识的目标量化系数对应的标识信息不需要写入码流之外,其余非零量化系数对应的标识信息仍需要写入码流中。因此,该方法还可以包括:按照第三循环顺序解析码流,确定当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息。
其中,第三循环顺序为从当前块的最后一个非零量化系数向当前块的左上位置的顺序;或者,第三循环顺序为从当前块的左上位置向当前块的最后一个非零量化系数的顺序。
需要说明的是,在本申请实施例中,包括三个循环过程:(1)按照第一循环顺序解码第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息(即标识1~5),(2)按照第二循环顺序解码当前块的量化系数绝对值中大于或等于15的部分,(3)按照第三循环顺序解码当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息。
还需要说明的是,在这三个循环过程中,第一循环顺序为从当前块的最后一个非零量化系数开始到当前块的左上位置的顺序;而第二循环顺序和第三循环顺序均可以为从当前块的最后一个非零量化系数开始到当前块的左上位置的顺序,也可以为从当前块的左上位置开始到当前块的最后一个非零量化系数的顺序,本申请实施例并不作任何限定。
进一步地,对于当前块的每一区域中非零量化系数对应的标识信息,在一些实施例中,该方法还可以包括:若当前块的左上位置处的第一量化系数为非零量化系数,则使用上下文模型解析码流,确定第一量化系数对应的标识信息;以及使用旁路模型解析码流,确定当前块中除第一量化系数和每一个区域中的目标量化系数之外的非零量化系数对应的标识信息。
也就是说,在本申请实施例中,解码顺序上会呈现先使用上下文模型解码第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息,接着使用旁路模型解码大于或等于15的部分,然后再使用上下文模型解码左上位置处的非零量化系数对应的正负号,最后又使用旁路模型解码其余非零量化系数对应的正负号,这在硬件实现上不友好。
这样,这里还可以在当前块的左上位置处的第一量化系数为非零量化系数的情况下,将第一量化系数的正负号从上下文模型解码修改为旁路模型解码。因此,在一些实施例中,该方法还可以包括:使用旁路模型解析码流,确定当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息。
除此之外,在一些实施例中,该方法还可以包括:
解析码流,确定预设元素标识信息;
在预设元素标识信息指示当前块使用标识隐藏技术时,执行按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数的步骤。
需要说明的是,在本申请实施例中,预设元素标识信息至少为下述其中一项级别的标识信息:序列(Sequence)级、图像(Picture)级、片(Slice)级和块(Block)级。
还需要说明的是,在本申请实施例中,预设元素标识信息用于指示当前块是否使用标识隐藏技术;只有在预设元素标识信息指示当前块使用标识隐藏技术时,才会执行本申请实施例所述的解码流程。在一种具体的实施例中,如果预设元素标识信息为第一值,那么预设元素标识信息指示当前块使用标识隐藏技术;如果预设元素标识信息为第二值,那么预设元素标识信息指示当前块不使用标识隐藏技术。
在这里,第一值和第二值不同,而且第一值和第二值可以是参数形式,也可以是数字形式。具体地,预设元素标识信息可以是写入在概述(profile)中的参数,也可以是一个标志(flag)的取值,这里对此不作具体限定。
示例性地,以flag为例,flag的设置有两种方式:使能标志位(enable_flag)和非使能标志位(disable_flag)。假定使能标志位的取值为第一值,非使能标志位的取值为第二值;那么对于第一值和第二值而言,第一值可以设置为1,第二值可以设置为0;或者,第一值还可以设置为true,第二值还可以设置为false;但是本申请实施例并不作具体限定。
简单来说,本申请实施例中提出了在AVM中将当前块划分成多个区域;以及利用每一个区域中的某些特性去隐藏该区域中的某个非零量化系数对应的标识信息(例如正负号标识信息);以及通过修改系数解码的顺序以适应提出的符号标识隐藏技术,可以进一步提高解码性能。
本申请实施例提供了一种解码方法,通过解析码流,确定当前块的量化系数绝对值;按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数;在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。这样,在确定当前区域中存在需要隐藏标识的非零量化系数的情况下,对该非零量化系数的标识信息(例如正负号标识信息)进行隐藏,即不需要编码/解码该非零量化系数的标识信息,可以直接根据当前区域所包括的非零量化系数绝对值的相关特性来确定该非零量化系数的标识信息;如此不仅能够节省码率,提高编解码效率,而且还能够提升编解码性能。
本申请的另一实施例中,参见图4,其示出了本申请实施例提供的另一种解码方法的流程示意图。如图4所示,该方法可以包括:
S401:解析码流,确定当前块的量化系数绝对值。
S402:按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域所包括的非零量化系数个数。
S403:根据非零量化系数个数,确定当前区域中是否存在隐藏标识的目标量化系数。
S404:在确定当前区域中存在目标量化系数的情况下,对当前区域包括的量化系数绝对值进行加法计算,得到第一和值。
S405:根据第一和值的奇偶特性,确定目标量化系数对应的标识信息。
需要说明的是,本申请实施例是在AVM中提出了一种利用当前区域所包括的非零量化系数绝对值的奇偶或别的特性来隐藏某个非零量化系数对应的标识信息,可以用于进一步利用提高编解码性能。
还需要说明的是,以变换块为例,本申请实施例主要从三个方面进行详细阐述:(1)在AVM中将每一个变换块划分成多个区域;(2)利用每一个区域中的某些特性去隐藏该区域中的某个非零量化系数对应的标识信息(例如正负号标识信息);(3)通过修改系数编解码的顺序以适应提出的符号标识隐藏技术。
具体来讲,每一个变换块可划分为1个或多个区域,每一个区域中包含至少一个量化系数绝对值,而且在每一个区域中可能存在一个隐藏标识的目标量化系数。当划分为多个区域时,不同区域的大小可以不同也可以相同。在AVM中,每一个变换块中都可以包括2 M个像素值,划分的多个区域中每一个区域为2 N个像素值。其中,2 M除以2 N为正整数。2 N个像素为预设扫描顺序上的连续2 N个系数,这些系数可以包括零或者非零的量化系数。另外,也可以划分成多个在预设扫描顺序上连续、但区域中像素个数不等的区域。
在本申请实施例中,需要隐藏的标识信息可以为正负号的符号标识信息。当满足当前区域中的非零量化系数个数大于L个时,对当前区域的已解码的量化系数绝对值进行求和,用和值的奇偶性表示隐藏正负号的非零量化系数的正负(这里,直接使用由奇偶性推断出的正负从而能够跳过解码该非零量化系数的正负号)。需要注意的是,隐藏正负的非零量化系数可以是当前区域内预设扫描顺序上的任意一个非零量化系数,也可以是固定的某一个非零量化系数,例如该区域内预设扫描顺序上的第一个非零量化系数、最后一个非零系数、或第i个非零量化系数(i小于等于L)等。
在本申请实施例中,由于此解码方法需要在解码隐藏标识的目标量化系数的正负号之前,需要先知道当前区域内非零量化系数绝对值之和的奇偶性,所以在解码隐藏标识之前需要解码出当前区域中每一个量化系数的绝对值。因此,本申请实施例中,首先解码标识1~5,接着按照从变换块的最后一个非零系数至变换块左上角的顺序来解码每一个量化系数绝对值中超出15的部分,最后根据每一个区域中的量化系数绝对值之和的奇偶以及预设条件是否满足来判断隐藏标识的目标量化系数的正负号并解码其余非零量化系数的正负号。
在一种具体的实施例中,在AVM的实现中,该解码流程的代码描述如表2所示。
表2
Figure PCTCN2022085946-appb-000004
Figure PCTCN2022085946-appb-000005
在表2中,第一个循环解码标识1-5的过程不变。将解码正负号和解码量化系数绝对值超过15的部分拆分成两个循环,先解码量化系数绝对值超过15的部分以达到在解码正负号的循环中,每一个量化系数绝对值已知。在解码正负号的循环中,将量化系数按照每SUBSIZE个为一组划分成多个组,按照预设扫描顺序逐个解码每一组量化系数中的正负号,如果当前组中的非零量化系数个数满足大于等于 SDHTHRESH的条件,那么可以根据该组中量化系数绝对值之和的奇偶性来确定该组中使用隐藏技术的预设扫描顺序上最后一个非零量化系数的正负号。
在这里,变量SUBSIZE和SDHTHRESH,分别表示每一个区域的大小和每一个区域中打开正负号隐藏技术所需的区域中非零量化系数个数大于或等于的阈值。这两个变量可以是定义的固定值,也可以是编码在码流中的可变值或定值,当编码在码流中时,可以编码在序列头中,图像头中等。
示例性地,本申请实施例提出的正负号隐藏技术实施在AVM中,其中使用的SUBSIZE区域大小可设置为16,正负号隐藏技术开启的阈值SDHTHRESH可设置为4。当正负号隐藏技术对当前区域开启时,如果当前区域中非零量化系数绝对值之和为奇数,表示该区域在预设扫描顺序上最后一个非零量化系数的正负号为负;如果当前区域中非零量化系数绝对值之和为偶数,表示该区域在预设扫描顺序上最后一个非零量化系数的正负号为正。
如此,根据AVM通用测试条件,在全帧内(All intra)和随机接入(Random access)下性能测试结果如图5和图6所示。其中,图5为本申请实施例提供的在All intra配置下的测试结果示意图,图6为本申请实施例提供的在Random access配置下的测试结果示意图。由图5和图6可以看出,本申请实施例的技术方案能够节省码率,提升了编解码性能。
进一步地,在一些实施例中,由于提出的正负号隐藏技术的引入,相关技术的标识位编码/解码顺序由2个循环(第一个循环为编码/解码标识1~5,第二个循环为编码/解码正负号和超出15的部分))变成了3个循环(第一个循环为编码/解码标识1~5,第二个循环为编码/解码超出15的部分,第三个循环为编码/解码正负号)。这样可能会带来一个问题:由于变换块的左上角系数若为非零量化系数,那么左上角系数的正负号紧随着标识1~5编码且同样使用上下文模型编码,在这之后都使用旁路模型编码。而引入正负号隐藏技术后,编码顺序上会呈现先使用上下文模型编码/解码(标识1~5)),接着使用旁路模型编码/解码(超出15的部分),然后再使用上下文模型编码/解码(左上角系数若为非零时编码/解码该系数的正负号),最后又是使用旁路模型编码/解码(其余非零量化系数的正负号)的穿插,这对硬件实现不友好。因此,本申请实施例还可以将变换块的左上角系数的正负号由从上下文模型修改为旁路模型进行编码/解码。
进一步地,在一些实施例中,利用当前区域的某些条件去隐藏正负号的标识信息时,可以将当前区域内的非零量化系数个数大于L作为对当前块使用正负号隐藏技术的开启条件。除此之外,还可以使用以下内容作为对当前区域使用正负号隐藏技术的开启条件:
(1)在当前区域中,预设扫描顺序上的第一个非零量化系数到最后一个非零量化系数之间的距离值大于P,P为正整数;
(2)在当前区域中,预设扫描顺序上的第一个非零量化系数到最后一个系数之间的距离值大于P,P为正整数;
(3)在当前区域中,非零量化系数的绝对值之和大于Q,Q为正整数。
进一步地,在一些实施例中,将相关技术中的两个循环修改为三个循环,修改后的第二循环和第三循环中的循环顺序可以从最后一个非零量化系数开始到变换块左上角结束,也可以从左上角开始到最后一个非零量化系数结束,这里并不作任何限定。
进一步地,在一些实施例中,除了使用当前区域中非零量化系数绝对值之和的奇偶性去隐藏某个非零量化系数的正负号之外,还可以使用以下条件去隐藏某个非零量化系数的正负号:
(1)当前区域中非零量化系数个数的奇偶性;
(2)当前区域中标识1~5的量化系数绝对值之和的奇偶性。
这里,还需要注意的是,由于标识1~5原本在AVM中就是在一个循环中编码,如果使用这个特性去隐藏正负号信息,那么量化系数编码/解码的顺序可以使用本申请实施例提供的方式,也可以使用相关技术中的两个循环对应的方式,这时候仅需改变其中的正负号部分,该部分的代码描述如表3所示。
表3
Figure PCTCN2022085946-appb-000006
Figure PCTCN2022085946-appb-000007
Figure PCTCN2022085946-appb-000008
通过本实施例对前述实施例的具体实现进行详细阐述,从中可以看出,根据前述实施例的技术方案,在确定当前区域中存在需要隐藏标识的非零量化系数的情况下,对该非零量化系数的标识信息(例如正负号标识信息)进行隐藏,即不需要编码/解码该非零量化系数的标识信息,可以直接根据当前区域所包括的非零量化系数绝对值的相关特性来确定该非零量化系数的标识信息;如此不仅能够节省码率,提高编解码效率,而且还能够提升编解码性能。
本申请的又一实施例中,参见图7,其示出了本申请实施例提供的一种编码方法的流程示意图。如图7所示,该方法可以包括:
S701:确定当前块的量化系数绝对值。
需要说明的是,本申请实施例的编码方法应用于编码器,尤其是应用于AVM中的编码器。另外,该编码方法具体可以是一种关于符号标识隐藏的编码方法,这里主要是针对当前块中的量化系数绝对值对应的正负号标识进行隐藏,以便进一步提升编解码性能。
还需要说明的是,在本申请实施例中,在确定是否存在待隐藏的正负号标识之前,首先需要确定当前块的量化系数绝对值。其中,每一个量化系数绝对值可以由一个或多个多符号的标识信息来表示。具体地,根据量化系数绝对值的大小,可以分段由第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息等几种多符号的标识信息来表示。
进一步地,在确定当前块的量化系数绝对值之后,还需要对这些量化系数绝对值进行编码以写入码流中。因此,在一些实施例中,该方法还可以包括:
若当前块的量化系数绝对值满足下述其中之一:0、1、2或者大于或等于3,则确定第一标识信息,并对第一标识信息进行编码,将所得到的编码比特写入码流;
若当前块的量化系数绝对值满足下述其中之一:3、4、5或者大于或等于6,则继续确定第二标识 信息,并对第二标识信息进行编码,将所得到的编码比特写入码流;
若当前块的量化系数绝对值满足下述其中之一:6、7、8或者大于或等于9,则继续确定第三标识信息,并对第三标识信息进行编码,将所得到的编码比特写入码流;
若当前块的量化系数绝对值满足下述其中之一:9、10、11或者大于或等于12,则继续确定第四标识信息,并对第四标识信息进行编码,将所得到的编码比特写入码流;
若当前块的量化系数绝对值满足下述其中之一:12、13、14或者大于或等于15,则继续确定第五标识信息,并对第五标识信息进行编码,将所得到的编码比特写入码流;
若当前块的量化系数绝对值大于或等于15,则继续对当前块的量化系数绝对值进行编码,将所得到的编码比特写入码流。
在本申请实施例中,可以设置有五个标识信息,即第一标识信息(可以用标识1表示)、第二标识信息(可以用标识2表示)、第三标识信息(可以用标识3表示)、第四标识信息(可以用标识4表示)和第五标识信息(可以用标识5表示),而且每一个标识信息可以包括多个符号,具体为四个符号(0,1,2,3)。其中,第一标识信息可以用于编码当前块的量化系数绝对值为0~3的部分,第二标识信息可以用于编码当前块的量化系数绝对值为3~6的部分,第三标识信息可以用于编码当前块的量化系数绝对值为6~9的当前块的量化系数绝对值部分,第四标识信息可以用于编码当前块的量化系数绝对值为9~12的部分,第五标识信息可以用于编码当前块的量化系数绝对值为12~15的部分。
示例性地,如果当前块的量化系数绝对值为0,那么意味着第一标识信息的符号为0;如果当前块的量化系数绝对值为1,那么意味着第一标识信息的符号为1;如果当前块的量化系数绝对值为2,那么意味着第一标识信息的符号为2;如果第一标识信息的符号为3,那么意味着当前块的量化系数绝对值为大于或等于3,这时候不仅需要编码第一标识信息,还需要编码第二标识信息;其中,如果当前块的量化系数绝对值为3,那么意味着第二标识信息的符号为0;如果当前块的量化系数绝对值为4,那么意味着第二标识信息的符号为1;如果当前块的量化系数绝对值为5,那么意味着第二标识信息的符号为2;如果当前块的量化系数绝对值为大于或等于6,那么意味着第二标识信息的符号为3,这时候还需要继续编码第三标识信息;以此类推,如果当前块的量化系数绝对值为大于或等于12,那么还需要编码第五标识信息;其中,如果当前块的量化系数绝对值为12,那么意味着第五标识信息的符号为0;如果当前块的量化系数绝对值为13,那么意味着第五标识信息的符号为1;如果当前块的量化系数绝对值为14,那么意味着第五标识信息的符号为2;如果当前块的量化系数绝对值为大于或等于15,那么意味着第五标识信息的符号为3;如果当前块的量化系数绝对值为大于或等于15,那么还需要进一步编码当前块的量化系数绝对值。
还需要说明的是,对于编码当前块的量化系数绝对值,在一些实施例中,该方法还可以包括:
在当前块的量化系数绝对值小于15时,按照第一循环顺序,使用上下文模型对第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息进行编码,将所得到的编码比特写入码流;
在当前块的量化系数绝对值大于或等于15时,按照第二循环顺序,使用旁路模型对当前块的量化系数绝对值进行编码,将所得到的编码比特写入码流。
也就是说,大于或等于15的部分,可以使用旁路模型进行编码(例如指数哥伦布编码);而小于15的部分,第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息(即标识1~5)可以使用上下文模型进行编码,其中,第一标识信息(即标识1)有一套单独的上下文模型,而剩余四个标识信息(即标识2~5)公用一套上下文模型。
另外,在本申请实施例中,对于编码当前块的量化系数绝对值,可以包括两个循环过程:根据第一循环顺序编码标识1~5,再根据第二循环顺序编码量化系数绝对值中大于或等于15的部分。
在一些实施例中,第一循环顺序和第二循环顺序均为从当前块的最后一个非零量化系数向当前块的左上位置的顺序;或者,
第一循环顺序为从当前块的最后一个非零量化系数向当前块的左上位置的顺序,第二循环顺序为从当前块的左上位置向当前块的最后一个非零量化系数的顺序。
也就是说,可以按照从当前块的最后一个非零量化系数至左上位置(即左上角)的循环顺序,编码标识1~5;接着按照从当前块的左上角至最后一个非零量化系数的循环顺序,编码量化系数绝对值大于或等于15的部分;或者,也可以按照从当前块的最后一个非零量化系数至左上角的循环顺序,编码标识1~5;接着仍然按照从当前块的最后一个非零量化系数至左上角的循环顺序,编码量化系数绝对值大于或等于15的部分。
S702:按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数。
S703:在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确 定目标量化系数对应的标识信息。
在本申请实施例中,预设扫描顺序可以是对角线、Zigzag、水平、垂直、4×4子块扫描或者任何其它扫描顺序,这里不作任何限定。
在本申请实施例中,可以将当前块划分成1个或多个区域;其中,当前区域则为这1个或多个区域中当前编码的区域。因此,在一些实施例中,对于当前块的区域划分,可以包括:在预设扫描顺序上,根据预设尺寸值对当前块进行区域划分,确定至少一个区域;其中,当前区域为至少一个区域中当前编码的区域。
在一种具体的实施例中,所述根据预设尺寸值对当前块进行区域划分,确定至少一个区域,可以包括:
根据预设尺寸值对当前块进行等区域划分,确定至少一个区域,其中,每一个区域包括的量化系数个数相同;或者,
根据预设尺寸值对当前块进行不等区域划分,确定至少一个区域,其中,每一个区域包括的量化系数个数不相同。
需要说明的是,在本申请实施例中,预设尺寸值是预先设置的每一个区域的大小。其中,预设尺寸值可以是固定值,也可以是写入码流中的可变值或者固定值。在一种具体的实施例中,预设尺寸值的取值可以设置为16。另外,当预设尺寸值写入码流中时,可以编码在序列头中,图像头中等等,这里均不作任何限定。另外,根据预设尺寸值将当前块划分成多个区域时,这多个区域的大小可以相同,也可以不同。
还需要说明的是,在进行区域划分后,对于得到的至少一个区域,每一个区域确定是否存在待隐藏标识的目标量化系数以及如何确定该目标量化系数对应的标识信息的步骤相同,下面仅以当前区域为例进行相关描述。
在一种可能的实现方式中,所述按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数,可以包括:
按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域所包括的非零量化系数个数;
根据非零量化系数个数,确定当前区域中是否存在待隐藏标识的目标量化系数。
在一种具体的实施例中,所述根据非零量化系数个数,确定当前区域中是否存在待隐藏标识的目标量化系数,可以包括:若非零量化系数个数大于预设个数,则确定当前区域中存在目标量化系数;若非零量化系数个数小于或等于预设个数,则确定当前区域中不存在目标量化系数。
在另一种可能的实现方式中,所述按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数,可以包括:
按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个非零量化系数之间的第一距离值;
根据第一距离值,确定当前区域中是否存在待隐藏标识的目标量化系数。
在一种具体的实施例中,所述根据第一距离值,确定当前区域中是否存在待隐藏标识的目标量化系数,可以包括:若第一距离值大于第一距离阈值,则确定当前区域中存在目标量化系数;若第一距离值小于或等于第一距离阈值,则确定当前区域中不存在目标量化系数。
在一种可能的实现方式中,所述按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数,可以包括:
按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个量化系数之间的第二距离值;
根据第二距离值,确定当前区域中是否存在待隐藏标识的目标量化系数。
在一种具体的实施例中,所述根据第二距离值,确定当前区域中是否存在待隐藏标识的目标量化系数,可以包括:若第二距离值大于第二距离阈值,则确定当前区域中存在目标量化系数;若第二距离值小于或等于第二距离阈值,则确定当前区域中不存在目标量化系数。
在再一种可能的实现方式中,所述按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数,可以包括:
按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域包括的量化系数绝对值;
对当前区域包括的量化系数绝对值进行加法计算,得到第一和值;
根据第一和值,确定当前区域中是否存在待隐藏标识的目标量化系数。
在一种具体的实施例中,所述根据第一和值,确定当前区域中是否存在待隐藏标识的目标量化系数,可以包括:若第一和值大于和值阈值,则确定当前区域中存在目标量化系数;若第一和值小于或等于和值阈值,则确定当前区域中不存在目标量化系数。
需要说明的是,在本申请实施例中,对于当前块的当前区域中是否存在待隐藏标识的目标量化系数,可以根据当前区域所包括的非零量化系数个数大于预设个数来确定,还可以根据当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个非零量化系数之间的距离值大于第一距离阈值来确定,也可以根据当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个量化系数之间的距离值大于第二距离阈值来确定,甚至也可以根据当前区域包括的量化系数绝对值之和大于和值阈值来确定,这里对此不作任何限定。
还需要说明的是,在本申请实施例中,预设个数、第一距离阈值、第二距离阈值、和值阈值均可以作为预先设置的用于判断当前区域是否开启标识隐藏技术的衡量指标。另外,预设个数、第一距离阈值、第二距离阈值、和值阈值等的设置可以是固定值,也可以是写入码流中的可变值或者固定值。当写入码流中时,可以编码在序列头中,图像头中等等,这里对此也不作任何限定。
进一步地,由于预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值等预设参数值可以是写入码流中的;因此,在编码端,该方法还包括:对预设参数值进行编码,将所得到的编码比特写入码流;其中,所述预设参数值包括下述至少之一:预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值。
需要说明的是,预设参数值可以是固定值,也可以是写入码流中的可变值或者固定值。当预设参数值写入码流中时,可以编码在序列头中,图像头中等等,这里不作任何限定。
还需要说明的是,对于待隐藏标识的目标量化系数而言,在一些实施例中,该方法还可以包括:在确定当前区域中存在目标量化系数的情况下,获取当前区域中目标位置处的非零量化系数,将目标位置处的非零量化系数确定为目标量化系数。
在一种具体的实施例中,目标位置处的非零量化系数为当前区域中在预设扫描顺序上的第K个非零量化系数,K为大于零且小于或等于N的整数,N为当前区域所包括的非零量化系数个数。
在一种更具体的实施例中,目标位置处的非零量化系数为当前区域中在预设扫描顺序上的最后一个非零量化系数。
也就是说,在本申请实施例中,待隐藏标识的目标量化系数可以是当前区域内预设扫描顺序上的任意一个非零量化系数,也可以是固定的某一个非零量化系数,例如当前区域中预设扫描顺序上的第一个非零量化系数,最后一个非零量化系数,或者第i个非零量化系数(i小于或等于L)等等,这里均不作任何限定。
还可以理解地,在当前区域中存在待隐藏标识的目标量化系数的情况下,对于该目标量化系数对应的标识信息的确定,在一种可能的实现方式中,所述根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息,可以包括:
对当前区域包括的量化系数绝对值进行加法计算,得到第一和值;根据第一和值的奇偶特性,确定目标量化系数对应的标识信息。
在一种具体的实施例中,当标识信息为符号标识信息时,所述根据第一和值的奇偶特性,确定目标量化系数对应的标识信息,可以包括:若第一和值为奇数,则确定标识信息为负号;若第一和值为偶数,则确定标识信息为正号;或者,若第一和值为奇数,则确定标识信息为正号;若标识信息为偶数,则确定标识信息为负号。
在另一种可能的实现方式中,所述根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息,可以包括:
获取当前区域中小于15的若干个量化系数绝对值;对若干个量化系数绝对值进行加法计算,得到第二和值;根据第二和值的奇偶特性,确定目标量化系数对应的标识信息。
在一种具体的实施例中,当标识信息为符号标识信息时,所述根据第二和值的奇偶特性,确定目标量化系数对应的标识信息,可以包括:若第二和值为奇数,则确定标识信息为负号;若第二和值为偶数,则确定标识信息为正号;或者,若第二和值为奇数,则确定标识信息为正号;若第二和值为偶数,则确定标识信息为负号。
在又一种可能的实现方式中,所述根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息,可以包括:
对当前区域包括的量化系数绝对值进行非零量化系数统计,确定当前区域所包括的非零量化系数个数;根据非零量化系数个数的奇偶特性,确定目标量化系数对应的标识信息。
在一种具体的实施例中,当标识信息为符号标识信息时,所述根据非零量化系数个数的奇偶特性,确定目标量化系数对应的标识信息,可以包括:若非零量化系数个数为奇数,则确定标识信息为负号;若非零量化系数个数为偶数,则确定标识信息为正号;或者,若非零量化系数个数为奇数,则确定标识信息为正号;若非零量化系数个数为偶数,则确定标识信息为负号。
需要说明的是,在本申请实施例中,对于需要隐藏标识的目标量化系数对应的标识信息而言,可以根据当前区域包括的量化系数绝对值之和的奇偶性来确定,还可以根据当前区域中利用标识1~5解码获得的若干个量化系数绝对值之和的奇偶性来确定,也可以根据当前区域包括的非零量化系数个数的奇偶性来确定,这里对此不作任何限定。
还需要说明的是,在本申请实施例中,需要隐藏的标识信息可以为正负号的符号标识信息。示例性地,以根据当前区域包括的量化系数绝对值之和的奇偶性来确定正负号为例,如果当前区域包括的量化系数绝对值之和为奇数,那么可以确定标识信息为负号,即该目标量化系数为负值;如果当前区域包括的量化系数绝对值之和为偶数,那么可以确定标识信息为正号,即该目标量化系数为正值。或者,如果当前区域包括的量化系数绝对值之和为奇数,那么可以确定标识信息为正号,即该目标量化系数为正值;如果当前区域包括的量化系数绝对值之和为偶数,那么可以确定标识信息为负号,即该目标量化系数为负值。
在一些实施例中,对于当前块的每一区域中非零量化系数对应的标识信息,除了需要隐藏标识的目标量化系数对应的标识信息不需要写入码流之外,其余非零量化系数对应的标识信息仍需要写入码流中。因此,该方法还可以包括:按照第三循环顺序对当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息进行编码,将所得到的编码比特写入码流。
其中,第三循环顺序为从当前块的最后一个非零量化系数向当前块的左上位置的顺序;或者,第三循环顺序为从当前块的左上位置向当前块的最后一个非零量化系数的顺序。
需要说明的是,在本申请实施例中,包括三个循环过程:(1)按照第一循环顺序编码第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息(即标识1~5),(2)按照第二循环顺序编码当前块的量化系数绝对值中大于或等于15的部分,(3)按照第三循环顺序编码当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息。
还需要说明的是,在这三个循环过程中,第一循环顺序为从当前块的最后一个非零量化系数开始到当前块的左上位置的顺序;而第二循环顺序和第三循环顺序均可以为从当前块的最后一个非零量化系数开始到当前块的左上位置的顺序,也可以为从当前块的左上位置开始到当前块的最后一个非零量化系数的顺序,本申请实施例对此也不作任何限定。
进一步地,对于当前块的每一区域中非零量化系数对应的标识信息的编码,在一些实施例中,该方法还可以包括:若当前块的左上位置处的第一量化系数为非零量化系数,则使用上下文模型对第一量化系数对应的标识信息进行编码,以及使用旁路模型对当前块中除第一量化系数和每一个区域中的目标量化系数之外的非零量化系数对应的标识信息进行编码。
也就是说,在本申请实施例中,编码顺序上会呈现先使用上下文模型编码第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息,接着使用旁路模型编码大于或等于15的部分,然后再使用上下文模型编码左上位置处的非零量化系数对应的正负号,最后又使用旁路模型编码其余非零量化系数对应的正负号,这在硬件实现上不友好。
这样,这里还可以在当前块的左上位置处的第一量化系数为非零量化系数的情况下,将第一量化系数的正负号从上下文模型编码修改为旁路模型编码。因此,在一些实施例中,该方法还可以包括:使用旁路模型对当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息进行编码,将所得到的编码比特写入码流。
除此之外,在一些实施例中,该方法还可以包括:
确定预设元素标识信息;其中,所述预设元素标识信息用于指示所述当前块是否使用标识隐藏技术;
对所述预设元素标识信息进行编码,将所得到的编码比特写入码流。
需要说明的是,在本申请实施例中,预设元素标识信息至少为下述其中一项级别的标识信息:序列(Sequence)级、图像(Picture)级、片(Slice)级和块(Block)级。
还需要说明的是,在本申请实施例中,预设元素标识信息用于指示当前块是否使用标识隐藏技术。因此,在一些实施例中,所述确定预设元素标识信息,可以包括:
若当前块使用标识隐藏技术,则确定预设元素标识信息为第一值;
若当前块不使用标识隐藏技术,则确定预设元素标识信息为第二值。
在这里,第一值和第二值不同,而且第一值和第二值可以是参数形式,也可以是数字形式。具体地,预设元素标识信息可以是写入在概述(profile)中的参数,也可以是一个标志(flag)的取值,这里对此不作具体限定。
示例性地,以flag为例,flag的设置有两种方式:使能标志位(enable_flag)和非使能标志位(disable_flag)。假定使能标志位的取值为第一值,非使能标志位的取值为第二值;那么对于第一值和第二值而言,第一值可以设置为1,第二值可以设置为0;或者,第一值还可以设置为true,第二值还 可以设置为false;但是本申请实施例并不作具体限定。
简单来说,本申请实施例中提出了在AVM中将当前块划分成多个区域;以及利用每一个区域中的某些特性去隐藏该区域中的某个非零量化系数对应的标识信息(例如正负号标识信息);以及通过修改系数编码的顺序以适应提出的符号标识隐藏技术,可以进一步提高编码性能。
本申请实施例提供了一种编码方法,通过确定当前块的量化系数绝对值;按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数;在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。这样,在确定当前区域中存在需要隐藏标识的非零量化系数时,对该非零量化系数的标识信息(例如正负号标识信息)进行隐藏,即不需要编码/解码该非零量化系数的标识信息,可以直接根据当前区域所包括的非零量化系数绝对值的相关特性来确定该非零量化系数的标识信息;如此不仅能够节省码率,提高编解码效率,而且还能够提升编解码性能。
本申请的再一实施例中,参见图8,其示出了本申请实施例提供的另一种编码方法的流程示意图。如图8所示,该方法可以包括:
S801:确定当前块的量化系数绝对值。
S802:按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域所包括的非零量化系数个数。
S803:根据非零量化系数个数,确定当前区域中是否存在待隐藏标识的目标量化系数。
S804:在确定当前区域中存在目标量化系数的情况下,隐藏目标量化系数对应的标识信息,使得无需编码该目标量化系数对应的标识信息到码流中。
需要说明的是,本申请实施例是在AVM中提出了一种利用当前区域所包括的非零量化系数绝对值的奇偶或别的特性来隐藏某个非零量化系数对应的标识信息,可以用于进一步利用提高编解码性能。
还需要说明的是,以变换块为例,本申请实施例主要从三个方面进行详细阐述:(1)在AVM中将每一个变换块划分成多个区域;(2)利用每一个区域中的某些特性去隐藏该区域中的某个非零量化系数对应的标识信息(例如正负号标识信息);(3)通过修改系数编码的顺序以适应提出的符号标识隐藏技术。
具体来讲,每一个变换块可划分为1个或多个区域,每一个区域中包含至少一个量化系数绝对值,而且在每一个区域中可能存在一个待隐藏标识的目标量化系数。当划分为多个区域时,不同区域的大小可以不同也可以相同。在AVM中,每一个变换块中都可以包括2 M个像素值,划分的多个区域中每一个区域为2 N个像素值。其中,2 M除以2 N为正整数。2 N个像素为预设扫描顺序上的连续2 N个系数,这些系数可以包括零或者非零的量化系数。另外,也可以划分成多个在预设扫描顺序上连续、但区域中像素个数不等的区域。
在本申请实施例中,需要隐藏的标识信息可以为正负号的符号标识信息。当满足当前区域中的非零量化系数个数大于L个时,对当前区域的已编码的量化系数绝对值进行求和,用和值的奇偶性表示隐藏正负号的非零量化系数的正负(这里,直接使用由奇偶性推断出的正负从而能够跳过编码该非零量化系数的正负号)。需要注意的是,隐藏正负的非零量化系数可以是当前区域内预设扫描顺序上的任意一个非零量化系数,也可以是固定的某一个非零量化系数,例如该区域内预设扫描顺序上的第一个非零量化系数、最后一个非零系数、或第i个非零量化系数(i小于等于L)等。
在本申请实施例中,此编码方法可以在编码非零量化系数对应的正负号之前,先编码当前区域中每一个量化系数的绝对值。因此,本申请实施例中,首先编码标识1~5,接着按照从变换块的最后一个非零系数至变换块左上角的顺序来编码每一个量化系数绝对值中超出15的部分,最后根据每一个区域中的量化系数绝对值之和的奇偶以及预设条件是否满足来判断待隐藏标识的目标量化系数的正负号并编码其余非零量化系数的正负号。
在一种具体的实施例中,在AVM的实现中,该编码流程的代码描述也可如表2所示。在表2中,第一个循环编码标识1-5的过程不变。将编码正负号和编码量化系数绝对值超过15的部分拆分成两个循环,先编码量化系数绝对值超过15的部分以达到在编码正负号的循环中,每一个量化系数绝对值已知。在编码正负号的循环中,将量化系数按照每SUBSIZE个为一组划分成多个组,按照预设扫描顺序逐个编码每一组量化系数中的正负号,如果当前组中的非零量化系数个数满足大于等于SDHTHRESH的条件,那么可以不需要编码该组中使用隐藏技术的预设扫描顺序上最后一个非零量化系数的正负号,其可以根据该组中量化系数绝对值之和的奇偶性来确定。
在这里,变量SUBSIZE和SDHTHRESH,分别表示每一个区域的大小和每一个区域中打开正负号隐藏技术所需的区域中非零量化系数个数大于或等于的阈值。这两个变量可以是定义的固定值,也可以 是编码在码流中的可变值或定值,当编码在码流中时,可以编码在序列头中,图像头中等。
示例性地,本申请实施例提出的正负号隐藏技术实施在AVM中,其中使用的SUBSIZE区域大小可设置为16,正负号隐藏技术开启的阈值SDHTHRESH可设置为4。当正负号隐藏技术对当前区域开启时,如果当前区域中非零量化系数绝对值之和为奇数,表示该区域在预设扫描顺序上最后一个非零量化系数的正负号为负;如果当前区域中非零量化系数绝对值之和为偶数,表示该区域在预设扫描顺序上最后一个非零量化系数的正负号为正。
在本申请的再一实施例中,本申请实施例还提供了一种码流,该码流是根据待编码信息进行比特编码生成的,待编码信息包括下述至少之一:
预设元素标识信息、第一标识信息、第二标识信息、第三标识信息、第四标识信息、第五标识信息、当前块的量化系数绝对值中大于或等于15的部分、当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息以及预设参数值。
在本申请实施例中,预设元素标识信息用于指示当前块是否使用标识隐藏技术,第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息用于确定当前块的量化系数绝对值中小于15的部分,预设参数值可以包括下述至少之一:预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值。
这样,在将这些待编码信息进行比特编码生成码流之后,码流由编码端传输到解码端;然后在解码端,通过解析码流即可确定当前块是否使用标识隐藏技术;以及通过解析码流即可确定预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值等(如果预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值写入码流的情况下);以及通过解析码流还可以确定出当前块的量化系数绝对值。
通过本实施例对前述实施例的具体实现进行详细阐述,从中可以看出,根据前述实施例的技术方案,在确定当前区域中存在需要隐藏标识的非零量化系数的情况下,对该非零量化系数的标识信息(例如正负号标识信息)进行隐藏,即不需要编码/解码该非零量化系数的标识信息,可以直接根据当前区域所包括的非零量化系数绝对值的相关特性来确定该非零量化系数的标识信息;如此不仅能够节省码率,提高编解码效率,而且还能够提升编解码性能。
本申请的再一实施例中,基于前述实施例相同的发明构思,参见图9,其示出了本申请实施例提供的一种编码器90的组成结构示意图。如图9所示,该编码器90可以包括:第一确定单元901和第一判断单元902;其中,
第一确定单元901,配置为确定当前块的量化系数绝对值;
第一判断单元902,配置为按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数;
第一确定单元901,还配置为在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。
在一些实施例中,第一确定单元901,还配置为按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域所包括的非零量化系数个数;以及根据非零量化系数个数,确定当前区域中是否存在待隐藏标识的目标量化系数。
在一些实施例中,第一判断单元902,还配置为若非零量化系数个数大于预设个数,则确定当前区域中存在目标量化系数;若非零量化系数个数小于或等于预设个数,则确定当前区域中不存在目标量化系数。
在一些实施例中,第一确定单元901,还配置为按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个非零量化系数之间的第一距离值;以及根据第一距离值,确定当前区域中是否存在待隐藏标识的目标量化系数。
在一些实施例中,第一判断单元902,还配置为若第一距离值大于第一距离阈值,则确定当前区域中存在目标量化系数;以及若第一距离值小于或等于第一距离阈值,则确定当前区域中不存在目标量化系数。
在一些实施例中,第一确定单元901,还配置为按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个量化系数之间的第二距离值;以及根据第二距离值,确定当前区域中是否存在待隐藏标识的目标量化系数。
在一些实施例中,第一判断单元902,还配置为若第二距离值大于第二距离阈值,则确定当前区域中存在目标量化系数;若第二距离值小于或等于第二距离阈值,则确定当前区域中不存在目标量化系数。
在一些实施例中,第一确定单元901,还配置为按照预设扫描顺序对当前块的量化系数绝对值进行 扫描,确定当前区域包括的量化系数绝对值;以及对当前区域包括的量化系数绝对值进行加法计算,得到第一和值;以及根据第一和值,确定当前区域中是否存在待隐藏标识的目标量化系数。
在一些实施例中,第一判断单元902,还配置为若第一和值大于和值阈值,则确定当前区域中存在目标量化系数;若第一和值小于或等于和值阈值,则确定当前区域中不存在目标量化系数。
在一些实施例中,参见图9,编码器90还可以包括第一划分单元903,配置为在预设扫描顺序上,根据预设尺寸值对当前块进行区域划分,确定至少一个区域;其中,当前区域为至少一个区域中当前编码的区域。
在一些实施例中,第一划分单元903,还配置为根据预设尺寸值对当前块进行等区域划分,确定至少一个区域,其中,每一个区域包括的量化系数个数相同;或者,根据预设尺寸值对当前块进行不等区域划分,确定至少一个区域,其中,每一个区域包括的量化系数个数不相同。
在一些实施例中,参见图9,编码器90还可以包括编码单元904,配置为对预设参数值进行编码,将所得到的编码比特写入码流;其中,预设参数值包括下述至少之一:预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值。
在一些实施例中,第一确定单元901,还配置为在确定当前区域中存在目标量化系数的情况下,获取当前区域中目标位置处的非零量化系数;以及将目标位置处的非零量化系数确定为目标量化系数。
在一些实施例中,目标位置处的非零量化系数为当前区域中在预设扫描顺序上的最后一个非零量化系数。
在一些实施例中,目标位置处的非零量化系数为当前区域中在预设扫描顺序上的第K个非零量化系数,K为大于零且小于或等于N的整数,N为当前区域所包括的非零量化系数个数。
在一些实施例中,第一确定单元901,还配置为对当前区域包括的量化系数绝对值进行加法计算,得到第一和值;以及根据第一和值的奇偶特性,确定目标量化系数对应的标识信息。
在一些实施例中,第一判断单元902,还配置为在标识信息为符号标识信息的情况下,若第一和值为奇数,则确定标识信息为负号;若第一和值为偶数,则确定标识信息为正号;或者,若第一和值为奇数,则确定标识信息为正号;若标识信息为偶数,则确定标识信息为负号。
在一些实施例中,编码单元904,还配置为在确定当前块的量化系数绝对值之后,若当前块的量化系数绝对值满足下述其中之一:0、1、2或者大于或等于3,则确定第一标识信息,并对第一标识信息进行编码,将所得到的编码比特写入码流;若当前块的量化系数绝对值满足下述其中之一:3、4、5或者大于或等于6,则继续确定第二标识信息,并对第二标识信息进行编码,将所得到的编码比特写入码流;若当前块的量化系数绝对值满足下述其中之一:6、7、8或者大于或等于9,则继续确定第三标识信息,并对第三标识信息进行编码,将所得到的编码比特写入码流;若当前块的量化系数绝对值满足下述其中之一:9、10、11或者大于或等于12,则继续确定第四标识信息,并对第四标识信息进行编码,将所得到的编码比特写入码流;若当前块的量化系数绝对值满足下述其中之一:12、13、14或者大于或等于15,则继续确定第五标识信息,并对第五标识信息进行编码,将所得到的编码比特写入码流;以及若当前块的量化系数绝对值大于或等于15,则继续对当前块的量化系数绝对值进行编码,将所得到的编码比特写入码流。
在一些实施例中,编码单元904,还配置为在确定当前块的量化系数绝对值之后,在当前块的量化系数绝对值小于15时,按照第一循环顺序,使用上下文模型对第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息进行编码,将所得到的编码比特写入码流;以及在当前块的量化系数绝对值大于或等于15时,按照第二循环顺序,使用旁路模型对当前块的量化系数绝对值进行编码,将所得到的编码比特写入码流。
在一些实施例中,第一循环顺序和第二循环顺序均为从当前块的最后一个非零量化系数向当前块的左上位置的顺序;或者,第一循环顺序为从当前块的最后一个非零量化系数向当前块的左上位置的顺序,第二循环顺序为从当前块的左上位置向当前块的最后一个非零量化系数的顺序。
在一些实施例中,第一确定单元901,还配置为获取当前区域中小于15的若干个量化系数绝对值;以及对若干个量化系数绝对值进行加法计算,得到第二和值;以及根据第二和值的奇偶特性,确定目标量化系数对应的标识信息。
在一些实施例中,第一判断单元902,还配置为在标识信息为符号标识信息的情况下,若第二和值为奇数,则确定标识信息为负号;若第二和值为偶数,则确定标识信息为正号;或者,若第二和值为奇数,则确定标识信息为正号;若第二和值为偶数,则确定标识信息为负号。
在一些实施例中,第一确定单元901,还配置为对当前区域包括的量化系数绝对值进行非零量化系数统计,确定当前区域所包括的非零量化系数个数;以及根据非零量化系数个数的奇偶特性,确定目标量化系数对应的标识信息。
在一些实施例中,第一判断单元902,还配置为在标识信息为符号标识信息的情况下,若非零量化系数个数为奇数,则确定标识信息为负号;若非零量化系数个数为偶数,则确定标识信息为正号;或者,若非零量化系数个数为奇数,则确定标识信息为正号;若非零量化系数个数为偶数,则确定标识信息为负号。
在一些实施例中,编码单元904,还配置为按照第三循环顺序对当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息进行编码,将所得到的编码比特写入码流;其中,第三循环顺序为从当前块的最后一个非零量化系数向当前块的左上位置的顺序;或者,第三循环顺序为从当前块的左上位置向当前块的最后一个非零量化系数的顺序。
在一些实施例中,编码单元904,还配置为若当前块的左上位置处的第一量化系数为非零量化系数,则使用上下文模型对第一量化系数对应的标识信息进行编码,以及使用旁路模型对当前块中除第一量化系数和每一个区域中的目标量化系数之外的非零量化系数对应的标识信息进行编码。
在一些实施例中,编码单元904,还配置为使用旁路模型对当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息进行编码,将所得到的编码比特写入码流。
在一些实施例中,第一确定单元901,还配置为确定预设元素标识信息;其中,预设元素标识信息用于指示当前块是否使用标识隐藏技术;
编码单元904,还配置为对预设元素标识信息进行编码,将所得到的编码比特写入码流。
在一些实施例中,第一确定单元901,还配置为若当前块使用标识隐藏技术,则确定预设元素标识信息为第一值;若当前块不使用标识隐藏技术,则确定预设元素标识信息为第二值。
在一些实施例中,预设元素标识信息至少为下述其中一项级别的标识信息:序列级、图像级、片级和块级。
可以理解地,在本申请实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
因此,本申请实施例提供了一种计算机存储介质,应用于编码器90,该计算机存储介质存储有计算机程序,所述计算机程序被第一处理器执行时实现前述实施例中任一项所述的方法。
基于上述编码器90的组成以及计算机存储介质,参见图10,其示出了本申请实施例提供的编码器90的具体硬件结构示意图。如图10所示,编码器90可以包括:第一通信接口1001、第一存储器1002和第一处理器1003;各个组件通过第一总线系统1004耦合在一起。可理解,第一总线系统1004用于实现这些组件之间的连接通信。第一总线系统1004除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图10中将各种总线都标为第一总线系统1004。其中,
第一通信接口1001,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
第一存储器1002,用于存储能够在第一处理器1003上运行的计算机程序;
第一处理器1003,用于在运行所述计算机程序时,执行:
确定当前块的量化系数绝对值;
按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数;
在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。
可以理解,本申请实施例中的第一存储器1002可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic  RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请描述的系统和方法的第一存储器1002旨在包括但不限于这些和任意其它适合类型的存储器。
而第一处理器1003可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过第一处理器1003中的硬件的集成逻辑电路或者软件形式的指令完成。上述的第一处理器1003可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于第一存储器1002,第一处理器1003读取第一存储器1002中的信息,结合其硬件完成上述方法的步骤。
可以理解的是,本申请描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。对于软件实现,可通过执行本申请所述功能的模块(例如过程、函数等)来实现本申请所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。
可选地,作为另一个实施例,第一处理器1003还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。
本实施例提供了一种编码器,该编码器在当前区域中存在需要隐藏标识的非零量化系数的情况下,对该非零量化系数的标识信息(例如正负号标识信息)进行隐藏,即不需要编码该非零量化系数的标识信息,可以直接根据当前区域所包括的非零量化系数绝对值的相关特性来确定该非零量化系数的标识信息;如此不仅能够节省码率,提高编解码效率,而且还能够提升编解码性能。
本申请的再一实施例中,基于前述实施例相同的发明构思,参见图11,其示出了本申请实施例提供的一种解码器110的组成结构示意图。如图11所示,该解码器110可以包括:解码单元1101、第二判断单元1102和第二确定单元1103;其中,
解码单元1101,配置为解析码流,确定当前块的量化系数绝对值;
第二判断单元1102,配置为按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数;
第二确定单元1103,配置为在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。
在一些实施例中,第二确定单元1103,还配置为按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域所包括的非零量化系数个数;以及根据非零量化系数个数,确定当前区域中是否存在隐藏标识的目标量化系数。
在一些实施例中,第二判断单元1102,还配置为若非零量化系数个数大于预设个数,则确定当前区域中存在目标量化系数;若非零量化系数个数小于或等于预设个数,则确定当前区域中不存在目标量化系数。
在一些实施例中,第二确定单元1103,还配置为按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个非零量化系数之间的第一距离值;以及根据第一距离值,确定当前区域中是否存在隐藏标识的目标量化系数。
在一些实施例中,第二判断单元1102,还配置为若第一距离值大于第一距离阈值,则确定当前区域中存在目标量化系数;若第一距离值小于或等于第一距离阈值,则确定当前区域中不存在目标量化系数。
在一些实施例中,第二确定单元1103,还配置为按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个量化系数之间的第二距离值;以及根据第二距离值,确定当前区域中是否存在隐藏标识的目标量化系数。
在一些实施例中,第二判断单元1102,还配置为若第二距离值大于第二距离阈值,则确定当前区 域中存在目标量化系数;若第二距离值小于或等于第二距离阈值,则确定当前区域中不存在目标量化系数。
在一些实施例中,第二确定单元1103,还配置为按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前区域包括的量化系数绝对值;
对当前区域包括的量化系数绝对值进行加法计算,得到第一和值;以及根据第一和值,确定当前区域中是否存在隐藏标识的目标量化系数。
在一些实施例中,第二判断单元1102,还配置为若第一和值大于和值阈值,则确定当前区域中存在目标量化系数;若第一和值小于或等于和值阈值,则确定当前区域中不存在目标量化系数。
在一些实施例中,参见图11,解码器110还可以包括第二划分单元1104,配置为在预设扫描顺序上,根据预设尺寸值对当前块进行区域划分,确定至少一个区域;其中,当前区域为至少一个区域中当前解码的区域。
在一些实施例中,第二划分单元1104,还配置为根据预设尺寸值对当前块进行等区域划分,确定至少一个区域,其中,每一个区域包括的量化系数个数相同;或者,根据预设尺寸值对当前块进行不等区域划分,确定至少一个区域,其中,每一个区域包括的量化系数个数不相同。
在一些实施例中,解码单元1101,还配置为解析码流,确定预设参数值;其中,预设参数值包括下述至少之一:预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值。
在一些实施例中,第二确定单元1103,还配置为在确定当前区域中存在目标量化系数的情况下,获取当前区域中目标位置处的非零量化系数;以及将目标位置处的非零量化系数确定为目标量化系数。
在一些实施例中,目标位置处的非零量化系数为当前区域中在预设扫描顺序上的最后一个非零量化系数。
在一些实施例中,目标位置处的非零量化系数为当前区域中在预设扫描顺序上的第K个非零量化系数,K为大于零且小于或等于N的整数,N为当前区域所包括的非零量化系数个数。
在一些实施例中,第二确定单元1103,还配置为对当前区域包括的量化系数绝对值进行加法计算,得到第一和值;以及根据第一和值的奇偶特性,确定目标量化系数对应的标识信息。
在一些实施例中,第二判断单元1102,还配置为在标识信息为符号标识信息的情况下,若第一和值为奇数,则确定标识信息为负号;若第一和值为偶数,则确定标识信息为正号;或者,若第一和值为奇数,则确定标识信息为正号;若标识信息为偶数,则确定标识信息为负号。
在一些实施例中,解码单元1101,还配置为解析码流,获得第一标识信息;根据第一标识信息,确定当前块的量化系数绝对值满足下述其中之一:0、1、2或者大于或等于3;以及若当前块的量化系数绝对值大于或等于3,则继续解析码流,获得第二标识信息;根据第二标识信息,确定当前块的量化系数绝对值满足下述其中之一:3、4、5或者大于或等于6;以及若当前块的量化系数绝对值大于或等于6,则继续解析码流,获得第三标识信息;根据第三标识信息,确定当前块的量化系数绝对值满足下述其中之一:6、7、8或者大于或等于9;以及若当前块的量化系数绝对值大于或等于9,则继续解析码流,获得第四标识信息;根据第四标识信息,确定当前块的量化系数绝对值满足下述其中之一:9、10、11或者大于或等于12;以及若当前块的量化系数绝对值大于或等于12,则继续解析码流,获得第五标识信息;根据第五标识信息,确定当前块的量化系数绝对值满足下述其中之一:12、13、14或者大于或等于15;以及若当前块的量化系数绝对值大于或等于15,则继续解析码流,确定当前块的量化系数绝对值。
在一些实施例中,解码单元1101,还配置为在当前块的量化系数绝对值小于15时,使用上下文模型解析码流,确定当前块的量化系数绝对值;以及在当前块的量化系数绝对值大于或等于15时,使用旁路模型解析码流,确定当前块的量化系数绝对值。
在一些实施例中,解码单元1101,还配置为在当前块的量化系数绝对值小于15时,按照第一循环顺序解析码流,确定当前块的量化系数绝对值;以及在当前块的量化系数绝对值大于或等于15时,按照第二循环顺序解析码流,确定当前块的量化系数绝对值。
在一些实施例中,第一循环顺序和第二循环顺序均为从当前块的最后一个非零量化系数向当前块的左上位置的顺序;或者,第一循环顺序为从当前块的最后一个非零量化系数向当前块的左上位置的顺序,第二循环顺序为从当前块的左上位置向当前块的最后一个非零量化系数的顺序。
在一些实施例中,第二确定单元1103,还配置为获取当前区域中根据第一标识信息、第二标识信息、第三标识信息、第四标识信息和第五标识信息确定的若干个量化系数绝对值;以及对若干个量化系数绝对值进行加法计算,得到第二和值;以及根据第二和值的奇偶特性,确定目标量化系数对应的标识信息。
在一些实施例中,第二判断单元1102,还配置为在标识信息为符号标识信息的情况下,若第二和 值为奇数,则确定标识信息为负号;若第二和值为偶数,则确定标识信息为正号;或者,若第二和值为奇数,则确定标识信息为正号;若第二和值为偶数,则确定标识信息为负号。
在一些实施例中,第二确定单元1103,还配置为对当前区域包括的量化系数绝对值进行非零量化系数统计,确定当前区域所包括的非零量化系数个数;以及根据非零量化系数个数的奇偶特性,确定目标量化系数对应的标识信息。
在一些实施例中,第二判断单元1102,还配置为在标识信息为符号标识信息的情况下,若非零量化系数个数为奇数,则确定标识信息为负号;若非零量化系数个数为偶数,则确定标识信息为正号;或者,若非零量化系数个数为奇数,则确定标识信息为正号;若非零量化系数个数为偶数,则确定标识信息为负号。
在一些实施例中,解码单元1101,还配置为按照第三循环顺序解析码流,确定当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息;其中,第三循环顺序为从当前块的最后一个非零量化系数向当前块的左上位置的顺序;或者,第三循环顺序为从当前块的左上位置向当前块的最后一个非零量化系数的顺序。
在一些实施例中,解码单元1101,还配置为若当前块的左上位置处的第一量化系数为非零量化系数,则使用上下文模型解析码流,确定第一量化系数对应的标识信息;以及使用旁路模型解析码流,确定当前块中除第一量化系数和每一个区域中的目标量化系数之外的非零量化系数对应的标识信息。
在一些实施例中,解码单元1101,还配置为使用旁路模型解析码流,确定当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息。
在一些实施例中,解码单元1101,还配置为解析码流,确定预设元素标识信息;
第二确定单元1103,还配置为在预设元素标识信息指示当前块使用标识隐藏技术时,执行按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数的步骤。
在一些实施例中,预设元素标识信息至少为下述其中一项级别的标识信息:序列级、图像级、片级和块级。
可以理解地,在本实施例中,“单元”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是模块,还可以是非模块化的。而且在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本实施例提供了一种计算机存储介质,应用于解码器110,该计算机存储介质存储有计算机程序,所述计算机程序被第二处理器执行时实现前述实施例中任一项所述的方法。
基于上述解码器110的组成以及计算机存储介质,参见图12,其示出了本申请实施例提供的解码器110的具体硬件结构示意图。如图12所示,解码器110可以包括:第二通信接口1201、第二存储器1202和第二处理器1203;各个组件通过第二总线系统1204耦合在一起。可理解,第二总线系统1204用于实现这些组件之间的连接通信。第二总线系统1204除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图12中将各种总线都标为第二总线系统1204。其中,
第二通信接口1201,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;
第二存储器1202,用于存储能够在第二处理器1203上运行的计算机程序;
第二处理器1203,用于在运行所述计算机程序时,执行:
解析码流,确定当前块的量化系数绝对值;
按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数;
在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。
可选地,作为另一个实施例,第二处理器1203还配置为在运行所述计算机程序时,执行前述实施例中任一项所述的方法。
可以理解,第二存储器1202与第一存储器1002的硬件功能类似,第二处理器1203与第一处理器1003的硬件功能类似;这里不再详述。
本实施例提供了一种解码器,该解码器在当前区域中存在需要隐藏标识的非零量化系数的情况下,对该非零量化系数的标识信息(例如正负号标识信息)进行隐藏,即不需要解码该非零量化系数的标识信息,可以直接根据当前区域所包括的非零量化系数绝对值的相关特性来确定该非零量化系数的标识信 息;如此不仅能够节省码率,提高编解码效率,而且还能够提升编解码性能。
在本申请的再一实施例中,参见图13,其示出了本申请实施例提供的一种编解码系统的组成结构示意图。如图13所示,编解码系统130可以包括编码设备1301和解码设备1302。其中,编码设备1301可以为前述实施例中任一项所述的编码器,解码设备1302可以为前述实施例中任一项所述的解码器。
在本申请实施例中,该编解码系统130中的编码设备1301与解码设备1302可以进行信息交互,例如编码设备1301生成的码流可以传输到解码设备1302中。这样,对于该编解码系统130而言,在确定当前区域中存在需要隐藏标识的非零量化系数的情况下,对该非零量化系数的标识信息(例如正负号标识信息)进行隐藏,即不需要编码/解码该非零量化系数的标识信息,可以直接根据当前区域所包括的非零量化系数绝对值的相关特性来确定该非零量化系数的标识信息;如此不仅能够节省码率,提高编解码效率,而且还能够提升编解码性能。
需要说明的是,在本申请中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
工业实用性
本申请实施例中,在编码端,通过确定当前块的量化系数绝对值;按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在待隐藏标识的目标量化系数;在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。在解码端,通过解析码流,确定当前块的量化系数绝对值;按照预设扫描顺序对当前块的量化系数绝对值进行扫描,确定当前块的当前区域中是否存在隐藏标识的目标量化系数;在确定当前区域中存在目标量化系数的情况下,根据当前区域包括的量化系数绝对值,确定目标量化系数对应的标识信息。这样,无论是编码端还是解码端,都可以在当前区域中存在需要隐藏标识的非零量化系数的情况下,对该非零量化系数的标识信息(例如正负号标识信息)进行隐藏,即不需要编码/解码该非零量化系数的标识信息,可以直接根据当前区域所包括的非零量化系数绝对值的相关特性来确定该非零量化系数的标识信息;如此不仅能够节省码率,提高编解码效率,而且还能够提升编解码性能。

Claims (66)

  1. 一种解码方法,应用于解码器,所述方法包括:
    解析码流,确定当前块的量化系数绝对值;
    按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在隐藏标识的目标量化系数;
    在确定所述当前区域中存在所述目标量化系数的情况下,根据所述当前区域包括的量化系数绝对值,确定所述目标量化系数对应的标识信息。
  2. 根据权利要求1所述的方法,其中,所述按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在隐藏标识的目标量化系数,包括:
    按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前区域所包括的非零量化系数个数;
    根据所述非零量化系数个数,确定所述当前区域中是否存在隐藏标识的目标量化系数。
  3. 根据权利要求2所述的方法,其中,所述根据所述非零量化系数个数,确定所述当前区域中是否存在隐藏标识的目标量化系数,包括:
    若所述非零量化系数个数大于预设个数,则确定所述当前区域中存在所述目标量化系数;
    若所述非零量化系数个数小于或等于预设个数,则确定所述当前区域中不存在所述目标量化系数。
  4. 根据权利要求1所述的方法,其中,所述按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在隐藏标识的目标量化系数,包括:
    按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个非零量化系数之间的第一距离值;
    根据所述第一距离值,确定所述当前区域中是否存在隐藏标识的目标量化系数。
  5. 根据权利要求4所述的方法,其中,所述根据所述第一距离值,确定所述当前区域中是否存在隐藏标识的目标量化系数,包括:
    若所述第一距离值大于第一距离阈值,则确定所述当前区域中存在所述目标量化系数;
    若所述第一距离值小于或等于第一距离阈值,则确定所述当前区域中不存在所述目标量化系数。
  6. 根据权利要求1所述的方法,其中,所述按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在隐藏标识的目标量化系数,包括:
    按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个量化系数之间的第二距离值;
    根据所述第二距离值,确定所述当前区域中是否存在隐藏标识的目标量化系数。
  7. 根据权利要求6所述的方法,其中,所述根据所述第二距离值,确定所述当前区域中是否存在隐藏标识的目标量化系数,包括:
    若所述第二距离值大于第二距离阈值,则确定所述当前区域中存在所述目标量化系数;
    若所述第二距离值小于或等于第二距离阈值,则确定所述当前区域中不存在所述目标量化系数。
  8. 根据权利要求1所述的方法,其中,所述按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在隐藏标识的目标量化系数,包括:
    按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前区域包括的量化系数绝对值;
    对所述当前区域包括的量化系数绝对值进行加法计算,得到第一和值;
    根据所述第一和值,确定所述当前区域中是否存在隐藏标识的目标量化系数。
  9. 根据权利要求8所述的方法,其中,所述根据所述第一和值,确定所述当前区域中是否存在隐藏标识的目标量化系数,包括:
    若所述第一和值大于和值阈值,则确定所述当前区域中存在所述目标量化系数;
    若所述第一和值小于或等于和值阈值,则确定所述当前区域中不存在所述目标量化系数。
  10. 根据权利要求1所述的方法,其中,所述方法还包括:
    在预设扫描顺序上,根据预设尺寸值对所述当前块进行区域划分,确定至少一个区域;其中,所述当前区域为所述至少一个区域中当前解码的区域。
  11. 根据权利要求10所述的方法,其中,所述根据预设尺寸值对所述当前块进行区域划分,确定至少一个区域,包括:
    根据预设尺寸值对所述当前块进行等区域划分,确定所述至少一个区域,其中,每一个区域包括的 量化系数个数相同;或者,
    根据预设尺寸值对所述当前块进行不等区域划分,确定所述至少一个区域,其中,每一个区域包括的量化系数个数不相同。
  12. 根据权利要求1所述的方法,其中,所述方法还包括:
    解析码流,确定预设参数值;
    其中,所述预设参数值包括下述至少之一:预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值。
  13. 根据权利要求1所述的方法,其中,所述方法还包括:
    在确定所述当前区域中存在所述目标量化系数的情况下,获取所述当前区域中目标位置处的非零量化系数;
    将所述目标位置处的非零量化系数确定为所述目标量化系数。
  14. 根据权利要求13所述的方法,其中,所述目标位置处的非零量化系数为所述当前区域中在预设扫描顺序上的最后一个非零量化系数。
  15. 根据权利要求13所述的方法,其中,所述目标位置处的非零量化系数为所述当前区域中在预设扫描顺序上的第K个非零量化系数,K为大于零且小于或等于N的整数,N为所述当前区域所包括的非零量化系数个数。
  16. 根据权利要求1所述的方法,其中,所述根据所述当前区域包括的量化系数绝对值,确定所述目标量化系数对应的标识信息,包括:
    对所述当前区域包括的量化系数绝对值进行加法计算,得到第一和值;
    根据所述第一和值的奇偶特性,确定所述目标量化系数对应的所述标识信息。
  17. 根据权利要求16所述的方法,其中,在所述标识信息为符号标识信息的情况下,所述根据所述第一和值的奇偶特性,确定所述目标量化系数对应的所述标识信息,包括:
    若所述第一和值为奇数,则确定所述标识信息为负号;
    若所述第一和值为偶数,则确定所述标识信息为正号;
    或者,
    若所述第一和值为奇数,则确定所述标识信息为正号;
    若所述标识信息为偶数,则确定所述标识信息为负号。
  18. 根据权利要求1所述的方法,其中,所述解析码流,确定当前块的量化系数绝对值,包括:
    解析码流,获得第一标识信息;
    根据所述第一标识信息,确定所述当前块的量化系数绝对值满足下述其中之一:0、1、2或者大于或等于3;
    若所述当前块的量化系数绝对值大于或等于3,则继续解析所述码流,获得第二标识信息;
    根据所述第二标识信息,确定所述当前块的量化系数绝对值满足下述其中之一:3、4、5或者大于或等于6;
    若所述当前块的量化系数绝对值大于或等于6,则继续解析所述码流,获得第三标识信息;
    根据所述第三标识信息,确定所述当前块的量化系数绝对值满足下述其中之一:6、7、8或者大于或等于9;
    若所述当前块的量化系数绝对值大于或等于9,则继续解析所述码流,获得第四标识信息;
    根据所述第四标识信息,确定所述当前块的量化系数绝对值满足下述其中之一:9、10、11或者大于或等于12;
    若所述当前块的量化系数绝对值大于或等于12,则继续解析所述码流,获得第五标识信息;
    根据所述第五标识信息,确定所述当前块的量化系数绝对值满足下述其中之一:12、13、14或者大于或等于15;
    若所述当前块的量化系数绝对值大于或等于15,则继续解析所述码流,确定所述当前块的量化系数绝对值。
  19. 根据权利要求18所述的方法,其中,所述解析码流,确定当前块的量化系数绝对值,包括:
    在所述当前块的量化系数绝对值小于15时,使用上下文模型解析所述码流,确定所述当前块的量化系数绝对值;
    在所述当前块的量化系数绝对值大于或等于15时,使用旁路模型解析所述码流,确定所述当前块的量化系数绝对值。
  20. 根据权利要求18所述的方法,其中,所述解析码流,确定当前块的量化系数绝对值,包括:
    在所述当前块的量化系数绝对值小于15时,按照第一循环顺序解析所述码流,确定所述当前块的 量化系数绝对值;
    在所述当前块的量化系数绝对值大于或等于15时,按照第二循环顺序解析所述码流,确定所述当前块的量化系数绝对值。
  21. 根据权利要求20所述的方法,其中,所述第一循环顺序和所述第二循环顺序均为从所述当前块的最后一个非零量化系数向所述当前块的左上位置的顺序;或者,
    所述第一循环顺序为从所述当前块的最后一个非零量化系数向所述当前块的左上位置的顺序,所述第二循环顺序为从所述当前块的左上位置向所述当前块的最后一个非零量化系数的顺序。
  22. 根据权利要求18所述的方法,其中,所述根据所述当前区域包括的量化系数绝对值,确定所述目标量化系数对应的标识信息,包括:
    获取所述当前区域中根据所述第一标识信息、所述第二标识信息、所述第三标识信息、所述第四标识信息和所述第五标识信息确定的若干个量化系数绝对值;
    对所述若干个量化系数绝对值进行加法计算,得到第二和值;
    根据所述第二和值的奇偶特性,确定所述目标量化系数对应的所述标识信息。
  23. 根据权利要求22所述的方法,其中,在所述标识信息为符号标识信息的情况下,所述根据所述第二和值的奇偶特性,确定所述目标量化系数对应的所述标识信息,包括:
    若所述第二和值为奇数,则确定所述标识信息为负号;
    若所述第二和值为偶数,则确定所述标识信息为正号;
    或者,
    若所述第二和值为奇数,则确定所述标识信息为正号;
    若所述第二和值为偶数,则确定所述标识信息为负号。
  24. 根据权利要求1所述的方法,其中,所述根据所述当前区域包括的量化系数绝对值,确定所述目标量化系数对应的标识信息,包括:
    对所述当前区域包括的量化系数绝对值进行非零量化系数统计,确定所述当前区域所包括的非零量化系数个数;
    根据所述非零量化系数个数的奇偶特性,确定所述目标量化系数对应的所述标识信息。
  25. 根据权利要求24所述的方法,其中,在所述标识信息为符号标识信息的情况下,所述根据所述非零量化系数个数的奇偶特性,确定所述目标量化系数对应的所述标识信息,包括:
    若所述非零量化系数个数为奇数,则确定所述标识信息为负号;
    若所述非零量化系数个数为偶数,则确定所述标识信息为正号;
    或者,
    若所述非零量化系数个数为奇数,则确定所述标识信息为正号;
    若所述非零量化系数个数为偶数,则确定所述标识信息为负号。
  26. 根据权利要求1所述的方法,其中,所述方法还包括:
    按照第三循环顺序解析所述码流,确定所述当前块的每一个区域中除所述目标量化系数之外的非零量化系数对应的标识信息;
    其中,所述第三循环顺序为从所述当前块的最后一个非零量化系数向所述当前块的左上位置的顺序;或者,所述第三循环顺序为从所述当前块的左上位置向所述当前块的最后一个非零量化系数的顺序。
  27. 根据权利要求26所述的方法,其中,所述方法还包括:
    若所述当前块的左上位置处的第一量化系数为非零量化系数,则使用上下文模型解析所述码流,确定所述第一量化系数对应的标识信息;以及
    使用旁路模型解析所述码流,确定所述当前块中除所述第一量化系数和每一个区域中的所述目标量化系数之外的非零量化系数对应的标识信息。
  28. 根据权利要求26所述的方法,其中,所述方法还包括:
    使用旁路模型解析所述码流,确定所述当前块的每一个区域中除所述目标量化系数之外的非零量化系数对应的标识信息。
  29. 根据权利要求1至28任一项所述的方法,其中,所述方法还包括:
    解析所述码流,确定预设元素标识信息;
    在所述预设元素标识信息指示所述当前块使用标识隐藏技术时,执行所述按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在隐藏标识的目标量化系数的步骤。
  30. 根据权利要求29所述的方法,其中,所述预设元素标识信息至少为下述其中一项级别的标识信息:序列级、图像级、片级和块级。
  31. 一种编码方法,应用于编码器,所述方法包括:
    确定当前块的量化系数绝对值;
    按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在待隐藏标识的目标量化系数;
    在确定所述当前区域中存在所述目标量化系数的情况下,根据所述当前区域包括的量化系数绝对值,确定所述目标量化系数对应的标识信息。
  32. 根据权利要求31所述的方法,其中,所述按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在待隐藏标识的目标量化系数,包括:
    按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前区域所包括的非零量化系数个数;
    根据所述非零量化系数个数,确定所述当前区域中是否存在待隐藏标识的目标量化系数。
  33. 根据权利要求32所述的方法,其中,所述根据所述非零量化系数个数,确定所述当前区域中是否存在待隐藏标识的目标量化系数,包括:
    若所述非零量化系数个数大于预设个数,则确定所述当前区域中存在所述目标量化系数;
    若所述非零量化系数个数小于或等于预设个数,则确定所述当前区域中不存在所述目标量化系数。
  34. 根据权利要求31所述的方法,其中,所述按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在待隐藏标识的目标量化系数,包括:
    按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个非零量化系数之间的第一距离值;
    根据所述第一距离值,确定所述当前区域中是否存在待隐藏标识的目标量化系数。
  35. 根据权利要求34所述的方法,其中,所述根据所述第一距离值,确定所述当前区域中是否存在待隐藏标识的目标量化系数,包括:
    若所述第一距离值大于第一距离阈值,则确定所述当前区域中存在所述目标量化系数;
    若所述第一距离值小于或等于第一距离阈值,则确定所述当前区域中不存在所述目标量化系数。
  36. 根据权利要求31所述的方法,其中,所述按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在待隐藏标识的目标量化系数,包括:
    按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前区域中在预设扫描顺序上的第一个非零量化系数与最后一个量化系数之间的第二距离值;
    根据所述第二距离值,确定所述当前区域中是否存在待隐藏标识的目标量化系数。
  37. 根据权利要求36所述的方法,其中,所述根据所述第二距离值,确定所述当前区域中是否存在待隐藏标识的目标量化系数,包括:
    若所述第二距离值大于第二距离阈值,则确定所述当前区域中存在所述目标量化系数;
    若所述第二距离值小于或等于第二距离阈值,则确定所述当前区域中不存在所述目标量化系数。
  38. 根据权利要求31所述的方法,其中,所述按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在待隐藏标识的目标量化系数,包括:
    按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前区域包括的量化系数绝对值;
    对所述当前区域包括的量化系数绝对值进行加法计算,得到第一和值;
    根据所述第一和值,确定所述当前区域中是否存在待隐藏标识的目标量化系数。
  39. 根据权利要求38所述的方法,其中,所述根据所述第一和值,确定所述当前区域中是否存在待隐藏标识的目标量化系数,包括:
    若所述第一和值大于和值阈值,则确定所述当前区域中存在所述目标量化系数;
    若所述第一和值小于或等于和值阈值,则确定所述当前区域中不存在所述目标量化系数。
  40. 根据权利要求31所述的方法,其中,所述方法还包括:
    在预设扫描顺序上,根据预设尺寸值对所述当前块进行区域划分,确定至少一个区域;其中,所述当前区域为所述至少一个区域中当前编码的区域。
  41. 根据权利要求40所述的方法,其中,所述根据预设尺寸值对所述当前块进行区域划分,确定至少一个区域,包括:
    根据预设尺寸值对所述当前块进行等区域划分,确定所述至少一个区域,其中,每一个区域包括的量化系数个数相同;或者,
    根据预设尺寸值对所述当前块进行不等区域划分,确定所述至少一个区域,其中,每一个区域包括的量化系数个数不相同。
  42. 根据权利要求31所述的方法,其中,所述方法还包括:
    对预设参数值进行编码,将所得到的编码比特写入码流;
    其中,所述预设参数值包括下述至少之一:预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值。
  43. 根据权利要求31所述的方法,其中,所述方法还包括:
    在确定所述当前区域中存在所述目标量化系数的情况下,获取所述当前区域中目标位置处的非零量化系数;
    将所述目标位置处的非零量化系数确定为所述目标量化系数。
  44. 根据权利要求43所述的方法,其中,所述目标位置处的非零量化系数为所述当前区域中在预设扫描顺序上的最后一个非零量化系数。
  45. 根据权利要求43所述的方法,其中,所述目标位置处的非零量化系数为所述当前区域中在预设扫描顺序上的第K个非零量化系数,K为大于零且小于或等于N的整数,N为所述当前区域所包括的非零量化系数个数。
  46. 根据权利要求31所述的方法,其中,所述根据所述当前区域包括的量化系数绝对值,确定所述目标量化系数对应的标识信息,包括:
    对所述当前区域包括的量化系数绝对值进行加法计算,得到第一和值;
    根据所述第一和值的奇偶特性,确定所述目标量化系数对应的所述标识信息。
  47. 根据权利要求46所述的方法,其中,在所述标识信息为符号标识信息的情况下,所述根据所述第一和值的奇偶特性,确定所述目标量化系数对应的所述标识信息,包括:
    若所述第一和值为奇数,则确定所述标识信息为负号;
    若所述第一和值为偶数,则确定所述标识信息为正号;
    或者,
    若所述第一和值为奇数,则确定所述标识信息为正号;
    若所述标识信息为偶数,则确定所述标识信息为负号。
  48. 根据权利要求31所述的方法,其中,在所述确定当前块的量化系数绝对值之后,所述方法还包括:
    若所述当前块的量化系数绝对值满足下述其中之一:0、1、2或者大于或等于3,则确定第一标识信息,并对所述第一标识信息进行编码,将所得到的编码比特写入码流;
    若所述当前块的量化系数绝对值满足下述其中之一:3、4、5或者大于或等于6,则继续确定第二标识信息,并对所述第二标识信息进行编码,将所得到的编码比特写入码流;
    若所述当前块的量化系数绝对值满足下述其中之一:6、7、8或者大于或等于9,则继续确定第三标识信息,并对所述第三标识信息进行编码,将所得到的编码比特写入码流;
    若所述当前块的量化系数绝对值满足下述其中之一:9、10、11或者大于或等于12,则继续确定第四标识信息,并对所述第四标识信息进行编码,将所得到的编码比特写入码流;
    若所述当前块的量化系数绝对值满足下述其中之一:12、13、14或者大于或等于15,则继续确定第五标识信息,并对所述第五标识信息进行编码,将所得到的编码比特写入码流;
    若所述当前块的量化系数绝对值大于或等于15,则继续对所述当前块的量化系数绝对值进行编码,将所得到的编码比特写入码流。
  49. 根据权利要求48所述的方法,其中,在所述确定当前块的量化系数绝对值之后,所述方法还包括:
    在所述当前块的量化系数绝对值小于15时,按照第一循环顺序,使用上下文模型对所述第一标识信息、所述第二标识信息、所述第三标识信息、所述第四标识信息和所述第五标识信息进行编码,将所得到的编码比特写入码流;
    在所述当前块的量化系数绝对值大于或等于15时,按照第二循环顺序,使用旁路模型对所述当前块的量化系数绝对值进行编码,将所得到的编码比特写入码流。
  50. 根据权利要求49所述的方法,其中,所述第一循环顺序和所述第二循环顺序均为从所述当前块的最后一个非零量化系数向所述当前块的左上位置的顺序;或者,
    所述第一循环顺序为从所述当前块的最后一个非零量化系数向所述当前块的左上位置的顺序,所述第二循环顺序为从所述当前块的左上位置向所述当前块的最后一个非零量化系数的顺序。
  51. 根据权利要求48所述的方法,其中,所述根据所述当前区域包括的量化系数绝对值,确定所述目标量化系数对应的标识信息,包括:
    获取所述当前区域中小于15的若干个量化系数绝对值;
    对所述若干个量化系数绝对值进行加法计算,得到第二和值;
    根据所述第二和值的奇偶特性,确定所述目标量化系数对应的所述标识信息。
  52. 根据权利要求51所述的方法,其中,在所述标识信息为符号标识信息的情况下,所述根据所述第二和值的奇偶特性,确定所述目标量化系数对应的所述标识信息,包括:
    若所述第二和值为奇数,则确定所述标识信息为负号;
    若所述第二和值为偶数,则确定所述标识信息为正号;
    或者,
    若所述第二和值为奇数,则确定所述标识信息为正号;
    若所述第二和值为偶数,则确定所述标识信息为负号。
  53. 根据权利要求31所述的方法,其中,所述根据所述当前区域包括的量化系数绝对值,确定所述目标量化系数对应的标识信息,包括:
    对所述当前区域包括的量化系数绝对值进行非零量化系数统计,确定所述当前区域所包括的非零量化系数个数;
    根据所述非零量化系数个数的奇偶特性,确定所述目标量化系数对应的所述标识信息。
  54. 根据权利要求53所述的方法,其中,在所述标识信息为符号标识信息的情况下,所述根据所述非零量化系数个数的奇偶特性,确定所述目标量化系数对应的所述标识信息,包括:
    若所述非零量化系数个数为奇数,则确定所述标识信息为负号;
    若所述非零量化系数个数为偶数,则确定所述标识信息为正号;
    或者,
    若所述非零量化系数个数为奇数,则确定所述标识信息为正号;
    若所述非零量化系数个数为偶数,则确定所述标识信息为负号。
  55. 根据权利要求31所述的方法,其中,所述方法还包括:
    按照第三循环顺序对所述当前块的每一个区域中除所述目标量化系数之外的非零量化系数对应的标识信息进行编码,将所得到的编码比特写入码流;
    其中,所述第三循环顺序为从所述当前块的最后一个非零量化系数向所述当前块的左上位置的顺序;或者,所述第三循环顺序为从所述当前块的左上位置向所述当前块的最后一个非零量化系数的顺序。
  56. 根据权利要求55所述的方法,其中,所述方法还包括:
    若所述当前块的左上位置处的第一量化系数为非零量化系数,则使用上下文模型对所述第一量化系数对应的标识信息进行编码,以及使用旁路模型对所述当前块中除所述第一量化系数和每一个区域中的所述目标量化系数之外的非零量化系数对应的标识信息进行编码。
  57. 根据权利要求55所述的方法,其中,所述方法还包括:
    使用旁路模型对所述当前块的每一个区域中除所述目标量化系数之外的非零量化系数对应的标识信息进行编码,将所得到的编码比特写入码流。
  58. 根据权利要求31至57任一项所述的方法,其中,所述方法还包括:
    确定预设元素标识信息;其中,所述预设元素标识信息用于指示所述当前块是否使用标识隐藏技术;
    对所述预设元素标识信息进行编码,将所得到的编码比特写入码流。
  59. 根据权利要求58所述的方法,其中,所述确定预设元素标识信息,包括:
    若所述当前块使用标识隐藏技术,则确定所述预设元素标识信息为第一值;
    若所述当前块不使用标识隐藏技术,则确定所述预设元素标识信息为第二值。
  60. 根据权利要求58所述的方法,其中,所述预设元素标识信息至少为下述其中一项级别的标识信息:序列级、图像级、片级和块级。
  61. 一种码流,所述码流是根据待编码信息进行比特编码生成的,所述待编码信息包括下述至少之一:
    预设元素标识信息、第一标识信息、第二标识信息、第三标识信息、第四标识信息、第五标识信息、当前块的量化系数绝对值中大于或等于15的部分、所述当前块的每一个区域中除目标量化系数之外的非零量化系数对应的标识信息以及预设参数值;
    其中,所述预设元素标识信息用于指示所述当前块是否使用标识隐藏技术,所述第一标识信息、所述第二标识信息、所述第三标识信息、所述第四标识信息和所述第五标识信息用于确定所述当前块的量化系数绝对值中小于15的部分,所述预设参数值包括下述至少之一:预设个数、第一距离阈值、第二距离阈值、和值阈值和预设尺寸值。
  62. 一种编码器,包括第一确定单元和第一判断单元;其中,
    所述第一确定单元,配置为确定当前块的量化系数绝对值;
    所述第一判断单元,配置为按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在待隐藏标识的目标量化系数;
    所述第一确定单元,还配置为在确定所述当前区域中存在所述目标量化系数的情况下,根据所述当前区域包括的量化系数绝对值,确定所述目标量化系数对应的标识信息。
  63. 一种编码器,所述编码器包括第一存储器和第一处理器;其中,
    所述第一存储器,用于存储能够在所述第一处理器上运行的计算机程序;
    所述第一处理器,用于在运行所述计算机程序时,执行如权利要求31至60任一项所述的方法。
  64. 一种解码器,包括解码单元、第二确定单元和第二判断单元;其中,
    所述解码单元,配置为解析码流,确定当前块的量化系数绝对值;
    所述第二判断单元,配置为按照预设扫描顺序对所述当前块的量化系数绝对值进行扫描,确定所述当前块的当前区域中是否存在隐藏标识的目标量化系数;
    所述第二确定单元,配置为在确定所述当前区域中存在所述目标量化系数的情况下,根据所述当前区域包括的量化系数绝对值,确定所述目标量化系数对应的标识信息。
  65. 一种解码器,所述解码器包括第二存储器和第二处理器;其中,
    所述第二存储器,用于存储能够在所述第二处理器上运行的计算机程序;
    所述第二处理器,用于在运行所述计算机程序时,执行如权利要求1至30任一项所述的方法。
  66. 一种计算机存储介质,其中,所述计算机存储介质存储有计算机程序,所述计算机程序被执行时实现如权利要求1至30任一项所述的方法、或者实现如权利要求31至60任一项所述的方法。
PCT/CN2022/085946 2022-04-08 2022-04-08 编解码方法、码流、编码器、解码器以及存储介质 WO2023193260A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/085946 WO2023193260A1 (zh) 2022-04-08 2022-04-08 编解码方法、码流、编码器、解码器以及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2022/085946 WO2023193260A1 (zh) 2022-04-08 2022-04-08 编解码方法、码流、编码器、解码器以及存储介质

Publications (1)

Publication Number Publication Date
WO2023193260A1 true WO2023193260A1 (zh) 2023-10-12

Family

ID=88243891

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/085946 WO2023193260A1 (zh) 2022-04-08 2022-04-08 编解码方法、码流、编码器、解码器以及存储介质

Country Status (1)

Country Link
WO (1) WO2023193260A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108353167A (zh) * 2015-11-13 2018-07-31 高通股份有限公司 译码视频数据的正负号信息
WO2019135630A1 (ko) * 2018-01-05 2019-07-11 에스케이텔레콤 주식회사 변환 계수의 부호 데이터 은닉
CN111788830A (zh) * 2017-12-13 2020-10-16 三星电子株式会社 视频解码方法及其装置以及视频编码方法及其装置
CN111837389A (zh) * 2018-03-07 2020-10-27 华为技术有限公司 适用于多符号位隐藏的块检测方法及装置
CN113892269A (zh) * 2019-05-29 2022-01-04 韩国电子通信研究院 图像编码/解码方法和设备、以及存储有比特流的记录介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108353167A (zh) * 2015-11-13 2018-07-31 高通股份有限公司 译码视频数据的正负号信息
CN111788830A (zh) * 2017-12-13 2020-10-16 三星电子株式会社 视频解码方法及其装置以及视频编码方法及其装置
WO2019135630A1 (ko) * 2018-01-05 2019-07-11 에스케이텔레콤 주식회사 변환 계수의 부호 데이터 은닉
CN111837389A (zh) * 2018-03-07 2020-10-27 华为技术有限公司 适用于多符号位隐藏的块检测方法及装置
CN113892269A (zh) * 2019-05-29 2022-01-04 韩国电子通信研究院 图像编码/解码方法和设备、以及存储有比特流的记录介质

Similar Documents

Publication Publication Date Title
WO2020253829A1 (zh) 一种编解码方法、装置及存储介质
US11778235B2 (en) Signaling coding of transform-skipped blocks
JP7439841B2 (ja) ループ内フィルタリングの方法及びループ内フィルタリングの装置
CN113068028A (zh) 视频图像分量的预测方法、装置及计算机存储介质
JP2019521555A (ja) イントラ予測されたピクチャのブロックを復号する方法及び装置並びに対応するコード化方法及びコード化装置
CN113068026B (zh) 编码预测方法、装置及计算机存储介质
WO2022116246A1 (zh) 帧间预测方法、视频编解码方法、装置及介质
WO2022227082A1 (zh) 块划分方法、编码器、解码器以及计算机存储介质
WO2023193260A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
US20220167010A1 (en) Image decoding device, image decoding method, and program
CN113395520B (zh) 解码预测方法、装置及计算机存储介质
WO2020215226A1 (zh) 图像解码方法、解码器以及存储介质
WO2020215216A1 (zh) 图像解码方法、解码器以及存储介质
WO2020258052A1 (zh) 图像分量预测方法、装置及计算机存储介质
WO2024060099A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2023123358A1 (zh) 编解码方法、码流、编码器、解码器以及存储介质
WO2022217442A1 (zh) 系数编解码方法、编码器、解码器以及计算机存储介质
WO2023272517A1 (zh) 编解码方法、码流、编码器、解码器及计算机存储介质
WO2022266971A1 (zh) 编解码方法、编码器、解码器以及计算机存储介质
WO2024007120A1 (zh) 编解码方法、编码器、解码器以及存储介质
WO2022188239A1 (zh) 系数的编解码方法、编码器、解码器及计算机存储介质
WO2023231008A1 (zh) 编解码方法、编码器、解码器以及存储介质
WO2023044917A1 (zh) 帧内预测的方法、编码器、解码器和编解码系统
WO2024113311A1 (zh) 编解码方法、编解码器、码流以及存储介质
WO2023065890A1 (zh) 多媒体数据处理方法、装置、计算机设备、计算机可读存储介质及计算机程序产品

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22936197

Country of ref document: EP

Kind code of ref document: A1