WO2009086766A1 - A quantization mode and an encoding and decoding method, an encoder and a decoder and a codec system - Google Patents

A quantization mode and an encoding and decoding method, an encoder and a decoder and a codec system Download PDF

Info

Publication number
WO2009086766A1
WO2009086766A1 PCT/CN2008/073338 CN2008073338W WO2009086766A1 WO 2009086766 A1 WO2009086766 A1 WO 2009086766A1 CN 2008073338 W CN2008073338 W CN 2008073338W WO 2009086766 A1 WO2009086766 A1 WO 2009086766A1
Authority
WO
WIPO (PCT)
Prior art keywords
code stream
image
quantization mode
mode
quantization
Prior art date
Application number
PCT/CN2008/073338
Other languages
French (fr)
Chinese (zh)
Inventor
Jianhua Zheng
Xiaozhen Zheng
Original Assignee
Huawei Technologies Co., Ltd.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co., Ltd. filed Critical Huawei Technologies Co., Ltd.
Publication of WO2009086766A1 publication Critical patent/WO2009086766A1/en

Links

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/124Quantisation
    • H04N19/126Details of normalisation or weighting functions, e.g. normalisation matrices or variable uniform quantisers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • Quantization mode and image encoding and decoding method, encoder and decoder, and codec system are quantization mode and image encoding and decoding method, encoder and decoder, and codec system.
  • the invention name is "quantization mode, image coding"
  • Embodiments of the present invention relate to codec techniques, and in particular, to a quantization mode and a corresponding image encoding and decoding method, an encoder and a decoder, and a codec system.
  • the macroblock-level adaptive quantization technique is to provide a macroblock quantization codec method, and in the image coding and decoding process, the macroblock quantization quality can be changed according to the content of each macroblock image.
  • a macroblock-level adaptive quantization codec technology in which a technique of predicting a current block feature by using neighboring block coded information is used, so that different macros are selected according to the predicted macroblock feature in quantization. Block quantization quality.
  • the neighboring block coding information includes block mode information of the neighboring block, prediction Information, motion vector information, etc., which can reflect the image characteristics of the current block. As shown in FIG.
  • FIG. 1 which is a schematic diagram of a macroblock in the prior art, where the current block is E, the adjacent blocks of E are A, B, C, and D, and the block sizes of block E and blocks A, B, C, and D can be The same, can also be different.
  • the adjacent blocks in the vertical direction of block E are A and D, and the adjacent blocks in the horizontal direction are B and! ) or C and D.
  • the adjacent boundary block of E is called a direct neighboring block of E, and the adjacent block of the adjacent boundary block of E is called an indirect neighboring block of E.
  • the 2 is a schematic diagram of a prior art image codec system, where the encoder 1 includes a transform module 2, a scaling or quantization module 3, a first quantization mode decision module 4, and an entropy encoding module 5.
  • the decoder 6 includes An entropy decoding module 7, an inverse scaling or inverse quantization module 8, a second quantization mode decision module 9 and an inverse transform module 10, wherein the first quantization mode decision module 4 utilizes block mode information and macroblock size of neighboring blocks in the encoding process And parameter information such as prediction information, before quantifying the current block, determining a quantization mode of the current block according to a result of determining whether the current block is a detail region.
  • Quantization mode A which is the default quantization mode
  • the quantization matrix used in coding is the same as the current default quantization matrix
  • Quantization mode B in order to preserve the detail quantization mode, the quantization matrix used in encoding allows the quantized image to retain image details;
  • the quantization mode C is a non-detail quantization mode, and the quantized image does not need to retain image details. According to the visual characteristics of a person, the quantization mode of the decision current block generally needs to follow the following criteria:
  • the quantization mode used should retain more high-frequency information, that is, use a high-quality quantization mode
  • the quantization mode used should retain more high-frequency information, that is, use a high-quality quantization mode
  • the current block is a region with relatively strong motion. If the appropriate decline in objective quality does not have a large impact on subjective quality, a coarser quantization mode can be used, that is, a low-quality quantization mode is used.
  • the quantization mode decision is actually a set of decision rules satisfying the above decision criteria, and the current block quantization quality is determined according to different frame types and different neighbor block coding information, and the decision result is the current block quantization mode. .
  • the first quantization mode decision module 4 uses the parameter information such as the block mode information, the macroblock size, and the prediction information of the neighboring block to determine the quantization mode of the current block through a preset criterion.
  • the second quantization mode decision module 9 uses the parameter information such as the block mode information, the macroblock size, and the prediction information of the neighboring block to determine the quantization mode of the current block through a preset criterion.
  • the set criterion is to set a corresponding quantization mode according to the parameter information of the neighboring block.
  • Both the encoder 1 and the decoder 6 include a quantization mode decision module, that is, both the encoding and decoding methods need to perform a quantization mode decision algorithm, which increases the computational burden and implementation cost of the decoder;
  • the embodiment of the invention provides a quantization mode and a corresponding image encoding and decoding method, an encoder and a decoder, and a codec system, so that the decoding end can obtain the quantization mode according to the decoded code stream, and reduce the quantization mode decision at the decoding end.
  • the embodiment of the invention provides a quantization mode coding method, including:
  • the quantized mode code stream value is written into the image code stream.
  • the embodiment of the invention provides a quantization mode decoding method, including:
  • a quantization mode of the current decoded block is obtained according to the quantized mode code stream value.
  • An embodiment of the present invention provides a quantization mode encoder, including: a quantization mode coding module, configured to obtain a quantization mode code stream value according to a quantization mode of the current coding block;
  • an image stream insertion module configured to write the quantized mode code stream value into the image code stream.
  • An embodiment of the present invention provides a quantization mode decoder, including:
  • a quantization mode code stream obtaining module configured to obtain, from the image code stream, a quantized mode code stream value of the current decoded block
  • a quantization mode decoding module configured to obtain, according to the quantized mode code stream value, a quantization mode of the current decoded block.
  • An embodiment of the present invention provides a quantization mode codec system, including: a quantization mode encoder and a quantization mode decoder;
  • the quantization mode encoder includes:
  • a quantization mode coding module configured to obtain a quantized mode code stream value according to a quantization mode of the current coding block
  • An image code stream insertion module configured to write the quantized mode code stream value into the image code stream;
  • the quantization mode decoder includes:
  • a quantization mode code stream obtaining module configured to obtain, from the image code stream, a quantized mode code stream value of the current decoded block
  • a quantization mode decoding module configured to obtain, according to the quantized mode code stream value, a quantization mode of the current decoded block.
  • An embodiment of the present invention provides an image coding method, including:
  • the quantized current coded block data is encoded to obtain an image code stream, and the quantized mode code stream value is written into the image code stream.
  • An embodiment of the present invention provides an image decoding method, including:
  • a decoded image is obtained based on the dequantized current decoded block data.
  • An embodiment of the present invention provides an image encoder, including:
  • a quantization mode decision module configured to determine a quantization mode of a current coding block in the input image
  • a scaling or quantization processing module configured to perform scaling or quantization processing on the current coding block according to the quantization mode, to obtain quantized current coding block data
  • a quantization mode coding module configured to obtain a quantized mode code stream value according to a quantization mode of the current coding block
  • an image coding module configured to encode the quantized current coded block data to obtain an image code stream; and the image code stream insertion module is configured to write the quantized mode code stream value into the image code stream.
  • An embodiment of the present invention provides an image decoder, including:
  • a parsing module configured to parse the current decoded block data from the image code stream
  • a quantization mode code stream obtaining module configured to obtain, from the image code stream, a quantized mode code stream value of the current decoded block
  • a quantization mode decoding module configured to obtain, according to the quantized mode code stream value, a quantization mode of a current decoded block
  • An inverse scaling or inverse quantization module configured to perform inverse scaling or inverse quantization processing on the current decoded block data by using the quantization mode to obtain dequantized current decoded block data
  • a decoded image generating module configured to obtain a decoded image according to the dequantized current decoded block data.
  • An embodiment of the present invention provides an image coding and decoding system, including: an image encoder and an image decoder;
  • the image encoder includes:
  • a quantization mode decision module configured to determine a quantization mode of a current coding block in the input image
  • a scaling or quantization processing module configured to perform scaling or quantization processing on the current coding block according to the quantization mode, to obtain quantized current coding block data
  • a quantization mode coding module configured to obtain a quantized mode code stream value according to a quantization mode of the current coding block
  • a parsing module configured to parse the current decoded block data from the image code stream
  • a quantization mode code stream obtaining module configured to obtain, from the image code stream, a quantized mode code stream value of the current decoded block
  • a quantization mode decoding module configured to obtain, according to the quantized mode code stream value, a quantization mode of a current decoded block
  • An inverse scaling or inverse quantization module configured to perform inverse scaling or inverse quantization processing on the current decoded block data by using the quantization mode to obtain dequantized current decoded block data
  • a decoded image generating module configured to obtain a decoded image according to the dequantized current decoded block data.
  • the quantization mode and the corresponding image encoding and decoding method, the encoder and the decoder, and the codec system provided by the embodiments of the present invention do not need to be quantized at the decoder end by writing the determined current coding block quantization mode into the encoded data.
  • Mode decision the current block quantization mode can be obtained directly by decoding, which reduces the computational burden and implementation cost of the decoder.
  • FIG. 1 is a schematic diagram of a macroblock in the prior art
  • FIG. 2 is a schematic diagram of an image coding and decoding system in the prior art
  • 3 is a flowchart of a quantization mode encoding method according to an embodiment of the present invention
  • FIG. 4 is a flowchart of a quantization mode decoding method according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a quantization mode encoder according to an embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a quantization mode decoder according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a quantization mode codec system according to an embodiment of the present invention.
  • FIG. 8 is a flowchart of an image encoding method according to an embodiment of the present invention.
  • FIG. 9 is a flowchart of determining a current coding block quantization mode in an image coding method according to an embodiment of the present invention.
  • FIG. 10 is a flowchart of an image decoding method according to an embodiment of the present invention.
  • FIG. 11 is a schematic diagram of an image encoder according to an embodiment of the present invention.
  • FIG. 12 is a schematic diagram of an image decoder according to an embodiment of the present invention.
  • FIG. 13 is a schematic diagram of an image coding and decoding system according to an embodiment of the present invention. detailed description
  • the quantization mode, the image coding, the decoding method, the encoder, the decoder and the system provided by the embodiments of the present invention do not need to be quantized at the decoder end by encoding the quantization mode of the current coding block and writing into the image code stream.
  • Mode decision, the quantization mode of the current coding block can be obtained directly by decoding.
  • quantization mode quantization mode
  • M is a macroblock representing the position of the image at (i, j). For each macroblock M in P, it is now necessary to determine its corresponding quantization mode.
  • A, B, and C are three kinds of quantization modes, and the lower subscript indicates the position of the macroblock in the image P.
  • 4,. indicates that the quantization mode of the macroblock is A at the (i, j) position.
  • FIG. 3 it is a flowchart of a quantization mode coding method according to an embodiment of the present invention, which specifically includes the following steps:
  • Step 101 Obtain a quantized mode code stream value according to a quantization mode of the current coding block.
  • Step 102 Write the quantized mode code stream value into an image code stream.
  • obtaining the quantization mode code stream value may include: encoding the quantization mode result of the current coding block; or including: converting the quantization mode result of the current coding block by a function relationship Encode.
  • the above coding may be direct coding or entropy coding.
  • Direct coding refers to the result of transforming the quantization mode result of the current coding block or the quantization mode of the current coding block through a functional relationship as a quantization mode code stream value.
  • the quantization mode result of the current coding block is directly written into the coded code stream;
  • the quantization mode of the corresponding position in Mi is directly written into the corresponding macroblock code stream.
  • the corresponding quantization mode is 21 at M 21 , and therefore, the quantization mode B is written into the code stream of the macro block B 21 .
  • the quantization mode result of the current coding block is transformed according to a certain functional relationship and then encoded.
  • the corresponding quantization mode result of the image is divided into macroblocks.
  • is used as a quantization mode image for secondary transform coding.
  • each pixel value in the quantized mode image is a quantized mode value in the image frame.
  • the encoded object is written into the coded code stream according to a determined entropy coding method, including but not limited to index coding, fixed length coding, run length coding, variable length coding (VLC). , such as context-based variable length coding CAVLC, etc.), arithmetic coding (AC, such as Huffman coding, context-based arithmetic coding CABAC, etc.) or any combination of the above methods.
  • a determined entropy coding method including but not limited to index coding, fixed length coding, run length coding, variable length coding (VLC). , such as context-based variable length coding CAVLC, etc.), arithmetic coding (AC, such as Huffman coding, context-based arithmetic coding CABAC, etc.
  • the index encoding method is implemented as follows:
  • the above index value may also be represented by a binary variable length code of l-3bi t, and the binary variable length code has a correspondence relationship with the index value, thereby establishing a correspondence relationship with the quantization mode.
  • Table 2 a preset comparison table of the quantization mode, the index value and the binary variable length code, as shown in Table 2:
  • Index value binary variable length code quantization mode 00 1 A mode: default mode
  • the above three types of quantization modes are a specific example of the embodiment of the present invention.
  • the type of the quantization mode in the embodiment of the present invention is not limited to the above three types, and may be set to be more than three types in advance.
  • the type of quantization mode makes the type of quantization mode more abundant.
  • the quantized mode code stream value is obtained by using the determined coding method in step 101, and the quantized mode code stream value is the coded value of the quantization mode in the image code stream.
  • the index value of the quantization mode is the quantization mode code stream value in the image code stream. If the above Table 1 is used, the quantization mode code stream value corresponding to the quantization mode c is 11. If the quantization mode is expressed in the form of a binary variable length code, if the above Table 2 is used, the quantization mode code stream value corresponding to the quantization mode C is 011.
  • step 102 the quantized mode code stream value is written into the image code stream, and the existence position of the specific quantization mode in the image code stream may be:
  • block (i) represents a macroblock subblock included in the macroblock
  • mb_wq_mode is a quantization mode corresponding to the macroblock
  • U(2) is encoded by a binary integer, that is, a maximum of four types of quantization mode types are allowed to be changed. Form. This allows each macroblock to have a corresponding quantization mode.
  • mb_wq_mode is the quantization mode corresponding to the macroblock sub-block, and is encoded by the entropy coding method se(v). At this point, each sub-block of the macroblock is allowed to have a corresponding quantization mode.
  • the SEI message structure of the code stream is SEI_Message(), mb_wq_mode_id represents the quantized mode code stream value existing in the code stream, and mb_wq_mode (i) represents the quantization mode according to the macroblock in the code stream. Code stream value.
  • the quantization mode coding method encodes the quantization mode of the current coding block and writes it into the image code stream, so that the quantization mode decision algorithm does not need to be performed at the decoder end.
  • the quantization mode of the current coding block can be obtained directly by decoding, which reduces the computational burden and implementation cost of the decoder.
  • FIG. 4 it is a flowchart of a quantization mode decoding method according to an embodiment of the present invention, which specifically includes the following steps:
  • Step 201 Obtain a quantization mode code stream value of a current coding block from an image code stream.
  • Step 202 Obtain a quantization mode of the current decoded block according to the quantized mode code stream value.
  • the location of the specific quantization mode code stream value in the image code stream may be referred to the content described in the quantization mode coding method in the embodiment of the present invention. Therefore, in step 201, the current coded block is obtained from the image code stream.
  • the quantizing mode code stream value may include: obtaining a quantization mode code stream value of the current decoding block from the image macroblock code stream; and may further include: acquiring a quantization mode code stream of the current decoding block from the sub-block code stream included in the image macroblock
  • the value may also include: acquiring a quantization mode image of the current image from the image code stream and decoding, and determining a quantization mode code stream value of the current decoded block according to an arrangement position of the current decoded block in the image.
  • the method may further include: obtaining a quantization mode of the current image macroblock from the SE I message of the image code stream and decoding, and determining a quantization mode code stream value of the current decoded block.
  • the quantization mode decoding method of this embodiment can correspond to the quantization mode encoding method of the embodiment of the present invention.
  • the step 202 may include: using the quantization mode code stream value as the quantization mode of the current decoding block.
  • the step 202 may include: after inversely transforming the quantization mode code stream value through a function relationship The result is the quantization mode of the current decoded block.
  • the step 202 may include: entropy decoding the quantized mode code stream value, or performing entropy decoding and inverse function transformation on the quantized mode code stream value to obtain a current The quantization mode of the decoded block.
  • the entropy decoding method includes but is not limited to index, fixed length decoding, run length decoding, variable length decoding (VLC, such as context-based variable length decoding CAVLC, etc.), arithmetic decoding (AC, such as Huffman decoding, context-based arithmetic decoding CABAC, etc.) or any combination of the above.
  • VLC variable length decoding
  • AC arithmetic decoding
  • Huffman decoding context-based arithmetic decoding CABAC, etc.
  • the quantization mode decoding method provided by the embodiment of the present invention does not need to execute the quantization mode decision algorithm, and can directly obtain the quantization mode of the current coding block by decoding, which reduces the computational burden and implementation cost of the decoder.
  • a schematic diagram of a quantization mode encoder includes: a quantization mode coding module 11 configured to obtain a quantization mode code stream value according to a quantization mode of a current coding block; and an image code stream insertion module 12 And for writing the quantized mode code stream value into the image code stream.
  • the quantization mode encoding module 11 may include a first quantization mode encoding module, configured to use the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship as a quantization mode code stream value.
  • the quantization mode encoding module 11 may further include a second quantization mode encoding module for encoding the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship to obtain a quantization mode code stream value.
  • the second quantization mode coding module may further include a quantization mode entropy coding module, configured to entropy encode the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship to obtain a quantization mode code stream value.
  • a quantization mode entropy coding module configured to entropy encode the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship to obtain a quantization mode code stream value.
  • the image stream insertion module 12 may include: an image macroblock stream insertion module, configured to write the quantized mode stream value to the currently encoded macroblock stream in the image; or, the image macroblock subblock stream insertion module And for writing the quantized mode code stream value into the sub-block code stream included in the currently coded macroblock in the image; or, the image code stream SEI message insertion module, configured to write the quantized mode code stream value to the image code stream
  • the SEI message is in the code stream.
  • the image stream insertion module 12 may further include: a quantization mode image encoding unit, configured to combine the quantized mode code stream values into a quantized mode image according to an arrangement position of the current coding block in the image, and encode the insertion unit, The encoded quantized mode image is written into the image code stream.
  • a quantization mode image encoding unit configured to combine the quantized mode code stream values into a quantized mode image according to an arrangement position of the current coding block in the image, and encode the insertion unit, The encoded quantized mode image is written into the image code stream.
  • the quantization mode encoder provided by the embodiment of the present invention compiles the quantization mode of the current coding block
  • the code is written into the image code stream so that the quantization mode decision algorithm does not need to be performed at the decoder end, and the quantization mode of the current coding block can be obtained directly by decoding, which reduces the computational burden and implementation cost of the decoder.
  • a schematic diagram of a quantization mode decoder includes: a quantization mode code stream obtaining module 21, configured to obtain a quantization mode code stream value of a current decoding block from an image code stream;
  • the module 22 is configured to obtain, according to the quantized mode code stream value, a quantization mode of the current decoded block.
  • the quantization mode code stream obtaining module 21 may include: a quantization mode macroblock code stream acquiring module, configured to obtain a quantization mode code stream value of the current decoding block from the image macroblock code stream; or, a quantization mode macroblock subblock stream And an obtaining module, configured to obtain, from the sub-block code stream included in the image macroblock, a quantization mode code stream value of the current decoded block; or, a quantization mode SEI message code stream obtaining module, configured to obtain a current from the SEI message code stream of the image The quantized mode code stream value of the image decoding block.
  • the quantization mode code stream obtaining module 21 may further include: a quantization mode image decoding unit, configured to acquire and decode a quantization mode image of the current image from the image code stream; and a determining unit configured to arrange the position of the current decoded block in the image A quantized mode stream value of the current decoded block is determined.
  • the quantization mode decoding module 22 may include a first quantization mode decoding module, configured to use the result of inverse transforming the quantization mode code stream value or the quantization mode code stream value as a quantization mode of the current decoding block.
  • the quantization mode decoding module 22 includes a second quantization mode decoding module for decoding the quantized mode code stream value or decoding the quantized mode code stream value and inversely transforming the function relationship to obtain a quantization mode of the current decoded block.
  • the second quantization mode decoding module may further include a quantization mode entropy decoding module, configured to perform entropy decoding on the quantized mode code stream value or perform entropy decoding and inverse function transformation on the quantized mode code stream value to obtain a current decoded block. Quantization mode.
  • the quantization mode decoder provided by the embodiment of the present invention does not need to perform a quantization mode decision algorithm, and can obtain the quantization mode of the current coding block directly by decoding, thereby reducing the computational burden of the decoder and Achieve costs.
  • FIG. 7 it is a schematic diagram of a quantization mode codec system according to an embodiment of the present invention, which includes a quantization mode coder 31 and a quantization mode decoder 32.
  • the quantization mode encoder 31 includes: a quantization mode encoding module 1 1 configured to obtain a quantization mode code stream value according to a quantization mode of the current coding block; and an image code stream insertion module 12, configured to write the quantization mode code stream value to In the image stream.
  • the quantization mode decoder 32 includes: a quantization mode code stream acquisition module 21, configured to obtain a quantization mode code stream value of the current decoding block from the image code stream; a quantization mode decoding module 22, configured to use the quantization mode code stream value, The quantization mode of the current decoded block is obtained.
  • the quantization mode codec system of the embodiment of the present invention may further include any of the quantization mode decoders described in the quantization mode encoder of the embodiment of the present invention and any of the quantization mode decoders described in the quantization mode decoder of the embodiment of the present invention. Device.
  • the quantization mode codec system encodes the quantization mode of the current coding block and writes it into the image code stream, so that the quantization mode decision algorithm does not need to be performed at the decoder end, and the current can be obtained through decoding.
  • the quantization mode of the coding block reduces the computational burden and implementation cost of the decoder.
  • a flowchart of an image coding method according to an embodiment of the present invention specifically includes the following steps:
  • Step 301 Determine a quantization mode of a current coding block in the input image.
  • Step 302 Perform scaling or quantization processing on the current coding block according to the quantization mode, to obtain quantized current coding block data.
  • Step 303 Obtain a quantized mode code stream value according to a quantization mode of the current coding block.
  • the method may include: determining a quantization mode of the current block according to the neighboring block coding information of the current coding block; and may further include: determining a quantization mode of the current block according to the quantization mode decision method of the external extended input;
  • the method may further include: obtaining a quantization mode of the current block according to a quantization mode of the current coding block input by the external extension;
  • the quantization mode of the current coding block may be used to determine the quantization mode of the current coding block according to the above three different methods or combinations of methods.
  • an example is given to determine how to determine the quantization mode of the current block when there are two or more methods.
  • the effects on the final quantization mode result are sequentially in order of priority, the externally input quantization mode, the externally input quantization mode decision method, the quantization mode, and the neighboring block coding information.
  • the quantitative model of decision making is a quantitative model of decision making.
  • the quantization mode decision method based on the current coding block neighboring coding information is used as the quantization mode decision method used by the current coding by default; otherwise, if there is an external input quantization mode decision method, the use is performed.
  • An externally input quantization mode decision method is used as a quantization mode decision method for current coding;
  • the quantization mode determined by the quantization mode decision method used in the current encoding is used as the quantization mode of the current block by default; otherwise, if there is an externally input quantization mode, the externally input quantization mode is directly used as the quantization mode.
  • the quantization mode of the current block is used as the quantization mode of the current block by default; otherwise, if there is an externally input quantization mode, the externally input quantization mode is directly used as the quantization mode.
  • a flowchart for determining a current coding block quantization mode in an image coding method includes:
  • Step 401 First, it is determined whether there is an external input quantization mode, and if yes, step 407 is performed, that is, for the current coding block, the quantization mode directly uses the externally input quantization mode; otherwise, step 402 is performed;
  • Step 402 When there is no externally input quantization mode, the quantization mode decision method needs to be used to determine the quantization mode of the current coding block. In this case, the neighbor block coding information of the current block needs to be obtained. To quantify the input of decision making methods;
  • Step 403 Determine whether there is an externally input quantization mode decision method, and if yes, execute step 405, that is, the current quantization mode decision method, using an externally input quantization mode decision method; otherwise, execute step 404, that is, there is no external input quantization mode When making a decision method, use the current default quantization mode decision method;
  • Step 404 When there is no externally input quantization mode decision method, the current default quantization mode decision method is used; the current default quantization mode decision method is to determine the quantization mode of the current coding block according to the coding information of the neighboring block, and the decision method is implemented. Defining a fixed decision rule, that is, performing step 406;
  • Step 405 Determine and update a current quantization mode decision method.
  • an externally input quantization mode decision method use an externally input quantization mode decision method to update a default quantization mode decision method as a quantization mode decision method used by the current coding;
  • Step 406 Determine the current quantization mode decision method according to the current quantization mode decision method determined in step 404 or step 405, and determine the quantization mode of the current coding block according to the neighbor block coding information of the current coding block.
  • Step 407 Output the current coding block The quantization mode is used for the scaling/quantization operation of the current coding block.
  • the user can customize the quantization mode decision method and the quantization mode decision result through the external input quantization mode and/or the quantization mode decision method, thereby flexibly changing the quantization decision process and enriching the decision result.
  • obtaining the quantized mode stream value according to the quantization mode of the current coding block may include: encoding the quantization mode result of the current coding block; and may further include: The result of the quantization mode is encoded after the function relationship transformation.
  • the above coding may be direct coding or entropy coding.
  • Direct coding refers to the result of transforming the quantization mode result of the current coding block or the quantization mode of the current coding block through a functional relationship as a quantization mode code stream value.
  • the quantization mode of the corresponding position is directly written into the corresponding macroblock code stream.
  • the quantization mode B is written to the code stream of the macroblock Affi 21 as the corresponding quantization mode at ⁇ 21 .
  • the quantization mode result of the current coding block is transformed according to a certain functional relationship and then encoded.
  • the corresponding quantization mode result of the image is divided into macroblocks.
  • is used as a quantization mode image for secondary transform coding.
  • each pixel value in the quantized mode image is a quantized mode value in the image frame.
  • the encoded object is written into the coded code stream according to a determined entropy coding method, including but not limited to index coding, fixed length coding, run length coding, variable length coding (VLC). , such as context-based variable length coding CAVLC, etc.), arithmetic coding (AC, such as Huffman coding, context-based arithmetic coding CABAC, etc.) or any combination of the above methods.
  • a determined entropy coding method including but not limited to index coding, fixed length coding, run length coding, variable length coding (VLC). , such as context-based variable length coding CAVLC, etc.), arithmetic coding (AC, such as Huffman coding, context-based arithmetic coding CABAC, etc.
  • the index coding method may employ an embodiment of the index coding method described in the quantization mode coding method of the embodiment of the present invention.
  • the quantized mode code stream value is written into the image code stream, and the existence position of the specific quantization mode code stream value in the image code stream may be: (1) writing the quantized mode code stream value to the macroblock level of the image. (2) writing the quantized mode code stream value to the macroblock sub-block code stream of the image; (3) combining the quantized mode code stream values into a quantized mode image according to the arrangement position of the current coding block in the image; And encode, write to the image stream. (4) Write the code stream value of the quantization mode into the SEI message code stream of the image code stream.
  • the image coding method provided by the embodiment of the present invention encodes the quantization mode of the current coding block and writes it into the image code stream, so that the quantization mode decision algorithm is not required to be performed at the decoder end, and the current coding block can be obtained directly by decoding.
  • the quantization mode reduces the computational burden and implementation cost of the decoder; further, the user can customize the change quantization mode decision method and the quantization mode decision result, Thereby, it is possible to flexibly change the quantitative decision process and enrich the decision result.
  • FIG. 10 it is a flowchart of an image decoding method according to an embodiment of the present invention, which specifically includes the following steps:
  • Step 501 Parsing the current decoded block data and the corresponding quantization mode code stream value from the image code stream;
  • Step 502 Obtain a quantization mode of the current decoded block according to the quantized mode code stream value.
  • Step 503 Perform inverse scaling or inverse quantization processing on the current decoded block data by using the quantization mode to obtain dequantized current decoded block data. ;
  • Step 504 Obtain a decoded image according to the dequantized current decoded block data.
  • the location of the specific quantization mode code stream value in the image code stream may refer to the content described in the image coding method of the embodiment of the present invention. Therefore, the current decoded block data is parsed from the image code stream in step 501.
  • the corresponding quantized mode code stream value may include: parsing the current decoded block data corresponding to the quantized mode code stream value from the image macroblock code stream; and may further include: parsing the current decoded block from the sub-block code stream included in the image macroblock
  • the data corresponds to the quantized mode code stream value; and may further include: parsing and decoding the quantized mode image of the current image from the image code stream, and determining the quantized mode code stream value of the current decoded block data according to the arrangement position of the current decoded block in the image.
  • the method may further include: parsing a quantization mode of the current image macroblock from the SEI message of the image code stream, and determining a quantization mode code stream value of the current decoded block.
  • the image decoding method of this embodiment can correspond to the image decoding method of the embodiment of the present invention.
  • the step 502 may include: using the quantization mode code stream value as the quantization mode of the current decoding block.
  • the step 502 may include: after inversely transforming the quantization mode code stream value through a function relationship The result is the quantization mode of the current decoded block.
  • the step 502 may include: using the quantization mode The code stream value is entropy decoded, or the quantization mode code stream value is entropy decoded and the function relationship is inversely transformed to obtain a quantization mode of the current decoded block.
  • the entropy decoding method includes but is not limited to index, fixed length decoding, run length decoding, variable length decoding
  • VLC such as context-based variable length decoding CAVLC, etc.
  • AC arithmetic decoding
  • CABAC context-based arithmetic decoding
  • the image decoding method provided by the embodiment of the present invention does not need to perform the quantization mode decision algorithm, and the quantization mode of the current coding block can be obtained directly by decoding, which reduces the computational burden and the implementation cost of the decoder.
  • a schematic diagram of an image encoder includes: a quantization mode decision module 41, configured to determine a quantization mode of a current coding block in an input image; and a scaling or quantization processing module 42 configured to The quantization mode performs scaling or quantization processing on the current coding block to obtain the quantized current coding block data.
  • the quantization mode coding module 43 is configured to obtain a quantization mode code stream value according to the quantization mode of the current coding block.
  • the image coding module 44 And for encoding the quantized current coded block data to obtain an image code stream; and the image code stream insertion module 45 is configured to write the quantized mode code stream value into the image code stream.
  • the quantization mode decision module 41 may include a neighboring block decision module, configured to determine a quantization mode of the current coded block according to neighbor block coding information of the current coded block.
  • the quantization mode decision module 41 may also include an external decision module for determining the quantization mode of the current coded block based on the externally input quantization mode decision method or quantization mode.
  • the quantization mode decision module 41 may further include: a neighboring block decision module, configured to determine a first level quantization mode of the current coding block according to the neighboring block coding information of the current coding block; and an external decision module for performing quantization according to the external input a mode decision method or a quantization mode, determining a second-level quantization mode or a third-level quantization mode of the current coding block; an integrated decision module, configured to use the first-level quantization mode, the second-level quantization mode, and the third-level according to the current coding block The quantization mode determines the quantization mode of the current coded block.
  • a neighboring block decision module configured to determine a first level quantization mode of the current coding block according to the neighboring block coding information of the current coding block
  • an external decision module for performing quantization according to the external input a mode decision method or a quantization mode, determining a second-level quantization mode or a third-level quantization mode of the current coding block
  • an integrated decision module
  • the priority of the quantization mode decision module 41 is: according to the external input quantization mode
  • the third-level quantization mode determined by the partial decision module has the highest priority
  • the second-level quantization mode priority determined by the external decision module of the externally input quantization mode decision method the first determined by the neighboring block decision module
  • the primary quantization mode has the lowest priority
  • when determining the quantization mode of the current coding block the quantization mode determined by the higher priority quantization mode decision module replaces the quantization mode determined by the lower priority quantization mode decision module.
  • the quantization mode encoding module 43 may include a first quantization mode encoding module, configured to use the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship as a quantization mode code stream value.
  • the quantization mode encoding module 43 may further include a second quantization mode encoding module for encoding the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship to obtain a quantization mode code stream value.
  • the second quantization mode coding module may further include a quantization mode entropy coding module, configured to entropy encode the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship to obtain a quantization mode code stream value.
  • a quantization mode entropy coding module configured to entropy encode the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship to obtain a quantization mode code stream value.
  • the image stream insertion module 45 may include an image macroblock or a sub-block stream insertion module, configured to write the quantized mode stream value to the currently encoded macroblock stream in the image or the subblock included in the currently encoded macroblock. In the code stream.
  • the image stream insertion module 45 may further include: a quantization mode image encoding unit, configured to combine the quantized mode code stream values into a quantized mode image according to an arrangement position of the current coding block in the image, and encode the insertion unit, The encoded quantized mode image is written into the image code stream.
  • a quantization mode image encoding unit configured to combine the quantized mode code stream values into a quantized mode image according to an arrangement position of the current coding block in the image, and encode the insertion unit, The encoded quantized mode image is written into the image code stream.
  • the image code stream insertion module 45 may further include: a quantization mode SEI message code stream insertion module, configured to write the code stream value of the quantization mode into the SEI message code stream of the image.
  • the image encoder provided by the embodiment of the present invention encodes the quantization mode of the current coding block and writes it into the image code stream, so that the quantization mode decision algorithm is not required to be performed at the decoder end, and the current coding block can be obtained directly by decoding.
  • the quantization mode reduces the computational burden and implementation cost of the decoder; further, the user can customize the quantization mode decision method through an external decision module and Quantitative mode decision results, which can flexibly change the quantitative decision process and enrich the decision results. As shown in FIG.
  • FIG. 12 it is a schematic diagram of an image decoder according to an embodiment of the present invention, which specifically includes: a parsing module 51, configured to parse a current decoded block data from an image code stream; and a quantization mode code stream acquiring module 52, configured to Obtaining a quantized mode code stream value of the current decoded block in the code stream; a quantization mode decoding module 53, configured to obtain a quantization mode of the current decoded block according to the quantized mode code stream value; and an inverse scaling or inverse quantization module 54 for Performing inverse scaling or inverse quantization processing on the current decoded block data to obtain the dequantized current decoded block data; the decoded image generating module 55 is configured to obtain decoding according to the dequantized current decoded block data. image.
  • a parsing module 51 configured to parse a current decoded block data from an image code stream
  • a quantization mode code stream acquiring module 52 configured to Obtaining a quantized mode code
  • the quantization mode code stream acquisition module 52 may include: a quantization mode macroblock code stream acquisition module, configured to obtain a quantization mode code stream value of the current decoding block from the image macroblock code stream; or a quantization mode macroblock sub-block code stream acquisition. And a module, configured to obtain, from a sub-block code stream included in the image macroblock, a quantized mode code stream value of the current decoded block.
  • the quantization mode code stream obtaining module 52 may further include: a quantization mode image decoding unit, configured to acquire and decode a quantization mode image of the current image from the image code stream; and a determining unit, configured to arrange the position of the current decoded block in the image A quantized mode stream value of the current decoded block is determined.
  • the quantized mode code stream obtaining module 52 may further include an image SE I message code stream obtaining module of the quantization mode, configured to obtain a quantized mode code stream value of the current image decoding block from the SEI message code stream of the image.
  • the quantization mode decoding module 53 may include a first quantization mode decoding module, configured to use the result of inverse transforming the quantization mode code stream value or the quantization mode code stream value as a quantization mode of the current decoding block.
  • the quantization mode decoding module 53 includes a second quantization mode decoding module for decoding the quantized mode code stream value or decoding the quantized mode code stream value and inversely transforming the function relationship to obtain a quantization mode of the current decoded block.
  • the quantization mode decoding module 53 may further include a quantization mode entropy decoding module, configured to perform entropy decoding on the quantized mode code stream value or perform entropy decoding and inverse function relationship on the quantized mode code stream value. After that, the quantization mode of the current decoded block is obtained.
  • a quantization mode entropy decoding module configured to perform entropy decoding on the quantized mode code stream value or perform entropy decoding and inverse function relationship on the quantized mode code stream value. After that, the quantization mode of the current decoded block is obtained.
  • the image decoder provided by the embodiment of the present invention does not need to perform a quantization mode decision algorithm, and can obtain the quantization mode of the current coding block directly by decoding, which reduces the computational burden and implementation cost of the decoder.
  • a schematic diagram of an image coding and decoding system includes: an image encoder 61 and an image decoder 62.
  • the image encoder 61 includes: a quantization mode decision module 41, configured to determine a quantization mode of a current coding block in the input image; a scaling or quantization processing module 42, configured to perform scaling or quantization processing on the current coding block according to the quantization mode, to obtain
  • the quantized mode encoding module 43 is configured to obtain the quantized mode code stream value according to the quantization mode of the current coding block
  • the image encoding module 44 is configured to encode the quantized current coding block data to obtain the image code.
  • an image stream insertion module 45 configured to write the quantized mode code stream value into the image code stream.
  • the image decoder 62 includes: a parsing module 51, configured to parse the current decoded block data from the image code stream; and a quantization mode code stream obtaining module 52, configured to obtain a quantized mode stream value of the current decoded block from the image code stream;
  • the quantization mode decoding module 53 is configured to obtain a quantization mode of the current decoding block according to the quantization mode code stream value, and use an inverse scaling or inverse quantization module 54 to inverse scale the current decoded block data by using the quantization mode or
  • the dequantization process is performed to obtain the dequantized current decoded block data.
  • the decoded image generating module 55 is configured to obtain the decoded image according to the dequantized current decoded block data.
  • the image coding and decoding system of the embodiment of the present invention may further include any of the image encoders described in the image encoder of the embodiment of the present invention and any of the image decoders described above in the image decoder of the embodiment of the present invention.
  • the image coding and decoding system encodes the quantization mode of the current coding block and writes it into the image code stream, so that the quantization mode decision algorithm is not required to be performed at the decoder end, and the current coding can be obtained directly by decoding.
  • the quantization mode of the block reduces the computational burden and implementation cost of the decoder; further, the user can customize the quantization mode decision method and the quantization mode decision As a result, it is possible to flexibly change the quantitative decision process and enrich the decision result.
  • the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.

Landscapes

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

Abstract

A quantization mode and the corresponding image encoding and decoding method, an encoder and a decoder and a CODEC system. The encoding method of the quantization mode includes: acquiring the code stream value based on the quantization mode of current encoding block; writing the code stream value of the quantization mode into the image code stream. The image encoding method includes: determining the quantization mode of current coding block in the input image; acquiring the quantized current coding block data based on process of scaling or quantizing the current encoding block; acquiring the code stream value of the quantization mode based on quantization mode of the current encoding block; encoding the quantized current coding block data to acquire the image code stream, and writing the code stream value of the quantization mode in the image stream. By writing the determined quantization mode of the current coding block in the encoded data without decision-making of the quantization mode in the decoder terminal, acquiring quantization mode of the current block through decoding directly, the said method reduces the computational burden and the realization cost of the decoder.

Description

量化模式及图像的编码和解码方法、 编码器和解码器及编解码系统 本申请要求了 2007年 12月 4日提交的、 申请号为 CN 20071 0193851. 2、 发明名称为 "量化模式、 图像编码、 解码方法、 编码器、 解码器及系统" 的 中国申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域  Quantization mode and image encoding and decoding method, encoder and decoder, and codec system. The present application claims to be filed on December 4, 2007, the application number is CN 20071 0193851. 2. The invention name is "quantization mode, image coding" The priority of the Chinese application, the decoding method, the coder, the decoder and the system, the entire contents of which are incorporated herein by reference. Technical field
本发明实施例涉及编解码技术, 尤其涉及一种量化模式及相应的图像编 码和解码方法、 编码器和解码器及编解码系统。  Embodiments of the present invention relate to codec techniques, and in particular, to a quantization mode and a corresponding image encoding and decoding method, an encoder and a decoder, and a codec system.
背景技术 Background technique
在图像编解码技术中, 通常需要将图像分成编码块后再进行编码处理。 对于分为编码块的图像经过正交变换处理将得到相应的块变换系数, 所述的 块变换系数再经过量化取整计算, 以及熵编码便可以最后得到该图像对应的 压缩编码后的码流, 从而实现了针对图像的编码操作。  In image coding and decoding technology, it is usually necessary to divide an image into coded blocks and then perform encoding processing. The orthogonal transform processing is performed on the image divided into coded blocks, and the corresponding block transform coefficients are obtained, and the block transform coefficients are further subjected to quantization rounding calculation, and the entropy coding can finally obtain the compression-coded code stream corresponding to the image. Thus, an encoding operation for an image is achieved.
由于在一个序列中的图像内容并不是完全相同, 而是会有较大的变化, 即在同一个图像序列中图像的细节各不相同, 因此, 如果对于整个序列均釆 用同一个量化矩阵实现量化处理, 显然无法达到最佳的量化编码后的图像主 观质量。 同样, 对于一个序列中的某一幅图像, 图像的各个区域的内容也各 不相同, 对同一幅图像的各个区域或宏块釆用相同的量化质量, 也不能达到 最佳的量化编码后的图像主观质量。  Since the image content in a sequence is not exactly the same, there will be a big change, that is, the details of the image in the same image sequence are different, so if the same sequence is used for the entire sequence, the same quantization matrix is used. Quantization processing obviously does not achieve the subjective quality of the image after optimal quantization coding. Similarly, for a certain image in a sequence, the content of each region of the image is also different, and the same quantization quality is used for each region or macroblock of the same image, and the optimal quantization and coding cannot be achieved. Subjective quality of the image.
宏块级自适应量化技术就是提供一种宏块量化编解码方法,使图像编 解码过程中, 宏块量化质量可以根据每个宏块图像内容不同而改变。 现有 技术中提供了一种宏块级自适应量化编解码技术, 在编解码过程中利用邻近 块已编码信息预测当前块特征的技术, 从而在量化中根据预测的宏块特征选 择不同的宏块量化质量。 邻近块编码信息包括邻近块的分块模式信息、 预测 信息、 运动矢量信息等, 这些信息可以反映当前块的图像特征。 如图 1所示, 为现有技术中宏块的示意图, 其中当前块为 E , E的邻近块为 A、 B、 C和 D , 块 E和块 A、 B、 C、 D的块尺寸可以相同, 也可以不同。 当前块 E垂直方向的 邻近块为 A与 D , 水平方向的邻近块为 B与!)或者 C与 D。 E的相邻边界块称 为 E的直接邻近块, E的相邻边界块的邻近块称为 E的间接邻近块。 The macroblock-level adaptive quantization technique is to provide a macroblock quantization codec method, and in the image coding and decoding process, the macroblock quantization quality can be changed according to the content of each macroblock image. In the prior art, a macroblock-level adaptive quantization codec technology is provided, in which a technique of predicting a current block feature by using neighboring block coded information is used, so that different macros are selected according to the predicted macroblock feature in quantization. Block quantization quality. The neighboring block coding information includes block mode information of the neighboring block, prediction Information, motion vector information, etc., which can reflect the image characteristics of the current block. As shown in FIG. 1 , which is a schematic diagram of a macroblock in the prior art, where the current block is E, the adjacent blocks of E are A, B, C, and D, and the block sizes of block E and blocks A, B, C, and D can be The same, can also be different. The adjacent blocks in the vertical direction of block E are A and D, and the adjacent blocks in the horizontal direction are B and! ) or C and D. The adjacent boundary block of E is called a direct neighboring block of E, and the adjacent block of the adjacent boundary block of E is called an indirect neighboring block of E.
如图 2所示, 为现有技术中图像编解码系统的示意图, 其中编码器 1包 括变换模块 2、缩放或量化模块 3、第一量化模式决策模块 4和熵编码模块 5, 解码器 6包括熵解码模块 7、逆缩放或反量化模块 8、 第二量化模式决策模块 9和逆变换模块 1 0 , 其中第一量化模式决策模块 4利用编码过程中邻近块的 分块模式信息、 宏块大小及预测信息等参数信息, 在对当前块进行量化前, 根据判断当前块是否为细节区域的结果来决策当前块的量化模式。  2 is a schematic diagram of a prior art image codec system, where the encoder 1 includes a transform module 2, a scaling or quantization module 3, a first quantization mode decision module 4, and an entropy encoding module 5. The decoder 6 includes An entropy decoding module 7, an inverse scaling or inverse quantization module 8, a second quantization mode decision module 9 and an inverse transform module 10, wherein the first quantization mode decision module 4 utilizes block mode information and macroblock size of neighboring blocks in the encoding process And parameter information such as prediction information, before quantifying the current block, determining a quantization mode of the current block according to a result of determining whether the current block is a detail region.
上述宏块级自适应量化编解码方法将量化模式划分为以下几类: 量化模式 A , 为默认的量化模式, 在编码时釆用的量化矩阵与当前默认 的量化矩阵相同;  The above macroblock-level adaptive quantization codec method divides the quantization mode into the following categories: Quantization mode A, which is the default quantization mode, and the quantization matrix used in coding is the same as the current default quantization matrix;
量化模式 B , 为保留细节的量化模式, 在编码时釆用的量化矩阵使得量 化后的图像保留图像细节;  Quantization mode B, in order to preserve the detail quantization mode, the quantization matrix used in encoding allows the quantized image to retain image details;
量化模式 C , 为非细节量化模式, 量化后的图像无需保留图像细节。 根据人的视觉特性, 所述的决策当前块的量化模式一般需要遵循以下几 种准则:  The quantization mode C is a non-detail quantization mode, and the quantized image does not need to retain image details. According to the visual characteristics of a person, the quantization mode of the decision current block generally needs to follow the following criteria:
( 1 )当前块为图像的细节区域, 则釆用的量化模式应保留较多的高频信 息, 即釆用高质量的量化模式;  (1) If the current block is the detail area of the image, the quantization mode used should retain more high-frequency information, that is, use a high-quality quantization mode;
( 2 )当前块为图像的运动边缘部分, 则釆用的量化模式应保留较多的高 频信息, 即釆用高质量的量化模式;  (2) If the current block is the motion edge part of the image, the quantization mode used should retain more high-frequency information, that is, use a high-quality quantization mode;
( 3 )当前块为运动比较剧烈的区域,客观质量的适当下降不会对主观质 量产生 4艮大的影响, 则可以釆用较粗糙的量化模式, 即釆用低质量的量化模 式。 所述的量化模式决策实际是满足以上决策准则的一组判决规则, 根据不 同的帧类型、 不同的邻近块编码信息来判决当前的块釆用的量化质量, 判决 结果即是当前块的量化模式。 (3) The current block is a region with relatively strong motion. If the appropriate decline in objective quality does not have a large impact on subjective quality, a coarser quantization mode can be used, that is, a low-quality quantization mode is used. The quantization mode decision is actually a set of decision rules satisfying the above decision criteria, and the current block quantization quality is determined according to different frame types and different neighbor block coding information, and the decision result is the current block quantization mode. .
具体的说, 在编码过程中, 第一量化模式决策模块 4利用邻近块的分块 模式信息、 宏块大小及预测信息等参数信息, 通过预先设定的准则, 决策当 前块的量化模式。 在解码过程中, 第二量化模式决策模块 9利用邻近块的分 块模式信息、 宏块大小及预测信息等参数信息, 通过预先设定的准则, 决策 当前块的量化模式。 所述设定的准则为根据邻近块的参数信息情况设定对应 的量化模式。  Specifically, in the encoding process, the first quantization mode decision module 4 uses the parameter information such as the block mode information, the macroblock size, and the prediction information of the neighboring block to determine the quantization mode of the current block through a preset criterion. In the decoding process, the second quantization mode decision module 9 uses the parameter information such as the block mode information, the macroblock size, and the prediction information of the neighboring block to determine the quantization mode of the current block through a preset criterion. The set criterion is to set a corresponding quantization mode according to the parameter information of the neighboring block.
上述现有技术至少存在以下问题:  The above prior art has at least the following problems:
( 1 )编码器 1和解码器 6中均包括量化模式决策模块, 即编码和解码方 法中均需要执行量化模式决策算法, 增加了解码器的计算负担和实现成本; (1) Both the encoder 1 and the decoder 6 include a quantization mode decision module, that is, both the encoding and decoding methods need to perform a quantization mode decision algorithm, which increases the computational burden and implementation cost of the decoder;
( 2 )固定的量化模式的决策算法决定了量化模式的结果,使得该量化决 策方法不够灵活。 发明内容 (2) The fixed quantization mode decision algorithm determines the result of the quantization mode, making the quantitative decision method inflexible. Summary of the invention
本发明实施例提出了一种量化模式及相应的图像编码和解码方法、 编码 器和解码器及编解码系统, 使得解码端可根据解码码流获取量化模式, 降低 了在解码端进行量化模式决策的运算复杂度。  The embodiment of the invention provides a quantization mode and a corresponding image encoding and decoding method, an encoder and a decoder, and a codec system, so that the decoding end can obtain the quantization mode according to the decoded code stream, and reduce the quantization mode decision at the decoding end. The computational complexity.
本发明实施例提供了一种量化模式编码方法, 包括:  The embodiment of the invention provides a quantization mode coding method, including:
根据当前编码块的量化模式, 得到量化模式码流值;  Obtaining a quantized mode code stream value according to a quantization mode of the current coding block;
将所述量化模式码流值写到图像码流中。  The quantized mode code stream value is written into the image code stream.
本发明实施例提供了一种量化模式解码方法, 包括:  The embodiment of the invention provides a quantization mode decoding method, including:
从图像码流中获取当前解码块的量化模式码流值;  Obtaining a quantization mode code stream value of the current decoded block from the image code stream;
根据所述量化模式码流值, 得到当前解码块的量化模式。  A quantization mode of the current decoded block is obtained according to the quantized mode code stream value.
本发明实施例提供了一种量化模式编码器, 包括: 量化模式编码模块, 用于根据当前编码块的量化模式, 得到量化模式码 流值; An embodiment of the present invention provides a quantization mode encoder, including: a quantization mode coding module, configured to obtain a quantization mode code stream value according to a quantization mode of the current coding block;
图像码流插入模块, 用于将所述量化模式码流值写到图像码流中。  And an image stream insertion module, configured to write the quantized mode code stream value into the image code stream.
本发明实施例提供了一种量化模式解码器, 包括:  An embodiment of the present invention provides a quantization mode decoder, including:
量化模式码流获取模块, 用于从图像码流中获取当前解码块的量化模式 码流值;  a quantization mode code stream obtaining module, configured to obtain, from the image code stream, a quantized mode code stream value of the current decoded block;
量化模式解码模块, 用于根据所述量化模式码流值, 得到当前解码块的 量化模式。  And a quantization mode decoding module, configured to obtain, according to the quantized mode code stream value, a quantization mode of the current decoded block.
本发明实施例提供了一种量化模式编解码系统, 包括: 量化模式编码器 和量化模式解码器;  An embodiment of the present invention provides a quantization mode codec system, including: a quantization mode encoder and a quantization mode decoder;
量化模式编码器包括:  The quantization mode encoder includes:
量化模式编码模块, 用于根据当前编码块的量化模式, 得到量化模式码 流值;  a quantization mode coding module, configured to obtain a quantized mode code stream value according to a quantization mode of the current coding block;
图像码流插入模块, 用于将所述量化模式码流值写到图像码流中; 量化模式解码器包括:  An image code stream insertion module, configured to write the quantized mode code stream value into the image code stream; the quantization mode decoder includes:
量化模式码流获取模块, 用于从图像码流中获取当前解码块的量化模式 码流值;  a quantization mode code stream obtaining module, configured to obtain, from the image code stream, a quantized mode code stream value of the current decoded block;
量化模式解码模块, 用于根据所述量化模式码流值, 得到当前解码块的 量化模式。  And a quantization mode decoding module, configured to obtain, according to the quantized mode code stream value, a quantization mode of the current decoded block.
本发明实施例提供了一种图像编码方法, 包括:  An embodiment of the present invention provides an image coding method, including:
确定输入图像中当前编码块的量化模式;  Determining a quantization mode of a current coded block in the input image;
根据所述量化模式对当前编码块进行缩放或量化处理, 得到量化后的当 前编码块数据;  Performing scaling or quantization processing on the current coding block according to the quantization mode, to obtain quantized current coding block data;
根据当前编码块的量化模式, 得到量化模式码流值;  Obtaining a quantized mode code stream value according to a quantization mode of the current coding block;
将量化后的当前编码块数据编码得到图像码流, 并将所述量化模式码流 值写到所述图像码流中。 本发明实施例提供了一种图像解码方法, 包括: The quantized current coded block data is encoded to obtain an image code stream, and the quantized mode code stream value is written into the image code stream. An embodiment of the present invention provides an image decoding method, including:
从图像码流中解析得到当前解码块数据及其对应量化模式码流值; 根据所述量化模式码流值, 得到当前解码块的量化模式;  And parsing the current decoded block data and the corresponding quantized mode code stream value from the image code stream; and obtaining a quantization mode of the current decoded block according to the quantized mode code stream value;
用所述量化模式对当前解码块数据进行逆缩放或反量化处理, 得到解量 化后的当前解码块数据;  Performing inverse scaling or inverse quantization processing on the current decoded block data by using the quantization mode to obtain the dequantized current decoded block data;
根据所述解量化后的当前解码块数据, 获得解码图像。  A decoded image is obtained based on the dequantized current decoded block data.
本发明实施例提供了一种图像编码器, 包括:  An embodiment of the present invention provides an image encoder, including:
量化模式决策模块, 用于确定输入图像中当前编码块的量化模式; 缩放或量化处理模块, 用于根据所述量化模式对当前编码块进行缩放或 量化处理, 得到量化后的当前编码块数据;  a quantization mode decision module, configured to determine a quantization mode of a current coding block in the input image; a scaling or quantization processing module, configured to perform scaling or quantization processing on the current coding block according to the quantization mode, to obtain quantized current coding block data;
量化模式编码模块, 用于根据当前编码块的量化模式, 得到量化模式码 流值;  a quantization mode coding module, configured to obtain a quantized mode code stream value according to a quantization mode of the current coding block;
图像编码模块, 用于将量化后的当前编码块数据编码得到图像码流; 图像码流插入模块, 用于将所述量化模式码流值写到所述图像码流中。 本发明实施例提供了一种图像解码器, 包括:  And an image coding module, configured to encode the quantized current coded block data to obtain an image code stream; and the image code stream insertion module is configured to write the quantized mode code stream value into the image code stream. An embodiment of the present invention provides an image decoder, including:
解析模块, 用于从图像码流中解析得到当前解码块数据;  a parsing module, configured to parse the current decoded block data from the image code stream;
量化模式码流获取模块, 用于从图像码流中获取当前解码块的量化模式 码流值;  a quantization mode code stream obtaining module, configured to obtain, from the image code stream, a quantized mode code stream value of the current decoded block;
量化模式解码模块, 用于根据所述量化模式码流值, 得到当前解码块的 量化模式;  a quantization mode decoding module, configured to obtain, according to the quantized mode code stream value, a quantization mode of a current decoded block;
逆缩放或反量化模块, 用于釆用所述量化模式对当前解码块数据进行逆 缩放或反量化处理, 得到解量化后的当前解码块数据;  An inverse scaling or inverse quantization module, configured to perform inverse scaling or inverse quantization processing on the current decoded block data by using the quantization mode to obtain dequantized current decoded block data;
解码图像生成模块, 用于根据所述解量化后的当前解码块数据, 获得解 码图像。  And a decoded image generating module, configured to obtain a decoded image according to the dequantized current decoded block data.
本发明实施例提供了一种图像编解码系统, 包括: 图像编码器和图像解 码器; 所述图像编码器包括: An embodiment of the present invention provides an image coding and decoding system, including: an image encoder and an image decoder; The image encoder includes:
量化模式决策模块, 用于确定输入图像中当前编码块的量化模式; 缩放或量化处理模块, 用于根据所述量化模式对当前编码块进行缩放或 量化处理, 得到量化后的当前编码块数据;  a quantization mode decision module, configured to determine a quantization mode of a current coding block in the input image; a scaling or quantization processing module, configured to perform scaling or quantization processing on the current coding block according to the quantization mode, to obtain quantized current coding block data;
量化模式编码模块, 用于根据当前编码块的量化模式, 得到量化模式码 流值;  a quantization mode coding module, configured to obtain a quantized mode code stream value according to a quantization mode of the current coding block;
图像编码模块, 用于将量化后的当前编码块数据编码得到图像码流; 图像码流插入模块, 用于将所述量化模式码流值写到所述图像码流中; 所述图像解码器包括:  An image coding module, configured to encode the quantized current coded block data to obtain an image code stream; and an image code stream insertion module, configured to write the quantized mode code stream value into the image code stream; the image decoder Includes:
解析模块, 用于从图像码流中解析得到当前解码块数据;  a parsing module, configured to parse the current decoded block data from the image code stream;
量化模式码流获取模块, 用于从图像码流中获取当前解码块的量化模式 码流值;  a quantization mode code stream obtaining module, configured to obtain, from the image code stream, a quantized mode code stream value of the current decoded block;
量化模式解码模块, 用于根据所述量化模式码流值, 得到当前解码块的 量化模式;  a quantization mode decoding module, configured to obtain, according to the quantized mode code stream value, a quantization mode of a current decoded block;
逆缩放或反量化模块, 用于釆用所述量化模式对当前解码块数据进行逆 缩放或反量化处理, 得到解量化后的当前解码块数据;  An inverse scaling or inverse quantization module, configured to perform inverse scaling or inverse quantization processing on the current decoded block data by using the quantization mode to obtain dequantized current decoded block data;
解码图像生成模块, 用于根据所述解量化后的当前解码块数据, 获得解 码图像。  And a decoded image generating module, configured to obtain a decoded image according to the dequantized current decoded block data.
本发明实施例提供的量化模式及相应的图像编码和解码方法、 编码器和 解码器及编解码系统, 通过将确定的当前编码块量化模式写入编码数据中, 在解码器端不需要进行量化模式决策, 直接通过解码即可获得当前块量化模 式, 减小了解码器的计算负担和实现成本。 附图说明  The quantization mode and the corresponding image encoding and decoding method, the encoder and the decoder, and the codec system provided by the embodiments of the present invention do not need to be quantized at the decoder end by writing the determined current coding block quantization mode into the encoded data. Mode decision, the current block quantization mode can be obtained directly by decoding, which reduces the computational burden and implementation cost of the decoder. DRAWINGS
图 1为现有技术中宏块的示意图;  1 is a schematic diagram of a macroblock in the prior art;
图 2为现有技术中图像编解码系统的示意图; 图 3为本发明实施例量化模式编码方法的流程图; 2 is a schematic diagram of an image coding and decoding system in the prior art; 3 is a flowchart of a quantization mode encoding method according to an embodiment of the present invention;
图 4为本发明实施例量化模式解码方法的流程图;  4 is a flowchart of a quantization mode decoding method according to an embodiment of the present invention;
图 5为本发明实施例量化模式编码器的示意图;  FIG. 5 is a schematic diagram of a quantization mode encoder according to an embodiment of the present invention; FIG.
图 6为本发明实施例量化模式解码器的示意图;  6 is a schematic diagram of a quantization mode decoder according to an embodiment of the present invention;
图 7为本发明实施例量化模式编解码系统的示意图;  7 is a schematic diagram of a quantization mode codec system according to an embodiment of the present invention;
图 8为本发明实施例图像编码方法的流程图;  8 is a flowchart of an image encoding method according to an embodiment of the present invention;
图 9为本发明实施例图像编码方法中确定当前编码块量化模式的流程 图 10为本发明实施例图像解码方法的流程图;  FIG. 9 is a flowchart of determining a current coding block quantization mode in an image coding method according to an embodiment of the present invention; FIG. 10 is a flowchart of an image decoding method according to an embodiment of the present invention;
图 11为本发明实施例图像编码器的示意图;  11 is a schematic diagram of an image encoder according to an embodiment of the present invention;
图 12为本发明实施例图像解码器的示意图;  FIG. 12 is a schematic diagram of an image decoder according to an embodiment of the present invention; FIG.
图 1 3为本发明实施例图像编解码系统的示意图。 具体实施方式  FIG. 13 is a schematic diagram of an image coding and decoding system according to an embodiment of the present invention. detailed description
下面通过附图和实施例, 对本发明实施例的技术方案做进一步的详细描 述。  The technical solutions of the embodiments of the present invention are further described in detail below with reference to the accompanying drawings and embodiments.
本发明实施例提供的量化模式、 图像编码、 解码方法、 编码器、 解码器 及系统, 通过将当前编码块的量化模式进行编码, 并写入图像码流中, 在解 码器端不需要进行量化模式决策, 直接通过解码即可获得当前编码块的量化 模式。  The quantization mode, the image coding, the decoding method, the encoder, the decoder and the system provided by the embodiments of the present invention do not need to be quantized at the decoder end by encoding the quantization mode of the current coding block and writing into the image code stream. Mode decision, the quantization mode of the current coding block can be obtained directly by decoding.
为了描述方便, 在执行本发明实施例的方法之前, 若预先假定存在 3种 类型的量化模式: 量化模式 、 量化模式^ 量化模式(。 输入图像 P按照宏 块划分为:  For convenience of description, before performing the method of the embodiment of the present invention, it is presupposed that there are three types of quantization modes: quantization mode, quantization mode ^ quantization mode (. The input image P is divided into macro blocks according to macroblocks:
MB00 MB0l MB02 MB, MB 00 MB 0l MB 02 MB,
MBW MBn MBn MB, MB W MB n MB n MB,
P=  P=
MB20 MB2l MB22 MB, MB 20 MB 2l MB 22 MB,
MB30 MB3l MB32 MB, MB 30 MB 3l MB 32 MB,
1 其中, M , 表示图像在(i, j)位置处的宏块。 对于 P 中的每个宏块 M ,. 现在要确定其对应的量化模式。 1 Where M is a macroblock representing the position of the image at (i, j). For each macroblock M in P, it is now necessary to determine its corresponding quantization mode.
假定当前图像按照宏块划分所对应量化模式结果为:  Assume that the result of the quantization mode corresponding to the current image according to the macroblock is:
^00 ^02 ^03  ^00 ^02 ^03
Bn r ^13 B nr ^13
r  r
^30 r ^31 c r ^33  ^30 r ^31 c r ^33
其中 A、 B、 C为 3种量化模式, 下脚标表示该宏块在图像 P中的位置。 例如, 4,.表示在(i, j)位置处该宏块的量化模式为 A。 如图 3所示, 为本发明实施例量化模式编码方法的流程图, 具体包括如 下步骤: Among them, A, B, and C are three kinds of quantization modes, and the lower subscript indicates the position of the macroblock in the image P. For example, 4,. indicates that the quantization mode of the macroblock is A at the (i, j) position. As shown in FIG. 3, it is a flowchart of a quantization mode coding method according to an embodiment of the present invention, which specifically includes the following steps:
步骤 101、 根据当前编码块的量化模式, 得到量化模式码流值; 步骤 102、 将所述量化模式码流值写到图像码流中。  Step 101: Obtain a quantized mode code stream value according to a quantization mode of the current coding block. Step 102: Write the quantized mode code stream value into an image code stream.
其中步骤 101 中, 根据当前编码块的量化模式, 得到量化模式码流值可 以包括: 将当前编码块的量化模式结果进行编码; 也可以包括: 将当前编码 块的量化模式结果经过函数关系变换后进行编码。  In step 101, according to the quantization mode of the current coding block, obtaining the quantization mode code stream value may include: encoding the quantization mode result of the current coding block; or including: converting the quantization mode result of the current coding block by a function relationship Encode.
上述编码可以为直接编码, 也可以为熵编码。 直接编码是指将当前编码 块的量化模式结果或当前编码块的量化模式经过函数关系变换后的结果作为 量化模式码流值。  The above coding may be direct coding or entropy coding. Direct coding refers to the result of transforming the quantization mode result of the current coding block or the quantization mode of the current coding block through a functional relationship as a quantization mode code stream value.
当釆用直接编码, 且编码的对象是当前编码块的量化模式结果时, 即将 当前编码块的量化模式结果直接写入到编码码流中;  When direct coding is used, and the encoded object is the quantization mode result of the current coding block, the quantization mode result of the current coding block is directly written into the coded code stream;
也就是说,将 M0tfe。Mi中对应位置的量化模式直接写到对应的宏块码流中。 如在 M 21处对应的量化模式为 21 , 因此,将量化模式 B 写到宏块 B21的码 流中。 In other words, will be M 0t fe. The quantization mode of the corresponding position in Mi is directly written into the corresponding macroblock code stream. The corresponding quantization mode is 21 at M 21 , and therefore, the quantization mode B is written into the code stream of the macro block B 21 .
当釆用直接编码, 且编码的对象是当前编码块的量化模式经过函数关系 变换后的结果时, 即将当前编码块的量化模式结果按照一定的函数关系变换 后进行编码。 如, 图像按照宏块划分的对应量化模式结果 Μ^。Μί当作是量化模式图像 进行二次变换编码。 其中该量化模式图像中每个像素值为图像 Ρ中的量化模 式值。 When the direct encoding is used, and the encoded object is the result of the function mode transformation of the quantization mode of the current coding block, the quantization mode result of the current coding block is transformed according to a certain functional relationship and then encoded. For example, the corresponding quantization mode result of the image is divided into macroblocks. Μί is used as a quantization mode image for secondary transform coding. Wherein each pixel value in the quantized mode image is a quantized mode value in the image frame.
当釆用熵编码时, 就是将编码的对象按照确定的熵编码方法写到编码码 流中, 所述的熵编码方法包括但不限于索引编码、 定长编码、 游程编码、 变 长编码(VLC, 如基于上下文的变长编码 CAVLC等) 、 算术编码(AC, 如霍夫 曼编码, 基于上下文的算术编码 CABAC等)或上述方法的任一组合。  When entropy coding is used, the encoded object is written into the coded code stream according to a determined entropy coding method, including but not limited to index coding, fixed length coding, run length coding, variable length coding (VLC). , such as context-based variable length coding CAVLC, etc.), arithmetic coding (AC, such as Huffman coding, context-based arithmetic coding CABAC, etc.) or any combination of the above methods.
其中索引编码方法实施例如下:  The index encoding method is implemented as follows:
本实施例中, 如表 1所示, 仍假定使用 3种量化模式, A模式、 B模式、 C模式, 索引值可以为二进制编码, 因此, 对于 3种量化模式可以釆用 2bi t 的二进制编码表示索引值。 假定预先设置量化模式与索引值的对照表, 如表 1所示:  In this embodiment, as shown in Table 1, it is still assumed that three quantization modes, A mode, B mode, and C mode, are used, and the index value may be binary code. Therefore, binary coding of 2bi t may be used for the three quantization modes. Represents an index value. Assume that a comparison table of quantization mode and index value is preset, as shown in Table 1:
表 1.量化模式与索引值的对照表  Table 1. Comparison table between quantization mode and index value
Figure imgf000011_0001
为了减少熵编码时索引值所占用的比特数, 上述索引值还可以使用 l-3bi t 的二进制变长编码表示, 二进制变长码与索引值之间具有对应关系, 进而与量化模式建立对应关系, 预先设置的量化模式、 索引值与二进制变长 码的对照表, 如表 2所示:
Figure imgf000011_0001
In order to reduce the number of bits occupied by the index value during entropy coding, the above index value may also be represented by a binary variable length code of l-3bi t, and the binary variable length code has a correspondence relationship with the index value, thereby establishing a correspondence relationship with the quantization mode. , a preset comparison table of the quantization mode, the index value and the binary variable length code, as shown in Table 2:
表 2.量化模式、 索引值与二进制变长码的对照表  Table 2. Comparison table of quantization mode, index value and binary variable length code
索引值 二进制变长码 量化模式 00 1 A模式: 默认模式Index value binary variable length code quantization mode 00 1 A mode: default mode
01 010 B模式: 非保留细节模式01 010 B mode: Non-reserved detail mode
10 Oi l C模式: 保留细节模式 上述 3种类型的量化模式为本发明实施例一个具体的例子, 本发明实施 例量化模式的类型并不仅限于上述 3种类型, 而可以预先设定大于 3种类型 的量化模式, 使得量化模式的类型更加丰富。 10 Oi l C mode: Preserving the detail mode The above three types of quantization modes are a specific example of the embodiment of the present invention. The type of the quantization mode in the embodiment of the present invention is not limited to the above three types, and may be set to be more than three types in advance. The type of quantization mode makes the type of quantization mode more abundant.
经过步骤 101釆用确定的编码方法得到量化模式码流值, 所述量化模式 码流值就是量化模式在图像码流中的编码值。  The quantized mode code stream value is obtained by using the determined coding method in step 101, and the quantized mode code stream value is the coded value of the quantization mode in the image code stream.
例如, 若以索引值的形式表示量化模式, 则量化模式的索引值即在图像 码流中的量化模式码流值。 如釆用上述表 1时, 量化模式 c所对应量化模式 码流值为 11。 若以二进制变长码形式表示量化模式, 如釆用上述表 2时, 量 化模式 C所对应量化模式码流值为 011。  For example, if the quantization mode is expressed in the form of an index value, the index value of the quantization mode is the quantization mode code stream value in the image code stream. If the above Table 1 is used, the quantization mode code stream value corresponding to the quantization mode c is 11. If the quantization mode is expressed in the form of a binary variable length code, if the above Table 2 is used, the quantization mode code stream value corresponding to the quantization mode C is 011.
步骤 102 中, 将量化模式码流值写到图像码流中, 具体量化模式在图像 码流中的存在位置可以为:  In step 102, the quantized mode code stream value is written into the image code stream, and the existence position of the specific quantization mode in the image code stream may be:
( 1 )将量化模式码流值写到图像的宏块级码流中 ,如写到 macrob lock () 中 表 3 将量化模式写到宏块码流中  (1) Write the quantized mode code stream value to the macroblock level code stream of the image, as written in macrob lock (). Table 3 Write the quantization mode to the macroblock code stream.
Figure imgf000012_0001
Figure imgf000012_0001
其中, block (i)表示该宏块中包括的宏块子块, mb— wq_mode为该宏块对应 的量化模式, 用二进制整数编码 U(2), 即最多允许有 4种量化模式类型的变化 形式。 此时允许每个宏块拥有对应的量化模式。 Where block (i) represents a macroblock subblock included in the macroblock, mb_wq_mode is a quantization mode corresponding to the macroblock, and U(2) is encoded by a binary integer, that is, a maximum of four types of quantization mode types are allowed to be changed. Form. This allows each macroblock to have a corresponding quantization mode.
( 2)将量化模式码流值写到图像的宏块子块码流中, 如写到宏块子块 block ()中, 表 4 将量化模式写到宏块子块码流中  (2) writing the quantized mode code stream value to the macroblock sub-block code stream of the image, such as writing to the macroblock sub-block block (), and Table 4 writing the quantization mode to the macroblock sub-block code stream.
Figure imgf000013_0001
Figure imgf000013_0001
其中, mb— wq_mode为该宏块子块对应的量化模式, 用熵编码方法 se(v)进行 编码。 此时允许宏块的每个子块拥有对应的量化模式。 Where mb_wq_mode is the quantization mode corresponding to the macroblock sub-block, and is encoded by the entropy coding method se(v). At this point, each sub-block of the macroblock is allowed to have a corresponding quantization mode.
( 3 )将量化模式码流值按照当前编码块在图像中的排列位置组合成一个 量化模式图像并编码, 写到图像码流中。  (3) Combining the quantized mode code stream values into a quantized mode image according to the arrangement position of the current coded block in the image, and encoding and writing into the image code stream.
(4)将量化模式码流值作为辅助增强信息 ( Supplemental Enhancement Information, 以下简称: SEI ) 消息写到图像码流中, 如表 5所示。 表 5 量化模式写到码流的 SEI消息中  (4) Write the quantized mode code stream value as a Supplemental Enhancement Information (SEI) message to the image code stream, as shown in Table 5. Table 5 Quantization mode is written into the SEI message of the code stream.
Figure imgf000013_0002
Figure imgf000013_0002
其中, 码流的 SEI 消息结构为 SEI_Message() , mb— wq— mode— id表示码 流中存在的量化模式码流值, mb— wq— mode (i) 表示码流中按照宏块的量化 模式码流值。  The SEI message structure of the code stream is SEI_Message(), mb_wq_mode_id represents the quantized mode code stream value existing in the code stream, and mb_wq_mode (i) represents the quantization mode according to the macroblock in the code stream. Code stream value.
本发明实施例提供的量化模式编码方法, 通过将当前编码块的量化模式 编码, 并写到图像码流中, 使得在解码器端不需要执行量化模式决策算法, 直接通过解码即可获得当前编码块的量化模式, 减小了解码器的计算负担和 实现成本。 The quantization mode coding method provided by the embodiment of the present invention encodes the quantization mode of the current coding block and writes it into the image code stream, so that the quantization mode decision algorithm does not need to be performed at the decoder end. The quantization mode of the current coding block can be obtained directly by decoding, which reduces the computational burden and implementation cost of the decoder.
如图 4所示, 为本发明实施例量化模式解码方法的流程图, 具体包括如 下步骤:  As shown in FIG. 4, it is a flowchart of a quantization mode decoding method according to an embodiment of the present invention, which specifically includes the following steps:
步骤 201、 从图像码流中获取当前编码块的量化模式码流值;  Step 201: Obtain a quantization mode code stream value of a current coding block from an image code stream.
步骤 202、 根据所述量化模式码流值, 得到当前解码块的量化模式。 本实施例中, 具体量化模式码流值在图像码流中的存在位置可以参照本 发明实施例量化模式编码方法中所述的内容, 因此, 步骤 201 中从图像码流 中获取当前编码块的量化模式码流值可以包括: 从图像宏块码流中获取当前 解码块的量化模式码流值; 也可以包括: 从图像宏块包含的子块码流中获取 当前解码块的量化模式码流值; 也可以包括: 从图像码流中获取当前图像的 量化模式图像并解码, 且按照当前解码块在图像中的排列位置确定当前解码 块的量化模式码流值。 还可以包括: 从图像码流的 SE I消息中获取当前图像 宏块的量化模式并解码, 确定当前解码块的量化模式码流值。  Step 202: Obtain a quantization mode of the current decoded block according to the quantized mode code stream value. In this embodiment, the location of the specific quantization mode code stream value in the image code stream may be referred to the content described in the quantization mode coding method in the embodiment of the present invention. Therefore, in step 201, the current coded block is obtained from the image code stream. The quantizing mode code stream value may include: obtaining a quantization mode code stream value of the current decoding block from the image macroblock code stream; and may further include: acquiring a quantization mode code stream of the current decoding block from the sub-block code stream included in the image macroblock The value may also include: acquiring a quantization mode image of the current image from the image code stream and decoding, and determining a quantization mode code stream value of the current decoded block according to an arrangement position of the current decoded block in the image. The method may further include: obtaining a quantization mode of the current image macroblock from the SE I message of the image code stream and decoding, and determining a quantization mode code stream value of the current decoded block.
本实施例量化模式解码方法可以与本发明实施例量化模式编码方法相对 应。  The quantization mode decoding method of this embodiment can correspond to the quantization mode encoding method of the embodiment of the present invention.
当编码方法中釆用直接编码, 且编码的对象是当前编码块的量化模式结 果时, 所述步骤 202可以包括: 将所述量化模式码流值作为当前解码块的量 化模式。  When direct coding is used in the coding method, and the coded object is the quantization mode result of the current coding block, the step 202 may include: using the quantization mode code stream value as the quantization mode of the current decoding block.
当编码方法中釆用直接编码, 且编码的对象是当前编码块的量化模式经 过函数关系变换后的结果时, 所述步骤 202可以包括: 将所述量化模式码流 值经过函数关系反变换后的结果作为当前解码块的量化模式。  When the encoding method is directly encoded, and the encoded object is the result of the function mode transformation of the quantization mode of the current coding block, the step 202 may include: after inversely transforming the quantization mode code stream value through a function relationship The result is the quantization mode of the current decoded block.
当编码方法中釆用熵编码时, 所述步骤 202可以包括: 将所述量化模式 码流值进行熵解码, 或者将所述量化模式码流值进行熵解码及函数关系反变 换后, 得到当前解码块的量化模式。  When entropy coding is used in the coding method, the step 202 may include: entropy decoding the quantized mode code stream value, or performing entropy decoding and inverse function transformation on the quantized mode code stream value to obtain a current The quantization mode of the decoded block.
所述的熵解码方法包括但不限于索引、 定长解码、 游程解码、 变长解码 ( VLC, 如基于上下文的变长解码 CAVLC等)、 算术解码(AC , 如霍夫曼解码, 基于上下文的算术解码 CABAC等)或上述方法的任一组合。 The entropy decoding method includes but is not limited to index, fixed length decoding, run length decoding, variable length decoding (VLC, such as context-based variable length decoding CAVLC, etc.), arithmetic decoding (AC, such as Huffman decoding, context-based arithmetic decoding CABAC, etc.) or any combination of the above.
本发明实施例提供的量化模式解码方法,不需要执行量化模式决策算法, 直接通过解码即可获得当前编码块的量化模式, 减小了解码器的计算负担和 实现成本。  The quantization mode decoding method provided by the embodiment of the present invention does not need to execute the quantization mode decision algorithm, and can directly obtain the quantization mode of the current coding block by decoding, which reduces the computational burden and implementation cost of the decoder.
如图 5所示, 为本发明实施例量化模式编码器的示意图, 具体包括: 量 化模式编码模块 11 ,用于根据当前编码块的量化模式,得到量化模式码流值; 图像码流插入模块 12 , 用于将所述量化模式码流值写到图像码流中。  As shown in FIG. 5, a schematic diagram of a quantization mode encoder according to an embodiment of the present invention includes: a quantization mode coding module 11 configured to obtain a quantization mode code stream value according to a quantization mode of a current coding block; and an image code stream insertion module 12 And for writing the quantized mode code stream value into the image code stream.
其中量化模式编码模块 11可以包括第一量化模式编码模块,用于将当前 编码块的量化模式结果或当前编码块的量化模式经过函数关系变换后的结果 作为量化模式码流值。  The quantization mode encoding module 11 may include a first quantization mode encoding module, configured to use the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship as a quantization mode code stream value.
量化模式编码模块 11也可以包括第二量化模式编码模块,用于将当前编 码块的量化模式结果或当前编码块的量化模式经过函数关系变换后的结果进 行编码, 得到量化模式码流值。  The quantization mode encoding module 11 may further include a second quantization mode encoding module for encoding the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship to obtain a quantization mode code stream value.
第二量化模式编码模块也可以包括量化模式熵编码模块, 用于将当前编 码块的量化模式结果或当前编码块的量化模式经过函数关系变换后的结果进 行熵编码, 得到量化模式码流值。  The second quantization mode coding module may further include a quantization mode entropy coding module, configured to entropy encode the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship to obtain a quantization mode code stream value.
其中图像码流插入模块 12可以包括: 图像宏块码流插入模块, 用于将量 化模式码流值写到图像中当前编码的宏块码流中; 或, 图像宏块子块码流插 入模块, 用于将量化模式码流值写到图像中当前编码的宏块所包含的子块码 流中; 或, 图像码流 SEI消息插入模块, 用于将量化模式码流值写到图像码 流的 SEI消息码流中。  The image stream insertion module 12 may include: an image macroblock stream insertion module, configured to write the quantized mode stream value to the currently encoded macroblock stream in the image; or, the image macroblock subblock stream insertion module And for writing the quantized mode code stream value into the sub-block code stream included in the currently coded macroblock in the image; or, the image code stream SEI message insertion module, configured to write the quantized mode code stream value to the image code stream The SEI message is in the code stream.
图像码流插入模块 12还可以具体包括: 量化模式图像编码单元, 用于将 量化模式码流值按照当前编码块在图像中的排列位置组合成一个量化模式图 像并编码; 插入单元, 用于将编码后的量化模式图像写到图像码流中。  The image stream insertion module 12 may further include: a quantization mode image encoding unit, configured to combine the quantized mode code stream values into a quantized mode image according to an arrangement position of the current coding block in the image, and encode the insertion unit, The encoded quantized mode image is written into the image code stream.
本发明实施例提供的量化模式编码器, 通过将当前编码块的量化模式编 码, 并写到图像码流中, 使得在解码器端不需要执行量化模式决策算法, 直 接通过解码即可获得当前编码块的量化模式, 减小了解码器的计算负担和实 现成本。 The quantization mode encoder provided by the embodiment of the present invention compiles the quantization mode of the current coding block The code is written into the image code stream so that the quantization mode decision algorithm does not need to be performed at the decoder end, and the quantization mode of the current coding block can be obtained directly by decoding, which reduces the computational burden and implementation cost of the decoder.
如图 6所示, 为本发明实施例量化模式解码器的示意图, 具体包括: 量 化模式码流获取模块 21 , 用于从图像码流中获取当前解码块的量化模式码流 值; 量化模式解码模块 22 , 用于根据所述量化模式码流值, 得到当前解码块 的量化模式。  As shown in FIG. 6, a schematic diagram of a quantization mode decoder according to an embodiment of the present invention includes: a quantization mode code stream obtaining module 21, configured to obtain a quantization mode code stream value of a current decoding block from an image code stream; The module 22 is configured to obtain, according to the quantized mode code stream value, a quantization mode of the current decoded block.
其中量化模式码流获取模块 21可以包括: 量化模式宏块码流获取模块, 用于从图像宏块码流中获取当前解码块的量化模式码流值; 或, 量化模式宏 块子块码流获取模块, 用于从图像宏块包含的子块码流中获取当前解码块的 量化模式码流值; 或, 量化模式 SEI 消息码流获取模块, 用于从图像的 SEI 消息码流中获取当前图像解码块的量化模式码流值。  The quantization mode code stream obtaining module 21 may include: a quantization mode macroblock code stream acquiring module, configured to obtain a quantization mode code stream value of the current decoding block from the image macroblock code stream; or, a quantization mode macroblock subblock stream And an obtaining module, configured to obtain, from the sub-block code stream included in the image macroblock, a quantization mode code stream value of the current decoded block; or, a quantization mode SEI message code stream obtaining module, configured to obtain a current from the SEI message code stream of the image The quantized mode code stream value of the image decoding block.
量化模式码流获取模块 21还可以具体包括: 量化模式图像解码单元, 用 于从图像码流中获取当前图像的量化模式图像并解码; 确定单元, 用于按照 当前解码块在图像中的排列位置确定当前解码块的量化模式码流值。  The quantization mode code stream obtaining module 21 may further include: a quantization mode image decoding unit, configured to acquire and decode a quantization mode image of the current image from the image code stream; and a determining unit configured to arrange the position of the current decoded block in the image A quantized mode stream value of the current decoded block is determined.
其中量化模式解码模块 22可以包括第一量化模式解码模块,用于将所述 量化模式码流值或量化模式码流值经过函数关系反变换后的结果作为当前解 码块的量化模式。  The quantization mode decoding module 22 may include a first quantization mode decoding module, configured to use the result of inverse transforming the quantization mode code stream value or the quantization mode code stream value as a quantization mode of the current decoding block.
量化模式解码模块 22包括第二量化模式解码模块,用于将所述量化模式 码流值进行解码或者将量化模式码流值进行解码及函数关系反变换后, 得到 当前解码块的量化模式。  The quantization mode decoding module 22 includes a second quantization mode decoding module for decoding the quantized mode code stream value or decoding the quantized mode code stream value and inversely transforming the function relationship to obtain a quantization mode of the current decoded block.
第二量化模式解码模块也可以包括量化模式熵解码模块, 用于将所述量 化模式码流值进行熵解码或者将量化模式码流值进行熵解码及函数关系反变 换后, 得到当前解码块的量化模式。  The second quantization mode decoding module may further include a quantization mode entropy decoding module, configured to perform entropy decoding on the quantized mode code stream value or perform entropy decoding and inverse function transformation on the quantized mode code stream value to obtain a current decoded block. Quantization mode.
本发明实施例提供的量化模式解码器, 不需要执行量化模式决策算法, 直接通过解码即可获得当前编码块的量化模式, 减小了解码器的计算负担和 实现成本。 The quantization mode decoder provided by the embodiment of the present invention does not need to perform a quantization mode decision algorithm, and can obtain the quantization mode of the current coding block directly by decoding, thereby reducing the computational burden of the decoder and Achieve costs.
如图 7所示, 为本发明实施例量化模式编解码系统的示意图, 其中包括 量化模式编码器 31和量化模式解码器 32。  As shown in FIG. 7, it is a schematic diagram of a quantization mode codec system according to an embodiment of the present invention, which includes a quantization mode coder 31 and a quantization mode decoder 32.
量化模式编码器 31 包括: 量化模式编码模块 1 1 , 用于根据当前编码块 的量化模式, 得到量化模式码流值; 图像码流插入模块 12 , 用于将所述量化 模式码流值写到图像码流中。  The quantization mode encoder 31 includes: a quantization mode encoding module 1 1 configured to obtain a quantization mode code stream value according to a quantization mode of the current coding block; and an image code stream insertion module 12, configured to write the quantization mode code stream value to In the image stream.
量化模式解码器 32 包括: 量化模式码流获取模块 21 , 用于从图像码流 中获取当前解码块的量化模式码流值; 量化模式解码模块 22 , 用于根据所述 量化模式码流值, 得到当前解码块的量化模式。  The quantization mode decoder 32 includes: a quantization mode code stream acquisition module 21, configured to obtain a quantization mode code stream value of the current decoding block from the image code stream; a quantization mode decoding module 22, configured to use the quantization mode code stream value, The quantization mode of the current decoded block is obtained.
本发明实施例量化模式编解码系统还可以包括上述本发明实施例量化模 式编码器中所述的任一量化模式编码器和上述本发明实施例量化模式解码器 中所述的任一量化模式解码器。  The quantization mode codec system of the embodiment of the present invention may further include any of the quantization mode decoders described in the quantization mode encoder of the embodiment of the present invention and any of the quantization mode decoders described in the quantization mode decoder of the embodiment of the present invention. Device.
本发明实施例提供的量化模式编解码系统, 通过将当前编码块的量化模 式编码, 并写到图像码流中, 使得在解码器端不需要执行量化模式决策算法, 直接通过解码即可获得当前编码块的量化模式, 减小了解码器的计算负担和 实现成本。  The quantization mode codec system provided by the embodiment of the present invention encodes the quantization mode of the current coding block and writes it into the image code stream, so that the quantization mode decision algorithm does not need to be performed at the decoder end, and the current can be obtained through decoding. The quantization mode of the coding block reduces the computational burden and implementation cost of the decoder.
如图 8所示, 为本发明实施例图像编码方法的流程图, 具体包括如下步 骤:  As shown in FIG. 8, a flowchart of an image coding method according to an embodiment of the present invention specifically includes the following steps:
步骤 301、 确定输入图像中当前编码块的量化模式;  Step 301: Determine a quantization mode of a current coding block in the input image.
步骤 302、 根据所述量化模式对当前编码块进行缩放或量化处理, 得到 量化后的当前编码块数据;  Step 302: Perform scaling or quantization processing on the current coding block according to the quantization mode, to obtain quantized current coding block data.
步骤 303、 根据当前编码块的量化模式, 得到量化模式码流值; 步骤 304、 将量化后的当前编码块数据编码得到图像码流, 并将所述量 化模式码流值写到所述图像码流中。  Step 303: Obtain a quantized mode code stream value according to a quantization mode of the current coding block. Step 304: encode the quantized current coding block data to obtain an image code stream, and write the quantized mode code stream value to the image code. In the stream.
上述步骤 302和步骤 303的执行顺序可以互换。  The order of execution of the above steps 302 and 303 can be interchanged.
下面在结合具体例子详细说明如何确定当前编码块的量化模式, 该确定 方法可以包括: 根据当前编码块的邻近块编码信息, 决策当前块的量化模式; 也可以包括: 根据外部扩展输入的量化模式决策方法, 决策当前块的量 化模式; The following describes in detail how to determine the quantization mode of the current coding block in combination with a specific example, the determination The method may include: determining a quantization mode of the current block according to the neighboring block coding information of the current coding block; and may further include: determining a quantization mode of the current block according to the quantization mode decision method of the external extended input;
还可以包括: 根据外部扩展输入的当前编码块的量化模式, 得到当前块 的量化模式;  The method may further include: obtaining a quantization mode of the current block according to a quantization mode of the current coding block input by the external extension;
又可以包括: 上述 3种方法的综合判决的得到当前块的量化模式。  It may also include: a comprehensive decision of the above three methods to obtain a quantization mode of the current block.
当前编码块的量化模式可以根据以上 3种不同方法或方法组合来共同确 定当前编码块的量化模式, 这里举例说明, 当存在 2种或 2种以上方法时, 如何确定当前块的量化模式。  The quantization mode of the current coding block may be used to determine the quantization mode of the current coding block according to the above three different methods or combinations of methods. Here, an example is given to determine how to determine the quantization mode of the current block when there are two or more methods.
以上 3种方法在确定当前块的量化模式时, 对最终量化模式结果的影响 按优先级次序依次为, 外部输入的量化模式、 外部输入的量化模式决策方法 决策的量化模式、 根据邻近块编码信息决策的量化模式。  When the above three methods determine the quantization mode of the current block, the effects on the final quantization mode result are sequentially in order of priority, the externally input quantization mode, the externally input quantization mode decision method, the quantization mode, and the neighboring block coding information. The quantitative model of decision making.
当不存在外部输入的量化模式决策方法时, 则默认使用根据当前编码块 邻近编码信息的量化模式决策方法作为当前编码使用的量化模式决策方法; 否则若存在外部输入的量化模式决策方法, 则使用外部输入的量化模式决策 方法作为当前编码使用的量化模式决策方法;  When there is no externally input quantization mode decision method, the quantization mode decision method based on the current coding block neighboring coding information is used as the quantization mode decision method used by the current coding by default; otherwise, if there is an external input quantization mode decision method, the use is performed. An externally input quantization mode decision method is used as a quantization mode decision method for current coding;
当不存在外部输入的量化模式时, 则默认使用当前编码使用的量化模式 决策方法确定的量化模式作为当前块的量化模式; 否则若存在外部输入的量 化模式时, 直接使用外部输入的量化模式作为当前块的量化模式。  When there is no externally input quantization mode, the quantization mode determined by the quantization mode decision method used in the current encoding is used as the quantization mode of the current block by default; otherwise, if there is an externally input quantization mode, the externally input quantization mode is directly used as the quantization mode. The quantization mode of the current block.
如图 9所示, 为本发明实施例图像编码方法中确定当前编码块量化模式 的流程图, 具体步骤包括:  As shown in FIG. 9, a flowchart for determining a current coding block quantization mode in an image coding method according to an embodiment of the present invention includes:
步骤 401、 首先确定是否存在外部输入的量化模式, 若是, 则执行步骤 407,即对于当前编码块, 其量化模式直接使用外部输入的量化模式; 否则执 行步骤 402 ;  Step 401: First, it is determined whether there is an external input quantization mode, and if yes, step 407 is performed, that is, for the current coding block, the quantization mode directly uses the externally input quantization mode; otherwise, step 402 is performed;
步骤 402、 当不存在外部输入的量化模式时, 需要使用量化模式决策方 法来决策当前编码块的量化模式, 此时需要获取当前块的邻近块编码信息作 为量化决策方法的输入; Step 402: When there is no externally input quantization mode, the quantization mode decision method needs to be used to determine the quantization mode of the current coding block. In this case, the neighbor block coding information of the current block needs to be obtained. To quantify the input of decision making methods;
步骤 403、 判断是否存在外部输入的量化模式决策方法, 若是, 则执行 步骤 405 , 即当前量化模式决策方法, 使用外部输入的量化模式决策方法; 否则执行步骤 404 , 即不存在外部输入的量化模式决策方法时, 使用当前默 认的量化模式决策方法;  Step 403: Determine whether there is an externally input quantization mode decision method, and if yes, execute step 405, that is, the current quantization mode decision method, using an externally input quantization mode decision method; otherwise, execute step 404, that is, there is no external input quantization mode When making a decision method, use the current default quantization mode decision method;
步骤 404、 不存在外部输入的量化模式决策方法时, 使用当前默认的量 化模式决策方法; 当前默认的量化模式决策方法是根据邻近块的编码信息来 确定当前编码块的量化模式, 决策方法为实现定义好的固定决策规则, 即执 行步骤 406 ;  Step 404: When there is no externally input quantization mode decision method, the current default quantization mode decision method is used; the current default quantization mode decision method is to determine the quantization mode of the current coding block according to the coding information of the neighboring block, and the decision method is implemented. Defining a fixed decision rule, that is, performing step 406;
步骤 405、 确定并更新当前量化模式决策方法, 当存在外部输入的量化 模式决策方法时, 用外部输入的量化模式决策方法更新默认的量化模式决策 方法作为当前编码使用的量化模式决策方法;  Step 405: Determine and update a current quantization mode decision method. When there is an externally input quantization mode decision method, use an externally input quantization mode decision method to update a default quantization mode decision method as a quantization mode decision method used by the current coding;
步骤 406、 使用步骤 404或步骤 405中所述确定的当前量化模式决策方 法,并才艮据当前编码块的邻块编码信息进行决策确定当前编码块的量化模式; 步骤 407、 输出当前编码块的量化模式, 并用于当前编码块的缩放 /量化 操作。  Step 406: Determine the current quantization mode decision method according to the current quantization mode decision method determined in step 404 or step 405, and determine the quantization mode of the current coding block according to the neighbor block coding information of the current coding block. Step 407: Output the current coding block The quantization mode is used for the scaling/quantization operation of the current coding block.
上述确定量化模式的过程中,用户可以通过外部输入量化模式和 /或量化 模式决策方法, 自定义改变量化模式决策方法和量化模式决策结果, 从而能 够灵活地改变量化决策过程, 丰富了判决结果。  In the above process of determining the quantization mode, the user can customize the quantization mode decision method and the quantization mode decision result through the external input quantization mode and/or the quantization mode decision method, thereby flexibly changing the quantization decision process and enriching the decision result.
在上述内容的基础上, 进一步地, 步骤 303中根据当前编码块的量化模 式, 得到量化模式码流值可以包括: 将当前编码块的量化模式结果进行编码; 也可以包括: 将当前编码块的量化模式结果经过函数关系变换后进行编码。  On the basis of the foregoing, further, in step 303, obtaining the quantized mode stream value according to the quantization mode of the current coding block may include: encoding the quantization mode result of the current coding block; and may further include: The result of the quantization mode is encoded after the function relationship transformation.
上述编码可以为直接编码, 也可以为熵编码。 直接编码是指将当前编码 块的量化模式结果或当前编码块的量化模式经过函数关系变换后的结果作为 量化模式码流值。  The above coding may be direct coding or entropy coding. Direct coding refers to the result of transforming the quantization mode result of the current coding block or the quantization mode of the current coding block through a functional relationship as a quantization mode code stream value.
当釆用直接编码, 且编码的对象是当前编码块的量化模式结果时, 即将 当前编码块的量化模式结果直接写入到编码码流中; When direct encoding is used, and the encoded object is the result of the quantization mode of the current coding block, The quantization mode result of the current coding block is directly written into the coded code stream;
也就是说,将 中对应位置的量化模式直接写到对应的宏块码流中。 如在^©21处对应的量化模式为 因此,将量化模式 B 写到宏块 Affi21的码 流中。 That is to say, the quantization mode of the corresponding position is directly written into the corresponding macroblock code stream. The quantization mode B is written to the code stream of the macroblock Affi 21 as the corresponding quantization mode at ^© 21 .
当釆用直接编码, 且编码的对象是当前编码块的量化模式经过函数关系 变换后的结果时, 即将当前编码块的量化模式结果按照一定的函数关系变换 后进行编码。  When the direct encoding is used, and the encoded object is the result of the function of the quantization mode of the current coding block, the quantization mode result of the current coding block is transformed according to a certain functional relationship and then encoded.
如, 图像按照宏块划分的对应量化模式结果 Μ^。Μί当作是量化模式图像 进行二次变换编码。 其中该量化模式图像中每个像素值为图像 Ρ中的量化模 式值。 For example, the corresponding quantization mode result of the image is divided into macroblocks. Μί is used as a quantization mode image for secondary transform coding. Wherein each pixel value in the quantized mode image is a quantized mode value in the image frame.
当釆用熵编码时, 就是将编码的对象按照确定的熵编码方法写到编码码 流中, 所述的熵编码方法包括但不限于索引编码、 定长编码、 游程编码、 变 长编码(VLC , 如基于上下文的变长编码 CAVLC等) 、 算术编码(AC , 如霍夫 曼编码, 基于上下文的算术编码 CABAC等)或上述方法的任一组合。  When entropy coding is used, the encoded object is written into the coded code stream according to a determined entropy coding method, including but not limited to index coding, fixed length coding, run length coding, variable length coding (VLC). , such as context-based variable length coding CAVLC, etc.), arithmetic coding (AC, such as Huffman coding, context-based arithmetic coding CABAC, etc.) or any combination of the above methods.
其中索引编码方法可以釆用本发明实施例量化模式编码方法中所述的索 引编码方法的实施例。  The index coding method may employ an embodiment of the index coding method described in the quantization mode coding method of the embodiment of the present invention.
步骤 304 中, 将量化模式码流值写到图像码流中, 具体量化模式码流值 在图像码流中的存在位置可以为: ( 1 )将量化模式码流值写到图像的宏块级 码流中; ( 2 )将量化模式码流值写到图像的宏块子块码流中; ( 3 ) 将量化 模式码流值按照当前编码块在图像中的排列位置组合成一个量化模式图像并 编码, 写到图像码流中。 ( 4 )将量化模式的码流值写到图像码流的 SEI消息 码流中。  In step 304, the quantized mode code stream value is written into the image code stream, and the existence position of the specific quantization mode code stream value in the image code stream may be: (1) writing the quantized mode code stream value to the macroblock level of the image. (2) writing the quantized mode code stream value to the macroblock sub-block code stream of the image; (3) combining the quantized mode code stream values into a quantized mode image according to the arrangement position of the current coding block in the image; And encode, write to the image stream. (4) Write the code stream value of the quantization mode into the SEI message code stream of the image code stream.
本发明实施例提供的图像编码方法,通过将当前编码块的量化模式编码, 并写到图像码流中, 使得在解码器端不需要执行量化模式决策算法, 直接通 过解码即可获得当前编码块的量化模式, 减小了解码器的计算负担和实现成 本; 进一步的, 用户可以自定义改变量化模式决策方法和量化模式决策结果, 从而能够灵活地改变量化决策过程和丰富了判决结果。 The image coding method provided by the embodiment of the present invention encodes the quantization mode of the current coding block and writes it into the image code stream, so that the quantization mode decision algorithm is not required to be performed at the decoder end, and the current coding block can be obtained directly by decoding. The quantization mode reduces the computational burden and implementation cost of the decoder; further, the user can customize the change quantization mode decision method and the quantization mode decision result, Thereby, it is possible to flexibly change the quantitative decision process and enrich the decision result.
如图 10所示, 为本发明实施例图像解码方法的流程图, 具体包括如下步 骤:  As shown in FIG. 10, it is a flowchart of an image decoding method according to an embodiment of the present invention, which specifically includes the following steps:
步骤 501、 从图像码流中解析得到当前解码块数据及其对应量化模式码 流值;  Step 501: Parsing the current decoded block data and the corresponding quantization mode code stream value from the image code stream;
步骤 502、 根据所述量化模式码流值, 得到当前解码块的量化模式; 步骤 503、 用所述量化模式对当前解码块数据进行逆缩放或反量化处理, 得到解量化后的当前解码块数据;  Step 502: Obtain a quantization mode of the current decoded block according to the quantized mode code stream value. Step 503: Perform inverse scaling or inverse quantization processing on the current decoded block data by using the quantization mode to obtain dequantized current decoded block data. ;
步骤 504、 根据所述解量化后的当前解码块数据, 获得解码图像。  Step 504: Obtain a decoded image according to the dequantized current decoded block data.
本实施例中, 具体量化模式码流值在图像码流中的存在位置可以参照本 发明实施例图像编码方法中所述的内容, 因此, 步骤 501 中从图像码流中解 析得到当前解码块数据所对应量化模式码流值可以包括: 从图像宏块码流中 解析得到当前解码块数据对应量化模式码流值; 也可以包括: 从图像宏块包 含的子块码流中解析得到当前解码块数据对应量化模式码流值;也可以包括: 从图像码流中解析得到当前图像的量化模式图像并解码, 且按照当前解码块 在图像中的排列位置确定当前解码块数据对应量化模式码流值;还可以包括: 从图像码流的 SEI 消息中解析当前图像宏块的量化模式, 确定当前解码块的 量化模式码流值。  In this embodiment, the location of the specific quantization mode code stream value in the image code stream may refer to the content described in the image coding method of the embodiment of the present invention. Therefore, the current decoded block data is parsed from the image code stream in step 501. The corresponding quantized mode code stream value may include: parsing the current decoded block data corresponding to the quantized mode code stream value from the image macroblock code stream; and may further include: parsing the current decoded block from the sub-block code stream included in the image macroblock The data corresponds to the quantized mode code stream value; and may further include: parsing and decoding the quantized mode image of the current image from the image code stream, and determining the quantized mode code stream value of the current decoded block data according to the arrangement position of the current decoded block in the image. The method may further include: parsing a quantization mode of the current image macroblock from the SEI message of the image code stream, and determining a quantization mode code stream value of the current decoded block.
本实施例图像解码方法可以与本发明实施例图像解码方法相对应。  The image decoding method of this embodiment can correspond to the image decoding method of the embodiment of the present invention.
当编码方法中釆用直接编码, 且编码的对象是当前编码块的量化模式结 果时, 所述步骤 502可以包括: 将所述量化模式码流值作为当前解码块的量 化模式。  When direct coding is used in the coding method, and the coded object is the quantization mode result of the current coding block, the step 502 may include: using the quantization mode code stream value as the quantization mode of the current decoding block.
当编码方法中釆用直接编码, 且编码的对象是当前编码块的量化模式经 过函数关系变换后的结果时, 所述步骤 502可以包括: 将所述量化模式码流 值经过函数关系反变换后的结果作为当前解码块的量化模式。  When the encoding method is directly encoded, and the encoded object is the result of the function mode transformation of the quantization mode of the current coding block, the step 502 may include: after inversely transforming the quantization mode code stream value through a function relationship The result is the quantization mode of the current decoded block.
当编码方法中釆用熵编码时, 所述步骤 502可以包括: 将所述量化模式 码流值进行熵解码, 或者将所述量化模式码流值进行熵解码及函数关系反变 换后, 得到当前解码块的量化模式。 When entropy coding is used in the coding method, the step 502 may include: using the quantization mode The code stream value is entropy decoded, or the quantization mode code stream value is entropy decoded and the function relationship is inversely transformed to obtain a quantization mode of the current decoded block.
所述的熵解码方法包括但不限于索引、 定长解码、 游程解码、 变长解码 The entropy decoding method includes but is not limited to index, fixed length decoding, run length decoding, variable length decoding
( VLC , 如基于上下文的变长解码 CAVLC等)、 算术解码(AC , 如霍夫曼解码, 基于上下文的算术解码 CABAC等)或上述方法的任一组合。 (VLC, such as context-based variable length decoding CAVLC, etc.), arithmetic decoding (AC, such as Huffman decoding, context-based arithmetic decoding CABAC, etc.) or any combination of the above methods.
本发明实施例提供的图像解码方法, 不需要执行量化模式决策算法, 直 接通过解码即可获得当前编码块的量化模式, 减小了解码器的计算负担和实 现成本。  The image decoding method provided by the embodiment of the present invention does not need to perform the quantization mode decision algorithm, and the quantization mode of the current coding block can be obtained directly by decoding, which reduces the computational burden and the implementation cost of the decoder.
如图 1 1所示, 为本发明实施例图像编码器的示意图, 具体包括: 量化模 式决策模块 41 , 用于确定输入图像中当前编码块的量化模式; 缩放或量化处 理模块 42 , 用于根据所述量化模式对当前编码块进行缩放或量化处理, 得到 量化后的当前编码块数据; 量化模式编码模块 43 , 用于根据当前编码块的量 化模式, 得到量化模式码流值; 图像编码模块 44 , 用于将量化后的当前编码 块数据编码得到图像码流; 图像码流插入模块 45 , 用于将所述量化模式码流 值写到所述图像码流中。  As shown in FIG. 11 , a schematic diagram of an image encoder according to an embodiment of the present invention includes: a quantization mode decision module 41, configured to determine a quantization mode of a current coding block in an input image; and a scaling or quantization processing module 42 configured to The quantization mode performs scaling or quantization processing on the current coding block to obtain the quantized current coding block data. The quantization mode coding module 43 is configured to obtain a quantization mode code stream value according to the quantization mode of the current coding block. The image coding module 44 And for encoding the quantized current coded block data to obtain an image code stream; and the image code stream insertion module 45 is configured to write the quantized mode code stream value into the image code stream.
其中量化模式决策模块 41可以包括基于邻近块决策模块,用于根据当前 编码块的邻近块编码信息, 决策所述当前编码块的量化模式。  The quantization mode decision module 41 may include a neighboring block decision module, configured to determine a quantization mode of the current coded block according to neighbor block coding information of the current coded block.
量化模式决策模块 41也可以包括外部决策模块,用于根据外部输入的量 化模式决策方法或量化模式, 决策所述当前编码块的量化模式。  The quantization mode decision module 41 may also include an external decision module for determining the quantization mode of the current coded block based on the externally input quantization mode decision method or quantization mode.
量化模式决策模块 41还可以具体包括: 基于邻近块决策模块, 用于根据 当前编码块的邻近块编码信息, 决策当前编码块的第一级量化模式; 外部决 策模块, 用于根据外部输入的量化模式决策方法或量化模式, 决策当前编码 块的第二级量化模式或第三级量化模式; 综合决策模块, 用于根据当前编码 块的第一级量化模式、 第二级量化模式、 第三级量化模式决策所述当前编码 块的量化模式。  The quantization mode decision module 41 may further include: a neighboring block decision module, configured to determine a first level quantization mode of the current coding block according to the neighboring block coding information of the current coding block; and an external decision module for performing quantization according to the external input a mode decision method or a quantization mode, determining a second-level quantization mode or a third-level quantization mode of the current coding block; an integrated decision module, configured to use the first-level quantization mode, the second-level quantization mode, and the third-level according to the current coding block The quantization mode determines the quantization mode of the current coded block.
所述量化模式决策模块 41优先级为:根据所述外部输入的量化模式的外 部决策模块确定的第三级量化模式优先级最高; 根据所述外部输入的量化模 式决策方法的外部决策模块确定的第二级量化模式优先级次之; 所述基于邻 近块决策模块确定的第一级量化模式优先级最低; 在确定当前编码块的量化 模式时 , 优先级高的量化模式决策模块所确定的量化模式取代优先级低的量 化模式决策模块所确定的量化模式。 The priority of the quantization mode decision module 41 is: according to the external input quantization mode The third-level quantization mode determined by the partial decision module has the highest priority; the second-level quantization mode priority determined by the external decision module of the externally input quantization mode decision method; the first determined by the neighboring block decision module The primary quantization mode has the lowest priority; when determining the quantization mode of the current coding block, the quantization mode determined by the higher priority quantization mode decision module replaces the quantization mode determined by the lower priority quantization mode decision module.
其中量化模式编码模块 43可以包括第一量化模式编码模块,用于将当前 编码块的量化模式结果或当前编码块的量化模式经过函数关系变换后的结果 作为量化模式码流值。  The quantization mode encoding module 43 may include a first quantization mode encoding module, configured to use the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship as a quantization mode code stream value.
量化模式编码模块 43也可以包括第二量化模式编码模块,用于将当前编 码块的量化模式结果或当前编码块的量化模式经过函数关系变换后的结果进 行编码, 得到量化模式码流值。  The quantization mode encoding module 43 may further include a second quantization mode encoding module for encoding the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship to obtain a quantization mode code stream value.
第二量化模式编码模块也可以包括量化模式熵编码模块, 用于将当前编 码块的量化模式结果或当前编码块的量化模式经过函数关系变换后的结果进 行熵编码, 得到量化模式码流值。  The second quantization mode coding module may further include a quantization mode entropy coding module, configured to entropy encode the result of the quantization mode result of the current coding block or the quantization mode of the current coding block by a function relationship to obtain a quantization mode code stream value.
其中图像码流插入模块 45可以包括图像宏块或子块码流插入模块,用于 将量化模式码流值写到图像中当前编码的宏块码流或当前编码的宏块所包含 的子块码流中。  The image stream insertion module 45 may include an image macroblock or a sub-block stream insertion module, configured to write the quantized mode stream value to the currently encoded macroblock stream in the image or the subblock included in the currently encoded macroblock. In the code stream.
图像码流插入模块 45还可以具体包括: 量化模式图像编码单元, 用于将 量化模式码流值按照当前编码块在图像中的排列位置组合成一个量化模式图 像并编码; 插入单元, 用于将编码后的量化模式图像写到图像码流中。  The image stream insertion module 45 may further include: a quantization mode image encoding unit, configured to combine the quantized mode code stream values into a quantized mode image according to an arrangement position of the current coding block in the image, and encode the insertion unit, The encoded quantized mode image is written into the image code stream.
图像码流插入模块 45还可以具体包括:量化模式 SEI消息码流插入模块, 用于将量化模式的码流值写到图像的 SEI消息码流中。  The image code stream insertion module 45 may further include: a quantization mode SEI message code stream insertion module, configured to write the code stream value of the quantization mode into the SEI message code stream of the image.
本发明实施例提供的图像编码器, 通过将当前编码块的量化模式编码, 并写到图像码流中, 使得在解码器端不需要执行量化模式决策算法, 直接通 过解码即可获得当前编码块的量化模式, 减小了解码器的计算负担和实现成 本; 进一步的, 用户可以通过外部决策模块自定义改变量化模式决策方法和 量化模式决策结果, 从而能够灵活地改变量化决策过程和丰富了判决结果。 如图 12所示, 为本发明实施例图像解码器的示意图, 具体包括: 解析模 块 51 , 用于从图像码流中解析得到当前解码块数据; 量化模式码流获取模块 52 , 用于从图像码流中获取当前解码块的量化模式码流值; 量化模式解码模 块 53 , 用于根据所述量化模式码流值, 得到当前解码块的量化模式; 逆缩放 或反量化模块 54 , 用于釆用所述量化模式对当前解码块数据进行逆缩放或反 量化处理, 得到解量化后的当前解码块数据; 解码图像生成模块 55 , 用于根 据所述解量化后的当前解码块数据, 获得解码图像。 The image encoder provided by the embodiment of the present invention encodes the quantization mode of the current coding block and writes it into the image code stream, so that the quantization mode decision algorithm is not required to be performed at the decoder end, and the current coding block can be obtained directly by decoding. The quantization mode reduces the computational burden and implementation cost of the decoder; further, the user can customize the quantization mode decision method through an external decision module and Quantitative mode decision results, which can flexibly change the quantitative decision process and enrich the decision results. As shown in FIG. 12, it is a schematic diagram of an image decoder according to an embodiment of the present invention, which specifically includes: a parsing module 51, configured to parse a current decoded block data from an image code stream; and a quantization mode code stream acquiring module 52, configured to Obtaining a quantized mode code stream value of the current decoded block in the code stream; a quantization mode decoding module 53, configured to obtain a quantization mode of the current decoded block according to the quantized mode code stream value; and an inverse scaling or inverse quantization module 54 for Performing inverse scaling or inverse quantization processing on the current decoded block data to obtain the dequantized current decoded block data; the decoded image generating module 55 is configured to obtain decoding according to the dequantized current decoded block data. image.
其中量化模式码流获取模块 52可以包括: 量化模式宏块码流获取模块, 用于从图像宏块码流中获取当前解码块的量化模式码流值; 或量化模式宏块 子块码流获取模块, 用于从图像宏块包含的子块码流中获取当前解码块的量 化模式码流值。  The quantization mode code stream acquisition module 52 may include: a quantization mode macroblock code stream acquisition module, configured to obtain a quantization mode code stream value of the current decoding block from the image macroblock code stream; or a quantization mode macroblock sub-block code stream acquisition. And a module, configured to obtain, from a sub-block code stream included in the image macroblock, a quantized mode code stream value of the current decoded block.
量化模式码流获取模块 52还可以具体包括: 量化模式图像解码单元, 用 于从图像码流中获取当前图像的量化模式图像并解码; 确定单元, 用于按照 当前解码块在图像中的排列位置确定当前解码块的量化模式码流值。  The quantization mode code stream obtaining module 52 may further include: a quantization mode image decoding unit, configured to acquire and decode a quantization mode image of the current image from the image code stream; and a determining unit, configured to arrange the position of the current decoded block in the image A quantized mode stream value of the current decoded block is determined.
量化模式码流获取模块 52还可以包括,量化模式的图像 SE I消息码流获 取模块, 用于从图像的 SEI消息码流中获取当前图像解码块的量化模式码流 值。  The quantized mode code stream obtaining module 52 may further include an image SE I message code stream obtaining module of the quantization mode, configured to obtain a quantized mode code stream value of the current image decoding block from the SEI message code stream of the image.
量化模式解码模块 53可以包括第一量化模式解码模块, 用于将所述量化 模式码流值或量化模式码流值经过函数关系反变换后的结果作为当前解码块 的量化模式。  The quantization mode decoding module 53 may include a first quantization mode decoding module, configured to use the result of inverse transforming the quantization mode code stream value or the quantization mode code stream value as a quantization mode of the current decoding block.
量化模式解码模块 53包括第二量化模式解码模块,用于将所述量化模式 码流值进行解码或者将量化模式码流值进行解码及函数关系反变换后, 得到 当前解码块的量化模式。  The quantization mode decoding module 53 includes a second quantization mode decoding module for decoding the quantized mode code stream value or decoding the quantized mode code stream value and inversely transforming the function relationship to obtain a quantization mode of the current decoded block.
量化模式解码模块 53也可以包括量化模式熵解码模块,用于将所述量化 模式码流值进行熵解码或者将量化模式码流值进行熵解码及函数关系反变换 后, 得到当前解码块的量化模式。 The quantization mode decoding module 53 may further include a quantization mode entropy decoding module, configured to perform entropy decoding on the quantized mode code stream value or perform entropy decoding and inverse function relationship on the quantized mode code stream value. After that, the quantization mode of the current decoded block is obtained.
本发明实施例提供的图像解码器, 不需要执行量化模式决策算法, 直接 通过解码即可获得当前编码块的量化模式, 减小了解码器的计算负担和实现 成本。  The image decoder provided by the embodiment of the present invention does not need to perform a quantization mode decision algorithm, and can obtain the quantization mode of the current coding block directly by decoding, which reduces the computational burden and implementation cost of the decoder.
如图 1 3所示, 为本发明实施例图像编解码系统的示意图, 其中包括: 图 像编码器 61和图像解码器 62。  As shown in FIG. 13, a schematic diagram of an image coding and decoding system according to an embodiment of the present invention includes: an image encoder 61 and an image decoder 62.
图像编码器 61 包括: 量化模式决策模块 41 , 用于确定输入图像中当前 编码块的量化模式; 缩放或量化处理模块 42 , 用于根据所述量化模式对当前 编码块进行缩放或量化处理, 得到量化后的当前编码块数据; 量化模式编码 模块 43 , 用于根据当前编码块的量化模式, 得到量化模式码流值; 图像编码 模块 44 , 用于将量化后的当前编码块数据编码得到图像码流; 图像码流插入 模块 45 , 用于将所述量化模式码流值写到所述图像码流中。  The image encoder 61 includes: a quantization mode decision module 41, configured to determine a quantization mode of a current coding block in the input image; a scaling or quantization processing module 42, configured to perform scaling or quantization processing on the current coding block according to the quantization mode, to obtain The quantized mode encoding module 43 is configured to obtain the quantized mode code stream value according to the quantization mode of the current coding block, and the image encoding module 44 is configured to encode the quantized current coding block data to obtain the image code. And an image stream insertion module 45, configured to write the quantized mode code stream value into the image code stream.
图像解码器 62 包括: 解析模块 51 , 用于从图像码流中解析得到当前解 码块数据; 量化模式码流获取模块 52 , 用于从图像码流中获取当前解码块的 量化模式码流值; 量化模式解码模块 53 , 用于根据所述量化模式码流值, 得 到当前解码块的量化模式; 逆缩放或反量化模块 54 , 用于釆用所述量化模式 对当前解码块数据进行逆缩放或反量化处理, 得到解量化后的当前解码块数 据; 解码图像生成模块 55 , 用于根据所述解量化后的当前解码块数据, 获得 解码图像。  The image decoder 62 includes: a parsing module 51, configured to parse the current decoded block data from the image code stream; and a quantization mode code stream obtaining module 52, configured to obtain a quantized mode stream value of the current decoded block from the image code stream; The quantization mode decoding module 53 is configured to obtain a quantization mode of the current decoding block according to the quantization mode code stream value, and use an inverse scaling or inverse quantization module 54 to inverse scale the current decoded block data by using the quantization mode or The dequantization process is performed to obtain the dequantized current decoded block data. The decoded image generating module 55 is configured to obtain the decoded image according to the dequantized current decoded block data.
本发明实施例图像编解码系统还可以包括上述本发明实施例图像编码器 中所述的任一图像编码器和上述本发明实施例图像解码器中所述的任一图像 解码器。  The image coding and decoding system of the embodiment of the present invention may further include any of the image encoders described in the image encoder of the embodiment of the present invention and any of the image decoders described above in the image decoder of the embodiment of the present invention.
本发明实施例提供的图像编解码系统, 通过将当前编码块的量化模式编 码, 并写到图像码流中, 使得在解码器端不需要执行量化模式决策算法, 直 接通过解码即可获得当前编码块的量化模式, 减小了解码器的计算负担和实 现成本; 进一步的, 用户可以自定义改变量化模式决策方法和量化模式决策 结果, 从而能够灵活地改变量化决策过程和丰富了判决结果。 The image coding and decoding system provided by the embodiment of the present invention encodes the quantization mode of the current coding block and writes it into the image code stream, so that the quantization mode decision algorithm is not required to be performed at the decoder end, and the current coding can be obtained directly by decoding. The quantization mode of the block reduces the computational burden and implementation cost of the decoder; further, the user can customize the quantization mode decision method and the quantization mode decision As a result, it is possible to flexibly change the quantitative decision process and enrich the decision result.
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步 骤可以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机 可读取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤, 而前述的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程 序代码的介质。  A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The steps of the foregoing method embodiments are included, and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
非对其限制; 尽管参照前述实施例对本发明实施例进行了详细的说明, 本领 域的普通技术人员应当理解: 其依然可以对前述各实施例所记载的技术方案 进行修改, 或者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技术方案的本质脱离本发明实施例各实施例技术方案的精神和范 围。 It is not limited thereto; although the embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or some of the technologies. The features are equivalent to the equivalents of the technical solutions of the embodiments of the embodiments of the present invention.

