WO2014048188A1 - 分层编解码方法及装置 - Google Patents

分层编解码方法及装置 Download PDF

Info

Publication number
WO2014048188A1
WO2014048188A1 PCT/CN2013/081980 CN2013081980W WO2014048188A1 WO 2014048188 A1 WO2014048188 A1 WO 2014048188A1 CN 2013081980 W CN2013081980 W CN 2013081980W WO 2014048188 A1 WO2014048188 A1 WO 2014048188A1
Authority
WO
WIPO (PCT)
Prior art keywords
mode
value
index
coding mode
coding
Prior art date
Application number
PCT/CN2013/081980
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 华为技术有限公司
Publication of WO2014048188A1 publication Critical patent/WO2014048188A1/zh

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/46Embedding additional information in the video signal during the compression process
    • H04N19/463Embedding additional information in the video signal during the compression process by compressing encoding parameters before transmission
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/30Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using hierarchical techniques, e.g. scalability
    • 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/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/103Selection of coding mode or of prediction mode
    • H04N19/11Selection of coding mode or of prediction mode among a plurality of spatial predictive coding modes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/17Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object
    • H04N19/176Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being an image region, e.g. an object the region being a block, e.g. a macroblock
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/169Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding
    • H04N19/187Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the coding unit, i.e. the structural portion or semantic portion of the video signal being the object or the subject of the adaptive coding the unit being a scalable video layer

