WO2011069412A1 - 视频编码方法、解码方法、编码及解码装置 - Google Patents

视频编码方法、解码方法、编码及解码装置 Download PDF

Info

Publication number
WO2011069412A1
WO2011069412A1 PCT/CN2010/079117 CN2010079117W WO2011069412A1 WO 2011069412 A1 WO2011069412 A1 WO 2011069412A1 CN 2010079117 W CN2010079117 W CN 2010079117W WO 2011069412 A1 WO2011069412 A1 WO 2011069412A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
sub
double prediction
flag
prediction
Prior art date
Application number
PCT/CN2010/079117
Other languages
English (en)
French (fr)
Inventor
虞露
于彬彬
李尚文
王栋
杨名远
熊联欢
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP10835447.3A priority Critical patent/EP2503783B1/en
Publication of WO2011069412A1 publication Critical patent/WO2011069412A1/zh
Priority to US13/492,498 priority patent/US20120243608A1/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/103Selection of coding mode or of prediction mode
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/46Embedding additional information in the video signal during the compression process

Definitions

  • Video coding method, decoding method, coding and decoding device
  • the present invention relates to the field of video coding and decoding technologies, and in particular, to a video coding method, a decoding method, and an encoding and decoding device. Background technique
  • Video compression techniques are generally based on block-based, traditional hybrid coding (Hybrid Coding) frameworks that combine predictive coding, transform coding, and entropy coding.
  • the predictive coding in the traditional video hybrid coding framework divides the coded frame into coding units, predictively encodes the coding unit, obtains the predicted value, and obtains the difference between the predicted value and the value to be encoded, that is, the residual data, and performs the residual data.
  • Dimension transform coding then transform the transform coefficients in the transform domain, scan and convert them into one-dimensional signals; and finally perform entropy coding.
  • a codec method using double prediction defines a prediction in a traditional hybrid video codec framework as a first re-prediction, and a reconstruction process of the decoded reconstructed image includes a double prediction compensation process and a second re-prediction storage; correspondingly, in a traditional hybrid video codec framework
  • the prediction residual is defined as the first heavy residual
  • the prediction for the first heavy residual is defined as the second re-prediction.
  • the double prediction compensation process includes a first re-prediction compensation process and a second re-prediction compensation process.
  • the input of the second re-prediction compensation process includes the reconstructed first heavy residual and the reconstructed second heavy residual, thereby obtaining the reconstructed residual.
  • the encoding method includes a double prediction process and a second re-prediction storage.
  • the double prediction process includes a first re-prediction process and a second re-prediction process.
  • the input of the second re-prediction process includes the first heavy residual sum
  • the first residual residual is predicted and a second residual is generated therefrom.
  • the first residual residual prediction value is generated by the reconstructed first heavy residual according to the second heavy mode using the prediction method.
  • the corresponding code stream generated by the coding method, including the first weight mode and the second weight residual does not include the first weight residual; or includes the first weight mode, the second weight mode, and the second weight residual, excluding the first Heavy residuals.
  • the unit of action of the double prediction is a macroblock, that is, for a macroblock, all the sub-blocks are either double-predicted or not used. Double prediction, the flexibility of double prediction is poor, and the coding and decoding efficiency is not high. Summary of the invention
  • the embodiment of the invention provides a video encoding method, a decoding method, a coding and decoding device, and the unit of the codec block of the double prediction is identified by refining the double prediction marker symbol to enhance the flexibility of the double prediction and improve the codec. s efficiency.
  • the embodiment of the invention provides a video encoding method, including:
  • a prediction residual is obtained based on the predicted image, and the prediction residual is encoded.
  • An embodiment of the present invention further provides a video encoding apparatus, including:
  • a first generating module configured to generate a double prediction marker symbol for the coding block
  • a second generating module configured to generate a double prediction marker symbol for at least one subblock of the coding block when the coding block needs to perform double prediction, where the double prediction marker symbol of the subblock is used to indicate the Whether the sub-block performs double prediction
  • a prediction module configured to perform prediction according to the double prediction marker symbol of the coding block and the double prediction marker symbol of at least one subblock of the coding block, to obtain a prediction image.
  • the video coding method and the coding apparatus provided by the embodiments of the present invention identify the sub-blocks in the coding block by using sub-block-level double prediction marker symbols, and refine the unit of the double prediction of the double prediction marker symbol identification to the sub-block.
  • the level that is, the unit of the coding block that double-predicts the double prediction marker symbol to identify the double prediction, can enhance the flexibility of the double prediction and improve the efficiency of the codec.
  • the embodiment of the invention further provides a video decoding method, including:
  • the double prediction marker symbol of the decoding block indicates that the decoding block needs to perform double prediction, obtaining a double prediction marker symbol of at least one subblock of the decoding block;
  • Predicting is performed according to the double prediction marker symbol of the decoding block and the double prediction marker symbol of at least one subblock of the decoding block, to obtain a prediction image.
  • the embodiment of the invention further provides a video decoding device, including:
  • a first acquiring module configured to acquire a double prediction marker symbol of the decoding block
  • a second acquiring module configured to: when a double prediction marker symbol of the decoding block indicates that the decoding block needs to perform double prediction, acquire a double prediction marker symbol of at least one subblock of the decoding block; and decode a prediction module, And performing prediction according to the double prediction marker symbol of the decoding block and the double prediction marker symbol of at least one subblock of the decoding block, to obtain a prediction image.
  • the video decoding method and the decoding apparatus provided by the embodiments of the present invention obtain one of the decoding blocks by acquiring
  • the sub-block-level double-predictive marker symbol is identified by the level sub-block, and the unit of the double prediction is refined to the sub-block level, that is, the unit of the decoding block of the double-predictive marker symbol identification double prediction is refined, and the unit of the decoding block can be enhanced.
  • the flexibility of re-prediction improves the efficiency of decoding.
  • FIG. 1 is a flowchart of a video encoding method according to Embodiment 1 of the present invention.
  • FIG. 2 is a flowchart of a video decoding method according to Embodiment 2 of the present invention.
  • FIG. 3 is a flowchart of a video encoding method according to Embodiment 3 of the present invention.
  • Embodiment 4 is a schematic diagram of a macroblock structure in Embodiment 4, Embodiment 5, and Embodiment 6 of the present invention
  • FIG. 5 is a flowchart of a video decoding method according to Embodiment 4 of the present invention.
  • FIG. 6 is a flowchart of a video encoding method according to Embodiment 5 of the present invention.
  • FIG. 7 is a flowchart of a video decoding method according to Embodiment 6 of the present invention.
  • FIG. 8 is a flowchart of a video encoding method according to Embodiment 7 of the present invention.
  • Embodiment 9 is a schematic structural diagram of a macroblock according to Embodiment 7 and Embodiment 8 of the present invention.
  • FIG. 10 is a flowchart of a video decoding method according to Embodiment 8 of the present invention.
  • FIG. 12 is a flowchart of CABAC performing arithmetic coding in a video encoding method according to an embodiment of the present invention
  • FIG. 13 is a flowchart of a method for encoding a sub_sop_flag syntax element of an mxn sub-block in a video encoding method according to an embodiment of the present disclosure
  • FIG. 14 is a schematic diagram of a sub-block of the encoding method of the sub_sop_flag syntax element of the mxn sub-block in the video encoding method according to the embodiment of the present invention.
  • 15 is a flowchart of a method for decoding a sub_sop_flag syntax element of a mxn sub-block in a video decoding method according to an embodiment of the present invention
  • FIG. 16 is a schematic structural diagram of a video encoding apparatus according to an embodiment of the present disclosure.
  • FIG. 17 is a schematic structural diagram of a video decoding apparatus according to an embodiment of the present invention. detailed description
  • the syntax elements may be added: Second Order Prediction Flag (sop_flag), Prediction Second Prediction Mode Flag (pred_sp_mode_flag), and second mode decoding information. (Remaining Second Prediction Mode, rem_sp_mode ).
  • the sop_flag is a double prediction marker symbol identifier, and is used to identify whether the current codec block uses a double prediction technique, and the value is 0 or 1. That is, for a codec block, it is indicated by the sop_flag in the code stream whether all sub-blocks in the codec block use double prediction or no double prediction.
  • the macroblock sop_flag is 0, it indicates that all the sub-blocks in the codec block are not reconstructed by the double prediction technique, and the syntax elements red_sp_mode_flag and rem_sp_mode are not required to be generated at the encoding end.
  • pred_sp_mode_flag indicates that all the sub-blocks in the codec block are reconstructed by using a double prediction technique, and the syntax elements pred_sp_mode_flag and rem_sp_mode are generated at the encoding end, and the code stream is written after entropy coding;
  • the end parses the syntax elements pred_sp_mode_flag and rem_sp_mode from the code stream.
  • Pred_sp_mode_flag and rem_sp_mode are syntax elements related to the second recalculation mode.
  • the value of the second intra-prediction mode is 0 to 8, representing nine intra prediction modes, respectively.
  • the decoding method of the second re-intra prediction mode is the same as the decoding method of the 4 ⁇ 4 intra prediction mode in H.264/AVC, that is, whether the prediction is accurate first. If it is accurate, the mode is equal to the mode corresponding to the mode prediction value; if the prediction is not accurate, it is necessary to continue to parse the information from the code stream to obtain the mode.
  • the pred_sp_mode_flag indicates whether the second intra-frame prediction mode is accurate or not, and has a value of 0 or 1.
  • Rem_sp_mode is information for indicating the second intra intra prediction mode when the second intra prediction mode prediction is inaccurate. If the current second intra-prediction mode prediction is accurate, the syntax element rem_sp_mode of the current second intra-prediction mode does not exist in the code stream. The value of rem_sp_mode is 0 ⁇ 7.
  • FIG. 1 is a flowchart of a video encoding method according to Embodiment 1 of the present invention.
  • the method includes: Step 11. Generate a sop_flag for the coding block;
  • the sop_flag of the coding block is generated according to the criterion, or the sop_flag of the coding block is adaptively generated. If the sop_flag is adaptively generated, the sop_flag is not entropy encoded and then written into the code stream and transmitted to the decoding end.
  • Step 12 When the coding block needs to perform double prediction, generating a sop_flag for at least one sub-block of the coding block, where the sop_flag of the sub-block is used to indicate whether the sub-block performs double prediction;
  • the coding block corresponding to the sop_flag is indicated. At least one level of sub-blocks is used for double prediction.
  • the sop_flag of each sub-block in the coding block is generated.
  • the sop_flag of the sub-block is hereinafter referred to as a Sub Second Order Prediction Flag (sub_sop_flag);
  • Sub_sop_flag is used to indicate whether the corresponding sub-block performs double prediction;
  • sop_flag If the value of the sop_flag is 0, it indicates that all sub-blocks in the corresponding coding block are not subjected to double prediction; if the value of the sop_flag is 1, it indicates that at least one sub-block in the corresponding coding block performs double prediction.
  • the coding block has at least one sub-block double prediction, similar to step 11, in accordance with the registration shell may be 1 J, or may be adaptively generated sub_sop_flag coded block for each sub-block. If the value of sub_sop_flag is 0, it indicates that the corresponding sub-block is not reconstructed by the double prediction technique; if the value of sub_sop_flag is 1, it indicates that the corresponding sub-block is reconstructed by the double prediction technique.
  • the first inter-coded frame may be generated according to a criterion and transmitted to the decoding end.
  • the adaptive generation method may be: for the subsequent frame, according to the decoded block of the reference frame corresponding to the motion vector.
  • the value of sub_sop_flag directly gets the sub_sop_flag of the current sub-block to achieve flexible coding.
  • a new syntax element is added to the header information at the frame level to indicate whether or not adaptation is used in the current frame encoding.
  • the sub_sop_flag of the current sub-block is directly obtained according to the value of the sub_sop_flag of the decoded block of the reference frame corresponding to the motion vector; if no adaptation is used, sub_sop_flag is generated according to the criterion.
  • the method of adaptively obtaining the sub_sop_flag is not limited to this.
  • Step 13 Perform prediction according to the sop_flag of the coding block and at least one sub_sop_flag of the coding block to obtain a prediction image.
  • Step 14 Obtain a prediction residual according to the predicted image, and encode the prediction residual.
  • a corresponding pred_sp_mode_flag is generated for the sub-block that performs double prediction in the coding block;
  • the pred_sp_mode_flag of the sub-block that performs the double prediction is generated according to the criterion.
  • the value of pred_sp_mode_flag is 0, rem_sp_mode needs to be generated, so that the decoder performs double prediction decoding reconstruction according to the generated rem_sp_mode.
  • the code stream After entropy encoding the red_sp_mode_flag, the code stream is written.
  • pred_sp_mode_flag 1
  • pred_sp_mode_flag 1
  • rem_sp_mode needs to be entropy encoded into the code stream and sent to the decoder.
  • the decoder performs double prediction decoding reconstruction according to the received rem_sp_mode.
  • the technical solution provided by the embodiment reduces the unit of the double prediction in the sop_flag to the sub-block level by using the sub_sop_flag to identify the sub-block in the coding block, and the block size of the double prediction coding is reduced and reasonable.
  • the combination so that the advantages of the double prediction technique are more fully utilized, so that when all the sub-blocks of the current coding block do not use the double prediction, the coding efficiency is higher than the coding efficiency of the double prediction of all the sub-blocks. Or, above all its sub-blocks, the coding efficiency of the double prediction is not used.
  • the technical solution provided in this embodiment refines the unit of the double prediction of the double prediction marker symbol identification to the sub-block level, that is, the unit of the coding block that double-predicts the double prediction marker symbol to identify the double prediction, and can enhance the double Predictive flexibility and improved codec efficiency.
  • the video encoding method provided by the embodiment of the present invention may further include: entropy encoding the sop_flag and sub_sop_flag and writing the code stream.
  • the video coding method provided by the embodiment may further include:
  • a syntax element for indicating whether or not the adaptive is used in the current frame encoding is added to the header information of the frame level of the code stream.
  • a sub-block of a coding block further includes multiple sub-blocks
  • a sub-block of a coding block is referred to as a primary sub-block
  • a sub-block in a primary sub-block is referred to as a secondary sub-block
  • a secondary sub-block The sub-blocks in it are called three-level sub-blocks, and so on.
  • a value of 0 in the sub_sop_flag also indicates that all secondary sub-blocks in the corresponding primary sub-block do not perform double prediction;
  • a value of 1 in the sub_sop_flag also indicates that all secondary sub-blocks of the corresponding primary sub-block are double-homed Predictive construction.
  • the corresponding red_sp_mode_flag and rem_sp_mode are generated, which may include:
  • second_sub_sop_flag a second-level sub-block-level second pre-ordered flag
  • the second_sub_sop_flag can be generated adaptively or generated according to criteria.
  • the decoder When the second_sub_sop_flag is adaptively generated, it does not need to be transmitted to the decoding end.
  • the decoder also generates second_sub_sop_flag by adaptation.
  • the video encoding method provided by the embodiment of the present invention may further include: entropy encoding the second_sub_sop_flag and writing the code stream.
  • the coding block can be divided into three sub-blocks, four sub-blocks and even more sub-blocks, similar to the encoding process of the above sub_sop_flag, second_sub_sop_flag, Refine the sop_flag to a three-level sub-block level double prediction marker symbol (Second Sub Second Order Prediction Flag, Third_sub_sop_flag ), Four-Level Sub-Order Prediction Flag (Forth Sub Second Order Prediction Flag, Forth_sub_sop_flag), etc., to identify whether a smaller unit performs double prediction, further satisfying The flexible requirements of double prediction improve coding efficiency.
  • FIG. 2 is a flowchart of a video decoding method according to Embodiment 2 of the present invention. The method includes:
  • Step 21 Obtain a sop_flag of the decoded block.
  • the sop_flag when receiving the code stream sent by the encoding end, when the code stream includes the sop_flag, the sop_flag may be parsed from the code stream; when the code stream does not include the sop_flag, the frame level header may be parsed from the code stream.
  • the information is used to indicate whether the adaptive syntax element is used in the current frame encoding, and in the case where the current frame encoding is used for adaptation, the sop_flag is adaptively obtained.
  • Step 22 When the sop_flag of the decoding block indicates that the decoding block needs to perform double prediction, acquiring a sop_flag of at least one sub-block of the decoding block (ie, at least one sub_sop_flag);
  • the sub_sop_flag when the code stream includes the sub_sop_flag, the sub_sop_flag may be parsed from the code stream; when the code stream does not include the sub_sop_flag, the header information of the frame level may be parsed from the code stream for indicating the current frame coding.
  • sub_sop_flag is obtained by an adaptive method.
  • the sub_sop_flag of the current sub-block is directly obtained according to the value of the sub_sop_flag of the decoded block of the reference frame corresponding to the motion vector.
  • the sub_sop_flag is described in detail in step 12 above.
  • Step 23 Perform prediction according to the sop_flag of the decoding block and at least one sub_sop_flag of the decoding block to obtain a predicted image.
  • the primary sub-block that performs double prediction in the decoding block from the code stream.
  • the corresponding red_sp_mode_flag is parsed, and the double prediction decoding reconstruction is performed.
  • pred_sp_mode_flag is 0, rem_sp_mode needs to be further parsed.
  • the technical solution provided in this embodiment refines the unit of the double prediction to the sub-block level by acquiring the sub_sop_flag that identifies the primary sub-block in the decoding block, and the block size of the double prediction coding is performed to reduce and
  • the reasonable combination makes the advantages of the double prediction technology more fully utilized, making the objects of the double prediction more diversified and satisfying the requirements of different coding efficiency.
  • the corresponding pred_sp_mode_flag is parsed from the code stream, including :
  • the second_sub_sop_flag is used to indicate whether the corresponding secondary sub-block performs double prediction
  • the corresponding pred_sp_mod e_flag is parsed from the code stream.
  • the decoding block can be divided into three sub-blocks, four sub-blocks and even more sub-blocks, similar to the decoding process of the above sub_sop_flag, second_sub_sop_flag,
  • the sop_flag is refined to a third-level sub-block-order double-predictive mark (Second Sub Second Order Prediction Flag, Third_sub_sop_flag), and a four-level sub-block-level double-pre-predetermined; Forth Sub Second Order Prediction Flag (Forth Sub Second Order Prediction Flag, Forth_sub_sop_flag) Etc., to identify whether the smaller unit is performing double prediction, and further meet the flexibility requirements of more double prediction.
  • FIG. 3 is a flowchart of a video encoding method according to Embodiment 3 of the present invention.
  • the method includes: Step 31: According to a certain criterion, such as a Rate Distortion Optimization (RDO) criterion, but not limited to the criterion, generate an MXN-level sop_flag, that is, a sop_flag of a coding block of size M x N (hereinafter referred to as an MXN coding block).
  • RDO Rate Distortion Optimization
  • Step 32 Similar to step 31, according to a certain criterion, such as the RDO criterion but not limited to this criterion, a sub_sop_flag of the mxn sub-block is generated, and the m n sub-block sub_sop_flag is entropy encoded into the code stream.
  • a certain criterion such as the RDO criterion but not limited to this criterion
  • sop_flag of the MxN macroblock is 0, it means that all mxn subblocks in the MxN coding block are not subjected to double prediction. At this time, it is not necessary to generate sub_sop_flag and double prediction related syntax elements such as pred_sp_mode_flag and rem_sp_mode, and need not The entropy code is written to the code stream.
  • the sop_flag of the MxN coding block is 1, it indicates that at least one m xn subblock in the MxN coding block performs double prediction.
  • the sub-interval prediction mode corresponding to the MxN coding block may be divided according to a certain criterion, such as the RDO criterion, but not limited to the criterion, and a sub_sop_flag is generated for each mxn sub-block, and the code is written by entropy coding. In the stream.
  • the block partitioning structure obtained according to the first re-prediction mode has a second re-predicted block size of 8x8.
  • This example is not limited to this type of block division mode, and there may be many other block division structures, and the second re-prediction block size is not limited to this one size.
  • the sop_flag corresponds to a 16x16 size block, that is, a macroblock
  • the first re-prediction mode divides the 16x16 size macroblock into one 8x16 block on the left and two 8x8 blocks on the right, that is, the macroblock is divided into block 1. , block 2 and block 3 three sub-blocks.
  • sop_flag is 1, according to certain criteria, such as RD0 criteria but not limited to this a criterion is to generate a sub_sop_flag for the three sub-blocks to indicate whether all second re-predicted blocks of the corresponding sub-block perform double prediction, and write the sub_sop_flag of block 1, block 2 and block 3 by entropy coding. In the code stream.
  • Step 33 When the sub_sop_flag of a certain sub-block is 1, according to a certain criterion, such as the RDO criterion, but not limited to the criterion, generating a double prediction related syntax element pred_sp_mode_flag and rem_sp_mode, etc., and entropy the double prediction related syntax element After encoding, it is written into the stream.
  • a certain criterion such as the RDO criterion, but not limited to the criterion
  • the block 1 sub-block of size 8x16 if the sub_sop_flag of block 1 is 1, according to certain criteria, such as RDO criterion but not limited to this criterion, a set of pred_sp_mode_flag and r em_sp_mode of the block 1 are generated. Entropy coding is written into the code stream. And, the block 1 sub-block is encoded by a double prediction technique. For the second re-predicted block in the block 1 sub-block, the same double prediction mode r em_sp_mode is used for the double prediction reconstruction. Similarly, the decoder uses the same rem_sp_mode for double prediction decoding reconstruction.
  • FIG. 5 is a flowchart of a video decoding method according to Embodiment 4 of the present invention.
  • the decoding end decoding method includes:
  • Step 51 Parse the sop_flag of the MxN decoding block from the code stream, and obtain whether the MxN decoding block and each of the mxn sub-blocks perform double prediction.
  • m ⁇ M
  • n ⁇ N
  • the m xn sub-block belongs to the current M xN decoding block.
  • Step 52 Parse and obtain sub_sop_flag.
  • sop_flag of the MxN decoding block is 0, it means that all mxn sub-blocks in the MxN decoding block do not perform double prediction. At this point, there is no need to further parse the sub_sop_fl from the code stream. Ag and other double prediction related syntax elements such as pred_sp_mode_flag and rem_sp_mode. If the sop_flag of the ⁇ decoding block is 1, it indicates that at least one m xn sub-block in the MxN decoding block is reconstructed by a double prediction technique.
  • a sub_sop_f lag may be parsed from the code stream for each mxn sub-block according to the block division corresponding to the M-N decoding block one-frame inter prediction mode.
  • the block partitioning structure obtained according to the first re-prediction mode has a second re-predicted block size of 8x8. This example is not limited to this type of block division mode, and there may be many other block division structures, and the second re-prediction block size is not limited to this one size.
  • the sop_flag corresponds to a block of 16 ⁇ 16 size, that is, one macroblock, and the first re-prediction mode divides the 16x16-size macroblock into one 8x16 sub-block on the left and two 8x8 sub-blocks on the right, that is, block 1, block 2 And block 3 three sub-blocks. If the sop_flag is 1, the sub_sop_flag is parsed from the code stream for each of the three sub-blocks to indicate whether all the second re-predicted blocks of the corresponding sub-block perform double prediction.
  • Step 53 When the sub_sop_flag of a certain sub-block is 1, parsing the double prediction related syntax elements, such as pred_sp_mode_flag and rem_sp_mode, from the code stream, performing double prediction reconstruction on all second re-predicted blocks in the sub-block, and The second prediction mode used by all the second re-predicted blocks in this sub-block is the same.
  • the block 1 sub-block of size 8x16 if the sub_sop_fla g of block 1 is 1, parsing a set of red_sp_mode_flag and rem_sp_mo de of the 8 X 16 block from the code stream, for all the second weights thereof
  • the prediction block performs double prediction decoding reconstruction and adopts the same double prediction mode.
  • FIG. 6 is a flowchart of a video encoding method according to Embodiment 5 of the present invention.
  • the method includes: Step 61, according to certain criteria, such as RDO criteria but not limited to the criteria, according to a reference frame or
  • the information of the current frame decoded block adaptively obtains the sop_flag of the MN coded block to indicate whether the M xN coded block and its respective mxn sub-blocks are subjected to double prediction.
  • m ⁇ M
  • Step 62 Similar to step 61, according to a certain criterion, such as the RDO criterion but not limited to the criterion, the sub_sop_f lag of the mxn sub-block is adaptively obtained according to the information of the reference frame or the decoded block of the current frame.
  • a certain criterion such as the RDO criterion but not limited to the criterion
  • sop_flag of the MxN coding block is 0, it means that all mxn sub-blocks in the MxN coding block are not subjected to double prediction. At this time, it is not necessary to further obtain sub_sop_flag and other double prediction related syntax elements such as pred_sp_mode_flag and rem_sp_mode.
  • the sop_flag of the MxN coding block is 1, it indicates that at least one m xn subblock in the MxN coding block performs double prediction.
  • the block division corresponding to the one-frame inter prediction mode of the MxN coding block according to certain criteria, such as the RDO criterion but not limited to the criterion, according to the reference frame or the information of the decoded block of the current frame, for each mxn sub-
  • the block adaptively obtains a sub_sop_flag. For example, as shown in FIG. 4, the block partitioning structure obtained according to the first re-prediction mode has a second re-predicted block size of 8x8.
  • the sop_flag corresponds to a block of size 16x16, which is a macroblock.
  • the first re-prediction mode divides the 16x16 size macroblock into the form of one 8x16 block on the left and two 8x8 blocks on the right, namely three blocks of block 1, block 2 and block 3.
  • the sub_sop_flag is adaptively obtained according to the information of the reference frame or the decoded block of the current frame by using a certain criterion, such as the RDO criterion, but not limited to the criterion, respectively, for the three sub-blocks, to indicate the corresponding Whether all second re-predicted blocks of the sub-blocks are subjected to double prediction.
  • Acquiring the sub_s op_flag adaptively may include: sub_sop_fla of the decoded block according to the reference frame corresponding to the motion vector
  • the value of g directly gets the sub_sop_flag of the current sub-block.
  • the method of adaptively obtaining the sub_sop_flag is not limited to the method described above.
  • Step 63 When a sub_sop_flag of a certain sub-block is 1, according to a certain criterion, such as an RDO criterion but not limited to the criterion, generating a double prediction related syntax element such as red_sp_mode_flag and rem_sp_mode, and entropy the double prediction related syntax element. Encoding, written to the stream.
  • a certain criterion such as an RDO criterion but not limited to the criterion
  • a block 1 sub-block of size 8x16 if the su b_sop_flag of block 1 is 1, a set of red_sp_mode_flags of the block 1 sub-block is generated according to certain criteria, such as RDO criteria but not limited to this criterion. And rem_sp_mode, and entropy encoding red_sp_mode_flag and rem_sp_mode, and writing into the code stream.
  • This sub-block performs a double prediction.
  • the same double prediction mode rem_sp_mode is used for double prediction.
  • the decoder uses the same rem_sp_mode for double prediction decoding reconstruction.
  • FIG. 7 is a flowchart of a video decoding method according to Embodiment 6 of the present invention.
  • the decoding end decoding method includes:
  • Step 71 The sop_flag of the MxN decoding block is adaptively obtained according to the information of the reference frame or the decoded block of the current frame, to indicate whether the MxN decoding block and each of the mxn sub-blocks perform double prediction.
  • m ⁇ M
  • Step 72 Adaptively obtain sub_sop_flag.
  • sop_flag of the MxN decoding block is 0, it means that all mxn sub-blocks in the MxN decoding block do not perform double prediction. At this time, it is not necessary to further obtain sub_sop_flag and other double prediction related syntax elements such as pred_sp_mode_flag and rem_sp_mode.
  • the sop_flag of the MxN decoding block is 1, it indicates that there is at least one m in the MxN decoding block.
  • the n sub-block performs double prediction.
  • a sub_sop_flag is adaptively obtained for each mxn sub-block according to the information of the reference frame or the decoded block of the current frame. For example, as shown in FIG. 4, the block partitioning structure obtained according to the first re-prediction mode has a second re-predicted block size of 8x8.
  • the sop_flag corresponds to a block of size 16x16, that is, a macroblock.
  • the first re-prediction mode divides the 16 ⁇ 16-size macroblock into one 8x16 block on the left and two 8x8 blocks on the right, namely block 1, block 2 and Block 3 has three sub-blocks.
  • the three sub-blocks respectively adaptively derive a sub_sop_flag according to the information of the reference frame or the decoded block of the current frame, to indicate whether all the second re-predicted blocks of the corresponding sub-block are duplicated. prediction.
  • the obtaining the sub_sop_flag adaptively may include: directly obtaining the sub_sop_flag of the current sub-block according to the value of the sub_sop_flag of the decoded block of the reference frame corresponding to the motion vector.
  • the method of adaptively obtaining the sub_sop_flag is not limited to the method described above.
  • Step 73 When sub_sop_flag of a certain sub-block is 1, parsing the double prediction related syntax elements, such as pred_sp_mode_flag and rem_sp_mode, from the code stream, performing double prediction on all second re-predicted blocks in the sub-block, and this The second prediction mode used by all the second re-predicted blocks in the sub-block is the same. For example, the block 1 sub-block in FIG.
  • the double prediction block performs double prediction decoding reconstruction and adopts the same double prediction mode.
  • FIG. 8 is a flowchart of a video encoding method according to Embodiment 7 of the present invention.
  • the method includes: Step 81: Generate a sop_flag of the MxN coding block according to a certain criterion, such as an RDO criterion, but is not limited to the criterion, and entropy-encode the sop_flag of the ⁇ coding block into the code stream.
  • Step 82 Similar to the foregoing step 81, according to a certain criterion, such as RDO but not limited to the criterion, a sub_sop_flag of the mxn sub-block is generated, and the sub_sop_flag of the m n sub-block is entropy encoded and written into the code stream.
  • a certain criterion such as RDO but not limited to the criterion
  • sop_flag of the MxN coding block is 0, it means that all mxn sub-blocks in the MxN coding block are not subjected to double prediction. At this time, it is not necessary to further write s ub_sop_flag and other double prediction related syntax elements such as pred_sp_mode_flag and rem_sp_ mode in the code stream by entropy coding.
  • sop_flag of the MxN coding block is 1, it indicates that at least one mxn subblock in the MxN coding block performs double prediction.
  • a sub_sop_flag is generated for each mxn-level sub-block according to a certain criterion, such as an RDO (Price Distortion Optimization) criterion but not limited to the criterion.
  • entropy coding is written into the code stream.
  • the block partitioning structure obtained according to the first re-prediction mode has a second re-predicted block size of 8x8.
  • Sop_flag corresponds to a macroblock of size 32x32.
  • the first re-prediction mode divides the macroblock of size 32x32 into four 16x 16-level sub-block structures, that is, the first-level sub-block A and the first-level sub-block ⁇ first-level sub-block Block C and level one sub-block D.
  • Each primary sub-block of size 16x 16 is further divided into four secondary sub-blocks of size 8x8.
  • a sub_sop_flag is generated for the four first-level sub-blocks to indicate whether all second re-predicted blocks of the corresponding first-level sub-block perform double prediction, and the sub_sop_flag is entropy-coded and written into the code stream.
  • Step 83 When the sub_sop_flag of a certain level sub-block is 1, then each second-level sub-block in the first-level sub-block generates a second_sub_sop_flag according to a certain criterion, such as the RD0 criterion but not limited to the criterion.
  • a certain criterion such as the RD0 criterion but not limited to the criterion.
  • the second_sub_sop_flag of a secondary sub-block is 0, it means that all the second re-predicted blocks in the secondary sub-block do not perform double prediction. At this time, it is not necessary to further write sub_sop_flag and other double prediction related syntax elements such as pred_sp_mode_flag and rem_sp_mode in the code stream by entropy coding.
  • the second_sub_sop_flag of a certain secondary sub-block is 1, it means that all the second re-predicted blocks in the second-level sub-block perform double prediction, and the second weight used by all the second re-predicted blocks in the second-level sub-block
  • the prediction mode is the same.
  • binary prediction related syntax elements such as pred_sp_mode_flag and rem_sp_mode are generated and written into the code stream by entropy coding.
  • certain criteria such as RDO criteria but not limited to this criterion
  • the second_sub_sop_flag of an 8x8 secondary sub-block is 1, according to a certain criterion, such as the RDO criterion but not limited to the quasi-be 1 J
  • the bi-prediction related syntax elements such as pred_sp_mode_flag and rem_sp_mode are generated and written by entropy coding.
  • the code stream is streamed, and the second level block is double predicted.
  • the same double prediction mode rem_sp_mode is used for double prediction.
  • the sample decoder also uses the same rem_sp_mode for double prediction decoding reconstruction.
  • FIG. 10 corresponds to the seventh embodiment
  • FIG. 10 is a flowchart of a video decoding method according to Embodiment 8 of the present invention.
  • the decoding end decoding method includes:
  • Step 101 Parse the sop_flag of the ⁇ decoding block from the code stream to indicate whether the MxN decoding block and each of the mxn sub-blocks adopt a double prediction technique.
  • m ⁇ M
  • n ⁇ N
  • the m n sub-block belongs to the current MxN decoding block.
  • Step 102 Parse the sub_sop_flag of the sub-block.
  • sop_flag of the MxN decoding block is 0, it means that all mxn sub-blocks in the MxN decoding block do not perform double prediction. At this time, it is not necessary to further parse the sub_sop_flag and other double prediction related syntax elements such as pred_sp_mode_flag and rem_sp_mode from the code stream.
  • the sop_flag of the MxN decoding block is 1, it indicates that at least one mxn subblock in the MxN decoding block performs double prediction.
  • a sub_sop_flag is parsed from the code stream for each level one sub-block of size mxn.
  • the block partitioning structure obtained according to the first re-prediction mode has a second re-predicted block size of 8x8. This example is not limited to this type of block division mode, and there may be many other block division structures, and the second re-prediction block size is not limited to this one size.
  • Sop_flag corresponds to a macroblock of size 32x32.
  • the first re-prediction mode divides the 32x32 size macroblock into four 16x-16-level sub-block structures, that is, the first-level sub-block A, the first-level sub-block ⁇ first-level sub- Block C and level one sub-block D. Each 16x 16-level sub-block is further divided into four 8x8 secondary sub-blocks. If the sop_flag is 1, each of the four first-level sub-blocks parses a sub_sop_flag from the code stream, respectively Whether all second re-predicted blocks of its corresponding primary sub-block are subjected to double prediction.
  • Step 103 When the sub_sop_flag of a certain level of the sub-block is 1, a second_sub_sop_flag is parsed from the code stream for each of the second-level sub-blocks in the first-level sub-block, to represent the second-level sub-block. Whether the second re-predicted block performs double prediction decoding reconstruction.
  • the second_sub_sop_flag of a secondary sub-block is 0, it means that all the second re-predicted blocks in the secondary sub-block do not perform double prediction. At this time, there is no need to further parse the sub_sop_flag and other double pre->J-related syntax elements such as pred_sp_mode_flag and rem_sp_mode from the code stream.
  • the second_sub_sop_flag of a certain secondary sub-block is 1, it means that all the second re-predicted blocks in the second-level sub-block perform double prediction, and the second weight used by all the second re-predicted blocks in the second-level sub-block The prediction mode is the same.
  • a second_sub_sop_flag is parsed separately for each 8x8 secondary sub-block from the code stream. If the second_sub_sop_flag of an 8x8 secondary sub-block is 1, a set of red_sp_mode_flag and rem_sp_mode of the 8 ⁇ 8 secondary sub-block are parsed from the code stream, and a second prediction decoding reconstruction is performed on all the second re-predicted blocks. And adopt the same double prediction mode.
  • the sub_sop_flags in the first embodiment, the third embodiment, the fifth embodiment, the seventh embodiment, and the ninth embodiment can be encoded by using a context-based adaptive binary arithmetic coding (CAB AC).
  • CABAC context-based adaptive binary arithmetic coding
  • the basic coding steps of CABAC can be divided into three steps: binarization, context modeling, and binary arithmetic coding.
  • Binarization mainly converts non-binary syntax element values into binary bit sequences. If the syntax elements themselves are binary, this step can be omitted.
  • Context modeling primarily provides a probabilistic model for each bit of a bit sequence of a binarized syntax element, probabilistic prediction, and sometimes requires previously encoded syntax elements or bit sequences.
  • Binary arithmetic coding has two coding modes, one is the regular coding mode, and the other is the bypass coding mode.
  • the conventional coding mode adopts context modeling
  • the bypass coding mode does not adopt context modeling in order to speed up the coding speed, and the entire coding process is as shown in FIG.
  • Step 111 binarization.
  • CABAC uses binary arithmetic coding instead of other multi-ary arithmetic coding. To do this, each syntax element needs to be converted into a unique binary sequence, which is called a binary string in H.264.
  • a binary string in H.264 the binary string in H.264.
  • CABAC uses four basic binary conversion methods.
  • Step 112 context modeling. Context modeling must be done before arithmetic coding.
  • the so-called context modeling is to establish a probability model to predict the bit values and probabilities of each bit to be encoded.
  • the first type of model must be constructed according to its adjacent coded syntax elements. Generally, the corresponding syntax elements on the left and upper sides are used to establish the corresponding 3 ⁇ 43 ⁇ 4 rate model, and the current syntax elements are predicted by 3 ⁇ 4 ⁇ 4 rate.
  • the second model is limited to applications of macroblock types and subblock types.
  • the selection of the probability model of the Nth bit refers to the model used in the previously encoded N-1th bit.
  • the third and fourth models are only used for the encoding of residual data, both of which rely on the type of coding block.
  • the third model relies not on the encoded data, but on the location of the data in the scan path.
  • the fourth model is to calculate the bit The number of levels that have been encoded before the level.
  • Step 113 binary arithmetic coding.
  • CABAC the value 0 or 1 of each bit to be encoded is represented by a maximum probable symbol (MPS) and a least probable symbol (LPS).
  • MPS indicates the most likely state, corresponding to the one with the highest probability of 0 and 1.
  • LPS indicates the state that is least likely to occur, corresponding to the one with a low probability of 0 and 1. This only requires a variable value to hold the probability of the occurrence of LPS.
  • it quantizes the probability into 64 levels, each probability being uniquely given by its corresponding index ⁇ .
  • each context model can be uniquely determined by two variables.
  • CABAC The flow chart of CABAC when doing arithmetic coding is shown in Figure 12.
  • the probability model of CABAC effectively reduces the amount of computation in probability estimation and refresh.
  • CABAC first creates a 4x64 two-dimensional table that stores pre-computed multiplication results.
  • the entry parameters for the table are undoubtedly one from Px and the other from R.
  • Px can directly take ⁇ as a parameter, and the quantization formula of R is:
  • R is the size of the current interval
  • p is the result of R
  • >> indicates a bit shift to the right
  • & indicates a bit-level AND operation.
  • CABAC must save the record state of the variable in the progressive calculation process, including: the lower limit of the current interval 1 ⁇ , the size of the current interval, the current MPS character, and the probability number ⁇ of the LPS.
  • FIG. 13 is a block diagram of an mxn sub-block in a video encoding method according to an embodiment of the present invention.
  • Step 131 Establish three different probability models for the sub_sop_flag, and perform corresponding probability model initialization. Assume that the three probabilistic models have labels of 0, 1, and 2, respectively.
  • Step 132 Perform a selection of a probability model of the sub_sop_flag of the current m n sub-block C according to the value of the sub_sop_flag of the adjacent left mxn sub-block A and the upper mxn sub-block B of the current mxn sub-block C.
  • the choice formula is as follows:
  • Context_sub_sop_flag(C) sub_sop_flag(A) + sub_sop_flag(B).
  • Context_sub_sop_flag(C) represents the product rate model of the arithmetic coding solution to be used by the current mxn sub-block C.
  • Step 133 Perform CABAC coding by using the selected probability model. Because CABAC adopts the idea of efficient arithmetic coding, and fully considers the statistical characteristics of video stream, it greatly improves the coding efficiency.
  • FIG. 15 is a flowchart of a method for decoding a sub_sop_flag syntax element of a mxn sub-block in a video decoding method according to an embodiment of the present disclosure, where the decoding process includes:
  • Step 151 Create three different probability models for the sub_sop_flag, and perform corresponding probability model initialization. Let the three probabilistic models have labels of 0, 1, 2, and 3, respectively.
  • Step 152 According to the adjacent left side mxn sub-block A of the current mxn sub-block C and the upper mxn The value of the sub_sop_flag of the sub-block B is used to select the probability model of the sub_sop_flag of the current mn sub-block C.
  • the choice formula for the probability model is:
  • Context_ sub_sop_flag(C) 2 ⁇ sub_sop_flag(A) + sub_ sop_flag(B).
  • Context_sub_sop_flag(C) represents the product rate model of the arithmetic coding solution to be used by the current mxn sub-block C.
  • the probability model 1 is selected. If the sub_sop_flag of sub-block A and sub-block B is 1, probability model 2 is selected.
  • Step 153 Perform CABAC code stream parsing by using the selected probability model, that is, perform binary arithmetic decoding to obtain a binary (bin), and directly assign the value of the bin to sub_sop_flag.
  • FIG. 16 is a schematic structural diagram of a video encoding apparatus according to an embodiment of the present invention.
  • the encoding device includes: a first generating module 161, a second generating module 162, a predicting module 163, and an encoding module 164.
  • the first generation module 161 is configured to generate a sop_flag for the coding block.
  • the first generation module 161 obtains the sop_flag of the coding block by using an adaptive method. For details, refer to the description of step 11 in the foregoing method embodiment.
  • the second generation module 162 is configured to generate a sop_flag of the sub-block, that is, a sub_sop_flag, for the at least one sub-block of the coding block when the coding block needs to perform the double prediction, where the sub_sop_flag is used to indicate whether the sub-block is dual- Predicting; as described by the second generation module 162, the sub_sop_flag is obtained by an adaptive method for each of the sub-blocks in the coding block. See the description of step 12 in the above method embodiment for details.
  • the prediction module 163 is configured to perform prediction according to the sop_flag of the coding block and at least one sub_sop_flag of the coding block to obtain a prediction image.
  • the coding module 164 is configured to obtain a prediction residual according to the prediction image, and the prediction residual is used. Encode.
  • the video encoding apparatus provided by the embodiment of the present invention may further include: a third generating module 165, configured to generate a corresponding pred_sp_mode_flag for the sub-block that performs double prediction in the encoding block, as described in the foregoing method embodiment.
  • the encoding module 164 is further configured to write the code stream after entropy encoding the pred_sp_mode_flag.
  • the encoding module 164 is further configured to perform entropy encoding on the sop_flag and sub_sop_flag, and then write the code stream.
  • the encoding module 164 may be specifically configured to perform CABAC.
  • the video encoding apparatus refines the sub-blocks in the coding block by sub_sop_flag, and refines the unit of the double prediction of the sop_flag to the sub-block level, and performs the block size of the double prediction coding to reduce and Reasonable combination, which fully exploits the advantages of the double prediction technique, so that when all the sub-blocks of the current coding block are not subjected to double prediction, the coding efficiency may be higher than that of all the sub-blocks. Efficiency, or higher than the coding efficiency of all sub-blocks without double prediction.
  • the video encoding apparatus may further include: a header information setting module 166.
  • the header information setting module 166 is configured to add, in the header information of the frame level of the code stream, whether to use an adaptive syntax element when the current frame encoding is used, so that the decoding end determines that the decoding is performed from the code stream according to the syntax element. Obtaining sop_flag, sub_sop_flag, or obtaining sop_flag, sub_sop_flag by adaptation.
  • the third generation module 165 may include: a first generation submodule 167 and a second generation submodule 168, when the sub-block that performs the double prediction is divided into the plurality of second-level sub-blocks.
  • the secondary sub-blocks are described in detail in the above method embodiments.
  • the first generation sub-module 167 is configured to perform, in the first-level sub-block for performing double prediction, for each level
  • the sub-block generates second_sub_sop_flag; the second_sub_sop_flag is used to indicate whether the corresponding secondary sub-block performs double prediction.
  • the second generation sub-module 168 is configured to generate a corresponding pred_sp_mode_flag for the secondary sub-block that performs the double prediction.
  • the encoding module 164 is further configured to write the code stream after entropy encoding the second_sub_sop_flag.
  • FIG. 17 is a schematic structural diagram of a video decoding apparatus according to an embodiment of the present invention.
  • the video decoding device includes: a first obtaining module 171, a second obtaining module 172, and a decoding predicting module 173.
  • the first obtaining module 171 is configured to acquire a sop_flag of the decoded block.
  • the first obtaining module 171 is specifically configured to parse the sop_flag of the decoding block from the code stream. For details, refer to the description of step 21 in the foregoing method embodiment.
  • the second obtaining module 172 is configured to: when the sop_flag of the decoding block indicates that the decoding block needs to perform double prediction, acquire a sop_flag of the at least one sub-block of the decoding block, that is, a sub_sop_flag; Sub_sop_flag of each sub-block in the decoded block is parsed from the code stream. Specifically, the second obtaining module 172 is configured to parse the sub_sop_flag of each of the decoded blocks from the code stream by using context-based binary arithmetic decoding. The sub_sop_flag is used to indicate whether the corresponding sub-block performs double prediction. For details, refer to the description of step 22 in the foregoing method embodiment.
  • the decoding prediction module 173 is configured to perform prediction according to the second sop_flag of the decoding block and at least one sub_sop_flag of the decoding block to obtain a predicted image.
  • the video decoding apparatus may further include a third obtaining module 174, configured to parse the corresponding pred_sp_mode_flag from the code stream for the sub-block that performs double prediction in the decoding block, for performing For double prediction, please refer to the description of the above method embodiment.
  • the video decoding apparatus may further include a parsing module 175, configured to parse out, in the code stream, header information in the frame level, and indicate whether to use an adaptive syntax element in the current frame encoding.
  • a parsing module 175 configured to parse out, in the code stream, header information in the frame level, and indicate whether to use an adaptive syntax element in the current frame encoding.
  • the first obtaining module 171 is specifically configured to obtain a sop_flag of the decoded block by using an adaptive method.
  • the second obtaining module 172 is specifically configured to obtain the decoded block by using an adaptive method. Each sub_sop_flag.
  • the third obtaining module 174 may include: an obtaining sub-module 176 and a parsing sub-module 177.
  • the obtaining sub-module 176 is configured to obtain a second_sub_sop_flag of each second-level sub-block in the first-level sub-block that performs double prediction; and the second_sub_sop_flag is used to indicate whether the corresponding second-level sub-block performs double prediction.
  • the parsing sub-module 177 is configured to parse the corresponding pred_sp_mode_flag from the code stream for the secondary sub-block that performs the double prediction.
  • the video decoding apparatus adopting the double prediction obtains the unit of the double prediction to the sub-block level by acquiring the sub_sop_flag that identifies the primary sub-block in the decoding block, and the block that is about to perform the double prediction coding.
  • the size is reduced and rationally combined, so that the advantages of the double prediction technology are more fully utilized, and the objects of the double prediction are more diverse, satisfying the requirements of different coding efficiency.
  • the technical solution provided in this embodiment refines the unit of the double prediction of the double prediction marker symbol identification to the sub-block level, that is, the unit of the coding block that duplicates the double prediction marker symbol identification double prediction, and can enhance the double Predictive flexibility and improved codec efficiency.
  • the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed.
  • the foregoing steps include the steps of the foregoing method embodiments; 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.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Description