Claims

权 利 要 求 Rights request
1、 一种量化模式编码方法, 其特征在于包括:  A quantization mode coding method, comprising:
根据当前编码块的量化模式, 得到量化模式码流值;  Obtaining a quantized mode code stream value according to a quantization mode of the current coding block;
将所述量化模式码流值写到图像码流中。  The quantized mode code stream value is written into the image code stream.
2、 根据权利要求 1 所述的量化模式编码方法, 其特征在于, 所述根据 当前编码块的量化模式, 得到量化模式码流值包括: 将当前编码块的量化模 式结果或当前编码块的量化模式经过函数关系变换后的结果作为量化模式码 流值。  The quantization mode encoding method according to claim 1, wherein the obtaining the quantized mode stream value according to the quantization mode of the current coding block comprises: quantizing the quantization mode result of the current coding block or quantifying the current coding block The result of the mode transformation by the function relationship is used as the quantization mode code stream value.
3、 根据权利要求 1 所述的量化模式编码方法, 其特征在于, 所述根据 当前编码块的量化模式, 得到量化模式码流值包括: 将当前编码块的量化模 式结果或当前编码块的量化模式经过函数关系变换后的结果进行编码, 得到 量化模式码流值。  The quantization mode coding method according to claim 1, wherein the obtaining the quantization mode code stream value according to the quantization mode of the current coding block comprises: quantizing the result of the quantization mode of the current coding block or quantifying the current coding block The pattern is encoded by the result of the function relationship transformation to obtain a quantized mode code stream value.
4、 根据权利要求 3所述的量化模式编码方法, 其特征在于, 所述进行 编码包括: 按照熵编码方法进行编码。  The quantization mode encoding method according to claim 3, wherein the performing the encoding comprises: performing encoding according to an entropy encoding method.
5、 根据权利要求 4所述的量化模式编码方法, 其特征在于, 所述熵编 码方法包括: 索引编码、 定长编码、 游程编码、 变长编码、 算术编码或上述 方法的任一组合。  The quantization mode encoding method according to claim 4, wherein the entropy encoding method comprises: index coding, fixed length coding, run length coding, variable length coding, arithmetic coding, or any combination of the above methods.
6、 根据权利要求 1-5任一所述的量化模式编码方法, 其特征在于, 所 述将量化模式码流值写到图像码流中包括: 将量化模式码流值写到图像中当 前编码的宏块码流或当前编码的宏块所包含的子块码流或当前图像的辅助增 强信息消息码流中。  The quantization mode encoding method according to any one of claims 1-5, wherein the writing the quantized mode code stream value to the image code stream comprises: writing the quantized mode code stream value to the current encoding in the image The macroblock code stream or the sub-block code stream included in the currently coded macroblock or the auxiliary enhanced information message stream of the current picture.
7、 根据权利要求 1-5任一所述的量化模式编码方法, 其特征在于, 所 述将量化模式码流值写到图像码流中包括: 将量化模式码流值按照当前编码 块在图像中的排列位置组合成一个量化模式图像并编码, 写到图像码流中。  The quantization mode encoding method according to any one of claims 1-5, wherein the writing the quantized mode code stream value to the image code stream comprises: dividing the quantized mode code stream value according to the current coding block in the image The arrangement positions in the group are combined into a quantized mode image and encoded and written into the image code stream.
8、 一种量化模式解码方法, 其特征在于包括:  8. A quantization mode decoding method, comprising:
从图像码流中获取当前解码块的量化模式码流值; 根据所述量化模式码流值, 得到当前解码块的量化模式。 Obtaining a quantization mode code stream value of the current decoded block from the image code stream; A quantization mode of the current decoded block is obtained according to the quantized mode code stream value.
9、 根据权利要求 8所述的量化模式解码方法, 其特征在于, 从图像码 流中获取当前解码块的量化模式码流值包括: 从图像宏块码流中或图像宏块 包含的子块码流或图像的辅助增强信息消息码流中获取当前解码块的量化模 式码流值。  The quantization mode decoding method according to claim 8, wherein the obtaining the quantized mode stream value of the current decoded block from the image code stream comprises: sub-blocks included in the image macroblock code stream or the image macroblock The quantized mode code stream value of the current decoded block is obtained from the code stream or the auxiliary enhanced information message code stream of the image.
10、 根据权利要求 8所述的量化模式解码方法, 其特征在于,从图像码 流中获取当前解码块的量化模式码流值包括: 从图像码流中获取当前图像的 量化模式图像并解码, 且按照当前解码块在图像中的排列位置确定当前解码 块的量化模式码流值。  The method for decoding a quantization mode according to claim 8, wherein the obtaining the quantized mode stream value of the current decoded block from the image code stream comprises: acquiring a quantized mode image of the current image from the image code stream and decoding, And determining a quantization mode code stream value of the current decoded block according to an arrangement position of the current decoded block in the image.
11、 根据权利要求 8 - 10任一所述的量化模式解码方法, 其特征在于, 所述根据所述量化模式码流值, 得到当前解码块的量化模式包括: 将所述量 化模式码流值或量化模式码流值经过函数关系反变换后的结果作为当前解码 块的量化模式。  The quantization mode decoding method according to any one of claims 8 to 10, wherein the obtaining, according to the quantization mode code stream value, the quantization mode of the current decoded block comprises: using the quantization mode code stream value Or the result of the inverse transform of the quantized mode code stream value by the function relationship is used as the quantization mode of the current decoded block.
12、 根据权利要求 8 - 10任一所述的量化模式解码方法, 其特征在于, 所述根据所述量化模式码流值, 得到当前解码块的量化模式包括: 将所述量 化模式码流值进行解码或者将量化模式码流值进行解码及函数关系反变换 后, 得到当前解码块的量化模式。  The quantization mode decoding method according to any one of claims 8 to 10, wherein the obtaining a quantization mode of the current decoding block according to the quantization mode code stream value comprises: using the quantization mode code stream value After decoding or decoding the quantized mode code stream value and inversely transforming the function relationship, the quantization mode of the current decoded block is obtained.
1 3、 根据权利要求 12所述的量化模式解码方法, 其特征在于, 所述进 行解码包括: 按照熵解码方法进行解码。  The quantization mode decoding method according to claim 12, wherein the performing decoding comprises: performing decoding according to an entropy decoding method.
14、 根据权利要求 1 3所述的量化模式解码方法, 其特征在于, 所述熵 解码方法包括: 索引、 定长码解码、 游程码解码、 变长码解码、 算术解码或 上述方法的任一组合。  The quantization mode decoding method according to claim 13, wherein the entropy decoding method comprises: an index, a fixed length code decoding, a run length code decoding, a variable length code decoding, an arithmetic decoding, or any of the foregoing methods. combination.
15、 一种量化模式编码器, 其特征在于包括:  15. A quantization mode encoder, comprising:
量化模式编码模块, 用于根据当前编码块的量化模式, 得到量化模式码 流值;  a quantization mode coding module, configured to obtain a quantized mode code stream value according to a quantization mode of the current coding block;
图像码流插入模块, 用于将所述量化模式码流值写到图像码流中。 And an image stream insertion module, configured to write the quantized mode code stream value into the image code stream.
16、 根据权利要求 15所述的量化模式编码器, 其特征在于, 所述量化 模式编码模块包括第一量化模式编码模块, 用于将当前编码块的量化模式结 果或当前编码块的量化模式经过函数关系变换后的结果作为量化模式码流 值。 The quantization mode coder according to claim 15, wherein the quantization mode coding module comprises a first quantization mode coding module, configured to: pass a quantization mode result of a current coding block or a quantization mode of a current coding block The result of the function relationship transformation is used as the quantization mode code stream value.
17、 根据权利要求 15所述的量化模式编码器, 其特征在于, 所述量化 模式编码模块包括第二量化模式编码模块, 用于将当前编码块的量化模式结 果或当前编码块的量化模式经过函数关系变换后的结果进行编码, 得到量化 模式码流值。  The quantization mode coder according to claim 15, wherein the quantization mode coding module comprises a second quantization mode coding module, configured to: pass a quantization mode result of a current coding block or a quantization mode of a current coding block The result of the function relationship transformation is encoded to obtain a quantized mode code stream value.
18、 根据权利要求 17所述的量化模式编码器, 其特征在于, 所述第二 量化模式编码模块包括量化模式熵编码模块, 用于将当前编码块的量化模式 结果或当前编码块的量化模式经过函数关系变换后的结果进行熵编码, 得到 量化模式码流值。  The quantization mode encoder according to claim 17, wherein the second quantization mode encoding module comprises a quantization mode entropy encoding module, configured to use a quantization mode result of a current coding block or a quantization mode of a current coding block. The result of the function relationship transformation is entropy encoded to obtain a quantized mode code stream value.
19、 根据权利要求 15 - 18任一所述的量化模式编码器, 其特征在于, 所述图像码流插入模块包括:  The quantization mode encoder according to any one of claims 15 to 18, wherein the image code stream insertion module comprises:
图像宏块码流插入模块, 用于将量化模式码流值写到图像中当前编码的 宏块码流中;  An image macroblock code stream insertion module, configured to write the quantized mode code stream value into a currently coded macroblock code stream in the image;
或, 图像宏块子块码流插入模块, 用于将量化模式码流值写到图像中当 前编码的宏块所包含的子块码流中;  Or an image macroblock sub-block code stream insertion module, configured to write the quantized mode code stream value into a sub-block code stream included in a currently coded macroblock in the image;
或, 图像辅助增强信息消息码流插入模块, 用于将量化模式码流值写到 图像的辅助增强信息消息码流中。  Or, the image assisted enhancement information message stream insertion module is configured to write the quantized mode code stream value into the auxiliary enhanced information message code stream of the image.
20、 根据权利要求 15 - 18任一所述的量化模式编码器, 其特征在于, 所述图像码流插入模块包括:  The quantization mode encoder according to any one of claims 15 to 18, wherein the image code stream insertion module comprises:
量化模式图像编码单元, 用于将量化模式码流值按照当前编码块在图像 中的排列位置组合成一个量化模式图像并编码;  a quantization mode image encoding unit, configured to combine the quantized mode code stream values into a quantization mode image according to an arrangement position of the current coding block in the image and encode the image;
插入单元, 用于将编码后的量化模式图像写到图像码流中。  An insertion unit, configured to write the encoded quantized mode image into the image code stream.
21、 一种量化模式解码器, 其特征在于包括: 量化模式码流获取模块, 用于从图像码流中获取当前解码块的量化模式 码流值; 21. A quantization mode decoder, comprising: a quantization mode code stream obtaining module, configured to obtain, from the image code stream, a quantized mode code stream value of the current decoded block;
量化模式解码模块, 用于根据所述量化模式码流值, 得到当前解码块的 量化模式。  And a quantization mode decoding module, configured to obtain, according to the quantized mode code stream value, a quantization mode of the current decoded block.
22、 根据权利要求 21所述的量化模式解码器, 其特征在于, 所述量化 模式码流获取模块包括:  The quantization mode decoder according to claim 21, wherein the quantization mode code stream acquisition module comprises:
量化模式宏块码流获取模块, 用于从图像宏块码流中获取当前解码块的 量化模式码流值;  a quantization mode macroblock code stream obtaining module, configured to obtain, from an image macroblock code stream, a quantization mode code stream value of a current decoding block;
或, 量化模式宏块子块码流获取模块, 用于从图像宏块包含的子块码流 中获取当前解码块的量化模式码流值;  Or a quantization mode macroblock sub-block code stream obtaining module, configured to obtain, from a sub-block code stream included in the image macroblock, a quantization mode code stream value of the current decoding block;
或, 量化模式图像辅助增强信息消息码流获取模块, 用于从图像的辅助 增强信息消息码流中获取当前图像编码块的量化模式码流值。  Or, the quantization mode image-assisted enhanced information message code stream obtaining module is configured to obtain a quantization mode code stream value of the current image coding block from the auxiliary enhancement information message code stream of the image.
23、 根据权利要求 21所述的量化模式解码器, 其特征在于, 所述量化 模式码流获取模块具体包括:  The quantization mode decoder according to claim 21, wherein the quantization mode code stream acquisition module specifically includes:
量化模式图像解码单元, 用于从图像码流中获取当前图像的量化模式图 像并解码;  a quantization mode image decoding unit, configured to acquire a quantization mode image of the current image from the image code stream and decode the image;
确定单元, 用于按照当前解码块在图像中的排列位置确定当前解码块的 量化模式码流值。  And a determining unit, configured to determine a quantization mode code stream value of the current decoded block according to an arrangement position of the current decoded block in the image.
24、 根据权利要求 21-23任一所述的量化模式解码器, 其特征在于, 所 述量化模式解码模块包括第一量化模式解码模块, 用于将所述量化模式码流 值或量化模式码流值经过函数关系反变换后的结果作为当前解码块的量化模 式。  The quantization mode decoder according to any one of claims 21 to 23, wherein the quantization mode decoding module includes a first quantization mode decoding module, configured to use the quantization mode code stream value or the quantization mode code. The result of the inverse transformation of the stream value through the function relationship is used as the quantization mode of the current decoded block.
25、 根据权利要求 21-23任一所述的量化模式解码器, 其特征在于, 所 述量化模式解码模块包括第二量化模式解码模块, 用于将所述量化模式码流 值进行解码或者将量化模式码流值进行解码及函数关系反变换后, 得到当前 解码块的量化模式。 The quantization mode decoder according to any one of claims 21 to 23, wherein the quantization mode decoding module includes a second quantization mode decoding module, configured to decode the quantized mode code stream value or After the quantization mode code stream value is decoded and the function relationship is inversely transformed, the quantization mode of the current decoded block is obtained.
26、 根据权利要求 25所述的量化模式解码器, 其特征在于, 所述第二 量化模式解码模块包括量化模式熵解码模块, 用于将所述量化模式码流值进 行熵解码或者将量化模式码流值进行熵解码及函数关系反变换后, 得到当前 解码块的量化模式。 The quantization mode decoder according to claim 25, wherein the second quantization mode decoding module comprises a quantization mode entropy decoding module, configured to entropy decode the quantization mode code stream value or to perform a quantization mode After the code stream value is subjected to entropy decoding and inverse function transformation, the quantization mode of the current decoded block is obtained.
27、 一种量化模式编解码系统, 其特征在于包括: 量化模式编码器和量 化模式解码器;  27. A quantization mode codec system, comprising: a quantization mode encoder and a quantization mode decoder;
量化模式编码器包括:  The quantization mode encoder includes:
量化模式编码模块, 用于根据当前编码块的量化模式, 得到量化模式码 流值;  a quantization mode coding module, configured to obtain a quantized mode code stream value according to a quantization mode of the current coding block;
图像码流插入模块, 用于将所述量化模式码流值写到图像码流中; 量化模式解码器包括:  An image code stream insertion module, configured to write the quantized mode code stream value into the image code stream; the quantization mode decoder includes:
量化模式码流获取模块, 用于从图像码流中获取当前解码块的量化模式 码流值;  a quantization mode code stream obtaining module, configured to obtain, from the image code stream, a quantized mode code stream value of the current decoded block;
量化模式解码模块, 用于根据所述量化模式码流值, 得到当前解码块的 量化模式。  And a quantization mode decoding module, configured to obtain, according to the quantized mode code stream value, a quantization mode of the current decoded block.
28、 一种图像编码方法, 其特征在于包括:  28. An image encoding method, comprising:
确定输入图像中当前编码块的量化模式;  Determining a quantization mode of a current coded block in the input image;
根据所述量化模式对当前编码块进行缩放或量化处理, 得到量化后的当 前编码块数据;  Performing scaling or quantization processing on the current coding block according to the quantization mode, to obtain quantized current coding block data;
根据当前编码块的量化模式, 得到量化模式码流值;  Obtaining a quantized mode code stream value according to a quantization mode of the current coding block;
将量化后的当前编码块数据编码得到图像码流, 并将所述量化模式码流 值写到所述图像码流中。  The quantized current coded block data is encoded to obtain an image code stream, and the quantized mode code stream value is written into the image code stream.
29、 根据权利要求 28所述的图像编码方法, 其特征在于, 所述确定输 入图像中当前编码块的量化模式包括: 根据当前编码块的邻近块编码信息、 外部输入的量化模式决策方法、 外部输入的量化模式或所述当前编码块的邻 近块编码信息、 所述外部输入的量化模式决策方法、 所述外部输入的量化模 式三者的任意组合, 得到所述当前编码块的量化模式。 The image encoding method according to claim 28, wherein the determining a quantization mode of the current coding block in the input image comprises: a neighboring block coding information according to a current coding block, an externally input quantization mode decision method, and an external Input quantization mode or adjacent block coding information of the current coding block, quantization mode decision method of the external input, quantization mode of the external input Arbitrary combination of the three, the quantization mode of the current coding block is obtained.
30、 根据权利要求 29所述的图像编码方法, 其特征在于, 确定当前编 码块的量化模式的方法中所述外部输入的量化模式的优先级最高, 所述外部 输入的量化模式决策方法的优先级次之, 所述根据当前编码块的邻近块编码 信息决策的方法优先级最低; 在确定当前编码块的量化模式时, 优先级高的 决策方法确定的量化模式取代优先级低的决策方法确定的量化模式。  The image encoding method according to claim 29, wherein the method of determining the quantization mode of the current coding block has the highest priority of the externally input quantization mode, and the external input quantization mode decision method has priority Secondly, the method for deciding according to the neighboring block coding information of the current coding block has the lowest priority; when determining the quantization mode of the current coding block, the quantization mode determined by the high priority decision method replaces the decision method with low priority Quantization mode.
31、 根据权利要求 28所述的图像编码方法, 其特征在于, 所述根据当 前编码块的量化模式, 得到量化模式码流值包括: 将当前编码块的量化模式 结果或当前编码块的量化模式经过函数关系变换后的结果作为量化模式码流 值。  The image encoding method according to claim 28, wherein the obtaining the quantized mode stream value according to the quantization mode of the current coding block comprises: determining a quantization mode result of the current coding block or a quantization mode of the current coding block The result of the function relationship transformation is used as the quantization mode code stream value.
32、 根据权利要求 28所述的图像编码方法, 其特征在于, 所述根据当 前编码块的量化模式, 得到量化模式码流值包括: 将当前编码块的量化模式 结果或当前编码块的量化模式经过函数关系变换后的结果进行编码, 得到量 化模式码流值。  The image encoding method according to claim 28, wherein the obtaining the quantized mode stream value according to the quantization mode of the current coding block comprises: determining a quantization mode result of the current coding block or a quantization mode of the current coding block The result of the function relationship transformation is encoded to obtain a quantized mode code stream value.
33、 根据权利要求 32所述的图像编码方法, 其特征在于, 所述进行编 码包括: 按照熵编码方法进行编码。  The image encoding method according to claim 32, wherein the performing the encoding comprises: encoding according to an entropy encoding method.
34、 根据权利要求 33所述的图像编码方法, 其特征在于, 所述熵编码 方法包括: 索引编码、 定长编码、 游程编码、 变长编码、 算术编码或上述方 法的任一组合。  The image encoding method according to claim 33, wherein the entropy encoding method comprises: index encoding, fixed length encoding, run length encoding, variable length encoding, arithmetic encoding, or any combination of the above methods.
35、 根据权利要求 28-34任一所述的图像编码方法, 其特征在于, 所述 将量化模式码流值写到图像码流中包括: 将量化模式码流值写到图像中当前 编码的宏块码流或当前编码的宏块所包含的子块码流中, 或者当前图像的辅 助增强信息消息码流中。  The image encoding method according to any one of claims 28 to 34, wherein the writing the quantized mode code stream value to the image code stream comprises: writing the quantized mode code stream value to the current coded image in the image The macroblock code stream or the sub-block code stream included in the currently coded macroblock, or the auxiliary enhanced information message stream of the current picture.
36、 根据权利要求 28-34任一所述的图像编码方法, 其特征在于, 所述 将量化模式码流值写到图像码流中包括: 将量化模式码流值按照当前编码块 在图像中的排列位置组合成一个量化模式图像并编码, 写到图像码流中。 The image encoding method according to any one of claims 28 to 34, wherein the writing the quantized mode code stream value to the image code stream comprises: dividing the quantized mode code stream value into the image according to the current coding block. The arrangement positions are combined into a quantized mode image and encoded and written into the image code stream.
37、 一种图像解码方法, 其特征在于包括: 37. An image decoding method, comprising:
从图像码流中解析得到当前解码块数据及其对应量化模式码流值; 根据所述量化模式码流值, 得到当前解码块的量化模式;  And parsing the current decoded block data and the corresponding quantized mode code stream value from the image code stream; and obtaining a quantization mode of the current decoded block according to the quantized mode code stream value;
用所述量化模式对当前解码块数据进行逆缩放或反量化处理, 得到解量 化后的当前解码块数据;  Performing inverse scaling or inverse quantization processing on the current decoded block data by using the quantization mode to obtain the dequantized current decoded block data;
根据所述解量化后的当前解码块数据, 获得解码图像。  A decoded image is obtained based on the dequantized current decoded block data.
38、 根据权利要求 37所述的图像解码方法, 其特征在于, 所述从图像 码流中解析得到当前解码块数据对应量化模式码流值包括: 从图像宏块码流 中或图像宏块包含的子块码流或者图像的辅助增强信息消息码流中解析得到 当前解码块数据对应量化模式码流值。  The image decoding method according to claim 37, wherein the parsing the current decoded block data corresponding to the quantized mode code stream value from the image code stream comprises: including from the image macroblock code stream or the image macroblock The sub-block code stream or the auxiliary enhancement information message stream of the image is parsed to obtain a quantization mode code stream value corresponding to the current decoded block data.
39、 根据权利要求 37所述的图像解码方法, 其特征在于, 所述从图像 码流中解析得到当前解码块数据对应量化模式码流值包括: 从图像码流中解 析得到当前图像的量化模式图像并解码, 且按照当前解码块在图像中的排列 位置确定当前解码块数据对应量化模式码流值。  The image decoding method according to claim 37, wherein the parsing the current decoded block data corresponding to the quantized mode code stream value from the image code stream comprises: parsing the quantization mode of the current image from the image code stream The image is decoded and the current decoded block data corresponding to the quantized mode code stream value is determined according to the arrangement position of the current decoded block in the image.
40、 根据权利要求 37 - 39任一所述的图像解码方法, 其特征在于, 所 述根据所述量化模式码流值, 得到当前解码块的量化模式包括: 将所述量化 模式码流值或量化模式码流值经过函数关系反变换后的结果作为当前解码块 的量化模式。  The image decoding method according to any one of claims 37 to 39, wherein the obtaining a quantization mode of the current decoded block according to the quantized mode code stream value comprises: using the quantization mode code stream value or The quantized mode code stream value is inversely transformed by the function relationship as the quantization mode of the current decoded block.
41、 根据权利要求 37 - 39任一所述的图像解码方法, 其特征在于, 所 述根据所述量化模式码流值, 得到当前解码块的量化模式包括: 将所述量化 模式码流值进行解码或者将量化模式码流值进行解码及函数关系反变换后, 得到当前解码块的量化模式。  The image decoding method according to any one of claims 37 to 39, wherein the obtaining a quantization mode of the current decoded block according to the quantization mode code stream value comprises: performing the quantization mode code stream value After decoding or decoding the quantized mode code stream value and inversely transforming the function relationship, the quantization mode of the current decoded block is obtained.
42、 根据权利要求 41所述的图像解码方法, 其特征在于, 所述进行解 码包括: 按照熵解码方法进行解码。  The image decoding method according to claim 41, wherein the performing decoding comprises: performing decoding according to an entropy decoding method.
43、 根据权利要求 42所述的图像解码方法, 其特征在于, 所述熵解码 方法包括: 索引、 定长码解码、 游程码解码、 变长码解码、 算术解码或上述 方法的任一组合。 43. The image decoding method according to claim 42, wherein the entropy decoding method comprises: an index, a fixed length code decoding, a run length code decoding, a variable length code decoding, an arithmetic decoding, or the like. Any combination of methods.
44、 一种图像编码器, 其特征在于包括:  44. An image encoder, comprising:
量化模式决策模块, 用于确定输入图像中当前编码块的量化模式; 缩放或量化处理模块, 用于根据所述量化模式对当前编码块进行缩放或 量化处理, 得到量化后的当前编码块数据;  a quantization mode decision module, configured to determine a quantization mode of a current coding block in the input image; a scaling or quantization processing module, configured to perform scaling or quantization processing on the current coding block according to the quantization mode, to obtain quantized current coding block data;
量化模式编码模块, 用于根据当前编码块的量化模式, 得到量化模式码 流值;  a quantization mode coding module, configured to obtain a quantized mode code stream value according to a quantization mode of the current coding block;
图像编码模块, 用于将量化后的当前编码块数据编码得到图像码流; 图像码流插入模块, 用于将所述量化模式码流值写到所述图像码流中。  And an image coding module, configured to encode the quantized current coded block data to obtain an image code stream; and the image code stream insertion module is configured to write the quantized mode code stream value into the image code stream.
45、 根据权利要求 44所述的图像编码器, 其特征在于, 所述量化模式 决策模块包括基于邻近块决策模块,用于根据当前编码块的邻近块编码信息, 决策所述当前编码块的量化模式。 The image encoder according to claim 44, wherein the quantization mode decision module comprises a neighboring block decision module, configured to determine a quantization of the current coded block according to neighboring block coding information of a current coding block. mode.
46、 根据权利要求 44所述的图像编码器, 其特征在于, 所述量化模式 决策模块包括外部决策模块, 用于根据外部输入的量化模式决策方法或量化 模式, 决策所述当前编码块的量化模式。  The image encoder according to claim 44, wherein the quantization mode decision module comprises an external decision module, configured to determine the quantization of the current coding block according to an externally input quantization mode decision method or a quantization mode. mode.
47、 根据权利要求 44所述的图像编码器, 其特征在于, 所述量化模式 决策模块包括:  The image encoder according to claim 44, wherein the quantization mode decision module comprises:
基于邻近块决策模块, 用于根据当前编码块的邻近块编码信息, 决策当 前编码块的第一级量化模式;  And determining, according to the neighboring block decision module, a first-level quantization mode of the current coding block according to the neighboring block coding information of the current coding block;
外部决策模块, 用于根据外部输入的量化模式决策方法或量化模式, 决 策当前编码块的第二级量化模式或第三级量化模式;  An external decision module, configured to determine a second-level quantization mode or a third-level quantization mode of the current coding block according to an externally input quantization mode decision method or a quantization mode;
综合决策模块, 用于根据当前编码块的第一级量化模式、 第二级量化模 式、 第三级量化模式决策所述当前编码块的量化模式。  And an integrated decision module, configured to determine, according to the first-level quantization mode, the second-level quantization mode, and the third-level quantization mode of the current coding block, the quantization mode of the current coding block.
48、 根据权利要求 44-47任一所述的图像编码器, 其特征在于, 所述量 化模式编码模块包括第一量化模式编码模块, 用于将当前编码块的量化模式 结果或当前编码块的量化模式经过函数关系变换后的结果作为量化模式码流 值。 The image encoder according to any one of claims 44 to 47, wherein the quantization mode encoding module comprises a first quantization mode encoding module, configured to use a quantization mode result of the current coding block or a current coding block. The quantization mode is transformed by the function relationship as the quantization mode code stream Value.
49、 根据权利要求 44-47任一所述的图像编码器, 其特征在于, 所述量 化模式编码模块包括第二量化模式编码模块, 用于将当前编码块的量化模式 结果或当前编码块的量化模式经过函数关系变换后的结果进行编码, 得到量 化模式码流值。  The image encoder according to any one of claims 44 to 47, wherein the quantization mode encoding module comprises a second quantization mode encoding module, configured to use a quantization mode result of the current coding block or a current coding block. The quantization mode is encoded by the result of the function relationship transformation to obtain a quantized mode code stream value.
50、 根据权利要求 49所述的图像编码器, 其特征在于, 所述第二量化 模式编码模块包括量化模式熵编码模块, 用于将当前编码块的量化模式结果 或当前编码块的量化模式经过函数关系变换后的结果进行熵编码, 得到量化 模式码流值。  The image encoder according to claim 49, wherein the second quantization mode encoding module comprises a quantization mode entropy encoding module, configured to pass a quantization mode result of a current coding block or a quantization mode of a current coding block. The result of the function relationship transformation is entropy encoded to obtain a quantized mode code stream value.
51、 根据权利要求 44-47任一所述的图像编码器, 其特征在于, 所述图 像码流插入模块包括:  The image encoder according to any one of claims 44 to 47, wherein the image stream insertion module comprises:
图像宏块码流插入模块, 用于将量化模式码流值写到图像中当前编码的 宏块码流中;  An image macroblock code stream insertion module, configured to write the quantized mode code stream value into a currently coded macroblock code stream in the image;
或, 图像宏块子块码流插入模块, 用于将量化模式码流值写到图像中当 前编码的宏块所包含的子块码流中;  Or an image macroblock sub-block code stream insertion module, configured to write the quantized mode code stream value into a sub-block code stream included in a currently coded macroblock in the image;
或, 图像辅助增强信息消息码流插入模块, 用于将量化模式的码流值写 到图像的辅助增强信息消息码流中。  Or, the image assisted enhancement information message stream insertion module is configured to write the code stream value of the quantization mode into the auxiliary enhanced information message code stream of the image.
52、 根据权利要求 44-47任一所述的图像编码器, 其特征在于, 所述图 像码流插入模块包括:  The image encoder according to any one of claims 44 to 47, wherein the image stream insertion module comprises:
量化模式图像编码单元, 用于将量化模式码流值按照当前编码块在图像 中的排列位置组合成一个量化模式图像并编码;  a quantization mode image encoding unit, configured to combine the quantized mode code stream values into a quantization mode image according to an arrangement position of the current coding block in the image and encode the image;
插入单元, 用于将编码后的量化模式图像写到图像码流中。  An insertion unit, configured to write the encoded quantized mode image into the image code stream.
53、 一种图像解码器, 其特征在于包括:  53. An image decoder, comprising:
解析模块, 用于从图像码流中解析得到当前解码块数据;  a parsing module, configured to parse the current decoded block data from the image code stream;
量化模式码流获取模块, 用于从图像码流中获取当前解码块的量化模式 码流值; 量化模式解码模块, 用于根据所述量化模式码流值, 得到当前解码块的 量化模式; a quantization mode code stream obtaining module, configured to obtain, from the image code stream, a quantized mode code stream value of the current decoded block; a quantization mode decoding module, configured to obtain, according to the quantized mode code stream value, a quantization mode of a current decoded block;
逆缩放或反量化模块, 用于釆用所述量化模式对当前解码块数据进行逆 缩放或反量化处理, 得到解量化后的当前解码块数据;  An inverse scaling or inverse quantization module, configured to perform inverse scaling or inverse quantization processing on the current decoded block data by using the quantization mode to obtain dequantized current decoded block data;
解码图像生成模块, 用于根据所述解量化后的当前解码块数据, 获得解 码图像。  And a decoded image generating module, configured to obtain a decoded image according to the dequantized current decoded block data.
54、 根据权利要求 53所述的图像解码器, 其特征在于, 所述量化模式 码流获取模块包括: 量化模式宏块或子块码流获取模块, 用于从图像宏块码 流中或图像宏块包含的子块码流中获取当前解码块的量化模式码流值; 或, 量化模式图像辅助增强信息消息码流获取模块, 用于从图像的辅助增强信息 消息码流中获取当前图像解码块的量化模式码流值。  The image decoder according to claim 53, wherein the quantization mode code stream acquisition module comprises: a quantization mode macroblock or a sub-block code stream acquisition module, configured to be used in an image macroblock stream or an image. Obtaining a quantized mode code stream value of the current decoded block in the sub-block code stream included in the macro block; or, a quantization mode image-assisted enhanced information message code stream obtaining module, configured to obtain a current image decoding from the auxiliary enhanced information message code stream of the image The quantization mode code stream value of the block.
55、 根据权利要求 53所述的图像解码器, 其特征在于, 所述量化模式 码流获取模块具体包括:  The image decoder according to claim 53, wherein the quantization mode code stream acquisition module specifically includes:
量化模式图像解码单元, 用于从图像码流中获取当前图像的量化模式图 像并解码;  a quantization mode image decoding unit, configured to acquire a quantization mode image of the current image from the image code stream and decode the image;
确定单元, 用于按照当前解码块在图像中的排列位置确定当前解码块的 量化模式码流值。  And a determining unit, configured to determine a quantization mode code stream value of the current decoded block according to an arrangement position of the current decoded block in the image.
56、 根据权利要求 53-55任一所述的图像解码器, 其特征在于, 所述量 化模式解码模块包括第一量化模式解码模块, 用于将所述量化模式码流值或 量化模式码流值经过函数关系反变换后的结果作为当前解码块的量化模式。  The image decoder according to any one of claims 53-55, wherein the quantization mode decoding module comprises a first quantization mode decoding module, configured to use the quantization mode code stream value or the quantization mode code stream. The result of the inverse transformation of the value is used as the quantization mode of the current decoded block.
57、 根据权利要求 53-55任一所述的图像解码器, 其特征在于, 所述量 化模式解码模块包括第二量化模式解码模块, 用于将所述量化模式码流值进 行解码或者将量化模式码流值进行解码及函数关系反变换后, 得到当前解码 块的量化模式。  The image decoder according to any one of claims 53-55, wherein the quantization mode decoding module comprises a second quantization mode decoding module, configured to decode or quantize the quantized mode code stream value. After the mode code stream value is decoded and the function relationship is inversely transformed, the quantization mode of the current decoded block is obtained.
58、 根据权利要求 57所述的图像解码器, 其特征在于, 所述第二量化 模式解码模块包括量化模式熵解码模块, 用于将所述量化模式码流值进行熵 解码或者将量化模式码流值进行熵解码及函数关系反变换后, 得到当前解码 块的量化模式。 The image decoder according to claim 57, wherein the second quantization mode decoding module comprises a quantization mode entropy decoding module, configured to entropy the quantized mode code stream value After decoding or entropy decoding the quantized mode stream value and inversely transforming the function relationship, a quantization mode of the current decoded block is obtained.
59、 一种图像编解码系统,其特征在于包括:图像编码器和图像解码器; 所述图像编码器包括:  59. An image coding and decoding system, comprising: an image encoder and an image decoder; the image encoder includes:
量化模式决策模块, 用于确定输入图像中当前编码块的量化模式; 缩放或量化处理模块, 用于根据所述量化模式对当前编码块进行缩放或 量化处理, 得到量化后的当前编码块数据;  a quantization mode decision module, configured to determine a quantization mode of a current coding block in the input image; a scaling or quantization processing module, configured to perform scaling or quantization processing on the current coding block according to the quantization mode, to obtain quantized current coding block data;
量化模式编码模块, 用于根据当前编码块的量化模式, 得到量化模式码 流值;  a quantization mode coding module, configured to obtain a quantized mode code stream value according to a quantization mode of the current coding block;
图像编码模块, 用于将量化后的当前编码块数据编码得到图像码流; 图像码流插入模块, 用于将所述量化模式码流值写到所述图像码流中; 所述图像解码器包括:  An image coding module, configured to encode the quantized current coded block data to obtain an image code stream; and an image code stream insertion module, configured to write the quantized mode code stream value into the image code stream; the image decoder Includes:
解析模块, 用于从图像码流中解析得到当前解码块数据;  a parsing module, configured to parse the current decoded block data from the image code stream;
量化模式码流获取模块, 用于从图像码流中获取当前解码块的量化模式 码流值;  a quantization mode code stream obtaining module, configured to obtain, from the image code stream, a quantized mode code stream value of the current decoded block;
量化模式解码模块, 用于根据所述量化模式码流值, 得到当前解码块的 量化模式;  a quantization mode decoding module, configured to obtain, according to the quantized mode code stream value, a quantization mode of a current decoded block;
逆缩放或反量化模块, 用于釆用所述量化模式对当前解码块数据进行逆 缩放或反量化处理, 得到解量化后的当前解码块数据;  An inverse scaling or inverse quantization module, configured to perform inverse scaling or inverse quantization processing on the current decoded block data by using the quantization mode to obtain dequantized current decoded block data;
解码图像生成模块, 用于根据所述解量化后的当前解码块数据, 获得解 码图像。  And a decoded image generating module, configured to obtain a decoded image according to the dequantized current decoded block data.
PCT/CN2008/073338 2007-12-04 2008-12-04 A quantization mode and an encoding and decoding method, an encoder and a decoder and a codec system WO2009086766A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200710193851.2 2007-12-04
CN 200710193851 CN101453643B (en) 2007-12-04 2007-12-04 Quantitative mode, image encoding, decoding method, encoder, decoder and system