Definitions

  • the present invention relates to video processing technologies, and in particular, to a layered codec method and apparatus. Background technique
  • High Efficiency Video Coding is a new generation of video coding standard.
  • HEVC's intraframe coding technology there are 35 modes for predicting luminance signals.
  • Scalable Video Coding is a technology that can split a video stream into multiple resolution, quality, and frame rate layers. It uses SVC as an extension of HEVC's intraframe coding technology. The data is divided into a bottom layer and a multi-layer video stream consisting of other optional enhancement layers that increase resolution, frame rate and quality. In order to adapt to the expansion of SVC to HEVC's intraframe coding technology, it is urgent to highlight an efficient video coding and decoding method to improve the codec performance. Summary of the invention
  • Embodiments of the present invention provide a layered codec method and apparatus to improve codec performance.
  • a layered coding method provided by an embodiment of the present invention includes:
  • the method further includes:
  • the generating the candidate mode list includes:
  • the generating a mode value according to a current coding mode of the current block and the candidate mode list specifically: if the candidate mode If the current encoding mode exists in the list, the mode value is set to an index corresponding to the current encoding mode in the candidate mode list;
  • the method further includes:
  • the first identification is written to the head of the code stream.
  • the generating the mode value according to the current coding mode of the current block and the candidate mode list includes: if the candidate mode list If the current coding mode does not exist, the coding modes in the candidate mode list are sorted according to the appearance probability from high to low;
  • the value of the current coding mode is greater than the value of the coding mode with the third occurrence probability, The value of the current coding mode is decremented by 1 to generate a first intermediate value, otherwise, the value of the current coding mode is taken as the first intermediate value;
  • the first intermediate value is decremented by 1 to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate a value; if the second intermediate value is greater than a value of an encoding mode in which the probability of occurrence is first, subtracting the second intermediate value by one to generate a third intermediate value; otherwise, using the second intermediate value as the a third intermediate value; setting the mode value to the third intermediate value;
  • the method further includes:
  • a second identity is written to the header of the codestream.
  • the encoding, by using the current coding mode, the current block to generate a code stream specifically:
  • Determining a predicted pixel of the current block according to the current coding mode acquiring an actual pixel of the current block, generating a current residual according to the actual pixel and the predicted pixel, and generating the code stream according to the current residual .
  • an embodiment of the present invention provides a layered decoding method, including:
  • the indication identifier is used to indicate that the intra-coding uses the inter-layer information, acquiring an underlying coding mode of the underlying block corresponding to the current block of the enhancement layer in the bottom layer;
  • the current block is decoded according to the underlying encoding mode. .
  • the method further includes:
  • the current block is decoded according to the current encoding mode.
  • the generating the candidate mode list includes:
  • the generating, according to the mode value in the code stream and the candidate mode list, the current coding mode of the current block includes:
  • the generating, according to the mode value in the code stream and the candidate mode list, the current coding mode of the current block includes:
  • each coding mode in the candidate mode list is sorted according to an appearance probability from high to low;
  • the mode value is smaller than the value of the coding mode whose probability of occurrence is the first, the mode value is incremented by one to generate a first intermediate value, otherwise, the mode value is used as the first intermediate value;
  • the first intermediate value is smaller than the value of the coding mode with the second appearance probability, the first intermediate is incremented by one to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate value.
  • the second intermediate value is smaller than a value of an encoding mode whose probability of occurrence is third, increasing the second intermediate value by one to generate a third intermediate value, and otherwise using the second intermediate value as the third intermediate value; value;
  • the value of the current encoding mode is set to the third intermediate value.
  • the decoding, by the bottom layer coding mode, the current block specifically:
  • an embodiment of the present invention provides a layered coding apparatus, including:
  • An obtaining unit configured to obtain an underlying coding mode of the underlying block corresponding to the current block of the enhancement layer in the bottom layer;
  • a first coding unit configured to be connected to the acquiring unit, configured to: if the current coding mode of the current block is the same as the bottom coding mode, encode the current block according to the current coding mode to generate a code stream, where The header of the code stream is set to indicate an indication of the intra-frame coding using the inter-layer information.
  • the layered coding apparatus further includes:
  • a list generating unit configured to generate a candidate mode list if a current encoding mode of the current block is different from the underlying encoding mode
  • a processing unit configured to be connected to the list generating unit, configured to generate a mode value according to the current encoding mode and the candidate mode list;
  • a second coding unit configured to be connected to the processing unit, configured to encode the current block according to the current coding mode to generate a code stream, and write a codeword corresponding to the mode value into the code stream, where The header of the code stream is set to indicate an indication of the intra-coded unused inter-layer information.
  • the list generating unit is specifically configured to:
  • the processing unit is specifically configured to: if the current coding mode exists in the candidate mode list, An index corresponding to the current coding mode in the candidate mode list is set; the second coding unit is further configured to write the first identifier to a header of the code stream.
  • the processing unit is specifically configured to: if the current coding mode does not exist in the candidate mode list, Sorting each coding mode in the candidate mode list by high to low;
  • the value of the current coding mode is greater than the value of the coding mode with the third appearance probability, the value of the current coding mode is decremented by 1 to generate a first intermediate value, otherwise, the value of the current coding mode is used as the First intermediate value;
  • the first intermediate value is decremented by 1 to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate a value; if the second intermediate value is greater than a value of an encoding mode in which the probability of occurrence is first, subtracting the second intermediate value by one to generate a third intermediate value; otherwise, using the second intermediate value as the a third intermediate value; setting the mode value to the third intermediate value;
  • the second coding unit is further configured to write a second identifier to a header of the code stream.
  • the first coding unit is specifically configured to determine a predicted pixel of the current block according to the current coding mode, and obtain an actual pixel of the current block, according to the actual pixel and the The predicted pixel generates a current residual, and the code stream is generated according to the current residual.
  • an embodiment of the present invention provides a layered decoding apparatus, including:
  • a first acquiring unit configured to acquire an indication identifier in the code stream
  • a second obtaining unit configured to be connected to the first obtaining unit, configured to: if the indication identifier is used to indicate that intra-frame coding uses inter-layer information, obtain an underlying coding mode of an underlying block corresponding to a current block of the enhancement layer in the bottom layer ;
  • a first decoding unit connected to the second obtaining unit, according to the bottom coding mode
  • the current block is decoded.
  • the layered decoding apparatus further includes:
  • a list generating unit configured to be connected to the first obtaining unit, to generate a candidate mode list if the indication identifier is used to indicate intra-frame coding unused inter-layer information
  • a processing unit configured to be connected to the list generating unit, configured to generate a current encoding mode of the current block according to the mode value in the code stream and the candidate mode list;
  • a second decoding unit connected to the processing unit, configured to decode the current block according to the current coding mode.
  • the list generating unit is specifically configured to:
  • the processing unit is specifically configured to: if the candidate mode list is identified according to the first identifier in the code stream The current encoding mode sets the current encoding mode to an encoding mode in which the candidate mode list is indexed by the mode value.
  • the processing unit is specifically configured to:
  • the coding modes in the candidate mode list are sorted according to the appearance probability from high to low;
  • the mode value is smaller than the value of the coding mode whose probability of occurrence is the first, the mode value is increased
  • the first intermediate value is smaller than the value of the coding mode with the second appearance probability, the first intermediate is incremented by one to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate value.
  • the second intermediate value is smaller than a value of an encoding mode whose probability of occurrence is third, increasing the second intermediate value by one to generate a third intermediate value, and otherwise using the second intermediate value as the third intermediate value; a value; setting the value of the current encoding mode to the third intermediate value.
  • the first decoding unit is specifically configured to determine a predicted pixel of the current block according to the underlay coding mode, generate a current residual according to the code stream, according to the predicted pixel and The current residual performs reconstruction of the current block.
  • an embodiment of the present invention provides a layered coding method, including:
  • the initial mode list includes an underlay coding mode of an underlay block corresponding to a current block of the enhancement layer in the bottom layer, and a first coding mode of a left neighboring block of the enhancement block and the current block And a second encoding mode of the upper adjacent block of the current block in the enhancement layer; generating a mode value according to a current encoding mode of the current block and the candidate mode list;
  • the modifying the initial mode list to generate a candidate mode list includes:
  • the index of the mode is 1, and the index of the coding mode with the third probability of occurrence is 2; if the value of the coding mode with index 0 is equal to the value of the coding mode with index 1 and is less than 2, the index is 0.
  • the value of the coding mode is set to 0, the value of the coding mode with the index of 1 is set to 1, and if the value of the coding mode with index 2 is equal to the value of the coding mode with the index of 0, the index is The value of the encoding mode of 2 is set to 26;
  • the value of the coding mode whose index is 0 is equal to the value of the coding mode whose index is 1, and is not less than 2, the value of the coding mode whose index is 1 and the index are respectively set according to the following formula.
  • candModeList[0] is an encoding mode in which the index is 0
  • candModeList[l] is an encoding mode in which the index is 1
  • candModeList[2] is an encoding mode in which the index is 2;
  • the value of the coding mode and the value of the coding mode whose index is 1 are not equal, and the value of the coding mode whose index is 2 is equal to the value of the coding mode whose index is 0 or the coding mode whose index is 1.
  • the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set to 0, if If the value of the coding mode with index 0 and the value of the coding mode with index 1 are not 1, the value of the coding mode with the index of 2 is set to 1, otherwise, the code with the index of 2 is set.
  • the value of the mode is set to 26;
  • the value of the coding mode whose index is 0 and the value of the coding mode whose index is 1, are not equal, and the value of the coding mode whose index is 2 is not equal to the value of the coding mode whose index is 0 and If the value of the coding mode whose index is 1 is, if the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set. Set to 0.
  • the generating a mode value according to a current coding mode of the current block and the candidate mode list specifically:
  • the method further includes:
  • the first identification is written to the head of the code stream.
  • the generating the mode value according to the current coding mode of the current block and the candidate mode list includes:
  • each coding mode in the candidate mode list is sorted according to an appearance probability from high to low;
  • the value of the current coding mode is decremented by 1 to generate a first intermediate value, otherwise, the value of the current coding mode is used as the First intermediate value; If the first intermediate value is greater than a value of the second occurrence coding mode, the first intermediate value is decremented by 1 to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate a value; if the second intermediate value is greater than a value of an encoding mode in which the probability of occurrence is first, subtracting the second intermediate value by one to generate a third intermediate value; otherwise, using the second intermediate value as the a third intermediate value; setting the mode value to the third intermediate value;
  • the method further includes:
  • a second identity is written to the header of the codestream.
  • the encoding by using the current coding mode, the current block to generate a code stream, specifically:
  • Determining a predicted pixel of the current block according to the current coding mode acquiring an actual pixel of the current block, generating a current residual according to the actual pixel and the predicted pixel, and generating the code stream according to the current residual .
  • an embodiment of the present invention provides a layered decoding method, including:
  • the initial mode list includes an underlay coding mode of an underlay block corresponding to a current block of the enhancement layer in the bottom layer, and a first coding mode of a left neighboring block of the enhancement block and the current block And a second encoding mode of the upper adjacent block of the current block in the enhancement layer; modifying the initial mode list to generate a candidate mode list;
  • the modifying the initial mode list to generate a candidate mode list includes:
  • the index of the mode is 1, and the index of the coding mode with the third probability of occurrence is 2; if the value of the coding mode with index 0 is equal to the value of the coding mode with index 1 and is less than 2, the index is 0.
  • the value of the coding mode is set to 0, the value of the coding mode with the index of 1 is set to 1, and if the value of the coding mode with index 2 is equal to the value of the coding mode with the index of 0, the index is The value of the encoding mode of 2 is set to 26;
  • the value of the coding mode with the index of 0 is equal to the value of the coding mode with the index of 1 and Not less than 2, the value of the encoding mode with the index of 1 and the value of the encoding mode with the index of 2 are respectively set according to the following formula:
  • candModeList[0] is an encoding mode in which the index is 0
  • candModeList[l] is an encoding mode in which the index is 1
  • candModeList[2] is an encoding mode in which the index is 2;
  • the value of the coding mode and the value of the coding mode whose index is 1 are not equal, and the value of the coding mode whose index is 2 is equal to the value of the coding mode whose index is 0 or the coding mode whose index is 1.
  • the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set to 0, if If the value of the coding mode with index 0 and the value of the coding mode with index 1 are not 1, the value of the coding mode with the index of 2 is set to 1, otherwise, the code with the index of 2 is set.
  • the value of the mode is set to 26;
  • the value of the coding mode whose index is 0 and the value of the coding mode whose index is 1, are not equal, and the value of the coding mode whose index is 2 is not equal to the value of the coding mode whose index is 0 and If the value of the coding mode whose index is 1 is, if the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set. Set to 0.
  • the generating, according to the mode value in the code stream and the candidate mode list, a current coding mode of the current block specifically:
  • the generating, according to the mode value in the code stream and the candidate mode list, a current coding mode of the current block including:
  • each coding mode in the candidate mode list is sorted according to an appearance probability from high to low;
  • the mode value is smaller than the value of the coding mode whose probability of occurrence is the first, the mode value is incremented by one to generate a first intermediate value, otherwise, the mode value is used as the first intermediate value;
  • the first intermediate value is smaller than a value of an encoding mode in which the probability of occurrence is the second, the first Adding a second intermediate value to the middle, otherwise, the first intermediate value is used as the second intermediate value; if the second intermediate value is smaller than the value of the third highest encoding mode, the first The second intermediate value is incremented by one to generate a third intermediate value, otherwise the second intermediate value is taken as the third intermediate value; and the value of the current encoding mode is set as the third intermediate value.
  • the decoding, by the current coding mode, the current block is specifically:
  • the embodiment of the present invention provides a layered coding apparatus, including:
  • An initializing unit configured to generate an initial mode list, where the initial mode list includes an underlay coding mode of an underlay block corresponding to a current block of the enhancement layer in the bottom layer, and a left neighboring block in the enhancement layer and the current block a first coding mode and a second coding mode of the upper adjacent block of the current block in the enhancement layer;
  • a correction unit connected to the initialization unit, configured to modify the initial mode list to generate a list of 4 selected modes
  • a processing unit configured to be connected to the correction unit, configured to generate a mode value according to a current coding mode of the current block and the candidate mode list;
  • a coding unit configured to be configured to code the current block according to the current coding mode to generate a code stream, and write the codeword corresponding to the mode value into the code stream.
  • the modifying unit includes:
  • a first sorting subunit connected to the first initializing unit, configured to perform sorting according to an occurrence probability from high to low, the bottom encoding mode, the first encoding mode, and the second encoding mode, and setting an occurrence probability to
  • the index of the first coding mode is 0, the index of the coding mode with the second appearance probability is 1, and the index of the coding mode with the third probability of occurrence is 2;
  • a first processing subunit connected to the first sorting subunit, configured to encode the index to 0 if a value of an encoding mode with an index of 0 and an encoding mode with an index of 1 are equal and less than two
  • the value of the mode is set to 0, the value of the coding mode with the index of 1 is set to 1, and if the value of the coding mode with index 2 is equal to the value of the coding mode with the index of 0, the index is The value of the encoding mode of 2 is set to 26;
  • the value of the coding mode with the index of 0 is equal to the value of the coding mode with the index of 1 and Not less than 2, the value of the encoding mode with the index of 1 and the value of the encoding mode with the index of 2 are respectively set according to the following formula:
  • candModeList[0] is an encoding mode in which the index is 0
  • candModeList[l] is an encoding mode in which the index is 1
  • candModeList[2] is an encoding mode in which the index is 2;
  • the value of the coding mode and the value of the coding mode whose index is 1 are not equal, and the value of the coding mode whose index is 2 is equal to the value of the coding mode whose index is 0 or the coding mode whose index is 1.
  • the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set to 0, if If the value of the coding mode with index 0 and the value of the coding mode with index 1 are not 1, the value of the coding mode with the index of 2 is set to 1, otherwise, the code with the index of 2 is set.
  • the value of the mode is set to 26;
  • the value of the coding mode whose index is 0 and the value of the coding mode whose index is 1, are not equal, and the value of the coding mode whose index is 2 is not equal to the value of the coding mode whose index is 0 and If the value of the coding mode whose index is 1 is, if the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set. Set to 0.
  • the processing unit is specifically configured to: if the current coding mode exists in the candidate mode list, set the mode value to the current coding in the candidate mode list. The index corresponding to the pattern;
  • the encoding unit is further configured to write the first identifier to a header of the code stream.
  • the processing unit includes:
  • a second sorting subunit connected to the first modifying unit, configured to: if the current encoding mode does not exist in the candidate mode list, select each encoding mode in the candidate mode list according to an appearance probability from high to low Sort;
  • a second processing subunit connected to the second sorting subunit, configured to: if the value of the current encoding mode is greater than a value of an encoding mode with a third occurrence probability, decrement the value of the current encoding mode by one a first intermediate value, otherwise, the value of the current coding mode is used as the first intermediate value; if the first intermediate value is greater than a value of an encoding mode in which the probability of occurrence is the second, the first intermediate value is Subtracting 1 to generate a second intermediate value, otherwise, using the first intermediate value as the second intermediate value; If the second intermediate value is greater than the value of the encoding mode in which the probability of occurrence is the first, subtracting the second intermediate value by 1 to generate a third intermediate value, otherwise, using the second intermediate value as the third intermediate a value; the mode value is set to the third intermediate value;
  • the encoding unit is further configured to write a second identifier to a header of the code stream.
  • the coding unit is specifically configured to determine, according to the current coding mode, a predicted pixel of the current block, and acquire an actual pixel of the current block, according to the actual pixel and the prediction.
  • the pixel generates a current residual, and the code stream is generated based on the current residual.
  • the eighth aspect, the embodiment of the present invention provides a layered decoding apparatus, including:
  • An initializing unit configured to generate an initial mode list, where the initial mode list includes an underlay coding mode of an underlay block corresponding to a current block of the enhancement layer in the bottom layer, and a left neighboring block in the enhancement layer and the current block a first coding mode and a second coding mode of the upper adjacent block of the current block in the enhancement layer;
  • a correction unit configured to be connected to the initialization unit, configured to modify the initial mode list to generate a candidate mode list
  • a processing unit configured to be connected to the correction unit, configured to generate a current coding mode of the current block according to the mode value in the code stream and the candidate mode list;
  • a decoding unit connected to the modifying unit, configured to decode the current block according to the current encoding mode.
  • the modifying unit includes:
  • a first sorting subunit connected to the initializing unit, configured to sort the bottom encoding mode, the first encoding mode, and the second encoding mode according to an appearance probability from high to low, and set an appearance probability to be the first
  • the index of the coding mode is 0, the index of the coding mode with the second probability of occurrence is 1 , and the index of the coding mode with the probability of occurrence of the third is 2;
  • a second processing subunit connected to the first sorting subunit, configured to: if the value of the encoding mode with index 0 is equal to the value of the encoding mode with index 1 and less than 2, the encoding of the index is 0 The value of the mode is set to 0, the value of the coding mode with the index of 1 is set to 1, and if the value of the coding mode with index 2 is equal to the value of the coding mode with the index of 0, the index is The value of the encoding mode of 2 is set to 26;
  • the value of the coding mode whose index is 0 is equal to the value of the coding mode whose index is 1, and is not less than 2, the value of the coding mode whose index is 1 and the index are respectively set according to the following formula.
  • candModeList[0] is an encoding mode in which the index is 0
  • candModeList[l] is an encoding mode in which the index is 1
  • candModeList[2] is an encoding mode in which the index is 2;
  • the value of the coding mode and the value of the coding mode whose index is 1 are not equal, and the value of the coding mode whose index is 2 is equal to the value of the coding mode whose index is 0 or the coding mode whose index is 1.
  • the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set to 0, if If the value of the coding mode with index 0 and the value of the coding mode with index 1 are not 1, the value of the coding mode with the index of 2 is set to 1, otherwise, the code with the index of 2 is set.
  • the value of the mode is set to 26;
  • the value of the coding mode whose index is 0 and the value of the coding mode whose index is 1, are not equal, and the value of the coding mode whose index is 2 is not equal to the value of the coding mode whose index is 0 and If the value of the coding mode whose index is 1 is, if the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set. Set to 0.
  • the processing unit is specifically configured to: if the current coding mode exists in the candidate mode list according to the first identifier in the code stream, the current coding mode is An encoding mode in which the candidate mode list is indexed by the mode value is set.
  • the processing unit includes:
  • a second sorting subunit connected to the modifying unit, configured to: according to the second identifier in the code stream, the current encoding mode does not exist in the candidate mode list, according to an occurrence probability from high to low Sorting each coding mode in the candidate mode list;
  • a second processing subunit connected to the second sorting subunit, configured to increase the mode value by one to generate a first intermediate value if the mode value is smaller than a value of an encoding mode in which the probability of occurrence is first, Bay ' J , the mode value is taken as the first intermediate value;
  • the first intermediate value is smaller than the value of the coding mode with the second appearance probability, the first intermediate is incremented by one to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate value.
  • the second intermediate value is smaller than a value of an encoding mode whose probability of occurrence is third, increasing the second intermediate value by one to generate a third intermediate value, and otherwise using the second intermediate value as the third intermediate value; value;
  • the value of the current encoding mode is set to the third intermediate value.
  • the decoding unit is specifically configured to determine a predicted pixel of the current block according to the current coding mode, generate a current residual according to the code stream, according to the predicted pixel and the The current residual performs reconstruction of the current block.
  • the layered coding apparatus obtains an underlay coding mode of an underlay block corresponding to a current block of an enhancement layer in an underlay, if a current coding mode of the current block The same as the underlying coding mode, the current block is encoded according to the current coding mode to generate a code stream, and an indication flag for indicating the intra-frame coding using the inter-layer information is set in the code stream.
  • the encoding mode of the corresponding underlying block is considered, and the inter-layer correlation is fully utilized, and the encoding and decoding performance is greatly improved.
  • the layered coding apparatus generates an initial mode list, corrects the initial mode list, generates a candidate mode list, and generates a mode value according to the current coding mode and the candidate mode list of the current block,
  • the current block is encoded according to the current coding mode to generate a code stream, and the codeword corresponding to the mode value is written into the code stream.
  • the encoding mode of the corresponding underlying block is taken into consideration, and the inter-layer correlation is fully utilized, and the encoding and decoding performance is greatly improved.
  • FIG. 1 is a flowchart of a first hierarchical coding method according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an intra prediction mode and a direction of a luminance signal according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a second hierarchical coding method according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of a first hierarchical decoding method according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of a second hierarchical decoding method according to an embodiment of the present invention.
  • FIG. 6 is a flowchart of a third hierarchical coding method according to an embodiment of the present invention.
  • FIG. 7 is a flowchart of a third hierarchical decoding method according to an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of a first hierarchical coding apparatus according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a second hierarchical coding apparatus according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of a first hierarchical decoding apparatus according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of a second hierarchical decoding apparatus according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram of a third layered coding apparatus according to an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of a fourth hierarchical coding apparatus according to an embodiment of the present disclosure.
  • FIG. 14 is a schematic structural diagram of a third hierarchical decoding apparatus according to an embodiment of the present disclosure.
  • FIG. 15 is a schematic structural diagram of a fourth hierarchical decoding apparatus according to an embodiment of the present invention.
  • the technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention.
  • the embodiments are a part of the embodiments of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
  • FIG. 1 is a flowchart of a first hierarchical coding method according to an embodiment of the present invention.
  • the process can be based on, but not limited to, HEVC-SVC technology.
  • the layered coding method provided in this embodiment may be implemented by a layered coding apparatus, which may be integrated in a video processor of a device such as a television, a set top box, a personal computer, a notebook computer, a tablet computer or a mobile phone. It can also be set separately, and the layered encoding device can be implemented by software and/or hardware.
  • Step A10 Obtain an underlying coding mode of the underlying block corresponding to the current block of the enhancement layer in the bottom layer;
  • Step A20 If the current coding mode of the current block is the same as the bottom coding mode, And encoding the current block according to the current coding mode to generate a code stream, and setting an indication identifier for indicating intra-frame coding using inter-layer information in a header of the code stream.
  • the video data is divided into a bottom layer and a multi-layer video stream consisting of other optional enhancement layers that increase resolution, frame rate and quality.
  • Encoding the video data requires encoding the underlying layer and the enhancement layer separately.
  • the underlying intra prediction mode can be used.
  • the encoding mode of the underlying current block refers to the underlying layer.
  • the prediction of the luminance signal exists in 35 modes, and the intra prediction mode of the luminance signal is as shown in Table 1.
  • mode 2-34 is angle prediction.
  • FIG. 2 is a schematic diagram of an intra prediction mode and a direction of a luminance signal according to an embodiment of the present invention. The graph shown in FIG. 2 may reflect the direction of the prediction mode 2-34 in Table 1.
  • the enhancement layer is encoded.
  • the enhancement layer may be divided into a plurality of non-overlapping coding blocks, that is, a maximum coding unit.
  • the size of the maximum coding unit may be 64 64, and the maximum coding unit may be adaptively further symmetrically or asymmetrically divided into multiple coding blocks, and the size of the divided coding block is, for example, 32 x 32, 16 x 16 or 8 x 8 Wait.
  • the encoding process for the enhancement layer is the encoding process for all the largest coding units in the enhancement layer.
  • the coding mode of the current block of the enhancement layer not only refers to the coding mode of the coding unit adjacent to the current block space in the enhancement layer, such as a coding unit adjacent to the current block space, for example, the current block.
  • the coding unit adjacent to the left side and the coding unit adjacent to the upper side of the current block also consider the coding mode of the underlying block corresponding to the current block in the lower layer.
  • the position of the current block in the enhancement layer relative to the upper left corner of the frame is (x, y), its size is N, and the upper sampling ratio of the bottom layer and the enhancement layer is 1: 2, then the position in the bottom layer relative to the upper left corner of the frame is (x/2, y/2), a block of size N/2 corresponds to the current block.
  • the corresponding block may be separately coded into multiple sub-blocks, and the encoding mode of all sub-blocks in the corresponding block may be referred to in the encoding process of the current block of the enhancement layer, or reference may be made to The encoding mode of one or several sub-blocks.
  • the codec performance can be improved. Determining the coding mode of the current block, the coding mode of the current block is the current coding mode, and the coding mode of the underlying block corresponding to the current block in the bottom layer is the underlying coding mode. If the current coding mode is the same as the underlying coding mode, then the current coding mode is The coding mode encodes the current block to generate a code stream, and sets an indication flag in the code stream to indicate that the intra coding uses inter-layer information.
  • the indication identifier is specifically used to indicate that the encoding of the current block is encoded using the same encoding mode as the underlying block. For example, the inter-layer information usage identifier is use_inter_pred_direct_flag, and its value can be set to 1 to occupy one bit.
  • the decoding side When the decoding side receives the code stream, it may identify that the coding mode used by the coding side for the current block is the same as the coding mode of the corresponding underlying block according to the indication identifier used to indicate the intra-frame coding using the inter-layer information in the code stream. Then, the coding mode of the underlying block can be obtained, and the code stream is decoded by the coding mode to implement reconstruction.
  • the layered coding apparatus obtains an underlay coding mode of an underlay block corresponding to a current block of the enhancement layer in the bottom layer, and if the current coding mode of the current block is the same as the underlying coding mode, according to the current coding
  • the mode encodes the current block to generate a code stream, and an indication flag indicating that the intra-frame coding uses the inter-layer information is set in the code stream.
  • the encoding mode of the corresponding underlying block is considered, and the inter-layer correlation is fully utilized, and the codec performance is greatly improved.
  • step A20 the encoding, by using the current coding mode, the current block is encoded to generate a code stream, which may be specifically:
  • Determining a predicted pixel of the current block according to the current coding mode acquiring an actual pixel of the current block, generating a current residual according to the actual pixel and the predicted pixel, and generating the code stream according to the current residual .
  • the predicted pixel of the current block may be determined according to the current coding mode.
  • the current coding mode is a vertical prediction coding mode
  • a pixel that is adjacent to the block above the current block may be used as the prediction pixel of the current block.
  • a residual between the actual pixel of the current block and the predicted pixel is calculated as a current residual, and the residual is encoded to generate a code stream.
  • the code stream is decoded to obtain the current residual, and if the identifier is used according to the inter-layer information in the code stream, the coding mode used by the coding side for the current block is the same as the coding mode of the corresponding underlying block. Then, the coding mode of the underlying block can be obtained, and the prediction pixel is determined according to the coding mode of the underlying block, and the reconstruction of the current block can be implemented by adding the prediction pixel to the current residual.
  • FIG. 3 is a flowchart of a second hierarchical coding method according to an embodiment of the present invention. As shown in FIG. 3, in this embodiment, after the obtaining the underlying coding mode of the underlying block corresponding to the current block of the enhancement layer in the bottom layer, the method further includes:
  • Step A30 Generate a candidate mode list if a current coding mode of the current block is different from the bottom coding mode;
  • the coding mode in the candidate mode list is not repeated, and the candidate mode list includes a coding mode that is more likely.
  • Step A40 Generate a mode value according to the current coding mode and the candidate mode list.
  • the mode value may be generated according to a relationship between a current coding mode and a candidate mode list.
  • the candidate mode list is used, If the current coding mode exists, the mode value may be generated according to an index of the current coding mode in the candidate mode list. In another implementation manner, if the current coding mode does not exist in the candidate mode list, the mode value may be generated according to the candidate mode list.
  • Step A50 Code the current block according to the current coding mode to generate a code stream, and write a codeword corresponding to the mode value into the code stream, where a header is set in the code stream to indicate a frame.
  • the inner code encodes an indication of the unused inter-layer information.
  • different mode values correspond to different codewords, and the mode value can be encoded to generate the codeword.
  • the indication identifier is set at the head of the code stream so that the indication side can be first decoded to the decoding side, and the inter-layer information used in the intra-frame coding is determined according to the indication identifier.
  • step A30 the generating a candidate mode list may specifically include the following steps:
  • candModeList[l] 2 + ((candModeList[0] - 2 + 1) % 32
  • candModeList[0] is an encoding mode in which the index is 0
  • candModeList[1] is an encoding mode in which the index is 1.
  • the candidate mode list is established by:
  • the candidate mode list generated by the above method includes three coding modes that are more likely.
  • the values corresponding to the coding modes in the foregoing processing refer to the correspondence shown in Table 1, that is, the value of the coding mode is 0 corresponding to the planar mode (Intra-Planar), and the value of the coding mode is 1 corresponding to the DC mode (Intra- DC ) , the value of the encoding mode is 26 for the vertical mode ( Intra-Vertical). It can be understood that, according to the corresponding relationship between the preset value and the coding mode, the technical solutions adjusted by the person skilled in the art according to the actual setting are all within the protection scope of the present invention.
  • step A40 the generating a mode value according to the current coding mode of the current block and the candidate mode list may be specifically:
  • the method further includes:
  • the first identification is written to the head of the code stream.
  • the current coding mode exists in the candidate mode list
  • the current coding mode is candlntraPredModeL
  • the index of the candidate mode list candlntraPredModeL is 1
  • the mode value is set to 1, to save resource occupation, and the mode value is written.
  • the first identifier is used to indicate that the current coding mode exists in the candidate mode list, for example, the pre V_intra-luma_pred_flag may be set to 1 to indicate the First identification.
  • the specific implementation manner of writing the first identifier to the header of the code stream is: writing the first identifier into the intra-coded inter-layer information of the header of the code stream. The position after the identification is used; or the intra-coded inter-layer information in which the first identifier is written to the header of the code stream does not use the position before the identification.
  • the step A40, the generating the mode value according to the current coding mode of the current block and the candidate mode list may specifically include the following steps:
  • each coding mode in the candidate mode list is sorted according to an appearance probability from high to low;
  • the value of the current coding mode is greater than the value of the coding mode with the third appearance probability, the value of the current coding mode is decremented by 1 to generate a first intermediate value, otherwise, the value of the current coding mode is used as the First intermediate value;
  • the first intermediate value is decremented by 1 to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate a value; if the second intermediate value is greater than a value of an encoding mode in which the probability of occurrence is first, subtracting the second intermediate value by one to generate a third intermediate value; otherwise, using the second intermediate value as the a third intermediate value; setting the mode value to the third intermediate value;
  • the method further includes:
  • a second identity is written to the header of the codestream.
  • the coding modes in the candidate mode list are sorted according to the appearance probability from high to low.
  • the sorting process may be specifically: If candModeList ] is greater than candModeList[l] , Bay ' J
  • the sorting can be implemented by the function swap function swap(x, y). Of course, the sorting process can also be implemented in other ways, not limited to this embodiment.
  • rem_intra-luma_pred_mode is set to the value of the current encoding mode
  • the second identifier is used to indicate that the current encoding mode does not exist in the candidate mode list.
  • the prev_intra-luma_pred_flag may be set to 0 to indicate the second identifier.
  • the specific implementation manner of writing the second identifier to the header of the code stream is: writing the second identifier to the intra-coded inter-layer information of the header of the code stream. The position after the identification is used; or the intra-coded inter-layer information in which the second identifier is written to the header of the code stream does not use the position before the identification.
  • FIG. 4 is a flowchart of a first hierarchical decoding method according to an embodiment of the present invention.
  • the layered decoding method provided in this embodiment may be specifically applied to a decoding process of a video, and the decoding process may be based on, but not limited to, HEVC-SVC technology.
  • the layered decoding method provided in this embodiment may be implemented in conjunction with the layered coding method provided in the embodiment shown in FIG. 1.
  • the layered decoding method provided by this embodiment may be implemented by a layered decoding device, which may be integrated into a video processor of a device such as a television, a set top box, a personal computer, a notebook computer, a tablet computer or a mobile phone. It can also be set separately, and the hierarchical decoding device can be implemented by software and/or hardware.
  • Step B10 Obtain an indication identifier in the code stream.
  • Step B20 If the indication identifier is used to indicate that intra-frame coding uses inter-layer information, obtain an underlying coding mode of an underlying block corresponding to a current block of the enhancement layer in the bottom layer;
  • Step B30 Decode the current block according to the underlying coding mode.
  • the layered decoding device obtains the indication identifier in the code stream, and if the indication identifier is used to indicate that the intra-frame coding uses the inter-layer information usage identifier, the bottom layer corresponds to the current block of the enhancement layer.
  • the underlying encoding mode of the underlying block is used to decode the current block according to the underlying encoding mode. In the encoding process of the current block, the encoding mode of the corresponding underlying block is considered, and the inter-layer correlation is fully utilized, and the encoding and decoding performance is greatly improved.
  • step B20 the decoding, by the bottom layer coding mode, the current block is specifically:
  • FIG. 5 is a flowchart of a second hierarchical decoding method according to an embodiment of the present invention. As shown in FIG. 5, after the obtaining the indication identifier in the code stream, the method further includes:
  • B40 If the indication identifier is used to indicate that intra-frame coding does not use inter-layer information, generate a candidate mode list.
  • B50 Generate a current coding mode of the current block according to the mode value in the code stream and the candidate mode list.
  • the step B40, the generating the candidate mode list may specifically include the following steps:
  • candModeList[l] 2 + ((candModeList[0] - 2 + 1) % 32
  • candModeList[0] is an encoding mode in which the index is 0
  • candModeList[1] is an encoding mode in which the index is 1.
  • B50 the generating the current coding mode of the current block according to the mode value in the code stream and the candidate mode list may specifically include the following steps:
  • the current coding mode exists in the candidate mode list, and the mode value in the code stream is an index of the current coding mode in the candidate mode list, and the current value may be determined according to the mode value.
  • Encoding mode if the first identifier exists in the code stream, the current coding mode exists in the candidate mode list, and the mode value in the code stream is an index of the current coding mode in the candidate mode list, and the current value may be determined according to the mode value. Encoding mode.
  • step B50 the generating the current coding mode of the current block according to the mode value in the code stream and the candidate mode list may specifically include the following steps:
  • each coding mode in the candidate mode list is entered according to an appearance probability from high to low.
  • the mode value is smaller than the value of the coding mode whose probability of occurrence is the first, the mode value is increased
  • the first intermediate value is smaller than the value of the coding mode with the second appearance probability, the first intermediate is incremented by one to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate value.
  • the second intermediate value is smaller than a value of an encoding mode whose probability of occurrence is third, increasing the second intermediate value by one to generate a third intermediate value, and otherwise using the second intermediate value as the third intermediate value; a value; setting the value of the current encoding mode to the third intermediate value.
  • the current coding mode needs to be calculated according to the candidate mode list and the mode value.
  • the coding modes in the candidate mode list are sorted according to the probability of occurrence from high to low.
  • the sequence process may be:
  • the sorting can be implemented by the function swap(x, y).
  • the sorting process can also be implemented in other ways, which is not limited to this embodiment.
  • Rem - intra - luma_pred - mode increased by 1, no shell 1 J keep rem - intra - luma_pred - mode no more; then rem - intra - luma_pred - mode compared with candModeList [l]:
  • Rem - intra - luma_pred - mode increased by 1, no shell 1 J , keep rem - intra - luma_pred - mode is not more; Then rem- intra- luma_pred-mode is compared with candModeList[2]:
  • Rem - intra - luma_pred - mode is incremented by 1, no shell 1 J , keep rem - intra - luma_pred - mode is not more, the current encoding mode value is set to rem - intra - luma_pred - mode.
  • FIG. 6 is not the third embodiment provided by the embodiment of the present invention.
  • a flow chart of a hierarchical coding method As shown in Figure 6, The encoding process can be based on, but not limited to, HEVC-SVC technology.
  • the layered coding method provided in this embodiment may be implemented by a layered coding apparatus, which may be integrated in a video processor of a device such as a television, a set top box, a personal computer, a notebook computer, a tablet computer or a mobile phone. It can also be set separately, and the layered encoding device can be implemented by software and/or hardware.
  • Step A100 Generate an initial mode list, where the initial mode list includes an underlay coding mode of an underlay block corresponding to a current block of the enhancement layer in the bottom layer, and a first neighboring block of the enhancement block and the current block. An encoding mode and a second encoding mode of the upper adjacent block of the current block in the enhancement layer;
  • the coding mode of the current block of the enhancement layer may refer to the coding mode of the block adjacent to the current block in the enhancement layer and the coding mode of the corresponding underlay block in the bottom layer.
  • the initial mode list may be generated first.
  • the initial mode list may specifically include the following content:
  • candModeList[0] is the encoding mode with index 1
  • candlntraPredModeB is the value of the underlying encoding mode
  • candModeList[l] is the encoding mode with index 1.
  • candlntraPredModeL is the value of the first coding mode, that is, the prediction mode of the reference block on the left side of the current coding block
  • candModeList[2] is the coding mode with index 2
  • candlntraPredModeA is the value of the second coding mode, that is, the prediction of the reference block on the current coding block. mode.
  • Step A200 Perform correction on the initial mode list to generate a candidate mode list. Specifically, in order to fully utilize the candidate mode list, the coding mode in the candidate mode list is not repeated, and the candidate mode list includes a more likely coding. mode.
  • Step A300 Generate a mode value according to a current coding mode of the current block and the candidate mode list.
  • the coding mode of the current block is the current coding mode
  • the mode value may be generated according to the relationship between the current coding mode and the candidate mode list.
  • the mode value is generated according to an index of the current coding mode in the candidate mode list.
  • the mode value may be generated according to the candidate mode list.
  • Step A400 Code the current block according to the current coding mode to generate a code stream, and write a codeword corresponding to the mode value into the code stream.
  • different mode values correspond to different codewords, and the mode value can be encoded to generate the codeword.
  • the layered coding apparatus generates an initial mode list, corrects the initial mode list, generates a candidate mode list, and generates a mode value according to the current coding mode and the candidate mode list of the current block, according to the current coding mode.
  • the current block is encoded to generate a code stream, and the code word corresponding to the mode value is written into the code stream.
  • the encoding mode of the corresponding underlying block is taken into consideration, and the inter-layer correlation is fully utilized, and the encoding and decoding performance is greatly improved.
  • the initial mode list is generated, the coding mode of the corresponding underlying block is taken as the more likely coding mode, and the generated candidate mode list is used for coding reference of the current block, thereby further improving the codec performance.
  • step A200 the initial mode list is modified to generate a candidate mode list, which may specifically include the following steps:
  • the index of the mode is 1, and the index of the coding mode with the third probability of occurrence is 2; if the value of the coding mode with index 0 is equal to the value of the coding mode with index 1 and is less than 2, the index is 0.
  • the value of the coding mode is set to 0, the value of the coding mode with the index of 1 is set to 1, and the value of the coding mode with index 2 is the value of the coding mode with the index of 0.
  • Etc the value of the encoding mode with the index of 2 is set to 26;
  • the value of the coding mode with the index of 0 is equal to the value of the coding mode with the index of 1 and is not less than 2
  • the value of the coding mode with the index of 1 and the index of 2 are respectively set according to the following formula.
  • candModeList[0] is an encoding mode in which the index is 0
  • candModeList[1] is an encoding mode in which the index is 1
  • candModeList[2] is an encoding mode in which the index is 2;
  • the value of the coding mode and the value of the coding mode whose index is 1 are not equal, and the value of the coding mode whose index is 2 is equal to the value of the coding mode whose index is 0 or the coding mode whose index is 1.
  • the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set to 0, if If the value of the coding mode with index 0 and the value of the coding mode with index 1 are not 1, the value of the coding mode with the index of 2 is set to 1, otherwise, the code with the index of 2 is set.
  • the value of the mode is set to 26;
  • the value of the coding mode whose index is 0 and the value of the coding mode whose index is 1, are not equal, and the value of the coding mode whose index is 2 is not equal to the value of the coding mode whose index is 0 and If the value of the coding mode whose index is 1 is, if the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set. Set to 0.
  • the larger the value of the coding mode, the smaller the probability of occurrence, and the probability of occurrence of each coding mode is pre-statistic.
  • candModeList[0] candlntraPredModeB
  • the value of the coding mode is 0 corresponding to the planar mode (Intra-Planar), and the value of the coding mode is 1 corresponding to the DC mode (Intra- DC ) , the value of the encoding mode is 26 for the vertical mode ( Intra-Vertical). It can be understood that, according to the corresponding relationship between the preset value and the coding mode, the technical solutions adjusted by the person skilled in the art according to the actual setting are all within the protection scope of the present invention.
  • step A300 the generating a mode value according to the current coding mode of the current block and the candidate mode list may be specifically:
  • step A400 after the current block is encoded to generate a code stream according to the current coding mode, the method may further include:
  • the first identification is written to the head of the code stream.
  • the mode value is set to 1, to save resource occupation, and the mode value is written.
  • a first identifier is written in the header of the code stream, where the first identifier is used to indicate that the current encoding mode exists in the candidate mode list.
  • the prev_intra-luma_pred_flag may be set to 1 to indicate the first A logo.
  • the generating the mode value according to the current coding mode of the current block and the candidate mode list may specifically include:
  • each coding mode in the candidate mode list is sorted according to an appearance probability from high to low;
  • the value of the current coding mode is greater than the value of the coding mode with the third appearance probability, the value of the current coding mode is decremented by 1 to generate a first intermediate value, otherwise, the value of the current coding mode is used as the First intermediate value;
  • the first intermediate value is decremented by 1 to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate a value; if the second intermediate value is greater than a value of an encoding mode in which the probability of occurrence is first, subtracting the second intermediate value by one to generate a third intermediate value; otherwise, using the second intermediate value as the a third intermediate value; setting the mode value to the third intermediate value;
  • the method may further include:
  • a second identity is written to the header of the codestream.
  • the coding modes in the candidate mode list are sorted according to the appearance probability from high to low, and the sorting process may be: if candModeList ] is larger than candModeList[l] , ⁇ ' J
  • the sorting can be implemented by the function swap(x, y).
  • the sorting process can also be implemented in other ways, which is not limited to this embodiment.
  • rem_intra-luma_pred_mode is set to the value of the current encoding mode
  • the second identifier is used to indicate that the current encoding mode does not exist in the candidate mode list.
  • the prev_intra-luma_pred_flag may be set to 0 to indicate the second identifier.
  • step A400 the encoding, by the current coding mode, the code stream is generated according to the current coding mode, which may be specifically:
  • Determining a predicted pixel of the current block according to the current coding mode acquiring an actual pixel of the current block, generating a current residual according to the actual pixel and the predicted pixel, and generating the code stream according to the current residual .
  • FIG. 7 is a flowchart of a third hierarchical decoding method according to an embodiment of the present invention.
  • the layered decoding method provided in this embodiment may be specifically applied to a decoding process of a video, and the decoding process may be based on, but not limited to, HEVC-SVC technology.
  • the hierarchical decoding method provided in this embodiment can be implemented in conjunction with the layered coding method provided in the embodiment shown in FIG. 6. The specific implementation process is not described here.
  • the layered decoding method provided by this embodiment may be implemented by a layered decoding device, which may be integrated into a video processor of a device such as a television, a set top box, a personal computer, a notebook computer, a tablet computer or a mobile phone. It can also be set separately, and the hierarchical decoding device can be implemented by software and/or hardware.
  • Step B100 Generate an initial mode list, where the initial mode list includes an underlay coding mode of an underlay block corresponding to a current block of the enhancement layer in the bottom layer, and a first neighboring block of the enhancement block and the current block An encoding mode and a second of the enhancement layer and an upper adjacent block of the current block Coding mode
  • Step B200 Perform correction on the initial mode list to generate a candidate mode list.
  • Step B300 Generate a current coding mode of the current block according to the mode value in the code stream and the candidate mode list.
  • Step B400 Decode the current block according to the current coding mode.
  • the layered decoding apparatus generates an initial mode list, corrects the initial mode list, generates a candidate mode list, and generates a current coding mode of the current block according to the mode value and the candidate mode list in the code stream.
  • the current block is decoded according to the current coding mode.
  • the encoding mode of the corresponding underlying block is considered, and the inter-layer correlation is fully utilized, and the encoding and decoding performance is greatly improved.
  • the initial mode list is generated, the coding mode of the corresponding underlay block is used as a more probable coding mode, and the generated candidate mode list is used for decoding reference of the current block, thereby further improving the coding and decoding performance.
  • step B200 the initial mode list is modified to generate a candidate mode list, which may specifically include the following steps:
  • the index of the mode is 1, and the index of the coding mode with the third probability of occurrence is 2; if the value of the coding mode with index 0 is equal to the value of the coding mode with index 1 and is less than 2, the index is 0.
  • the value of the coding mode is set to 0, the value of the coding mode with the index of 1 is set to 1, and if the value of the coding mode with index 2 is equal to the value of the coding mode with the index of 0, the index is The value of the encoding mode of 2 is set to 26;
  • the value of the coding mode with the index of 0 is equal to the value of the coding mode with the index of 1 and is not less than 2
  • the value of the coding mode with the index of 1 and the index of 2 are respectively set according to the following formula.
  • candModeList[0] is an encoding mode in which the index is 0
  • candModeList[1] is an encoding mode in which the index is 1
  • candModeList[2] is an encoding mode in which the index is 2;
  • the value of the coding mode and the value of the coding mode whose index is 1 are not equal, and the value of the coding mode whose index is 2 is equal to the value of the coding mode whose index is 0 or the cable If the value of the coding mode indexed by 1 is not 0, and the value of the coding mode whose index is 1 is not 0, the value of the coding mode whose index is 2 is set.
  • the value of the encoding mode with the index of 0 and the value of the encoding mode with the index of 1 are not 1, the value of the encoding mode with the index of 2 is set to 1, otherwise, The value of the encoding mode with index 2 is set to 26;
  • the value of the coding mode whose index is 0 and the value of the coding mode whose index is 1, are not equal, and the value of the coding mode whose index is 2 is not equal to the value of the coding mode whose index is 0 and If the value of the coding mode whose index is 1 is, if the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set. Set to 0.
  • step B300 the current coding mode of the current block is generated according to the mode value in the code stream and the candidate mode list, which may be specifically:
  • the current coding mode exists in the candidate mode list, and the mode value in the code stream is an index of the current coding mode in the candidate mode list, and the current value may be determined according to the mode value.
  • Encoding mode if the first identifier exists in the code stream, the current coding mode exists in the candidate mode list, and the mode value in the code stream is an index of the current coding mode in the candidate mode list, and the current value may be determined according to the mode value. Encoding mode.
  • the generating the current coding mode of the current block according to the mode value in the code stream and the candidate mode list may specifically include the following steps:
  • each coding mode in the candidate mode list is sorted according to an appearance probability from high to low;
  • the mode value is smaller than the value of the coding mode whose probability of occurrence is the first, the mode value is incremented by one to generate a first intermediate value, otherwise, the mode value is used as the first intermediate value;
  • the first intermediate value is smaller than the value of the coding mode with the second appearance probability, the first intermediate is incremented by one to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate value.
  • the second intermediate value is smaller than a value of an encoding mode whose probability of occurrence is third, increasing the second intermediate value by one to generate a third intermediate value, and otherwise using the second intermediate value as the third intermediate value; a value; setting the value of the current encoding mode to the third intermediate value.
  • the current mode is not included in the candidate mode list.
  • the current coding mode needs to be calculated according to the candidate mode list and the mode value.
  • the coding modes in the candidate mode list are sorted according to the probability of occurrence from high to low.
  • the sorting process may specifically be:
  • the sorting can be implemented by the function swap(x, y).
  • the sorting process can also be implemented in other ways, which is not limited to this embodiment.
  • Rem - intra - luma_pred - mode increased by 1, no shell 1 J keep rem - intra - luma_pred - mode no more; then rem - intra - luma_pred - mode compared with candModeList [l]:
  • Rem_intra- luma_pred-mode is incremented by 1, no shell 1 J, keep rem-intra-luma_pred-mode not more; then rem-in-luma_pred-mode is compared with candModeList[2]:
  • Rem - intra - luma_pred - mode increased by 1, no shell 1 J , keep rem - intra - luma_pred - mode no more.
  • the value of the current encoding mode is set to rem_intra-luma_pred_mode.
  • step B400 the decoding, by the current coding mode, the current block is specifically:
  • FIG. 8 is a schematic structural diagram of a first hierarchical coding apparatus according to an embodiment of the present invention.
  • the hierarchical coding apparatus provided in this embodiment may specifically implement the steps of the layered coding method provided in the embodiment shown in FIG. 1 , and the specific implementation process is not described herein.
  • the layered encoding device of the embodiment may be integrated into a video processor of a device such as a television, a set top box, a personal computer, a notebook computer, a tablet computer or a mobile phone, or may be separately provided, and the layered encoding device may pass through software. And / or hardware to achieve.
  • the layered coding apparatus specifically includes an acquisition unit 11 and a first coding unit 12.
  • the obtaining unit 11 is configured to obtain an underlying coding mode of the underlying block corresponding to the current block of the enhancement layer in the bottom layer.
  • the first coding unit 12 is connected to the obtaining unit 11 and configured to: if the current coding mode of the current block is the same as the bottom coding mode, encode the current block according to the current coding mode. And indicating, at the head of the code stream, an indication identifier for indicating that intra-frame coding uses inter-layer information.
  • the obtaining unit 11 obtains an underlay coding mode of the underlay block corresponding to the current block of the enhancement layer in the bottom layer, and if the current coding mode of the current block is the same as the underlying coding mode, the first coding unit 12 Then, the current block is encoded according to the current coding mode to generate a code stream, and an indication identifier for indicating intra-frame coding using the inter-layer information is set in the code stream.
  • the encoding mode of the corresponding underlying block is considered, and the inter-layer correlation is fully utilized, which greatly improves the encoding and decoding performance.
  • the first coding unit 12 may be specifically configured to determine, according to the current coding mode, a predicted pixel of the current block, and acquire an actual pixel of the current block, according to the actual pixel and the prediction.
  • the pixel generates a current residual, and the code stream is generated based on the current residual.
  • the predicted pixel of the current block may be determined according to the current coding mode. For example, if the current coding mode is a vertical prediction coding mode, a pixel adjacent to the block above the current block may be used as the prediction pixel of the current block. A residual between the actual pixel of the current block and the predicted pixel is calculated as a current residual, and the residual is encoded to generate a code stream.
  • the current coding mode is a vertical prediction coding mode
  • a residual between the actual pixel of the current block and the predicted pixel is calculated as a current residual, and the residual is encoded to generate a code stream.
  • the code stream is decoded to obtain the current residual, and if the identifier is used according to the inter-layer information in the code stream, the coding mode used by the coding side for the current block and the corresponding underlying block are identified. If the coding mode is the same, the coding mode of the underlying block may be obtained, and the prediction pixel is determined according to the coding mode of the underlying block, and the reconstruction of the current block may be implemented by adding the prediction pixel to the current residual.
  • FIG. 9 is a schematic structural diagram of a second hierarchical coding apparatus according to an embodiment of the present invention.
  • the hierarchical coding apparatus may further include a list generating unit 13, a processing unit 14, and a second encoding unit 15.
  • the list generating unit 13 is connected to the obtaining unit 11 for generating a candidate mode list if the current encoding mode of the current block is different from the underlying encoding mode.
  • the processing unit 14 is connected to the list generating unit 13 for generating a mode value according to the current encoding mode and the candidate mode list.
  • the second coding unit 15 is connected to the processing unit 14 and configured to encode the current block according to the current coding mode to generate a code stream, and write a codeword corresponding to the mode value into the code stream. And indicating, in the header of the code stream, an indication identifier indicating that the intra-coded unused inter-layer information is used.
  • the list generating unit 13 may be specifically configured to:
  • candModeList[l] 2 + ((candModeList[0] - 2 + 1) % 32
  • candModeList[0] is an encoding mode in which the index is 0
  • candModeList[1] is an encoding mode in which the index is 1.
  • the candidate mode list is established by:
  • the candidate mode list generated by the above method includes three coding modes that are more likely.
  • the values corresponding to the coding modes in the foregoing processing refer to the correspondence shown in Table 1, that is, the value of the coding mode is 0 corresponding to the planar mode (Intra-Planar), and the value of the coding mode is 1 corresponding to the DC mode (Intra- DC ) , the value of the encoding mode is 26 for the vertical mode ( Intra-Vertical). It can be understood that, according to the corresponding relationship between the preset value and the coding mode, the technical solutions adjusted by the person skilled in the art according to the actual setting are all within the protection scope of the present invention.
  • the processing unit 14 may be specifically configured to: if the current coding mode exists in the candidate mode list, set the mode value to correspond to the current coding mode in the candidate mode list. index of;
  • the second encoding unit 15 can also be configured to write the first identification to the header of the code stream.
  • the current coding mode exists in the candidate mode list
  • the current coding mode is candlntraPredModeL
  • the index of the candidate mode list candlntraPredModeL is 1
  • the mode value is set to 1, to save resource occupation, and the mode value is written.
  • the first identifier is used to indicate that the current coding mode exists in the candidate mode list, for example, the pre V_intra-luma_pred_flag may be set to 1 to indicate the First identification.
  • the processing unit 14 may be specifically configured to: if the current coding mode does not exist in the candidate mode list, sort the coding modes in the candidate mode list according to an appearance probability from high to low. ;
  • the value of the current coding mode is greater than the value of the coding mode with the third appearance probability, the value of the current coding mode is decremented by 1 to generate a first intermediate value, otherwise, the value of the current coding mode is used as the First intermediate value;
  • the first intermediate value is greater than a value of an encoding mode in which the probability of occurrence is the second, the first The intermediate value is decremented by 1 to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate value; if the second intermediate value is greater than the value of the first occurrence of the encoding mode, the The second intermediate value is decremented by 1 to generate a third intermediate value, otherwise, the second intermediate value is taken as the third intermediate value; the mode value is set as the third intermediate value;
  • the second encoding unit 15 can also be used to write a second identification to the header of the code stream.
  • the coding modes in the candidate mode list are sorted according to the appearance probability from high to low, and the sorting process may be: if candModeList ] is larger than candModeList[l] , ⁇ ' J
  • the sorting can be implemented by the function swap(x, y).
  • the sorting process can also be implemented in other ways, which is not limited to this embodiment.
  • rem_intra-luma_pred_mode is set to the value of the current encoding mode
  • the second identifier is used to indicate that the current encoding mode does not exist in the candidate mode list, for example,
  • the prev_in_luma_pred_flag is set to 0 to indicate the second identity.
  • FIG. 10 is a schematic structural diagram of a first hierarchical decoding apparatus according to an embodiment of the present invention.
  • the layered decoding apparatus provided in this embodiment may implement various steps of the layered decoding method provided in the embodiment shown in FIG. 3, and the specific implementation process thereof is not described herein.
  • the layered decoding device of the embodiment may be integrated into a video processor of a device such as a television, a set top box, a personal computer, a notebook computer, a tablet computer or a mobile phone, or may be separately provided, and the layered decoding device may pass through software. And / or hardware to achieve.
  • the hierarchical decoding apparatus specifically includes a first obtaining unit 21, a second obtaining unit 22, and a first decoding unit 23.
  • the first obtaining unit 21 is configured to obtain an indication identifier in the code stream.
  • the second obtaining unit 22 is connected to the first obtaining unit 21, and configured to: if the indication identifier is used to indicate that intra-frame coding uses inter-layer information, obtain an underlay block corresponding to a current block of the enhancement layer in the bottom layer.
  • the underlying encoding mode is connected to the second obtaining unit 22, and is configured to decode the current block according to the underlying encoding mode.
  • the first acquiring unit 21 acquires the indication identifier in the code stream
  • the second obtaining unit 22 obtains the current information of the current layer in the bottom layer if the layer layer uses the identifier in the code stream.
  • the underlying encoding mode of the underlying block the first decoding unit 23 decodes the current block according to the underlying encoding mode. In the encoding process of the current block, the encoding mode of the corresponding underlying block is considered, and the inter-layer correlation is fully utilized, and the encoding and decoding performance is greatly improved.
  • the first decoding unit 23 may be specifically configured to determine a predicted pixel of the current block according to the underlay coding mode, generate a current residual according to the code stream, according to the predicted pixel and the The current residual performs reconstruction of the current block.
  • FIG. 11 is a schematic structural diagram of a second hierarchical decoding apparatus according to an embodiment of the present invention.
  • the hierarchical decoding apparatus may further include a list generating unit 24, a processing unit 25, and a second decoding unit 26.
  • the list generating unit 24 is connected to the first obtaining unit, and is configured to generate a candidate mode list if the indication identifier is used to indicate that intra-frame coding does not use inter-layer information.
  • the processing unit 25 is connected to the list generating unit 24, and configured to: according to the mode value in the code stream and the candidate
  • the selection mode list generates the current coding mode of the current block.
  • the second decoding unit 26 is connected to the processing unit 25, and is configured to decode the current block according to the current coding mode.
  • the list generating unit 24 may be specifically configured to:
  • candModeList[l] 2 + ((candModeList[0] - 2 + 1) % 32
  • candModeList[0] is an encoding mode in which the index is 0
  • candModeList[1] is an encoding mode in which the index is 1.
  • the processing unit 25 may be specifically configured to: if the current encoding mode exists in the candidate mode list according to the first identifier in the code stream, set the current encoding mode to The candidate mode list is an encoding mode indexed by the mode value.
  • the current coding mode exists in the candidate mode list, and the mode value in the code stream is an index of the current coding mode in the candidate mode list, and the current value may be determined according to the mode value.
  • Encoding mode if the first identifier exists in the code stream, the current coding mode exists in the candidate mode list, and the mode value in the code stream is an index of the current coding mode in the candidate mode list, and the current value may be determined according to the mode value. Encoding mode.
  • processing unit 25 may be specifically configured to:
  • each coding mode in the candidate mode list is sorted according to an appearance probability from high to low;
  • the mode value is smaller than the value of the coding mode whose probability of occurrence is the first, the mode value is incremented by one to generate a first intermediate value, otherwise, the mode value is used as the first intermediate value;
  • the first intermediate value is smaller than the value of the coding mode with the second appearance probability, the first intermediate is incremented by one to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate value. ; And if the second intermediate value is smaller than a value of an encoding mode whose probability of occurrence is third, increasing the second intermediate value by one to generate a third intermediate value, and otherwise using the second intermediate value as the third intermediate value And setting a value of the current encoding mode to the third intermediate value.
  • the current coding mode needs to be calculated according to the candidate mode list and the mode value.
  • the coding modes in the candidate mode list are sorted according to the probability of occurrence from high to low.
  • the sequence process may be:
  • the sorting can be implemented by the function swap(x, y).
  • the sorting process can also be implemented in other ways, which is not limited to this embodiment.
  • Rem - intra - luma_pred - mode increased by 1, no shell 1 J keep rem - intra - luma_pred - mode no more; then rem - intra - luma_pred - mode compared with candModeList [l]:
  • Rem - intra - luma_pred - mode increased by 1, no shell 1 J , keep rem - intra - luma_pred - mode no more; then rem - intra - luma_pred - mode compared with candModeList [2]:
  • Rem - intra - luma_pred - mode is incremented by 1, no shell 1 J , keep rem - intra - luma_pred - mode no more, the current encoding mode value is set to rem - intra - luma_pred - mode.
  • FIG. 12 is a schematic structural diagram of a third hierarchical coding apparatus according to an embodiment of the present invention.
  • the layered coding apparatus provided in this embodiment may implement various steps of the layered coding method provided in the embodiment shown in FIG. 6, and the specific implementation process is not described herein.
  • the layered encoding device of the embodiment may be integrated into a video processor of a device such as a television, a set top box, a personal computer, a notebook computer, a tablet computer or a mobile phone, or may be separately provided, and the layered encoding device may pass through software. And / or hardware to achieve.
  • the hierarchical coding apparatus specifically includes an initialization unit 31, a correction unit 32, a processing unit 33, and an encoding unit 34.
  • the initializing unit 31 is configured to generate an initial mode list, where the initial mode list includes an underlay coding mode of an underlay block corresponding to a current block of the enhancement layer in the bottom layer, and a left phase of the enhancement layer and the current block a first coding mode of the neighboring block and a second coding mode of the upper adjacent block of the current block in the enhancement layer.
  • the modification unit 32 is connected to the initialization unit 31 for modifying the initial mode list to generate a candidate mode list.
  • the processing unit 33 is connected to the modification unit 32, and configured to generate a mode value according to a current coding mode of the current block and the candidate mode list.
  • the coding unit 34 is connected to the processing unit 33, and configured to code the current block according to the current coding mode to generate a code stream, and write a codeword corresponding to the mode value into the code stream.
  • the initialization unit 31 generates an initial mode list
  • the correction unit 32 corrects the initial mode list
  • the processing unit 33 generates a mode value according to the current coding mode and the candidate mode list of the current block.
  • the encoding unit 34 encodes the current block according to the current encoding mode to generate a code stream, and writes the code word corresponding to the mode value into the code stream.
  • the encoding mode of the corresponding underlying block is taken into consideration, and the inter-layer correlation is fully utilized, and the codec performance is greatly improved.
  • the initial mode list is generated, the coding mode of the corresponding underlying block is taken as the more likely coding mode, and the generated candidate mode list is used for the coding reference of the current block, thereby further improving the coding and decoding performance.
  • FIG. 13 is a schematic structural diagram of a fourth hierarchical coding apparatus according to an embodiment of the present invention.
  • the correction unit 32 may include a first sorting subunit 321 and a first processing subunit 322.
  • the first sorting sub-unit 321 is connected to the initializing unit 31, and is configured to sort the low-level encoding mode, the first encoding mode, and the second encoding mode according to an appearance probability, and set an occurrence probability.
  • the index of the first coding mode is 0, the index of the coding mode with the second probability of occurrence is 1 , and the index of the coding mode with the third probability of occurrence is 2.
  • the first processing sub-unit 322 is connected to the first sorting sub-unit 321 and configured to: if the value of the encoding mode with the index of 0 and the value of the encoding mode with the index of 1 are equal and less than 2, the index is The value of the coding mode of 0 is set to 0, the value of the coding mode with the index of 1 is set to 1, and if the value of the coding mode with index 2 is equal to the value of the coding mode with the index of 0, then The value of the encoding mode with index 2 is set to 26;
  • the value of the coding mode with the index of 0 is equal to the value of the coding mode with the index of 1 and is not less than 2
  • the value of the coding mode with the index of 1 and the index of 2 are respectively set according to the following formula.
  • candModeList[0] is an encoding mode in which the index is 0
  • candModeList[1] is an encoding mode in which the index is 1
  • candModeList[2] is an encoding mode in which the index is 2;
  • the value of the coding mode and the value of the coding mode whose index is 1 are not equal, and the value of the coding mode whose index is 2 is equal to the value of the coding mode whose index is 0 or the coding mode whose index is 1.
  • the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set to 0, if If the value of the coding mode with index 0 and the value of the coding mode with index 1 are not 1, the value of the coding mode with the index of 2 is set to 1, otherwise, the code with the index of 2 is set.
  • the value of the mode is set to 26;
  • the value of the coding mode whose index is 0 and the value of the coding mode whose index is 1, are not equal, and the value of the coding mode whose index is 2 is not equal to the value of the coding mode whose index is 0 and If the value of the coding mode whose index is 1 is, if the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set. Set to 0.
  • the larger the value of the coding mode, the smaller the probability of occurrence, and the probability of occurrence of each coding mode is pre-statistic.
  • candModeList[0] candlntraPredModeB
  • candModeList[0] and candModeList[l] are equal If candModeList[0] is less than 2, then
  • the value of the coding mode is 0 corresponding to the planar mode (Intra-Planar)
  • the value of the coding mode is 1 corresponding to the DC mode (Intra- DC )
  • the value of the encoding mode is 26 for the vertical mode ( Intra-Vertical).
  • the processing unit 33 is specifically configured to: if the current coding mode exists in the candidate mode list, set the mode value to correspond to the current coding mode in the candidate mode list.
  • the encoding unit 34 is further configured to write the first identification to the header of the code stream.
  • the current coding mode exists in the candidate mode list
  • the current coding mode is candlntraPredModeB
  • the index of the candidate mode list candlntraPredModeB is 1
  • the mode value is set to 1, to save resource occupation, and the mode value is written.
  • the pre V-intra-luma_pred_flag may be set to 1 to indicate the first identity.
  • the processing unit 33 may specifically include a second sorting subunit 331 and a second processing subunit 332.
  • the second sorting sub-unit 331 is connected to the correcting unit 32, and configured to: if the current encoding mode does not exist in the candidate mode list, encode each candidate mode list according to an appearance probability from high to low. The mode is sorted.
  • the second processing sub-unit 332 is connected to the second sorting sub-unit 331, and configured to: if the value of the current encoding mode is greater than the value of the encoding mode with the third appearance probability, the value of the current encoding mode Subtracting 1 to generate a first intermediate value, otherwise, using the value of the current encoding mode as the first intermediate value;
  • the first intermediate value is decremented by 1 to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate a value; if the second intermediate value is greater than a value of an encoding mode in which the probability of occurrence is first, subtracting the second intermediate value by one to generate a third intermediate value; otherwise, using the second intermediate value as the a third intermediate value; setting the mode value to the third intermediate value;
  • the encoding unit 34 is further configured to write a second identification to the header of the code stream.
  • the coding modes in the candidate mode list are sorted according to the appearance probability from high to low, and the sorting process may be: if candModeList ] is larger than candModeList[l] , ⁇ ' J
  • the sorting can be implemented by the function swap(x, y).
  • the sorting process can also be implemented in other ways, which is not limited to this embodiment.
  • rem_intra-luma_pred_mode is set to the value of the current encoding mode
  • the second identifier is used to indicate that the current encoding mode does not exist in the candidate mode list.
  • the prev_intra-luma_pred_flag may be set to 0 to indicate the second identifier.
  • the second coding unit 34 may be specifically configured to determine, according to the current coding mode, a predicted pixel of the current block, and acquire an actual pixel of the current block, according to the actual pixel and the prediction.
  • the pixel generates a current residual, and the code stream is generated based on the current residual.
  • FIG. 14 is a schematic structural diagram of a third hierarchical decoding apparatus according to an embodiment of the present invention.
  • the layered decoding apparatus provided in this embodiment may implement various steps of the layered decoding method provided in the embodiment shown in FIG. 7, and the specific implementation process is not described herein.
  • the layered decoding device of the embodiment may be integrated into a video processor of a device such as a television, a set top box, a personal computer, a notebook computer, a tablet computer or a mobile phone, or may be separately provided, and the layered decoding device may pass through software. And / or hardware to achieve.
  • the hierarchical decoding apparatus specifically includes an initialization unit 41, a correction unit 42, a processing unit 43, and a decoding unit 44.
  • the initializing unit 41 is configured to generate an initial mode list, where the initial mode list includes an underlay coding mode of an underlay block corresponding to a current block of the enhancement layer in the bottom layer, and a left phase of the enhancement layer and the current block a first coding mode of the neighboring block and a second coding mode of the upper adjacent block of the current block in the enhancement layer.
  • the modifying unit 42 is connected to the initializing unit 41, and is configured to modify the initial mode list to generate a candidate mode list.
  • the processing unit 43 is connected to the modifying unit 42 for using a mode according to the code stream.
  • the value and the candidate mode list generate a current encoding mode of the current block.
  • the decoding unit 44 is connected to the modification unit 42 and configured to decode the current block according to the current coding mode.
  • the initializing unit 41 generates an initial mode list, and the correction is performed.
  • the unit 42 corrects the initial mode list to generate a candidate mode list
  • the processing unit 43 generates a current coding mode of the current block according to the mode value and the candidate mode list in the code stream
  • the decoding unit 44 decodes the current block according to the current coding mode.
  • the encoding mode of the corresponding underlying block is considered, and the inter-layer correlation is fully utilized, and the encoding and decoding performance is greatly improved.
  • the initial mode list is generated, the coding mode of the corresponding underlay block is used as the more likely coding mode, and the generated candidate mode list is used for decoding reference of the current block, thereby further improving the codec performance.
  • FIG. 15 is a schematic structural diagram of a fourth hierarchical decoding apparatus according to an embodiment of the present invention.
  • the correcting unit 42 may specifically include a first sorting subunit 421 and a first processing subunit 422.
  • the first sorting sub-unit 421 is connected to the initializing unit 41, and is configured to sort the low-level encoding mode, the first encoding mode, and the second encoding mode according to an appearance probability, and set an occurrence probability.
  • the index of the first coding mode is 0, the index of the coding mode with the second probability of occurrence is 1 , and the index of the coding mode with the third probability of occurrence is 2.
  • the first processing sub-unit 422 is connected to the first sorting sub-unit 421, and is configured to: if the value of the encoding mode with the index of 0 and the value of the encoding mode with the index of 1 are equal and less than 2, the index is The value of the coding mode of 0 is set to 0, the value of the coding mode with the index of 1 is set to 1, and if the value of the coding mode with index 2 is equal to the value of the coding mode with the index of 0, then The value of the encoding mode with index 2 is set to 26;
  • the value of the coding mode with the index of 0 is equal to the value of the coding mode with the index of 1 and is not less than 2
  • the value of the coding mode with the index of 1 and the index of 2 are respectively set according to the following formula.
  • candModeList[0] is an encoding mode in which the index is 0
  • candModeList[1] is an encoding mode in which the index is 1
  • candModeList[2] is an encoding mode in which the index is 2;
  • the value of the coding mode and the value of the coding mode whose index is 1 are not equal, and the value of the coding mode whose index is 2 is equal to the value of the coding mode whose index is 0 or the coding mode whose index is 1.
  • the value of the coding mode with the index of 2 is set to 0, if If the value of the coding mode with index 0 and the value of the coding mode with index 1 are not 1, then The value of the encoding mode with the index of 2 is set to 1, otherwise, the value of the encoding mode with the index of 2 is set to 26;
  • the value of the coding mode whose index is 0 and the value of the coding mode whose index is 1, are not equal, and the value of the coding mode whose index is 2 is not equal to the value of the coding mode whose index is 0 and If the value of the coding mode whose index is 1 is, if the value of the coding mode with the index of 0 and the value of the coding mode with the index of 1 are not 0, the value of the coding mode with the index of 2 is set. Set to 0.
  • the processing unit 43 may be specifically configured to: if the current encoding mode exists in the candidate mode list according to the first identifier in the code stream, set the current encoding mode to The candidate mode list is an encoding mode indexed by the mode value.
  • the processing unit 43 may specifically include a second sorting subunit 431 and a second processing subunit 432.
  • the second sorting sub-unit 431 is connected to the correcting unit 42, and configured to: if the current encoding mode does not exist in the candidate mode list according to the second identifier in the code stream, High to low sorts each coding mode in the candidate mode list.
  • the second processing sub-unit 432 is connected to the second sorting sub-unit 431, and is configured to increase the mode value by one to generate the first intermediate if the mode value is smaller than the value of the first encoding mode. a value, otherwise, the mode value is taken as the first intermediate value;
  • the first intermediate value is smaller than the value of the coding mode with the second appearance probability, the first intermediate is incremented by one to generate a second intermediate value, otherwise, the first intermediate value is used as the second intermediate value.
  • the second intermediate value is smaller than a value of an encoding mode whose probability of occurrence is third, increasing the second intermediate value by one to generate a third intermediate value, and otherwise using the second intermediate value as the third intermediate value; a value; setting the value of the current encoding mode to the third intermediate value.
  • the coding modes in the candidate mode list are sorted according to the probability of occurrence from high to low.
  • the sequence process may be:
  • the sorting can be implemented by the function swap(x, y).
  • the sorting process can also be implemented in other ways, which is not limited to this embodiment.
  • Rem - intra - luma_pred - mode increased by 1, no shell 1 J keep rem - intra - luma_pred - mode no more; then rem - intra - luma_pred - mode compared with candModeList [l]:
  • Rem - intra - luma_pred - mode increased by 1, no shell 1 J , keep rem - intra - luma_pred - mode no more; then rem - intra - luma_pred - mode compared with candModeList [2]:
  • Rem - intra - luma_pred - mode increased by 1, no shell 1 J , keep rem - intra - luma_pred - mode no more.
  • the value of the current encoding mode is set to rem_intra-luma_pred_mode.
  • the decoding unit 44 may be specifically configured to determine, according to the current coding mode, a predicted pixel of the current block, and generate a current residual according to the code stream, according to the predicted pixel and the current residual. The difference is the reconstruction of the current block.