视频编码方法、 解码方法、 编码及解码装置
技术领域
本发明涉及视频编解码技术领域,尤其涉及一种视频编码方法、解码方法、 编码及解码装置。 背景技术
视频信号中存在着大量的冗余信息, 这些冗余信息可以分成空间冗余信 息、 时间冗余信息、 数据冗余信息和视觉冗余信息。 视频压缩技术一般基于块的、 集预测编码、 变换编码和熵编码于一体的传 统混合编码( Hybrid Coding )框架。 传统的视频混合编码框架中的预测编码将编码帧分成编码单元,对编码单 元进行预测编码, 得到预测值, 并求得预测值和待编码值的差即残差数据, 对 残差数据进行二维变换编码; 然后在变换域中对变换系数进行量化、扫描转换 成一维信号; 最后进行熵编码。 现有技术中,提出了一种使用二重预测的编解码方法。该方法将传统混合 视频编解码框架中的预测定义为第一重预测,解码重建图像的重建过程包含二 重预测补偿过程和第二重预测存储; 相应地,把传统混合视频编解码框架中的 预测残差定义为第一重残差,把针对第一重残差的预测定义为第二重预测。二 重预测补偿过程包括第一重预测补偿过程和第二重预测补偿过程。第二重预测 补偿过程的输入包括重建后的第一重残差和重建后的第二重残差,由此得到重 建后的残差。 编码方法包括二重预测过程和第二重预测存储。其中,二重预测过程包括 第一重预测过程和第二重预测过程。第二重预测过程的输入包括第一重残差和 第一重残差预测值, 并由此生成第二重残差。 第一重残差预测值由重建后的第 一重残差根据第二重模式使用预测方法生成。编码方法产生的相应码流, 包括 第一重模式和第二重残差, 不包括第一重残差; 或者包括第一重模式、 第二重 模式和第二重残差, 不包括第一重残差。
在实现本发明的过程中,发明人发现现有技术至少存在以下缺陷: 二重预 测的作用单位为一个宏块, 即对于一个宏块,其所有子块要么均采用二重预测 要么均不采用二重预测, 二重预测的灵活性差, 编解码效率不高。 发明内容
本发明实施例提出一种视频编码方法、 解码方法、 编码及解码装置, 通过 细化二重预测标记符号标识二重预测的编解码块的单位,以增强二重预测的灵 活性, 提高编解码的效率。
本发明实施例提供了一种视频编码方法, 包括:
对编码块生成二重预测标记符号;
当所述编码块需要进行二重预测时,对所述编码块的至少一个子块生成二 重预测标记符号,所述子块的二重预测标记符号用于表示该子块是否进行二重 预测;
根据所述编码块的二重预测标记符号和所述编码块的至少一个子块的二 重预测标记符号进行预测, 得到预测图像;
根据所述预测图像, 得到预测残差, 对所述预测残差进行编码。
本发明实施例还提供了一种视频编码装置, 包括:
第一生成模块, 用于对编码块生成二重预测标记符号; 第二生成模块, 用于当所述编码块需要进行二重预测时,对所述编码块的 至少一个子块生成二重预测标记符号,所述子块的二重预测标记符号用于表示 该子块是否进行二重预测;
预测模块,用于根据所述编码块的二重预测标记符号和所述编码块的至少 一个子块的二重预测标记符号进行预测, 得到预测图像。
本发明实施例提供的视频编码方法和编码装置通过用子块级二重预测标 记符号对编码块中的子块进行标识,将二重预测标记符号标识的二重预测的单 位细化到了子块级, 即细化了二重预测标记符号标识二重预测的编码块的单 位, 可以增强二重预测的灵活性, 提高编解码的效率。
本发明实施例还提供了一种视频解码方法, 包括:
获取解码块的二重预测标记符号;
当所述解码块的二重预测标记符号指示该解码块需要进行二重预测时,获 取所述解码块的至少一个子块的二重预测标记符号;
根据所述解码块的二重预测标记符号和所述解码块的至少一个子块的二 重预测标记符号进行预测, 得到预测图像。
本发明实施例还提供了一种视频解码装置, 包括:
第一获取模块, 用于获取解码块的二重预测标记符号;
第二获取模块,用于当所述解码块的二重预测标记符号指示该解码块需要 进行二重预测时, 获取所述解码块的至少一个子块的二重预测标记符号; 解码预测模块,用于根据所述解码块的二重预测标记符号和所述解码块的 至少一个子块的二重预测标记符号进行预测, 得到预测图像。
本发明实施例提供的视频解码方法和解码装置通过获取对解码块中的一 级子块进行标识的子块级二重预测标记符号,将二重预测的单位细化到了子块 级, 即细化了二重预测标记符号标识二重预测的解码块的单位, 可以增强二重 预测的灵活性, 提高解码的效率。 附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要 使用的附图作简单地介绍,显而易见地, 下面描述中的附图是本发明的一些实 施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以 才艮据这些附图获得其他的附图。 图 1为本发明实施例一提供的一种视频编码方法的流程图;
图 2为本发明实施例二提供的一种视频解码方法的流程图;
图 3为本发明实施例三提供的一种视频编码方法的流程图;
图 4为本发明实施例三、 实施例四、 实施例五与实施例六中的宏块结构示 意图;
图 5为本发明实施例四提供的一种视频解码方法的流程图;
图 6为本发明实施例五提供的一种视频编码方法的流程图;
图 7为本发明实施例六提供的一种视频解码方法的流程图;
图 8为本发明实施例七提供的一种视频编码方法的流程图;
图 9为本发明实施例七与实施例八中的宏块结构示意图;
图 10为本发明实施例八提供的一种视频解码方法的流程图;
图 12为本发明实施例提供的视频编码方法中 CABAC做算术编码时的流 程图; 图 13为本发明实施例提供的视频编码方法中 mxn子块的 sub_sop_flag语 法元素的编码方法的流程图;
图 14为本发明实施例提供的视频编码方法中 mxn子块的 sub_sop_flag语 法元素的编码方法作用的子块示意图;
图 15为本发明实施例提供的视频解码方法中 mxn子块的 sub_sop_flag语 法元素的解码方法的流程图;
图 16为本发明实施例提供的视频编码装置的结构示意图;
图 17为本发明实施例提供的视频解码装置的结构示意图。 具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部 的实施例。基于本发明中的实施例, 本领域普通技术人员在没有作出创造性劳 动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
当编解码方法采用二重预测技术时, 可以增加语法元素: 二重预测标记符 号 ( Second Order Prediction Flag, sop_flag )、 模式预测准确标志 ( Prediction Second Prediction Mode Flag , pred_sp_mode_flag ) 和第二重模式解码信息 ( Remaining Second Prediction Mode, rem_sp_mode )。
其中, sop_flag为二重预测标记符号标识, 用于标识当前编解码块是否采 用二重预测技术,其值为 0或 1。即对于一个编解码块,通过码流中的 sop_flag 来指示该编解码块中所有子块是均采用二重预测还是均不采用二重预测。当该 宏块 sop_flag为 0时,表示该编解码块中的所有子块均不采用二重预测技术进 行重建, 在编码端不需要生成语法元素 red_sp_mode_flag和 rem_sp_mode , 在解码端也不需要从码流中解析出语法元素 pred_sp_mode_flag 和 rem_sp_mode。 当该编解码块 sop_flag为 1时, 表示该编解码块中的所有子块 均采用二重预测技术进行重建, 在编码端生成语法元素 pred_sp_mode_flag和 rem_sp_mode , 经熵编码后写入码流; 在解码端从码流中解析出语法元素 pred_sp_mode_flag和 rem_sp_mode。
pred_sp_mode_flag和 rem_sp_mode为与第二重顿内预测模式相关的句法 元素。 第二重帧内预测模式的值为 0〜8, 分别代表 9种帧内预测模式。 第二重 帧内预测模式的解码方法与 H.264/AVC中的 4 X 4帧内预测模式的解码方法一 样, 即为先看预测是否准确。 若准确, 则模式等于模式预测值对应的模式; 若 预测不准确, 则需继续从码流中解析信息来得到模式。
pred_sp_mode_flag表明第二重帧内预测模式是否预测准确,其值为 0或 1。 rem_sp_mode 为第二重帧内预测模式预测不准确时用于表示第二重帧内预测 模式的信息。若当前第二重帧内预测模式预测准确, 则码流中不存在当前第二 重中贞内预测模式的句法元素 rem_sp_mode。 rem_sp_mode的值为 0 ~ 7。
图 1为本发明实施例一提供的一种视频编码方法的流程图。 该方法包括: 步骤 11、 对编码块生成 sop_flag;
如依照准则生成编码块的 sop_flag, 或者自适应生成编码块的 sop_flag。 如果自适应生成 sop_flag, 则无需将 sop_flag经熵编码后写入码流, 传输到解 码端。
步骤 12、 当所述编码块需要进行二重预测时, 对所述编码块的至少一个 子块生成 sop_flag, 所述子块的 sop_flag用于表示该子块是否进行二重预测; 当所述编码块需要进行二重预测时, 表明在所述 sop_flag对应的编码块 中, 至少有一个一级子块进行二重预测。 这种情况下, 生成所述编码块中的每 个子块的 sop_flag, 为便于描述, 后续将子块的 sop_flag称为子块级二重预测 标记符号 ( Sub Second Order Prediction Flag, sub_sop_flag ); 所述 sub_sop_flag 用于表示对应的子块是否进行二重预测;
如 sop_flag的值为 0时,表示对应的编码块中所有子块均不进行二重预测; 如 sop_flag的值为 1时, 表示对应的编码块中至少有一个子块进行二重预测。
当编码块中至少有一个子块进行二重预测时, 与步骤 11类似, 可依照准 贝1 J, 或者可自适应生成编码块中的每个子块的 sub_sop_flag。 如 sub_sop_flag 的值为 0时, 表示对应的子块不采用二重预测技术进行重建; 如 sub_sop_flag 的值为 1时, 表示对应的子块采用二重预测技术进行重建。
自适应生成 sub_sop_flag, 考虑到图像之间的变化, 始终自适应会导致信 息不准确。 具体地, 可对于第一个帧间编码的帧, 采用依照准则的方式生成, 并传输给解码端; 自适应生成方法可以是: 对于之后的帧, 根据运动矢量对应 的参考帧的已解码块的 sub_sop_flag的值,直接得到当前子块的 sub_sop_flag, 以实现灵活的编码方式。 并且,在帧级的头信息中加入新的语法元素指出当前 帧编码时是否使用自适应。如果使用自适应, 则根据运动矢量对应的参考帧的 已解码块的 sub_sop_flag的值, 直接得到当前子块的 sub_sop_flag; 如果不使 用自适应, 则按照准则生成 sub_sop_flag。 自适应地获得 sub_sop_flag的方法 不局限于此。
步骤 13、 根据所述编码块的 sop_flag 和所述编码块的至少一个 sub_sop_flag进行预测, 得到预测图像;
步骤 14、 根据所述预测图像得到预测残差, 对所述预测残差进行编码。 本实施例中, 对于所述编码块中进行二重预测的子块, 生成相应的 pred_sp_mode_flag;
如依照准则生成进行二重预测的子块的 pred_sp_mode_flag。 当 pred_sp_mode_flag的值为 0时,还需要生成 rem_sp_mode, 以便解码端根据该 生成的 rem_sp_mode进行二重预测解码重建。
对所述 red_sp_mode_flag进行熵编码后, 写入码流。
^口当 pred_sp_mode_flag的值为 1时,只需^夺 pred_sp_mode_flag进行熵编 码写入码流, 发送到解码端。 解码端根据 pred_sp_mode_flag的值自适应生成 rem_sp_mode。 当 pred_sp_mode_flag的值为 0时, 还需要将 rem_sp_mode进 行熵编码写入码流, 并发送到解码端。 解码端根据接收到的 rem_sp_mode 进 行二重预测解码重建。
本实施例提供的技术方案通过用 sub_sop_flag对编码块中的子块进行标 识, 将 sop_flag标识的二重预测的单位细化到了子块级, 即将进行二重预测编 码的块大小进行来缩小和合理的组合,从而更加充分地发挥了二重预测技术的 优势,使得当当前编码块的所有子块不都采用二重预测的编码效率有可能高于 其所有子块均采用二重预测的编码效率,或者高于其所有子块均不采用二重预 测的编码效率。本实施例提供的技术方案将二重预测标记符号标识的二重预测 的单位细化到了子块级,即细化了二重预测标记符号标识二重预测的编码块的 单位, 可以增强二重预测的灵活性, 提高编解码的效率。
当 sop_flag依照准则生成, 需要传输到解码端时, 本发明实施例提供的视 频编码方法还可包括: 对所述 sop_flag、 sub_sop_flag进行熵编码后写入码流。
当 sop_flag、 sub_sop_flag 自适应生成, 无需传输到解码端时, 本发明实 施例提供的视频编码方法还可包括:
在所述码流的帧级的头信息中加入用于指出当前帧编码时是否使用自适 应的语法元素。
当编码块的子块中还包括多个子块时, 为便于描述,将编码块的子块称为 一级子块,一级子块中的子块称为二级子块,二级子块中的子块称为三级子块, 依此类推。 sub_sop_flag的值为 0还表示对应的一级子块中的所有二级子块均 不进行二重预测; sub_sop_flag的值为 1还表示对应的一级子块的所有二级子 块均进行二重预测建。 此时, 对于所述编码块中进行二重预测的一级子块, 生 成相应的 red_sp_mode_flag以及 rem_sp_mode, 可包括:
在所述进行二重预测的一级子块中,对每个二级子块生成二级子块级二重 预则标 i己符号 ( Second Sub Second Order Prediction Flag, second_sub_sop_flag ); 所述 second_sub_sop_flag用于表示对应的二级子块是否进行二重预测;
对于进行二重预测的二级子块, 生成相应的 pred_sp_mode_flag, 或者进 一步生成 rem_sp_mode。
second_sub_sop_flag可自适应生成, 也可依照准则生成。
当 second_sub_sop_flag自适应生成时,无需传输到解码端。解码端同样通 过自适应生成 second_sub_sop_flag。
当 second_sub_sop_flag需要传输到解码端时,本发明实施例提供的视频编 码方法还可包括: 对所述 second_sub_sop_flag进行熵编码后写入所述码流。
当编码块的大小为 64 x 64, 128 x 128等等时, 该编码块可划分到三级子 块、 四级子块甚至更多级子块, 与上述 sub_sop_flag、 second_sub_sop_flag的 编码过程类似, 可将 sop_flag细化到三级子块级二重预测标记符号 (Second Sub Second Order Prediction Flag, Third_sub_sop_flag )、 四级子块级二重预 则标 i己符号 ( Forth Sub Second Order Prediction Flag, Forth_sub_sop_flag ) 等等, 以标识更小的单位是否进行二重预测, 进一步满足更加二重预测的灵活 要求, 提高编码效率。
与上述实施例一相对应地,图 2为本发明实施例二提供的一种视频解码方 法的流程图。 该方法包括:
步骤 21、 获取解码块的 sop_flag;
如接收编码端发送的码流, 当码流中包含有 sop_flag时, 可从所述码流中 解析出 sop_flag; 当码流中不包含 sop_flag, 可从所述码流中解析出帧级的头 信息中用于指出当前帧编码时是否使用自适应的语法元素,在所述当前帧编码 时使用自适应的情况下, 自适应得到 sop_flag。
步骤 22、 当所述解码块的 sop_flag指示该解码块需要进行二重预测时, 获取所述解码块的至少一个子块的 sop_flag (即至少一个 sub_sop_flag );
如当码流中包含有 sub_sop_flag时,可从所述码流中解析出 sub_sop_flag; 当码流中不包含 sub_sop_flag, 可从所述码流中解析出帧级的头信息中用于指 出当前帧编码时是否使用自适应的语法元素,在所述当前帧编码时使用自适应 的情况下, 通过自适应方法得到 sub_sop_flag。 如根据运动矢量对应的参考帧 的已解码块的 sub_sop_flag的值, 直接得到当前子块的 sub_sop_flag。 其中, sub_sop_flag详见上述步骤 12中的说明。
步骤 23、 根据所述解码块的 sop_flag 和所述解码块的至少一个 sub_sop_flag进行预测, 得到预测图像。
本实施例中,对于所述解码块中进行二重预测的一级子块,从所述码流中 解析出相应的 red_sp_mode_flag, 进行二重预测解码重建。 当 pred_sp_mode_ flag的值为 0时, 还需要进一步解析出 rem_sp_mode。
本实施例提供的技术方案通过获取对解码块中的一级子块进行标识的 sub _sop_flag, 将二重预测的单位细化到了子块级, 即将进行二重预测编码的块大 小进行来缩小和合理的组合,从而更加充分地发挥了二重预测技术的优势,使 得二重预测的对象更加多样化, 满足了不同编码效率的需求。
当一级子块被划分为多个二级子块时, 上述步骤 24中, 对于所述解码块 中进行二重预测的一级子块, 从所述码流中解析出相应的 pred_sp_mode_flag, 包括:
在所述进行二重预测的一级子块中, 获取每个二级子块的 second_sub_sop_flag; 所述 second_sub_sop_flag用于表示对应的二级子块是否 进行二重预测;
对于进行二重预测的二级子块, 从所述码流中解析出相应的 pred_sp_mod e_flag。
当解码块的大小为 64 x 64, 128 x 128等等时, 该解码块可划分到三级子 块、 四级子块甚至更多级子块, 与上述 sub_sop_flag、 second_sub_sop_flag的 解码过程类似, 可将 sop_flag细化到三级子块级二重预测标记符号 (Second Sub Second Order Prediction Flag, Third_sub_sop_flag )、 四级子块级二重预 ;则标 i己符号 ( Forth Sub Second Order Prediction Flag, Forth_sub_sop_flag ) 等等, 以标识更小的单位是否进行二重预测, 进一步满足更加二重预测的灵活 要求。
图 3为本发明实施例三提供的一种视频编码方法的流程图。 该方法包括: 步骤 31、 按照一定的准则, 如率失真优化(Rate Distortion Optimization, RDO )准则但不限于此准则, 生成 M X N级 sop_flag, 即大小为 M x N的编码 块(以下简称 M X N编码块)的 sop_flag, 并将 M X N编码块的 sop_flag经熵 编码写入码流中。 MxN编码块的 sop_flag用来表示该 MxN编码块以及其各个 mxn子块是否进行二重预测, 其中 m <= M, n <= N, 且 mxn子块属于当前 MxN编码块。
步骤 32、 与步骤 31类似, 按照一定的准则, 如 RDO准则但不限于此准 则,生成 mxn子块的 sub_sop_flag,并将 m n子块 sub_sop_flag经熵编码写入 码流中。
如果 MxN宏块的 sop_flag为 0, 则表示该 MxN编码块中所有 mxn子块 均不进行二重预测, 此时, 不需要生成 sub_sop_flag 以及 pred_sp_mode_flag 和 rem_sp_mode等二重预测相关语法元素, 也不需要经熵编码写入码流。
如果 MxN编码块的 sop_flag为 1,则表示该 MxN编码块中至少有一个 m xn子块进行二重预测。此时, 可以按照该 MxN编码块一重帧间预测模式所对 应的块划分, 按照一定准则, 如 RDO准则但不限于此准则, 为每一个 mxn子 块生成一个 sub_sop_flag, 并通过熵编码写入码流中。
例如,如图 4所示的根据第一重预测模式得到的块划分结构, 第二重预测 块大小为 8x8。 本实例不仅仅局限于这一种块划分模式, 可以有多种其他的块 划分结构, 第二重预测块大小不仅仅局限于这一种大小。 sop_flag对应着一个 16x 16大小的块, 即一个宏块, 而第一重预测模式将此 16x16大小宏块划分成 左边一个 8x 16块和右边两个 8x8块的形式, 即将宏块划分为块 1、 块 2和块 3三个子块。 如果 sop_flag为 1, 则依照一定的准则, 如 RD0准则但不限于此 准则, 分别为这三个子块生成一个 sub_sop_flag, 用以指示其对应的子块的所 有第二重预测块是否进行二重预测, 并将块 1、 块 2和块 3的 sub_sop_flag通 过熵编码写入码流中。
步骤 33、 当某个子块的 sub_sop_flag为 1时, 根据一定的准则, 如 RDO 准则但不限于此准则, 生成二重预测相关语法元素 pred_sp_mode_flag和 rem_ sp_mode等, 并对二重预测相关语法元素进行熵编码后, 写入码流中。 例如图 4中大小为 8x 16的块 1子块, 如果块 1的 sub_sop_flag为 1, 则根据一定的准 则, 如 RDO准则但不限于此准则, 生成该块 1的一组 pred_sp_mode_flag和 r em_sp_mode, 经过熵编码后写入码流中。 并且, 该块 1子块采用二重预测技 术进行编码。 对于块 1子块中所有的第二重预测块采用同一种二重预测模式 r em_sp_mode进行二重预测重建。 同样解码端也采用相同的 rem_sp_mode进行 二重预测解码重建。
当某个子块的 sub_sop_flag为 0时,对此子块的所有第二重预测块不进行 二重预测解码重建。
与上述实施例三相对应地,图 5为本发明实施例四提供的一种视频解码方 法的流程图。 解码端解码的方法包括:
步骤 51、 从码流中解析出 MxN解码块的 sop_flag, 用来获取该 MxN解 码块及其各个 mxn子块是否进行二重预测。 其中, m <= M, n <= N, 且 m xn子块属于当前 M xN解码块。
步骤 52、 解析得到 sub_sop_flag。
具体地,如果 MxN解码块的 sop_flag为 0,则表示该 MxN解码块中所有 mxn子块均不进行二重预测。 此时, 不需要进一步从码流中解析出 sub_sop_fl ag以及其他二重预测相关语法元素如 pred_sp_mode_flag和 rem_sp_mode等。 如果 ΜχΝ解码块的 sop_flag为 1,则表示该 MxN解码块中至少有一个 m xn子块采用二重预测技术进行重建。此时, 可以按照该 MxN解码块一重帧间 预测模式所对应的块划分, 为每一个 mxn子块从码流中解析出一个 sub_sop_f lag。 例如, 如图 4所示的根据第一重预测模式得到的块划分结构, 第二重预 测块大小为 8x8。 本实例不仅仅局限于这一种块划分模式, 可以有多种其他的 块划分结构, 第二重预测块大小不仅仅局限于这一种大小。 sop_flag对应 16χ 16大小的块, 即一个宏块, 而第一重预测模式将此 16x 16大小宏块划分成左 边一个 8x 16子块和右边两个 8x8子块的形式, 即块 1, 块 2和块 3三个子块。 sop_flag为 1, 则分别为这三个子块从码流中各解析出一个 sub_sop_flag,用以 指示其对应的子块的所有第二重预测块是否进行二重预测。
步骤 53、 当某个子块的 sub_sop_flag为 1时,则从码流中解析出二重预测 相关语法元素如 pred_sp_mode_flag和 rem_sp_mode等, 对此子块中所有第二 重预测块进行二重预测重建,并且这个子块中所有第二重预测块所采用的二重 预测模式相同。 例如图 4中大小为 8x 16的块 1子块, 如果块 1的 sub_sop_fla g为 1, 则从码流中解析出该 8 X 16块的一组 red_sp_mode_flag和 rem_sp_mo de,对其中所有的第二重预测块进行二重预测解码重建, 并采用同一种二重预 测模式。
当某个子块的 sub_sop_flag为 0时,对此子块的所有第二重预测块不进行 二重预测解码重建。
图 6为本发明实施例五提供的一种视频编码方法的流程图。 该方法包括: 步骤 61、 按照一定的准则, 如 RDO准则但不限于此准则, 根据参考帧或 当前帧已解码块的信息自适应地获得 M N编码块的 sop_flag, 用来表示该 M xN编码块及其各个 mxn子块是否进行二重预测。 其中, m <= M, n <= N, 且 mxn子块属于当前 MxN编码块。
步骤 62、 与步骤 61类似, 按照一定的准则, 如 RDO准则但不限于此准 则, 根据参考帧或当前帧已解码块的信息自适应地获得 mxn子块的 sub_sop_f lag。
如果 MxN编码块的 sop_flag为 0, 则表示该 MxN编码块中所有 mxn子 块均不进行二重预测。 此时, 不需要进一步获得 sub_sop_flag及其他二重预测 相关语法元素如 pred_sp_mode_flag和 rem_sp_mode等。
如果 MxN编码块的 sop_flag为 1,则表示该 MxN编码块中至少有一个 m xn子块进行二重预测。此时, 可以按照该 MxN编码块一重帧间预测模式所对 应的块划分, 按照一定准则, 如 RDO准则但不限于此准则, 根据参考帧或当 前帧已解码块的信息, 为每一个 mxn子块自适应地获得一个 sub_sop_flag。 例 如,如图 4所示的根据第一重预测模式得到的块划分结构, 第二重预测块大小 为 8x8。 本实例不仅仅局限于这一种块划分模式, 可以有多种其他的块划分结 构, 第二重预测块大小不仅仅局限于这一种大小。 sop_flag对应大小为 16x 16 的块, 即一个宏块。 第一重预测模式将此 16x 16大小宏块划分成左边一个 8x1 6块和右边两个 8x8块的形式, 即块 1、 块 2和块 3三个子块。 如果 sop_flag 为 1, 则通过一定的准则, 如 RDO准则但不限于此准则, 分别为这三个子块, 根据参考帧或当前帧已解码块的信息自适应地获得一个 sub_sop_flag, 用以指 示其对应的子块的所有第二重预测块是否进行二重预测。 自适应地获得 sub_s op_flag具体地可包括: 根据运动矢量对应的参考帧的已解码块的 sub_sop_fla g的值, 直接得到当前子块的 sub_sop_flag。 自适应地获得 sub_sop_flag的方 法不局限于上面描述的方法。
步骤 63、 当某个子块的 sub_sop_flag为 1时, 根据一定的准则, 如 RDO 准则但不限于此准则, 生成二重预测相关语法元素如 red_sp_mode_flag 和 rem_sp_mode等, 并对二重预测相关语法元素进行熵编码, 写入码流中。
当某个子块的 sub_sop_flag为 0时,对此子块的所有第二重预测块不进行 二重预测解码重建。 例如图 4中大小为 8x 16的块 1子块, 其, 如果块 1的 su b_sop_flag为 1, 则根据一定的准则, 如 RDO准则但不限于此准则, 生成该块 1子块的一组 red_sp_mode_flag和 rem_sp_mode , 并对 red_sp_mode_flag和 rem_sp_mode进行熵编码后, 写入码流中。 该子块进行二重预测。 对于块 1子 块中所有的第二重预测块采用同一种二重预测模式 rem_sp_mode进行二重预 测。 同样, 解码端也采用相同的 rem_sp_mode进行二重预测解码重建。
与实施例五相对应地,图 7为本发明实施例六提供的一种视频解码方法的 流程图。 解码端解码的方法包括:
步骤 71、根据参考帧或当前帧已解码块的信息自适应地得出 MxN解码块 的 sop_flag, 用来表示该 MxN解码块及其各个 mxn子块是否进行二重预测。 其中 m <= M, n <= N, 且 mxn子块属于当前 MxN解码块。
步骤 72、 自适应获得 sub_sop_flag。
具体地,如果 MxN解码块的 sop_flag为 0,则表示该 MxN解码块中所有 mxn子块均不进行二重预测。 此时, 不需要进一步获得 sub_sop_flag及其他二 重预测相关语法元素如 pred_sp_mode_flag和 rem_sp_mode等。
如果 MxN解码块的 sop_flag为 1,则表示该 MxN解码块中至少有一个 m n子块进行二重预测。此时, 可以按照该 ΜχΝ解码块一重帧间预测模式所对 应的块划分, 根据参考帧或当前帧已解码块的信息, 为每一个 mxn子块自适 应地得出一个 sub_sop_flag。 例如, 如图 4所示的根据第一重预测模式得到的 块划分结构, 第二重预测块大小为 8x8。 本实例不仅仅局限于这一种块划分模 式, 可以有多种其他的块划分结构, 第二重预测块大小不仅仅局限于这一种大 小。 sop_flag对应大小为 16x 16的块, 即一个宏块, 第一重预测模式将此 16 < 16大小宏块划分成左边一个 8x 16块和右边两个 8x8块的形式, 即块 1、 块 2 和块 3三个子块。 如果 sop_flag为 1, 则分别为这三个子块根据参考帧或当前 帧已解码块的信息自适应地得出一个 sub_sop_flag, 用以指示其对应的子块的 所有第二重预测块是否进行二重预测。自适应地获得 sub_sop_flag具体可包括: 根据运动矢量对应的参考帧的已解码块的 sub_sop_flag的值直接得到当前子块 的 sub_sop_flag。 自适应地获得 sub_sop_flag的方法不局限于上面描述的方法。
步骤 73、 当某个子块的 sub_sop_flag为 1时,则从码流中解析出二重预测 相关语法元素如 pred_sp_mode_flag和 rem_sp_mode等, 对此子块中所有第二 重预测块进行二重预测,并且这个子块中所有第二重预测块所采用的二重预测 模式相同。 例如图 4中的块 1子块, 其大小为 8x 16, 如果块 1的 sub_sop_fla g为 1, 则从码流中解析出该 8 X 16块的一组 red_sp_mode_flag和 rem_sp_mo de,对其中所有的第二重预测块进行二重预测解码重建, 并采用同一种二重预 测模式。
当某个子块的 sub_sop_flag为 0时,对此子块的所有第二重预测块不进行 二重预测解码重建。
图 8为本发明实施例七提供的一种视频编码方法的流程图。 该方法包括: 步骤 81、 按照一定的准则, 如 RDO准则但不限于此准则, 生成 MxN编 码块的 sop_flag, 并将 ΜχΝ编码块的 sop_flag经熵编码后写入码流中。 ΜχΝ 编码块的 sop_flag用来表示该 MxN编码块及其各个 mxn子块是否进行二重预 测。 其中 m <= M, n <= N, 且 mxn子块属于当前 MxN编码块。
步骤 82、 与上述步骤 81类似, 按照一定的准则, 如 RDO则但不限于此 准则,生成 mxn子块的 sub_sop_flag,并将 m n子块的 sub_sop_flag经熵编码 后写入码流中。
具体地,如果 MxN编码块的 sop_flag为 0,则表示该 MxN编码块中所有 mxn子块均不进行二重预测。 此时, 不需要进一步通过熵编码在码流中写入 s ub_sop_flag以及其他二重预测相关语法元素如 pred_sp_mode_flag和 rem_sp_ mode等。
如果 MxN编码块的 sop_flag为 1, 则表示该 MxN编码块中至少有一个 mxn子块进行二重预测。 此时, 可以按照该 MxN编码块一重帧间预测模式所 对应的块划分, 按照一定准则, 如 RDO ( Rate Distortion Optimization )准则但 不限于此准则, 为每一个 mxn—级子块生成一个 sub_sop_flag, 并进行熵编码 后写入码流中。 例如, 如图 9所示的根据第一重预测模式得到的块划分结构, 第二重预测块大小为 8x8。 本实例不仅仅局限于这一种块划分模式, 可以有多 种其他的块划分结构, 第二重预测块大小不仅仅局限于这一种大小。 sop_flag 对应大小为 32x32的宏块, 第一重预测模式将此大小为 32x32的宏块划分成 四个 16x 16—级子块的结构, 即一级子块 A、 一级子块^ 一级子块 C和一 级子块 D。每个大小为 16x 16的一级子块又划分成 4个大小为 8x8的二级子块。 如果 sop_flag为 1, 则分别根据一定的准则, 如 RD0准则但不限于此准则, 为这四个一级子块生成一个 sub_sop_flag, 用以指示其对应的一级子块的所有 第二重预测块是否进行二重预测,并对 sub_sop_flag进行熵编码后写入码流中。
步骤 83、 当某个一级子块的 sub_sop_flag为 1时,则为该一级子块中的每 一个二级子块根据一定的准则, 如 RD0 准则但不限于此准则, 生成一个 second_sub_sop_flag, 用以表示该二级子块中第二重预测块是否均进行二重预 测解码重建, 并经过熵编码后写入码流中。
如果某个二级子块的 second_sub_sop_flag为 0,则表示该二级子块中所有 第二重预测块均不进行二重预测。此时, 不需要进一步通过熵编码在码流中写 入 sub_sop_flag以及其他二重预测相关语法元素如 pred_sp_mode_flag和 rem— sp_mode等。
如果某个二级子块的 second_sub_sop_flag为 1,则表示该二级子块中所有 第二重预测块均进行二重预测,并且这个二级子块中所有第二重预测块所采用 的二重预测模式相同。 此时,根据一定的准则, 如 RDO准则但不限于此准则, 生成二重预测相关语法元素如 pred_sp_mode_flag和 rem_sp_mode等, 并通过 熵编码写入码流中。
例如图 9中大小为 16x16的一级子块 B, 如果其 sub_sop_flag为 1, 则根 据一定的准则, 如 RDO准则但不限于此准则, 为其每个 8x8二级子块分别生 成一个 second_sub_sop_flag, 并通过熵编码写入码流中。 如果某个 8x8二级子 块的 second_sub_sop_flag为 1, 才艮据一定的准则, 如 RDO准则但不限于此准 贝1 J, 生成二重预测相关语法元素如 pred_sp_mode_flag和 rem_sp_mode等, 并 通过熵编码写入码流中, 并对该二级子块进行二重预测。对于该二级子块中所 有的第二重预测块采用同一种二重预测模式 rem_sp_mode进行二重预测。 同 样解码端也采用相同的 rem_sp_mode进行二重预测解码重建。
当某个一级子块的 sub_sop_flag为 0时,该一级子块中所有子块均不进行 二重预测解码重建。
与上述实施例七相对应地, 图 10为本发明实施例八提供的一种视频解码 方法的流程图。 解码端解码的方法包括:
步骤 101、 从码流中解析出 ΜχΝ解码块的 sop_flag, 用来表示该 MxN解 码块及其各个 mxn子块是否采用二重预测技术。其中 m <= M, n <= N,且 m n 子块属于当前 MxN解码块。
步骤 102、 解析子块的 sub_sop_flag。
具体地,如果 MxN解码块的 sop_flag为 0,则表示该 MxN解码块中所有 mxn子块均不进行二重预测。此时,不需要进一步从码流中解析出 sub_sop_flag 以及其他二重预测相关语法元素如 pred_sp_mode_flag和 rem_sp_mode等。
如果 MxN解码块的 sop_flag为 1, 则表示该 MxN解码块中至少有一个 mxn子块进行二重预测。 此时, 可以按照该 MxN解码块一重帧间预测模式所 对应的块划分, 为每一个大小为 mxn 的一级子块从码流中解析出一个 sub_sop_flag。 例如, 如图 9所示的根据第一重预测模式得到的块划分结构, 第二重预测块大小为 8x8。 本实例不仅仅局限于这一种块划分模式, 可以有多 种其他的块划分结构, 第二重预测块大小不仅仅局限于这一种大小。 sop_flag 对应大小为 32x32的宏块, 第一重预测模式将此 32x32大小宏块划分成四个 大小为 16x 16—级子块的结构, 即一级子块 A, 一级子块^ 一级子块 C和 一级子块 D。每个 16x 16—级子块又划分成 4个 8x8的二级子块。如果 sop_flag 为 1, 则分别为这四个一级子块从码流中各解析出一个 sub_sop_flag, 用以指 示其对应的一级子块的所有第二重预测块是否进行二重预测。
步骤 103、 当某个一级子块的 sub_sop_flag为 1时, 则为该一级子块中的 每一个二级子块分别从码流中解析出一个 second_sub_sop_flag,用以表示该二 级子块中第二重预测块是否均进行二重预测解码重建。
如果某个二级子块的 second_sub_sop_flag为 0,则表示该二级子块中所有 第二重预测块均不进行二重预测。 此时, 不需要进一步从码流中解析出 sub_sop_flag 以及其他二重预 > 'J 目关语法元素如 pred_sp_mode_flag 和 rem_sp_mode等。
如果某个二级子块的 second_sub_sop_flag为 1,则表示该二级子块中所有 第二重预测块均进行二重预测,并且这个二级子块中所有第二重预测块所采用 的二重预测模式相同。
例如图 9中大小为 16x 16的一级子块 A, 如果其 sub_sop_flag为 1, 则从 码流中分别为其每个 8x8二级子块分别解析出一个 second_sub_sop_flag。如果 某个 8x8二级子块的 second_sub_sop_flag为 1,则从码流中解析出该 8 <8二级 子块的一组 red_sp_mode_flag和 rem_sp_mode, 对其中所有的第二重预测块 进行二重预测解码重建, 并采用同一种二重预测模式。
当某个一级子块的 sub_sop_flag为 0时,该一级子块中所有子块均不进行 二重预测解码重建。
上述实施例一、 实施例三、 实施例五、 实施例七及实施例九中所涉及的 sub_sop_flag, 可采用基于上下文的自适应二进制算术编码( Context Adaptive Binary Arithmetic Coding, CAB AC )的方式进行编码, 以保证在增加语法元素 的情况下仍然能够使二重预测模式信息的编码性能得到提升。 CABAC 的基本编码步骤可分为二进制化、上下文建模、二进制算术编码 三步。 二进制化主要是将非二进制的各语法元素值转换成二进制的比特序列, 如果语法元素本身是二进制的, 则该步骤可省略。 上下文建模主要是为已二进 制化的语法元素的比特序列的每一位提供概率模型, 进行概率预测,有时会需 要以前已编码的语法元素或者比特序列。二进制算术编码有两种编码模式,一 种是常规编码模式(regular coding mode ), 另一种是旁路编码模式(by pass coding mode )。 其中, 常规编码模式采用上下文建模, 而旁路编码模式为了加 快编码速度不采用上下文建模, 整个编码过程如图 11所示。
步骤 111、二进制化。为了降低算术编码的复杂度,提高编码速度, CABAC 采用了二进制的算术编码而非其它多进制的算术编码。 为此, 需要事先将每一 语法元素转换成独一无二的二进制序列,该二进制序列在 H.264中称为二进制 字符串 (bin string )。 同时, 为了便于后面的算术编码尽可能降低编码复杂度, 应该尽可能减小二进制序列的大小。 CABAC采用了 4种基本二进制转换方式。
步骤 112、 上下文建模。 在算术编码前, 必须进行上下文建模。 所谓上下 文建模, 就是建立概率模型, 对每一位待编码的比特值和概率进行预测。 在 H.264中, 一共有 399种上下文模型, 这些模型可分为 4种类型。 第 1种类型 的模型必须根据它相邻的已编码的语法元素构成,一般是用其左边和上边的对 应语法元素来建立相应的 ¾¾率模型,对当前语法元素进行 ¾¾率预测。 第 2种模 型仅局限于对宏块类型和子块类型的应用。 其中第 N 比特的概率模型的选定 要参考前面已编码第 N-1比特所采用的模型。第 3种和第 4种模型仅用于残余 数据的编码, 这两种模型都依赖编码块的类型。其中第 3种模型依赖的不是已 编码的数据, 而是数据在扫描路径中的位置。 第 4种模型则要计算该比特所在 电平之前已编码的电平数。 在 H.264中, 除了这些条件概率模型之外, 还有一 些固定概率模型, 它们对待编码的比特提供固定的概率预测, 不因以前已编码 的比特而改变。
步骤 113、 二进制算术编码。 在 CABAC中, 对每一待编码的比特位的值 0或 1, 用最大概率符号( most probable symbol, MPS )和最小概率符号( least probable symbol, LPS )表示。 其中, MPS表示最可能出现的状态, 对应 0和 1中概率大的那一个。 LPS表示最不可能出现的状态, 对应 0和 1中概率小的 那一个。 这样只需要一个变量值来保存 LPS 出现的概率大小。 同时, 它把概 率量化成 64个等级, 每一概率由其对应的索引 σ唯一给出。 这样在 CABAC 中, 每一个上下文模型可由两个变量唯一决定。
CABAC做算术编码时的流程图见图 12。 CABAC的概率模型很有效地降 低了概率估计和刷新中的计算量。 CABAC首先建立一个 4x64的二维表格, 存储预先计算好的乘法结果。 表格的入口参数毫无疑问一格来自 Px, 另一个 来自 R。 Px可以直接以 σ作为参数, R的量化公式为:
p = (R〉〉6) & 3。
其中, R表示当前区间的大小, p表示 R的结果, 〉〉表示比特级右移, &表示比特级 "与" 操作。
每次在需要做乘法运算时,携带 p和 σ进行查表操作就可以得到结果。 简 历了概率模型和乘法模型后,在递进计算过程中 CABAC必须保存一下变量的 记录状态, 包括: 当前区间的下限1^、 当前区间的大小 、 当前 MPS字符、 LPS的概率编号 σ。
如图 13所示, 图 13为本发明实施例提供的视频编码方法中 mxn子块的 sub_sop_flag语法元素的编码方法的流程图。 以图 14所示的子块 A、 子块 B 及子块 C为例, mxn子块的 sub_sop_flag语法元素的编码过程包括:
步骤 131、 对 sub_sop_flag建立三个不同的概率模型, 并且进行相应的概 率模型初始化。 假设这三个概率模型的标号分别为 0、 1、 2。
步骤 132、根据当前 mxn子块 C的相邻的左边的 mxn子块 A和上边的 mxn 子块 B的 sub_sop_flag的值, 来进行当前 m n子块 C的 sub_sop_flag的概率 模型的选择。 选择公式如下:
Context_sub_sop_flag(C) = sub_sop_flag(A) + sub_sop_flag(B)。
其中, Context— sub_sop_flag(C)表示当前 mxn子块 C要采用的算术编码解 码的积无率模型。 sub_sop_flag( x )表示 mxn子块 x的 sub_sop_flag的值。若 mxn 子块 X不可用, 则 sub_sop_flag ( x ) =0。 £设子块 A、 子块 B的 sub_sop_flag 均为 0,则选择概率模型 0。若子块 A的 sub_sop_flag为 0,子块 B的 sub_sop_flag 为 1, 则选择概率模型 1。 若子块 A、 子块 B的 sub_sop_flag为 1, 则选择概 率模型 2。
步骤 133、 利用选择的概率模型进行 CABAC编码。 由于 CABAC采用了 高效的算术编码思想, 同时充分考虑视频流相关统计特性, 因而大大提高了编 码效率。
相对应地, 图 15 为本发明实施例提供的视频解码方法中 mxn子块的 sub_sop_flag语法元素的解码方法的流程图, 解码过程包括:
步骤 151、 对 sub_sop_flag建立三个不同的概率模型, 并且进行相应的概 率模型初始化。 令这三个概率模型的标号分别为 0、 1、 2、 3。
步骤 152、根据当前 mxn子块 C的相邻的左边的 mxn子块 A和上边的 mxn 子块 B的 sub_sop_flag的值, 来进行当前 m n子块 C的 sub_sop_flag的概率 模型的选择。 概率模型的选择公式为:
Context— sub_sop_flag(C) = 2 χ sub_sop_flag(A) + sub— sop_flag(B)。
其中, Context— sub_sop_flag(C)表示当前 mxn子块 C要采用的算术编码解 码的积无率模型。 sub_sop_flag( x )表示 mxn子块 x的 sub_sop_flag的值。若 mxn 子块 X不可用, 则 sub_sop_flag ( x ) =0。 £设子块 A、 子块 B的 sub_sop_flag 为 0,则选择概率模型 0。若子块 A的 sub_sop_flag为 0且子块 B的 sub_sop_flag 为 1, 或子块 A的 sub_sop_flag为 1且 B块的 sub_sop_flag为 0, 则选择概率 模型 1。 若子块 A、 子块 B的 sub_sop_flag为 1, 则选择概率模型 2。
步骤 153、 利用选择的概率模型进行 CABAC码流解析, 也即进行二进制 算术解码, 得到一个二进制 (bin ), 将这个 bin的值直接赋给 sub_sop_flag。
图 16为本发明实施例提供的视频编码装置的结构示意图。 该编码装置包 括: 第一生成模块 161、 第二生成模块 162、 预测模块 163及编码模块 164。 第一生成模块 161用于对编码块生成 sop_flag, 如所述第一生成模块 161通过 自适应方法得到所述编码块的 sop_flag, 详见上述方法实施例中步骤 11 的说 明。 第二生成模块 162用于当所述编码块需要进行二重预测时,对所述编码块 的至少一个子块生成子块的 sop_flag即 sub_sop_flag, 所述 sub_sop_flag用于 表示该子块是否进行二重预测;如所述第二生成模块 162针对所述编码块中的 每个子块通过自适应方法得到 sub_sop_flag。 详见上述方法实施例中步骤 12 的说明。预测模块 163用于根据所述编码块的 sop_flag和所述编码块的至少一 个 sub_sop_flag进行预测, 得到预测图像; 编码模块 164用于根据所述预测图 像, 得到预测残差, 对所述预测残差进行编码。 本发明实施例提供的视频编码装置还可包括:第三生成模块 165用于对于 所述编码块中进行二重预测的子块, 生成相应的 pred_sp_mode_flag, 详见上 述方法实施例中的说明。 此时, 编码模块 164 还可用于对所述 pred_sp_mode_flag进行熵编码后, 写入码流。 当 sop—flag、 sub_sop_flag需要 传输到解码端时, 所述编码模块 164还用于对所述 sop_flag、 sub_sop_flag进 行熵编码后,写入码流。对所述 sub_sop_flag进行熵编码时,所述编码模块 164 可具体用于进行 CABAC。
本实施例中,视频编码装置通过用 sub_sop_flag对编码块中的子块进行标 识, 将 sop_flag标识的二重预测的单位细化到了子块级, 即将进行二重预测编 码的块大小进行来缩小和合理的组合,从而更加充分地发挥了二重预测技术的 优势,使得当当前编码块的所有子块不都进行二重预测的编码效率有可能高于 其所有子块均进行二重预测的编码效率,或者高于其所有子块均不进行二重预 测的编码效率。
当 sop_flag、 sub_sop_flag无需传输到解码端时, 本发明实施例提供的视 频编码装置还可包括: 头信息设置模块 166。 该头信息设置模块 166用于在所 述码流的帧级的头信息中加入用于指出当前帧编码时是否使用自适应的语法 元素, 以便解码端根据该语法元素决定是从码流中解析获得 sop_flag、 sub_sop_flag, 还是通过自适应获得 sop_flag、 sub_sop_flag。
当进行二重预测的子块被划分为多个二级子块时, 所述第三生成模块 165 可包括: 第一生成子模块 167及第二生成子模块 168。 其中二级子块详见上述 方法实施例中的说明。
第一生成子模块 167用于在所述进行二重预测的一级子块中,对每个二级 子块生成 second_sub_sop_flag;所述 second_sub_sop_flag用于表示对应的二级 子块是否进行二重预测。第二生成子模块 168用于对于进行二重预测的二级子 块, 生成相应的 pred_sp_mode_flag。
此时,所述编码模块 164还用于对所述 second_sub_sop_flag进行熵编码后, 写入所述码流。
图 17为本发明实施例提供的视频解码装置的结构示意图。 该视频解码装 置包括: 第一获取模块 171、 第二获取模块 172及解码预测模块 173。 第一获 取模块 171用于获取解码块的 sop_flag。 如所述第一获取模块 171具体用于从 所述码流中解析出解码块的 sop_flag, 详见上述方法实施例中步骤 21的说明。 第二获取模块 172用于当所述解码块的 sop_flag指示该解码块需要进行二重预 测时, 获取所述解码块的至少一个子块的 sop_flag即 sub_sop_flag; 如所述第 二获取模块 172 具体用于从所述码流中解析出所述解码块中的每个子块的 sub_sop_flag。 具体地, 所述第二获取模块 172可用于采用基于上下文的二进 制算术解码从所述码流中解析出所述解码块中的每个子块的 sub_sop_flag。 所 述 sub_sop_flag用于表示对应的子块是否进行二重预测,详见上述方法实施例 中步骤 22的说明。 解码预测模块 173用于根据所述解码块的二 sop_flag和所 述解码块的至少一个 sub_sop_flag进行预测, 得到预测图像。
本发明实施例提供的视频解码装置还可包括第三获取模块 174, 用于对于 所述解码块中进行二重预测的子块, 从所述码流中解析出相应的 pred_sp_mode_flag, 以用于进行二重预测, 详见上述方法实施例的说明。
本发明实施例提供的视频解码装置还可包括解析模块 175, 用于从所述码 流中解析出帧级的头信息中用于指出当前帧编码时是否使用自适应的语法元 素。 当当前帧编码时使用自适应时, 所述第一获取模块 171具体用于通过自适 应方法得到解码块的 sop_flag; 所述第二获取模块 172具体用于通过自适应方 法得到所述解码块中的每个 sub_sop_flag。
当一级子块(详见上述方法实施例的说明)被划分为多个二级子块时, 所 述第三获取模块 174可包括: 获取子模块 176及解析子模块 177。 获取子模块 176 用于在所述进行二重预测的一级子块中, 获取每个二级子块的 second_sub_sop_flag; 所述 second_sub_sop_flag用于表示对应的二级子块是否 进行二重预测。解析子模块 177用于对于进行二重预测的二级子块,从所述码 流中解析出相应的 pred_sp_mode_flag。
本实施例中,采用二重预测的视频解码装置通过获取对解码块中的一级子 块进行标识的 sub_sop_flag, 将二重预测的单位细化到了子块级, 即将进行二 重预测编码的块大小进行来缩小和合理的组合,从而更加充分地发挥了二重预 测技术的优势,使得二重预测的对象更加多样化,满足了不同编码效率的需求。
本实施例提供的技术方案将二重预测标记符号标识的二重预测的单位细 化到了子块级, 即细化了二重预测标记符号标识二重预测的编码块的单位, 可 以增强二重预测的灵活性, 提高编解码的效率。
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可 以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存 储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的存储 介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代码的介质。
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其限 制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术人员 应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改,或者对其 中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技术方案的 本质脱离本发明各实施例技术方案的精神和范围。