Publications (1)

Publication Number Publication Date
WO2009086766A1 true WO2009086766A1 (en) 2009-07-16

Family

ID=40735621

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2008/073338 WO2009086766A1 (en) 2007-12-04 2008-12-04 A quantization mode and an encoding and decoding method, an encoder and a decoder and a codec system

Country Status (2)

Country Link
CN (1) CN101453643B (en)
WO (1) WO2009086766A1 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685478B (en) 2011-03-11 2015-04-29 华为技术有限公司 Encoding method and device, and decoding method and device
CN102685485B (en) * 2011-03-11 2014-11-05 华为技术有限公司 Coding method and device, and decoding method and device
KR101527445B1 (en) * 2012-04-16 2015-06-11 한국전자통신연구원 Method and apparatus for image encoding/decoding
WO2017052174A1 (en) * 2015-09-21 2017-03-30 엘지전자(주) Method and apparatus for processing video signals using coefficient derivation prediction
CN113411579B (en) * 2016-05-13 2024-01-23 夏普株式会社 Image decoding device and method, image encoding device and method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6473875A (en) * 1987-09-16 1989-03-20 Japan Broadcasting Corp Method and device for coding image data
CN1102030A (en) * 1993-04-13 1995-04-26 三星电子株式会社 Method of and apparatus for coding in which quantizing degree can be changed according to character of energy of frequency zone
US5870435A (en) * 1996-12-09 1999-02-09 Electronics And Telecommunications Research Institute Quantization/inverse quantization unit selectably accommodating multiple video encoding standards and including differential pulse code modulator
KR20040062732A (en) * 2003-01-03 2004-07-09 엘지전자 주식회사 Bit rate control system based on object
CN101039432A (en) * 2006-03-16 2007-09-19 华为技术有限公司 Method and apparatus for realizing self-adaptive quantization in coding process

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246689B (en) * 2004-09-17 2011-09-14 广州广晟数码技术有限公司 Audio encoding system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6473875A (en) * 1987-09-16 1989-03-20 Japan Broadcasting Corp Method and device for coding image data
CN1102030A (en) * 1993-04-13 1995-04-26 三星电子株式会社 Method of and apparatus for coding in which quantizing degree can be changed according to character of energy of frequency zone
US5870435A (en) * 1996-12-09 1999-02-09 Electronics And Telecommunications Research Institute Quantization/inverse quantization unit selectably accommodating multiple video encoding standards and including differential pulse code modulator
KR20040062732A (en) * 2003-01-03 2004-07-09 엘지전자 주식회사 Bit rate control system based on object
CN101039432A (en) * 2006-03-16 2007-09-19 华为技术有限公司 Method and apparatus for realizing self-adaptive quantization in coding process