Abstract

本发明实施例提供一种分层编解码方法及装置,该分层编码方法包括:获取底层中、与增强层的当前块对应的底层块的底层编码模式;若当前块的当前编码模式与底层编码模式相同,则根据当前编码模式对当前块进行编码生成码流,在码流的头部设置用以指示帧内编码使用层间信息的指示标识。本发明实施例提供的分层编解码方法及装置,在对当前块的编码过程中考虑到了对应的底层块的编码模式,充分利用了层间相关性,大大提高了编解码性能。

Description

分层编解码方法及装置 技术领域 本发明实施例涉及视频处理技术,尤其涉及一种分层编解码方法及装置。 背景技术
随着网络技术和终端处理能力的不断提高和发展, 人们对视频编码要求 越来越高。 高效率视频编码( High Efficiency Video Coding, 简称 HEVC )是 新一代的视频编码标准, 在 HEVC 的帧内编码技术中, 对亮度信号的预测 有 35种模式。 在 HEVC的帧内编码技术的应用过程中, 需要构建候选模式 列表来实现编解码。
可分层视频编解码(Scalable Video Coding, 简称 SVC ) , 是一种能将视 频流分割为多个分辨率、质量和帧速率层的技术,将 SVC作为 HEVC的帧内 编码技术的扩展, 视频数据被分为一个底层和可提高分辨率、 帧速率和质量 的其它可选的增强层组成的多层视频流。为了适应 SVC对 HEVC的帧内编码 技术的扩展, 亟需突出一种高效的视频编解码方法, 以提高编解码性能。 发明内容
本发明实施例提供一种分层编解码方法及装置, 以提高编解码性能。 第一方面, 本发明实施例提供的一种分层编码方法, 包括:
获取底层中、 与增强层的当前块对应的底层块的底层编码模式; 若所述当前块的当前编码模式与所述底层编码模式相同, 则根据所述当 前编码模式对所述当前块进行编码生成码流, 在所述码流的头部设置用以指 示帧内编码使用层间信息的指示标识。
在第一种可能的实现方式中, 所述获取底层中、 与增强层的当前块对应 的底层块的底层编码模式之后, 所述方法还包括:
若所述当前块的当前编码模式与所述底层编码模式不同, 则生成候选模 式列表;
根据所述当前编码模式和所述候选模式列表生成模式值; 根据所述当前编码模式对所述当前块进行编码生成码流, 将所述模式值 对应的码字写入所述码流中, 在所述码流的头部设置用以指示帧内编码未使 用层间信息的指示标识。
结合第一方面的第一种可能的实现方式, 在第二种可能的实现方式中, 所述生成候选模式列表, 包括:
设置所述增强层中与所述当前块的左相邻块的第一编码模式的索引为 0 , 设置所述增强层中与所述当前块的上相邻块的第二编码模式的索引为 1; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 ;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 则若所述底层编码模式的值大于所述第一编码模式的值, 根据以 下公式设置所述索引为 1 的编码模式的值: candModeList[l] = 2 + ((candModeList[0] + 29) % 32), 否则,根据以下公式设置所述索引为 1的编码 模式的值: candModeList[l] = 2 + ((candModeList[0] · · 2 + 1) % 32); 其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l]为所述索引为 1的编码模式;
设置所述底层编码模式的索引为 2。
结合第一方面的第一种可能的实现方式, 在第三种可能的实现方式中, 所述根据当前块的当前编码模式和所述候选模式列表生成模式值, 具体为: 若所述候选模式列表中存在所述当前编码模式 , 则将所述模式值设置为 所述候选模式列表中的所述当前编码模式对应的索引;
所述根据所述当前编码模式对所述当前块进行编码生成码流之后, 所述 方法还包括:
将第一标识写入所述码流的头部。
结合第一方面的第一种可能的实现方式, 在第四种可能的实现方式中, 所述根据当前块的当前编码模式和所述候选模式列表生成模式值, 包括: 若所述候选模式列表中不存在所述当前编码模式, 则按照出现概率由高 到低将所述候选模式列表中各编码模式进行排序;
若所述当前编码模式的值大于出现概率为第三的编码模式的值, 则将所 述当前编码模式的值减 1生成第一中间值, 否则, 将所述当前编码模式的值 作为所述第一中间值;
若所述第一中间值大于出现概率为第二的编码模式的值, 则将所述第一 中间值减 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值大于出现概率为第一的编码模式的值, 则将所述第二 中间值减 1生成第三中间值, 否则, 将所述第二中间值作为所述第三中间值; 将所述模式值设置为所述第三中间值;
所述根据所述当前编码模式对所述当前块进行编码生成码流之后, 所述 方法还包括:
将第二标识写入所述码流的头部。
在第五种可能的实现方式中, 所述根据所述当前编码模式对所述当前块 进行编码生成码流, 具体为:
根据所述当前编码模式确定所述当前块的预测像素, 获取所述当前块的 实际像素, 根据所述实际像素和所述预测像素生成当前残差, 根据所述当前 残差生成所述码流。
第二方面, 本发明实施例提供一种分层解码方法, 包括:
获取码流中的指示标识;
若所述指示标识用以指示帧内编码使用层间信息, 则获取底层中与增强 层的当前块对应的底层块的底层编码模式;
根据所述底层编码模式对所述当前块进行解码。 。
在第一种可能的实现方式中, 所述获取码流中的指示标识之后, 所述方 法还包括:
若所述指示标识用以指示帧内编码未使用层间信息, 则生成候选模式列 表;
根据所述码流中的模式值和所述候选模式列表生成当前块的当前编码模 式;
根据所述当前编码模式对所述当前块进行解码。
结合第二方面的第一种可能的实现方式, 在第二种可能的实现方式中, 所述生成候选模式列表, 包括:
设置所述增强层中与所述当前块的左相邻块的第一编码模式的索引为 0, 设置所述增强层中与所述当前块的上相邻块的第二编码模式的索引为 1; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 ;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 则若所述底层编码模式的值大于所述第一编码模式的值, 根据以 下公式设置所述索引为 1 的编码模式的值: candModeList[l] = 2 + ((candModeList[0] + 29) % 32), 否则,根据以下公式设置所述索引为 1的编码 模式的值: candModeList[l] = 2 + ((candModeList[0] · · 2 + 1) % 32); 其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l]为所述索引为 1的编码模式;
设置所述底层编码模式的索引为 2。
结合第二方面的第一种可能的实现方式, 在第三种可能的实现方式中, 所述根据码流中的模式值和所述候选模式列表生成当前块的当前编码模式, 包括:
若根据所述码流中的第一标识识别到所述候选模式列表中存在所述当前 编码模式, 则将所述当前编码模式设置为所述候选模式列表以所述模式值为 索引的编码模式。
结合第二方面的第一种可能的实现方式, 在第四种可能的实现方式中, 所述根据码流中的模式值和所述候选模式列表生成当前块的当前编码模式, 包括:
若根据所述码流中的第二标识识别到所述候选模式列表中不存在所述当 前编码模式, 则按照出现概率由高到低将所述候选模式列表中各编码模式进 行排序;
若所述模式值小于出现概率为第一的编码模式的值, 则将所述模式值增 1生成第一中间值, 否则, 将所述模式值作为所述第一中间值;
若所述第一中间值小于出现概率为第二的编码模式的值, 则将所述第一 中间增 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值小于出现概率为第三的编码模式的值, 则将所述第二 中间值增 1生成第三中间值, 否则将所述第二中间值作为所述第三中间值; 将所述当前编码模式的值设置为所述第三中间值。
在第五种可能的实现方式中, 所述根据所述底层编码模式对所述当前块 进行解码, 具体为:
根据所述底层编码模式确定所述当前块的预测像素, 根据所述码流生成 当前残差, 根据所述预测像素和所述当前残差进行所述当前块的重建。
第三方面, 本发明实施例提供一种分层编码装置, 包括:
获取单元, 用于获取底层中、 与增强层的当前块对应的底层块的底层编 码模式;
第一编码单元, 与所述获取单元相连, 用于若所述当前块的当前编码模 式与所述底层编码模式相同, 则根据所述当前编码模式对所述当前块进行编 码生成码流, 在所述码流的头部设置用以指示帧内编码使用层间信息的指示 标识。
在第一种可能的实现方式中, 所述分层编码装置, 还包括:
列表生成单元, 用于若所述当前块的当前编码模式与所述底层编码模式 不同, 则生成候选模式列表;
处理单元, 与所述列表生成单元相连, 用于根据所述当前编码模式和所 述候选模式列表生成模式值;
第二编码单元, 与所述处理单元相连, 用于根据所述当前编码模式对所 述当前块进行编码生成码流, 将所述模式值对应的码字写入所述码流中, 在 所述码流的头部设置用以指示帧内编码未使用层间信息的指示标识。
结合第三方面的第一种可能的实现方式, 在第二种可能的实现方式中, 所述列表生成单元具体用于:
设置所述增强层中与所述当前块的左相邻块的第一编码模式的索引为 0 , 设置所述增强层中与所述当前块的上相邻块的第二编码模式的索引为 1; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 ;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 则若所述底层编码模式的值大于所述第一编码模式的值, 根据以 下公式设置所述索引为 1 的编码模式的值: candModeList[l] = 2 + ((candModeList[0] + 29) % 32), 否则,根据以下公式设置所述索引为 1的编码 模式的值: candModeList[l] = 2 + ((candModeList[0] · · 2 + 1) % 32); 其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l]为所述索引为 1的编码模式;
设置所述底层编码模式的索引为 2。
结合第三方面的第一种可能的实现方式, 在第三种可能的实现方式中, 所述处理单元具体用于若所述候选模式列表中存在所述当前编码模式, 则将 所述模式值设置为所述候选模式列表中的所述当前编码模式对应的索引; 所述第二编码单元还用于将第一标识写入所述码流的头部。
结合第三方面的第一种可能的实现方式, 在第四种可能的实现方式中, 所述处理单元具体用于若所述候选模式列表中不存在所述当前编码模式, 则 按照出现概率由高到低将所述候选模式列表中各编码模式进行排序;
若所述当前编码模式的值大于出现概率为第三的编码模式的值, 则将所 述当前编码模式的值减 1生成第一中间值, 否则, 将所述当前编码模式的值 作为所述第一中间值;
若所述第一中间值大于出现概率为第二的编码模式的值, 则将所述第一 中间值减 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值大于出现概率为第一的编码模式的值, 则将所述第二 中间值减 1生成第三中间值, 否则, 将所述第二中间值作为所述第三中间值; 将所述模式值设置为所述第三中间值;
所述第二编码单元还用于将第二标识写入所述码流的头部。
在第五种可能的实现方式中, 所述第一编码单元具体用于根据所述当前 编码模式确定所述当前块的预测像素, 获取所述当前块的实际像素, 根据所 述实际像素和所述预测像素生成当前残差,根据所述当前残差生成所述码流。
第四方面, 本发明实施例提供一种分层解码装置, 包括:
第一获取单元, 用于获取码流中的指示标识;
第二获取单元, 与所述第一获取单元相连, 用于若所述指示标识用以指 示帧内编码使用层间信息, 则获取底层中与增强层的当前块对应的底层块的 底层编码模式;
第一解码单元, 与所述第二获取单元相连, 用于根据所述底层编码模式 对所述当前块进行解码。
在第一种可能的实现方式中, 所述分层解码装置, 还包括:
列表生成单元, 与所述第一获取单元相连, 用于若所述指示标识用以指 示帧内编码未使用层间信息, 则生成候选模式列表;
处理单元, 与所述列表生成单元相连, 用于根据码流中的模式值和所述 候选模式列表生成当前块的当前编码模式;
第二解码单元, 与所述处理单元相连, 用于根据所述当前编码模式对所 述当前块进行解码。
结合第四方面的第一种可能的实现方式, 在第二种可能的实现方式中, 所述列表生成单元具体用于:
设置所述增强层中与所述当前块的左相邻块的第一编码模式的索引为 0 , 设置所述增强层中与所述当前块的上相邻块的第二编码模式的索引为 1; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 ;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 则若所述底层编码模式的值大于所述第一编码模式的值, 根据以 下公式设置所述索引为 1 的编码模式的值: candModeList[l] = 2 + ((candModeList[0] + 29) % 32), 否则,根据以下公式设置所述索引为 1的编码 模式的值: candModeList[l] = 2 + ((candModeList[0] · · 2 + 1) % 32); 其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l]为所述索引为 1的编码模式;
设置所述底层编码模式的索引为 2。
结合第四方面的第一种可能的实现方式, 在第三种可能的实现方式中, 所述处理单元具体用于若根据所述码流中的第一标识识别到所述候选模式列 表中存在所述当前编码模式, 则将所述当前编码模式设置为所述候选模式列 表以所述模式值为索引的编码模式。
结合第四方面的第一种可能的实现方式, 在第四种可能的实现方式中, 所述处理单元具体用于:
若根据所述码流中的第二标识识别到所述候选模式列表中不存在所述当 前编码模式, 则按照出现概率由高到低将所述候选模式列表中各编码模式进 行排序;
若所述模式值小于出现概率为第一的编码模式的值 , 则将所述模式值增
1生成第一中间值, 否则, 将所述模式值作为所述第一中间值;
若所述第一中间值小于出现概率为第二的编码模式的值, 则将所述第一 中间增 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值小于出现概率为第三的编码模式的值, 则将所述第二 中间值增 1生成第三中间值, 否则将所述第二中间值作为所述第三中间值; 将所述当前编码模式的值设置为所述第三中间值。
在第五种可能的实现方式中, 所述第一解码单元具体用于根据所述底层 编码模式确定所述当前块的预测像素, 根据所述码流生成当前残差, 根据所 述预测像素和所述当前残差进行所述当前块的重建。
第五方面, 本发明实施例提供一种分层编码方法, 包括:
生成初始模式列表, 其中, 所述初始模式列表包括底层中与增强层的当 前块对应的底层块的底层编码模式、 所述增强层中与所述当前块的左相邻块 的第一编码模式和所述增强层中与所述当前块的上相邻块的第二编码模式; 根据当前块的当前编码模式和所述候选模式列表生成模式值;
根据所述当前编码模式对所述当前块进行编码生成码流, 将所述模式值 对应的码字写入所述码流中。
在第一种可能的实现方式中, 所述对所述初始模式列表进行修正, 生成 候选模式列表, 包括:
按照出现概率由高到低所述底层编码模式、 所述第一编码模式和所述第 二编码模式进行排序, 设置出现概率为第一的编码模式的索引为 0, 出现概 率为第二的编码模式的索引为 1 , 出现概率为第三的编码模式的索引为 2; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 , 若索引为 2的编码模式的值与所述索引为 0的编码模式的值相 等, 则将所述索引为 2的编码模式的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 根据以下公式分别设置所述索引为 1 的编码模式的值和所述索引 为 2的编码模式的值:
candModeList[l] = 2 + ((candModeList[0] + 29) % 32);
candModeList[2] = 2 + ((candModeList[0] · · 2 + 1) % 32);
其中, candModeList[0] 为所述索引为 0 的编码模式, candModeList[l] 为所述索引为 1的编码模式, candModeList[2]为所述索引为 2的编码模式; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值等于所述索引为 0的编码模式的值或所述索 引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1 的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0, 若所 述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 1 , 则将 所述索引为 2的编码模式的值设置为 1 , 否则, 将所述索引为 2的编码模式 的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值不等于所述索引为 0的编码模式的值和所述 索引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0。
在第二种可能的实现方式中, 所述根据当前块的当前编码模式和所述候 选模式列表生成模式值, 具体为:
若所述候选模式列表中存在所述当前编码模式 , 则将所述模式值设置为 所述候选模式列表中的所述当前编码模式对应的索引;
所述根据所述当前编码模式对所述当前块进行编码生成码流之后, 所述 方法还包括:
将第一标识写入所述码流的头部。
在第三种可能的实现方式中, 所述根据当前块的当前编码模式和所述候 选模式列表生成模式值, 包括:
若所述候选模式列表中不存在所述当前编码模式, 则按照出现概率由高 到低将所述候选模式列表中各编码模式进行排序;
若所述当前编码模式的值大于出现概率为第三的编码模式的值, 则将所 述当前编码模式的值减 1生成第一中间值, 否则, 将所述当前编码模式的值 作为所述第一中间值; 若所述第一中间值大于出现概率为第二的编码模式的值, 则将所述第一 中间值减 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值大于出现概率为第一的编码模式的值, 则将所述第二 中间值减 1生成第三中间值, 否则, 将所述第二中间值作为所述第三中间值; 将所述模式值设置为所述第三中间值;
所述根据所述当前编码模式对所述当前块进行编码生成码流之后, 所述 方法还包括:
将第二标识写入所述码流的头部。
在第四种可能的实现方式中, 所述根据所述当前编码模式对所述当前块 进行编码生成码流, 具体为:
根据所述当前编码模式确定所述当前块的预测像素, 获取所述当前块的 实际像素, 根据所述实际像素和所述预测像素生成当前残差, 根据所述当前 残差生成所述码流。
第六方面, 本发明实施例提供一种分层解码方法, 包括:
生成初始模式列表, 其中, 所述初始模式列表包括底层中与增强层的当 前块对应的底层块的底层编码模式、 所述增强层中与所述当前块的左相邻块 的第一编码模式和所述增强层中与所述当前块的上相邻块的第二编码模式; 对所述初始模式列表进行修正, 生成候选模式列表;
根据码流中的模式值和所述候选模式列表生成当前块的当前编码模式; 根据所述当前编码模式对所述当前块进行解码。
在第一种可能的实现方式中, 所述对所述初始模式列表进行修正, 生成 候选模式列表, 包括:
按照出现概率由高到低所述底层编码模式、 所述第一编码模式和所述第 二编码模式进行排序, 设置出现概率为第一的编码模式的索引为 0, 出现概 率为第二的编码模式的索引为 1 , 出现概率为第三的编码模式的索引为 2; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 , 若索引为 2的编码模式的值与所述索引为 0的编码模式的值相 等, 则将所述索引为 2的编码模式的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 根据以下公式分别设置所述索引为 1 的编码模式的值和所述索引 为 2的编码模式的值:
candModeList[l] = 2 + ((candModeList[0] + 29) % 32);
candModeList[2] = 2 + ((candModeList[0] · · 2 + 1) % 32);
其中, candModeList[0] 为所述索引为 0 的编码模式, candModeList[l] 为所述索引为 1的编码模式, candModeList[2]为所述索引为 2的编码模式; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值等于所述索引为 0的编码模式的值或所述索 引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1 的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0, 若所 述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 1 , 则将 所述索引为 2的编码模式的值设置为 1 , 否则, 将所述索引为 2的编码模式 的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值不等于所述索引为 0的编码模式的值和所述 索引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0。
在第二种可能的实现方式中, 所述根据码流中的模式值和所述候选模式 列表生成当前块的当前编码模式, 具体为:
若根据所述码流中的第一标识识别到所述候选模式列表中存在所述当前 编码模式, 则将所述当前编码模式设置为所述候选模式列表以所述模式值为 索引的编码模式。
在第三种可能的实现方式中, 所述根据码流中的模式值和所述候选模式 列表生成当前块的当前编码模式, 包括:
若根据所述码流中的第二标识识别到所述候选模式列表中不存在所述当 前编码模式, 则按照出现概率由高到低将所述候选模式列表中各编码模式进 行排序;
若所述模式值小于出现概率为第一的编码模式的值 , 则将所述模式值增 1生成第一中间值, 否则, 将所述模式值作为所述第一中间值;
若所述第一中间值小于出现概率为第二的编码模式的值, 则将所述第一 中间增 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值小于出现概率为第三的编码模式的值, 则将所述第二 中间值增 1生成第三中间值, 否则将所述第二中间值作为所述第三中间值; 将所述当前编码模式的值设置为所述第三中间值。
在第四种可能的实现方式中, 所述根据所述当前编码模式对所述当前块 进行解码, 具体为:
根据所述当前编码模式确定所述当前块的预测像素, 根据所述码流生成 当前残差, 根据所述预测像素和所述当前残差进行所述当前块的重建。
第七方面, 本发明实施例提供一种分层编码装置, 包括:
初始化单元, 用于生成初始模式列表, 其中, 所述初始模式列表包括底 层中与增强层的当前块对应的底层块的底层编码模式、 所述增强层中与所述 当前块的左相邻块的第一编码模式和所述增强层中与所述当前块的上相邻块 的第二编码模式;
修正单元, 与所述初始化单元相连, 用于对所述初始模式列表进行修正, 生成 4美选模式列表;
处理单元, 与所述修正单元相连, 用于根据当前块的当前编码模式和所 述候选模式列表生成模式值;
编码单元, 与所述处理单元相连, 用于根据所述当前编码模式对所述当 前块进行编码生成码流, 将所述模式值对应的码字写入所述码流中。
在第一种可能的实现方式中, 所述修正单元包括:
第一排序子单元, 与所述第一初始化单元相连, 用于按照出现概率由高 到低所述底层编码模式、 所述第一编码模式和所述第二编码模式进行排序 , 设置出现概率为第一的编码模式的索引为 0, 出现概率为第二的编码模式的 索引为 1 , 出现概率为第三的编码模式的索引为 2;
第一处理子单元, 与所述第一排序子单元相连, 用于若索引为 0的编码 模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编 码模式的值设置为 0, 将所述索引为 1的编码模式的值设置为 1 , 若索引为 2 的编码模式的值与所述索引为 0的编码模式的值相等, 则将所述索引为 2的 编码模式的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 根据以下公式分别设置所述索引为 1 的编码模式的值和所述索引 为 2的编码模式的值:
candModeList[l] = 2 + ((candModeList[0] + 29) % 32);
candModeList[2] = 2 + ((candModeList[0] · · 2 + 1) % 32);
其中, candModeList[0] 为所述索引为 0 的编码模式, candModeList[l] 为所述索引为 1的编码模式, candModeList[2]为所述索引为 2的编码模式; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值等于所述索引为 0的编码模式的值或所述索 引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1 的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0, 若所 述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 1 , 则将 所述索引为 2的编码模式的值设置为 1 , 否则, 将所述索引为 2的编码模式 的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值不等于所述索引为 0的编码模式的值和所述 索引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0。
在第二种可能的实现方式中, 所述处理单元具体用于若所述候选模式列 表中存在所述当前编码模式 , 则将所述模式值设置为所述候选模式列表中的 所述当前编码模式对应的索引;
所述编码单元还用于将第一标识写入所述码流的头部。
在第三种可能的实现方式中, 所述处理单元包括:
第二排序子单元, 与所述第一修正单元相连, 用于若所述候选模式列表 中不存在所述当前编码模式, 则按照出现概率由高到低将所述候选模式列表 中各编码模式进行排序;
第二处理子单元, 与所述第二排序子单元相连, 用于若所述当前编码模 式的值大于出现概率为第三的编码模式的值, 则将所述当前编码模式的值减 1生成第一中间值, 否则, 将所述当前编码模式的值作为所述第一中间值; 若所述第一中间值大于出现概率为第二的编码模式的值, 则将所述第一 中间值减 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值大于出现概率为第一的编码模式的值, 则将所述第二 中间值减 1生成第三中间值, 否则, 将所述第二中间值作为所述第三中间值; 将所述模式值设置为所述第三中间值;
所述编码单元还用于将第二标识写入所述码流的头部。
在第四种可能的实现方式中, 所述编码单元具体用于根据所述当前编码 模式确定所述当前块的预测像素, 获取所述当前块的实际像素, 根据所述实 际像素和所述预测像素生成当前残差, 根据所述当前残差生成所述码流。
第八方面, 本发明实施例提供一种分层解码装置, 包括:
初始化单元, 用于生成初始模式列表, 其中, 所述初始模式列表包括底 层中与增强层的当前块对应的底层块的底层编码模式、 所述增强层中与所述 当前块的左相邻块的第一编码模式和所述增强层中与所述当前块的上相邻块 的第二编码模式;
修正单元, 与所述初始化单元相连, 用于对所述初始模式列表进行修正, 生成候选模式列表;
处理单元, 与所述修正单元相连, 用于根据码流中的模式值和所述候选 模式列表生成当前块的当前编码模式;
解码单元, 与所述修正单元相连, 用于根据所述当前编码模式对所述当 前块进行解码。
在第一种可能的实现方式中, 所述修正单元包括:
第一排序子单元, 与所述初始化单元相连, 用于按照出现概率由高到低 所述底层编码模式、 所述第一编码模式和所述第二编码模式进行排序, 设置 出现概率为第一的编码模式的索引为 0, 出现概率为第二的编码模式的索引 为 1 , 出现概率为第三的编码模式的索引为 2;
第二处理子单元, 与所述第一排序子单元相连, 用于若索引为 0的编码 模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编 码模式的值设置为 0, 将所述索引为 1的编码模式的值设置为 1 , 若索引为 2 的编码模式的值与所述索引为 0的编码模式的值相等, 则将所述索引为 2的 编码模式的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 根据以下公式分别设置所述索引为 1 的编码模式的值和所述索引 为 2的编码模式的值:
candModeList[l] = 2 + ((candModeList[0] + 29) % 32);
candModeList[2] = 2 + ((candModeList[0] · · 2 + 1) % 32);
其中, candModeList[0] 为所述索引为 0 的编码模式, candModeList[l] 为所述索引为 1的编码模式, candModeList[2]为所述索引为 2的编码模式; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值等于所述索引为 0的编码模式的值或所述索 引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1 的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0, 若所 述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 1 , 则将 所述索引为 2的编码模式的值设置为 1 , 否则, 将所述索引为 2的编码模式 的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值不等于所述索引为 0的编码模式的值和所述 索引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0。
在第二种可能的实现方式中, 所述处理单元具体用于若根据所述码流中 的第一标识识别到所述候选模式列表中存在所述当前编码模式, 则将所述当 前编码模式设置为所述候选模式列表以所述模式值为索引的编码模式。
在第三种可能的实现方式中, 所述处理单元包括:
第二排序子单元, 与所述修正单元相连, 用于若根据所述码流中的第二 标识识别到所述候选模式列表中不存在所述当前编码模式, 则按照出现概率 由高到低将所述候选模式列表中各编码模式进行排序;
第二处理子单元, 与所述第二排序子单元相连, 用于若所述模式值小于 出现概率为第一的编码模式的值, 则将所述模式值增 1生成第一中间值, 否 贝' J , 将所述模式值作为所述第一中间值;
若所述第一中间值小于出现概率为第二的编码模式的值, 则将所述第一 中间增 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值小于出现概率为第三的编码模式的值, 则将所述第二 中间值增 1生成第三中间值, 否则将所述第二中间值作为所述第三中间值; 将所述当前编码模式的值设置为所述第三中间值。
在第四种可能的实现方式中, 所述解码单元具体用于根据所述当前编码 模式确定所述当前块的预测像素, 根据所述码流生成当前残差, 根据所述预 测像素和所述当前残差进行所述当前块的重建。
由上述技术方案可知, 本发明实施例提供的分层编解码方法及装置, 分 层编码装置获取底层中、 与增强层的当前块对应的底层块的底层编码模式, 若当前块的当前编码模式与底层编码模式相同, 则根据当前编码模式对当前 块进行编码生成码流, 在码流中设置用以指示帧内编码使用层间信息的指示 标识。 在对当前块的编码过程中考虑了对应的底层块的编码模式, 充分利用 了层间相关性, 大大提高了编解码性能。 且在当前块的编码模式与底层块的 编码模式相同时, 通过层间信息使用标识的设置, 只需编码一个标志位, 从 而有效地减少了对帧内编码模式编码所需要的比特数, 节省了码流对存储介 质和传输带宽的要求, 成功避免了编解码过程中构建候选模式列表以及其后 建立在候选模式列表上的操作 , 有效降低了编解码过程中的内存和能量等资 源消耗。 本发明实施例提供的分层编解码方法及装置, 分层编码装置生成初 始模式列表, 对初始模式列表进行修正, 生成候选模式列表, 根据当前块的 当前编码模式和候选模式列表生成模式值, 根据当前编码模式对当前块进行 编码生成码流, 将模式值对应的码字写入码流中。 在对当前块的编码过程中 考虑到了对应的底层块的编码模式, 充分利用了层间相关性, 大大提高了编 解码性能。 且在生成初始模式列表时, 将对应的底层块的编码模式作为可能 性较大的编码模式, 基于此生成的候选模式列表用于对当前块的编码参考, 进一步提高了编解码性能。 附图说明 为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下 面描述中的附图是本发明的一些实施例, 对于本领域普通技术人员来讲, 在 不付出创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明实施例提供的第一种分层编码方法流程图;
图 2为本发明实施例提供的亮度信号的帧内预测模式和方向示意图; 图 3为本发明实施例提供的第二种分层编码方法流程图;
图 4为本发明实施例提供的第一种分层解码方法流程图;
图 5为本发明实施例提供的第二种分层解码方法流程图;
图 6为本发明实施例提供的第三种分层编码方法流程图;
图 7为本发明实施例提供的第三种分层解码方法流程图;
图 8为本发明实施例提供的第一种分层编码装置结构示意图;
图 9为本发明实施例提供的第二种分层编码装置结构示意图;
图 10为本发明实施例提供的第一种分层解码装置结构示意图;
图 11为本发明实施例提供的第二种分层解码装置结构示意图;
图 12为本发明实施例提供的第三种分层编码装置结构示意图;
图 13为本发明实施例提供的第四种分层编码装置结构示意图;
图 14为本发明实施例提供的第三种分层解码装置结构示意图;
图 15为本发明实施例提供的第四种分层解码装置结构示意图。 具体实施方式 为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本发 明实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于 本发明中的实施例, 本领域普通技术人员在没有作出创造性劳动前提下所获 得的所有其他实施例, 都属于本发明保护的范围。
图 1为本发明实施例提供的第一种分层编码方法流程图。 如图 1所示, 程可以基于但并不限于 HEVC-SVC技术。本实施例提供的分层编码方法可以 通过分层编码装置来执行, 该分层编码装置可以集成在例如电视机、机顶盒、 个人计算机、 笔记本电脑、 平板电脑或手机等设备的视频处理器中, 也可以 单独设置, 该分层编码装置可以通过软件和 /或硬件的方式来实现。
本实施例提供的分层编码方法具体包括:
步骤 A10、 获取底层中、 与增强层的当前块对应的底层块的底层编码模 式;
步骤 A20、 若所述当前块的当前编码模式与所述底层编码模式相同, 则 根据所述当前编码模式对所述当前块进行编码生成码流, 在所述码流的头部 设置用以指示帧内编码使用层间信息的指示标识。
具体地, 视频数据被分为底层和可提高分辨率、 帧速率和质量的其它可 选的增强层组成的多层视频流。 对视频数据进行编码需要对底层和增强层分 别进行编码, 对底层进行帧内编码时, 可以采用底层的帧内预测模式来实现, 在该实现过程中, 底层的当前块的编码模式会参考底层中与该当前块空间相 邻的编码块的编码模式。 在 HEVC的帧内编码过程中, 对亮度信号的预测存 在 35种模式, 亮度信号的帧内预测模式如表 1所示。
表 1
Figure imgf000020_0001
其中, 模式 2-34 为角度预测。 图 2为本发明实施例提供的亮度信号的 帧内预测模式和方向示意图, 如图 2所示图形可以反映表 1中预测模式 2-34 的方向。
对底层进行编码后, 再对增强层进行编码。 在对该增强层的编码过程中, 可以将增强层划分为多个不重叠的编码块, 即最大编码单元。 最大编码单元 的大小可以为 64 64, 最大编码单元可以自适应地进一步对称或不对称地划 分为多个编码块, 划分后的编码块的大小例如为 32 x 32、 16 x 16或 8 x 8等。 对增强层的编码过程即为对增强层中所有最大编码单元的编码过程。 在该实 现过程中, 增强层的当前块的编码模式不仅会参考增强层中与该当前块空间 相邻的编码单元的编码模式, 如与该当前块空间相邻的编码单元例如与该当 前块左边相邻的编码单元和与该当前块上边相邻的编码单元, 还会考虑底层 中与该当前块对应的底层块的编码模式。
假设增强层中的当前块相对于帧左上角的位置是 (x, y), 其大小为 N, 底 层和增强层的上抽样比例为 1 : 2, 则底层中相对于帧左上角的位置是 (x/2, y/2) , 大小为 N/2的块与该当前块相对应。 在对底层的编码过程中, 该对应块 可能被分为多个子块分别进行编码, 则在对增强层的当前块的编码过程中可 以参考对应块中所有子块的编码模式, 也可以参考其中一个或几个子块的编 码模式。 通过层间信息的充分利用, 可以提高编解码性能。 确定当前块的编码模式, 当前块的编码模式即为当前编码模式, 底层中 与当前块对应的底层块的编码模式为底层编码模式, 若当前编码模式与底层 编码模式相同, 则才艮据当前编码模式对当前块进行编码生成码流, 并在码流 中设置用以指示帧内编码使用层间信息的指示标识。 该指示标识具体用以指 示对该当前块的编码采用了与底层块相同的编码模式进行编码。 例如该层间 信息使用标识为 use— inter_pred— direct— flag, 其值可以设置为 1 , 占用一个比 特位。
当解码侧接收到该码流时, 可以根据码流中用以指示帧内编码使用层间 信息的指示标识识别到编码侧对该当前块采用的编码模式与对应的底层块的 编码模式相同, 则可以获取底层块的编码模式, 并通过该编码模式对码流进 行解码, 以实现重建。
本实施例提供的分层编码方法, 分层编码装置获取底层中、 与增强层的 当前块对应的底层块的底层编码模式, 若当前块的当前编码模式与底层编码 模式相同, 则根据当前编码模式对当前块进行编码生成码流, 在码流中设置 用以指示帧内编码使用层间信息的指示标识。 在对当前块的编码过程中考虑 了对应的底层块的编码模式, 充分利用了层间相关性, 大大提高了编解码性 能。 且在当前块的编码模式与底层块的编码模式相同时, 通过层间信息使用 标识的设置, 只需编码一个标志位, 从而有效地减少了对帧内编码模式编码 所需要的比特数, 成功避免了编解码过程中构建候选模式列表以及其后建立 在候选模式列表上的操作 , 有效降低了编解码过程中的内存和能量等资源消 耗。
在本实施例中, 步骤 A20中, 所述根据所述当前编码模式对所述当前块 进行编码生成码流, 具体可以为:
根据所述当前编码模式确定所述当前块的预测像素, 获取所述当前块的 实际像素, 根据所述实际像素和所述预测像素生成当前残差, 根据所述当前 残差生成所述码流。
具体地, 根据当前编码模式可以确定所述当前块的预测像素, 例如, 当 前编码模式为竖直预测编码模式, 则可以将与当前块上边相邻块的像素作为 该当前块的预测像素。 计算当前块的实际像素与该预测像素之间的残差作为 当前残差, 对该残差进行编码生成码流。 相应地, 在解码侧, 对码流进行解码得到该当前残差, 若根据码流中的 层间信息使用标识识别到编码侧对该当前块采用的编码模式与对应的底层块 的编码模式相同, 则可以获取底层块的编码模式, 根据底层块的编码模式确 定预测像素, 将预测像素与该当前残差相加即可实现对当前块的重建。
图 3为本发明实施例提供的第二种分层编码方法流程图。 如图 3所示, 在本实施例中, 步骤 A10, 所述获取底层中、 与增强层的当前块对应的底层 块的底层编码模式之后, 所述方法还包括:
步骤 A30、 若所述当前块的当前编码模式与所述底层编码模式不同, 则 生成候选模式列表;
具体地, 为了充分利用候选模式列表, 候选模式列表中的编码模式不重 复, 且该候选模式列表中包括可能性较大的编码模式。
步骤 A40、 根据所述当前编码模式和所述候选模式列表生成模式值; 具体地, 可以根据当前编码模式和候选模式列表的关系生成该模式值, 在一种实现方式中, 若候选模式列表中存在该当前编码模式, 则可以根据候 选模式列表中该当前编码模式的索引生成该模式值。 在另一种实现方式中, 若候选模式列表中不存在该当前编码模式, 则可以根据候选模式列表生成该 模式值。
步骤 A50、 根据所述当前编码模式对所述当前块进行编码生成码流, 将 所述模式值对应的码字写入所述码流中, 在所述码流的头部设置用以指示帧 内编码未使用层间信息的指示标识。
具体地, 不同的模式值对应不同的码字, 可以将模式值进行编码生成该 码字。 在码流的头部设置该指示标识, 以使的在解码侧可以首先解码到该指 示标识, 并根据该指示标识判断在帧内编码时是否使用的层间信息。
在本实施例中, 步骤 A30中, 所述生成候选模式列表, 具体可以包括如 下步骤:
设置所述增强层中与所述当前块的左相邻块的第一编码模式的索引为 0 , 设置所述增强层中与所述当前块的上相邻块的第二编码模式的索引为 1; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 ; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 则若所述底层编码模式的值大于所述第一编码模式的值, 根据以 下公式设置所述索引为 1的编码模式的值: candModeList[l] = 2 +
((candModeList[0] + 29) % 32), 否则,根据以下公式设置所述索引为 1的编码 模式的值: candModeList[l] = 2 + ((candModeList[0] - 2 + 1) % 32); 其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l]为所述索引为 1的编码模式;
设置所述底层编码模式的索引为 2。
具体地, 通过以下方式建立该候选模式列表:
candModeList[0] = candlntraPredModeL
candModeList[l] = candlntraPredModeA
若 candModeList[0] 和 candModeList[l] 相等
若 candModeList[0] 小于 2, 则
candModeList[0] = Intra— Planar
candModeList[ 1 ] = Intra— DC
若 candModeList[0] 大于或等于 2, 贝' J
candModeList[0] = candlntraPredModeL
若 candlntraPredModeB 大于 candlntraPredModeL , 贝1 J
candModeList[l] = 2 + ((candlntraPredModeL + 29) % 32) 否则, candModeList[ 1] = 2 + ((candlntraPredModeL— 2 + 1 ) % 32) candModeList[2] = candlntraPredModeB
通过上述方法生成的候选模式列表的包括三个可能性较大的编码模式。 上述处理过程中各编码模式所对应的值可参考如表 1所示的对应关系, 即编码模式的值为 0对应平面模式( Intra— Planar ) , 编码模式的值为 1对应 直流模式(Intra— DC ) , 编码模式的值为 26对应垂直模式( Intra— Vertical ) 。 可以理解的是, 本实施例基于预先设定的数值与编码模式的对应关系, 本领 域技术人员根据实际设置进行调整的技术方案,均在本发明的保护范围之内。
在本实施例中, 步骤 A40, 所述根据当前块的当前编码模式和所述候选 模式列表生成模式值, 具体可以为:
若所述候选模式列表中存在所述当前编码模式, 则将所述模式值设置为 所述候选模式列表中的所述当前编码模式对应的索引;
所述根据所述当前编码模式对所述当前块进行编码生成码流之后, 所述 方法还包括:
将第一标识写入所述码流的头部。
具体地, 若候选模式列表中存在当前编码模式, 例如当前编码模式为 candlntraPredModeL , 且在候选模式列表 candlntraPredModeL的索引为 1 , 则 将模式值设置为 1 , 以节省资源占用, 将该模式值写入码流中, 并在码流的 头部写入第一标识,该第一标识用以指示候选模式列表中存在当前编码模式, 例如可以将 pre V— intra— luma_pred— flag设置为 1以表示该第一标识。
还需要说明的是, 优选的, 将第一标识写入所述码流的头部的具体实现 方式为: 将第一标识写入所述码流的头部的该帧内编码层间信息未使用标识 之后的位置; 或者, 将第一标识写入所述码流的头部的该帧内编码层间信息 未使用标识之前的位置。
在本实施例中, 步骤 A40, 所述根据当前块的当前编码模式和所述候选 模式列表生成模式值, 具体可以包括如下步骤:
若所述候选模式列表中不存在所述当前编码模式, 则按照出现概率由高 到低将所述候选模式列表中各编码模式进行排序;
若所述当前编码模式的值大于出现概率为第三的编码模式的值 , 则将所 述当前编码模式的值减 1生成第一中间值, 否则, 将所述当前编码模式的值 作为所述第一中间值;
若所述第一中间值大于出现概率为第二的编码模式的值 , 则将所述第一 中间值减 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值大于出现概率为第一的编码模式的值 , 则将所述第二 中间值减 1生成第三中间值, 否则, 将所述第二中间值作为所述第三中间值; 将所述模式值设置为所述第三中间值;
所述根据所述当前编码模式对所述当前块进行编码生成码流之后, 所述 方法还包括:
将第二标识写入所述码流的头部。
具体地, 若候选模式列表中不存在该当前编码模式, 则按照出现概率由 高到低将所述候选模式列表中各编码模式进行排序, 排序过程具体可以为: 若 candModeList ] 大于 candModeList[l] , 贝' J
(candModeList[0],candModeList[l])=swap(candModeList[0],candModeList[
1] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[0],candModeList[2])=swap(candModeList[0],candModeList[ 2] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[l ] ,candModeList[2])=swap(candModeList[ l],candModeList[
2] )
通过函数交换函数 swap(x, y)可以实现排序, 当然排序过程也可以通过其 他方式实现, 不以本实施例为限。
rem— intra— luma_pred— mode的值设置为当前编码模式的值;
先 ^夺 rem— intra— luma_pred— mode与 candModeList[2]比较:
若 rem— intra— luma_pred— mode大于 candModeList[2] , 贝1 J
rem— intra— luma_pred— mode减 1 ,否贝1 J ,保持 rem— intra— luma_pred— mode不更; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[l]比较:
若 rem— intra— luma_pred— mode 大于 candModeList[ 1 ] , 贝1 J
rem— intra— luma_pred— mode减 1 , 否贝1 J保持 rem— intra— luma_pred— mode不更。
再 ^夺 rem— intra— luma_pred— mode与 candModeList[0]比较:
若 rem— intra— luma_pred— mode 不大于 candModeList[0] , 贝1 J
rem— intra— luma_pred— mode减 1 ,否贝1 J ,保持 rem— intra— luma_pred— mode不更。, 将模式值设置为 rem— intra— luma_pred— mode。
第二标识用以指示候选模式列表中不存在当前编码模式, 例如可以将 prev— intra— luma_pred— flag设置为 0以表示该第二标识。 还需要说明的是, 优 选的, 将第二标识写入所述码流的头部的具体实现方式为: 将第二标识写入 所述码流的头部的该帧内编码层间信息未使用标识之后的位置; 或者, 将第 二标识写入所述码流的头部的该帧内编码层间信息未使用标识之前的位置。
步骤 A50中的根据所述当前编码模式对所述当前块进行编码生成码流的 过程具体参照上述步骤 A20中根据当前编码模式对当前块进行编码生成码流 的具体实现方式, 在此不再贅述。 图 4为本发明实施例提供的第一种分层解码方法流程图。 如图 4所示, 本实施例提供的分层解码方法具体可以应用于对视频的解码过程, 该解码过 程可以基于但并不限于 HEVC-SVC技术。本实施例提供的分层解码方法可以 与图 1所示实施例提供的分层编码方法配合实现, 其具体实现过程, 在此不 再贅述。 本实施例提供的分层解码方法可以通过分层解码装置来执行, 该分 层解码装置可以集成在例如电视机、 机顶盒、 个人计算机、 笔记本电脑、 平 板电脑或手机等设备的视频处理器中, 也可以单独设置, 该分层解码装置可 以通过软件和 /或硬件的方式来实现。
本实施例提供的分层解码方法具体包括:
步骤 B10、 获取码流中的指示标识;
步骤 B20、 若所述指示标识用以指示帧内编码使用层间信息, 则获取底 层中与增强层的当前块对应的底层块的底层编码模式;
步骤 B30、 根据所述底层编码模式对所述当前块进行解码。
本实施例提供的分层解码方法, 分层解码装置获取码流中的指示标识, 若指示标识用以指示帧内编码使用层间信息使用标识, 则获取底层中与增强 层的当前块对应的底层块的底层编码模式, 才艮据底层编码模式对当前块进行 解码。 在对当前块的编码过程中考虑了对应的底层块的编码模式, 充分利用 了层间相关性, 大大提高了编解码性能。 且在当前块的编码模式与底层块的 编码模式相同时, 通过层间信息使用标识的设置, 只需编码一个标志位, 从 而有效地减少了对帧内编码模式编码所需要的比特数, 成功避免了编解码过 程中构建候选模式列表以及其后建立在候选模式列表上的操作, 有效降低了 编解码过程中的内存和能量等资源消耗。
在本实施例中, 步骤 B20, 所述根据所述底层编码模式对所述当前块进 行解码, 具体可以为:
根据所述底层编码模式确定所述当前块的预测像素, 根据所述码流生成 当前残差, 根据所述预测像素和所述当前残差进行所述当前块的重建。
图 5为本发明实施例提供的第二种分层解码方法流程图。 如图 5所示, 步骤 B10, 所述获取码流中的指示标识之后, 所述方法还包括:
B40、若所述指示标识用以指示帧内编码未使用层间信息,则生成候选模 式列表; B50、根据所述码流中的模式值和所述候选模式列表生成当前块的当前编 码模式;
B60、 根据所述当前编码模式对所述当前块进行解码。
在本实施例中, 步骤 B40, 所述生成候选模式列表, 具体可以包括如下 步骤:
设置所述增强层中与所述当前块的左相邻块的第一编码模式的索引为 0 , 设置所述增强层中与所述当前块的上相邻块的第二编码模式的索引为 1; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 ;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 则若所述底层编码模式的值大于所述第一编码模式的值, 根据以 下公式设置所述索引为 1的编码模式的值: candModeList[l] = 2 +
((candModeList[0] + 29) % 32), 否则,根据以下公式设置所述索引为 1的编码 模式的值: candModeList[l] = 2 + ((candModeList[0] - 2 + 1) % 32); 其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l]为所述索引为 1的编码模式;
设置所述底层编码模式的索引为 2。
在本实施例中, B50,所述根据码流中的模式值和所述候选模式列表生成 当前块的当前编码模式, 具体可以包括如下步骤:
若根据所述码流中的第一标识识别到所述候选模式列表中存在所述当前 编码模式, 则将所述当前编码模式设置为所述候选模式列表以所述模式值为 索引的编码模式。
具体地, 若码流中存在第一标识, 则说明候选模式列表中存在当前编码 模式, 码流中的模式值即为该当前编码模式在候选模式列表中的索引, 则根 据模式值可以确定当前编码模式。
在本实施例中, 步骤 B50, 所述根据码流中的模式值和所述候选模式列 表生成当前块的当前编码模式, 具体可以包括如下步骤:
若根据所述码流中的第二标识识别到所述候选模式列表中不存在所述当 前编码模式, 则按照出现概率由高到低将所述候选模式列表中各编码模式进 行排序;
若所述模式值小于出现概率为第一的编码模式的值 , 则将所述模式值增
1生成第一中间值, 否则, 将所述模式值作为所述第一中间值;
若所述第一中间值小于出现概率为第二的编码模式的值 , 则将所述第一 中间增 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值小于出现概率为第三的编码模式的值 , 则将所述第二 中间值增 1生成第三中间值, 否则将所述第二中间值作为所述第三中间值; 将所述当前编码模式的值设置为所述第三中间值。
具体地, 若码流中存在第二标识, 则说明候选模式列表中不存在当前编 码模式, 则需要根据候选模式列表和模式值计算出当前编码模式。
按照出现概率由高到低将所述候选模式列表中各编码模式进行排序 , 排 序过程具体可以为:
若 candModeList ] 大于 candModeList[l] , 贝' J
(candModeList[0],candModeList[l])=swap(candModeList[0],candModeList[ 1] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[0],candModeList[2])=swap(candModeList[0],candModeList[
2] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[l ] ,candModeList[2])=swap(candModeList[ l],candModeList[
2] )
通过函数 swap(x, y)可以实现排序, 当然排序过程也可以通过其他方式实 现, 不以本实施例为限。
将 rem— intra— luma_pred— mode的值设置为模式值;
先 ^夺 rem— intra— luma_pred— mode与 candModeList[0]比较:
若 rem— intra— luma_pred— mode小于 candModeList[0] , 贝1 J
rem— intra— luma_pred— mode增 1 , 否贝1 J保持 rem— intra— luma_pred— mode不更 ; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[l]比较:
若 rem— intra— luma_pred— mode小于 candModeList[ 1 ] , 贝1 J
rem— intra— luma_pred— mode增 1 , 否贝1 J ,保持 rem— intra— luma_pred— mode不更; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[2]比较:
若 rem— intra— luma_pred— mode小于 candModeList[2] , 贝1 J
rem— intra— luma_pred— mode增 1 ,否贝1 J ,保持 rem— intra— luma_pred— mode不更 , 当前编码模式的值设为 rem— intra— luma_pred— mode。
步骤 B60中的根据当前编码模式对当前块进行解码的过程具体参照上述 步骤 B30中根据底层编码模式对当前块进行解码的具体实现方式, 在此不再 图 6为本发明实施例提供的第三种分层编码方法流程图。 如图 6所示,
Figure imgf000029_0001
该编码过 程可以基于但并不限于 HEVC-SVC技术。本实施例提供的分层编码方法可以 通过分层编码装置来执行, 该分层编码装置可以集成在例如电视机、机顶盒、 个人计算机、 笔记本电脑、 平板电脑或手机等设备的视频处理器中, 也可以 单独设置, 该分层编码装置可以通过软件和 /或硬件的方式来实现。
本实施例提供的分层编码方法具体包括:
步骤 A100、 生成初始模式列表, 其中, 所述初始模式列表包括底层中与 增强层的当前块对应的底层块的底层编码模式、 所述增强层中与所述当前块 的左相邻块的第一编码模式和所述增强层中与所述当前块的上相邻块的第二 编码模式;
具体地, 增强层的当前块的编码模式可以同时参考增强层中与该当前块 相邻块的编码模式和底层中对应的底层块的编码模式。 则可以首先生成初始 模式列表, 初始模式列表长度为 3时, 初始模式列表中具体可以包括以下内 容:
candModeList[0] = candlntraPredModeB
candModeList[l] = candlntraPredModeL
candModeList[2] = candlntraPredModeA
其中, candModeList[0]为索引为 0的编码模式, candlntraPredModeB为 底层编码模式的值, candModeList[l] 为索引为 1的编码模式,
candlntraPredModeL为第一编码模式的值, 即当前编码块左边参考块的预测 模式, candModeList[2] 为索引为 2的编码模式, candlntraPredModeA为第二 编码模式的值, 即当前编码块上面参考块的预测模式。 步骤 A200、 对所述初始模式列表进行修正, 生成候选模式列表; 具体地, 为了充分利用候选模式列表, 候选模式列表中的编码模式不重 复, 且该候选模式列表中包括可能性较大的编码模式。
步骤 A300、 根据当前块的当前编码模式和所述候选模式列表生成模式 值;
具体地, 当前块的编码模式即为当前编码模式, 可以根据当前编码模式 和候选模式列表的关系生成该模式值, 在一种实现方式中, 若候选模式列表 中存在该当前编码模式, 则可以根据候选模式列表中该当前编码模式的索引 生成该模式值。 在另一种实现方式中, 若候选模式列表中不存在该当前编码 模式, 则可以根据候选模式列表生成该模式值。
步骤 A400、 根据所述当前编码模式对所述当前块进行编码生成码流, 将 所述模式值对应的码字写入所述码流中。
具体地, 不同的模式值对应不同的码字, 可以将模式值进行编码生成该 码字。
本实施例提供的分层编码方法, 分层编码装置生成初始模式列表, 对初 始模式列表进行修正, 生成候选模式列表, 根据当前块的当前编码模式和候 选模式列表生成模式值, 根据当前编码模式对当前块进行编码生成码流, 将 模式值对应的码字写入码流中。 在对当前块的编码过程中考虑到了对应的底 层块的编码模式, 充分利用了层间相关性, 大大提高了编解码性能。 且在生 成初始模式列表时,将对应的底层块的编码模式作为可能性较大的编码模式, 基于此生成的候选模式列表用于对当前块的编码参考, 进一步提高了编解码 性能。
在本实施例中, 步骤 A200, 所述对所述初始模式列表进行修正, 生成候 选模式列表, 具体可以包括如下步骤:
按照出现概率由高到低所述底层编码模式、 所述第一编码模式和所述第 二编码模式进行排序, 设置出现概率为第一的编码模式的索引为 0 , 出现概 率为第二的编码模式的索引为 1 , 出现概率为第三的编码模式的索引为 2; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 , 若索引为 2的编码模式的值与所述索引为 0的编码模式的值相 等, 则将所述索引为 2的编码模式的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 根据以下公式分别设置所述索引为 1的编码模式的值和所述索引 为 2的编码模式的值:
candModeList[l] = 2 + ((candModeList[0] + 29) % 32);
candModeList[2] = 2 + ((candModeList[0] - 2 + 1) % 32);
其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l] 为所述索引为 1的编码模式, candModeList[2]为所述索引为 2的编码模式; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值等于所述索引为 0的编码模式的值或所述索 引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1 的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0, 若所 述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 1 , 则将 所述索引为 2的编码模式的值设置为 1 , 否则, 将所述索引为 2的编码模式 的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值不等于所述索引为 0的编码模式的值和所述 索引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0。
具体地, 编码模式的值越大, 则出现概率越小, 各编码模式的出现概率 为预先统计的。 例如按照出现概率由高到底排列好的编码模式顺序如下: candModeList[0] = candlntraPredModeB
candModeList[l] = candlntraPredModeL
candModeList[2] = candlntraPredModeA
通过如下描述对上述排序后的列表进行修正:
若 candModeList[0] 和 candModeList[l] 相等
若 candModeList[0] 小于 2, 则
candModeList[0] = Intra— Planar
candModeList[l] = Intra— DC
若 candModeList[2] 等于 candModeList[0] 或 candModeList[l] , 则 candModeList[2] = Intra— Vertical
若 candModeList[0] 大于或等于 2, 贝' J
candModeList[l] = 2 + ((candlntraPredModeB + 29) % 32) candModeList[2] = 2 + ((candlntraPredModeB - 2 + 1) % 32) 若 candModeList[0] 和 candModeList[l]不相等
若 candModeList[2] 等于 candModeList[0] 或 candModeList[l] 若 candModeList[0] 不为 0并且 candModeList[l] 不为 0, 贝' J candModeList[2] = 0
若 candModeList[0] 不为 1并且 candModeList[l] 不为 1 , 贝' J candModeList[2] = 1
否贝1 J , candModeList[2] = Intra— Vertical
若 candModeList[0] 不为 0并且 candModeList[l] 不为 0, 贝' J candModeList[2] = 0
上述处理过程中各编码模式所对应的值可参考如表 1所示的对应关系, 即编码模式的值为 0对应平面模式(Intra— Planar ) , 编码模式的值为 1对应 直流模式(Intra— DC ) , 编码模式的值为 26对应垂直模式( Intra— Vertical )。 可以理解的是, 本实施例基于预先设定的数值与编码模式的对应关系, 本领 域技术人员根据实际设置进行调整的技术方案,均在本发明的保护范围之内。
在本实施例中, 步骤 A300, 所述根据当前块的当前编码模式和所述候选 模式列表生成模式值, 具体可以为:
若所述候选模式列表中存在所述当前编码模式, 则将所述模式值设置为 所述候选模式列表中的所述当前编码模式对应的索引;
步骤 A400中, 所述根据所述当前编码模式对所述当前块进行编码生成 码流之后, 所述方法还可以包括:
将第一标识写入所述码流的头部。
具体地, 若候选模式列表中存在当前编码模式, 例如当前编码模式为 candlntraPredModeB , 且在候选模式列表 candlntraPredModeB的索引为 1 , 则 将模式值设置为 1 , 以节省资源占用, 将该模式值写入码流中, 并在码流的 头部写入第一标识,该第一标识用以指示候选模式列表中存在当前编码模式, 例如可以将 prev— intra— luma_pred— flag设置为 1以表示该第一标识。 在本实施例中, 所述根据当前块的当前编码模式和所述候选模式列表生 成模式值, 具体可以包括:
若所述候选模式列表中不存在所述当前编码模式, 则按照出现概率由高 到低将所述候选模式列表中各编码模式进行排序;
若所述当前编码模式的值大于出现概率为第三的编码模式的值, 则将所 述当前编码模式的值减 1生成第一中间值, 否则, 将所述当前编码模式的值 作为所述第一中间值;
若所述第一中间值大于出现概率为第二的编码模式的值 , 则将所述第一 中间值减 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值大于出现概率为第一的编码模式的值, 则将所述第二 中间值减 1生成第三中间值, 否则, 将所述第二中间值作为所述第三中间值; 将所述模式值设置为所述第三中间值;
步骤 A400中、 所述根据所述当前编码模式对所述当前块进行编码生成 码流之后, 所述方法还可以包括:
将第二标识写入所述码流的头部。
具体地, 若候选模式列表中不存在该当前编码模式, 则按照出现概率由 高到低将所述候选模式列表中各编码模式进行排序, 排序过程具体可以为: 若 candModeList ] 大于 candModeList[l] , 贝' J
(candModeList[0],candModeList[l])=swap(candModeList[0],candModeList[ 1] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[0],candModeList[2])=swap(candModeList[0],candModeList[
2] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[l ] ,candModeList[2])=swap(candModeList[ l],candModeList[
2] )
通过函数 swap(x, y)可以实现排序, 当然排序过程也可以通过其他方式实 现, 不以本实施例为限。
rem— intra— luma_pred— mode的值设置为当前编码模式的值;
先 ^夺 rem— intra— luma_pred— mode与 candModeList[2]比较: 若 rem— intra— luma_pred— mode大于 candModeList[2] , 贝1 J
rem— intra— luma_pred— mode减 1 ,否贝1 J ,保持 rem— intra— luma_pred— mode不更; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[l]比较:
若 rem— intra— luma_pred— mode 大于 candModeList[ 1 ] , 贝1 J
rem— intra— luma_pred— mode减 1 , 否贝1 J保持 rem— intra— luma_pred— mode不更; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[0]比较:
若 rem— intra— luma_pred— mode 不大于 candModeList[0] , 贝1 J
rem— intra— luma_pred— mode减 1 ,否贝1 J ,保持 rem— intra— luma_pred— mode不更 , 将模式值设置为 rem— intra— luma_pred— mode。
第二标识用以指示候选模式列表中不存在当前编码模式, 例如可以将 prev— intra— luma_pred— flag设置为 0以表示该第二标识。
在本实施例中, 步骤 A400中, 所述根据所述当前编码模式对所述当前 块进行编码生成码流, 具体可以为:
根据所述当前编码模式确定所述当前块的预测像素, 获取所述当前块的 实际像素, 根据所述实际像素和所述预测像素生成当前残差, 根据所述当前 残差生成所述码流。
根据当前编码模式对当前块进行编码生成码流的具体实现方式和技术效 果可以参照上述分层编码方法中的描述, 在此不再贅述。
图 7为本发明实施例提供的第三种分层解码方法流程图。 如图 7所示, 本实施例提供的分层解码方法具体可以应用于对视频的解码过程, 该解码过 程可以基于但并不限于 HEVC-SVC技术。本实施例提供的分层解码方法可以 与图 6所示实施例提供的分层编码方法配合实现, 其具体实现过程, 在此不 再贅述。 本实施例提供的分层解码方法可以通过分层解码装置来执行, 该分 层解码装置可以集成在例如电视机、 机顶盒、 个人计算机、 笔记本电脑、 平 板电脑或手机等设备的视频处理器中, 也可以单独设置, 该分层解码装置可 以通过软件和 /或硬件的方式来实现。
本实施例提供的分层解码方法具体包括:
步骤 B100、 生成初始模式列表, 其中, 所述初始模式列表包括底层中与 增强层的当前块对应的底层块的底层编码模式、 所述增强层中与所述当前块 的左相邻块的第一编码模式和所述增强层中与所述当前块的上相邻块的第二 编码模式;
步骤 B200、 对所述初始模式列表进行修正, 生成候选模式列表; 步骤 B300、根据码流中的模式值和所述候选模式列表生成当前块的当前 编码模式;
步骤 B400、 根据所述当前编码模式对所述当前块进行解码。
本实施例提供的分层解码方法, 分层解码装置生成初始模式列表, 对初 始模式列表进行修正, 生成候选模式列表, 根据码流中的模式值和候选模式 列表生成当前块的当前编码模式, 根据当前编码模式对当前块进行解码。 在 对当前块的编码过程中考虑了对应的底层块的编码模式, 充分利用了层间相 关性, 大大提高了编解码性能。 且在生成初始模式列表时, 将对应的底层块 的编码模式作为可能性较大的编码模式, 基于此生成的候选模式列表用于对 当前块的解码参考, 进一步提高了编解码性能。
在本实施例中, 步骤 B200, 所述对所述初始模式列表进行修正, 生成候 选模式列表, 具体可以包括如下步骤:
按照出现概率由高到低所述底层编码模式、 所述第一编码模式和所述第 二编码模式进行排序, 设置出现概率为第一的编码模式的索引为 0 , 出现概 率为第二的编码模式的索引为 1 , 出现概率为第三的编码模式的索引为 2; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 , 若索引为 2的编码模式的值与所述索引为 0的编码模式的值相 等, 则将所述索引为 2的编码模式的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 根据以下公式分别设置所述索引为 1的编码模式的值和所述索引 为 2的编码模式的值:
candModeList[l] = 2 + ((candModeList[0] + 29) % 32);
candModeList[2] = 2 + ((candModeList[0] - 2 + 1) % 32);
其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l] 为所述索引为 1的编码模式, candModeList[2]为所述索引为 2的编码模式; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值等于所述索引为 0的编码模式的值或所述索 引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1 的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0, 若所 述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 1 , 则将 所述索引为 2的编码模式的值设置为 1 , 否则, 将所述索引为 2的编码模式 的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值不等于所述索引为 0的编码模式的值和所述 索引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0。
在本实施例中, 步骤 B300, 所述根据码流中的模式值和所述候选模式列 表生成当前块的当前编码模式, 具体可以为:
若根据所述码流中的第一标识识别到所述候选模式列表中存在所述当前 编码模式, 则将所述当前编码模式设置为所述候选模式列表以所述模式值为 索引的编码模式。
具体地, 若码流中存在第一标识, 则说明候选模式列表中存在当前编码 模式, 码流中的模式值即为该当前编码模式在候选模式列表中的索引, 则根 据模式值可以确定当前编码模式。
在本实施例中, 所述根据码流中的模式值和所述候选模式列表生成当前 块的当前编码模式, 具体可以包括如下步骤:
若根据所述码流中的第二标识识别到所述候选模式列表中不存在所述当 前编码模式, 则按照出现概率由高到低将所述候选模式列表中各编码模式进 行排序;
若所述模式值小于出现概率为第一的编码模式的值 , 则将所述模式值增 1生成第一中间值, 否则, 将所述模式值作为所述第一中间值;
若所述第一中间值小于出现概率为第二的编码模式的值, 则将所述第一 中间增 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值小于出现概率为第三的编码模式的值 , 则将所述第二 中间值增 1生成第三中间值, 否则将所述第二中间值作为所述第三中间值; 将所述当前编码模式的值设置为所述第三中间值。
具体地, 若码流中存在第二标识, 则说明候选模式列表中不存在当前编 码模式, 则需要根据候选模式列表和模式值计算出当前编码模式。 按照出现概率由高到低将所述候选模式列表中各编码模式进行排序 , 排 序过程具体可以为:
若 candModeList ] 大于 candModeList[l] , 贝' J
(candModeList[0],candModeList[l])=swap(candModeList[0],candModeList[
1] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[0],candModeList[2])=swap(candModeList[0],candModeList[
2] )
若 candModeList[i;| 大于 candModeList[2] , 贝' J
(candModeList[l ] ,candModeList[2])=swap(candModeList[ l],candModeList[
2] )
通过函数 swap(x, y)可以实现排序, 当然排序过程也可以通过其他方式实 现, 不以本实施例为限。
将 rem— intra— luma_pred— mode的值设置为模式值;
先 ^夺 rem— intra— luma_pred— mode与 candModeList[0]比较:
若 rem— intra— luma_pred— mode小于 candModeList[0] , 贝1 J
rem— intra— luma_pred— mode增 1 , 否贝1 J保持 rem— intra— luma_pred— mode不更 ; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[l]比较:
若 rem— intra— luma_pred— mode小于 candModeList[l] , 贝1 J
rem— intra— luma_pred— mode增 1 ,否贝1 J ,保持 rem— intra— luma_pred— mode不更; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[2]比较:
若 rem— intra— luma_pred— mode小于 candModeList[2] , 贝1 J
rem— intra— luma_pred— mode增 1 ,否贝1 J ,保持 rem— intra— luma_pred— mode不更。
当前编码模式的值设为 rem— intra— luma_pred— mode。
在本实施例中, 步骤 B400, 所述根据所述当前编码模式对所述当前块进 行解码, 具体可以为:
根据所述当前编码模式确定所述当前块的预测像素, 根据所述码流生成 当前残差, 根据所述预测像素和所述当前残差进行所述当前块的重建。
图 8为本发明实施例提供的第一种分层编码装置结构示意图。 如图 8所 示, 本实施例提供的分层编码装置具体可以实现如图 1所示实施例提供的分 层编码方法的各个步骤, 其具体实现过程, 在此不再贅述。 本实施例提供方 的分层编码装置可以集成在例如电视机、 机顶盒、 个人计算机、 笔记本电脑、 平板电脑或手机等设备的视频处理器中, 也可以单独设置, 该分层编码装置 可以通过软件和 /或硬件的方式来实现。
本实施例提供的分层编码装置具体包括获取单元 11和第一编码单元 12。 所述获取单元 11用于获取底层中、与增强层的当前块对应的底层块的底层编 码模式。 所述第一编码单元 12与所述获取单元 11相连, 用于若所述当前块 的当前编码模式与所述底层编码模式相同, 则根据所述当前编码模式对所述 当前块进行编码生成码流, 在所述码流的头部设置用以指示帧内编码使用层 间信息的指示标识。
本实施例提供的分层编码装置, 获取单元 11获取底层中、 与增强层的当 前块对应的底层块的底层编码模式,第一编码单元 12若当前块的当前编码模 式与底层编码模式相同, 则根据当前编码模式对当前块进行编码生成码流, 在码流中设置用以指示帧内编码使用层间信息的指示标识。 在对当前块的编 码过程中考虑了对应的底层块的编码模式, 充分利用了层间相关性, 大大提 高了编解码性能。 且在当前块的编码模式与底层块的编码模式相同时, 通过 层间信息使用标识的设置, 只需编码一个标志位, 从而有效地减少了对帧内 编码模式编码所需要的比特数, 成功避免了编解码过程中构建候选模式列表 以及其后建立在候选模式列表上的操作, 有效降低了编解码过程中的内存和 能量等资源消耗。
在本实施例中,所述第一编码单元 12具体可以用于根据所述当前编码模 式确定所述当前块的预测像素, 获取所述当前块的实际像素, 根据所述实际 像素和所述预测像素生成当前残差, 根据所述当前残差生成所述码流。
具体地, 根据当前编码模式可以确定所述当前块的预测像素, 例如, 当 前编码模式为竖直预测编码模式, 则可以将与当前块上边相邻块的像素作为 该当前块的预测像素。 计算当前块的实际像素与该预测像素之间的残差作为 当前残差, 对该残差进行编码生成码流。
相应地, 在解码侧, 对码流进行解码得到该当前残差, 若根据码流中的 层间信息使用标识识别到编码侧对该当前块采用的编码模式与对应的底层块 的编码模式相同, 则可以获取底层块的编码模式, 根据底层块的编码模式确 定预测像素, 将预测像素与该当前残差相加即可实现对当前块的重建。
图 9为本发明实施例提供的第二种分层编码装置结构示意图。 如图 9所 示, 在本实施例中, 所述分层编码装置还可以包括列表生成单元 13、 处理单 元 14和第二编码单元 15。 所述列表生成单元 13与所述获取单元 11相连, 用于若所述当前块的当前编码模式与所述底层编码模式不同, 则生成候选模 式列表。 所述处理单元 14与所述列表生成单元 13相连, 用于根据所述当前 编码模式和所述候选模式列表生成模式值。所述第二编码单元 15与所述处理 单元 14相连, 用于根据所述当前编码模式对所述当前块进行编码生成码流, 将所述模式值对应的码字写入所述码流中, 在所述码流的头部设置用以指示 帧内编码未使用层间信息的指示标识。
在本实施例中, 所述列表生成单元 13具体可以用于:
设置所述增强层中与所述当前块的左相邻块的第一编码模式的索引为 0 , 设置所述增强层中与所述当前块的上相邻块的第二编码模式的索引为 1; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 ;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 则若所述底层编码模式的值大于所述第一编码模式的值, 根据以 下公式设置所述索引为 1的编码模式的值: candModeList[l] = 2 +
((candModeList[0] + 29) % 32), 否则,根据以下公式设置所述索引为 1的编码 模式的值: candModeList[l] = 2 + ((candModeList[0] - 2 + 1) % 32); 其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l]为所述索引为 1的编码模式;
设置所述底层编码模式的索引为 2。
具体地, 通过以下方式建立该候选模式列表:
candModeList[0] = candlntraPredModeL
candModeList[l] = candlntraPredModeA
若 candModeList[0] 和 candModeList[l] 相等
若 candModeList[0] 小于 2, 贝' J candModeList[0] = Intra— Planar
candModeList[l] = Intra— DC
若 candModeList[0] 大于或等于 2, 贝' J
candModeList[0] = candlntraPredModeL
若 candlntraPredModeB 大于 candlntraPredModeL , 贝1 J
candModeList[l] = 2 + ((candlntraPredModeL + 29) % 32) 否则, candModeList[l] = 2 + ((candlntraPredModeL - 2 + 1) % 32) candModeList[2] = candlntraPredModeB
通过上述方法生成的候选模式列表的包括三个可能性较大的编码模式。 上述处理过程中各编码模式所对应的值可参考如表 1所示的对应关系, 即编码模式的值为 0对应平面模式( Intra— Planar ) , 编码模式的值为 1对应 直流模式(Intra— DC ) , 编码模式的值为 26对应垂直模式( Intra— Vertical ) 。 可以理解的是, 本实施例基于预先设定的数值与编码模式的对应关系, 本领 域技术人员根据实际设置进行调整的技术方案,均在本发明的保护范围之内。
在本实施例中,所述处理单元 14具体可以用于若所述候选模式列表中存 在所述当前编码模式 , 则将所述模式值设置为所述候选模式列表中的所述当 前编码模式对应的索引;
所述第二编码单元 15还可以用于将第一标识写入所述码流的头部。
具体地, 若候选模式列表中存在当前编码模式, 例如当前编码模式为 candlntraPredModeL , 且在候选模式列表 candlntraPredModeL的索引为 1 , 则 将模式值设置为 1 , 以节省资源占用, 将该模式值写入码流中, 并在码流的 头部写入第一标识,该第一标识用以指示候选模式列表中存在当前编码模式, 例如可以将 pre V— intra— luma_pred— flag设置为 1以表示该第一标识。
在本实施例中,所述处理单元 14具体可以用于若所述候选模式列表中不 存在所述当前编码模式, 则按照出现概率由高到低将所述候选模式列表中各 编码模式进行排序;
若所述当前编码模式的值大于出现概率为第三的编码模式的值 , 则将所 述当前编码模式的值减 1生成第一中间值, 否则, 将所述当前编码模式的值 作为所述第一中间值;
若所述第一中间值大于出现概率为第二的编码模式的值, 则将所述第一 中间值减 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值大于出现概率为第一的编码模式的值 , 则将所述第二 中间值减 1生成第三中间值, 否则, 将所述第二中间值作为所述第三中间值; 将所述模式值设置为所述第三中间值;
所述第二编码单元 15还可以用于将第二标识写入所述码流的头部。
具体地, 若候选模式列表中不存在该当前编码模式, 则按照出现概率由 高到低将所述候选模式列表中各编码模式进行排序, 排序过程具体可以为: 若 candModeList ] 大于 candModeList[l] , 贝' J
(candModeList[0],candModeList[l])=swap(candModeList[0],candModeList[
1] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[0],candModeList[2])=swap(candModeList[0],candModeList[
2] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[l ] ,candModeList[2])=swap(candModeList[ l],candModeList[
2] )
通过函数 swap(x, y)可以实现排序, 当然排序过程也可以通过其他方式实 现, 不以本实施例为限。
rem— intra— luma_pred— mode的值设置为当前编码模式的值;
先 ^夺 rem— intra— luma_pred— mode与 candModeList[2]比较:
若 rem— intra— luma_pred— mode大于 candModeList[2] , 贝1 J
rem— intra— luma_pred— mode减 1 , 否贝1 J ,保持 rem— intra— luma_pred— mode不更; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[l]比较:
若 rem— intra— luma_pred— mode 大于 candModeList[ 1 ] , 贝1 J
rem— intra— luma_pred— mode减 1 , 否贝1 J保持 rem— intra— luma_pred— mode不更。
再 ^夺 rem— intra— luma_pred— mode与 candModeList[0]比较:
若 rem— intra— luma_pred— mode 不大于 candModeList[0] , 贝1 J
rem— intra— luma_pred— mode减 1 ,否贝1 J ,保持 rem— intra— luma_pred— mode不更。, 将模式值设置为 rem— intra— luma_pred— mode。
第二标识用以指示候选模式列表中不存在当前编码模式, 例如可以将 prev— intra— luma_pred— flag设置为 0以表示该第二标识。
图 10为本发明实施例提供的第一种分层解码装置结构示意图。 如图 10 所示, 本实施例提供的分层解码装置具体可以实现如图 3所示实施例提供的 分层解码方法的各个步骤, 其具体实现过程, 在此不再贅述。 本实施例提供 方的分层解码装置可以集成在例如电视机、 机顶盒、 个人计算机、 笔记本电 脑、 平板电脑或手机等设备的视频处理器中, 也可以单独设置, 该分层解码 装置可以通过软件和 /或硬件的方式来实现。
本实施例提供的分层解码装置具体包括第一获取单元 21、 第二获取单元 22和第一解码单元 23。 所述第一获取单元 21用于获取码流中的指示标识。 所述第二获取单元 22与所述第一获取单元 21相连, 用于若所述指示标识用 以指示帧内编码使用层间信息, 则获取底层中与增强层的当前块对应的底层 块的底层编码模式。 所述第一解码单元 23与所述第二获取单元 22相连, 用 于根据所述底层编码模式对所述当前块进行解码。
本实施例提供的分层解码装置, 第一获取单元 21获取码流中的指示标 识, 第二获取单元 22若码流中存在层间信息使用标识, 则获取底层中与增强 层的当前块对应的底层块的底层编码模式,第一解码单元 23根据底层编码模 式对当前块进行解码。 在对当前块的编码过程中考虑了对应的底层块的编码 模式, 充分利用了层间相关性, 大大提高了编解码性能。 且在当前块的编码 模式与底层块的编码模式相同时, 通过层间信息使用标识的设置, 只需编码 一个标志位, 从而有效地减少了对帧内编码模式编码所需要的比特数, 成功 避免了编解码过程中构建候选模式列表以及其后建立在候选模式列表上的操 作 , 有效降低了编解码过程中的内存和能量等资源消耗。
在本实施例中,所述第一解码单元 23具体可以用于根据所述底层编码模 式确定所述当前块的预测像素, 根据所述码流生成当前残差, 根据所述预测 像素和所述当前残差进行所述当前块的重建。
图 11为本发明实施例提供的第二种分层解码装置结构示意图。 如图 11 所示, 所述分层解码装置还可以包括列表生成单元 24、 处理单元 25和第二 解码单元 26。 所述列表生成单元 24与所述第一获取单元相连, 用于若所述 指示标识用以指示帧内编码未使用层间信息, 则生成候选模式列表。 所述处 理单元 25与所述列表生成单元 24相连, 用于根据码流中的模式值和所述候 选模式列表生成当前块的当前编码模式。所述第二解码单元 26与所述处理单 元 25相连, 用于根据所述当前编码模式对所述当前块进行解码。
在本实施例中, 所述列表生成单元 24具体可以用于:
设置所述增强层中与所述当前块的左相邻块的第一编码模式的索引为 0 , 设置所述增强层中与所述当前块的上相邻块的第二编码模式的索引为 1 ; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 ;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 则若所述底层编码模式的值大于所述第一编码模式的值, 根据以 下公式设置所述索引为 1的编码模式的值: candModeList[l] = 2 +
((candModeList[0] + 29) % 32), 否则,根据以下公式设置所述索引为 1的编码 模式的值: candModeList[l] = 2 + ((candModeList[0] - 2 + 1) % 32); 其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l]为所述索引为 1的编码模式;
设置所述底层编码模式的索引为 2。
在本实施例中,所述处理单元 25具体可以用于若根据所述码流中的第一 标识识别到所述候选模式列表中存在所述当前编码模式, 则将所述当前编码 模式设置为所述候选模式列表以所述模式值为索引的编码模式。
具体地, 若码流中存在第一标识, 则说明候选模式列表中存在当前编码 模式, 码流中的模式值即为该当前编码模式在候选模式列表中的索引, 则根 据模式值可以确定当前编码模式。
在本实施例中, 所述处理单元 25具体可以用于:
若根据所述码流中的第二标识识别到所述候选模式列表中不存在所述当 前编码模式, 则按照出现概率由高到低将所述候选模式列表中各编码模式进 行排序;
若所述模式值小于出现概率为第一的编码模式的值 , 则将所述模式值增 1生成第一中间值, 否则, 将所述模式值作为所述第一中间值;
若所述第一中间值小于出现概率为第二的编码模式的值 , 则将所述第一 中间增 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值小于出现概率为第三的编码模式的值, 则将所述第二 中间值增 1生成第三中间值, 否则将所述第二中间值作为所述第三中间值; 将所述当前编码模式的值设置为所述第三中间值。
具体地, 若码流中存在第二标识, 则说明候选模式列表中不存在当前编 码模式, 则需要根据候选模式列表和模式值计算出当前编码模式。
按照出现概率由高到低将所述候选模式列表中各编码模式进行排序 , 排 序过程具体可以为:
若 candModeList ] 大于 candModeList[l] , 贝' J
(candModeList[0],candModeList[l])=swap(candModeList[0],candModeList[ 1] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[0],candModeList[2])=swap(candModeList[0],candModeList[
2] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[l ] ,candModeList[2])=swap(candModeList[ l],candModeList[
2] )
通过函数 swap(x, y)可以实现排序, 当然排序过程也可以通过其他方式实 现, 不以本实施例为限。
将 rem— intra— luma_pred— mode的值设置为模式值;
先 ^夺 rem— intra— luma_pred— mode与 candModeList[0]比较:
若 rem— intra— luma_pred— mode小于 candModeList[0] , 贝1 J
rem— intra— luma_pred— mode增 1 , 否贝1 J保持 rem— intra— luma_pred— mode不更 ; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[l]比较:
若 rem— intra— luma_pred— mode小于 candModeList[ 1 ] , 贝1 J
rem— intra— luma_pred— mode增 1 , 否贝1 J ,保持 rem— intra— luma_pred— mode不更; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[2]比较:
若 rem— intra— luma_pred— mode小于 candModeList[2] , 贝1 J
rem— intra— luma_pred— mode增 1 , 否贝1 J ,保持 rem— intra— luma_pred— mode不更 , 当前编码模式的值设为 rem— intra— luma_pred— mode。
图 12为本发明实施例提供的第三种分层编码装置结构示意图。 如图 12 所示, 本实施例提供的分层编码装置具体可以实现如图 6所示实施例提供的 分层编码方法的各个步骤, 其具体实现过程, 在此不再贅述。 本实施例提供 方的分层编码装置可以集成在例如电视机、 机顶盒、 个人计算机、 笔记本电 脑、 平板电脑或手机等设备的视频处理器中, 也可以单独设置, 该分层编码 装置可以通过软件和 /或硬件的方式来实现。
本实施例提供的分层编码装置具体包括初始化单元 31、修正单元 32、 处 理单元 33和编码单元 34。所述初始化单元 31用于生成初始模式列表,其中, 所述初始模式列表包括底层中与增强层的当前块对应的底层块的底层编码模 式、 所述增强层中与所述当前块的左相邻块的第一编码模式和所述增强层中 与所述当前块的上相邻块的第二编码模式。所述修正单元 32与所述初始化单 元 31相连, 用于对所述初始模式列表进行修正, 生成候选模式列表。 所述处 理单元 33与所述修正单元 32相连, 用于根据当前块的当前编码模式和所述 候选模式列表生成模式值。 所述编码单元 34与所述处理单元 33相连, 用于 根据所述当前编码模式对所述当前块进行编码生成码流, 将所述模式值对应 的码字写入所述码流中。
本实施例提供的分层编码装置, 初始化单元 31生成初始模式列表, 修正 单元 32对初始模式列表进行修正, 生成候选模式列表, 处理单元 33根据当 前块的当前编码模式和候选模式列表生成模式值,编码单元 34根据当前编码 模式对当前块进行编码生成码流, 将模式值对应的码字写入码流中。 在对当 前块的编码过程中考虑到了对应的底层块的编码模式, 充分利用了层间相关 性, 大大提高了编解码性能。 且在生成初始模式列表时, 将对应的底层块的 编码模式作为可能性较大的编码模式, 基于此生成的候选模式列表用于对当 前块的编码参考, 进一步提高了编解码性能。
图 13为本发明实施例提供的第四种分层编码装置结构示意图。 如图 13 所示, 在本实施例中, 所述修正单元具 32体可以包括第一排序子单元 321和 第一处理子单元 322。
所述第一排序子单元 321与所述初始化单元 31相连,用于按照出现概率 由高到低所述底层编码模式、 所述第一编码模式和所述第二编码模式进行排 序, 设置出现概率为第一的编码模式的索引为 0 , 出现概率为第二的编码模 式的索引为 1 , 出现概率为第三的编码模式的索引为 2。 所述第一处理子单元 322与所述第一排序子单元 321相连, 用于若索引 为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索 引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的值设置为 1 , 若索引为 2的编码模式的值与所述索引为 0的编码模式的值相等, 则将所述 索引为 2的编码模式的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 根据以下公式分别设置所述索引为 1的编码模式的值和所述索引 为 2的编码模式的值:
candModeList[l] = 2 + ((candModeList[0] + 29) % 32);
candModeList[2] = 2 + ((candModeList[0] - 2 + 1) % 32);
其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l] 为所述索引为 1的编码模式, candModeList[2]为所述索引为 2的编码模式; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值等于所述索引为 0的编码模式的值或所述索 引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1 的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0, 若所 述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 1 , 则将 所述索引为 2的编码模式的值设置为 1 , 否则, 将所述索引为 2的编码模式 的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值不等于所述索引为 0的编码模式的值和所述 索引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0。
具体地, 编码模式的值越大, 则出现概率越小, 各编码模式的出现概率 为预先统计的。 例如按照出现概率由高到底排列好的编码模式顺序如下: candModeList[0] = candlntraPredModeB
candModeList[l] = candlntraPredModeL
candModeList[2] = candlntraPredModeA
通过如下描述对上述排序后的列表进行修正:
若 candModeList[0] 和 candModeList[l] 相等 若 candModeList[0] 小于 2, 则
candModeList[0] = Intra— Planar
candModeList[l] = Intra— DC
若 candModeList[2] 等于 candModeList[0] 或 candModeList[l] , 则 candModeList[2] = Intra— Vertical
若 candModeList[0] 大于或等于 2, 贝' J
candModeList[l] = 2 + ((candlntraPredModeB + 29) % 32) candModeList[2] = 2 + ((candlntraPredModeB - 2 + 1) % 32) 若 candModeList[0] 和 candModeList[l]不相等
若 candModeList[2] 等于 candModeList[0] 或 candModeList[l] 若 candModeList[0] 不为 0并且 candModeList[l] 不为 0, 贝' J candModeList[2] = 0
若 candModeList[0] 不为 1并且 candModeList[l] 不为 1 , 贝' J candModeList[2] = 1
否则, candModeList[2] = Intra— Vertical
若 candModeList[0] 不为 0并且 candModeList[l] 不为 0, 贝' J candModeList[2] = 0
上述处理过程中各编码模式所对应的值可参考如表 1所示的对应关系, 即编码模式的值为 0对应平面模式( Intra— Planar ) , 编码模式的值为 1对应 直流模式(Intra— DC ) , 编码模式的值为 26对应垂直模式( Intra— Vertical ) 。 可以理解的是, 本实施例基于预先设定的数值与编码模式的对应关系, 本领 域技术人员根据实际设置进行调整的技术方案,均在本发明的保护范围之内。
在本实施例中,所述处理单元 33具体用于若所述候选模式列表中存在所 述当前编码模式, 则将所述模式值设置为所述候选模式列表中的所述当前编 码模式对应的索引;
所述编码单元 34还用于将第一标识写入所述码流的头部。
具体地, 若候选模式列表中存在当前编码模式, 例如当前编码模式为 candlntraPredModeB , 且在候选模式列表 candlntraPredModeB的索引为 1 , 则 将模式值设置为 1 , 以节省资源占用, 将该模式值写入码流中, 并在码流的 头部写入第一标识,该第一标识用以指示候选模式列表中存在当前编码模式, 例如可以将 pre V— intra— luma_pred— flag设置为 1以表示该第一标识。
在本实施例中,所述处理单元 33具体可以包括第二排序子单元 331和第 二处理子单元 332。 所述第二排序子单元 331与所述修正单元 32相连, 用于 若所述候选模式列表中不存在所述当前编码模式, 则按照出现概率由高到低 将所述候选模式列表中各编码模式进行排序。
所述第二处理子单元 332与所述第二排序子单元 331相连, 用于若所述 当前编码模式的值大于出现概率为第三的编码模式的值, 则将所述当前编码 模式的值减 1生成第一中间值, 否则, 将所述当前编码模式的值作为所述第 一中间值;
若所述第一中间值大于出现概率为第二的编码模式的值, 则将所述第一 中间值减 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值大于出现概率为第一的编码模式的值 , 则将所述第二 中间值减 1生成第三中间值, 否则, 将所述第二中间值作为所述第三中间值; 将所述模式值设置为所述第三中间值;
所述编码单元 34还用于将第二标识写入所述码流的头部。
具体地, 若候选模式列表中不存在该当前编码模式, 则按照出现概率由 高到低将所述候选模式列表中各编码模式进行排序, 排序过程具体可以为: 若 candModeList ] 大于 candModeList[l] , 贝' J
(candModeList[0],candModeList[l])=swap(candModeList[0],candModeList[ 1] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[0],candModeList[2])=swap(candModeList[0],candModeList[
2] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[l ] ,candModeList[2])=swap(candModeList[ l],candModeList[
2] )
通过函数 swap(x, y)可以实现排序, 当然排序过程也可以通过其他方式实 现, 不以本实施例为限。
rem— intra— luma_pred— mode的值设置为当前编码模式的值;
先 ^夺 rem— intra— luma_pred— mode与 candModeList[2]比较: 若 rem— intra— luma_pred— mode大于 candModeList[2] , 贝1 J
rem— intra— luma_pred— mode减 1 , 否贝1 J ,保持 rem— intra— luma_pred— mode不更; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[l]比较:
若 rem— intra— luma_pred— mode 大于 candModeList[ 1 ] , 贝1 J
rem— intra— luma_pred— mode减 1 , 否贝1 J保持 rem— intra— luma_pred— mode不更; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[0]比较:
若 rem— intra— luma_pred— mode 不大于 candModeList[0] , 贝1 J
rem— intra— luma_pred— mode减 1 , 否贝1 J ,保持 rem— intra— luma_pred— mode不更 , 将模式值设置为 rem— intra— luma_pred— mode。
第二标识用以指示候选模式列表中不存在当前编码模式, 例如可以将 prev— intra— luma_pred— flag设置为 0以表示该第二标识。
在本实施例中,所述第二编码单元 34具体可以用于根据所述当前编码模 式确定所述当前块的预测像素, 获取所述当前块的实际像素, 根据所述实际 像素和所述预测像素生成当前残差, 根据所述当前残差生成所述码流。
图 14为本发明实施例提供的第三种分层解码装置结构示意图。 如图 14 所示, 本实施例提供的分层解码装置具体可以实现如图 7所示实施例提供的 分层解码方法的各个步骤, 其具体实现过程, 在此不再贅述。 本实施例提供 方的分层解码装置可以集成在例如电视机、 机顶盒、 个人计算机、 笔记本电 脑、 平板电脑或手机等设备的视频处理器中, 也可以单独设置, 该分层解码 装置可以通过软件和 /或硬件的方式来实现。
本实施例提供的分层解码装置具体包括初始化单元 41、修正单元 42、 处 理单元 43和解码单元 44。所述初始化单元 41用于生成初始模式列表,其中, 所述初始模式列表包括底层中与增强层的当前块对应的底层块的底层编码模 式、 所述增强层中与所述当前块的左相邻块的第一编码模式和所述增强层中 与所述当前块的上相邻块的第二编码模式。所述修正单元 42与所述初始化单 元 41相连, 用于对所述初始模式列表进行修正, 生成候选模式列表; 所述处 理单元 43与所述修正单元 42相连, 用于根据码流中的模式值和所述候选模 式列表生成当前块的当前编码模式。 所述解码单元 44与所述修正单元 42相 连, 用于根据所述当前编码模式对所述当前块进行解码。
本实施例提供的分层解码装置, 初始化单元 41生成初始模式列表, 修正 单元 42对初始模式列表进行修正, 生成候选模式列表, 处理单元 43根据码 流中的模式值和候选模式列表生成当前块的当前编码模式,解码单元 44根据 当前编码模式对当前块进行解码。 在对当前块的编码过程中考虑了对应的底 层块的编码模式, 充分利用了层间相关性, 大大提高了编解码性能。 且在生 成初始模式列表时,将对应的底层块的编码模式作为可能性较大的编码模式, 基于此生成的候选模式列表用于对当前块的解码参考, 进一步提高了编解码 性能。
图 15为本发明实施例提供的第四种分层解码装置结构示意图。 如图 15 所示, 在本实施例中, 所述修正单元 42具体可以包括第一排序子单元 421和 第一处理子单元 422。 所述第一排序子单元 421与所述初始化单元 41相连, 用于按照出现概率由高到低所述底层编码模式、 所述第一编码模式和所述第 二编码模式进行排序, 设置出现概率为第一的编码模式的索引为 0 , 出现概 率为第二的编码模式的索引为 1 , 出现概率为第三的编码模式的索引为 2。
所述第一处理子单元 422与所述第一排序子单元 421相连, 用于若索引 为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索 引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的值设置为 1 , 若索引为 2的编码模式的值与所述索引为 0的编码模式的值相等, 则将所述 索引为 2的编码模式的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 根据以下公式分别设置所述索引为 1的编码模式的值和所述索引 为 2的编码模式的值:
candModeList[l] = 2 + ((candModeList[0] + 29) % 32);
candModeList[2] = 2 + ((candModeList[0] - 2 + 1) % 32);
其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l] 为所述索引为 1的编码模式, candModeList[2]为所述索引为 2的编码模式; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值等于所述索引为 0的编码模式的值或所述索 引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1 的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0, 若所 述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 1 , 则将 所述索引为 2的编码模式的值设置为 1 , 否则, 将所述索引为 2的编码模式 的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值不等于所述索引为 0的编码模式的值和所述 索引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0。
在本实施例中,所述处理单元 43具体可以用于若根据所述码流中的第一 标识识别到所述候选模式列表中存在所述当前编码模式, 则将所述当前编码 模式设置为所述候选模式列表以所述模式值为索引的编码模式。
在本实施例中,所述处理单元 43具体可以包括第二排序子单元 431和第 二处理子单元 432。 所述第二排序子单元 431与所述修正单元 42相连, 用于 若根据所述码流中的第二标识识别到所述候选模式列表中不存在所述当前编 码模式, 则按照出现概率由高到低将所述候选模式列表中各编码模式进行排 序。
所述第二处理子单元 432与所述第二排序子单元 431相连, 用于若所述 模式值小于出现概率为第一的编码模式的值, 则将所述模式值增 1生成第一 中间值, 否则, 将所述模式值作为所述第一中间值;
若所述第一中间值小于出现概率为第二的编码模式的值 , 则将所述第一 中间增 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值小于出现概率为第三的编码模式的值, 则将所述第二 中间值增 1生成第三中间值, 否则将所述第二中间值作为所述第三中间值; 将所述当前编码模式的值设置为所述第三中间值。
按照出现概率由高到低将所述候选模式列表中各编码模式进行排序 , 排 序过程具体可以为:
若 candModeList[0;| 大于 candModeList[l] , 贝' J
(candModeList[0],candModeList[l])=swap(candModeList[0],candModeList[
1] )
若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[0],candModeList[2])=swap(candModeList[0],candModeList[ 2] ) 若 candModeList ] 大于 candModeList[2] , 贝' J
(candModeList[l ] ,candModeList[2])=swap(candModeList[ l],candModeList[
2] )
通过函数 swap(x, y)可以实现排序, 当然排序过程也可以通过其他方式实 现, 不以本实施例为限。
将 rem— intra— luma_pred— mode的值设置为模式值;
先 ^夺 rem— intra— luma_pred— mode与 candModeList[0]比较:
若 rem— intra— luma_pred— mode小于 candModeList[0] , 贝1 J
rem— intra— luma_pred— mode增 1 , 否贝1 J保持 rem— intra— luma_pred— mode不更 ; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[l]比较:
若 rem— intra— luma_pred— mode小于 candModeList[ 1 ] , 贝1 J
rem— intra— luma_pred— mode增 1 , 否贝1 J ,保持 rem— intra— luma_pred— mode不更; 再 ^夺 rem— intra— luma_pred— mode与 candModeList[2]比较:
若 rem— intra— luma_pred— mode小于 candModeList[2] , 贝1 J
rem— intra— luma_pred— mode增 1 , 否贝1 J ,保持 rem— intra— luma_pred— mode不更。
当前编码模式的值设为 rem— intra— luma_pred— mode。
在本实施例中,所述解码单元 44具体可以用于根据所述当前编码模式确 定所述当前块的预测像素, 根据所述码流生成当前残差, 根据所述预测像素 和所述当前残差进行所述当前块的重建。
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步骤 可以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机可读 取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述 的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代码的介 最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或 者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技 术方案的本质脱离本发明各实施例技术方案的范围。