Claims

权 利 要 求
1、 一种视频编码方法, 其特征在于, 包括:
对编码块生成二重预测标记符号;
当所述编码块需要进行二重预测时,对所述编码块的至少一个子块生成二 重预测标记符号,所述子块的二重预测标记符号用于表示该子块是否进行二重 预测;
根据所述编码块的二重预测标记符号和所述编码块的至少一个子块的二 重预测标记符号进行预测, 得到预测图像;
根据所述预测图像, 得到预测残差, 对所述预测残差进行编码。
2、 根据权利要求 1所述的视频编码方法, 其特征在于, 还包括: 对于所述编码块中进行二重预测的子块, 生成相应的模式预测准确标志, 以用于进行二重预测。
3、 根据权利要求 1所述的视频编码方法, 其特征在于, 还包括: 对所述 编码块的二重预测标记符号、所述子块的二重预测标记符号进行熵编码后, 写 入码流, 发送给解码端。
4、 根据权利要求 1所述的视频编码方法, 其特征在于, 对编码块生成二 重预测标记符号包括: 通过自适应方法得到所述编码块的二重预测标记符号。
5、 根据权利要求 1所述的视频编码方法, 其特征在于, 对所述编码块的 至少一个子块生成二重预测标记符号包括:针对所述编码块的至少一个子块通 过自适应方法得到子块的二重预测标记符号。
6、 根据权利要求 4或 5所述的视频编码方法, 其特征在于, 还包括: 在编码得到的码流的帧级的头信息中加入用于指示当前帧编码时是否使 用自适应的语法元素。
7、 一种视频解码方法, 其特征在于, 包括:
获取解码块的二重预测标记符号;
当所述解码块的二重预测标记符号指示该解码块需要进行二重预测时,获 取所述解码块的至少一个子块的二重预测标记符号;
根据所述解码块的二重预测标记符号和所述解码块的至少一个子块的二 重预测标记符号进行预测, 得到预测图像。
8、 根据权利要求 7所述的视频解码方法, 其特征在于, 还包括: 对于所 述解码块中进行二重预测的子块,从所述码流中解析出相应的模式预测准确标 志, 以用于进行二重预测。
9、 根据权利要求 7所述的视频解码方法, 其特征在于, 还包括: 从所述 码流中解析出帧级的头信息中用于指出当前帧编码时是否使用自适应的语法 元素。
10、 根据权利要求 9所述的视频解码方法, 其特征在于,
获取解码块的二重预测标记符号包括:在所述当前帧编码时使用自适应的 情况下, 通过自适应方法得到所述解码块的二重预测标记符号。
11、 根据权利要求 9所述的视频解码方法, 其特征在于,
获取所述解码块的至少一个子块的二重预测标记符号包括:在所述当前帧 编码时使用自适应的情况下,通过自适应方法得到所述解码块中的每个子块的 二重预测标记符号。
12、 一种视频编码装置, 其特征在于, 包括:
第一生成模块, 用于对编码块生成二重预测标记符号; 第二生成模块, 用于当所述编码块需要进行二重预测时,对所述编码块的 至少一个子块生成二重预测标记符号,所述子块的二重预测标记符号用于表示 该子块是否进行二重预测;
预测模块,用于根据所述编码块的二重预测标记符号和所述编码块的至少 一个子块的二重预测标记符号进行预测, 得到预测图像。
13、 根据权利要求 12所述的视频编码装置, 其特征在于, 还包括: 编码模块, 用于根据所述预测图像, 得到预测残差, 对所述预测残差进行 编码。
14、 根据权利要求 12所述的视频编码装置, 其特征在于, 还包括: 第三生成模块, 用于对于所述编码块中进行二重预测的子块, 生成相应的 模式预测准确标志, 以用于进行二重预测。
15、 根据权利要求 13所述的视频编码装置, 其特征在于, 所述编码模块 还用于对所述编码块的二重预测标记符号、所述子块的二重预测标记符号进行 熵编码后, 写入码流。
16、 根据权利要求 12所述的视频编码装置, 其特征在于,
所述第一生成模块具体用于通过自适应方法得到所述编码块的二重预测 标记符号。
17、 根据权利要求 12所述的视频编码装置, 其特征在于,
所述第二生成模块具体用于针对所述编码块中的至少一个子块通过自适 应方法得到子块的二重预测标记符号。
18、 根据权利要求 16或 17所述的视频编码装置, 其特征在于, 还包括: 头信息设置模块, 用于在所述编码模块编码得到的码流的帧级的头信息 中, 加入用于指出当前帧编码时是否使用自适应的语法元素。
19、 一种视频解码装置, 其特征在于, 包括:
第一获取模块, 用于获取解码块的二重预测标记符号;
第二获取模块,用于当所述解码块的二重预测标记符号指示该解码块需要 进行二重预测时, 获取所述解码块的至少一个子块的二重预测标记符号; 解码预测模块,用于根据所述解码块的二重预测标记符号和所述解码块的 至少一个子块的二重预测标记符号进行预测, 得到预测图像。
20、 根据权利要求 19所述的视频解码装置, 其特征在于, 还包括: 第三获取模块, 用于对于所述解码块中进行二重预测的子块,从所述码流 中解析出相应的模式预测准确标志, 以用于进行二重预测。
21、 根据权利要求 19所述的视频解码装置, 其特征在于, 还包括: 解析 模块,用于从所述码流中解析出帧级的头信息中用于指示当前帧编码时是否使 用自适应的语法元素。
22、 根据权利要求 21所述的视频解码装置, 其特征在于,
所述第一获取模块具体用于通过自适应方法得到所述解码块的二重预测 标记符号。
23、 根据权利要求 21所述的视频解码装置, 其特征在于,
所述第二获取模块具体用于通过自适应方法得到所述解码块中的每个子 块的二重预测标记符号。
PCT/CN2010/079117 2009-12-09 2010-11-25 视频编码方法、解码方法、编码及解码装置 WO2011069412A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP10835447.3A EP2503783B1 (en) 2009-12-09 2010-11-25 Video encoding method, decoding method, encoding and decoding device
US13/492,498 US20120243608A1 (en) 2009-12-09 2012-06-08 Video coding and decoding method, and coding and decoding apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN2009102512821A CN102098519B (zh) 2009-12-09 2009-12-09 视频编码方法、解码方法、编码及解码装置
CN200910251282.1 2009-12-09

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/492,498 Continuation US20120243608A1 (en) 2009-12-09 2012-06-08 Video coding and decoding method, and coding and decoding apparatus