Also Published As

Publication number Publication date
CN101453643B (en) 2011-05-18
CN101453643A (en) 2009-06-10

Similar Documents

Publication Publication Date Title
JP5733590B2 (en) A context modeling technique for encoding transform coefficient levels.
JP6665225B2 (en) Video decoding method and apparatus, video encoding method and apparatus
JP5474546B2 (en) Method and apparatus for reduced resolution segmentation
JP5869493B2 (en) Method and apparatus for adaptive residual update of template matching prediction for video encoding and decoding
TWI615020B (en) Method for video decoding
KR101566105B1 (en) Binarization of dqp using separate absolute value and sign (savs) in cabac
CN107710759B (en) Method and device for coding and decoding conversion coefficient
KR20210063483A (en) Methods and apparatus for video encoding and decoding binary sets using adaptive tree selection
JP2005086830A (en) Bit-stream control post-processing filtering
CN114009015A (en) Transmission encoding technique for converting omitted blocks
CN107040780B (en) The method and apparatus of entropy coding in compression of images
TW202131681A (en) Determining a parametrization for context-adaptive binary arithmetic coding
WO2009086766A1 (en) A quantization mode and an encoding and decoding method, an encoder and a decoder and a codec system
Jiang et al. A CABAC based HEVC video steganography algorithm without bitrate increase
JP2006295796A (en) Image data decoding device and method
KR101739603B1 (en) Method and apparatus for reusing tree structures to encode and decode binary sets
CN116320485A (en) Data compression method and apparatus for selecting one of a plurality of low frequency transform matrix candidate sets
WO2012097250A1 (en) Method and apparatus for arithmetic coding and termination
CN111988618B (en) Decoding and encoding method, decoding end and encoding end
JP2019520001A (en) Method and apparatus for improved importance flag encoding using a simple local predictor
KR20100089546A (en) Method and apparatus for successively encoding/decoding image
AU2020354500B2 (en) Efficient implementation of matrix-based intra-prediction
WO2022178686A1 (en) Encoding/decoding method, encoding/decoding device, encoding/decoding system, and computer readable storage medium
WO2019181354A1 (en) Video encoding device, method and program, and video decoding device, method and program
WO2019181353A1 (en) Video encoding device, method and program, and video decoding device, method and program

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: 08869314

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 08869314

Country of ref document: EP

Kind code of ref document: A1