Claims

权 利 要求 书
1、 一种分层编码方法, 其特征在于, 包括:
获取底层中、 与增强层的当前块对应的底层块的底层编码模式; 若所述当前块的当前编码模式与所述底层编码模式相同, 则根据所述当 前编码模式对所述当前块进行编码生成码流, 在所述码流的头部设置用以指 示帧内编码使用层间信息的指示标识。
2、根据权利要求 1所述的分层编码方法,其特征在于,所述获取底层中、 与增强层的当前块对应的底层块的底层编码模式之后, 所述方法还包括: 若所述当前块的当前编码模式与所述底层编码模式不同, 则生成候选模 式列表;
根据所述当前编码模式和所述候选模式列表生成模式值;
根据所述当前编码模式对所述当前块进行编码生成码流, 将所述模式值 对应的码字写入所述码流中, 在所述码流的头部设置用以指示帧内编码未使 用层间信息的指示标识。
3、 根据权利要求 2所述的分层编码方法, 其特征在于, 所述生成候选模 式列表, 包括:
设置所述增强层中与所述当前块的左相邻块的第一编码模式的索引为 0 , 设置所述增强层中与所述当前块的上相邻块的第二编码模式的索引为 1; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 ;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 则若所述底层编码模式的值大于所述第一编码模式的值, 根据以 下公式设置所述索引为 1 的编码模式的值: candModeList[l] = 2 + ((candModeList[0] + 29) % 32), 否则,根据以下公式设置所述索引为 1的编码 模式的值: candModeList[l] = 2 + ((candModeList[0] - 2 + 1) % 32); 其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l]为所述索引为 1的编码模式;
设置所述底层编码模式的索引为 2。
4、 根据权利要求 2所述的分层编码方法, 其特征在于, 所述根据当前块 的当前编码模式和所述候选模式列表生成模式值, 具体为:
若所述候选模式列表中存在所述当前编码模式 , 则将所述模式值设置为 所述候选模式列表中的所述当前编码模式对应的索引;
所述根据所述当前编码模式对所述当前块进行编码生成码流之后, 所述 方法还包括:
将第一标识写入所述码流的头部。
5、 根据权利要求 2所述的分层编码方法, 其特征在于, 所述根据当前块 的当前编码模式和所述候选模式列表生成模式值, 包括:
若所述候选模式列表中不存在所述当前编码模式, 则按照出现概率由高 到低将所述候选模式列表中各编码模式进行排序;
若所述当前编码模式的值大于出现概率为第三的编码模式的值, 则将所 述当前编码模式的值减 1生成第一中间值, 否则, 将所述当前编码模式的值 作为所述第一中间值;
若所述第一中间值大于出现概率为第二的编码模式的值, 则将所述第一 中间值减 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值大于出现概率为第一的编码模式的值, 则将所述第二 中间值减 1生成第三中间值, 否则, 将所述第二中间值作为所述第三中间值; 将所述模式值设置为所述第三中间值;
所述根据所述当前编码模式对所述当前块进行编码生成码流之后, 所述 方法还包括:
将第二标识写入所述码流的头部。
6、 根据权利要求 1所述的分层编码方法, 其特征在于, 所述根据所述当 前编码模式对所述当前块进行编码生成码流, 具体为:
根据所述当前编码模式确定所述当前块的预测像素, 获取所述当前块的 实际像素, 根据所述实际像素和所述预测像素生成当前残差, 根据所述当前 残差生成所述码流。
7、 一种分层解码方法, 其特征在于, 包括:
获取码流中的指示标识;
若所述指示标识用以指示帧内编码使用层间信息, 则获取底层中与增强 层的当前块对应的底层块的底层编码模式; 根据所述底层编码模式对所述当前块进行解码。
8、 根据权利要求 7所述的分层解码方法, 其特征在于, 所述获取码流中 的指示标识之后, 所述方法还包括:
若所述指示标识用以指示帧内编码未使用层间信息, 则生成候选模式列 表;
根据所述码流中的模式值和所述候选模式列表生成当前块的当前编码模 式;
根据所述当前编码模式对所述当前块进行解码。
9、 根据权利要求 8所述的分层解码方法, 其特征在于, 所述生成候选模 式列表, 包括:
设置所述增强层中与所述当前块的左相邻块的第一编码模式的索引为 0 , 设置所述增强层中与所述当前块的上相邻块的第二编码模式的索引为 1; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 ;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 则若所述底层编码模式的值大于所述第一编码模式的值, 根据以 下公式设置所述索引为 1 的编码模式的值: candModeList[l] = 2 + ((candModeList[0] + 29) % 32), 否则,根据以下公式设置所述索引为 1的编码 模式的值: candModeList[l] = 2 + ((candModeList[0] - 2 + 1) % 32); 其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l]为所述索引为 1的编码模式;
设置所述底层编码模式的索引为 2。
10、 根据权利要求 8所述的分层解码方法, 其特征在于, 所述根据码流 中的模式值和所述候选模式列表生成当前块的当前编码模式, 包括:
若根据所述码流中的第一标识识别到所述候选模式列表中存在所述当前 编码模式, 则将所述当前编码模式设置为所述候选模式列表以所述模式值为 索引的编码模式。
11、 根据权利要求 8所述的分层解码方法, 其特征在于, 所述根据码流 中的模式值和所述候选模式列表生成当前块的当前编码模式, 包括: 若根据所述码流中的第二标识识别到所述候选模式列表中不存在所述当 前编码模式, 则按照出现概率由高到低将所述候选模式列表中各编码模式进 行排序;
若所述模式值小于出现概率为第一的编码模式的值 , 则将所述模式值增 1生成第一中间值, 否则, 将所述模式值作为所述第一中间值;
若所述第一中间值小于出现概率为第二的编码模式的值, 则将所述第一 中间增 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值小于出现概率为第三的编码模式的值, 则将所述第二 中间值增 1生成第三中间值, 否则将所述第二中间值作为所述第三中间值; 将所述当前编码模式的值设置为所述第三中间值。
12、 根据权利要求 7所述的分层解码方法, 其特征在于, 所述根据所述 底层编码模式对所述当前块进行解码, 具体为:
根据所述底层编码模式确定所述当前块的预测像素, 根据所述码流生成 当前残差, 根据所述预测像素和所述当前残差进行所述当前块的重建。
13、 一种分层编码装置, 其特征在于, 包括:
获取单元, 用于获取底层中、 与增强层的当前块对应的底层块的底层编 码模式;
第一编码单元, 与所述获取单元相连, 用于若所述当前块的当前编码模 式与所述底层编码模式相同, 则根据所述当前编码模式对所述当前块进行编 码生成码流, 在所述码流的头部设置用以指示帧内编码使用层间信息的指示 标识。
14、 根据权利要求 13所述的分层编码装置, 其特征在于, 还包括: 列表生成单元, 用于若所述当前块的当前编码模式与所述底层编码模式 不同, 则生成候选模式列表;
处理单元, 与所述列表生成单元相连, 用于根据所述当前编码模式和所 述候选模式列表生成模式值;
第二编码单元, 与所述处理单元相连, 用于根据所述当前编码模式对所 述当前块进行编码生成码流, 将所述模式值对应的码字写入所述码流中, 在 所述码流的头部设置用以指示帧内编码未使用层间信息的指示标识。
15、 根据权利要求 14所述的分层编码装置, 其特征在于, 所述列表生成 单元具体用于:
设置所述增强层中与所述当前块的左相邻块的第一编码模式的索引为 0 , 设置所述增强层中与所述当前块的上相邻块的第二编码模式的索引为 1; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 ;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 则若所述底层编码模式的值大于所述第一编码模式的值, 根据以 下公式设置所述索引为 1 的编码模式的值: candModeList[l] = 2 + ((candModeList[0] + 29) % 32), 否则,根据以下公式设置所述索引为 1的编码 模式的值: candModeList[l] = 2 + ((candModeList[0] - 2 + 1) % 32); 其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l]为所述索引为 1的编码模式;
设置所述底层编码模式的索引为 2。
16、 根据权利要求 14所述的分层编码装置, 其特征在于: 所述处理单元 具体用于若所述候选模式列表中存在所述当前编码模式, 则将所述模式值设 置为所述候选模式列表中的所述当前编码模式对应的索引;
所述第二编码单元还用于将第一标识写入所述码流的头部。
17、 根据权利要求 14所述的分层编码装置, 其特征在于: 所述处理单元 具体用于若所述候选模式列表中不存在所述当前编码模式, 则按照出现概率 由高到低将所述候选模式列表中各编码模式进行排序;
若所述当前编码模式的值大于出现概率为第三的编码模式的值, 则将所 述当前编码模式的值减 1生成第一中间值, 否则, 将所述当前编码模式的值 作为所述第一中间值;
若所述第一中间值大于出现概率为第二的编码模式的值, 则将所述第一 中间值减 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值大于出现概率为第一的编码模式的值, 则将所述第二 中间值减 1生成第三中间值, 否则, 将所述第二中间值作为所述第三中间值; 将所述模式值设置为所述第三中间值;
所述第二编码单元还用于将第二标识写入所述码流的头部。
18、 根据权利要求 13所述的分层编码装置, 其特征在于: 所述第一编码 单元具体用于根据所述当前编码模式确定所述当前块的预测像素, 获取所述 当前块的实际像素, 根据所述实际像素和所述预测像素生成当前残差, 根据 所述当前残差生成所述码流。
19、 一种分层解码装置, 其特征在于, 包括:
第一获取单元, 用于获取码流中的指示标识;
第二获取单元, 与所述第一获取单元相连, 用于若所述指示标识用以指 示帧内编码使用层间信息, 则获取底层中与增强层的当前块对应的底层块的 底层编码模式;
第一解码单元, 与所述第二获取单元相连, 用于根据所述底层编码模式 对所述当前块进行解码。
20、 根据权利要求 19所述的分层解码装置, 其特征在于, 还包括: 列表生成单元, 与所述第一获取单元相连, 用于若所述指示标识用以指 示帧内编码未使用层间信息, 则生成候选模式列表;
处理单元, 与所述列表生成单元相连, 用于根据码流中的模式值和所述 候选模式列表生成当前块的当前编码模式;
第二解码单元, 与所述处理单元相连, 用于根据所述当前编码模式对所 述当前块进行解码。
21、 根据权利要求 20所述的分层解码装置, 其特征在于, 所述列表生成 单元具体用于:
设置所述增强层中与所述当前块的左相邻块的第一编码模式的索引为 0 , 设置所述增强层中与所述当前块的上相邻块的第二编码模式的索引为 1; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 ;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 则若所述底层编码模式的值大于所述第一编码模式的值, 根据以 下公式设置所述索引为 1 的编码模式的值: candModeList[l] = 2 + ((candModeList[0] + 29) % 32), 否则,根据以下公式设置所述索引为 1的编码 模式的值: candModeList[l] = 2 + ((candModeList[0] - 2 + 1) % 32); 其中, candModeList[0] 为所述索引为 0的编码模式, candModeList[l]为所述索引为 1的编码模式;
设置所述底层编码模式的索引为 2。
22、 根据权利要求 20所述的分层解码装置, 其特征在于: 所述处理单元 具体用于若根据所述码流中的第一标识识别到所述候选模式列表中存在所述 当前编码模式, 则将所述当前编码模式设置为所述候选模式列表以所述模式 值为索引的编码模式。
23、 根据权利要求 20所述的分层解码装置, 其特征在于, 所述处理单元 具体用于:
若根据所述码流中的第二标识识别到所述候选模式列表中不存在所述当 前编码模式, 则按照出现概率由高到低将所述候选模式列表中各编码模式进 行排序;
若所述模式值小于出现概率为第一的编码模式的值 , 则将所述模式值增 1生成第一中间值, 否则, 将所述模式值作为所述第一中间值;
若所述第一中间值小于出现概率为第二的编码模式的值, 则将所述第一 中间增 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值小于出现概率为第三的编码模式的值, 则将所述第二 中间值增 1生成第三中间值, 否则将所述第二中间值作为所述第三中间值; 将所述当前编码模式的值设置为所述第三中间值。
24、 根据权利要求 19所述的分层解码装置, 其特征在于: 所述第一解码 单元具体用于根据所述底层编码模式确定所述当前块的预测像素, 根据所述 码流生成当前残差, 根据所述预测像素和所述当前残差进行所述当前块的重 建。
25、 一种分层编码方法, 其特征在于, 包括:
生成初始模式列表, 其中, 所述初始模式列表包括底层中与增强层的当 前块对应的底层块的底层编码模式、 所述增强层中与所述当前块的左相邻块 的第一编码模式和所述增强层中与所述当前块的上相邻块的第二编码模式; 对所述初始模式列表进行修正, 生成候选模式列表;
根据当前块的当前编码模式和所述候选模式列表生成模式值;
根据所述当前编码模式对所述当前块进行编码生成码流, 将所述模式值 对应的码字写入所述码流中。
26、 根据权利要求 25所述的分层编码方法, 其特征在于, 所述对所述初 始模式列表进行修正, 生成候选模式列表, 包括:
按照出现概率由高到低所述底层编码模式、 所述第一编码模式和所述第 二编码模式进行排序, 设置出现概率为第一的编码模式的索引为 0, 出现概 率为第二的编码模式的索引为 1 , 出现概率为第三的编码模式的索引为 2; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 , 若索引为 2的编码模式的值与所述索引为 0的编码模式的值相 等, 则将所述索引为 2的编码模式的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 根据以下公式分别设置所述索引为 1 的编码模式的值和所述索引 为 2的编码模式的值:
candModeList[l] = 2 + ((candModeList[0] + 29) % 32);
candModeList[2] = 2 + ((candModeList[0] - 2 + 1) % 32);
其中, candModeList[0] 为所述索引为 0 的编码模式, candModeList[l] 为所述索引为 1的编码模式, candModeList[2]为所述索引为 2的编码模式; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值等于所述索引为 0的编码模式的值或所述索 引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1 的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0, 若所 述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 1 , 则将 所述索引为 2的编码模式的值设置为 1 , 否则, 将所述索引为 2的编码模式 的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值不等于所述索引为 0的编码模式的值和所述 索引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0。
27、 根据权利要求 25所述的分层编码方法, 其特征在于, 所述根据当前 块的当前编码模式和所述候选模式列表生成模式值, 具体为: 若所述候选模式列表中存在所述当前编码模式, 则将所述模式值设置为 所述候选模式列表中的所述当前编码模式对应的索引;
所述根据所述当前编码模式对所述当前块进行编码生成码流之后, 所述 方法还包括:
将第一标识写入所述码流的头部。
28、 根据权利要求 25所述的分层编码方法, 其特征在于, 所述根据当前 块的当前编码模式和所述候选模式列表生成模式值, 包括:
若所述候选模式列表中不存在所述当前编码模式, 则按照出现概率由高 到低将所述候选模式列表中各编码模式进行排序;
若所述当前编码模式的值大于出现概率为第三的编码模式的值, 则将所 述当前编码模式的值减 1生成第一中间值, 否则, 将所述当前编码模式的值 作为所述第一中间值;
若所述第一中间值大于出现概率为第二的编码模式的值, 则将所述第一 中间值减 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值大于出现概率为第一的编码模式的值, 则将所述第二 中间值减 1生成第三中间值, 否则, 将所述第二中间值作为所述第三中间值; 将所述模式值设置为所述第三中间值;
所述根据所述当前编码模式对所述当前块进行编码生成码流之后, 所述 方法还包括:
将第二标识写入所述码流的头部。
29、 根据权利要求 25所述的分层编码方法, 其特征在于, 所述根据所述 当前编码模式对所述当前块进行编码生成码流, 具体为:
根据所述当前编码模式确定所述当前块的预测像素, 获取所述当前块的 实际像素, 根据所述实际像素和所述预测像素生成当前残差, 根据所述当前 残差生成所述码流。
30、 一种分层解码方法, 其特征在于, 包括:
生成初始模式列表, 其中, 所述初始模式列表包括底层中与增强层的当 前块对应的底层块的底层编码模式、 所述增强层中与所述当前块的左相邻块 的第一编码模式和所述增强层中与所述当前块的上相邻块的第二编码模式; 对所述初始模式列表进行修正, 生成候选模式列表; 根据码流中的模式值和所述候选模式列表生成当前块的当前编码模式; 根据所述当前编码模式对所述当前块进行解码。
31、 根据权利要求 30所述的分层解码方法, 其特征在于, 所述对所述初 始模式列表进行修正, 生成候选模式列表, 包括:
按照出现概率由高到低所述底层编码模式、 所述第一编码模式和所述第 二编码模式进行排序, 设置出现概率为第一的编码模式的索引为 0, 出现概 率为第二的编码模式的索引为 1 , 出现概率为第三的编码模式的索引为 2; 若索引为 0的编码模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编码模式的值设置为 0, 将所述索引为 1的编码模式的 值设置为 1 , 若索引为 2的编码模式的值与所述索引为 0的编码模式的值相 等, 则将所述索引为 2的编码模式的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 根据以下公式分别设置所述索引为 1 的编码模式的值和所述索引 为 2的编码模式的值:
candModeList[l] = 2 + ((candModeList[0] + 29) % 32);
candModeList[2] = 2 + ((candModeList[0] - 2 + 1) % 32);
其中, candModeList[0] 为所述索引为 0 的编码模式, candModeList[l] 为所述索引为 1的编码模式, candModeList[2]为所述索引为 2的编码模式; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值等于所述索引为 0的编码模式的值或所述索 引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1 的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0, 若所 述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 1 , 则将 所述索引为 2的编码模式的值设置为 1 , 否则, 将所述索引为 2的编码模式 的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值不等于所述索引为 0的编码模式的值和所述 索引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0。
32、 根据权利要求 30 所述的分层解码方法, 其特征在于, 所述根据码 流中的模式值和所述候选模式列表生成当前块的当前编码模式, 具体为: 若根据所述码流中的第一标识识别到所述候选模式列表中存在所述当前 编码模式, 则将所述当前编码模式设置为所述候选模式列表以所述模式值为 索引的编码模式。
33、 根据权利要求 30 所述的分层解码方法, 其特征在于, 所述根据码 流中的模式值和所述候选模式列表生成当前块的当前编码模式, 包括:
若根据所述码流中的第二标识识别到所述候选模式列表中不存在所述当 前编码模式, 则按照出现概率由高到低将所述候选模式列表中各编码模式进 行排序;
若所述模式值小于出现概率为第一的编码模式的值, 则将所述模式值增 1生成第一中间值, 否则, 将所述模式值作为所述第一中间值;
若所述第一中间值小于出现概率为第二的编码模式的值, 则将所述第一 中间增 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值小于出现概率为第三的编码模式的值, 则将所述第二 中间值增 1生成第三中间值, 否则将所述第二中间值作为所述第三中间值; 将所述当前编码模式的值设置为所述第三中间值。
34、 根据权利要求 30 所述的分层解码方法, 其特征在于, 所述根据所 述当前编码模式对所述当前块进行解码, 具体为:
根据所述当前编码模式确定所述当前块的预测像素, 根据所述码流生成 当前残差, 根据所述预测像素和所述当前残差进行所述当前块的重建。
35、 一种分层编码装置, 其特征在于, 包括:
初始化单元, 用于生成初始模式列表, 其中, 所述初始模式列表包括底 层中与增强层的当前块对应的底层块的底层编码模式、 所述增强层中与所述 当前块的左相邻块的第一编码模式和所述增强层中与所述当前块的上相邻块 的第二编码模式;
修正单元, 与所述初始化单元相连, 用于对所述初始模式列表进行修正, 生成候选模式列表;
处理单元, 与所述修正单元相连, 用于根据当前块的当前编码模式和所 述候选模式列表生成模式值;
编码单元, 与所述处理单元相连, 用于根据所述当前编码模式对所述当 前块进行编码生成码流, 将所述模式值对应的码字写入所述码流中。
36、 根据权利要求 35所述的分层编码装置, 其特征在于, 所述修正单元 包括:
第一排序子单元, 与所述第一初始化单元相连, 用于按照出现概率由高 到低所述底层编码模式、 所述第一编码模式和所述第二编码模式进行排序, 设置出现概率为第一的编码模式的索引为 0, 出现概率为第二的编码模式的 索引为 1 , 出现概率为第三的编码模式的索引为 2;
第一处理子单元, 与所述第一排序子单元相连, 用于若索引为 0的编码 模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编 码模式的值设置为 0, 将所述索引为 1的编码模式的值设置为 1 , 若索引为 2 的编码模式的值与所述索引为 0的编码模式的值相等, 则将所述索引为 2的 编码模式的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 根据以下公式分别设置所述索引为 1 的编码模式的值和所述索引 为 2的编码模式的值:
candModeList[l] = 2 + ((candModeList[0] + 29) % 32);
candModeList[2] = 2 + ((candModeList[0] - 2 + 1) % 32);
其中, candModeList[0] 为所述索引为 0 的编码模式, candModeList[l] 为所述索引为 1的编码模式, candModeList[2]为所述索引为 2的编码模式; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值等于所述索引为 0的编码模式的值或所述索 引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1 的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0, 若所 述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 1 , 则将 所述索引为 2的编码模式的值设置为 1 , 否则, 将所述索引为 2的编码模式 的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值不等于所述索引为 0的编码模式的值和所述 索引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0。
37、 根据权利要求 35所述的分层编码装置, 其特征在于: 所述处理单元 具体用于若所述候选模式列表中存在所述当前编码模式, 则将所述模式值设 置为所述候选模式列表中的所述当前编码模式对应的索引;
所述编码单元还用于将第一标识写入所述码流的头部。
38、 根据权利要求 35所述的分层编码装置, 其特征在于, 所述处理单元 包括:
第二排序子单元, 与所述第一修正单元相连, 用于若所述候选模式列表 中不存在所述当前编码模式, 则按照出现概率由高到低将所述候选模式列表 中各编码模式进行排序;
第二处理子单元, 与所述第二排序子单元相连, 用于若所述当前编码模 式的值大于出现概率为第三的编码模式的值, 则将所述当前编码模式的值减 1生成第一中间值, 否则, 将所述当前编码模式的值作为所述第一中间值; 若所述第一中间值大于出现概率为第二的编码模式的值, 则将所述第一 中间值减 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值大于出现概率为第一的编码模式的值, 则将所述第二 中间值减 1生成第三中间值, 否则, 将所述第二中间值作为所述第三中间值; 将所述模式值设置为所述第三中间值;
所述编码单元还用于将第二标识写入所述码流的头部。
39、 根据权利要求 35所述的分层编码装置, 其特征在于, 所述编码单元 具体用于根据所述当前编码模式确定所述当前块的预测像素, 获取所述当前 块的实际像素, 根据所述实际像素和所述预测像素生成当前残差, 根据所述 当前残差生成所述码流。
40、 一种分层解码装置, 其特征在于, 包括:
初始化单元, 用于生成初始模式列表, 其中, 所述初始模式列表包括底 层中与增强层的当前块对应的底层块的底层编码模式、 所述增强层中与所述 当前块的左相邻块的第一编码模式和所述增强层中与所述当前块的上相邻块 的第二编码模式;
修正单元, 与所述初始化单元相连, 用于对所述初始模式列表进行修正, 生成候选模式列表;
处理单元, 与所述修正单元相连, 用于根据码流中的模式值和所述候选 模式列表生成当前块的当前编码模式;
解码单元, 与所述修正单元相连, 用于根据所述当前编码模式对所述当 前块进行解码。
41、 根据权利要求 40所述的分层解码装置, 其特征在于, 所述修正单元 包括:
第一排序子单元, 与所述初始化单元相连, 用于按照出现概率由高到低 所述底层编码模式、 所述第一编码模式和所述第二编码模式进行排序, 设置 出现概率为第一的编码模式的索引为 0, 出现概率为第二的编码模式的索引 为 1 , 出现概率为第三的编码模式的索引为 2;
第二处理子单元, 与所述第一排序子单元相连, 用于若索引为 0的编码 模式的值和索引为 1的编码模式的值相等且小于 2, 则将所述索引为 0的编 码模式的值设置为 0, 将所述索引为 1的编码模式的值设置为 1 , 若索引为 2 的编码模式的值与所述索引为 0的编码模式的值相等, 则将所述索引为 2的 编码模式的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值相等且 不小于 2, 根据以下公式分别设置所述索引为 1 的编码模式的值和所述索引 为 2的编码模式的值:
candModeList[l] = 2 + ((candModeList[0] + 29) % 32);
candModeList[2] = 2 + ((candModeList[0] - 2 + 1) % 32);
其中, candModeList[0] 为所述索引为 0 的编码模式, candModeList[l] 为所述索引为 1的编码模式, candModeList[2]为所述索引为 2的编码模式; 若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值等于所述索引为 0的编码模式的值或所述索 引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1 的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0, 若所 述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 1 , 则将 所述索引为 2的编码模式的值设置为 1 , 否则, 将所述索引为 2的编码模式 的值设置为 26;
若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值不相等, 且所述索引为 2的编码模式的值不等于所述索引为 0的编码模式的值和所述 索引为 1的编码模式的值, 则若所述索引为 0的编码模式的值和所述索引为 1的编码模式的值均不为 0, 则将所述索引为 2的编码模式的值设置为 0。
42、 根据权利要求 40所述的分层解码装置, 其特征在于: 所述处理单元 具体用于若根据所述码流中的第一标识识别到所述候选模式列表中存在所述 当前编码模式, 则将所述当前编码模式设置为所述候选模式列表以所述模式 值为索引的编码模式。
43、 根据权利要求 40所述的分层解码装置, 其特征在于, 所述处理单元 包括:
第二排序子单元, 与所述修正单元相连, 用于若根据所述码流中的第二 标识识别到所述候选模式列表中不存在所述当前编码模式, 则按照出现概率 由高到低将所述候选模式列表中各编码模式进行排序;
第二处理子单元, 与所述第二排序子单元相连, 用于若所述模式值小于 出现概率为第一的编码模式的值, 则将所述模式值增 1生成第一中间值, 否 贝' J , 将所述模式值作为所述第一中间值;
若所述第一中间值小于出现概率为第二的编码模式的值, 则将所述第一 中间增 1生成第二中间值, 否则, 将所述第一中间值作为所述第二中间值; 若所述第二中间值小于出现概率为第三的编码模式的值, 则将所述第二 中间值增 1生成第三中间值, 否则将所述第二中间值作为所述第三中间值; 将所述当前编码模式的值设置为所述第三中间值。
44、 根据权利要求 40所述的分层解码装置, 其特征在于: 所述解码单元 具体用于根据所述当前编码模式确定所述当前块的预测像素, 根据所述码流 生成当前残差, 根据所述预测像素和所述当前残差进行所述当前块的重建。
PCT/CN2013/081980 2012-09-29 2013-08-21 分层编解码方法及装置 WO2014048188A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210374837.3A CN103716627B (zh) 2012-09-29 2012-09-29 分层编解码方法及装置
CN201210374837.3 2012-09-29