Publications (1)

Publication Number Publication Date
WO2011069412A1 true WO2011069412A1 (zh) 2011-06-16

Family

ID=44131355

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/079117 WO2011069412A1 (zh) 2009-12-09 2010-11-25 视频编码方法、解码方法、编码及解码装置

Country Status (4)

Country Link
US (1) US20120243608A1 (zh)
EP (1) EP2503783B1 (zh)
CN (1) CN102098519B (zh)
WO (1) WO2011069412A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130114693A1 (en) * 2011-11-04 2013-05-09 Futurewei Technologies, Co. Binarization of Prediction Residuals for Lossless Video Coding
CN107396118A (zh) * 2011-07-18 2017-11-24 太阳专利托管公司 编码方法和编码装置
CN108810541A (zh) * 2012-01-20 2018-11-13 佳能株式会社 从视频数据的位流解码多个编码单位的方法

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9549190B2 (en) * 2009-10-01 2017-01-17 Sk Telecom Co., Ltd. Method and apparatus for encoding/decoding image using variable-size macroblocks
US20140003504A1 (en) * 2012-07-02 2014-01-02 Nokia Corporation Apparatus, a Method and a Computer Program for Video Coding and Decoding
CA2924501C (en) 2013-11-27 2021-06-22 Mediatek Singapore Pte. Ltd. Method of video coding using prediction based on intra picture block copy
CN104717511B (zh) * 2013-12-13 2018-10-16 联发科技(新加坡)私人有限公司 视频编码或解码的方法及装置
WO2015085575A1 (en) 2013-12-13 2015-06-18 Mediatek Singapore Pte. Ltd. Methods for background residual prediction
CN104301728B (zh) * 2014-10-15 2017-10-31 上海交通大学 基于结构化稀疏字典学习的压缩视频采集与重构***
CN109121465B (zh) * 2016-05-06 2023-06-06 交互数字麦迪逊专利控股公司 用于运动补偿残差预测的***和方法
KR102531386B1 (ko) 2016-10-04 2023-05-12 주식회사 비원영상기술연구소 영상 데이터 부호화/복호화 방법 및 장치
US20190253624A1 (en) * 2017-07-17 2019-08-15 Ki Baek Kim Image data encoding/decoding method and apparatus
CN111416975B (zh) * 2019-01-08 2022-09-16 华为技术有限公司 预测模式确定方法和装置
CN109996068A (zh) * 2019-04-12 2019-07-09 中国科学技术大学 一种视频运动信息编码方法及装置
EP4320866A1 (en) * 2021-04-09 2024-02-14 InterDigital CE Patent Holdings, SAS Spatial illumination compensation on large areas

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101129072A (zh) * 2005-01-12 2008-02-20 诺基亚公司 用于可扩展视频编码中的层间预测模式编码的方法和***
CN101137065A (zh) * 2006-09-01 2008-03-05 华为技术有限公司 图像编码方法、解码方法、编码器、解码器、编解码方法及编解码器
CN101159875A (zh) * 2007-10-15 2008-04-09 浙江大学 二重预测视频编解码方法和装置
CN101262607A (zh) * 2008-04-11 2008-09-10 浙江大学 二重预测视频编解码方法和装置

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7170937B2 (en) * 2002-05-01 2007-01-30 Texas Instruments Incorporated Complexity-scalable intra-frame prediction technique
KR100667808B1 (ko) * 2005-08-20 2007-01-11 삼성전자주식회사 영상의 인트라 예측 부호화, 복호화 방법 및 장치
US8130822B2 (en) * 2006-07-10 2012-03-06 Sharp Laboratories Of America, Inc. Methods and systems for conditional transform-domain residual accumulation
CN101502124B (zh) * 2006-07-28 2011-02-23 株式会社东芝 图像编码和解码的方法以及装置
US8059902B2 (en) * 2006-10-31 2011-11-15 Ntt Docomo, Inc. Spatial sparsity induced temporal prediction for video compression
KR100823287B1 (ko) * 2007-01-03 2008-04-21 삼성전자주식회사 전역 차이 벡터를 이용한 다시점 영상의 부호화, 복호화방법 및 장치
EP2081155B1 (en) * 2008-01-21 2011-11-16 Telefonaktiebolaget LM Ericsson (publ) Prediction-based image processing
WO2010041858A2 (en) * 2008-10-06 2010-04-15 Lg Electronics Inc. A method and an apparatus for decoding a video signal
US8665964B2 (en) * 2009-06-30 2014-03-04 Qualcomm Incorporated Video coding based on first order prediction and pre-defined second order prediction mode

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101129072A (zh) * 2005-01-12 2008-02-20 诺基亚公司 用于可扩展视频编码中的层间预测模式编码的方法和***
CN101137065A (zh) * 2006-09-01 2008-03-05 华为技术有限公司 图像编码方法、解码方法、编码器、解码器、编解码方法及编解码器
CN101159875A (zh) * 2007-10-15 2008-04-09 浙江大学 二重预测视频编解码方法和装置
CN101262607A (zh) * 2008-04-11 2008-09-10 浙江大学 二重预测视频编解码方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2503783A4 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107396118A (zh) * 2011-07-18 2017-11-24 太阳专利托管公司 编码方法和编码装置
CN107396118B (zh) * 2011-07-18 2020-02-21 太阳专利托管公司 编码方法和编码装置
US20130114693A1 (en) * 2011-11-04 2013-05-09 Futurewei Technologies, Co. Binarization of Prediction Residuals for Lossless Video Coding
US9503750B2 (en) * 2011-11-04 2016-11-22 Futurewei Technologies, Inc. Binarization of prediction residuals for lossless video coding
US9813733B2 (en) 2011-11-04 2017-11-07 Futurewei Technologies, Inc. Differential pulse code modulation intra prediction for high efficiency video coding
CN108810541A (zh) * 2012-01-20 2018-11-13 佳能株式会社 从视频数据的位流解码多个编码单位的方法
CN108924559A (zh) * 2012-01-20 2018-11-30 佳能株式会社 从视频数据的位流解码多个编码单位的方法
CN108924559B (zh) * 2012-01-20 2020-07-21 佳能株式会社 从视频数据的位流解码多个编码单位的方法
CN108810541B (zh) * 2012-01-20 2020-07-21 佳能株式会社 从视频数据的位流解码多个编码单位的方法
US11025953B2 (en) 2012-01-20 2021-06-01 Canon Kabushiki Kaisha Method, apparatus and system for encoding and decoding the significance map for residual coefficients of a transform unit