Publications (1)

Publication Number Publication Date
WO2014048188A1 true WO2014048188A1 (zh) 2014-04-03

Family

ID=50386955

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/081980 WO2014048188A1 (zh) 2012-09-29 2013-08-21 分层编解码方法及装置

Country Status (2)

Country Link
CN (1) CN103716627B (zh)
WO (1) WO2014048188A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109510997B (zh) * 2017-09-15 2022-09-23 华为技术有限公司 图像编码方法及设备

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101047857A (zh) * 2006-03-27 2007-10-03 华为技术有限公司 实现分层变长编解码的方法
CN101873484A (zh) * 2009-08-13 2010-10-27 杭州海康威视软件有限公司 分层视频编码中编码模式选择方法及装置
CN102598664A (zh) * 2009-10-28 2012-07-18 三星电子株式会社 对残差块编码的方法和设备、对残差块解码的方法和设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100518318C (zh) * 2005-04-13 2009-07-22 华为技术有限公司 一种增强层帧内预测方法
CN101895748B (zh) * 2010-06-21 2014-03-26 华为终端有限公司 一种编解码方法以及编解码装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101047857A (zh) * 2006-03-27 2007-10-03 华为技术有限公司 实现分层变长编解码的方法
CN101873484A (zh) * 2009-08-13 2010-10-27 杭州海康威视软件有限公司 分层视频编码中编码模式选择方法及装置
CN102598664A (zh) * 2009-10-28 2012-07-18 三星电子株式会社 对残差块编码的方法和设备、对残差块解码的方法和设备

Also Published As

Publication number Publication date
CN103716627A (zh) 2014-04-09
CN103716627B (zh) 2017-02-22

Similar Documents

Publication Publication Date Title
JP5727115B1 (ja) ピクチャ境界の符号化単位を符号化/復号化する方法及びその装置
CN103493481A (zh) 基于场景的适应性比特率控制
WO2012167539A1 (zh) 帧内预测模式处理的方法和装置
US20220191548A1 (en) Picture prediction method, encoder, decoder and storage medium
JP7448558B2 (ja) 画像エンコーディングおよびデコーディングのための方法およびデバイス
WO2012094908A1 (zh) 帧内预测模式二进制化的方法、解码方法、装置和系统
US8355057B2 (en) Joint scalar embedded graphics coding for color images
WO2014048188A1 (zh) 分层编解码方法及装置
TWI785073B (zh) 多重轉碼器編碼器及多重轉碼器編碼系統
CN104104956A (zh) 用于分层视频编码和解码的方法、编码装置和解码装置
US8433146B2 (en) Method for encoding image using color space estimation
WO2021012942A1 (zh) 残差编码、解码方法及装置、存储介质及电子装置
TW202209889A (zh) 精細控制影像編碼及解碼程序方法及裝置
US20110051815A1 (en) Method and apparatus for encoding data and method and apparatus for decoding data
US10397609B2 (en) Method and apparatus for predicting residual
KR101145399B1 (ko) 멀티-패스 인코딩 장치 및 방법
Chiu et al. A lossless embedded compression codec engine for HD video decoding
CN117693934A (zh) 基于合并色度块的亮度色度预测
CN116783888A (zh) 改进的帧内模式编码
CN117596392A (zh) 编码块的编码信息确定方法及相关产品
CN116547964A (zh) 用于交叉分量级重建的主变换
KR20120138430A (ko) 계층적인 화면 내 예측 모드의 부호화를 위한 장치 및 방법
CN117296320A (zh) 使用映射和不同类型的从亮度到色度预测
CN116547966A (zh) 用于帧间帧内联合预测模式的二次变换
CN112788340A (zh) 用于自适应地确定用于编码的图片组的帧数的方法和设备

Legal Events

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

Ref document number: 13841324

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13841324

Country of ref document: EP

Kind code of ref document: A1