Also Published As

Publication number Publication date
EP2503783A1 (en) 2012-09-26
EP2503783A4 (en) 2013-01-09
EP2503783B1 (en) 2016-11-09
US20120243608A1 (en) 2012-09-27
CN102098519B (zh) 2013-04-17
CN102098519A (zh) 2011-06-15

Similar Documents

Publication Publication Date Title
WO2011069412A1 (zh) 视频编码方法、解码方法、编码及解码装置
RU2654491C1 (ru) Способ и устройство для кодирования видео, а также способ и устройство для декодирования видео, дополняемые арифметическим кодированием
CN102595116B (zh) 多图像块划分的编解码方法和装置
JP6059384B2 (ja) 符号化または復号化のための方法および装置
JP5379020B2 (ja) イントラ予測符号化、復号化方法及び装置
CN104581161B (zh) 通过使用大型变换单元编码和解码图像的方法和设备
TWI590649B (zh) 視訊之算術解碼裝置
JP2021073805A (ja) 改善されたエントロピー符号化および復号を行う方法および装置
TW202119818A (zh) 用於逐塊圖片編碼的幀內預測模式概念
KR20130106340A (ko) 인트라 예측 모드 부호화/복호화 방법 및 컴퓨터로 읽을 수 있는 기록 매체
CN103339938A (zh) 执行视频译码的运动向量预测
CN103959782A (zh) 具有增强cabac解码的视频解码器
WO1998020680A1 (en) Image encoder and image decoder
TW201043039A (en) Image encoding apparatus, method, and program, and image decoding apparatus, method, and program
CN102939719A (zh) 用于在二进制熵编码和解码中减少源的方法和设备
KR20120009693A (ko) 다중 예측 필터를 이용하는 경쟁기반 인트라 예측 부호화/복호화 장치 및 방법
TW202131681A (zh) 脈絡適應性二進制算術寫碼用參數化體系決定技術
JP2024523635A (ja) 復号化方法、符号化方法、装置、デバイスおよび記憶媒体
KR101845622B1 (ko) 영상에 대한 적응적 rdpcm 방법, 적응적 rdpcm에 기반한 인코딩 방법 및 적응적 rdpcm에 기반한 디코딩 방법
CN102473315A (zh) 再次使用树结构编码和解码二元集的方法和装置
WO2010083743A1 (zh) 基于二重预测的编解码方法及装置
TWI555380B (zh) 利用參考畫面之影音編碼及解碼方法
KR20110098089A (ko) 영상 부호화 장치 및 그 방법, 및 영상 복호화 장치 및 그 방법
WO2013065262A1 (ja) 映像符号化装置、映像復号装置、映像符号化方法、映像復号方法およびプログラム

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

REEP Request for entry into the european phase

Ref document number: 2010835447

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2010835447

Country of ref document: EP