WO2019075638A1 - Coding and decoding method and apparatus, coder, decoder, and storage medium - Google Patents

Coding and decoding method and apparatus, coder, decoder, and storage medium Download PDF

Info

Publication number
WO2019075638A1
WO2019075638A1 PCT/CN2017/106547 CN2017106547W WO2019075638A1 WO 2019075638 A1 WO2019075638 A1 WO 2019075638A1 CN 2017106547 W CN2017106547 W CN 2017106547W WO 2019075638 A1 WO2019075638 A1 WO 2019075638A1
Authority
WO
WIPO (PCT)
Prior art keywords
mode
target
coding
decoding
binarized
Prior art date
Application number
PCT/CN2017/106547
Other languages
French (fr)
Chinese (zh)
Inventor
张贤国
范娟婷
朱政
张二丽
金星
Original Assignee
北京金山云网络技术有限公司
北京金山云科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京金山云网络技术有限公司, 北京金山云科技有限公司 filed Critical 北京金山云网络技术有限公司
Priority to CN201780006030.5A priority Critical patent/CN108702521B/en
Priority to PCT/CN2017/106547 priority patent/WO2019075638A1/en
Publication of WO2019075638A1 publication Critical patent/WO2019075638A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/96Tree coding, e.g. quad-tree coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/124Quantisation
    • 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/136Incoming video signal characteristics or properties
    • H04N19/14Coding unit complexity, e.g. amount of activity or edge presence estimation
    • 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/186Methods 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 colour or a chrominance component
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/60Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
    • H04N19/61Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/80Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
    • H04N19/82Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation involving filtering within a prediction loop
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/85Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
    • H04N19/86Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving reduction of coding artifacts, e.g. of blockiness
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/90Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
    • H04N19/91Entropy coding, e.g. variable length coding [VLC] or arithmetic coding

Definitions

  • the present application relates to the field of video coding technologies, and in particular, to an SAO type coding and decoding method, apparatus, encoder, decoder, and storage medium.
  • SAO Sample Adaptive Offset
  • HEVC High Efficiency Video Coding
  • the SAO types include: skip mode, EO (Edge Offset) mode, and BO (Band Offset) mode. Since a CTU (Coding Tree Unit) includes a luma coding tree block and a plurality of chroma coding tree blocks, the coding of the SAO type for the CTU in the related art can be understood as each of the CTUs. Coding performed by a coding tree block (CTB, Coding Tree Block).
  • CTB Coding Tree Block
  • the encoder determines the SAO type applied by a CTB, it needs to encode the determined SAO type, and then add the encoded SAO type to the video code stream.
  • the SAO type is encoded in the related art, there is still a problem that the video coding efficiency is low in the related art.
  • the application provides an encoding and decoding method, device, encoder, decoder and storage medium to improve video encoding efficiency.
  • an embodiment of the present application provides an SAO type encoding method, where the method includes:
  • the target binarization corresponding to the target SAO type is determined according to the correspondence between each SAO type and the binarized character string recorded in the preset first coding rule. a string in which the first encoding rule records each SAO type and two The correspondence between the valued strings and the entropy encoding of the binarized strings;
  • the first coding rule is determined according to any one of the following coding principles:
  • the first coding principle the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
  • the second coding principle the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
  • the first coding rule is determined according to any one of a first coding principle, a second coding principle, and a third coding principle;
  • the third coding principle is that the entropy coding mode of each bit in the binarized character string is an equal probability coding mode.
  • the foregoing method also includes:
  • the preset execution condition is: a condition for indicating that the prediction transform accuracy of the target coding tree unit CTU to which the target CTB belongs is low;
  • the step of determining the target binarized character string corresponding to the target SAO type according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule is performed.
  • the foregoing step of determining whether the preset execution condition is met includes:
  • the target image is an image in which the target CTU is located.
  • the foregoing step of determining, according to the target image, whether the preset execution condition is met includes:
  • the target image is an intra prediction image
  • the quantization parameter used by the target image is greater than the first preset threshold
  • the header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
  • the target image is not a bidirectional predicted image.
  • the foregoing step of determining whether the preset execution condition is met includes:
  • Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
  • the step of determining whether the preset execution condition is met, according to at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs includes:
  • All prediction units in the target CTU are intra prediction units
  • the quantization parameter used by the target CTU is greater than a second preset threshold
  • the average size of all transform units in the target CTU is less than a third preset threshold
  • the average size of all coding units in the target CTU is less than a fourth predetermined threshold.
  • the foregoing step of determining whether the preset execution condition is met includes:
  • Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
  • the first coding rule determined according to the first coding principle includes:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized string is based on the context model. the way.
  • the first coding rule determined according to the first coding principle includes:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
  • the first coding rule determined according to the first coding principle includes:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each binarized string, the first bit of the binarized string.
  • the coding mode is equal probability coding.
  • the binarized character string further includes the second bit, the coding mode of the second bit of the binarized character string is based on the context model. .
  • the first coding rule determined according to the second coding principle includes:
  • the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is based on the context model. the way.
  • an embodiment of the present application provides a method for decoding an SAO type, where the method includes:
  • the target SAO type corresponding to the target binarized character string is determined according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule.
  • the first decoding rule is determined according to any one of the following decoding principles:
  • the first decoding principle the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
  • the second decoding principle the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy decoding method for distinguishing the bits corresponding to the encoded binarized character string respectively for the EO mode and the BO mode is based on The way the context model is decoded.
  • the first decoding rule is determined according to any one of a first decoding principle, a second decoding principle, and a third decoding principle;
  • the third decoding principle is that the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode.
  • the encoded binarized string recorded in the foregoing first decoding rule according to the preset further includes:
  • the preset execution condition being: indicating the prediction transformation accuracy of the target coding tree unit CTU to which the target CTB belongs Low condition
  • entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule If the entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule is performed, entropy decoding the encoded target binarized character string corresponding to the target coding tree block CTB is performed. The step of the target binarizing the string.
  • the foregoing step of determining whether the preset execution condition is met includes:
  • the target image is an image in which the target CTU is located.
  • the foregoing step of determining, according to the target image, whether the preset execution condition is met includes:
  • the target image is an intra prediction image
  • the quantization parameter used by the target image is greater than the first preset threshold
  • the header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
  • the target image is not a bidirectional predicted image.
  • the foregoing step of determining whether the preset execution condition is met includes:
  • Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
  • the step of determining whether the preset execution condition is met, according to at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs includes:
  • All prediction units in the target CTU are intra prediction units
  • the quantization parameter used by the target CTU is greater than a second preset threshold
  • the average size of all transform units in the target CTU is less than a third preset threshold
  • the average size of all coding units in the target CTU is less than a fourth predetermined threshold.
  • the foregoing step of determining whether the preset execution condition is met includes:
  • Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
  • the first decoding rule determined according to the first decoding principle includes:
  • Decoding rules the binarized strings corresponding to EO mode, skip mode and BO mode are 0, 10, 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model The way to decode.
  • the first decoding rule determined according to the first decoding principle includes:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
  • the first decoding rule determined according to the first decoding principle includes:
  • Decoding rules the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each encoded binarized string, the encoded binary string is
  • the decoding mode of one bit is a method of equal probability decoding, and in the case where the encoded binarized character string further includes the second bit, the decoding of the second bit of the encoded binarized character string
  • the mode is a context model based decoding method.
  • the first decoding rule determined according to the second decoding principle includes:
  • Decoding rules the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model. The way to decode.
  • an SAO type encoding apparatus where the apparatus includes:
  • a first determining module configured to: according to the target SAO type of the target coding tree block CTB, according to the correspondence between each SAO type and the binarized character string recorded in the preset first coding rule, Determining a target binarized character string corresponding to the target SAO type, wherein the first encoding rule records a correspondence between each SAO type and the binarized character string, and an entropy encoding mode of the binarized character string;
  • An entropy coding module configured to perform entropy coding on a target binarized character string according to an entropy coding manner of the binarized character string recorded in the first coding rule, to obtain an encoding result corresponding to the target SAO type;
  • the first coding rule is determined according to any one of the following coding principles:
  • the first coding principle the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
  • the second coding principle the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
  • the first coding rule is determined according to any one of a first coding principle, a second coding principle, and a third coding principle;
  • the third coding principle is that the entropy coding mode of each bit in the binarized character string is an equal probability coding mode.
  • the foregoing apparatus further includes:
  • a first determining module configured to determine whether a preset execution condition is met after determining a target SAO type of the target coding tree block CTB, where the preset execution condition is: a prediction used to indicate a target coding tree unit CTU to which the target CTB belongs a condition with low conversion accuracy;
  • the first determining module is specifically configured to:
  • the target binarization corresponding to the target SAO type is determined according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule. String.
  • the foregoing first determining module is specifically configured to:
  • the target image is an image in which the target CTU is located.
  • the foregoing first determining module is specifically configured to:
  • the target image is an intra prediction image
  • the quantization parameter used by the target image is greater than the first preset threshold
  • the header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
  • the target image is not a bidirectional predicted image.
  • the foregoing first determining module is specifically configured to:
  • Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
  • the foregoing first determining module is specifically configured to:
  • All prediction units in the target CTU are intra prediction units
  • the quantization parameter used by the target CTU is greater than a second preset threshold
  • the average size of all transform units in the target CTU is less than a third preset threshold
  • the average size of all coding units in the target CTU is less than a fourth predetermined threshold.
  • the foregoing first determining module is specifically configured to:
  • Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
  • the first coding rule determined according to the first coding principle includes:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized string is based on the context model. the way.
  • the first coding rule determined according to the first coding principle includes:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
  • the first coding rule determined according to the first coding principle includes:
  • the binarized strings corresponding to EO mode, skip mode, and BO mode are 0, respectively. 10, 11; and for each binarized string, the first bit of the binarized string is encoded in an equal probability encoding manner, and the binarized string further includes a second bit In the case of the second bit of the binarized character string, the encoding method based on the context model is used.
  • the first coding rule determined according to the second coding principle includes:
  • the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is based on the context model. the way.
  • an embodiment of the present application provides a decoding apparatus of the SAO type, where the apparatus includes:
  • An entropy decoding module configured to entropy decode the encoded target binarized character string corresponding to the target coding tree block CTB according to an entropy decoding manner of the encoded binarized character string recorded in the preset first decoding rule, Obtaining a target binarized character string; wherein the first decoding rule records an entropy decoding manner of the encoded binarized character string, and a correspondence relationship between each SAO type and the binarized character string;
  • the second determining module is configured to determine, according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule, the target SAO type corresponding to the target binarized character string.
  • the first decoding rule is determined according to any one of the following decoding principles:
  • the first decoding principle the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
  • the second decoding principle the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy decoding method for distinguishing the bits corresponding to the encoded binarized character string respectively for the EO mode and the BO mode is based on The way the context model is decoded.
  • the first decoding rule is determined according to any one of a first decoding principle, a second decoding principle, and a third decoding principle;
  • the third decoding principle is that the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode.
  • the foregoing apparatus further includes:
  • a second determining module configured to determine, according to the target binarized character string corresponding to the target coding tree block CTB, whether the preset execution condition is met, and the preset execution condition is: used to represent the target CTB a condition that the prediction transform accuracy of the associated target coding tree unit CTU is low;
  • the above entropy decoding module is specifically configured to:
  • the target coded tree block corresponding to the target coding tree block CTB is encoded.
  • the valued string is entropy decoded to obtain the target binarized string.
  • the foregoing second determining module is specifically configured to: determine, according to the target image, whether the preset execution condition is met; wherein the target image is an image in which the target CTU is located.
  • the foregoing second determining module is specifically configured to:
  • the target image is an intra prediction image
  • the quantization parameter used by the target image is greater than the first preset threshold
  • the header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
  • the target image is not a bidirectional predicted image.
  • the foregoing second determining module is specifically configured to:
  • Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
  • the foregoing second determining module is specifically configured to:
  • All prediction units in the target CTU are intra prediction units
  • the quantization parameter used by the target CTU is greater than a second preset threshold
  • the average size of all transform units in the target CTU is less than a third preset threshold
  • the average size of all coding units in the target CTU is less than a fourth predetermined threshold.
  • the foregoing second determining module is specifically configured to:
  • Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is met; otherwise, It is determined that the preset execution condition is not satisfied.
  • the first decoding rule determined according to the first decoding principle includes:
  • Decoding rules the binarized strings corresponding to EO mode, skip mode and BO mode are 0, 10, 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model The way to decode.
  • the first decoding rule determined according to the first decoding principle includes:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
  • the first decoding rule determined according to the first decoding principle includes:
  • Decoding rules the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each encoded binarized string, the encoded binary string is
  • the decoding mode of one bit is a method of equal probability decoding, and in the case where the encoded binarized character string further includes the second bit, the decoding of the second bit of the encoded binarized character string
  • the mode is a context model based decoding method.
  • the first decoding rule determined according to the second decoding principle includes:
  • Decoding rules the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model. The way to decode.
  • an encoder including a first processor and a first memory, where
  • a first memory for storing a computer program
  • the first processor is configured to implement the method steps described in any of the SAO type encoding methods when executing the program stored on the first memory.
  • an embodiment of the present application provides a decoder, including a second processor and a second memory, where
  • a second memory for storing a computer program
  • the second processor is configured to implement any of the above SAOs when executing the program stored on the second memory Type of decoding method described method steps.
  • the embodiment of the present application provides a computer readable storage medium, where the computer readable storage medium stores a computer program, and when the computer program is executed by the processor, implements the coding method of any of the above SAO types. Method steps.
  • the embodiment of the present application provides another computer readable storage medium, where the computer readable storage medium stores a computer program, and when the computer program is executed by the processor, the decoding method of any of the above SAO types is implemented. Method steps.
  • an embodiment of the present application provides a computer program product comprising instructions, when executed on a computer, causing a computer to perform the method steps described in any of the above-described SAO type encoding methods.
  • the embodiment of the present application provides another computer program product comprising instructions, which when executed on a computer, causes the computer to perform the method steps described in any of the above SAO type decoding methods.
  • an embodiment of the present application provides a computer program that, when run on a computer, causes the computer to perform the method steps described in any of the SAO-type encoding methods described above.
  • an embodiment of the present application provides a computer program that, when run on a computer, causes the computer to perform the method steps described in any of the SAO-type decoding methods described above.
  • the first coding principle the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
  • the second coding principle the EO mode and the BO mode respectively correspond to the same length of the binarized character string; And the entropy coding method for distinguishing the bits corresponding to the binarized character strings respectively in the EO mode and the BO mode is a context model based coding mode.
  • the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to two.
  • the entropy coding result of the valued string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode is much more probable than the BO mode.
  • the probability even when it is greater than the use probability of the skip mode; the scheme provided by the embodiment of the present application can improve the video coding efficiency when the first coding rule determined according to the first coding principle performs the coding of the SAO type.
  • the encoder When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode.
  • the compression ratio is high, so when the first encoding rule determined by the second coding principle is used to perform the SAO type encoding, the solution provided by the embodiment of the present application can also improve the video encoding efficiency.
  • 1 is a general frame diagram of a video codec corresponding to the latest video coding standard HEVC;
  • FIG. 2 is a frame diagram of an interface interface of the SAO decoding end in the latest video coding standard HEVC;
  • FIG. 3 is a schematic diagram of four different sets of adjacent pixels of the EO mode in the SAO of the latest video coding standard HEVC;
  • FIG. 4 is a schematic diagram of a merge mode in the SAO in the latest video coding standard HEVC;
  • FIG. 5 is a schematic flowchart of a coding method of an SAO type according to an embodiment of the present disclosure
  • FIG. 6 is a schematic flowchart of a coding method of an SAO type according to another embodiment of the present disclosure.
  • FIG. 7 is a schematic flowchart of a method for decoding an SAO type according to an embodiment of the present disclosure
  • FIG. 8 is a schematic flowchart of a method for decoding an SAO type according to another embodiment of the present disclosure.
  • FIG. 9 is a schematic flowchart of an SAO type encoding apparatus according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic flowchart of an SAO type encoding apparatus according to another embodiment of the present disclosure.
  • FIG. 11 is a schematic flowchart of a SAO type decoding apparatus according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic flowchart of a SAO type decoding apparatus according to another embodiment of the present disclosure.
  • FIG. 13 is a schematic structural diagram of an encoder according to an embodiment of the present disclosure.
  • FIG. 14 is a schematic structural diagram of a decoder according to an embodiment of the present application.
  • Video coding also known as video compression, is designed to eliminate redundant information that exists between video signals.
  • video compression is designed to eliminate redundant information that exists between video signals.
  • the mainstream video coding standards use a hybrid coding framework based on block-based prediction and transformation.
  • Figure 1 shows the video corresponding to the latest video coding standard HEVC.
  • the overall frame diagram of the codec the input video signal is processed by coding techniques such as block structure division, prediction, transform, quantization, entropy coding, etc., and finally the bit stream is output.
  • a video encoder divides a video frame into blocks for encoding, such as an H.264/AVC (Advanced Video Coding) video coding standard, which divides a video frame into equal parts.
  • Small 16x16 macroblocks (Macro Block, MB) are not covered by each other, while HEVC divides the video frame into uniform equal-sized Coding Tree Units (CTUs).
  • the size of the CTU can be in the encoder configuration file. Set in the middle, usually in 64 x 64 size.
  • HEVC supports dividing the coding tree unit into smaller coding units (CUs) according to the quadtree structure, and the 64 ⁇ 64 CTU can be divided into four 32 ⁇ 32 CUs of the same size.
  • a 32x32 CU can be quadruple divided into four 16x16 CUs or not divided, and so on until the minimum allowed CU size is divided.
  • the CU is a basic unit of coding, and is generally a 2N ⁇ 2N block, and the size does not exceed the size of the CTU.
  • the size of the CU may be 8 ⁇ 8, 16 ⁇ 16, 32 ⁇ 32, 64 ⁇ 64, and the like.
  • the CU may be divided into prediction units (PUs) of different sizes and different shapes, and the prediction unit PU is a basic unit of prediction, and the size of the prediction unit cannot exceed the size of the CU where the CU is located.
  • the CU can also be recursively divided into transform units (TUs) of different sizes for transforming the residual block obtained after the prediction.
  • the TU is the basic unit of the transform, and the size of the TU cannot exceed the size of the CU.
  • the size is 4 ⁇ 4, 8 ⁇ 8, 16 ⁇ 16, 32 ⁇ 32, and the like.
  • the video sequence image is first divided into equal-sized CTUs, and the CTU can be divided into different sizes of CUs.
  • the encoder is coded in units of CU, and then divided into different PUs based on the CU.
  • the prediction is performed in units of PUs, and the prediction block is obtained.
  • the prediction block is compared with the original block to obtain a prediction residual block, and the prediction residual block is transformed to obtain a transform coefficient block, and then a one-dimensional array input quantization is formed by a specific scanning manner.
  • the scalar quantization is performed, and finally the quantized coefficients are input to the entropy encoder to be encoded to form a final code stream.
  • the encoded video sequence reconstructed frame/block will be used as a reference frame/block for subsequent frames so that it results in a more accurate prediction block with inter/intra prediction.
  • the reconstructed data obtained from the original data and the predicted, transformed, quantized, inverse quantized and inverse transformed may have certain errors, which causes distortion of the final reconstructed video.
  • In-loop filtering such as De-block Filter (DF) and SAO can effectively reduce distortion and improve subjective/objective quality.
  • FIG. 2 is a frame diagram of the SAO decoding end interface in the latest video coding standard HEVC, and the input is the deblocked filtered data of the reconstructed data and the SAO decoded by the entropy decoder. Information, the output is the final reconstructed signal (input to the reference frame list buffer for subsequent Video frame reference).
  • the syntax element sample_adaptive_offset_enabled_flag in the Sequence Parameter Set is true, and the syntax elements slice_sao_luma_flag and slice_sao_chroma_flag in the slice-level header information are true.
  • the SAO type in the HEVC standard, is identified by sao_type_idx, and the SAO type includes three types: skip mode, EO mode, and BO mode. It is well known to those skilled in the art that a CTU includes a luma coding tree block and a plurality of chroma coding tree blocks. Therefore, in the video encoding and decoding process, the encoding and decoding of the SAO type performed by the encoder and the decoder can be understood as Editing and decoding the luma coding tree block and each chroma coding tree block in the CTU.
  • the encoder may encode a tree block for the luma of the CTU, and select the SAO type of the luma coding tree block with the least cost penalty from the three SAO types; if the CTU has a chroma component (That is, the color space format is not 4:0:0), then the SAO type of the chroma coding tree block is selected in the same manner, and if there are multiple chroma components, the SAO type decision selection needs to be separately performed.
  • the EO mode is a process of calculating a suitable offset value offset according to the relationship between adjacent pixels in the CTB and the current pixel, and applying the calculated offset value to the current pixel.
  • the specific operation mode is as follows: EO mode is usually The current pixel is compared with a set of adjacent pixels, and according to the relationship between the current pixel and the adjacent pixel shown in Table 1, the current pixel is divided into five different types, wherein a group of adjacent pixels (a, b) The selection method is as shown in FIG. 3, where a and b respectively represent adjacent pixels, and c represents the current pixel.
  • the current pixel of the class will not be c has any operations; if the other four cases are satisfied, an offset value is assigned to each class and added to the current pixel c. Also, for classes 1 and 2, the offset value offset must be a positive integer, and for the 3rd and 4th classes, the offset value offset must be a negative integer to avoid encoding the offset sign bit resulting in an increase in the coded bits.
  • Table 1 EO mode pixel classification mapping table
  • the BO mode classifies all pixel values according to the size of all pixel values in the CTB, and sets an appropriate offset value for each class, and finally applies the offset value to the pixels of the corresponding category.
  • the specific operation mode is as follows: BO All pixels of different sizes are divided into 32 bands that are not inter-interleaved, that is, each band contains corresponding 8 pixel values, similar to a statistical histogram, and the range of the first band containing values belongs to [0, 7] 8 pixels, and so on, the 32nd band contains values of 8 pixels belonging to [248, 255].
  • the offset offset is calculated as follows: Calculate the average value R of all the pixels in each band after the CTB is divided into 32 bands before entering the SAO and the average of all the pixels in each band after the CTB original pixel is divided into 32 bands.
  • the value S, the offset value is (SR).
  • FIG. 4 is a schematic diagram of a merge mode in a SAO in the latest video coding standard HEVC.
  • the merge mode refers to an SAO parameter including a CTU that is inherited and used, including SAO parameters of the luma coding tree unit and all chroma coding.
  • the SAO parameter of the tree unit may be used to determine whether to adopt the SAO merge mode, including sao_merge_left_flag (left merge mode) and sao_merge_up_flag (up merge mode).
  • embodiments of the present application provide an encoding and decoding method, apparatus, encoder, decoder, and storage medium.
  • an SAO type encoding method provided by an embodiment of the present application may be applied to an encoder.
  • the encoder may be a physical device, and may also be a video encoding function.
  • the program is reasonable, and the embodiment of the present application does not limit the specific form of the encoder.
  • an embodiment of the present application provides an SAO type encoding method, where the method includes:
  • S101 After determining the target SAO type of the target coding tree block CTB, determining the target corresponding to the target SAO type according to the correspondence between each SAO type and the binarized character string recorded in the preset first coding rule. a valued string in which each SAO is recorded in the first encoding rule The correspondence between the type and the binarized string, and the entropy encoding of the binarized string.
  • a CTU may include a luma coding tree block and a plurality of chroma coding tree blocks. Therefore, the target coding tree block CTB described in this embodiment may be either a luma coding tree block or a chroma. Encoding tree blocks, this is all reasonable. In addition, the target CTB does not specifically refer to a CTB, and any CTB in the video sequence image may be used as the target CTB.
  • the above-described correspondence relationship includes the binarized character strings corresponding to the skip mode, the EO mode, and the BO mode, respectively.
  • the correspondence relationship is a correspondence relationship table.
  • the binarized strings corresponding to the skip mode, the EO mode, and the BO mode are: a binarized string x, a binarized string y, and The binarized character string z; in this case, assuming that the target SAO type determined above is the EO mode, the target binarized character string can be determined as the binarized character string y according to the correspondence relationship table.
  • the entropy coding manner of the binarized character string recorded in the first coding rule can be understood as a specific entropy coding mode adopted by each binarized bit (abbreviated as a bit) in the binarized character string.
  • a bit a specific entropy coding mode adopted by each binarized bit (abbreviated as a bit) in the binarized character string.
  • the coding method based on the context model and the equal-probability coding method are all well-known technologies, and the specific implementation methods of the two coding modes are not described in detail herein. However, it is well known to those skilled in the art that if the bits in the binarized character string are entropy encoded using a context model based coding scheme, the code compression ratio of the bit is high; and if the bits in the binarized string are binarized When the bit is entropy encoded by the equal probability coding method, the coding speed of the bit is high.
  • S102 Entropy coding the target binarized character string according to the entropy coding manner of the binarized character string recorded in the first coding rule, to obtain an encoding result corresponding to the target SAO type.
  • the first coding rule is determined according to any one of the following coding principles:
  • the first coding principle the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
  • the second coding principle the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
  • the first encoding rule in the embodiment of the present application is preset, but does not represent the first encoding.
  • the code rules are randomly set, and the first coding rule needs to be set according to any of the first coding principle and the second coding principle described above.
  • the first encoding rule used in the encoding process of the video is the same.
  • the coding principle used to determine the first coding rule may be information according to a coding parameter of a current image, an encoding parameter of a current coding unit (for example, an encoding parameter of a current coding CTU), and the like in a video coding process. And selecting the first coding principle and the second coding principle, and then determining the specific rule content of the first coding rule according to the selected coding principle, so that when the encoder encodes the SAO type in the video coding process, The first coding rule adopted is more flexible and is more conducive to improving video coding efficiency.
  • the binarized character strings respectively corresponding to the skip mode, the EO mode, and the BO mode are selected among the three binarized strings of 0, 10, and 11, and of course, It can be selected in the three binary strings of 1, 00, and 01.
  • the first coding principle stipulates that the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode, that is, the EO mode corresponds to
  • the length of the binarized string is less than the length of the binarized string corresponding to the BO mode, or the length of the binarized string corresponding to the EO mode is less than the length of the binarized string corresponding to the BO mode.
  • the length of the binarized character string may be the number of bits of the bit string included in the binarized character string. For example, the binarized character string corresponding to the skip mode and the EO mode is 0, 10, respectively, due to the binarized character.
  • the bit number of the string 10 is greater than the binarized character string 0, and the length of the binarized character string corresponding to the EO mode is smaller than the length of the binarized character string corresponding to the skip mode.
  • the first coding principle only limits the correspondence between each SAO type and the binarized character string, and the entropy coding manner of the binary string is not limited, so different codes determined according to the first coding principle are used.
  • the same bit in the binarized character string is set to be entropy encoded by the equal probability coding method, and some bits are set to be entropy coded by the context model based coding mode.
  • the first coding rule determined according to the first coding principle may be:
  • Coding rules the binarized strings corresponding to EO mode, skip mode and BO mode are 0, 10, 11 respectively; and the entropy coding mode of each bit of the binarized string is based on the context model The encoding method.
  • each SAO type and the binarized character string recorded in the first encoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively. 11;
  • the entropy coding mode of the recorded binarized character string is: the entropy coding mode of each bit of the binarized character string is a coding mode based on a context model.
  • the encoder determines, according to the above correspondence, that the binarized character string corresponding to the EO mode is 0, and then uses the context-based model for the binarized character string 0.
  • the encoding method is entropy encoded to obtain the encoding result corresponding to the EO mode.
  • the encoder determines, according to the above correspondence, that the binary character string corresponding to the BO mode is 11, and then the first bit in the binarized character string 11 Bit 1, using the context model based coding method for entropy coding; for the second bit 1 in the binarized character string 11, the entropy coding is also performed by using the context model based coding method, and finally the BO mode is correspondingly obtained.
  • the entropy coding is also performed by using the context model based coding method, and finally the BO mode is correspondingly obtained.
  • the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codeword, that is, the encoder can perform the EO mode.
  • the compression ratio of the SAO type is high. The inventors have found through a large number of experiments that the probability of using the EO mode is much larger than that of the BO mode in the video coding process, and even greater than the use probability of the skip mode in some cases. Therefore, when the SAO type encoding is performed according to the first encoding rule in this implementation manner, the video encoding efficiency can be improved.
  • the entropy coding mode of each bit of the binarized character string is based on the context model coding mode, and the coding ratio of the coding performed by the encoder on various SAO types is high, thereby further improving the video coding efficiency.
  • the first coding rule determined according to the first coding principle may also be:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
  • each SAO type and the binarized character string recorded in the first encoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are respectively 0, 10, 11;
  • the entropy coding mode of the recorded binarized character string is: the entropy coding mode of each bit of the binarized character string is a method of equal probability coding.
  • the encoder determines, according to the above correspondence, that the binarized character string corresponding to the EO mode is 0, and then uses the equal probability coding for the binarized character string 0.
  • the entropy coding is performed to obtain the coding result corresponding to the EO mode.
  • the encoder determines, according to the above correspondence, that the binary character string corresponding to the BO mode is 11, and then the first bit in the binarized character string 11 Bit 1, using entropy coding based on equal probability coding; for the second bit 1 in the binarized character string 11, the entropy coding is also performed by means of equal probability coding, and finally the coding corresponding to the BO mode is obtained. result.
  • the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codeword, that is, the encoder can perform the EO mode.
  • the SAO type encodes a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than the BO mode, and sometimes even greater than the skip mode. Therefore, according to this implementation When the first encoding rule performs SAO type encoding, video encoding efficiency can be improved.
  • the entropy coding mode of each bit of the binarized character string is an encoding method of equal probability coding, and the encoding speed of the encoder for various SAO types is fast, so according to this implementation manner
  • the video encoding speed can also be improved.
  • the first coding rule determined according to the first coding principle may also be:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each binarized string, the first bit of the binarized string.
  • the coding mode is equal probability coding.
  • the binarized character string further includes the second bit, the coding mode of the second bit of the binarized character string is based on the context model. .
  • the correspondence between each SAO type and the binarized character string recorded in the first encoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively. , 11; the entropy encoding of the recorded binarized string is: for each binarized character a string, the first bit of the binarized string is encoded in an equal probability encoding manner, and in the case where the binarized string further includes a second bit, the second digit of the binary string The encoding of the two bits is based on the context model.
  • the encoder determines, according to the above correspondence, that the binarized character string corresponding to the EO mode is 0, and then uses the equal probability coding for the binarized character string 0.
  • the entropy coding is performed to obtain the coding result corresponding to the EO mode.
  • the encoder determines, according to the above correspondence, that the binary character string corresponding to the skip mode is 10, and then the first one of the binarized character strings 10 Bit 1 is entropy encoded by means of equal probability coding; for the second bit 0 in the binarized string 10, entropy coding is performed using a context model based coding method, and finally a skip mode is obtained. Corresponding coding result.
  • the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codeword, that is, the encoder can perform the EO mode.
  • the SAO type encodes a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than the BO mode, and sometimes even greater than the skip mode. Therefore, according to this implementation When the first encoding rule performs SAO type encoding, video encoding efficiency can be improved.
  • the first coding rule determined according to the foregoing first coding principle is not limited to the foregoing three implementation manners, and may be other first coding rules.
  • the first encoding rule determined according to the first encoding principle may also be:
  • Encoding rules the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 11, and 10, respectively; and for each binarized string, the first bit of the binarized string.
  • the coding mode is a context model based coding mode.
  • the coding mode of the second bit of the binarized character string is an equal probability coding mode. .
  • the first encoding rule determined according to the first encoding principle may also be:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 11, and 10, respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
  • the second coding principle stipulates that the EO mode and the BO mode respectively have the same length of the binarized character string; and are used to distinguish the EO mode and the BO mode respectively corresponding to the bits of the binarized character string.
  • the entropy coding method is a coding method based on a context model.
  • the entropy coding mode for distinguishing the bits corresponding to the binarized character string respectively of the EO mode and the BO mode is a context model based coding mode, and the encoder pair
  • the coding ratios of the two types of SAOs, the EO mode and the BO mode, are high, so that the SAO type coding method is performed by using the first coding rule determined according to the second coding principle, and the video coding efficiency can be improved.
  • the first coding rule determined according to the second coding principle may be:
  • the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is based on the context model. the way.
  • each SAO type and the binarized character string recorded in the first encoding rule is: the binarized character strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, respectively.
  • the entropy coding mode of the binarized character string recorded in 11 is: the entropy coding mode of each bit of the binarized character string is a coding mode based on a context model.
  • the encoder determines, according to the above correspondence, that the binarized character string corresponding to the EO mode is 11, and then the first one of the binarized character strings 1
  • the bit 1 and the first bit 1 are both entropy encoded using a context model based coding method to obtain an encoding result corresponding to the EO mode.
  • the encoder determines, according to the above correspondence, that the binary character string corresponding to the skip mode is 10, and then the first one of the binarized character strings 1 is The bit 1 and the first bit 0 are both entropy encoded using a context model based coding method to obtain a coding result corresponding to the BO mode.
  • the first coding rule determined according to the foregoing second coding principle is not limited to the foregoing implementation manner, and may be other first coding rules.
  • the first encoding rule determined according to the second encoding principle may also be:
  • Encoding rules the binarized strings corresponding to skip mode, BO mode, and EO mode are respectively 0, 11, 10; and the entropy coding mode of each bit of the binarized character string is based on the context model.
  • the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to two.
  • the entropy coding result of the valued string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode is much more probable than the BO mode.
  • the probability even when it is greater than the use probability of the skip mode; the scheme provided by the embodiment of the present application can improve the video coding efficiency when the first coding rule determined according to the first coding principle performs the coding of the SAO type.
  • the encoder When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode.
  • the compression ratio is high, so when the first encoding rule determined by the second coding principle is used to perform the SAO type encoding, the solution provided by the embodiment of the present application can also improve the video encoding efficiency.
  • the first coding rule may be determined according to any one of a first coding principle, a second coding principle, and a third coding principle;
  • the third coding principle is that the entropy coding mode of each bit in the binarized character string is an equal probability coding mode.
  • the coding principle for determining the first coding rule may be pre-selected, or may be selected in real time according to the coding parameters in the video coding process, which is reasonable, and the embodiment of the present application is here.
  • the selection of the coding principle for determining the first coding rule is not limited.
  • the third coding principle only limits the entropy coding mode of the binarized character string, and the correspondence relationship between each SAO type and the binarized character string is not limited.
  • the first coding rule determined according to the third coding principle may be:
  • Encoding rules the binarized strings corresponding to skip mode, BO mode, and EO mode are respectively 0, 10, 11; and the entropy coding mode of each bit of the binarized character string is an equal probability coding mode.
  • each SAO type and the binarized character string recorded in the first encoding rule is: the binarized character strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, respectively. 11;
  • the entropy coding mode of the recorded binarized character string is: the entropy coding mode of each bit of the binarized character string is an equal probability coding mode.
  • the encoder determines, according to the above correspondence, that the binarized character string corresponding to the EO mode is 11, and then the first bit of the binarized character string 11 Bit 1 and the second bit 1 are both entropy encoded using an equal probability coding method to obtain an encoding result corresponding to the EO mode.
  • the first coding rule determined according to the first coding principle may also be:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
  • each SAO type and the binarized character string recorded in the first encoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively. 11;
  • the entropy coding mode of the recorded binarized character string is: the entropy coding mode of each bit of the binarized character string is a method of equal probability coding.
  • the encoder determines, according to the above correspondence, that the binarized character string corresponding to the EO mode is 0, and then uses the equal probability coding for the binarized character string 0.
  • the entropy coding is performed to obtain the coding result corresponding to the EO mode.
  • the encoder determines, according to the above correspondence, that the binary character string corresponding to the BO mode is 11, and then the first bit in the binarized character string 11 Bit 1, using entropy coding based on equal probability coding; for the second bit 1 in the binarized character string 11, the entropy coding is also performed by means of equal probability coding, and finally the coding corresponding to the BO mode is obtained. result.
  • the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codeword, that is, the encoder can perform the EO mode.
  • the SAO type encodes a high compression ratio; since the video coding process, the EO mode The usage probability of the formula is much larger than the usage probability of the BO mode, and is sometimes greater than the use probability of the skip mode; therefore, when the first encoding rule in this implementation manner performs the SAO type encoding, the video encoding efficiency can be improved.
  • the entropy coding mode of each bit of the binarized character string is an encoding method of equal probability coding, and the encoding speed of the encoder for various SAO types is fast, so according to this implementation manner
  • the video encoding speed can also be improved.
  • the first coding rule determined according to the foregoing third coding principle is not limited to the foregoing two implementation manners, and may be other first coding rules.
  • the first encoding rule determined according to the third encoding principle may also be:
  • the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 11, and 10, respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding mode.
  • the entropy coding mode of each bit in the binarized character string is an equal probability coding mode
  • the SAO type coding process does not Using any context model can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
  • the target SAO type is determined according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule.
  • the above method can also be packaged before the step of the corresponding target binarization string include:
  • the preset execution condition is: a condition for indicating that the prediction transform accuracy of the target coding tree unit CTU to which the target CTB belongs is low;
  • the step of determining the target binarized character string corresponding to the target SAO type according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule is performed.
  • the first coding rule may be determined according to the first coding principle or the second coding principle, or may be determined according to any one of the first to third coding principles.
  • the foregoing SAO type encoding method includes:
  • the preset execution condition is: indicating that the prediction transform accuracy of the target coding tree unit CTU to which the target CTB belongs is low. condition.
  • the encoder may perform the determination according to different information, and then determine whether the preset execution condition is met.
  • the step of determining whether the preset execution condition is met may include :
  • the target image is an image in which the target CTU is located.
  • the above target CTU is in the target image, so some image information of the target image can represent that the prediction transform accuracy of the target CTU is low.
  • the step of determining whether the preset execution condition is met based on the target image may include:
  • the target image is an intra prediction image
  • the quantization parameter used by the target image is greater than the first preset threshold
  • the header information of the target image carries target identifier information, where the target identifier information indicates
  • the SAO type corresponding to all CTBs in the target image needs identification information that is encoded according to the foregoing first coding rule;
  • the target image is not a bidirectional predicted image.
  • the target image is an intra prediction image, that is, the target image is an I frame.
  • the quantization parameter used by the target image is greater than the first preset threshold. It can be understood that the quantization parameter used by the target image is used by the encoder in performing the quantization operation on the target image.
  • the first preset threshold may be preset based on actual conditions, for example, the first preset threshold is set to 25.
  • the header information of the target image carries the target identification information. It can be understood that the header information of the target image is additionally provided with a flag bit, which is used to identify whether the SAO type corresponding to all CTBs in the image needs to be in accordance with the
  • the information encoded by an encoding rule indicates that the SAO type corresponding to all CTBs in the image needs to be encoded according to the first encoding rule.
  • the corresponding identification information can be set according to a preset rule.
  • the target image is not a bi-predictive image, that is, the target image is not a B frame, and may be an I frame or a P frame.
  • the encoder finds that the target image is an intra prediction image, it can directly determine that the preset execution condition is satisfied.
  • the step of determining whether the preset execution condition is met may include:
  • Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
  • the encoder may use only the quantization information of the target CTU itself to determine whether the preset execution condition is met, or may use only the prediction information of the target CTU itself to determine whether the preset execution condition is met, or may only utilize the transformation of the target CTU itself.
  • the information is used to determine whether the preset execution condition is met; and any combination of the quantized information, the predicted information, and the transformed information of the target CTU itself can be used to determine whether the preset execution condition is satisfied.
  • the step of determining whether the preset execution condition is met is performed according to at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
  • All prediction units in the target CTU are intra prediction units
  • the quantization parameter used by the target CTU is greater than a second preset threshold, for example, the quantization parameter used by the target CTU is greater than 30;
  • the average size of all transform units in the target CTU is smaller than a third preset threshold, for example, the average size of all transform units in the target CTU is less than 8 ⁇ 8;
  • the average size of all coding units in the target CTU is less than a fourth predetermined threshold, for example, the average size of all coding units in the target CTU is less than 16 ⁇ 16.
  • the encoder finds that the quantization parameter used by the target CTU is 40, it can directly determine that the preset execution condition is satisfied.
  • the step of determining whether the preset execution condition is met may include:
  • Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
  • the encoder can know the loop filtering strength value when performing deblocking filtering on the target CTU, for example, the fifth preset threshold is 1.
  • the encoder directly determines that the preset execution condition is satisfied when the loop filter strength value when the target CTU is found to perform deblocking filtering is greater than one.
  • step S202 is performed to determine the target binarized character corresponding to the target SAO type according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule. a string, wherein the first encoding rule records a correspondence between each SAO type and a binarized character string, and an entropy encoding manner of the binarized character string.
  • the encoder may not encode the target CTB according to the first coding rule set in the embodiment of the present application, and may directly follow the coding rules specified in the existing HEVC standard.
  • the target CTB is encoded.
  • S203 Entropy coding the target binarized character string according to the entropy coding manner of the binarized character string recorded in the first coding rule, to obtain an encoding result corresponding to the target SAO type.
  • the first coding rule is determined according to any one of the following coding principles:
  • the first coding principle the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
  • the second coding principle the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
  • steps S202 and S203 are the same as the steps S101 and S102 in the method embodiment shown in FIG. 5, and the related content and explanation of the steps S202 and S203 can be referred to the method embodiment shown in FIG. The example is not described in detail here.
  • the embodiment of the present application further provides a decoding method of the SAO type.
  • the decoding method can be applied to a decoder.
  • the decoder can be an entity.
  • the device may also be a program that can implement the video decoding function, which is reasonable.
  • the embodiment of the present application does not limit the specific form of the decoder.
  • the decoding method includes:
  • S301 Entropy decoding the encoded target binarized character string corresponding to the target coding tree block CTB according to an entropy decoding manner of the encoded binarized character string recorded in the preset first decoding rule, to obtain a target binary value.
  • the first decoding rule records an entropy decoding manner of the encoded binarized character string, and a correspondence between each SAO type and the binarized character string.
  • the target binarized character string corresponding to the target CTB that can be obtained by the decoder that is, the target SAO type involved in the method embodiment of the foregoing SAO type decoding method is corresponding.
  • the result of the encoding is corresponding.
  • the entropy decoding mode of the encoded binarized character string recorded in the first decoding rule can be understood as: the specific entropy decoding method used by each bit in the encoded binarized character string. formula. There are two types of decoding methods for each of the above bits: a context model based decoding method and an equal probability decoding method.
  • the decoding method based on the context model and the equal-probability decoding method are all well-known technologies, and the specific implementation methods of the two decoding methods are not described in detail herein. However, it is well known to those skilled in the art that if the bits in the encoded binarized character string are entropy decoded using a context model based decoding method, the decoding efficiency of the bit is high; and if the binarized string is encoded The bit in the bit is entropy decoded by the equal probability decoding method, and the decoding speed of the bit is high.
  • S302 Determine, according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule, the target SAO type corresponding to the target binarized character string.
  • the first decoding rule is determined according to any one of the following decoding principles:
  • the first decoding principle the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
  • the second decoding principle the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy decoding method for distinguishing the bits corresponding to the encoded binarized character string respectively for the EO mode and the BO mode is based on The way the context model is decoded.
  • the first decoding rule in the embodiment of the present application is also preset, but does not mean that the first decoding rule is randomly set, and the first decoding rule needs to be in accordance with the foregoing first decoding principle and the second decoding principle. Any one of them is set. Moreover, when any one video is decoded after the first decoding rule is set, the first decoding rule used in the decoding process of the video is the same.
  • the decoding principle used to determine the first decoding rule may be: according to the encoding parameter of the current image, the encoding parameter of the current coding unit, and the like in the video decoding process, from the foregoing first decoding principle. And selecting the second decoding principle, and then determining the specific rule content of the first decoding rule according to the selected decoding principle.
  • the first decoding rule applied by the encoder and the first decoding applied by the decoder may be preset. Corresponding to the rules.
  • the first decoding principle specifies that the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode; that is, the EO mode corresponds to The length of the binarized string is less than the length of the binarized string corresponding to the BO mode.
  • the length of the binary string corresponding to the degree or the EO mode is smaller than the length of the binarized string corresponding to the BO mode.
  • the first decoding principle only limits the correspondence between each SAO type and the binarized character string, and the entropy decoding manner of the encoded binary string is not limited, so it is determined according to the first decoding principle.
  • the same bit in the binarized string is set, and some bits are set to be entropy decoded by equal probability decoding, and some bits are set to be entropy decoded by using a context model based decoding method. .
  • the first decoding rule determined according to the first decoding principle may be:
  • Decoding rules the binarized strings corresponding to EO mode, skip mode and BO mode are 0, 10, 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model The way to decode.
  • each SAO type and the binarized character string recorded in the first decoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively.
  • the entropy decoding mode of the recorded binarized character string is: the entropy decoding mode of each bit of the binarized character string is a decoding mode based on the context model.
  • the decoder first performs entropy decoding on the two bits in the encoded binarized character string by using a context model based decoding manner to obtain a target binarized character string 11; Then, according to the above correspondence, it is determined that the SAO type corresponding to the target binarized character string 11 is the BO mode.
  • the first encoding rule corresponding to the first decoding rule is:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized string is based on the context model. the way.
  • the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode is The codeword is less, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the EO mode is more likely to be used in the video encoding process than the BO mode, even larger than Skip mode usage probability; so the first encoding rule performs SAO When coding of a type, video coding efficiency can be improved.
  • the entropy coding mode of each bit of the binarized character string is a coding mode based on a context model, and the coding ratio of the coding performed by the encoder on various SAO types is high. Further improve the video coding efficiency.
  • the first decoding rule determined according to the first decoding principle may also be:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
  • each SAO type and the binarized character string recorded in the first decoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively.
  • the entropy decoding mode of the recorded binarized character string is as follows: the entropy coding mode of each bit of the encoded binarized character string is a method of equal probability decoding.
  • the decoder first performs entropy decoding on the two bits in the encoded binarized character string by using a context model based decoding manner to obtain a target binarized character string 10 Then, according to the above correspondence, it is determined that the SAO type corresponding to the target binarized character string 10 is the skip mode.
  • the first encoding rule corresponding to the first decoding rule is:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
  • the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode is The codeword is less, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the EO mode is more likely to be used in the video encoding process than the BO mode, even larger than The probability of use of the skip mode; therefore, when the SAO type encoding is performed according to the first encoding rule in this implementation manner, the video encoding efficiency can be improved.
  • the entropy encoding mode of each bit of the binarized character string is an encoding method of equal probability encoding, and the encoding speed of the encoder for various SAO types is fast, so according to this Implementer
  • the first encoding rule under the formula performs SAO type encoding, the video encoding speed can also be improved.
  • the first decoding rule determined according to the first decoding principle may also be:
  • Decoding rules the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each encoded binarized string, the encoded binary string is
  • the decoding mode of one bit is a method of equal probability decoding, and in the case where the encoded binarized character string further includes the second bit, the decoding of the second bit of the encoded binarized character string
  • the mode is a context model based decoding method.
  • the correspondence between each SAO type and the binarized character string recorded in the first decoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively.
  • the entropy decoding manner of the recorded binarized character string is: for each binarized character string, the decoding manner of the first bit of the binarized character string is a method of equal probability decoding, In the case where the binarized character string further includes the second bit, the encoding mode of the second bit of the binarized character string is a context model based decoding mode.
  • the decoder finds that the encoded binary string has only one bit, and firstly uses the equal probability decoding method for the bits in the encoded binarized string. Entropy decoding obtains the target binarized string 0; then, according to the above correspondence, it is determined that the SAO type corresponding to the target binarized string 0 is the EO mode.
  • the first encoding rule corresponding to the first decoding rule is:
  • Encoding rules the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 11, and 10, respectively; and for each binarized string, the first bit of the binarized string.
  • the coding mode is a context model based coding mode.
  • the coding mode of the second bit of the binarized character string is an equal probability coding mode. .
  • the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode is The codeword is less, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the EO mode is more likely to be used in the video encoding process than the BO mode, even larger than Skip mode usage probability; so follow the first in this implementation
  • the encoding rule performs the encoding of the SAO type, the video encoding efficiency can be improved.
  • the first decoding rule determined according to the foregoing first decoding principle is not limited to the foregoing three implementation manners, and may be other first decoding rules.
  • the first decoding rule determined according to the first decoding principle may also be:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 11, and 10, respectively; and for each of the encoded binarized strings, the encoded binary string is
  • the decoding mode of one bit is a context mode based decoding mode, and in the case where the encoded binarized character string further includes a second bit, the second bit of the encoded binarized character string
  • the decoding method is a method of equal probability decoding.
  • the first decoding rule determined according to the first decoding principle may also be:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 11, and 10, respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
  • the second decoding principle stipulates that the EO mode and the BO mode respectively have the same length of the binarized character string; and are used to distinguish the EO mode and the BO mode respectively corresponding to the bits of the encoded binary string.
  • the entropy decoding mode of the bit is a decoding method based on the context model.
  • the first decoding rule corresponding to the first decoding principle is used to distinguish the EO mode and the BO mode respectively corresponding to the binarized character string.
  • the entropy coding method is a coding mode based on the context model, and the encoder has a high compression ratio for the coding of the two types of SAOs, the EO mode and the BO mode, so that the coding method of the SAO type according to the first coding rule can be improved. Video coding efficiency.
  • the first decoding rule determined according to the second decoding principle may be:
  • Decoding rules the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model. The way to decode.
  • the decoder first performs entropy decoding on the two bits in the encoded binarized character string by using a context model based decoding manner to obtain a target binarized character string 10 Then, according to the above correspondence, the target binarization string 10 is determined.
  • the corresponding SAO type is BO mode.
  • the first encoding rule corresponding to the first decoding rule is:
  • the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is based on the context model. the way.
  • the first decoding rule determined according to the foregoing second decoding principle is not limited to the foregoing implementation manner, and may be other first decoding rules.
  • the first decoding rule determined according to the second decoding principle may also be:
  • Decoding rules the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 11, and 10, respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model. The way to decode.
  • the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, because the solution provided by the embodiment of the present application
  • the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codeword, that is, the first coding rule applied to match the first decoding rule.
  • the encoder can encode the SAO type of EO mode with a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than that of the BO mode, and sometimes even greater than the skip mode. Probability; Therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the solution provided by the embodiment of the present application can improve the video coding efficiency.
  • the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, which is used in the solution provided by the embodiment of the present application.
  • the entropy coding method for distinguishing the bits of the binarized character string corresponding to the EO mode and the BO mode respectively is a coding mode based on the context model, so the encoder pair is used to distinguish the EO mode and the BO mode respectively corresponding to the binarized character string.
  • the compression ratio of the entropy coding performed by the bit is high, that is, the compression ratio of the encoding of the two types of SAOs of the EO mode and the BO mode is high, so the scheme provided by the embodiment of the present application can also improve the video coding efficiency.
  • the first decoding rule It may also be determined according to any one of the first decoding principle, the second decoding principle, and the third decoding principle;
  • the third decoding principle is that the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode.
  • the decoding principle for determining the first decoding rule may be pre-selected, or may be selected in real time according to the encoding parameters in the video decoding process, which is reasonable, and the embodiment of the present application is This does not limit the way in which the decoding principles for determining the first decoding rule are determined.
  • the first decoding rule determined according to the third decoding principle may be:
  • Decoding rules the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. the way.
  • the decoder first performs entropy decoding on the two bits in the encoded binarized character string by using an equal probability decoding manner to obtain a target binarized character string 10; According to the above correspondence, it is determined that the SAO type corresponding to the target binarized character string 10 is the BO mode.
  • the first encoding rule corresponding to the first decoding rule is:
  • the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding mode.
  • the first decoding rule determined according to the first decoding principle may also be:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
  • each SAO type and the binarized character string recorded in the first decoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively.
  • the entropy coding mode of the recorded binarized character string is as follows: the entropy coding mode of each bit of the coded binarized character string is a method of equal probability decoding.
  • the decoder first targets the encoded binarized word.
  • the two bits in the character string are entropy decoded by using the context model based decoding method to obtain the target binarized character string 10; then, according to the above correspondence, the SAO type corresponding to the target binarized character string 10 is determined as Skip mode.
  • the first encoding rule corresponding to the first decoding rule is:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
  • the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode is The codeword is less, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the EO mode is more likely to be used in the video encoding process than the BO mode, even larger than The probability of use of the skip mode; therefore, when the SAO type encoding is performed according to the first encoding rule in this implementation manner, the video encoding efficiency can be improved.
  • the entropy encoding mode of each bit of the binarized character string is an encoding method of equal probability encoding, and the encoding speed of the encoder for various SAO types is fast, so according to this
  • the first encoding rule in the implementation mode performs the SAO type encoding, the video encoding speed can also be improved.
  • the first decoding rule determined according to the foregoing third decoding principle is not limited to the foregoing two implementation manners, and may be other first decoding rules.
  • the first decoding rule determined according to the third decoding principle may also be:
  • Encoding rules the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 11, and 10, respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. the way.
  • the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode
  • SAO The type decoding process does not use any context model, which saves the decoder's operation of updating the context model and the buffering cost, ensures the low complexity of the decoder, and speeds up the video decoding speed.
  • the encoder performs SAO type encoding by using the first encoding rule matched with the first decoding rule, binarization
  • the entropy coding mode of each bit in the string is an equal probability coding mode.
  • the SAO type coding process does not use any context model, which can save the operation of the encoder update context model and the buffer cost, and ensure the encoder. Low complexity while speeding up video encoding.
  • the target coded tree block corresponding to the target coding tree block CTB is encoded.
  • the method further includes:
  • the preset execution condition being: indicating the prediction transformation accuracy of the target coding tree unit CTU to which the target CTB belongs Low condition
  • entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule If the entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule is performed, entropy decoding the encoded target binarized character string corresponding to the target coding tree block CTB is performed. The step of the target binarizing the string.
  • the first decoding rule may be determined according to the first decoding principle or the second decoding principle, or may be determined according to any one of the first to third decoding principles.
  • the foregoing SAO type decoding method includes:
  • the preset execution condition is a condition for indicating that the prediction conversion accuracy of the target coding tree unit CTU to which the target CTB belongs is low.
  • the encoder can judge according to different information, and then determine whether the preset execution condition is met, and the information according to the encoder is usually present in the video bitstream, so the decoder can also be based on the The different information described is judged to determine whether the preset execution condition is satisfied.
  • the step of determining whether the preset execution condition is met may include:
  • the target image is an image in which the target CTU is located.
  • the step of determining whether the preset execution condition is met based on the target image may include:
  • the target image is an intra prediction image
  • the quantization parameter used by the target image is greater than the first preset threshold
  • the header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
  • the target image is not a bidirectional predicted image.
  • the step of determining whether the preset execution condition is met may include:
  • Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
  • the step of determining whether the preset execution condition is met, according to at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs may include:
  • All prediction units in the target CTU are intra prediction units
  • the quantization parameter used by the target CTU is greater than a second preset threshold
  • the average size of all transform units in the target CTU is less than a third preset threshold
  • the average size of all coding units in the target CTU is less than a fourth predetermined threshold.
  • the step of determining whether the preset execution condition is met may include:
  • Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
  • step S402 is executed: the target binary value corresponding to the target coding tree block CTB is encoded according to the entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule. Entropy decoding of the character string to obtain a target binarized character string; wherein, the first decoding rule records an entropy decoding mode of the encoded binarized character string, and a correspondence relationship between each SAO type and the binarized character string;
  • the decoder may not decode the encoded binary string according to the first decoding rule set in the embodiment of the present application, which may directly follow the existing HEVC standard.
  • the decoding rule specified in the decoding of the encoded binarized character string may directly follow the existing HEVC standard.
  • S403 Determine, according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule, the target SAO type corresponding to the target binarized character string.
  • the first decoding rule is determined according to any one of the following decoding principles:
  • the first decoding principle the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
  • the second decoding principle the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy decoding method for distinguishing the bits corresponding to the encoded binarized character string respectively for the EO mode and the BO mode is based on The way the context model is decoded.
  • steps S402 and S403 are respectively the same as the steps S301 and S302 in the method embodiment shown in FIG. 7.
  • the related content and explanation of the steps S402 and S403 can be referred to the method embodiment shown in FIG. The example is not described in detail here.
  • the embodiment of the present application provides an SAO type encoding device.
  • the device includes:
  • the first determining module 510 is configured to determine, according to the target SAO type of the target coding tree block CTB, the target SAO according to the correspondence between each SAO type and the binarized character string recorded in the preset first coding rule. a target binarized character string corresponding to the type, wherein the first encoding rule records a correspondence between each SAO type and the binarized character string, and an entropy encoding mode of the binarized character string;
  • the entropy coding module 520 is configured to perform entropy coding on the target binarized character string according to the entropy coding manner of the binarized character string recorded in the first coding rule, to obtain an encoding result corresponding to the target SAO type;
  • the first coding rule is determined according to any one of the following coding principles:
  • the first coding principle the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
  • the second coding principle the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
  • the first coding rule may be determined according to any one of a first coding principle, a second coding principle, and a third coding principle;
  • the third coding principle is that the entropy coding mode of each bit in the binarized character string is an equal probability coding mode.
  • the foregoing apparatus may further include:
  • the first determining module 530 is configured to determine whether the preset execution condition is met after the target SAO type of the target coding tree block CTB is determined, where the preset execution condition is: used to indicate the target coding tree unit CTU to which the target CTB belongs Predicting the condition that the transformation accuracy is low;
  • the first determining module 510 can be specifically configured to:
  • the target binary value corresponding to the target SAO type is determined according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule. String.
  • the foregoing first determining module 530 may be specifically configured to:
  • the target image is an image in which the target CTU is located.
  • the foregoing first determining module 530 may be specifically configured to:
  • the target image is an intra prediction image
  • the quantization parameter used by the target image is greater than the first preset threshold
  • the header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
  • the target image is not a bidirectional predicted image.
  • the foregoing first determining module 530 may be specifically configured to:
  • Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
  • the foregoing first determining module 530 may be specifically configured to:
  • All prediction units in the target CTU are intra prediction units
  • the quantization parameter used by the target CTU is greater than a second preset threshold
  • the average size of all transform units in the target CTU is less than a third preset threshold
  • the average size of all coding units in the target CTU is less than a fourth predetermined threshold.
  • the foregoing first determining module 530 may be specifically configured to:
  • Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
  • the first coding rule determined according to the first coding principle may include:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized string is based on the context model. the way.
  • the first coding rule determined according to the first coding principle may include:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
  • the first coding rule determined according to the first coding principle may include:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each binarized string, the first bit of the binarized string.
  • the coding mode is equal probability coding.
  • the binarized character string further includes the second bit, the coding mode of the second bit of the binarized character string is based on the context model. .
  • the first coding rule determined according to the second coding principle may include:
  • the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is based on the context model. the way.
  • the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to two.
  • the entropy coding result of the valued string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode
  • the usage probability of the formula is much larger than the usage probability of the BO mode, and is even greater than the use probability of the skip mode in some cases; therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the embodiment of the present application provides The solution can improve the efficiency of video coding.
  • the encoder When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode.
  • the compression ratio is high, so when the first encoding rule determined by the second coding principle is used to perform the SAO type encoding, the solution provided by the embodiment of the present application can also improve the video encoding efficiency.
  • the entropy coding mode of each bit in the binarized character string is an equal probability coding mode, and the SAO type coding process is performed.
  • the use of no context model can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
  • the embodiment of the present application provides a SAO type decoding apparatus.
  • the decoding apparatus includes:
  • the entropy decoding module 610 is configured to perform entropy decoding on the encoded target binarized character string corresponding to the target coding tree block CTB according to the entropy decoding manner of the encoded binarized character string recorded in the preset first decoding rule. Obtaining a target binarized character string; wherein, the first decoding rule records an entropy decoding manner of the encoded binarized character string, and a correspondence relationship between each SAO type and the binarized character string;
  • the second determining module 620 is configured to determine, according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule, the target SAO type corresponding to the target binarized character string.
  • the first decoding rule is determined according to any one of the following decoding principles:
  • the first decoding principle the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
  • the second decoding principle the EO mode and the BO mode respectively have the same length of the binarized character string; and are used to distinguish the EO mode and the BO mode respectively corresponding to the bits of the encoded binarized character string
  • the entropy decoding method is a decoding method based on a context model
  • the first decoding rule may be determined according to any one of a first decoding principle, a second decoding principle, and a third decoding principle;
  • the third decoding principle is that the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode.
  • the foregoing decoding apparatus may further include:
  • the second judging module 630 is configured to determine, according to the target binarized character string corresponding to the target coding tree block CTB, whether the preset execution condition is met, and the preset execution condition is: indicating the target coding tree to which the target CTB belongs a condition that the prediction conversion accuracy of the unit CTU is low;
  • the entropy decoding module 610 may be specifically configured to:
  • the target target corresponding to the target coding tree block CTB is encoded.
  • the binarized string is entropy decoded to obtain the target binarized string.
  • the foregoing second determining module 630 may be specifically configured to:
  • the target image is an image in which the target CTU is located.
  • the foregoing second determining module 630 may be specifically configured to:
  • the target image is an intra prediction image
  • the quantization parameter used by the target image is greater than the first preset threshold
  • the header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
  • the target image is not a bidirectional predicted image.
  • the foregoing second determining module 630 may be specifically configured to:
  • Quantization information and prediction information based on the target coding tree unit CTU of the target CTB At least one of the transformation information is used to determine whether the preset execution condition is satisfied.
  • the foregoing second determining module 630 may be specifically configured to:
  • All prediction units in the target CTU are intra prediction units
  • the quantization parameter used by the target CTU is greater than a second preset threshold
  • the average size of all transform units in the target CTU is less than a third preset threshold
  • the average size of all coding units in the target CTU is less than a fourth predetermined threshold.
  • the foregoing second determining module 630 may be specifically configured to:
  • Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
  • the first decoding rule determined according to the first decoding principle may include:
  • Decoding rules the binarized strings corresponding to EO mode, skip mode and BO mode are 0, 10, 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model The way to decode.
  • the first decoding rule determined according to the first decoding principle may include:
  • the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
  • the first decoding rule determined according to the first decoding principle may include:
  • Decoding rules the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each encoded binarized string, the encoded binary string is
  • the decoding mode of one bit is a method of equal probability decoding, and in the case where the encoded binarized character string further includes the second bit, the decoding of the second bit of the encoded binarized character string the way It is a context model based decoding method.
  • the first decoding rule determined according to the second decoding principle may include:
  • Decoding rules the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model. The way to decode.
  • the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, because the solution provided by the embodiment of the present application
  • the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codeword, that is, the first coding rule applied to match the first decoding rule.
  • the encoder can encode the SAO type of EO mode with a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than that of the BO mode, and sometimes even greater than the skip mode. Probability; Therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the solution provided by the embodiment of the present application can improve the video coding efficiency.
  • the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, which is used in the solution provided by the embodiment of the present application.
  • the entropy coding method for distinguishing the bits of the binarized character string corresponding to the EO mode and the BO mode respectively is a coding mode based on the context model, so the encoder pair is used to distinguish the EO mode and the BO mode respectively corresponding to the binarized character string.
  • the compression ratio of the entropy coding performed by the bit is high, that is, the compression ratio of the encoding of the two types of SAOs of the EO mode and the BO mode is high, so the scheme provided by the embodiment of the present application can also improve the video coding efficiency.
  • the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode, and the SAO type decoding process is performed.
  • the use of no context model does not save the decoder's operation of updating the context model and the buffering cost, ensuring low complexity of the decoder while speeding up video decoding.
  • the encoder performs SAO type encoding by using the first encoding rule matched with the first decoding rule, binarization
  • the entropy coding mode of each bit in the string is an equal probability coding method.
  • the SAO type encoding process does not use any context model, which can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
  • the embodiment of the present application further provides an encoder, as shown in FIG. 13, including a first processor 710 and a first memory 720, wherein
  • a first memory 720 configured to store a computer program
  • the target binarization corresponding to the target SAO type is determined according to the correspondence between each SAO type and the binarized character string recorded in the preset first coding rule. a string, wherein the first encoding rule records a correspondence between each SAO type and a binarized string, and an entropy encoding manner of the binarized string;
  • the first coding rule is determined according to any one of the following coding principles:
  • the first coding principle the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
  • the second coding principle the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
  • the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to the binary value.
  • the entropy coding result of the character string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode usage probability is much larger than the BO mode usage probability. Even at times when it is larger than the skip mode The probability of the video coding efficiency can be improved by the scheme provided by this embodiment when the first coding rule determined by the first coding principle is used for the coding of the SAO type.
  • the encoder When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode.
  • the compression ratio is high, so when the first coding rule determined by the second coding principle is used to perform the SAO type coding, the solution provided by this embodiment can also improve the video coding efficiency.
  • the entropy coding mode of each bit in the binarized character string is an equal probability coding mode, and the SAO type coding process is performed.
  • the use of no context model can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
  • the embodiment of the present application further provides a decoder, as shown in FIG. 14, including a second processor 810 and a second memory 820, wherein
  • a second memory 820 configured to store a computer program
  • the second processor 810 is configured to perform the following steps when executing the program stored on the second memory 820:
  • the target SAO type corresponding to the target binarized character string is determined according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule.
  • the first decoding rule is determined according to any one of the following decoding principles:
  • the first decoding principle the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
  • the second decoding principle the EO mode and the BO mode respectively correspond to the length of the binarized string
  • the entropy decoding method for distinguishing the bits corresponding to the encoded binary string respectively in the EO mode and the BO mode is a context model based decoding mode.
  • the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, because the solution provided by this embodiment is The length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codewords, that is, the first coding rule applied to match the first decoding rule.
  • the encoder can encode the SAO type of the EO mode with a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than that of the BO mode, and sometimes even greater than the skip mode. Therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the solution provided by this embodiment can improve the video coding efficiency.
  • the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, and the scheme provided in this embodiment is used to distinguish
  • the entropy coding mode of the bit corresponding to the binarized character string in the EO mode and the BO mode is the context mode-based coding mode, so the encoder pairs the bits corresponding to the binarized character string for distinguishing the EO mode and the BO mode, respectively.
  • the compression ratio of the entropy coding performed by the bit is high, that is, the coding ratio of the coding performed by the AO mode and the BO mode is high, so the scheme provided by this embodiment can also improve the video coding efficiency.
  • the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode
  • the SAO type is in the decoding process.
  • the encoder performs SAO type encoding by using the first encoding rule matched with the first decoding rule, binarization
  • the entropy coding mode of each bit in the string is an equal probability coding mode.
  • the SAO type coding process does not use any context model, which can save the operation of the encoder update context model and the buffer cost, and ensure the encoder. Low complexity while speeding up the video Coding speed.
  • Both the encoder and the decoder described above may be provided with a communication interface for realizing communication between the above self and other devices.
  • the above-mentioned processor, communication interface, and memory complete communication with each other through a communication bus.
  • the communication bus mentioned here may be a Peripheral Component Interconnect (PCI) bus or an extended industry standard structure (Extended Industry) Standard Architecture, EISA) bus, etc.
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • the communication bus can be divided into an address bus, a data bus, a control bus, and the like.
  • the memory may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.
  • RAM random access memory
  • NVM non-volatile memory
  • the memory may also be at least one storage device located away from the aforementioned processor.
  • the above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or may be a digital signal processing (DSP), dedicated integration.
  • CPU central processing unit
  • NP network processor
  • DSP digital signal processing
  • ASIC Application Specific Integrated Circuit
  • FPGA Field-Programmable Gate Array
  • the embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium stores a computer program, and the computer program is implemented by the processor to implement the foregoing.
  • the method steps described for any SAO type encoding method are described for any SAO type encoding method.
  • the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to the binary value.
  • the entropy coding result of the character string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode usage probability is much larger than the BO mode usage probability. Even when it is greater than the use probability of the skip mode, the scheme provided by this embodiment can improve the video coding efficiency when the first coding rule determined according to the first coding principle performs the coding of the SAO type.
  • the encoder When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode.
  • the compression ratio is high, so when the first coding rule determined by the second coding principle is used to perform the SAO type coding, the solution provided by this embodiment can also improve the video coding efficiency.
  • the entropy coding mode of each bit in the binarized character string is an equal probability coding mode, and the SAO type coding process is performed.
  • the use of no context model can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
  • the embodiment of the present application provides another computer readable storage medium, where the computer readable storage medium stores a computer program, and the computer program is implemented by the processor to implement the foregoing.
  • the method steps described in the decoding method of any SAO type are described in the decoding method of any SAO type.
  • the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, because the solution provided by this embodiment is The length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codewords, that is, the first coding rule applied to match the first decoding rule.
  • the encoder can encode the SAO type of the EO mode with a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than that of the BO mode, and sometimes even greater than the skip mode. Therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the solution provided by this embodiment can improve the video coding efficiency.
  • the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, and the scheme provided in this embodiment is used to distinguish
  • the entropy coding method corresponding to the bits of the binarized character string in the EO mode and the BO mode respectively is the coding mode based on the context model, so the encoder pair is used to distinguish the EO mode and
  • the compression ratio of the entropy coding of the bit corresponding to the binarized character string is high, that is, the coding ratio of the coding of the two types of SAOs of the EO mode and the BO mode is high, so the present embodiment provides The scheme can also improve the video coding efficiency.
  • the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode
  • the SAO type is in the decoding process.
  • the encoder performs SAO type encoding by using the first encoding rule matched with the first decoding rule, binarization
  • the entropy coding mode of each bit in the string is an equal probability coding mode.
  • the SAO type coding process does not use any context model, which can save the operation of the encoder update context model and the buffer cost, and ensure the encoder. Low complexity while speeding up video encoding.
  • the embodiment of the present application provides a computer program product including instructions, when it is run on a computer, causing the computer to execute the coding method of any of the above SAO types. Method steps.
  • the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to the binary value.
  • the entropy coding result of the character string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode usage probability is much larger than the BO mode usage probability. Even when it is greater than the use probability of the skip mode, the scheme provided by this embodiment can improve the video coding efficiency when the first coding rule determined according to the first coding principle performs the coding of the SAO type.
  • the encoder When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode. The compression ratio is high, so according to the second coding principle When the first coding rule is used to perform the coding of the SAO type, the solution provided by this embodiment can also improve the video coding efficiency.
  • the entropy coding mode of each bit in the binarized character string is an equal probability coding mode, and the SAO type coding process is performed.
  • the use of no context model can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
  • the embodiment of the present application provides another computer program product including instructions, when it is run on a computer, causing the computer to perform the decoding method of any of the above SAO types. Method steps.
  • the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, because the solution provided by this embodiment is The length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codewords, that is, the first coding rule applied to match the first decoding rule.
  • the encoder can encode the SAO type of the EO mode with a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than that of the BO mode, and sometimes even greater than the skip mode. Therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the solution provided by this embodiment can improve the video coding efficiency.
  • the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, and the scheme provided in this embodiment is used to distinguish
  • the entropy coding mode of the bit corresponding to the binarized character string in the EO mode and the BO mode is the context mode-based coding mode, so the encoder pairs the bits corresponding to the binarized character string for distinguishing the EO mode and the BO mode, respectively.
  • the compression ratio of the entropy coding performed by the bit is high, that is, the coding ratio of the coding performed by the AO mode and the BO mode is high, so the scheme provided by this embodiment can also improve the video coding efficiency.
  • the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode, and the SAO type
  • the encoder performs SAO type encoding by using the first encoding rule matched with the first decoding rule, binarization
  • the entropy coding mode of each bit in the string is an equal probability coding mode.
  • the SAO type coding process does not use any context model, which can save the operation of the encoder update context model and the buffer cost, and ensure the encoder. Low complexity while speeding up video encoding.
  • the embodiment of the present application provides a computer program that, when run on a computer, causes the computer to execute the method steps described in any of the above-described SAO type encoding methods.
  • the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to the binary value.
  • the entropy coding result of the character string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode usage probability is much larger than the BO mode usage probability. Even when it is greater than the use probability of the skip mode, the scheme provided by this embodiment can improve the video coding efficiency when the first coding rule determined according to the first coding principle performs the coding of the SAO type.
  • the encoder When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode.
  • the compression ratio is high, so when the first coding rule determined by the second coding principle is used to perform the SAO type coding, the solution provided by this embodiment can also improve the video coding efficiency.
  • the entropy coding mode of each bit in the binarized character string is an equal probability coding mode, and the SAO type coding process is performed.
  • No context model is used, which saves the encoder update context model Operation and buffer cost ensure low complexity of the encoder and speed up video encoding.
  • the embodiment of the present application provides a computer program that, when run on a computer, causes the computer to execute the method steps described in any of the SAO-type decoding methods described above.
  • the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, because the solution provided by this embodiment is The length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codewords, that is, the first coding rule applied to match the first decoding rule.
  • the encoder can encode the SAO type of the EO mode with a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than that of the BO mode, and sometimes even greater than the skip mode. Therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the solution provided by this embodiment can improve the video coding efficiency.
  • the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, and the scheme provided in this embodiment is used to distinguish
  • the entropy coding mode of the bit corresponding to the binarized character string in the EO mode and the BO mode is the context mode-based coding mode, so the encoder pairs the bits corresponding to the binarized character string for distinguishing the EO mode and the BO mode, respectively.
  • the compression ratio of the entropy coding performed by the bit is high, that is, the coding ratio of the coding performed by the AO mode and the BO mode is high, so the scheme provided by this embodiment can also improve the video coding efficiency.
  • the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode
  • the SAO type is in the decoding process.
  • the encoder performs SAO type encoding by using the first encoding rule matched with the first decoding rule, binarization
  • the entropy coding mode of each bit in the string is an equal probability coding method.
  • the SAO type encoding process does not use any context model, which can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
  • the various embodiments in the present specification are described in a related manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments.
  • the embodiments of the apparatus, the encoder, the decoder, the computer readable storage medium, the computer program product containing the instructions, and the computer program are relatively simple and relevant in that they are substantially similar to the method embodiment. See the partial description of the method embodiment.

Landscapes

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

Abstract

A coding and decoding method and apparatus, a coder, a decoder, and a storage medium. The method comprises: in an SAO-type coding process, firstly, determining a binary character string corresponding to the SAO type according to a first coding rule, and then, performing entropy coding on the binary character string to obtain the entropy coding result, the first coding rule being determined according to any one of the following coding principles: the first coding principle: the length of the binary character string corresponding to an EO mode being smaller than at least one of the length of the binary character string corresponding to the BO mode and the length of the binary character string corresponding to a skip mode; and a second coding principle: the length of a binary character string corresponding to the EO mode being equal to the length of a binary character string corresponding to the BO mode, and an entropy coding manner of corresponding bits used for distinguishing the EO mode and the BO mode being a coding manner based on a context model.

Description

编码和解码方法、装置、编码器、解码器及存储介质Encoding and decoding method, device, encoder, decoder and storage medium 技术领域Technical field
本申请涉及视频编码技术领域,特别是涉及SAO类型的编码和解码方法、装置、编码器、解码器及存储介质。The present application relates to the field of video coding technologies, and in particular, to an SAO type coding and decoding method, apparatus, encoder, decoder, and storage medium.
背景技术Background technique
SAO(Sample Adaptive Offset,样本自适应补偿)是在高效率视频编码标准(High Efficiency Video Coding,HEVC)中提出的一种新型的环内滤波技术,其目的是在尽可能减少降低压缩性能的前提下,增加像素补偿而减少原始图像与重构图像之间的失真,从而提升压缩后视频的视觉质量。SAO (Sample Adaptive Offset) is a new type of in-loop filtering technology proposed in High Efficiency Video Coding (HEVC), which aims to minimize the reduction of compression performance. Next, the pixel compensation is increased to reduce the distortion between the original image and the reconstructed image, thereby improving the visual quality of the compressed video.
为了获得更好的编码性能,在视频编码过程中需要选择合适的SAO类型,SAO类型包括:跳过模式、EO(Edge Offset,边缘补偿)模式和BO(Band Offset,带状补偿)模式。由于一个CTU(Coding Tree Unit,编码树单元)包括一个亮度编码树块和若干个色度编码树块,因此,相关技术中针对CTU所进行的SAO类型的编码,可以理解为对CTU内每个编码树块(CTB,Coding Tree Block)所进行的编码。In order to obtain better coding performance, it is necessary to select an appropriate SAO type in the video encoding process. The SAO types include: skip mode, EO (Edge Offset) mode, and BO (Band Offset) mode. Since a CTU (Coding Tree Unit) includes a luma coding tree block and a plurality of chroma coding tree blocks, the coding of the SAO type for the CTU in the related art can be understood as each of the CTUs. Coding performed by a coding tree block (CTB, Coding Tree Block).
在目前的HEVC标准下,编码器决策出某CTB所应用的SAO类型后,需要对所决策出的SAO类型进行编码,再将编码后的SAO类型添加到视频码流中。但即使相关技术中对SAO类型进行了编码,相关技术中依然存在视频编码效率低的问题。Under the current HEVC standard, after the encoder determines the SAO type applied by a CTB, it needs to encode the determined SAO type, and then add the encoded SAO type to the video code stream. However, even if the SAO type is encoded in the related art, there is still a problem that the video coding efficiency is low in the related art.
发明内容Summary of the invention
本申请提供了一种编码和解码方法、装置、编码器、解码器及存储介质,以提高视频编码效率。The application provides an encoding and decoding method, device, encoder, decoder and storage medium to improve video encoding efficiency.
为达上述目的,第一方面,本申请实施例提供了一种SAO类型的编码方法,该方法包括:To achieve the above objective, in a first aspect, an embodiment of the present application provides an SAO type encoding method, where the method includes:
在决策出目标编码树块CTB的目标SAO类型后,按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标SAO类型所对应的目标二值化字符串,其中,第一编码规则中记录有各SAO类型与二 值化字符串的对应关系,以及二值化字符串的熵编码方式;After the target SAO type of the target coding tree block CTB is determined, the target binarization corresponding to the target SAO type is determined according to the correspondence between each SAO type and the binarized character string recorded in the preset first coding rule. a string in which the first encoding rule records each SAO type and two The correspondence between the valued strings and the entropy encoding of the binarized strings;
按照第一编码规则中记录的二值化字符串的熵编码方式,对目标二值化字符串进行熵编码,得到目标SAO类型所对应的编码结果;Entropy coding the target binarized character string according to the entropy coding manner of the binarized character string recorded in the first coding rule, and obtaining the coding result corresponding to the target SAO type;
其中,该第一编码规则为按照下述编码原则中的任一种所确定的:Wherein the first coding rule is determined according to any one of the following coding principles:
第一编码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first coding principle: the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
第二编码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式。The second coding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
可选的,该第一编码规则为按照第一编码原则、第二编码原则以及第三编码原则中的任一种所确定的;Optionally, the first coding rule is determined according to any one of a first coding principle, a second coding principle, and a third coding principle;
该第三编码原则为:二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式。The third coding principle is that the entropy coding mode of each bit in the binarized character string is an equal probability coding mode.
可选的,在上述按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标SAO类型所对应的目标二值化字符串的步骤之前,上述方法还包括:Optionally, before the step of determining the target binarized character string corresponding to the target SAO type according to the corresponding relationship between each SAO type and the binarized character string recorded in the preset first encoding rule, the foregoing method Also includes:
在决策出目标编码树块CTB的目标SAO类型后,判断是否满足预设执行条件,该预设执行条件为:用于表示目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件;After determining the target SAO type of the target coding tree block CTB, determining whether the preset execution condition is met, the preset execution condition is: a condition for indicating that the prediction transform accuracy of the target coding tree unit CTU to which the target CTB belongs is low;
如果满足,执行上述按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标SAO类型所对应的目标二值化字符串的步骤。If yes, the step of determining the target binarized character string corresponding to the target SAO type according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule is performed.
可选的,上述判断是否满足预设执行条件的步骤,包括:Optionally, the foregoing step of determining whether the preset execution condition is met includes:
基于目标图像判断是否满足预设执行条件;其中,目标图像为上述目标CTU所处的图像。Determining whether the preset execution condition is satisfied based on the target image; wherein the target image is an image in which the target CTU is located.
可选的,上述基于目标图像判断是否满足预设执行条件的步骤,包括:Optionally, the foregoing step of determining, according to the target image, whether the preset execution condition is met, includes:
判断目标图像是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target image meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
该目标图像为帧内预测图像; The target image is an intra prediction image;
该目标图像所使用量化参数大于第一预设阈值;The quantization parameter used by the target image is greater than the first preset threshold;
该目标图像的头信息中携带目标标识信息,其中,目标标识信息为表明该目标图像中所有CTB所对应的SAO类型均需要按照上述第一编码规则进行编码的标识信息;The header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
该目标图像不是双向预测图像。The target image is not a bidirectional predicted image.
可选的,上述判断是否满足预设执行条件的步骤,包括:Optionally, the foregoing step of determining whether the preset execution condition is met includes:
基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件。Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
可选的,上述基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件的步骤,包括:Optionally, the step of determining whether the preset execution condition is met, according to at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs, includes:
判断目标CTB所属目标编码树单元CTU是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target coding tree unit CTU to which the target CTB belongs meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
目标CTU中的所有预测单元均为帧内预测单元;All prediction units in the target CTU are intra prediction units;
目标CTU所使用的量化参数大于第二预设阈值;The quantization parameter used by the target CTU is greater than a second preset threshold;
目标CTU中的所有变换单元的平均大小小于第三预设阈值;The average size of all transform units in the target CTU is less than a third preset threshold;
目标CTU中的所有编码单元的平均大小小于第四预设阈值。The average size of all coding units in the target CTU is less than a fourth predetermined threshold.
可选的,上述判断是否满足预设执行条件的步骤,包括:Optionally, the foregoing step of determining whether the preset execution condition is met includes:
判断在对目标CTB所属的目标编码树单元CTU进行去块滤波时的环路滤波强度值是否大于第五预设阈值;如果大于,判定满足预设执行条件;否则,判定不满足预设执行条件。Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
可选的,按照第一编码原则确定的第一编码规则,包括:Optionally, the first coding rule determined according to the first coding principle includes:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized string is based on the context model. the way.
可选的,按照第一编码原则确定的第一编码规则,包括:Optionally, the first coding rule determined according to the first coding principle includes:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为等概率编码的方式。 Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
可选的,按照第一编码原则确定的第一编码规则,包括:Optionally, the first coding rule determined according to the first coding principle includes:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且针对每一个二值化字符串,该二值化字符串的第一个比特位的编码方式为等概率编码的方式,在该二值化字符串还包括第二个比特位的情况下,该二值化字符串的第二个比特位的编码方式为基于上下文模型的编码方式。Encoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each binarized string, the first bit of the binarized string The coding mode is equal probability coding. When the binarized character string further includes the second bit, the coding mode of the second bit of the binarized character string is based on the context model. .
可选的,按照第二编码原则确定的第一编码规则,包括:Optionally, the first coding rule determined according to the second coding principle includes:
编码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is based on the context model. the way.
第二方面,本申请实施例提供了一种SAO类型的解码方法,该方法包括:In a second aspect, an embodiment of the present application provides a method for decoding an SAO type, where the method includes:
按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到目标二值化字符串;其中,第一解码规则记录有被编码二值化字符串的熵解码方式,以及各SAO类型与二值化字符串的对应关系;Entropy decoding of the target binarized character string corresponding to the target coding tree block CTB according to the entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule, to obtain the target binarized character a string; wherein the first decoding rule records an entropy decoding manner of the encoded binarized character string, and a correspondence between each SAO type and the binarized character string;
按照第一解码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标二值化字符串所对应的目标SAO类型。The target SAO type corresponding to the target binarized character string is determined according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule.
其中,第一解码规则为按照下述解码原则中的任一种所确定的:Wherein, the first decoding rule is determined according to any one of the following decoding principles:
第一解码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first decoding principle: the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
第二解码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应被编码二值化字符串的比特位的熵解码方式为基于上下文模型的解码方式。The second decoding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy decoding method for distinguishing the bits corresponding to the encoded binarized character string respectively for the EO mode and the BO mode is based on The way the context model is decoded.
可选的,第一解码规则为按照第一解码原则、第二解码原则以及第三解码原则中的任一种所确定的;Optionally, the first decoding rule is determined according to any one of a first decoding principle, a second decoding principle, and a third decoding principle;
该第三解码原则为:被编码二值化字符串中的每一个比特位的熵解码方式均为等概率解码方式。The third decoding principle is that the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode.
可选的,在上述按照预设的第一解码规则中记录的被编码二值化字符串 的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到目标二值化字符串的步骤之前,上述方法还包括:Optionally, the encoded binarized string recorded in the foregoing first decoding rule according to the preset The entropy decoding method, before the step of entropy decoding the target binarized character string corresponding to the target coding tree block CTB to obtain the target binarized character string, the method further includes:
针对目标编码树块CTB所对应被编码的目标二值化字符串,判断是否满足预设执行条件,该预设执行条件为:用于表示目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件;Determining whether the preset execution condition is met for the target binarized character string corresponding to the target coding tree block CTB, the preset execution condition being: indicating the prediction transformation accuracy of the target coding tree unit CTU to which the target CTB belongs Low condition
如果满足,执行上述按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到目标二值化字符串的步骤。If the entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule is performed, entropy decoding the encoded target binarized character string corresponding to the target coding tree block CTB is performed. The step of the target binarizing the string.
可选的,上述判断是否满足预设执行条件的步骤,包括:Optionally, the foregoing step of determining whether the preset execution condition is met includes:
基于目标图像判断是否满足预设执行条件;其中,目标图像为目标CTU所处的图像。Determining whether the preset execution condition is satisfied based on the target image; wherein the target image is an image in which the target CTU is located.
可选的,上述基于目标图像判断是否满足预设执行条件的步骤,包括:Optionally, the foregoing step of determining, according to the target image, whether the preset execution condition is met, includes:
判断目标图像是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target image meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
该目标图像为帧内预测图像;The target image is an intra prediction image;
该目标图像所使用量化参数大于第一预设阈值;The quantization parameter used by the target image is greater than the first preset threshold;
该目标图像的头信息中携带目标标识信息,其中,目标标识信息为表明该目标图像中所有CTB所对应的SAO类型均需要按照上述第一编码规则进行编码的标识信息;The header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
该目标图像不是双向预测图像。The target image is not a bidirectional predicted image.
可选的,上述判断是否满足预设执行条件的步骤,包括:Optionally, the foregoing step of determining whether the preset execution condition is met includes:
基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件。Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
可选的,上述基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件的步骤,包括:Optionally, the step of determining whether the preset execution condition is met, according to at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs, includes:
判断目标CTB所属目标编码树单元CTU是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target coding tree unit CTU to which the target CTB belongs meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
目标CTU中的所有预测单元均为帧内预测单元; All prediction units in the target CTU are intra prediction units;
目标CTU所使用的量化参数大于第二预设阈值;The quantization parameter used by the target CTU is greater than a second preset threshold;
目标CTU中的所有变换单元的平均大小小于第三预设阈值;The average size of all transform units in the target CTU is less than a third preset threshold;
目标CTU中的所有编码单元的平均大小小于第四预设阈值。The average size of all coding units in the target CTU is less than a fourth predetermined threshold.
可选的,上述判断是否满足预设执行条件的步骤,包括:Optionally, the foregoing step of determining whether the preset execution condition is met includes:
判断在对目标CTB所属的目标编码树单元CTU进行去块滤波时的环路滤波强度值是否大于第五预设阈值;如果大于,判定满足预设执行条件;否则,判定不满足预设执行条件。Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
可选的,按照第一解码原则确定的第一解码规则,包括:Optionally, the first decoding rule determined according to the first decoding principle includes:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to EO mode, skip mode and BO mode are 0, 10, 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model The way to decode.
可选的,按照第一解码原则确定的第一解码规则,包括:Optionally, the first decoding rule determined according to the first decoding principle includes:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为等概率解码的方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
可选的,按照第一解码原则确定的第一解码规则,包括:Optionally, the first decoding rule determined according to the first decoding principle includes:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且针对每一个被编码二值化字符串,该被编码二值化字符串的第一个比特位的解码方式为等概率解码的方式,在该被编码二值化字符串还包括第二个比特位的情况下,该被编码二值化字符串的第二个比特位的解码方式为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each encoded binarized string, the encoded binary string is The decoding mode of one bit is a method of equal probability decoding, and in the case where the encoded binarized character string further includes the second bit, the decoding of the second bit of the encoded binarized character string The mode is a context model based decoding method.
可选的,按照第二解码原则确定的第一解码规则,包括:Optionally, the first decoding rule determined according to the second decoding principle includes:
解码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model. The way to decode.
第三方面,本申请实施例提供了一种SAO类型的编码装置,该装置包括:In a third aspect, an embodiment of the present application provides an SAO type encoding apparatus, where the apparatus includes:
第一确定模块,用于在决策出目标编码树块CTB的目标SAO类型后,按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系, 确定目标SAO类型所对应的目标二值化字符串,其中,第一编码规则中记录有各SAO类型与二值化字符串的对应关系,以及二值化字符串的熵编码方式;a first determining module, configured to: according to the target SAO type of the target coding tree block CTB, according to the correspondence between each SAO type and the binarized character string recorded in the preset first coding rule, Determining a target binarized character string corresponding to the target SAO type, wherein the first encoding rule records a correspondence between each SAO type and the binarized character string, and an entropy encoding mode of the binarized character string;
熵编码模块,用于按照第一编码规则中记录的二值化字符串的熵编码方式,对目标二值化字符串进行熵编码,得到目标SAO类型所对应的编码结果;An entropy coding module, configured to perform entropy coding on a target binarized character string according to an entropy coding manner of the binarized character string recorded in the first coding rule, to obtain an encoding result corresponding to the target SAO type;
其中,该第一编码规则为按照下述编码原则中的任一种所确定的:Wherein the first coding rule is determined according to any one of the following coding principles:
第一编码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first coding principle: the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
第二编码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式。The second coding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
可选的,第一编码规则为按照第一编码原则、第二编码原则以及第三编码原则中的任一种所确定的;Optionally, the first coding rule is determined according to any one of a first coding principle, a second coding principle, and a third coding principle;
该第三编码原则为:二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式。The third coding principle is that the entropy coding mode of each bit in the binarized character string is an equal probability coding mode.
可选的,上述装置还包括:Optionally, the foregoing apparatus further includes:
第一判断模块,用于在决策出目标编码树块CTB的目标SAO类型后,判断是否满足预设执行条件,上述预设执行条件为:用于表示目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件;a first determining module, configured to determine whether a preset execution condition is met after determining a target SAO type of the target coding tree block CTB, where the preset execution condition is: a prediction used to indicate a target coding tree unit CTU to which the target CTB belongs a condition with low conversion accuracy;
相应的,第一确定模块,具体用于:Correspondingly, the first determining module is specifically configured to:
在第一判断模块的判断结果为是的情况下,按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标SAO类型所对应的目标二值化字符串。When the determination result of the first judging module is yes, the target binarization corresponding to the target SAO type is determined according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule. String.
可选的,上述第一判断模块,具体用于:Optionally, the foregoing first determining module is specifically configured to:
基于目标图像判断是否满足预设执行条件;其中,上述目标图像为目标CTU所处的图像。Determining whether the preset execution condition is satisfied based on the target image; wherein the target image is an image in which the target CTU is located.
可选的,上述第一判断模块,具体用于:Optionally, the foregoing first determining module is specifically configured to:
判断目标图像是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target image meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
该目标图像为帧内预测图像; The target image is an intra prediction image;
该目标图像所使用量化参数大于第一预设阈值;The quantization parameter used by the target image is greater than the first preset threshold;
该目标图像的头信息中携带目标标识信息,其中,目标标识信息为表明该目标图像中所有CTB所对应的SAO类型均需要按照上述第一编码规则进行编码的标识信息;The header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
该目标图像不是双向预测图像。The target image is not a bidirectional predicted image.
可选的,上述第一判断模块,具体用于:Optionally, the foregoing first determining module is specifically configured to:
基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件。Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
可选的,上述第一判断模块,具体用于:Optionally, the foregoing first determining module is specifically configured to:
判断目标CTB所属目标编码树单元CTU是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target coding tree unit CTU to which the target CTB belongs meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
目标CTU中的所有预测单元均为帧内预测单元;All prediction units in the target CTU are intra prediction units;
目标CTU所使用的量化参数大于第二预设阈值;The quantization parameter used by the target CTU is greater than a second preset threshold;
目标CTU中的所有变换单元的平均大小小于第三预设阈值;The average size of all transform units in the target CTU is less than a third preset threshold;
目标CTU中的所有编码单元的平均大小小于第四预设阈值。The average size of all coding units in the target CTU is less than a fourth predetermined threshold.
可选的,上述第一判断模块,具体用于:Optionally, the foregoing first determining module is specifically configured to:
判断在对目标CTB所属的目标编码树单元CTU进行去块滤波时的环路滤波强度值是否大于第五预设阈值;如果大于,判定满足预设执行条件;否则,判定不满足预设执行条件。Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
可选的,按照第一编码原则确定的第一编码规则,包括:Optionally, the first coding rule determined according to the first coding principle includes:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized string is based on the context model. the way.
可选的,按照第一编码原则确定的第一编码规则,包括:Optionally, the first coding rule determined according to the first coding principle includes:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为等概率编码的方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
可选的,按照第一编码原则确定的第一编码规则,包括:Optionally, the first coding rule determined according to the first coding principle includes:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、 10、11;且针对每一个二值化字符串,该二值化字符串的第一个比特位的编码方式为等概率编码的方式,在该二值化字符串还包括第二个比特位的情况下,该二值化字符串的第二个比特位的编码方式为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to EO mode, skip mode, and BO mode are 0, respectively. 10, 11; and for each binarized string, the first bit of the binarized string is encoded in an equal probability encoding manner, and the binarized string further includes a second bit In the case of the second bit of the binarized character string, the encoding method based on the context model is used.
可选的,按照第二编码原则确定的第一编码规则,包括:Optionally, the first coding rule determined according to the second coding principle includes:
编码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is based on the context model. the way.
第四方面,本申请实施例提供了一种SAO类型的解码装置,该装置包括:In a fourth aspect, an embodiment of the present application provides a decoding apparatus of the SAO type, where the apparatus includes:
熵解码模块,用于按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到目标二值化字符串;其中,第一解码规则记录有被编码二值化字符串的熵解码方式,以及各SAO类型与二值化字符串的对应关系;An entropy decoding module, configured to entropy decode the encoded target binarized character string corresponding to the target coding tree block CTB according to an entropy decoding manner of the encoded binarized character string recorded in the preset first decoding rule, Obtaining a target binarized character string; wherein the first decoding rule records an entropy decoding manner of the encoded binarized character string, and a correspondence relationship between each SAO type and the binarized character string;
第二确定模块,用于按照第一解码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标二值化字符串所对应的目标SAO类型。The second determining module is configured to determine, according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule, the target SAO type corresponding to the target binarized character string.
其中,第一解码规则为按照下述解码原则中的任一种所确定的:Wherein, the first decoding rule is determined according to any one of the following decoding principles:
第一解码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first decoding principle: the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
第二解码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应被编码二值化字符串的比特位的熵解码方式为基于上下文模型的解码方式。The second decoding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy decoding method for distinguishing the bits corresponding to the encoded binarized character string respectively for the EO mode and the BO mode is based on The way the context model is decoded.
可选的,第一解码规则为按照第一解码原则、第二解码原则以及第三解码原则中的任一种所确定的;Optionally, the first decoding rule is determined according to any one of a first decoding principle, a second decoding principle, and a third decoding principle;
第三解码原则为:被编码二值化字符串中的每一个比特位的熵解码方式均为等概率解码方式。The third decoding principle is that the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode.
可选的,上述装置还包括:Optionally, the foregoing apparatus further includes:
第二判断模块,用于针对目标编码树块CTB所对应被编码的目标二值化字符串,判断是否满足预设执行条件,预设执行条件为:用于表示目标CTB 所属的目标编码树单元CTU的预测变换准确度低的条件;a second determining module, configured to determine, according to the target binarized character string corresponding to the target coding tree block CTB, whether the preset execution condition is met, and the preset execution condition is: used to represent the target CTB a condition that the prediction transform accuracy of the associated target coding tree unit CTU is low;
相应的,上述熵解码模块,具体用于:Correspondingly, the above entropy decoding module is specifically configured to:
在第二判断模块的判断结果为是的情况下,按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到目标二值化字符串。If the judgment result of the second judging module is yes, according to the entropy decoding manner of the encoded binarized character string recorded in the preset first decoding rule, the target coded tree block corresponding to the target coding tree block CTB is encoded. The valued string is entropy decoded to obtain the target binarized string.
可选的,上述第二判断模块,具体用于:基于目标图像判断是否满足预设执行条件;其中,目标图像为目标CTU所处的图像。Optionally, the foregoing second determining module is specifically configured to: determine, according to the target image, whether the preset execution condition is met; wherein the target image is an image in which the target CTU is located.
可选的,上述第二判断模块,具体用于:Optionally, the foregoing second determining module is specifically configured to:
判断目标图像是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target image meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
该目标图像为帧内预测图像;The target image is an intra prediction image;
该目标图像所使用量化参数大于第一预设阈值;The quantization parameter used by the target image is greater than the first preset threshold;
该目标图像的头信息中携带目标标识信息,其中,目标标识信息为表明该目标图像中所有CTB所对应的SAO类型均需要按照上述第一编码规则进行编码的标识信息;The header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
该目标图像不是双向预测图像。The target image is not a bidirectional predicted image.
可选的,上述第二判断模块,具体用于:Optionally, the foregoing second determining module is specifically configured to:
基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件。Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
可选的,上述第二判断模块,具体用于:Optionally, the foregoing second determining module is specifically configured to:
判断目标CTB所属目标编码树单元CTU是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target coding tree unit CTU to which the target CTB belongs meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
目标CTU中的所有预测单元均为帧内预测单元;All prediction units in the target CTU are intra prediction units;
目标CTU所使用的量化参数大于第二预设阈值;The quantization parameter used by the target CTU is greater than a second preset threshold;
目标CTU中的所有变换单元的平均大小小于第三预设阈值;The average size of all transform units in the target CTU is less than a third preset threshold;
目标CTU中的所有编码单元的平均大小小于第四预设阈值。The average size of all coding units in the target CTU is less than a fourth predetermined threshold.
可选的,上述第二判断模块,具体用于:Optionally, the foregoing second determining module is specifically configured to:
判断在对目标CTB所属的目标编码树单元CTU进行去块滤波时的环路滤波强度值是否大于第五预设阈值;如果大于,判定满足预设执行条件;否则, 判定不满足预设执行条件。Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is met; otherwise, It is determined that the preset execution condition is not satisfied.
可选的,按照第一解码原则确定的第一解码规则,包括:Optionally, the first decoding rule determined according to the first decoding principle includes:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to EO mode, skip mode and BO mode are 0, 10, 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model The way to decode.
可选的,按照第一解码原则确定的第一解码规则,包括:Optionally, the first decoding rule determined according to the first decoding principle includes:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为等概率解码的方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
可选的,按照第一解码原则确定的第一解码规则,包括:Optionally, the first decoding rule determined according to the first decoding principle includes:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且针对每一个被编码二值化字符串,该被编码二值化字符串的第一个比特位的解码方式为等概率解码的方式,在该被编码二值化字符串还包括第二个比特位的情况下,该被编码二值化字符串的第二个比特位的解码方式为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each encoded binarized string, the encoded binary string is The decoding mode of one bit is a method of equal probability decoding, and in the case where the encoded binarized character string further includes the second bit, the decoding of the second bit of the encoded binarized character string The mode is a context model based decoding method.
可选的,按照第二解码原则确定的第一解码规则,包括:Optionally, the first decoding rule determined according to the second decoding principle includes:
解码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model. The way to decode.
第五方面,本申请实施例提供了一种编码器,包括第一处理器和第一存储器,其中;In a fifth aspect, an embodiment of the present application provides an encoder, including a first processor and a first memory, where
第一存储器,用于存放计算机程序;a first memory for storing a computer program;
第一处理器,用于执行第一存储器上所存放的程序时,实现上述任一SAO类型的编码方法所述的方法步骤。The first processor is configured to implement the method steps described in any of the SAO type encoding methods when executing the program stored on the first memory.
第六方面,本申请实施例提供了一种解码器,包括第二处理器和第二存储器,其中;In a sixth aspect, an embodiment of the present application provides a decoder, including a second processor and a second memory, where
第二存储器,用于存放计算机程序;a second memory for storing a computer program;
第二处理器,用于执行第二存储器上所存放的程序时,实现上述任一SAO 类型的解码方法所述的方法步骤。The second processor is configured to implement any of the above SAOs when executing the program stored on the second memory Type of decoding method described method steps.
第七方面,本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,该计算机程序被处理器执行时实现上述任一SAO类型的编码方法所述的方法步骤。In a seventh aspect, the embodiment of the present application provides a computer readable storage medium, where the computer readable storage medium stores a computer program, and when the computer program is executed by the processor, implements the coding method of any of the above SAO types. Method steps.
第八方面,本申请实施例提供了另一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,该计算机程序被处理器执行时实现上述任一SAO类型的解码方法所述的方法步骤。In an eighth aspect, the embodiment of the present application provides another computer readable storage medium, where the computer readable storage medium stores a computer program, and when the computer program is executed by the processor, the decoding method of any of the above SAO types is implemented. Method steps.
第九方面,本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述任一SAO类型的编码方法所述的方法步骤。In a ninth aspect, an embodiment of the present application provides a computer program product comprising instructions, when executed on a computer, causing a computer to perform the method steps described in any of the above-described SAO type encoding methods.
第十方面,本申请实施例提供了另一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述任一SAO类型的解码方法所述的方法步骤。In a tenth aspect, the embodiment of the present application provides another computer program product comprising instructions, which when executed on a computer, causes the computer to perform the method steps described in any of the above SAO type decoding methods.
第十一方面,本申请实施例提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述任一SAO类型的编码方法所述的方法步骤。In an eleventh aspect, an embodiment of the present application provides a computer program that, when run on a computer, causes the computer to perform the method steps described in any of the SAO-type encoding methods described above.
第十二方面,本申请实施例提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述任一SAO类型的解码方法所述的方法步骤。In a twelfth aspect, an embodiment of the present application provides a computer program that, when run on a computer, causes the computer to perform the method steps described in any of the SAO-type decoding methods described above.
由上述的技术方案可见,本申请实施例所提供的SAO类型的编码方式中,在决策出目标编码树块CTB的目标SAO类型后,首先按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标SAO类型所对应的目标二值化字符串,再按照第一编码规则中记录的二值化字符串的熵编码方式,对目标二值化字符串进行熵编码,得到目标SAO类型所对应的编码结果;其中,该第一编码规则中记录有各SAO类型与二值化字符串的对应关系,以及二值化字符串的熵编码方式,第一编码规则为按照下述编码原则中的任一种所确定的:It can be seen from the foregoing technical solution that, in the coding mode of the SAO type provided by the embodiment of the present application, after the target SAO type of the target coding tree block CTB is determined, firstly, each SAO recorded in the preset first coding rule is followed. Corresponding relationship between the type and the binarized character string, determining the target binarized character string corresponding to the target SAO type, and then targeting the target binarized character according to the entropy coding manner of the binarized character string recorded in the first coding rule Entropy coding of the string to obtain a coding result corresponding to the target SAO type; wherein, the first coding rule records the correspondence between each SAO type and the binarized character string, and the entropy coding mode of the binarized character string, An encoding rule is determined according to any of the following coding principles:
第一编码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first coding principle: the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
第二编码原则:EO模式和BO模式所分别对应二值化字符串的长度相同; 且用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式。The second coding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; And the entropy coding method for distinguishing the bits corresponding to the binarized character strings respectively in the EO mode and the BO mode is a context model based coding mode.
由以上可知,按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本申请实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本申请实施例提供的方案可以提高视频编码效率。It can be seen from the above that when the first coding rule determined according to the first coding principle performs the coding of the SAO type, in the solution provided by the embodiment of the present application, the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to two. The entropy coding result of the valued string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode is much more probable than the BO mode. The probability, even when it is greater than the use probability of the skip mode; the scheme provided by the embodiment of the present application can improve the video coding efficiency when the first coding rule determined according to the first coding principle performs the coding of the SAO type.
而按照第二编码原则确定的第一编码规则进行SAO类型的编码时,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以按照第二编码原则确定的第一编码规则进行SAO类型的编码时,本申请实施例提供的方案同样可以提高视频编码效率。When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode. The compression ratio is high, so when the first encoding rule determined by the second coding principle is used to perform the SAO type encoding, the solution provided by the embodiment of the present application can also improve the video encoding efficiency.
附图说明DRAWINGS
为了更清楚地说明本申请实施例和相关技术的技术方案,下面对实施例和相关技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application and the related art, the drawings used in the embodiments and the related art will be briefly described below. It is obvious that the drawings in the following description are only the present application. For some embodiments, other drawings may be obtained from those of ordinary skill in the art without departing from the drawings.
图1为最新的视频编码标准HEVC对应的视频编解码器总体框架图;1 is a general frame diagram of a video codec corresponding to the latest video coding standard HEVC;
图2为最新的视频编码标准HEVC内SAO解码端接口框架图;2 is a frame diagram of an interface interface of the SAO decoding end in the latest video coding standard HEVC;
图3为最新的视频编码标准HEVC内SAO中EO模式的四组不同的相邻像素示意图;3 is a schematic diagram of four different sets of adjacent pixels of the EO mode in the SAO of the latest video coding standard HEVC;
图4为最新的视频编码标准HEVC内SAO中的合并模式示意图;4 is a schematic diagram of a merge mode in the SAO in the latest video coding standard HEVC;
图5为本申请一实施例提供的一种SAO类型的编码方法的流程示意图;FIG. 5 is a schematic flowchart of a coding method of an SAO type according to an embodiment of the present disclosure;
图6为本申请另一实施例提供的一种SAO类型的编码方法的流程示意图; FIG. 6 is a schematic flowchart of a coding method of an SAO type according to another embodiment of the present disclosure;
图7为本申请一实施例提供的一种SAO类型的解码方法的流程示意图;FIG. 7 is a schematic flowchart of a method for decoding an SAO type according to an embodiment of the present disclosure;
图8为本申请另一实施例提供的一种SAO类型的解码方法的流程示意图;FIG. 8 is a schematic flowchart of a method for decoding an SAO type according to another embodiment of the present disclosure;
图9为本申请一实施例提供的一种SAO类型的编码装置的流程示意图;FIG. 9 is a schematic flowchart of an SAO type encoding apparatus according to an embodiment of the present disclosure;
图10为本申请另一实施例提供的一种SAO类型的编码装置的流程示意图;FIG. 10 is a schematic flowchart of an SAO type encoding apparatus according to another embodiment of the present disclosure;
图11为本申请一实施例提供的一种SAO类型的解码装置的流程示意图;FIG. 11 is a schematic flowchart of a SAO type decoding apparatus according to an embodiment of the present disclosure;
图12为本申请另一实施例提供的一种SAO类型的解码装置的流程示意图;FIG. 12 is a schematic flowchart of a SAO type decoding apparatus according to another embodiment of the present disclosure;
图13为本申请实施例提供的一种编码器的结构示意图;FIG. 13 is a schematic structural diagram of an encoder according to an embodiment of the present disclosure;
图14为本申请实施例提供的一种解码器的结构示意图。FIG. 14 is a schematic structural diagram of a decoder according to an embodiment of the present application.
具体实施方式Detailed ways
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the objects, technical solutions, and advantages of the present application more comprehensible, the present application will be further described in detail below with reference to the accompanying drawings. It is apparent that the described embodiments are only a part of the embodiments of the present application, and not all of them. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
为了方便对本申请实施例所提供方案的理解,下面首先对本申请实施例中所涉及的技术术语进行简单介绍。In order to facilitate the understanding of the solutions provided by the embodiments of the present application, the technical terms involved in the embodiments of the present application are briefly introduced below.
视频编码,也称视频压缩,其目的是消除视频信号间存在的冗余信息。随着多媒体数字视频应用的不断发展和人们对视频云计算需求的不断提高,原始视频信源的数据量是现有传输网络带宽和存储资源所无法承受的;因而,视频编码已成为目前国内外学术研究和工业应用的热点之一。至今,国内外标准化组织已相继制定了多种不同的视频编码标准,主流的视频编码标准均采用“基于块的预测和变换”的混合编码框架;图1为最新的视频编码标准HEVC对应的视频编解码器总体框架图,输入的视频信号经过块结构划分、预测、变换、量化、熵编码等编码技术处理后,最后输出比特流。Video coding, also known as video compression, is designed to eliminate redundant information that exists between video signals. With the continuous development of multimedia digital video applications and the increasing demand for video cloud computing, the amount of data of the original video source cannot be tolerated by the bandwidth and storage resources of the existing transmission network; therefore, video coding has become a domestic and international One of the hot spots of academic research and industrial applications. So far, domestic and foreign standardization organizations have successively developed a variety of different video coding standards. The mainstream video coding standards use a hybrid coding framework based on block-based prediction and transformation. Figure 1 shows the video corresponding to the latest video coding standard HEVC. The overall frame diagram of the codec, the input video signal is processed by coding techniques such as block structure division, prediction, transform, quantization, entropy coding, etc., and finally the bit stream is output.
一般情况下,视频编码器将视频帧划分为块进行编码,如H.264/AVC(Advanced Video Coding,高级视频编码)视频编码标准将视频帧划分为等大 小互不覆盖的16×16的宏块(Macro Block,MB),而HEVC则将视频帧划分成均匀等大小的编码树单元(Coding Tree Unit,CTU),CTU的大小可以在编码器配置文件中设置,通常采用64×64大小。此外,HEVC支持将编码树单元按照四叉树结构划分成更小的编码单元(Coding Unit,CU),大小为64×64的CTU可四叉划分为4个大小相同的32×32 CU,而32×32的CU又可四叉划分为4个16×16的CU或者不划分,如此下去,直到划分到允许的最小CU大小。该CU是编码的基本单元,一般呈2N×2N的方块,且大小不超过CTU的大小,一般CU的大小可以为8×8、16×16、32×32、64×64等。In general, a video encoder divides a video frame into blocks for encoding, such as an H.264/AVC (Advanced Video Coding) video coding standard, which divides a video frame into equal parts. Small 16x16 macroblocks (Macro Block, MB) are not covered by each other, while HEVC divides the video frame into uniform equal-sized Coding Tree Units (CTUs). The size of the CTU can be in the encoder configuration file. Set in the middle, usually in 64 x 64 size. In addition, HEVC supports dividing the coding tree unit into smaller coding units (CUs) according to the quadtree structure, and the 64×64 CTU can be divided into four 32×32 CUs of the same size. A 32x32 CU can be quadruple divided into four 16x16 CUs or not divided, and so on until the minimum allowed CU size is divided. The CU is a basic unit of coding, and is generally a 2N×2N block, and the size does not exceed the size of the CTU. Generally, the size of the CU may be 8×8, 16×16, 32×32, 64×64, and the like.
此外,CU可以划分成不同大小、不同形状的预测单元(Prediction Unit,PU),且预测单元PU是预测的基本单元,预测单元的大小不能超过自身所在CU的大小。CU还可以四叉递归划分成不同大小的变换单元(Transform Unit,TU)用于对预测后得到的残差块进行变换。同样地,TU是变换的基本单元,TU的大小也不能超过CU的大小,一般地,其大小为4×4、8×8、16×16、32×32等。In addition, the CU may be divided into prediction units (PUs) of different sizes and different shapes, and the prediction unit PU is a basic unit of prediction, and the size of the prediction unit cannot exceed the size of the CU where the CU is located. The CU can also be recursively divided into transform units (TUs) of different sizes for transforming the residual block obtained after the prediction. Similarly, the TU is the basic unit of the transform, and the size of the TU cannot exceed the size of the CU. Generally, the size is 4×4, 8×8, 16×16, 32×32, and the like.
综合上述,在HEVC中,视频序列图像先划分成等大小的CTU,CTU又可四叉划分为不同大小的CU,编码器以CU为单位进行编码,再以CU为基准划分成不同的PU,以PU为单位进行预测,得到预测块,预测块与原始块做差得到预测残差块,预测残差块又经过变换后得到变换系数块,后经特定的扫描方式形成一维的数组输入量化器进行标量量化,最终将量化后的系数输入熵编码器进行编码形成最终的码流。此外,已编码的视频序列重构帧/块会作为后续帧的参考帧/块以便其以帧间/帧内预测得到更为准确的预测块。而视频原始数据与经过预测、变换、量化、反量化、反变换后得到的重构数据可能存在一定的误差,使得最终的重构视频存在失真。而去块滤波(De-block Filter,DF)、SAO等环内滤波能有效地降低失真、提升主观/客观质量。In the above, in the HEVC, the video sequence image is first divided into equal-sized CTUs, and the CTU can be divided into different sizes of CUs. The encoder is coded in units of CU, and then divided into different PUs based on the CU. The prediction is performed in units of PUs, and the prediction block is obtained. The prediction block is compared with the original block to obtain a prediction residual block, and the prediction residual block is transformed to obtain a transform coefficient block, and then a one-dimensional array input quantization is formed by a specific scanning manner. The scalar quantization is performed, and finally the quantized coefficients are input to the entropy encoder to be encoded to form a final code stream. In addition, the encoded video sequence reconstructed frame/block will be used as a reference frame/block for subsequent frames so that it results in a more accurate prediction block with inter/intra prediction. However, the reconstructed data obtained from the original data and the predicted, transformed, quantized, inverse quantized and inverse transformed may have certain errors, which causes distortion of the final reconstructed video. In-loop filtering such as De-block Filter (DF) and SAO can effectively reduce distortion and improve subjective/objective quality.
SAO,如前背景技术所述,其是在HEVC中提出的一种新型的环内滤波技术,SAO应用于去块滤波之后,对于编码器来说,SAO是环内的操作。对于解码器来说,如图2所示,图2为最新的视频编码标准HEVC内SAO解码端接口框架图,其输入为重构数据经去块滤波后的数据以及熵解码器解码得到的SAO信息,输出为最终的重构信号(输入至参考帧列表缓冲区以备后续 视频帧参考)。当视频流使用了SAO模式时,即序列参数集合(Sequence Parameter Set,SPS)中的语法元素sample_adaptive_offset_enabled_flag为真,且片级头信息中的语法元素slice_sao_luma_flag和slice_sao_chroma_flag为真。SAO, as described in the prior art, is a novel in-loop filtering technique proposed in HEVC. After SAO is applied to deblocking filtering, SAO is an operation within the ring for the encoder. For the decoder, as shown in FIG. 2, FIG. 2 is a frame diagram of the SAO decoding end interface in the latest video coding standard HEVC, and the input is the deblocked filtered data of the reconstructed data and the SAO decoded by the entropy decoder. Information, the output is the final reconstructed signal (input to the reference frame list buffer for subsequent Video frame reference). When the video stream uses the SAO mode, the syntax element sample_adaptive_offset_enabled_flag in the Sequence Parameter Set (SPS) is true, and the syntax elements slice_sao_luma_flag and slice_sao_chroma_flag in the slice-level header information are true.
SAO类型,在HEVC标准中,用sao_type_idx标识,SAO类型包括三种:跳过模式、EO模式和BO模式。本领域技术人员公知的是,一个CTU包括一个亮度编码树块和若干个色度编码树块,故视频编码和解码过程中,编、解码器所进行的SAO类型的编、解码,可以理解为对CTU内的亮度编码树块和各个色度编码树块所进行的编、解码。例如,对于某一CTU,编码器可以针对该CTU的亮度编码树块,从三种SAO类型决策选择率失真代价最小的一种该亮度编码树块的SAO类型;如果该CTU存在色度分量(即颜色空间格式不是4:0:0),则按照同样的方式决策选择成色度编码树块的SAO类型,且若存在多个色度分量则需要分别进行SAO类型的决策选择。The SAO type, in the HEVC standard, is identified by sao_type_idx, and the SAO type includes three types: skip mode, EO mode, and BO mode. It is well known to those skilled in the art that a CTU includes a luma coding tree block and a plurality of chroma coding tree blocks. Therefore, in the video encoding and decoding process, the encoding and decoding of the SAO type performed by the encoder and the decoder can be understood as Editing and decoding the luma coding tree block and each chroma coding tree block in the CTU. For example, for a certain CTU, the encoder may encode a tree block for the luma of the CTU, and select the SAO type of the luma coding tree block with the least cost penalty from the three SAO types; if the CTU has a chroma component ( That is, the color space format is not 4:0:0), then the SAO type of the chroma coding tree block is selected in the same manner, and if there are multiple chroma components, the SAO type decision selection needs to be separately performed.
具体来说,EO模式是根据CTB内相邻像素与当前像素的关系计算合适的偏移值offset,并把计算得到的偏移值作用于当前像素的过程,其具体操作方式如下:EO模式通常使用当前像素与一组相邻像素进行比较,并根据表1中所示当前像素与相邻像素的关系,将当前像素分成五种不同的类型,其中,一组相邻像素(a,b)的选择方式如图3所示,a、b分别表示相邻像素,c表示当前像素,若满足“其它情况”,即该像素属于第“0”类,则将不会对该类的当前像素c有任何操;若满足其余四种情况,则为每一类分配一个偏移值,加到当前像素c中。并且,对于第1和2类,偏移值offset必须为正整数,对于第3和第4类,偏移值offset必须为负整数,以避免编码offset符号位导致增加编码比特。Specifically, the EO mode is a process of calculating a suitable offset value offset according to the relationship between adjacent pixels in the CTB and the current pixel, and applying the calculated offset value to the current pixel. The specific operation mode is as follows: EO mode is usually The current pixel is compared with a set of adjacent pixels, and according to the relationship between the current pixel and the adjacent pixel shown in Table 1, the current pixel is divided into five different types, wherein a group of adjacent pixels (a, b) The selection method is as shown in FIG. 3, where a and b respectively represent adjacent pixels, and c represents the current pixel. If the “other case” is satisfied, that is, the pixel belongs to the “0” class, the current pixel of the class will not be c has any operations; if the other four cases are satisfied, an offset value is assigned to each class and added to the current pixel c. Also, for classes 1 and 2, the offset value offset must be a positive integer, and for the 3rd and 4th classes, the offset value offset must be a negative integer to avoid encoding the offset sign bit resulting in an increase in the coded bits.
表1 EO模式像素分类映射表Table 1 EO mode pixel classification mapping table
类别编号Category number 条件condition
11 c<a&&c<bc<a&&c<b
22 (c<a&&c==b)||(c==a&&c<b)(c<a&&c==b)||(c==a&&c<b)
33 (c>a&&c==b)||(c==a&&c>b)(c>a&&c==b)||(c==a&&c>b)
44 c>a&&c>bc>a&&c>b
00 其它情况Other situations
BO模式根据CTB内所有的像素值大小将所有像素值进行分类,并对每一类设置合适的偏移值,最后再将偏移值作用于对应类别的像素上,其具体操作方式如下:BO将所有不同大小的像素分为32个不相互交织的带(band),即每个带包含对应的8个像素值,类似统计直方图,第1个带包含值的范围属于[0,7]的8个像素,依此类推,第32个带包含值的范围属于[248,255]的8个像素。并对每个带确定一个偏移值,作用于属于该带的像素上,该偏移值的正负性不受约束,最终选择CTB内像素分布最集中的4个带,并传输这4个带的起始位置以及相应地偏移值offset至解码端。其中,偏移量offset的计算方式如下:计算CTB进入SAO之前划分成32个带后每一个带中所有像素的平均值R以及CTB原始像素划分成32个带后每一个带中所有像素的平均值S,偏移值即为(S-R)。The BO mode classifies all pixel values according to the size of all pixel values in the CTB, and sets an appropriate offset value for each class, and finally applies the offset value to the pixels of the corresponding category. The specific operation mode is as follows: BO All pixels of different sizes are divided into 32 bands that are not inter-interleaved, that is, each band contains corresponding 8 pixel values, similar to a statistical histogram, and the range of the first band containing values belongs to [0, 7] 8 pixels, and so on, the 32nd band contains values of 8 pixels belonging to [248, 255]. And determining an offset value for each band, acting on the pixels belonging to the band, the positive and negative of the offset value are not constrained, and finally selecting the 4 bands with the most concentrated pixel distribution in the CTB, and transmitting the 4 bands The starting position of the band and the corresponding offset value offset to the decoding end. The offset offset is calculated as follows: Calculate the average value R of all the pixels in each band after the CTB is divided into 32 bands before entering the SAO and the average of all the pixels in each band after the CTB original pixel is divided into 32 bands. The value S, the offset value is (SR).
另外,编码器在决策选择SAO类型时,还可以首先会判断是否采用SAO的合并模式,包括sao_merge_left_flag(向左合并模式)以及sao_merge_up_flag(向上合并模式)。如图4所示,图4为最新的视频编码标准HEVC内SAO中的合并模式示意图,合并模式是指继承并使用所指向的CTU的SAO参数包括亮度编码树单元的SAO参数和所有色度编码树单元的SAO参数。In addition, when the encoder selects the SAO type, it may first determine whether to adopt the SAO merge mode, including sao_merge_left_flag (left merge mode) and sao_merge_up_flag (up merge mode). As shown in FIG. 4, FIG. 4 is a schematic diagram of a merge mode in a SAO in the latest video coding standard HEVC. The merge mode refers to an SAO parameter including a CTU that is inherited and used, including SAO parameters of the luma coding tree unit and all chroma coding. The SAO parameter of the tree unit.
为了解决相关技术问题,本申请实施例提供了编码和解码方法、装置、编码器、解码器及存储介质。In order to solve the related technical problem, embodiments of the present application provide an encoding and decoding method, apparatus, encoder, decoder, and storage medium.
下面首先对本申请实施例所提供的一种SAO类型的编码方法进行介绍。The following describes an SAO type encoding method provided by the embodiment of the present application.
需要说明的是,本申请实施例所提供的一种SAO类型的编码方法可以应用于编码器中,在实际应用中,该编码器可以是一个实体设备,当然也可以是一个可实现视频编码功能的程序,这都是合理的,本申请实施例并不限定该编码器的具体形式。It should be noted that an SAO type encoding method provided by an embodiment of the present application may be applied to an encoder. In an actual application, the encoder may be a physical device, and may also be a video encoding function. The program is reasonable, and the embodiment of the present application does not limit the specific form of the encoder.
如图5所示,本申请实施例提供了一种SAO类型的编码方法,该方法包括:As shown in FIG. 5, an embodiment of the present application provides an SAO type encoding method, where the method includes:
S101:在决策出目标编码树块CTB的目标SAO类型后,按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标SAO类型所对应的目标二值化字符串,其中,第一编码规则中记录有各SAO 类型与二值化字符串的对应关系,以及二值化字符串的熵编码方式。S101: After determining the target SAO type of the target coding tree block CTB, determining the target corresponding to the target SAO type according to the correspondence between each SAO type and the binarized character string recorded in the preset first coding rule. a valued string in which each SAO is recorded in the first encoding rule The correspondence between the type and the binarized string, and the entropy encoding of the binarized string.
如前所述,一个CTU可以包含一个亮度编码树块和多个色度编码树块,所以本申请实施例所述的目标编码树块CTB既有可能是亮度编码树块,也有可能是色度编码树块,这都是合理的。另外,该目标CTB并不是特指某一个CTB,视频序列图像中任何一个CTB都可能作为上述目标CTB。As described above, a CTU may include a luma coding tree block and a plurality of chroma coding tree blocks. Therefore, the target coding tree block CTB described in this embodiment may be either a luma coding tree block or a chroma. Encoding tree blocks, this is all reasonable. In addition, the target CTB does not specifically refer to a CTB, and any CTB in the video sequence image may be used as the target CTB.
SAO类型包括跳过模式、EO模式及BO模式,所以上述对应关系中记载有跳过模式、EO模式以及BO模式分别对应的二值化字符串。例如,该对应关系为一对应关系表,该对应关系表中,跳过模式、EO模式及BO模式分别对应的二值化字符串为:二值化字符串x,二值化字符串y和二值化字符串z;在此情况下,假设上述所决策出的目标SAO类型为EO模式,则可以根据该对应关系表,确定目标二值化字符串为二值化字符串y。Since the SAO type includes the skip mode, the EO mode, and the BO mode, the above-described correspondence relationship includes the binarized character strings corresponding to the skip mode, the EO mode, and the BO mode, respectively. For example, the correspondence relationship is a correspondence relationship table. In the correspondence relationship table, the binarized strings corresponding to the skip mode, the EO mode, and the BO mode are: a binarized string x, a binarized string y, and The binarized character string z; in this case, assuming that the target SAO type determined above is the EO mode, the target binarized character string can be determined as the binarized character string y according to the correspondence relationship table.
另外,第一编码规则中记录的二值化字符串的熵编码方式可以理解为:二值化字符串中每个二值化比特位(简称比特位)所采用的具体熵编码方式。针对上述每个比特位的编码方式,可以有两种:基于上下文模型的编码方式以及等概率编码方式。In addition, the entropy coding manner of the binarized character string recorded in the first coding rule can be understood as a specific entropy coding mode adopted by each binarized bit (abbreviated as a bit) in the binarized character string. There are two types of coding methods for each of the above bits: a coding method based on a context model and an equal probability coding method.
基于上下文模型的编码方式以及等概率编码方式都属于公知技术,两种编码方式的具体实现方法本申请实施例在此不做详细介绍。但本领域技术人员公知的是,如果二值化字符串中的比特位利用基于上下文模型的编码方式进行熵编码,则该比特位的编码压缩比高;而如果二值化字符串中的比特位利用等概率编码方式进行熵编码,则该比特位的编码速度高。The coding method based on the context model and the equal-probability coding method are all well-known technologies, and the specific implementation methods of the two coding modes are not described in detail herein. However, it is well known to those skilled in the art that if the bits in the binarized character string are entropy encoded using a context model based coding scheme, the code compression ratio of the bit is high; and if the bits in the binarized string are binarized When the bit is entropy encoded by the equal probability coding method, the coding speed of the bit is high.
S102:按照第一编码规则中记录的二值化字符串的熵编码方式,对目标二值化字符串进行熵编码,得到目标SAO类型所对应的编码结果。S102: Entropy coding the target binarized character string according to the entropy coding manner of the binarized character string recorded in the first coding rule, to obtain an encoding result corresponding to the target SAO type.
其中,该第一编码规则为按照下述编码原则中的任一种所确定的:Wherein the first coding rule is determined according to any one of the following coding principles:
第一编码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first coding principle: the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
第二编码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式。The second coding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
本申请实施例中的第一编码规则为预先设定的,但是并不表示该第一编 码规则是随机设定的,该第一编码规则需要按照上述第一编码原则和第二编码原则中的任一种所设定。并且,在设定了第一编码规则后,对任何一个视频进行编码时,该视频的编码过程中所使用的第一编码规则都是相同的。The first encoding rule in the embodiment of the present application is preset, but does not represent the first encoding. The code rules are randomly set, and the first coding rule needs to be set according to any of the first coding principle and the second coding principle described above. Moreover, when any one of the videos is encoded after the first encoding rule is set, the first encoding rule used in the encoding process of the video is the same.
一种实现方式中,用于确定第一编码规则的编码原则,可以是在视频编码过程中根据当前图像的编码参数、当前编码单元的编码参数(例如,当前编码CTU的编码参数)等信息,从上述第一编码原则、第二编码原则中选择出来的,之后依据选择出来的编码原则确定上述第一编码规则的具体规则内容,这样使得视频编码过程中,编码器对SAO类型进行编码时,所采用的第一编码规则更加灵活,更加有利于提高视频编码效率。In an implementation manner, the coding principle used to determine the first coding rule may be information according to a coding parameter of a current image, an encoding parameter of a current coding unit (for example, an encoding parameter of a current coding CTU), and the like in a video coding process. And selecting the first coding principle and the second coding principle, and then determining the specific rule content of the first coding rule according to the selected coding principle, so that when the encoder encodes the SAO type in the video coding process, The first coding rule adopted is more flexible and is more conducive to improving video coding efficiency.
需要说明的是,通常情况下,上述跳过模式、EO模式以及BO模式分别对应的二值化字符串是在0、10、11这三个二值化字符串中所选择的,当然,还可以是在1、00、01这三个二值化字符串中所选择的。It should be noted that, in general, the binarized character strings respectively corresponding to the skip mode, the EO mode, and the BO mode are selected among the three binarized strings of 0, 10, and 11, and of course, It can be selected in the three binary strings of 1, 00, and 01.
本申请实施例中,第一编码原则规定:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个,即:EO模式所对应二值化字符串的长度小于BO模式所对应二值化字符串的长度,或者EO模式所对应二值化字符串的长度小于BO模式所对应二值化字符串的长度。上述二值化字符串的长度可以为二值化字符串所包含比特位的位数,例如,跳过模式、EO模式所分别对应的二值化字符串为0、10,由于二值化字符串10的比特位位数大于二值化字符串0,则EO模式所对应二值化字符串的长度小于跳过模式所对应二值化字符串的长度。In the embodiment of the present application, the first coding principle stipulates that the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode, that is, the EO mode corresponds to The length of the binarized string is less than the length of the binarized string corresponding to the BO mode, or the length of the binarized string corresponding to the EO mode is less than the length of the binarized string corresponding to the BO mode. The length of the binarized character string may be the number of bits of the bit string included in the binarized character string. For example, the binarized character string corresponding to the skip mode and the EO mode is 0, 10, respectively, due to the binarized character. The bit number of the string 10 is greater than the binarized character string 0, and the length of the binarized character string corresponding to the EO mode is smaller than the length of the binarized character string corresponding to the skip mode.
可以理解,第一编码原则仅对各SAO类型与二值化字符串的对应关系做了限定,对二值化字符串的熵编码方式并不做限定,所以根据第一编码原则确定的不同编码规则中,二值化字符串中的同一个比特位,有的设定该比特位用等概率编码方式进行熵编码,有的设定该比特位用基于上下文模型的编码方式进行熵编码。It can be understood that the first coding principle only limits the correspondence between each SAO type and the binarized character string, and the entropy coding manner of the binary string is not limited, so different codes determined according to the first coding principle are used. In the rule, the same bit in the binarized character string is set to be entropy encoded by the equal probability coding method, and some bits are set to be entropy coded by the context model based coding mode.
作为本申请实施例的一种可选实现方式,按照第一编码原则确定的第一编码规则,可以是:As an optional implementation manner of the embodiment of the present application, the first coding rule determined according to the first coding principle may be:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型 的编码方式。Coding rules: the binarized strings corresponding to EO mode, skip mode and BO mode are 0, 10, 11 respectively; and the entropy coding mode of each bit of the binarized string is based on the context model The encoding method.
在此实现方式下,第一编码规则中所记录的各SAO类型与二值化字符串的对应关系为:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;所记录的二值化字符串的熵编码方式为:二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。In this implementation manner, the correspondence between each SAO type and the binarized character string recorded in the first encoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively. 11; The entropy coding mode of the recorded binarized character string is: the entropy coding mode of each bit of the binarized character string is a coding mode based on a context model.
示例性的,当待编码的SAO类型为EO模式时,编码器按照上述对应关系,确定EO模式所对应的二值化字符串为0,然后针对该二值化字符串0,利用基于上下文模型的编码方式进行熵编码,得到EO模式所对应的编码结果。Exemplarily, when the SAO type to be encoded is the EO mode, the encoder determines, according to the above correspondence, that the binarized character string corresponding to the EO mode is 0, and then uses the context-based model for the binarized character string 0. The encoding method is entropy encoded to obtain the encoding result corresponding to the EO mode.
再如,当待编码的SAO类型为BO模式时,编码器按照上述对应关系,确定BO模式所对应的二值化字符串为11,然后针对该二值化字符串11中的第一个比特位1,利用基于上下文模型的编码方式进行熵编码;针对该二值化字符串11中的第二个比特位1,同样利用基于上下文模型的编码方式进行熵编码,最终得到BO模式所对应的编码结果。For example, when the SAO type to be encoded is the BO mode, the encoder determines, according to the above correspondence, that the binary character string corresponding to the BO mode is 11, and then the first bit in the binarized character string 11 Bit 1, using the context model based coding method for entropy coding; for the second bit 1 in the binarized character string 11, the entropy coding is also performed by using the context model based coding method, and finally the BO mode is correspondingly obtained. The result of the encoding.
可以理解,在此实现方式下,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;发明人经过大量的实验总结发现在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照此实现方式下的第一编码规则进行SAO类型的编码时,可以提高视频编码效率。另外,此实现方式下,二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式,编码器对各种SAO类型进行的编码的压缩比高,进一步提高视频编码效率。It can be understood that, in this implementation manner, the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codeword, that is, the encoder can perform the EO mode. The compression ratio of the SAO type is high. The inventors have found through a large number of experiments that the probability of using the EO mode is much larger than that of the BO mode in the video coding process, and even greater than the use probability of the skip mode in some cases. Therefore, when the SAO type encoding is performed according to the first encoding rule in this implementation manner, the video encoding efficiency can be improved. In addition, in this implementation manner, the entropy coding mode of each bit of the binarized character string is based on the context model coding mode, and the coding ratio of the coding performed by the encoder on various SAO types is high, thereby further improving the video coding efficiency. .
作为本申请实施例的另一种可选实现方式,按照第一编码原则确定的第一编码规则,也可以是:As another optional implementation manner of the embodiment of the present application, the first coding rule determined according to the first coding principle may also be:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为等概率编码的方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
在此实现方式下,第一编码规则中所记录的各SAO类型与二值化字符串的对应关系为:EO模式、跳过模式和BO模式所对应的二值化字符串分别为 0、10、11;所记录的二值化字符串的熵编码方式为:二值化字符串的每个比特位的熵编码方式均为等概率编码的方式。In this implementation manner, the correspondence between each SAO type and the binarized character string recorded in the first encoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are respectively 0, 10, 11; The entropy coding mode of the recorded binarized character string is: the entropy coding mode of each bit of the binarized character string is a method of equal probability coding.
示例性的,当待编码的SAO类型为EO模式时,编码器按照上述对应关系,确定EO模式所对应的二值化字符串为0,然后针对该二值化字符串0,利用等概率编码的方式进行熵编码,得到EO模式所对应的编码结果。Exemplarily, when the SAO type to be encoded is the EO mode, the encoder determines, according to the above correspondence, that the binarized character string corresponding to the EO mode is 0, and then uses the equal probability coding for the binarized character string 0. The entropy coding is performed to obtain the coding result corresponding to the EO mode.
再如,当待编码的SAO类型为BO模式时,编码器按照上述对应关系,确定BO模式所对应的二值化字符串为11,然后针对该二值化字符串11中的第一个比特位1,利用基于等概率编码的方式进行熵编码;针对该二值化字符串11中的第二个比特位1,同样利用等概率编码的方式进行熵编码,最终得到BO模式所对应的编码结果。For example, when the SAO type to be encoded is the BO mode, the encoder determines, according to the above correspondence, that the binary character string corresponding to the BO mode is 11, and then the first bit in the binarized character string 11 Bit 1, using entropy coding based on equal probability coding; for the second bit 1 in the binarized character string 11, the entropy coding is also performed by means of equal probability coding, and finally the coding corresponding to the BO mode is obtained. result.
可以理解,在此实现方式下,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照此实现方式下的第一编码规则进行SAO类型的编码时,可以提高视频编码效率。另外,此实现方式下,二值化字符串的每个比特位的熵编码方式均为等概率编码的编码方式,编码器对各种SAO类型进行的编码的速度快,所以按照此实现方式下的第一编码规则进行SAO类型的编码时,还可以提高视频编码速度。It can be understood that, in this implementation manner, the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codeword, that is, the encoder can perform the EO mode. The SAO type encodes a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than the BO mode, and sometimes even greater than the skip mode. Therefore, according to this implementation When the first encoding rule performs SAO type encoding, video encoding efficiency can be improved. In addition, in this implementation manner, the entropy coding mode of each bit of the binarized character string is an encoding method of equal probability coding, and the encoding speed of the encoder for various SAO types is fast, so according to this implementation manner When the first encoding rule performs the SAO type encoding, the video encoding speed can also be improved.
作为本申请实施例的再一种可选实现方式,按照第一编码原则确定的第一编码规则,还可以是:As a further optional implementation manner of the embodiment of the present application, the first coding rule determined according to the first coding principle may also be:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且针对每一个二值化字符串,该二值化字符串的第一个比特位的编码方式为等概率编码的方式,在该二值化字符串还包括第二个比特位的情况下,该二值化字符串的第二个比特位的编码方式为基于上下文模型的编码方式。Encoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each binarized string, the first bit of the binarized string The coding mode is equal probability coding. When the binarized character string further includes the second bit, the coding mode of the second bit of the binarized character string is based on the context model. .
在此实现方式下,第一编码规则中所记录的各SAO类型与二值化字符串的对应关系为:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;所记录的二值化字符串的熵编码方式为:针对每一个二值化字符 串,该二值化字符串的第一个比特位的编码方式为等概率编码的方式,在该二值化字符串还包括第二个比特位的情况下,该二值化字符串的第二个比特位的编码方式为基于上下文模型的编码方式。In this implementation manner, the correspondence between each SAO type and the binarized character string recorded in the first encoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively. , 11; the entropy encoding of the recorded binarized string is: for each binarized character a string, the first bit of the binarized string is encoded in an equal probability encoding manner, and in the case where the binarized string further includes a second bit, the second digit of the binary string The encoding of the two bits is based on the context model.
示例性的,当待编码的SAO类型为EO模式时,编码器按照上述对应关系,确定EO模式所对应的二值化字符串为0,然后针对该二值化字符串0,利用等概率编码的方式进行熵编码,得到EO模式所对应的编码结果。Exemplarily, when the SAO type to be encoded is the EO mode, the encoder determines, according to the above correspondence, that the binarized character string corresponding to the EO mode is 0, and then uses the equal probability coding for the binarized character string 0. The entropy coding is performed to obtain the coding result corresponding to the EO mode.
再如,当待编码的SAO类型为跳过模式时,编码器按照上述对应关系,确定跳过模式所对应的二值化字符串为10,然后针对该二值化字符串10中的第一个比特位1,利用基于等概率编码的方式进行熵编码;针对该二值化字符串10中的第二个比特位0,利用基于上下文模型的编码方式进行熵编码,最终得到跳过模式所对应的编码结果。For example, when the SAO type to be encoded is the skip mode, the encoder determines, according to the above correspondence, that the binary character string corresponding to the skip mode is 10, and then the first one of the binarized character strings 10 Bit 1 is entropy encoded by means of equal probability coding; for the second bit 0 in the binarized string 10, entropy coding is performed using a context model based coding method, and finally a skip mode is obtained. Corresponding coding result.
可以理解,在此实现方式下,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照此实现方式下的第一编码规则进行SAO类型的编码时,可以提高视频编码效率。It can be understood that, in this implementation manner, the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codeword, that is, the encoder can perform the EO mode. The SAO type encodes a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than the BO mode, and sometimes even greater than the skip mode. Therefore, according to this implementation When the first encoding rule performs SAO type encoding, video encoding efficiency can be improved.
当然,按照上述第一编码原则所确定的第一编码规则并不限于上述3种实现方式,还可以是其它的第一编码规则。例如,按照第一编码原则确定的第一编码规则,还可以是:Certainly, the first coding rule determined according to the foregoing first coding principle is not limited to the foregoing three implementation manners, and may be other first coding rules. For example, the first encoding rule determined according to the first encoding principle may also be:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、11、10;且针对每一个二值化字符串,该二值化字符串的第一个比特位的编码方式为基于上下文模型的编码方式,在该二值化字符串还包括第二个比特位的情况下,该二值化字符串的第二个比特位的编码方式为等概率编码的方式。Encoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 11, and 10, respectively; and for each binarized string, the first bit of the binarized string The coding mode is a context model based coding mode. When the binary character string further includes a second bit, the coding mode of the second bit of the binarized character string is an equal probability coding mode. .
再如,按照第一编码原则确定的第一编码规则,还可以是:For another example, the first encoding rule determined according to the first encoding principle may also be:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、11、10;且二值化字符串的每个比特位的熵编码方式均为等概率编码的方式。 Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 11, and 10, respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
本申请实施例中,第二编码原则规定:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式。In the embodiment of the present application, the second coding principle stipulates that the EO mode and the BO mode respectively have the same length of the binarized character string; and are used to distinguish the EO mode and the BO mode respectively corresponding to the bits of the binarized character string. The entropy coding method is a coding method based on a context model.
可以理解,按照第二编码原则确定的第一编码规则中,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以利用按照第二编码原则确定的第一编码规则进行SAO类型的编码方式,可以提高视频编码效率。It can be understood that, in the first coding rule determined according to the second coding principle, the entropy coding mode for distinguishing the bits corresponding to the binarized character string respectively of the EO mode and the BO mode is a context model based coding mode, and the encoder pair The coding ratios of the two types of SAOs, the EO mode and the BO mode, are high, so that the SAO type coding method is performed by using the first coding rule determined according to the second coding principle, and the video coding efficiency can be improved.
作为本申请实施例的一种可选实现方式,按照第二编码原则确定的第一编码规则,可以是:As an optional implementation manner of the embodiment of the present application, the first coding rule determined according to the second coding principle may be:
编码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is based on the context model. the way.
在此实现方式下,第一编码规则中所记录的各SAO类型与二值化字符串的对应关系为:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11所记录的二值化字符串的熵编码方式为:二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。In this implementation manner, the correspondence between each SAO type and the binarized character string recorded in the first encoding rule is: the binarized character strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, respectively. The entropy coding mode of the binarized character string recorded in 11 is: the entropy coding mode of each bit of the binarized character string is a coding mode based on a context model.
示例性的,当待编码的SAO类型为EO模式时,编码器按照上述对应关系,确定EO模式所对应的二值化字符串为11,然后针对该二值化字符串1中的第一个比特位1,以及第一个比特位1,均利用基于上下文模型的编码方式进行熵编码,得到EO模式所对应的编码结果。Exemplarily, when the SAO type to be encoded is the EO mode, the encoder determines, according to the above correspondence, that the binarized character string corresponding to the EO mode is 11, and then the first one of the binarized character strings 1 The bit 1 and the first bit 1 are both entropy encoded using a context model based coding method to obtain an encoding result corresponding to the EO mode.
再如,当待编码的SAO类型为BO模式时,编码器按照上述对应关系,确定跳过模式所对应的二值化字符串为10,然后针对该二值化字符串1中的第一个比特位1,以及第一个比特位0,均利用基于上下文模型的编码方式进行熵编码,得到BO模式所对应的编码结果。For example, when the SAO type to be encoded is the BO mode, the encoder determines, according to the above correspondence, that the binary character string corresponding to the skip mode is 10, and then the first one of the binarized character strings 1 is The bit 1 and the first bit 0 are both entropy encoded using a context model based coding method to obtain a coding result corresponding to the BO mode.
当然,按照上述第二编码原则所确定的第一编码规则并不限于上述实现方式,还可以是其它的第一编码规则。例如,按照第二编码原则确定的第一编码规则,还可以是:Certainly, the first coding rule determined according to the foregoing second coding principle is not limited to the foregoing implementation manner, and may be other first coding rules. For example, the first encoding rule determined according to the second encoding principle may also be:
编码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为 0、11、10;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Encoding rules: the binarized strings corresponding to skip mode, BO mode, and EO mode are respectively 0, 11, 10; and the entropy coding mode of each bit of the binarized character string is based on the context model.
由以上可知,按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本申请实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本申请实施例提供的方案可以提高视频编码效率。It can be seen from the above that when the first coding rule determined according to the first coding principle performs the coding of the SAO type, in the solution provided by the embodiment of the present application, the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to two. The entropy coding result of the valued string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode is much more probable than the BO mode. The probability, even when it is greater than the use probability of the skip mode; the scheme provided by the embodiment of the present application can improve the video coding efficiency when the first coding rule determined according to the first coding principle performs the coding of the SAO type.
而按照第二编码原则确定的第一编码规则进行SAO类型的编码时,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以按照第二编码原则确定的第一编码规则进行SAO类型的编码时,本申请实施例提供的方案同样可以提高视频编码效率。When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode. The compression ratio is high, so when the first encoding rule determined by the second coding principle is used to perform the SAO type encoding, the solution provided by the embodiment of the present application can also improve the video encoding efficiency.
在上述方法实施例的基础上,该第一编码规则还可以是按照第一编码原则、第二编码原则以及第三编码原则中的任一种所确定的;On the basis of the foregoing method embodiment, the first coding rule may be determined according to any one of a first coding principle, a second coding principle, and a third coding principle;
该第三编码原则为:二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式。The third coding principle is that the entropy coding mode of each bit in the binarized character string is an equal probability coding mode.
当然,该用于确定第一编码规则的编码原则可以是预先选定的,也可以是在视频编码过程中所根据编码参数所实时选定的,这都是合理的,本申请实施例在此并不限定用于确定第一编码规则的编码原则的选择方式。另外,可以理解,第三编码原则仅对二值化字符串的熵编码方式做了限定,对各SAO类型与二值化字符串的对应关系并不做限定。Certainly, the coding principle for determining the first coding rule may be pre-selected, or may be selected in real time according to the coding parameters in the video coding process, which is reasonable, and the embodiment of the present application is here. The selection of the coding principle for determining the first coding rule is not limited. In addition, it can be understood that the third coding principle only limits the entropy coding mode of the binarized character string, and the correspondence relationship between each SAO type and the binarized character string is not limited.
作为本申请实施例的一种可选实现方式,按照第三编码原则确定的第一编码规则,可以是:As an optional implementation manner of the embodiment of the present application, the first coding rule determined according to the third coding principle may be:
编码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为 0、10、11;且二值化字符串的每个比特位的熵编码方式均为等概率编码方式。Encoding rules: the binarized strings corresponding to skip mode, BO mode, and EO mode are respectively 0, 10, 11; and the entropy coding mode of each bit of the binarized character string is an equal probability coding mode.
在此实现方式下,第一编码规则中所记录的各SAO类型与二值化字符串的对应关系为:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;所记录的二值化字符串的熵编码方式为:二值化字符串的每个比特位的熵编码方式均为等概率编码方式。In this implementation manner, the correspondence between each SAO type and the binarized character string recorded in the first encoding rule is: the binarized character strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, respectively. 11; The entropy coding mode of the recorded binarized character string is: the entropy coding mode of each bit of the binarized character string is an equal probability coding mode.
示例性的,当待编码的SAO类型为EO模式时,编码器按照上述对应关系,确定EO模式所对应的二值化字符串为11,然后针对该二值化字符串11的第一个比特位1以及第二个比特位1,均利用等概率编码方式进行熵编码,得到EO模式所对应的编码结果。Exemplarily, when the SAO type to be encoded is the EO mode, the encoder determines, according to the above correspondence, that the binarized character string corresponding to the EO mode is 11, and then the first bit of the binarized character string 11 Bit 1 and the second bit 1 are both entropy encoded using an equal probability coding method to obtain an encoding result corresponding to the EO mode.
作为本申请实施例的另一种可选实现方式,按照第一编码原则确定的第一编码规则,也可以是:As another optional implementation manner of the embodiment of the present application, the first coding rule determined according to the first coding principle may also be:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为等概率编码的方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
在此实现方式下,第一编码规则中所记录的各SAO类型与二值化字符串的对应关系为:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;所记录的二值化字符串的熵编码方式为:二值化字符串的每个比特位的熵编码方式均为等概率编码的方式。In this implementation manner, the correspondence between each SAO type and the binarized character string recorded in the first encoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively. 11; The entropy coding mode of the recorded binarized character string is: the entropy coding mode of each bit of the binarized character string is a method of equal probability coding.
示例性的,当待编码的SAO类型为EO模式时,编码器按照上述对应关系,确定EO模式所对应的二值化字符串为0,然后针对该二值化字符串0,利用等概率编码的方式进行熵编码,得到EO模式所对应的编码结果。Exemplarily, when the SAO type to be encoded is the EO mode, the encoder determines, according to the above correspondence, that the binarized character string corresponding to the EO mode is 0, and then uses the equal probability coding for the binarized character string 0. The entropy coding is performed to obtain the coding result corresponding to the EO mode.
再如,当待编码的SAO类型为BO模式时,编码器按照上述对应关系,确定BO模式所对应的二值化字符串为11,然后针对该二值化字符串11中的第一个比特位1,利用基于等概率编码的方式进行熵编码;针对该二值化字符串11中的第二个比特位1,同样利用等概率编码的方式进行熵编码,最终得到BO模式所对应的编码结果。For example, when the SAO type to be encoded is the BO mode, the encoder determines, according to the above correspondence, that the binary character string corresponding to the BO mode is 11, and then the first bit in the binarized character string 11 Bit 1, using entropy coding based on equal probability coding; for the second bit 1 in the binarized character string 11, the entropy coding is also performed by means of equal probability coding, and finally the coding corresponding to the BO mode is obtained. result.
可以理解,在此实现方式下,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模 式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照此实现方式下的第一编码规则进行SAO类型的编码时,可以提高视频编码效率。另外,此实现方式下,二值化字符串的每个比特位的熵编码方式均为等概率编码的编码方式,编码器对各种SAO类型进行的编码的速度快,所以按照此实现方式下的第一编码规则进行SAO类型的编码时,还可以提高视频编码速度。It can be understood that, in this implementation manner, the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codeword, that is, the encoder can perform the EO mode. The SAO type encodes a high compression ratio; since the video coding process, the EO mode The usage probability of the formula is much larger than the usage probability of the BO mode, and is sometimes greater than the use probability of the skip mode; therefore, when the first encoding rule in this implementation manner performs the SAO type encoding, the video encoding efficiency can be improved. In addition, in this implementation manner, the entropy coding mode of each bit of the binarized character string is an encoding method of equal probability coding, and the encoding speed of the encoder for various SAO types is fast, so according to this implementation manner When the first encoding rule performs the SAO type encoding, the video encoding speed can also be improved.
当然,按照上述第三编码原则所确定的第一编码规则并不限于上述两种实现方式,还可以是其它的第一编码规则。例如,按照第三编码原则确定的第一编码规则,还可以是:Certainly, the first coding rule determined according to the foregoing third coding principle is not limited to the foregoing two implementation manners, and may be other first coding rules. For example, the first encoding rule determined according to the third encoding principle may also be:
编码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、11、10;且二值化字符串的每个比特位的熵编码方式均为等概率编码方式。Coding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 11, and 10, respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding mode.
本领域技术人员公知的是,基于上下文模型的编码方式中,编码器在对一个新的CTU进行编码时,需要更新二值化字符串的每个比特位所建立的上下文模型,而且每个独立建立的上下文模型需要一定的缓冲(buffer)代价,增加了编码器的复杂度,而使用等概率编码,可以快速得到二值化字符串的每个比特位的熵编码结果。It is well known to those skilled in the art that in the coding mode based on the context model, when the encoder encodes a new CTU, it needs to update the context model established by each bit of the binarized character string, and each is independent. The established context model requires a certain buffer cost and increases the complexity of the encoder. With equal probability coding, the entropy coding result of each bit of the binarized string can be quickly obtained.
在本实施例中,当第一编码规则为按照第三编码原则所确定时,二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式,SAO类型的编码过程中不使用任何上下文模型,可以节省编码器更新上下文模型的操作以及缓冲(buffer)代价,保证编码器的低复杂度,同时加快视频编码速度。In this embodiment, when the first coding rule is determined according to the third coding principle, the entropy coding mode of each bit in the binarized character string is an equal probability coding mode, and the SAO type coding process does not Using any context model can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
本领域技术人员可以理解的是,对于CTU而言,其预测变换的准确度越低,其内块与块的边界块效应越明显,就越需要EO模式对其内块边界进行像素补偿,因而其内的CTB的SAO类型被决策为EO模式的概率越大。即在CTU预测变换的准确度低的情况下,迫切需要使用本申请实施例提供的第一编码规则对CTU内CTB所对应的SAO类型进行编码。It can be understood by those skilled in the art that for a CTU, the lower the accuracy of the prediction transform, the more obvious the boundary block effect of the inner block and the block, and the more the EO mode is required to perform pixel compensation on the inner block boundary thereof. The greater the probability that the SAB type of the CTB is determined to be the EO mode. That is, in the case where the accuracy of the CTU prediction transform is low, it is urgent to encode the SAO type corresponding to the CTB in the CTU by using the first coding rule provided in the embodiment of the present application.
在上述SAO类型编码方法的任一实施例的基础上,可选的,在上述按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标SAO类型所对应的目标二值化字符串的步骤之前,上述方法还可以包 括:On the basis of any of the foregoing SAO type encoding methods, optionally, the target SAO type is determined according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule. The above method can also be packaged before the step of the corresponding target binarization string include:
在决策出目标编码树块CTB的目标SAO类型后,判断是否满足预设执行条件,该预设执行条件为:用于表示目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件;After determining the target SAO type of the target coding tree block CTB, determining whether the preset execution condition is met, the preset execution condition is: a condition for indicating that the prediction transform accuracy of the target coding tree unit CTU to which the target CTB belongs is low;
如果满足,执行上述按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标SAO类型所对应的目标二值化字符串的步骤。If yes, the step of determining the target binarized character string corresponding to the target SAO type according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule is performed.
可以理解,本申请实施例中,该第一编码规则可以是按照第一编码原则或第二编码原则所确定的,也可以是按照第一~三编码原则中的任一种所确定的。It can be understood that, in the embodiment of the present application, the first coding rule may be determined according to the first coding principle or the second coding principle, or may be determined according to any one of the first to third coding principles.
例如,在图5所示方法实施例的基础上,如图6所示,在本申请实施例中,上述SAO类型的编码方法包括:For example, on the basis of the method embodiment shown in FIG. 5, as shown in FIG. 6, in the embodiment of the present application, the foregoing SAO type encoding method includes:
S201:在决策出目标编码树块CTB的目标SAO类型后,判断是否满足预设执行条件,该预设执行条件为:用于表示目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件。S201: After determining the target SAO type of the target coding tree block CTB, determining whether the preset execution condition is met, the preset execution condition is: indicating that the prediction transform accuracy of the target coding tree unit CTU to which the target CTB belongs is low. condition.
在实际应用中,编码器可以根据不同的信息进行判断,进而判定是否满足预设执行条件,作为本申请实施例的一种可选实现方式,上述判断是否满足预设执行条件的步骤,可以包括:In an actual application, the encoder may perform the determination according to different information, and then determine whether the preset execution condition is met. As an optional implementation manner of the embodiment of the present application, the step of determining whether the preset execution condition is met may include :
基于目标图像判断是否满足预设执行条件;其中,目标图像为上述目标CTU所处的图像。Determining whether the preset execution condition is satisfied based on the target image; wherein the target image is an image in which the target CTU is located.
可以理解,上述目标CTU处于该目标图像中,所以目标图像的一些图像信息可以表征出目标CTU的预测变换准确度低。It can be understood that the above target CTU is in the target image, so some image information of the target image can represent that the prediction transform accuracy of the target CTU is low.
可选的,上述基于目标图像判断是否满足预设执行条件的步骤,可以包括:Optionally, the step of determining whether the preset execution condition is met based on the target image may include:
判断目标图像是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target image meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
该目标图像为帧内预测图像;The target image is an intra prediction image;
该目标图像所使用量化参数大于第一预设阈值;The quantization parameter used by the target image is greater than the first preset threshold;
该目标图像的头信息中携带目标标识信息,其中,目标标识信息为表明 该目标图像中所有CTB所对应的SAO类型均需要按照上述第一编码规则进行编码的标识信息;The header information of the target image carries target identifier information, where the target identifier information indicates The SAO type corresponding to all CTBs in the target image needs identification information that is encoded according to the foregoing first coding rule;
该目标图像不是双向预测图像。The target image is not a bidirectional predicted image.
目标图像为帧内预测图像,即该目标图像为I帧。The target image is an intra prediction image, that is, the target image is an I frame.
目标图像所使用量化参数大于第一预设阈值,可以理解,目标图像所使用量化参数是编码器在对目标图像进行量化操作时所使用到的。该第一预设阈值可以基于实际情况预先设定,例如,该第一预设阈值设置为25。The quantization parameter used by the target image is greater than the first preset threshold. It can be understood that the quantization parameter used by the target image is used by the encoder in performing the quantization operation on the target image. The first preset threshold may be preset based on actual conditions, for example, the first preset threshold is set to 25.
该目标图像的头信息中携带有目标标识信息,可以理解为,目标图像的头信息中额外设置有一个标志位,该标志位用于标识图像中所有CTB所对应的SAO类型是否均需要按照第一编码规则进行编码的信息,例如,该标志位中标定的条件为真时,表明图像中所有CTB所对应的SAO类型均需要按照第一编码规则进行编码。另外,对于每帧视频序列图像而言,其对应的标识信息可以根据预先设定的规则进行设定。The header information of the target image carries the target identification information. It can be understood that the header information of the target image is additionally provided with a flag bit, which is used to identify whether the SAO type corresponding to all CTBs in the image needs to be in accordance with the The information encoded by an encoding rule, for example, when the condition of the calibration in the flag bit is true, indicates that the SAO type corresponding to all CTBs in the image needs to be encoded according to the first encoding rule. In addition, for each frame of the video sequence image, the corresponding identification information can be set according to a preset rule.
该目标图像不是双向预测图像,即该目标图像不是B帧,可以是I帧或者P帧。The target image is not a bi-predictive image, that is, the target image is not a B frame, and may be an I frame or a P frame.
可以理解,本实现方式中,只要目标图像符合上述4种条件中的任一种,都可以判定满足预设执行条件。例如,编码器发现该目标图像为帧内预测图像,则可以直接判定满足预设执行条件。It can be understood that, in this implementation manner, as long as the target image meets any of the above four conditions, it can be determined that the preset execution condition is satisfied. For example, if the encoder finds that the target image is an intra prediction image, it can directly determine that the preset execution condition is satisfied.
作为本申请实施例的另一种可选的实现方式,上述判断是否满足预设执行条件的步骤,可以包括:As another optional implementation manner of the embodiment of the present application, the step of determining whether the preset execution condition is met may include:
基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件。Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
即,编码器可以仅利用目标CTU自身的量化信息来判断是否满足预设执行条件,也可以仅利用目标CTU自身的预测信息来判断是否满足预设执行条件,还可以仅利用目标CTU自身的变换信息来判断是否满足预设执行条件;更可以利用目标CTU自身的量化信息、预测信息以及变换信息中的任意组合来判断是否满足预设执行条件。That is, the encoder may use only the quantization information of the target CTU itself to determine whether the preset execution condition is met, or may use only the prediction information of the target CTU itself to determine whether the preset execution condition is met, or may only utilize the transformation of the target CTU itself. The information is used to determine whether the preset execution condition is met; and any combination of the quantized information, the predicted information, and the transformed information of the target CTU itself can be used to determine whether the preset execution condition is satisfied.
可选的,上述基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件的步骤, 可以包括:Optionally, the step of determining whether the preset execution condition is met is performed according to at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs. Can include:
判断目标CTB所属目标编码树单元CTU是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target coding tree unit CTU to which the target CTB belongs meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
目标CTU中的所有预测单元均为帧内预测单元;All prediction units in the target CTU are intra prediction units;
目标CTU所使用的量化参数大于第二预设阈值,例如该目标CTU所使用的量化参数大于30;The quantization parameter used by the target CTU is greater than a second preset threshold, for example, the quantization parameter used by the target CTU is greater than 30;
目标CTU中的所有变换单元的平均大小小于第三预设阈值,例如该目标CTU中所有变换单元的平均大小小于8×8;The average size of all transform units in the target CTU is smaller than a third preset threshold, for example, the average size of all transform units in the target CTU is less than 8×8;
目标CTU中的所有编码单元的平均大小小于第四预设阈值,例如该目标CTU中所有编码单元的平均大小小于16×16。The average size of all coding units in the target CTU is less than a fourth predetermined threshold, for example, the average size of all coding units in the target CTU is less than 16×16.
同样的,本实现方式中,只要目标CTU符合上述4种条件中的任一种,都可以判定满足预设执行条件。例如,编码器发现该目标CTU所使用的量化参数为40,则可以直接判定满足预设执行条件。Similarly, in this implementation manner, as long as the target CTU meets any of the above four conditions, it can be determined that the preset execution condition is satisfied. For example, if the encoder finds that the quantization parameter used by the target CTU is 40, it can directly determine that the preset execution condition is satisfied.
作为本申请实施例的另一种可选的实现方式,上述判断是否满足预设执行条件的步骤,可以包括:As another optional implementation manner of the embodiment of the present application, the step of determining whether the preset execution condition is met may include:
判断在对目标CTB所属的目标编码树单元CTU进行去块滤波时的环路滤波强度值是否大于第五预设阈值;如果大于,判定满足预设执行条件;否则,判定不满足预设执行条件。Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
可以理解,对SAO类型进行编码的操作处于在对CTU进行的去块滤波后,所以编码器可以获知对目标CTU进行去块滤波时的环路滤波强度值,例如,该第五预设阈值为1,则编码器在发现目标CTU进行去块滤波时的环路滤波强度值大于1时,直接判定满足上述预设执行条件。It can be understood that the operation of encoding the SAO type is performed after the deblocking filtering on the CTU, so the encoder can know the loop filtering strength value when performing deblocking filtering on the target CTU, for example, the fifth preset threshold is 1. The encoder directly determines that the preset execution condition is satisfied when the loop filter strength value when the target CTU is found to perform deblocking filtering is greater than one.
需要说明的是,上述三种实现方式可以结合在一起使用,也就是说,只要编码器发现其中一种实现方式中的判断结果为是,即可以直接判定满足上述预设执行条件。It should be noted that the above three implementation manners can be used in combination, that is, as long as the encoder finds that the judgment result in one of the implementation manners is yes, it can directly determine that the preset execution condition is satisfied.
如果步骤S201的判断结果为是,执行步骤S202:按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标SAO类型所对应的目标二值化字符串,其中,第一编码规则中记录有各SAO类型与二值化字符串的对应关系,以及二值化字符串的熵编码方式。 If the result of the determination in step S201 is YES, step S202 is performed to determine the target binarized character corresponding to the target SAO type according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule. a string, wherein the first encoding rule records a correspondence between each SAO type and a binarized character string, and an entropy encoding manner of the binarized character string.
需要说明的是,如果步骤S201的判断结果为否,编码器可以不用按照本申请实施例中设定的第一编码规则对目标CTB进行编码,其可以直接按照现有HEVC标准中规定的编码规则对目标CTB进行编码。It should be noted that if the result of the determination in step S201 is no, the encoder may not encode the target CTB according to the first coding rule set in the embodiment of the present application, and may directly follow the coding rules specified in the existing HEVC standard. The target CTB is encoded.
S203:按照第一编码规则中记录的二值化字符串的熵编码方式,对目标二值化字符串进行熵编码,得到目标SAO类型所对应的编码结果。S203: Entropy coding the target binarized character string according to the entropy coding manner of the binarized character string recorded in the first coding rule, to obtain an encoding result corresponding to the target SAO type.
其中,该第一编码规则为按照下述编码原则中的任一种所确定的:Wherein the first coding rule is determined according to any one of the following coding principles:
第一编码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first coding principle: the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
第二编码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式。The second coding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
需要说明的是,上述步骤S202、S203分别与图5所示方法实施例中的步骤S101、S102相同,步骤S202、S203的相关内容和解释说明可以参照图5所示方法实施例,本申请实施例在此不做详细介绍。It should be noted that the above steps S202 and S203 are the same as the steps S101 and S102 in the method embodiment shown in FIG. 5, and the related content and explanation of the steps S202 and S203 can be referred to the method embodiment shown in FIG. The example is not described in detail here.
与SAO类型的编码方法相对应的,本申请实施例还提供了一种SAO类型的解码方法,同理,该解码方法可以应用于解码器中,在实际应用中,该解码器可以是一个实体设备,当然也可以是一个可实现视频解码功能的程序,这都是合理的,本申请实施例并不限定该解码器的具体形式。Corresponding to the coding method of the SAO type, the embodiment of the present application further provides a decoding method of the SAO type. Similarly, the decoding method can be applied to a decoder. In an actual application, the decoder can be an entity. The device, of course, may also be a program that can implement the video decoding function, which is reasonable. The embodiment of the present application does not limit the specific form of the decoder.
如图7所示,该解码方法包括:As shown in FIG. 7, the decoding method includes:
S301:按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到目标二值化字符串;其中,第一解码规则记录有被编码二值化字符串的熵解码方式,以及各SAO类型与二值化字符串的对应关系。S301: Entropy decoding the encoded target binarized character string corresponding to the target coding tree block CTB according to an entropy decoding manner of the encoded binarized character string recorded in the preset first decoding rule, to obtain a target binary value. The first decoding rule records an entropy decoding manner of the encoded binarized character string, and a correspondence between each SAO type and the binarized character string.
可以理解,作为编码的逆过程,解码器能够获得的上述目标CTB所对应被编码的目标二值化字符串,即前述SAO类型的解码方法的方法实施例中所涉及的目标SAO类型所对应的编码结果。It can be understood that, as an inverse process of the encoding, the target binarized character string corresponding to the target CTB that can be obtained by the decoder, that is, the target SAO type involved in the method embodiment of the foregoing SAO type decoding method is corresponding. The result of the encoding.
同理于编码过程,第一解码规则中记录的被编码二值化字符串的熵解码方式可以理解为:被编码二值化字符串中每个比特位所采用的具体熵解码方 式。针对上述每个比特位的解码方式,可以有两种:基于上下文模型的解码方式以及等概率解码方式。Similarly, in the encoding process, the entropy decoding mode of the encoded binarized character string recorded in the first decoding rule can be understood as: the specific entropy decoding method used by each bit in the encoded binarized character string. formula. There are two types of decoding methods for each of the above bits: a context model based decoding method and an equal probability decoding method.
基于上下文模型的解码方式以及等概率解码方式都属于公知技术,两种解码方式的具体实现方法本申请实施例在此不做详细介绍。但本领域技术人员公知的是,如果被编码二值化字符串中的比特位利用基于上下文模型的解码方式进行熵解码,则该比特位的解码效率高;而如果被编码二值化字符串中的比特位利用等概率解码方式进行熵解码,则该比特位的解码速度高。The decoding method based on the context model and the equal-probability decoding method are all well-known technologies, and the specific implementation methods of the two decoding methods are not described in detail herein. However, it is well known to those skilled in the art that if the bits in the encoded binarized character string are entropy decoded using a context model based decoding method, the decoding efficiency of the bit is high; and if the binarized string is encoded The bit in the bit is entropy decoded by the equal probability decoding method, and the decoding speed of the bit is high.
S302:按照第一解码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标二值化字符串所对应的目标SAO类型。S302: Determine, according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule, the target SAO type corresponding to the target binarized character string.
其中,第一解码规则为按照下述解码原则中的任一种所确定的:Wherein, the first decoding rule is determined according to any one of the following decoding principles:
第一解码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first decoding principle: the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
第二解码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应被编码二值化字符串的比特位的熵解码方式为基于上下文模型的解码方式。The second decoding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy decoding method for distinguishing the bits corresponding to the encoded binarized character string respectively for the EO mode and the BO mode is based on The way the context model is decoded.
本申请实施例中的第一解码规则同样为预先设定的,但是并不表示该第一解码规则是随机设定的,该第一解码规则需要按照上述第一解码原则和第二解码原则中的任一种所设定。并且,在设定了第一解码规则后,对任何一个视频进行解码时,该视频的解码过程中所使用的第一解码规则都是相同的。The first decoding rule in the embodiment of the present application is also preset, but does not mean that the first decoding rule is randomly set, and the first decoding rule needs to be in accordance with the foregoing first decoding principle and the second decoding principle. Any one of them is set. Moreover, when any one video is decoded after the first decoding rule is set, the first decoding rule used in the decoding process of the video is the same.
同样的,一种实现方式中,用于确定第一解码规则的解码原则,可以是在视频解码过程中根据当前图像的编码参数、当前编码单元的编码参数(等信息,从上述第一解码原则、第二解码原则中选择出来的,之后依据选择出来的解码原则确定上述第一解码规则的具体规则内容。Similarly, in an implementation manner, the decoding principle used to determine the first decoding rule may be: according to the encoding parameter of the current image, the encoding parameter of the current coding unit, and the like in the video decoding process, from the foregoing first decoding principle. And selecting the second decoding principle, and then determining the specific rule content of the first decoding rule according to the selected decoding principle.
需要注意的是,为了保证编码器生成的针对目标SAO类型所对应的编码结果能够被解码器所解码,可以预先设置编码器所应用的上述第一编码规则应该与解码器所应用的第一解码规则所对应。It is to be noted that, in order to ensure that the coding result corresponding to the target SAO type generated by the encoder can be decoded by the decoder, the first decoding rule applied by the encoder and the first decoding applied by the decoder may be preset. Corresponding to the rules.
本申请实施例中,第一解码原则规定:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;即:EO模式所对应二值化字符串的长度小于BO模式所对应二值化字符串的长 度,或者EO模式所对应二值化字符串的长度小于BO模式所对应二值化字符串的长度。In the embodiment of the present application, the first decoding principle specifies that the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode; that is, the EO mode corresponds to The length of the binarized string is less than the length of the binarized string corresponding to the BO mode. The length of the binary string corresponding to the degree or the EO mode is smaller than the length of the binarized string corresponding to the BO mode.
可以理解,第一解码原则仅对各SAO类型与二值化字符串的对应关系做了限定,对被编码二值化字符串的熵解码方式并不做限定,所以根据第一解码原则确定的不同解码规则中,二值化字符串中的同一个比特位,有的设定该比特位用等概率解码方式进行熵解码,有的设定该比特位用基于上下文模型的解码方式进行熵解码。It can be understood that the first decoding principle only limits the correspondence between each SAO type and the binarized character string, and the entropy decoding manner of the encoded binary string is not limited, so it is determined according to the first decoding principle. In different decoding rules, the same bit in the binarized string is set, and some bits are set to be entropy decoded by equal probability decoding, and some bits are set to be entropy decoded by using a context model based decoding method. .
作为本申请实施例的一种可选实现方式,按照第一解码原则确定的第一解码规则,可以是:As an optional implementation manner of the embodiment of the present application, the first decoding rule determined according to the first decoding principle may be:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to EO mode, skip mode and BO mode are 0, 10, 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model The way to decode.
在此实现方式下,第一解码规则中所记录的各SAO类型与二值化字符串的对应关系为:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;所记录的被编码二值化字符串的熵解码方式为:二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。In this implementation manner, the correspondence between each SAO type and the binarized character string recorded in the first decoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively. The entropy decoding mode of the recorded binarized character string is: the entropy decoding mode of each bit of the binarized character string is a decoding mode based on the context model.
示例性的,对于待解码的SAO类型,解码器首先针对被编码二值化字符串中的两个比特位,均利用基于上下文模型的解码方式进行熵解码,得到目标二值化字符串11;然后按照上述对应关系,确定目标二值化字符串11所对应的SAO类型为BO模式。Exemplarily, for the SAO type to be decoded, the decoder first performs entropy decoding on the two bits in the encoded binarized character string by using a context model based decoding manner to obtain a target binarized character string 11; Then, according to the above correspondence, it is determined that the SAO type corresponding to the target binarized character string 11 is the BO mode.
可以理解,与此第一解码规则相对应的第一编码规则,为:It can be understood that the first encoding rule corresponding to the first decoding rule is:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized string is based on the context model. the way.
故,在此实现方式下,与该第一解码规则对应的第一编码规则中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以该第一编码规则进行SAO 类型的编码时,可以提高视频编码效率。另外,利用该第一编码规则进行编码时,二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式,编码器对各种SAO类型进行的编码的压缩比高,进一步提高视频编码效率。Therefore, in this implementation manner, in the first coding rule corresponding to the first decoding rule, the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode is The codeword is less, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the EO mode is more likely to be used in the video encoding process than the BO mode, even larger than Skip mode usage probability; so the first encoding rule performs SAO When coding of a type, video coding efficiency can be improved. In addition, when encoding by using the first coding rule, the entropy coding mode of each bit of the binarized character string is a coding mode based on a context model, and the coding ratio of the coding performed by the encoder on various SAO types is high. Further improve the video coding efficiency.
作为本申请实施例的另一种可选实现方式,按照第一解码原则确定的第一解码规则,也可以是:As another optional implementation manner of the embodiment of the present application, the first decoding rule determined according to the first decoding principle may also be:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为等概率解码的方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
在此实现方式下,第一解码规则中所记录的各SAO类型与二值化字符串的对应关系为:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;所记录的被编码二值化字符串的熵解码方式为:被编码二值化字符串的每个比特位的熵编码方式均为等概率解码的方式。In this implementation manner, the correspondence between each SAO type and the binarized character string recorded in the first decoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively. The entropy decoding mode of the recorded binarized character string is as follows: the entropy coding mode of each bit of the encoded binarized character string is a method of equal probability decoding.
示例性的,对于待解码的SAO类型,解码器首先针对被编码的二值化字符串中的两个比特位,均利用基于上下文模型的解码方式进行熵解码,得到目标二值化字符串10;然后按照上述对应关系,确定目标二值化字符串10所对应的SAO类型为跳过模式。Exemplarily, for the SAO type to be decoded, the decoder first performs entropy decoding on the two bits in the encoded binarized character string by using a context model based decoding manner to obtain a target binarized character string 10 Then, according to the above correspondence, it is determined that the SAO type corresponding to the target binarized character string 10 is the skip mode.
可以理解,与此第一解码规则相对应的第一编码规则,为:It can be understood that the first encoding rule corresponding to the first decoding rule is:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为等概率编码的方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
故,在此实现方式下,与该第一解码规则对应的第一编码规则中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照此实现方式下的第一编码规则进行SAO类型的编码时,可以提高视频编码效率。另外,应用该第一编码规则后,二值化字符串的每个比特位的熵编码方式均为等概率编码的编码方式,编码器对各种SAO类型进行的编码的速度快,所以按照此实现方 式下的第一编码规则进行SAO类型的编码时,还可以提高视频编码速度。Therefore, in this implementation manner, in the first coding rule corresponding to the first decoding rule, the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode is The codeword is less, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the EO mode is more likely to be used in the video encoding process than the BO mode, even larger than The probability of use of the skip mode; therefore, when the SAO type encoding is performed according to the first encoding rule in this implementation manner, the video encoding efficiency can be improved. In addition, after applying the first encoding rule, the entropy encoding mode of each bit of the binarized character string is an encoding method of equal probability encoding, and the encoding speed of the encoder for various SAO types is fast, so according to this Implementer When the first encoding rule under the formula performs SAO type encoding, the video encoding speed can also be improved.
作为本申请实施例的再一种可选实现方式,按照第一解码原则确定的第一解码规则,还可以是:As a further optional implementation manner of the embodiment of the present application, the first decoding rule determined according to the first decoding principle may also be:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且针对每一个被编码二值化字符串,该被编码二值化字符串的第一个比特位的解码方式为等概率解码的方式,在该被编码二值化字符串还包括第二个比特位的情况下,该被编码二值化字符串的第二个比特位的解码方式为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each encoded binarized string, the encoded binary string is The decoding mode of one bit is a method of equal probability decoding, and in the case where the encoded binarized character string further includes the second bit, the decoding of the second bit of the encoded binarized character string The mode is a context model based decoding method.
在此实现方式下,第一解码规则中所记录的各SAO类型与二值化字符串的对应关系为:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;所记录的被编码二值化字符串的熵解码方式为:针对每一个二值化字符串,该二值化字符串的第一个比特位的解码方式为等概率解码的方式,在该二值化字符串还包括第二个比特位的情况下,该二值化字符串的第二个比特位的编码方式为基于上下文模型的解码方式。In this implementation manner, the correspondence between each SAO type and the binarized character string recorded in the first decoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively. And 11; the entropy decoding manner of the recorded binarized character string is: for each binarized character string, the decoding manner of the first bit of the binarized character string is a method of equal probability decoding, In the case where the binarized character string further includes the second bit, the encoding mode of the second bit of the binarized character string is a context model based decoding mode.
示例性的,对于待解码的SAO类型,解码器发现被编码的二值化字符串只有一个比特位,则首先针对被编码的二值化字符串中的比特位,利用等概率解码的方式进行熵解码,得到目标二值化字符串0;然后按照上述对应关系,确定目标二值化字符串0所对应的SAO类型为EO模式。Exemplarily, for the SAO type to be decoded, the decoder finds that the encoded binary string has only one bit, and firstly uses the equal probability decoding method for the bits in the encoded binarized string. Entropy decoding obtains the target binarized string 0; then, according to the above correspondence, it is determined that the SAO type corresponding to the target binarized string 0 is the EO mode.
可以理解,与此第一解码规则相对应的第一编码规则,为:It can be understood that the first encoding rule corresponding to the first decoding rule is:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、11、10;且针对每一个二值化字符串,该二值化字符串的第一个比特位的编码方式为基于上下文模型的编码方式,在该二值化字符串还包括第二个比特位的情况下,该二值化字符串的第二个比特位的编码方式为等概率编码的方式。Encoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 11, and 10, respectively; and for each binarized string, the first bit of the binarized string The coding mode is a context model based coding mode. When the binary character string further includes a second bit, the coding mode of the second bit of the binarized character string is an equal probability coding mode. .
故,在此实现方式下,与该第一解码规则对应的第一编码规则中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照此实现方式下的第一 编码规则进行SAO类型的编码时,可以提高视频编码效率。Therefore, in this implementation manner, in the first coding rule corresponding to the first decoding rule, the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode is The codeword is less, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the EO mode is more likely to be used in the video encoding process than the BO mode, even larger than Skip mode usage probability; so follow the first in this implementation When the encoding rule performs the encoding of the SAO type, the video encoding efficiency can be improved.
当然,按照上述第一解码原则所确定的第一解码规则并不限于上述3种实现方式,还可以是其它的第一解码规则。例如,按照第一解码原则确定的第一解码规则,还可以是:Certainly, the first decoding rule determined according to the foregoing first decoding principle is not limited to the foregoing three implementation manners, and may be other first decoding rules. For example, the first decoding rule determined according to the first decoding principle may also be:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、11、10;且针对每一个被编码二值化字符串,该被编码二值化字符串的第一个比特位的解码方式为基于上下文模型的解码方式,在该被编码二值化字符串还包括第二个比特位的情况下,该被编码二值化字符串的第二个比特位的解码方式为等概率解码的方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 11, and 10, respectively; and for each of the encoded binarized strings, the encoded binary string is The decoding mode of one bit is a context mode based decoding mode, and in the case where the encoded binarized character string further includes a second bit, the second bit of the encoded binarized character string The decoding method is a method of equal probability decoding.
再如,按照第一解码原则确定的第一解码规则,还可以是:For another example, the first decoding rule determined according to the first decoding principle may also be:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、11、10;且被编码二值化字符串的每个比特位的熵解码方式均为等概率解码的方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 11, and 10, respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
本申请实施例中,第二解码原则规定:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应被编码二值化字符串的比特位的熵解码方式为基于上下文模型的解码方式。In the embodiment of the present application, the second decoding principle stipulates that the EO mode and the BO mode respectively have the same length of the binarized character string; and are used to distinguish the EO mode and the BO mode respectively corresponding to the bits of the encoded binary string. The entropy decoding mode of the bit is a decoding method based on the context model.
可以理解,如果第一解码原则为按照第二解码原则确定的,则该第一解码原则对应的第一编码规则中,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以利用按照该第一编码规则进行SAO类型的编码方式,可以提高视频编码效率。It can be understood that, if the first decoding principle is determined according to the second decoding principle, the first coding rule corresponding to the first decoding principle is used to distinguish the EO mode and the BO mode respectively corresponding to the binarized character string. The entropy coding method is a coding mode based on the context model, and the encoder has a high compression ratio for the coding of the two types of SAOs, the EO mode and the BO mode, so that the coding method of the SAO type according to the first coding rule can be improved. Video coding efficiency.
作为本申请实施例的一种可选实现方式,按照第二解码原则确定的第一解码规则,可以是:As an optional implementation manner of the embodiment of the present application, the first decoding rule determined according to the second decoding principle may be:
解码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model. The way to decode.
示例性的,对于待解码的SAO类型,解码器首先针对被编码的二值化字符串中的两个比特位,均利用基于上下文模型的解码方式进行熵解码,得到目标二值化字符串10;然后按照上述对应关系,确定目标二值化字符串10所 对应的SAO类型为BO模式。Exemplarily, for the SAO type to be decoded, the decoder first performs entropy decoding on the two bits in the encoded binarized character string by using a context model based decoding manner to obtain a target binarized character string 10 Then, according to the above correspondence, the target binarization string 10 is determined. The corresponding SAO type is BO mode.
可以理解,与此第一解码规则相对应的第一编码规则,为:It can be understood that the first encoding rule corresponding to the first decoding rule is:
编码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is based on the context model. the way.
当然,按照上述第二解码原则所确定的第一解码规则并不限于上述实现方式,还可以是其它的第一解码规则。例如,按照第二解码原则确定的第一解码规则,还可以是:Certainly, the first decoding rule determined according to the foregoing second decoding principle is not limited to the foregoing implementation manner, and may be other first decoding rules. For example, the first decoding rule determined according to the second decoding principle may also be:
解码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、11、10;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 11, and 10, respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model. The way to decode.
由以上可知,在第一解码规则为按照第一解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,由于本申请实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即应用于该第一解码规则相匹配的第一编码规则的编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本申请实施例提供的方案可以提高视频编码效率。It can be seen from the above that, in the case that the first decoding rule is determined according to the first decoding principle, the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, because the solution provided by the embodiment of the present application The length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codeword, that is, the first coding rule applied to match the first decoding rule. The encoder can encode the SAO type of EO mode with a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than that of the BO mode, and sometimes even greater than the skip mode. Probability; Therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the solution provided by the embodiment of the present application can improve the video coding efficiency.
在第一解码规则为按照第二解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,由于本申请实施例提供的方案中,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以本申请实施例提供的方案同样可以提高视频编码效率。In the case where the first decoding rule is determined according to the second decoding principle, the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, which is used in the solution provided by the embodiment of the present application. The entropy coding method for distinguishing the bits of the binarized character string corresponding to the EO mode and the BO mode respectively is a coding mode based on the context model, so the encoder pair is used to distinguish the EO mode and the BO mode respectively corresponding to the binarized character string. The compression ratio of the entropy coding performed by the bit is high, that is, the compression ratio of the encoding of the two types of SAOs of the EO mode and the BO mode is high, so the scheme provided by the embodiment of the present application can also improve the video coding efficiency.
在上述SAO类型的解码方法所述的方法实施例的基础上,第一解码规则 还可以为按照第一解码原则、第二解码原则以及第三解码原则中的任一种所确定的;Based on the method embodiment described in the above SAO type decoding method, the first decoding rule It may also be determined according to any one of the first decoding principle, the second decoding principle, and the third decoding principle;
该第三解码原则为:被编码二值化字符串中的每一个比特位的熵解码方式均为等概率解码方式。The third decoding principle is that the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode.
同理,该用于确定第一解码规则的解码原则可以是预先选定的,也可以是在视频解码过程中所根据编码参数所实时选定的,这都是合理的,本申请实施例在此并不限定用于确定第一解码规则的解码原则的选择方式。For the same reason, the decoding principle for determining the first decoding rule may be pre-selected, or may be selected in real time according to the encoding parameters in the video decoding process, which is reasonable, and the embodiment of the present application is This does not limit the way in which the decoding principles for determining the first decoding rule are determined.
作为本申请实施例的一种可选实现方式,按照第三解码原则确定的第一解码规则,可以是:As an optional implementation manner of the embodiment of the present application, the first decoding rule determined according to the third decoding principle may be:
解码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为等概率解码方式。Decoding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. the way.
示例性的,对于待解码的SAO类型,解码器首先针对被编码的二值化字符串中的两个比特位,均利用等概率解码方式进行熵解码,得到目标二值化字符串10;然后按照上述对应关系,确定目标二值化字符串10所对应的SAO类型为BO模式。Exemplarily, for the SAO type to be decoded, the decoder first performs entropy decoding on the two bits in the encoded binarized character string by using an equal probability decoding manner to obtain a target binarized character string 10; According to the above correspondence, it is determined that the SAO type corresponding to the target binarized character string 10 is the BO mode.
可以理解,与此第一解码规则相对应的第一编码规则,为:It can be understood that the first encoding rule corresponding to the first decoding rule is:
编码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为等概率编码方式。Coding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding mode.
作为本申请实施例的另一种可选实现方式,按照第一解码原则确定的第一解码规则,也可以是:As another optional implementation manner of the embodiment of the present application, the first decoding rule determined according to the first decoding principle may also be:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为等概率解码的方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
在此实现方式下,第一解码规则中所记录的各SAO类型与二值化字符串的对应关系为:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;所记录的被编码二值化字符串的熵编码方式为:被编码二值化字符串的每个比特位的熵编码方式均为等概率解码的方式。In this implementation manner, the correspondence between each SAO type and the binarized character string recorded in the first decoding rule is: the binarized character strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, respectively. The entropy coding mode of the recorded binarized character string is as follows: the entropy coding mode of each bit of the coded binarized character string is a method of equal probability decoding.
示例性的,对于待解码的SAO类型,解码器首先针对被编码的二值化字 符串中的两个比特位,均利用基于上下文模型的解码方式进行熵解码,得到目标二值化字符串10;然后按照上述对应关系,确定目标二值化字符串10所对应的SAO类型为跳过模式。Illustratively, for the type of SAO to be decoded, the decoder first targets the encoded binarized word. The two bits in the character string are entropy decoded by using the context model based decoding method to obtain the target binarized character string 10; then, according to the above correspondence, the SAO type corresponding to the target binarized character string 10 is determined as Skip mode.
可以理解,与此第一解码规则相对应的第一编码规则,为:It can be understood that the first encoding rule corresponding to the first decoding rule is:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为等概率编码的方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
故,在此实现方式下,与该第一解码规则对应的第一编码规则中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照此实现方式下的第一编码规则进行SAO类型的编码时,可以提高视频编码效率。另外,应用该第一编码规则后,二值化字符串的每个比特位的熵编码方式均为等概率编码的编码方式,编码器对各种SAO类型进行的编码的速度快,所以按照此实现方式下的第一编码规则进行SAO类型的编码时,还可以提高视频编码速度。Therefore, in this implementation manner, in the first coding rule corresponding to the first decoding rule, the length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode is The codeword is less, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the EO mode is more likely to be used in the video encoding process than the BO mode, even larger than The probability of use of the skip mode; therefore, when the SAO type encoding is performed according to the first encoding rule in this implementation manner, the video encoding efficiency can be improved. In addition, after applying the first encoding rule, the entropy encoding mode of each bit of the binarized character string is an encoding method of equal probability encoding, and the encoding speed of the encoder for various SAO types is fast, so according to this When the first encoding rule in the implementation mode performs the SAO type encoding, the video encoding speed can also be improved.
当然,按照上述第三解码原则所确定的第一解码规则并不限于上述两种实现方式,还可以是其它的第一解码规则。例如,按照第三解码原则确定的第一解码规则,还可以是:Certainly, the first decoding rule determined according to the foregoing third decoding principle is not limited to the foregoing two implementation manners, and may be other first decoding rules. For example, the first decoding rule determined according to the third decoding principle may also be:
编码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、11、10;且被编码二值化字符串的每个比特位的熵解码方式均为等概率解码方式。Encoding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 11, and 10, respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. the way.
本领域技术人员公知的是,基于上下文模型的解码方式中,编码器在对一个新的CTU进行解码时,需要更新二值化字符串的每个比特位所建立的上下文模型,而且每个独立建立的上下文模型需要一定的缓冲代价,增加了解码器的复杂度,而使用等概率解码,可以快速得到被编码二值化字符串的每个比特位的熵解码结果。It is well known to those skilled in the art that in the context model based decoding mode, when decoding a new CTU, the encoder needs to update the context model established by each bit of the binarized character string, and each is independent. The established context model requires a certain buffering cost and increases the complexity of the decoder. With equal probability decoding, the entropy decoding result of each bit of the encoded binarized string can be quickly obtained.
在本申请实施例中,当第一编码规则按照第三编码原则所确定时,被编码二值化字符串中的每一个比特位的熵解码方式均为等概率解码方式,SAO 类型的解码过程中不使用任何上下文模型,可以节省解码器更新上下文模型的操作以及缓冲代价,保证解码器的低复杂度,同时加快视频解码速度。In the embodiment of the present application, when the first coding rule is determined according to the third coding principle, the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode, SAO The type decoding process does not use any context model, which saves the decoder's operation of updating the context model and the buffering cost, ensures the low complexity of the decoder, and speeds up the video decoding speed.
另外,从编码器角度而言,在第一解码规则为按照第三解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式,SAO类型的编码过程中不使用任何上下文模型,可以节省编码器更新上下文模型的操作以及缓冲(buffer)代价,保证编码器的低复杂度,同时加快视频编码速度。In addition, from the perspective of the encoder, in the case where the first decoding rule is determined according to the third decoding principle, the encoder performs SAO type encoding by using the first encoding rule matched with the first decoding rule, binarization The entropy coding mode of each bit in the string is an equal probability coding mode. The SAO type coding process does not use any context model, which can save the operation of the encoder update context model and the buffer cost, and ensure the encoder. Low complexity while speeding up video encoding.
与编码过程相对应的,本领域技术人员可以理解的是,对于CTU而言,其预测变换的准确度越低,其内块与块的边界块效应越明显,就越需要EO模式对其内块边界进行像素补偿,因而其内的CTB的SAO类型被决策为EO模式的概率越大。即在CTU预测变换的准确度低的情况下,迫切需要使用本申请实施例提供的第一解码规则对CTU对应的被编码的SAO类型进行解码。Corresponding to the encoding process, those skilled in the art can understand that the lower the accuracy of the prediction transform for the CTU, the more obvious the boundary block effect of the inner block and the block, and the more the EO mode is needed. The block boundaries are pixel compensated, so the probability that the SAB type of the CTB within it is determined to be the EO mode is greater. That is, in the case where the accuracy of the CTU prediction transform is low, it is urgent to decode the encoded SAO type corresponding to the CTU by using the first decoding rule provided by the embodiment of the present application.
与图6所示方法实施例相对应的,在上述按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到目标二值化字符串的步骤之前,上述方法还包括:Corresponding to the method embodiment shown in FIG. 6, in the entropy decoding manner of the encoded binarized character string recorded in the foregoing first decoding rule, the target coded tree block corresponding to the target coding tree block CTB is encoded. Before the step of entropy decoding the valued string to obtain the target binarized string, the method further includes:
针对目标编码树块CTB所对应被编码的目标二值化字符串,判断是否满足预设执行条件,该预设执行条件为:用于表示目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件;Determining whether the preset execution condition is met for the target binarized character string corresponding to the target coding tree block CTB, the preset execution condition being: indicating the prediction transformation accuracy of the target coding tree unit CTU to which the target CTB belongs Low condition
如果满足,执行上述按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到目标二值化字符串的步骤。If the entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule is performed, entropy decoding the encoded target binarized character string corresponding to the target coding tree block CTB is performed. The step of the target binarizing the string.
可以理解,本申请实施例中,该第一解码规则可以是按照第一解码原则或第二解码原则所确定的,也可以是按照第一~三解码原则中的任一种所确定的。It can be understood that, in this embodiment of the present application, the first decoding rule may be determined according to the first decoding principle or the second decoding principle, or may be determined according to any one of the first to third decoding principles.
在本申请实施例中,如图8所示,上述SAO类型的解码方法包括:In the embodiment of the present application, as shown in FIG. 8, the foregoing SAO type decoding method includes:
S401:针对目标编码树块CTB所对应被编码的目标二值化字符串,判断 是否满足预设执行条件,该预设执行条件为:用于表示目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件。S401: determining, according to the target binarized character string corresponding to the target coding tree block CTB, Whether the preset execution condition is satisfied, the preset execution condition is a condition for indicating that the prediction conversion accuracy of the target coding tree unit CTU to which the target CTB belongs is low.
如前所述,编码器可以根据不同的信息进行判断,进而判定是否满足预设执行条件,而编码器所根据的这些信息通常是存在于视频码流中,所以解码器同样可以根据此处所述的不同的信息进行判断,进而判定是否满足预设执行条件。As described above, the encoder can judge according to different information, and then determine whether the preset execution condition is met, and the information according to the encoder is usually present in the video bitstream, so the decoder can also be based on the The different information described is judged to determine whether the preset execution condition is satisfied.
作为本申请实施例的一种可选实现方式,上述判断是否满足预设执行条件的步骤,可以包括:As an optional implementation manner of the embodiment of the present application, the step of determining whether the preset execution condition is met may include:
基于目标图像判断是否满足预设执行条件;其中,目标图像为目标CTU所处的图像。Determining whether the preset execution condition is satisfied based on the target image; wherein the target image is an image in which the target CTU is located.
可选的,上述基于目标图像判断是否满足预设执行条件的步骤,可以包括:Optionally, the step of determining whether the preset execution condition is met based on the target image may include:
判断目标图像是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target image meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
该目标图像为帧内预测图像;The target image is an intra prediction image;
该目标图像所使用量化参数大于第一预设阈值;The quantization parameter used by the target image is greater than the first preset threshold;
该目标图像的头信息中携带目标标识信息,其中,目标标识信息为表明该目标图像中所有CTB所对应的SAO类型均需要按照上述第一编码规则进行编码的标识信息;The header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
该目标图像不是双向预测图像。The target image is not a bidirectional predicted image.
作为本申请实施例的另一种可选实现方式,上述判断是否满足预设执行条件的步骤,可以包括:As another optional implementation manner of the embodiment of the present application, the step of determining whether the preset execution condition is met may include:
基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件。Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
可选的,上述基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件的步骤,可以包括:Optionally, the step of determining whether the preset execution condition is met, according to at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs, may include:
判断目标CTB所属目标编码树单元CTU是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件: Determining whether the target coding tree unit CTU to which the target CTB belongs meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
目标CTU中的所有预测单元均为帧内预测单元;All prediction units in the target CTU are intra prediction units;
目标CTU所使用的量化参数大于第二预设阈值;The quantization parameter used by the target CTU is greater than a second preset threshold;
目标CTU中的所有变换单元的平均大小小于第三预设阈值;The average size of all transform units in the target CTU is less than a third preset threshold;
目标CTU中的所有编码单元的平均大小小于第四预设阈值。The average size of all coding units in the target CTU is less than a fourth predetermined threshold.
作为本申请实施例的又一种可选实现方式,上述判断是否满足预设执行条件的步骤,可以包括:As a further optional implementation manner of the embodiment of the present application, the step of determining whether the preset execution condition is met may include:
判断在对目标CTB所属的目标编码树单元CTU进行去块滤波时的环路滤波强度值是否大于第五预设阈值;如果大于,判定满足预设执行条件;否则,判定不满足预设执行条件。Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
需要说明的是,编码器实现判断是否满足预设执行条件的具体方式可以参照前述实施例中编码器实现判断是否满足预设执行条件的具体方式,本申请实施例在此不做详细介绍。It should be noted that the specific manner of the encoder to determine whether the preset execution condition is met may be referred to the specific manner of determining whether the preset execution condition is met by the encoder in the foregoing embodiment. The embodiment of the present application is not described in detail herein.
如果步骤S401的判断结果为是,执行步骤S402:按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到目标二值化字符串;其中,第一解码规则记录有被编码二值化字符串的熵解码方式,以及各SAO类型与二值化字符串的对应关系;If the result of the determination in step S401 is YES, step S402 is executed: the target binary value corresponding to the target coding tree block CTB is encoded according to the entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule. Entropy decoding of the character string to obtain a target binarized character string; wherein, the first decoding rule records an entropy decoding mode of the encoded binarized character string, and a correspondence relationship between each SAO type and the binarized character string;
需要说明的是,如果步骤S401的判断结果为否,解码器可以不用按照本申请实施例中设定的第一解码规则对被编码二值化字符串进行解码,其可以直接按照现有HEVC标准中规定的解码规则对被编码二值化字符串进行解码。It should be noted that if the result of the determination in step S401 is no, the decoder may not decode the encoded binary string according to the first decoding rule set in the embodiment of the present application, which may directly follow the existing HEVC standard. The decoding rule specified in the decoding of the encoded binarized character string.
S403:按照第一解码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标二值化字符串所对应的目标SAO类型。S403: Determine, according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule, the target SAO type corresponding to the target binarized character string.
其中,第一解码规则为按照下述解码原则中的任一种所确定的:Wherein, the first decoding rule is determined according to any one of the following decoding principles:
第一解码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first decoding principle: the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
第二解码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应被编码二值化字符串的比特位的熵解码方式为基于上下文模型的解码方式。 The second decoding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy decoding method for distinguishing the bits corresponding to the encoded binarized character string respectively for the EO mode and the BO mode is based on The way the context model is decoded.
需要说明的是,上述步骤S402、S403分别与图7所示方法实施例中的步骤S301、S302相同,步骤S402、S403的相关内容和解释说明可以参照图7所示方法实施例,本申请实施例在此不做详细介绍。It should be noted that the above steps S402 and S403 are respectively the same as the steps S301 and S302 in the method embodiment shown in FIG. 7. The related content and explanation of the steps S402 and S403 can be referred to the method embodiment shown in FIG. The example is not described in detail here.
相应于图5所示方法实施例,本申请实施例提供了一种SAO类型的编码装置,如图9所示,该装置包括:Corresponding to the method embodiment shown in FIG. 5, the embodiment of the present application provides an SAO type encoding device. As shown in FIG. 9, the device includes:
第一确定模块510,用于在决策出目标编码树块CTB的目标SAO类型后,按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标SAO类型所对应的目标二值化字符串,其中,第一编码规则中记录有各SAO类型与二值化字符串的对应关系,以及二值化字符串的熵编码方式;The first determining module 510 is configured to determine, according to the target SAO type of the target coding tree block CTB, the target SAO according to the correspondence between each SAO type and the binarized character string recorded in the preset first coding rule. a target binarized character string corresponding to the type, wherein the first encoding rule records a correspondence between each SAO type and the binarized character string, and an entropy encoding mode of the binarized character string;
熵编码模块520,用于按照第一编码规则中记录的二值化字符串的熵编码方式,对目标二值化字符串进行熵编码,得到目标SAO类型所对应的编码结果;The entropy coding module 520 is configured to perform entropy coding on the target binarized character string according to the entropy coding manner of the binarized character string recorded in the first coding rule, to obtain an encoding result corresponding to the target SAO type;
其中,该第一编码规则为按照下述编码原则中的任一种所确定的:Wherein the first coding rule is determined according to any one of the following coding principles:
第一编码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first coding principle: the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
第二编码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式。The second coding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
具体的,第一编码规则可以为按照第一编码原则、第二编码原则以及第三编码原则中的任一种所确定的;Specifically, the first coding rule may be determined according to any one of a first coding principle, a second coding principle, and a third coding principle;
该第三编码原则为:二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式。The third coding principle is that the entropy coding mode of each bit in the binarized character string is an equal probability coding mode.
相应于图6所示方法实施例,如图10所示,上述装置还可以包括:Corresponding to the method embodiment shown in FIG. 6, as shown in FIG. 10, the foregoing apparatus may further include:
第一判断模块530,用于在决策出目标编码树块CTB的目标SAO类型后,判断是否满足预设执行条件,上述预设执行条件为:用于表示目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件;The first determining module 530 is configured to determine whether the preset execution condition is met after the target SAO type of the target coding tree block CTB is determined, where the preset execution condition is: used to indicate the target coding tree unit CTU to which the target CTB belongs Predicting the condition that the transformation accuracy is low;
相应的,第一确定模块510,可以具体用于: Correspondingly, the first determining module 510 can be specifically configured to:
在第一判断模块530的判断结果为是的情况下,按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标SAO类型所对应的目标二值化字符串。When the determination result of the first judging module 530 is YES, the target binary value corresponding to the target SAO type is determined according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule. String.
作为本申请实施例的一种可选实现方式,上述第一判断模块530,可以具体用于:As an optional implementation manner of the embodiment of the present application, the foregoing first determining module 530 may be specifically configured to:
基于目标图像判断是否满足预设执行条件;其中,上述目标图像为目标CTU所处的图像。Determining whether the preset execution condition is satisfied based on the target image; wherein the target image is an image in which the target CTU is located.
可选的,在此实现方式下,上述第一判断模块530,可以具体用于:Optionally, in this implementation manner, the foregoing first determining module 530 may be specifically configured to:
判断目标图像是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target image meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
该目标图像为帧内预测图像;The target image is an intra prediction image;
该目标图像所使用量化参数大于第一预设阈值;The quantization parameter used by the target image is greater than the first preset threshold;
该目标图像的头信息中携带目标标识信息,其中,目标标识信息为表明该目标图像中所有CTB所对应的SAO类型均需要按照上述第一编码规则进行编码的标识信息;The header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
该目标图像不是双向预测图像。The target image is not a bidirectional predicted image.
作为本申请实施例的另一种可选实现方式,上述第一判断模块530,可以具体用于:As another optional implementation manner of the embodiment of the present application, the foregoing first determining module 530 may be specifically configured to:
基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件。Whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
可选的,在此实现方式下,上述第一判断模块530,可以具体用于:Optionally, in this implementation manner, the foregoing first determining module 530 may be specifically configured to:
判断目标CTB所属目标编码树单元CTU是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target coding tree unit CTU to which the target CTB belongs meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
目标CTU中的所有预测单元均为帧内预测单元;All prediction units in the target CTU are intra prediction units;
目标CTU所使用的量化参数大于第二预设阈值;The quantization parameter used by the target CTU is greater than a second preset threshold;
目标CTU中的所有变换单元的平均大小小于第三预设阈值;The average size of all transform units in the target CTU is less than a third preset threshold;
目标CTU中的所有编码单元的平均大小小于第四预设阈值。The average size of all coding units in the target CTU is less than a fourth predetermined threshold.
作为本申请实施例的又一种可选实现方式,上述第一判断模块530,可以具体用于: As a further optional implementation manner of the embodiment of the present application, the foregoing first determining module 530 may be specifically configured to:
判断在对目标CTB所属的目标编码树单元CTU进行去块滤波时的环路滤波强度值是否大于第五预设阈值;如果大于,判定满足预设执行条件;否则,判定不满足预设执行条件。Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
作为本申请实施例的一种可选实现方式,按照第一编码原则确定的第一编码规则,可以包括:As an optional implementation manner of the embodiment of the present application, the first coding rule determined according to the first coding principle may include:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized string is based on the context model. the way.
作为本申请实施例的另一种可选实现方式,按照第一编码原则确定的第一编码规则,可以包括:As another optional implementation manner of the embodiment of the present application, the first coding rule determined according to the first coding principle may include:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为等概率编码的方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
作为本申请实施例的又一种可选实现方式,按照第一编码原则确定的第一编码规则,可以包括:As a further optional implementation manner of the embodiment of the present application, the first coding rule determined according to the first coding principle may include:
编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且针对每一个二值化字符串,该二值化字符串的第一个比特位的编码方式为等概率编码的方式,在该二值化字符串还包括第二个比特位的情况下,该二值化字符串的第二个比特位的编码方式为基于上下文模型的编码方式。Encoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each binarized string, the first bit of the binarized string The coding mode is equal probability coding. When the binarized character string further includes the second bit, the coding mode of the second bit of the binarized character string is based on the context model. .
作为本申请实施例的一种可选实现方式,按照第二编码原则确定的第一编码规则,可以包括:As an optional implementation manner of the embodiment of the present application, the first coding rule determined according to the second coding principle may include:
编码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is based on the context model. the way.
由以上可知,按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本申请实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模 式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本申请实施例提供的方案可以提高视频编码效率。It can be seen from the above that when the first coding rule determined according to the first coding principle performs the coding of the SAO type, in the solution provided by the embodiment of the present application, the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to two. The entropy coding result of the valued string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode The usage probability of the formula is much larger than the usage probability of the BO mode, and is even greater than the use probability of the skip mode in some cases; therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the embodiment of the present application provides The solution can improve the efficiency of video coding.
而按照第二编码原则确定的第一编码规则进行SAO类型的编码时,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以按照第二编码原则确定的第一编码规则进行SAO类型的编码时,本申请实施例提供的方案同样可以提高视频编码效率。When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode. The compression ratio is high, so when the first encoding rule determined by the second coding principle is used to perform the SAO type encoding, the solution provided by the embodiment of the present application can also improve the video encoding efficiency.
另外,在本实施例中,当第一编码规则为按照第三编码原则所确定时,二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式,SAO类型的编码过程中不使用任何上下文模型,可以节省编码器更新上下文模型的操作以及缓冲(buffer)代价,保证编码器的低复杂度,同时加快视频编码速度。In addition, in this embodiment, when the first coding rule is determined according to the third coding principle, the entropy coding mode of each bit in the binarized character string is an equal probability coding mode, and the SAO type coding process is performed. The use of no context model can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
相应于图7所示方法实施例,本申请实施例提供了一种SAO类型的解码装置,如图11所示,该解码装置包括:Corresponding to the method embodiment shown in FIG. 7, the embodiment of the present application provides a SAO type decoding apparatus. As shown in FIG. 11, the decoding apparatus includes:
熵解码模块610,用于按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到目标二值化字符串;其中,第一解码规则记录有被编码二值化字符串的熵解码方式,以及各SAO类型与二值化字符串的对应关系;The entropy decoding module 610 is configured to perform entropy decoding on the encoded target binarized character string corresponding to the target coding tree block CTB according to the entropy decoding manner of the encoded binarized character string recorded in the preset first decoding rule. Obtaining a target binarized character string; wherein, the first decoding rule records an entropy decoding manner of the encoded binarized character string, and a correspondence relationship between each SAO type and the binarized character string;
第二确定模块620,用于按照第一解码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标二值化字符串所对应的目标SAO类型。The second determining module 620 is configured to determine, according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule, the target SAO type corresponding to the target binarized character string.
其中,第一解码规则为按照下述解码原则中的任一种所确定的:Wherein, the first decoding rule is determined according to any one of the following decoding principles:
第一解码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first decoding principle: the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
第二解码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应被编码二值化字符串的比特位 的熵解码方式为基于上下文模型的解码方式;The second decoding principle: the EO mode and the BO mode respectively have the same length of the binarized character string; and are used to distinguish the EO mode and the BO mode respectively corresponding to the bits of the encoded binarized character string The entropy decoding method is a decoding method based on a context model;
具体的,第一解码规则可以为按照第一解码原则、第二解码原则以及第三解码原则中的任一种所确定的;Specifically, the first decoding rule may be determined according to any one of a first decoding principle, a second decoding principle, and a third decoding principle;
第三解码原则为:被编码二值化字符串中的每一个比特位的熵解码方式均为等概率解码方式。The third decoding principle is that the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode.
相应于图8所示方法实施例,如图12所示,上述解码装置还可以包括:Corresponding to the method embodiment shown in FIG. 8, as shown in FIG. 12, the foregoing decoding apparatus may further include:
第二判断模块630,用于针对目标编码树块CTB所对应被编码的目标二值化字符串,判断是否满足预设执行条件,预设执行条件为:用于表示目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件;The second judging module 630 is configured to determine, according to the target binarized character string corresponding to the target coding tree block CTB, whether the preset execution condition is met, and the preset execution condition is: indicating the target coding tree to which the target CTB belongs a condition that the prediction conversion accuracy of the unit CTU is low;
相应的,上述熵解码模块610,可以具体用于:Correspondingly, the entropy decoding module 610 may be specifically configured to:
在第二判断模块630的判断结果为是的情况下,按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到目标二值化字符串。In the case that the determination result of the second judging module 630 is YES, according to the entropy decoding manner of the encoded binarized character string recorded in the preset first decoding rule, the target target corresponding to the target coding tree block CTB is encoded. The binarized string is entropy decoded to obtain the target binarized string.
作为本申请实施例的一种可选实现方式,上述第二判断模块630,可以具体用于:As an optional implementation manner of the embodiment of the present application, the foregoing second determining module 630 may be specifically configured to:
基于目标图像判断是否满足预设执行条件;其中,目标图像为目标CTU所处的图像。Determining whether the preset execution condition is satisfied based on the target image; wherein the target image is an image in which the target CTU is located.
在此实现方式下,上述第二判断模块630,可以具体用于:In this implementation manner, the foregoing second determining module 630 may be specifically configured to:
判断目标图像是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target image meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
该目标图像为帧内预测图像;The target image is an intra prediction image;
该目标图像所使用量化参数大于第一预设阈值;The quantization parameter used by the target image is greater than the first preset threshold;
该目标图像的头信息中携带目标标识信息,其中,目标标识信息为表明该目标图像中所有CTB所对应的SAO类型均需要按照上述第一编码规则进行编码的标识信息;The header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule.
该目标图像不是双向预测图像。The target image is not a bidirectional predicted image.
作为本申请实施例的另一种可选实现方式,上述第二判断模块630,可以具体用于:As another optional implementation manner of the embodiment of the present application, the foregoing second determining module 630 may be specifically configured to:
基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及 变换信息中的至少一种,判断是否满足预设执行条件。Quantization information and prediction information based on the target coding tree unit CTU of the target CTB At least one of the transformation information is used to determine whether the preset execution condition is satisfied.
在此实现方式下,上述第二判断模块630,可以具体用于:In this implementation manner, the foregoing second determining module 630 may be specifically configured to:
判断目标CTB所属目标编码树单元CTU是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足预设执行条件:Determining whether the target coding tree unit CTU to which the target CTB belongs meets at least one of the following conditions, if it is met, the determination satisfies the preset execution condition; otherwise, the determination does not satisfy the preset execution condition:
目标CTU中的所有预测单元均为帧内预测单元;All prediction units in the target CTU are intra prediction units;
目标CTU所使用的量化参数大于第二预设阈值;The quantization parameter used by the target CTU is greater than a second preset threshold;
目标CTU中的所有变换单元的平均大小小于第三预设阈值;The average size of all transform units in the target CTU is less than a third preset threshold;
目标CTU中的所有编码单元的平均大小小于第四预设阈值。The average size of all coding units in the target CTU is less than a fourth predetermined threshold.
作为本申请实施例的又一种可选实现方式,上述第二判断模块630,可以具体用于:As a further optional implementation manner of the embodiment of the present application, the foregoing second determining module 630 may be specifically configured to:
判断在对目标CTB所属的目标编码树单元CTU进行去块滤波时的环路滤波强度值是否大于第五预设阈值;如果大于,判定满足预设执行条件;否则,判定不满足预设执行条件。Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not met .
作为本申请实施例的一种可选实现方式,按照第一解码原则确定的第一解码规则,可以包括:As an optional implementation manner of the embodiment of the present application, the first decoding rule determined according to the first decoding principle may include:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to EO mode, skip mode and BO mode are 0, 10, 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model The way to decode.
作为本申请实施例的另一种可选实现方式,,按照第一解码原则确定的第一解码规则,可以包括:As another optional implementation manner of the embodiment of the present application, the first decoding rule determined according to the first decoding principle may include:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为等概率解码的方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
作为本申请实施例的又一种可选实现方式,按照第一解码原则确定的第一解码规则,可以包括:As a further optional implementation manner of the embodiment of the present application, the first decoding rule determined according to the first decoding principle may include:
解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且针对每一个被编码二值化字符串,该被编码二值化字符串的第一个比特位的解码方式为等概率解码的方式,在该被编码二值化字符串还包括第二个比特位的情况下,该被编码二值化字符串的第二个比特位的解码方式 为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each encoded binarized string, the encoded binary string is The decoding mode of one bit is a method of equal probability decoding, and in the case where the encoded binarized character string further includes the second bit, the decoding of the second bit of the encoded binarized character string the way It is a context model based decoding method.
作为本申请实施例的一种可选实现方式,,按照第二解码原则确定的第一解码规则,可以包括:As an optional implementation manner of the embodiment of the present application, the first decoding rule determined according to the second decoding principle may include:
解码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model. The way to decode.
由以上可知,在第一解码规则为按照第一解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,由于本申请实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即应用于该第一解码规则相匹配的第一编码规则的编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本申请实施例提供的方案可以提高视频编码效率。It can be seen from the above that, in the case that the first decoding rule is determined according to the first decoding principle, the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, because the solution provided by the embodiment of the present application The length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codeword, that is, the first coding rule applied to match the first decoding rule. The encoder can encode the SAO type of EO mode with a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than that of the BO mode, and sometimes even greater than the skip mode. Probability; Therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the solution provided by the embodiment of the present application can improve the video coding efficiency.
在第一解码规则为按照第二解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,由于本申请实施例提供的方案中,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以本申请实施例提供的方案同样可以提高视频编码效率。In the case where the first decoding rule is determined according to the second decoding principle, the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, which is used in the solution provided by the embodiment of the present application. The entropy coding method for distinguishing the bits of the binarized character string corresponding to the EO mode and the BO mode respectively is a coding mode based on the context model, so the encoder pair is used to distinguish the EO mode and the BO mode respectively corresponding to the binarized character string. The compression ratio of the entropy coding performed by the bit is high, that is, the compression ratio of the encoding of the two types of SAOs of the EO mode and the BO mode is high, so the scheme provided by the embodiment of the present application can also improve the video coding efficiency.
在本申请实施例中,当第一编码规则按照第三编码原则所确定时,被编码二值化字符串中的每一个比特位的熵解码方式均为等概率解码方式,SAO类型的解码过程中不使用任何上下文模型,可以节省解码器更新上下文模型的操作以及缓冲代价,保证解码器的低复杂度,同时加快视频解码速度。In the embodiment of the present application, when the first coding rule is determined according to the third coding principle, the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode, and the SAO type decoding process is performed. The use of no context model does not save the decoder's operation of updating the context model and the buffering cost, ensuring low complexity of the decoder while speeding up video decoding.
另外,从编码器角度而言,在第一解码规则为按照第三解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式, SAO类型的编码过程中不使用任何上下文模型,可以节省编码器更新上下文模型的操作以及缓冲(buffer)代价,保证编码器的低复杂度,同时加快视频编码速度。In addition, from the perspective of the encoder, in the case where the first decoding rule is determined according to the third decoding principle, the encoder performs SAO type encoding by using the first encoding rule matched with the first decoding rule, binarization The entropy coding mode of each bit in the string is an equal probability coding method. The SAO type encoding process does not use any context model, which can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
本申请实施例还提供了一种编码器,如图13所示,包括第一处理器710和第一存储器720,其中;The embodiment of the present application further provides an encoder, as shown in FIG. 13, including a first processor 710 and a first memory 720, wherein
第一存储器720,用于存放计算机程序;a first memory 720, configured to store a computer program;
第一处理器710,用于执行第一存储器720上所存放的程序时,实现如下步骤:When the first processor 710 is configured to execute the program stored on the first memory 720, the following steps are implemented:
在决策出目标编码树块CTB的目标SAO类型后,按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标SAO类型所对应的目标二值化字符串,其中,第一编码规则中记录有各SAO类型与二值化字符串的对应关系,以及二值化字符串的熵编码方式;After the target SAO type of the target coding tree block CTB is determined, the target binarization corresponding to the target SAO type is determined according to the correspondence between each SAO type and the binarized character string recorded in the preset first coding rule. a string, wherein the first encoding rule records a correspondence between each SAO type and a binarized string, and an entropy encoding manner of the binarized string;
按照第一编码规则中记录的二值化字符串的熵编码方式,对目标二值化字符串进行熵编码,得到目标SAO类型所对应的编码结果;Entropy coding the target binarized character string according to the entropy coding manner of the binarized character string recorded in the first coding rule, and obtaining the coding result corresponding to the target SAO type;
其中,该第一编码规则为按照下述编码原则中的任一种所确定的:Wherein the first coding rule is determined according to any one of the following coding principles:
第一编码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first coding principle: the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
第二编码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式。The second coding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
关于该方法各个步骤的具体实现以及相关解释内容可以参见上述图5和6所示的方法实施例,在此不做赘述。For specific implementations of the various steps of the method and related explanations, refer to the method embodiments shown in FIG. 5 and FIG. 6 above, and no further details are provided herein.
由以上可知,按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使 用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案可以提高视频编码效率。It can be seen from the above that when the first coding rule determined according to the first coding principle performs the coding of the SAO type, in the solution provided by the embodiment, the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to the binary value. The entropy coding result of the character string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode usage probability is much larger than the BO mode usage probability. Even at times when it is larger than the skip mode The probability of the video coding efficiency can be improved by the scheme provided by this embodiment when the first coding rule determined by the first coding principle is used for the coding of the SAO type.
而按照第二编码原则确定的第一编码规则进行SAO类型的编码时,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以按照第二编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案同样可以提高视频编码效率。When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode. The compression ratio is high, so when the first coding rule determined by the second coding principle is used to perform the SAO type coding, the solution provided by this embodiment can also improve the video coding efficiency.
另外,在本实施例中,当第一编码规则为按照第三编码原则所确定时,二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式,SAO类型的编码过程中不使用任何上下文模型,可以节省编码器更新上下文模型的操作以及缓冲(buffer)代价,保证编码器的低复杂度,同时加快视频编码速度。In addition, in this embodiment, when the first coding rule is determined according to the third coding principle, the entropy coding mode of each bit in the binarized character string is an equal probability coding mode, and the SAO type coding process is performed. The use of no context model can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
本申请实施例还提供了一种解码器,如图14所示,包括第二处理器810和第二存储器820,其中;The embodiment of the present application further provides a decoder, as shown in FIG. 14, including a second processor 810 and a second memory 820, wherein
第二存储器820,用于存放计算机程序;a second memory 820, configured to store a computer program;
第二处理器810,用于执行第二存储器820上所存放的程序时,实现如下步骤:The second processor 810 is configured to perform the following steps when executing the program stored on the second memory 820:
按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到目标二值化字符串;其中,第一解码规则记录有被编码二值化字符串的熵解码方式,以及各SAO类型与二值化字符串的对应关系;Entropy decoding of the target binarized character string corresponding to the target coding tree block CTB according to the entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule, to obtain the target binarized character a string; wherein the first decoding rule records an entropy decoding manner of the encoded binarized character string, and a correspondence between each SAO type and the binarized character string;
按照第一解码规则中所记录的各SAO类型与二值化字符串的对应关系,确定目标二值化字符串所对应的目标SAO类型。The target SAO type corresponding to the target binarized character string is determined according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule.
其中,第一解码规则为按照下述解码原则中的任一种所确定的:Wherein, the first decoding rule is determined according to any one of the following decoding principles:
第一解码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first decoding principle: the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
第二解码原则:EO模式和BO模式所分别对应二值化字符串的长度相 同;且用于区分EO模式和BO模式所分别对应被编码二值化字符串的比特位的熵解码方式为基于上下文模型的解码方式。The second decoding principle: the EO mode and the BO mode respectively correspond to the length of the binarized string And the entropy decoding method for distinguishing the bits corresponding to the encoded binary string respectively in the EO mode and the BO mode is a context model based decoding mode.
关于该方法各个步骤的具体实现以及相关解释内容可以参见上述图7和8所示的方法实施例,在此不做赘述。For specific implementations of the various steps of the method and related explanations, refer to the method embodiments shown in FIG. 7 and FIG. 8 above, and no further details are provided herein.
由以上可知,在第一解码规则为按照第一解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,由于本实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即应用于该第一解码规则相匹配的第一编码规则的编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案可以提高视频编码效率。It can be seen from the above that, in the case that the first decoding rule is determined according to the first decoding principle, the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, because the solution provided by this embodiment is The length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codewords, that is, the first coding rule applied to match the first decoding rule. The encoder can encode the SAO type of the EO mode with a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than that of the BO mode, and sometimes even greater than the skip mode. Therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the solution provided by this embodiment can improve the video coding efficiency.
在第一解码规则为按照第二解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,由于本实施例提供的方案中,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以本实施例提供的方案同样可以提高视频编码效率。In the case where the first decoding rule is determined according to the second decoding principle, the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, and the scheme provided in this embodiment is used to distinguish The entropy coding mode of the bit corresponding to the binarized character string in the EO mode and the BO mode is the context mode-based coding mode, so the encoder pairs the bits corresponding to the binarized character string for distinguishing the EO mode and the BO mode, respectively. The compression ratio of the entropy coding performed by the bit is high, that is, the coding ratio of the coding performed by the AO mode and the BO mode is high, so the scheme provided by this embodiment can also improve the video coding efficiency.
在本实施例中,当第一编码规则按照第三编码原则所确定时,被编码二值化字符串中的每一个比特位的熵解码方式均为等概率解码方式,SAO类型的解码过程中不使用任何上下文模型,可以节省解码器更新上下文模型的操作以及缓冲代价,保证解码器的低复杂度,同时加快视频解码速度。In this embodiment, when the first coding rule is determined according to the third coding principle, the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode, and the SAO type is in the decoding process. Without any context model, the operation of the decoder update context model and the buffering cost can be saved, ensuring low complexity of the decoder while speeding up video decoding.
另外,从编码器角度而言,在第一解码规则为按照第三解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式,SAO类型的编码过程中不使用任何上下文模型,可以节省编码器更新上下文模型的操作以及缓冲(buffer)代价,保证编码器的低复杂度,同时加快视频 编码速度。In addition, from the perspective of the encoder, in the case where the first decoding rule is determined according to the third decoding principle, the encoder performs SAO type encoding by using the first encoding rule matched with the first decoding rule, binarization The entropy coding mode of each bit in the string is an equal probability coding mode. The SAO type coding process does not use any context model, which can save the operation of the encoder update context model and the buffer cost, and ensure the encoder. Low complexity while speeding up the video Coding speed.
上述编码器以及解码器都是可以具备有实现上述自身与其他设备之间通信的通信接口。Both the encoder and the decoder described above may be provided with a communication interface for realizing communication between the above self and other devices.
上述的处理器,通信接口,存储器通过通信总线完成相互间的通信,此处所提到的通信总线可以是外设部件互连标准(Peripheral Component Interconnect,PCI)总线或扩展工业标准结构(Extended Industry Standard Architecture,EISA)总线等。该通信总线可以分为地址总线、数据总线、控制总线等。The above-mentioned processor, communication interface, and memory complete communication with each other through a communication bus. The communication bus mentioned here may be a Peripheral Component Interconnect (PCI) bus or an extended industry standard structure (Extended Industry) Standard Architecture, EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, and the like.
存储器可以包括随机存取存储器(Random Access Memory,RAM),也可以包括非易失性存储器(Non-Volatile Memory,NVM),例如至少一个磁盘存储器。可选的,存储器还可以是至少一个位于远离前述处理器的存储装置。The memory may include a random access memory (RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
上述的处理器可以是通用处理器,包括中央处理器(Central Processing Unit,CPU)、网络处理器(Network Processor,NP)等;还可以是数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。The above processor may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; or may be a digital signal processing (DSP), dedicated integration. Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component.
相应于图5和图6所示方法实施例,本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,该计算机程序被处理器执行时实现上述任一SAO类型的编码方法所述的方法步骤。Corresponding to the method embodiment shown in FIG. 5 and FIG. 6 , the embodiment of the present application further provides a computer readable storage medium, where the computer readable storage medium stores a computer program, and the computer program is implemented by the processor to implement the foregoing. The method steps described for any SAO type encoding method.
由以上可知,按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案可以提高视频编码效率。 It can be seen from the above that when the first coding rule determined according to the first coding principle performs the coding of the SAO type, in the solution provided by the embodiment, the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to the binary value. The entropy coding result of the character string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode usage probability is much larger than the BO mode usage probability. Even when it is greater than the use probability of the skip mode, the scheme provided by this embodiment can improve the video coding efficiency when the first coding rule determined according to the first coding principle performs the coding of the SAO type.
而按照第二编码原则确定的第一编码规则进行SAO类型的编码时,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以按照第二编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案同样可以提高视频编码效率。When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode. The compression ratio is high, so when the first coding rule determined by the second coding principle is used to perform the SAO type coding, the solution provided by this embodiment can also improve the video coding efficiency.
另外,在本实施例中,当第一编码规则为按照第三编码原则所确定时,二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式,SAO类型的编码过程中不使用任何上下文模型,可以节省编码器更新上下文模型的操作以及缓冲(buffer)代价,保证编码器的低复杂度,同时加快视频编码速度。In addition, in this embodiment, when the first coding rule is determined according to the third coding principle, the entropy coding mode of each bit in the binarized character string is an equal probability coding mode, and the SAO type coding process is performed. The use of no context model can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
相应于图7和图8所示方法实施例,本申请实施例提供了另一种计算机可读存储介质,该计算机可读存储介质内存储有计算机程序,该计算机程序被处理器执行时实现上述任一SAO类型的解码方法所述的方法步骤。Corresponding to the method embodiment shown in FIG. 7 and FIG. 8 , the embodiment of the present application provides another computer readable storage medium, where the computer readable storage medium stores a computer program, and the computer program is implemented by the processor to implement the foregoing. The method steps described in the decoding method of any SAO type.
由以上可知,在第一解码规则为按照第一解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,由于本实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即应用于该第一解码规则相匹配的第一编码规则的编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案可以提高视频编码效率。It can be seen from the above that, in the case that the first decoding rule is determined according to the first decoding principle, the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, because the solution provided by this embodiment is The length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codewords, that is, the first coding rule applied to match the first decoding rule. The encoder can encode the SAO type of the EO mode with a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than that of the BO mode, and sometimes even greater than the skip mode. Therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the solution provided by this embodiment can improve the video coding efficiency.
在第一解码规则为按照第二解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,由于本实施例提供的方案中,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和 BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以本实施例提供的方案同样可以提高视频编码效率。In the case where the first decoding rule is determined according to the second decoding principle, the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, and the scheme provided in this embodiment is used to distinguish The entropy coding method corresponding to the bits of the binarized character string in the EO mode and the BO mode respectively is the coding mode based on the context model, so the encoder pair is used to distinguish the EO mode and In the BO mode, the compression ratio of the entropy coding of the bit corresponding to the binarized character string is high, that is, the coding ratio of the coding of the two types of SAOs of the EO mode and the BO mode is high, so the present embodiment provides The scheme can also improve the video coding efficiency.
在本实施例中,当第一编码规则按照第三编码原则所确定时,被编码二值化字符串中的每一个比特位的熵解码方式均为等概率解码方式,SAO类型的解码过程中不使用任何上下文模型,可以节省解码器更新上下文模型的操作以及缓冲代价,保证解码器的低复杂度,同时加快视频解码速度。In this embodiment, when the first coding rule is determined according to the third coding principle, the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode, and the SAO type is in the decoding process. Without any context model, the operation of the decoder update context model and the buffering cost can be saved, ensuring low complexity of the decoder while speeding up video decoding.
另外,从编码器角度而言,在第一解码规则为按照第三解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式,SAO类型的编码过程中不使用任何上下文模型,可以节省编码器更新上下文模型的操作以及缓冲(buffer)代价,保证编码器的低复杂度,同时加快视频编码速度。In addition, from the perspective of the encoder, in the case where the first decoding rule is determined according to the third decoding principle, the encoder performs SAO type encoding by using the first encoding rule matched with the first decoding rule, binarization The entropy coding mode of each bit in the string is an equal probability coding mode. The SAO type coding process does not use any context model, which can save the operation of the encoder update context model and the buffer cost, and ensure the encoder. Low complexity while speeding up video encoding.
相应于图5和图6所示方法实施例,本申请实施例提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述任一SAO类型的编码方法所述的方法步骤。Corresponding to the method embodiment shown in FIG. 5 and FIG. 6, the embodiment of the present application provides a computer program product including instructions, when it is run on a computer, causing the computer to execute the coding method of any of the above SAO types. Method steps.
由以上可知,按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案可以提高视频编码效率。It can be seen from the above that when the first coding rule determined according to the first coding principle performs the coding of the SAO type, in the solution provided by the embodiment, the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to the binary value. The entropy coding result of the character string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode usage probability is much larger than the BO mode usage probability. Even when it is greater than the use probability of the skip mode, the scheme provided by this embodiment can improve the video coding efficiency when the first coding rule determined according to the first coding principle performs the coding of the SAO type.
而按照第二编码原则确定的第一编码规则进行SAO类型的编码时,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以按照第二编码原则确 定的第一编码规则进行SAO类型的编码时,本实施例提供的方案同样可以提高视频编码效率。When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode. The compression ratio is high, so according to the second coding principle When the first coding rule is used to perform the coding of the SAO type, the solution provided by this embodiment can also improve the video coding efficiency.
另外,在本实施例中,当第一编码规则为按照第三编码原则所确定时,二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式,SAO类型的编码过程中不使用任何上下文模型,可以节省编码器更新上下文模型的操作以及缓冲(buffer)代价,保证编码器的低复杂度,同时加快视频编码速度。In addition, in this embodiment, when the first coding rule is determined according to the third coding principle, the entropy coding mode of each bit in the binarized character string is an equal probability coding mode, and the SAO type coding process is performed. The use of no context model can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
相应于图7和图8所示方法实施例,本申请实施例提供了另一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述任一SAO类型的解码方法所述的方法步骤。Corresponding to the method embodiment shown in FIG. 7 and FIG. 8 , the embodiment of the present application provides another computer program product including instructions, when it is run on a computer, causing the computer to perform the decoding method of any of the above SAO types. Method steps.
由以上可知,在第一解码规则为按照第一解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,由于本实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即应用于该第一解码规则相匹配的第一编码规则的编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案可以提高视频编码效率。It can be seen from the above that, in the case that the first decoding rule is determined according to the first decoding principle, the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, because the solution provided by this embodiment is The length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codewords, that is, the first coding rule applied to match the first decoding rule. The encoder can encode the SAO type of the EO mode with a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than that of the BO mode, and sometimes even greater than the skip mode. Therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the solution provided by this embodiment can improve the video coding efficiency.
在第一解码规则为按照第二解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,由于本实施例提供的方案中,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以本实施例提供的方案同样可以提高视频编码效率。In the case where the first decoding rule is determined according to the second decoding principle, the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, and the scheme provided in this embodiment is used to distinguish The entropy coding mode of the bit corresponding to the binarized character string in the EO mode and the BO mode is the context mode-based coding mode, so the encoder pairs the bits corresponding to the binarized character string for distinguishing the EO mode and the BO mode, respectively. The compression ratio of the entropy coding performed by the bit is high, that is, the coding ratio of the coding performed by the AO mode and the BO mode is high, so the scheme provided by this embodiment can also improve the video coding efficiency.
在本实施例中,当第一编码规则按照第三编码原则所确定时,被编码二值化字符串中的每一个比特位的熵解码方式均为等概率解码方式,SAO类型 的解码过程中不使用任何上下文模型,可以节省解码器更新上下文模型的操作以及缓冲代价,保证解码器的低复杂度,同时加快视频解码速度。In this embodiment, when the first coding rule is determined according to the third coding principle, the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode, and the SAO type The use of no context model in the decoding process saves the decoder's operation of updating the context model and the buffering cost, ensuring low complexity of the decoder and speeding up video decoding.
另外,从编码器角度而言,在第一解码规则为按照第三解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式,SAO类型的编码过程中不使用任何上下文模型,可以节省编码器更新上下文模型的操作以及缓冲(buffer)代价,保证编码器的低复杂度,同时加快视频编码速度。In addition, from the perspective of the encoder, in the case where the first decoding rule is determined according to the third decoding principle, the encoder performs SAO type encoding by using the first encoding rule matched with the first decoding rule, binarization The entropy coding mode of each bit in the string is an equal probability coding mode. The SAO type coding process does not use any context model, which can save the operation of the encoder update context model and the buffer cost, and ensure the encoder. Low complexity while speeding up video encoding.
相应于图5和图6所示方法实施例,本申请实施例提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述任一SAO类型的编码方法所述的方法步骤。Corresponding to the method embodiments shown in FIG. 5 and FIG. 6, the embodiment of the present application provides a computer program that, when run on a computer, causes the computer to execute the method steps described in any of the above-described SAO type encoding methods.
由以上可知,按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案可以提高视频编码效率。It can be seen from the above that when the first coding rule determined according to the first coding principle performs the coding of the SAO type, in the solution provided by the embodiment, the length of the binary string corresponding to the EO mode is small, so the EO mode corresponds to the binary value. The entropy coding result of the character string occupies less codeword, that is, the encoder can encode the SAO type of the EO mode with a higher compression ratio; since the video coding process, the EO mode usage probability is much larger than the BO mode usage probability. Even when it is greater than the use probability of the skip mode, the scheme provided by this embodiment can improve the video coding efficiency when the first coding rule determined according to the first coding principle performs the coding of the SAO type.
而按照第二编码原则确定的第一编码规则进行SAO类型的编码时,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以按照第二编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案同样可以提高视频编码效率。When the first coding rule determined according to the second coding principle performs the SAO type coding, the entropy coding mode for distinguishing the bits corresponding to the binarized character strings respectively of the EO mode and the BO mode is a context model based coding mode. Therefore, the encoder has a high compression ratio for entropy coding of the bits corresponding to the binarized character strings respectively for distinguishing the EO mode and the BO mode, that is, the encoder encodes the two SAO types, EO mode and BO mode. The compression ratio is high, so when the first coding rule determined by the second coding principle is used to perform the SAO type coding, the solution provided by this embodiment can also improve the video coding efficiency.
另外,在本实施例中,当第一编码规则为按照第三编码原则所确定时,二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式,SAO类型的编码过程中不使用任何上下文模型,可以节省编码器更新上下文模型的 操作以及缓冲(buffer)代价,保证编码器的低复杂度,同时加快视频编码速度。In addition, in this embodiment, when the first coding rule is determined according to the third coding principle, the entropy coding mode of each bit in the binarized character string is an equal probability coding mode, and the SAO type coding process is performed. No context model is used, which saves the encoder update context model Operation and buffer cost ensure low complexity of the encoder and speed up video encoding.
相应于图7和图8所示方法实施例,本申请实施例提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述任一SAO类型的解码方法所述的方法步骤。Corresponding to the method embodiments shown in FIG. 7 and FIG. 8, the embodiment of the present application provides a computer program that, when run on a computer, causes the computer to execute the method steps described in any of the SAO-type decoding methods described above.
由以上可知,在第一解码规则为按照第一解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,由于本实施例提供的方案中,EO模式所对应二值化字符串的长度小,所以EO模式所对应二值化字符串的熵编码结果所占码字少,即应用于该第一解码规则相匹配的第一编码规则的编码器能够对EO模式这种SAO类型进行编码的压缩比高;由于在视频编码过程中,EO模式的使用概率远大于BO模式的使用概率,甚至于在有的时候大于跳过模式的使用概率;所以按照第一编码原则确定的第一编码规则进行SAO类型的编码时,本实施例提供的方案可以提高视频编码效率。It can be seen from the above that, in the case that the first decoding rule is determined according to the first decoding principle, the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, because the solution provided by this embodiment is The length of the binarized character string corresponding to the EO mode is small, so the entropy coding result of the binarized character string corresponding to the EO mode occupies less codewords, that is, the first coding rule applied to match the first decoding rule. The encoder can encode the SAO type of the EO mode with a high compression ratio; since the EO mode is used in the video encoding process, the probability of use is much larger than that of the BO mode, and sometimes even greater than the skip mode. Therefore, when the first coding rule determined according to the first coding principle performs the coding of the SAO type, the solution provided by this embodiment can improve the video coding efficiency.
在第一解码规则为按照第二解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,由于本实施例提供的方案中,用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式,所以编码器对用于区分EO模式和BO模式所分别对应二值化字符串的比特位所进行熵编码的压缩比高,即编码器对EO模式和BO模式这两种SAO类型进行的编码的压缩比高,所以本实施例提供的方案同样可以提高视频编码效率。In the case where the first decoding rule is determined according to the second decoding principle, the encoder performs the SAO type encoding by using the first encoding rule that matches the first decoding rule, and the scheme provided in this embodiment is used to distinguish The entropy coding mode of the bit corresponding to the binarized character string in the EO mode and the BO mode is the context mode-based coding mode, so the encoder pairs the bits corresponding to the binarized character string for distinguishing the EO mode and the BO mode, respectively. The compression ratio of the entropy coding performed by the bit is high, that is, the coding ratio of the coding performed by the AO mode and the BO mode is high, so the scheme provided by this embodiment can also improve the video coding efficiency.
在本实施例中,当第一编码规则按照第三编码原则所确定时,被编码二值化字符串中的每一个比特位的熵解码方式均为等概率解码方式,SAO类型的解码过程中不使用任何上下文模型,可以节省解码器更新上下文模型的操作以及缓冲代价,保证解码器的低复杂度,同时加快视频解码速度。In this embodiment, when the first coding rule is determined according to the third coding principle, the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode, and the SAO type is in the decoding process. Without any context model, the operation of the decoder update context model and the buffering cost can be saved, ensuring low complexity of the decoder while speeding up video decoding.
另外,从编码器角度而言,在第一解码规则为按照第一解码原则所确定的情况下,编码器利用与第一解码规则相匹配的第一编码规则进行SAO类型的编码,二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式, SAO类型的编码过程中不使用任何上下文模型,可以节省编码器更新上下文模型的操作以及缓冲(buffer)代价,保证编码器的低复杂度,同时加快视频编码速度。In addition, from the perspective of the encoder, in the case where the first decoding rule is determined according to the first decoding principle, the encoder performs SAO type encoding by using the first encoding rule matched with the first decoding rule, binarization The entropy coding mode of each bit in the string is an equal probability coding method. The SAO type encoding process does not use any context model, which can save the operation of the encoder update context model and the buffer cost, ensure the low complexity of the encoder, and speed up the video encoding speed.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this context, relational terms such as first and second are used merely to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply these entities or operations. There is any such actual relationship or order between them. Furthermore, the term "comprises" or "comprises" or "comprises" or any other variations thereof is intended to encompass a non-exclusive inclusion, such that a process, method, article, or device that comprises a plurality of elements includes not only those elements but also Other elements, or elements that are inherent to such a process, method, item, or device. An element that is defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device that comprises the element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、编码器、解码器、计算机可读存储介质、包含指令的计算机程序产品以及计算机程序的实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in the present specification are described in a related manner, and the same or similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, the embodiments of the apparatus, the encoder, the decoder, the computer readable storage medium, the computer program product containing the instructions, and the computer program are relatively simple and relevant in that they are substantially similar to the method embodiment. See the partial description of the method embodiment.
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。 The above is only the preferred embodiment of the present application, and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc., which are made within the spirit and principles of the present application, should be included in the present application. Within the scope of protection.

Claims (52)

  1. 一种SAO类型的编码方法,其特征在于,所述方法包括:An SAO type encoding method, the method comprising:
    在决策出目标编码树块CTB的目标SAO类型后,按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定所述目标SAO类型所对应的目标二值化字符串,其中,所述第一编码规则中记录有各SAO类型与二值化字符串的对应关系,以及二值化字符串的熵编码方式;After the target SAO type of the target coding tree block CTB is determined, the target corresponding to the target SAO type is determined according to the correspondence between each SAO type and the binarized character string recorded in the preset first coding rule. a valued string, wherein the first encoding rule records a correspondence between each SAO type and a binarized character string, and an entropy encoding manner of the binarized character string;
    按照所述第一编码规则中记录的二值化字符串的熵编码方式,对所述目标二值化字符串进行熵编码,得到所述目标SAO类型所对应的编码结果;Entropy coding the target binarized character string according to the entropy coding manner of the binarized character string recorded in the first coding rule, to obtain an encoding result corresponding to the target SAO type;
    其中,所述第一编码规则为按照下述编码原则中的任一种所确定的:Wherein the first coding rule is determined according to any one of the following coding principles:
    第一编码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first coding principle: the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
    第二编码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式。The second coding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
  2. 根据权利要求1所述的方法,其特征在于,所述第一编码规则为按照所述第一编码原则、所述第二编码原则以及第三编码原则中的任一种所确定的;The method according to claim 1, wherein the first encoding rule is determined according to any one of the first encoding principle, the second encoding principle, and the third encoding principle;
    所述第三编码原则为:二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式。The third coding principle is that the entropy coding mode of each bit in the binarized character string is an equal probability coding mode.
  3. 根据权利要求1或2所述的方法,其特征在于,在所述按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定所述目标SAO类型所对应的目标二值化字符串的步骤之前,所述方法还包括:The method according to claim 1 or 2, wherein the target SAO type is determined according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule Before the step of binarizing the string corresponding to the target, the method further includes:
    在决策出目标编码树块CTB的目标SAO类型后,判断是否满足预设执行条件,所述预设执行条件为:用于表示所述目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件;After determining the target SAO type of the target coding tree block CTB, determining whether the preset execution condition is met, the preset execution condition is: indicating that the prediction transform accuracy of the target coding tree unit CTU to which the target CTB belongs is low conditions of;
    如果满足,执行所述按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定所述目标SAO类型所对应的目标二值化字符串的步骤。If yes, the step of determining the target binarized character string corresponding to the target SAO type according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule is performed.
  4. 根据权利要求3所述的方法,其特征在于,所述判断是否满足预设执 行条件的步骤,包括:The method according to claim 3, wherein said determining whether the predetermined execution is satisfied The steps of the line condition include:
    基于目标图像判断是否满足预设执行条件;其中,所述目标图像为所述目标CTU所处的图像。Determining whether the preset execution condition is satisfied based on the target image; wherein the target image is an image in which the target CTU is located.
  5. 根据权利要求4所述的方法,其特征在于,所述基于目标图像判断是否满足预设执行条件的步骤,包括:The method according to claim 4, wherein the step of determining whether the preset execution condition is met based on the target image comprises:
    判断目标图像是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足所述预设执行条件:Determining whether the target image meets at least one of the following conditions, if it is met, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not satisfied:
    所述目标图像为帧内预测图像;The target image is an intra prediction image;
    所述目标图像所使用量化参数大于第一预设阈值;The quantization parameter used by the target image is greater than a first preset threshold;
    所述目标图像的头信息中携带目标标识信息,所述目标标识信息为表明所述目标图像中所有CTB所对应的SAO类型均需要按照所述第一编码规则进行编码的标识信息;The header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule;
    所述目标图像不是双向预测图像。The target image is not a bidirectional predicted image.
  6. 根据权利要求3所述的方法,其特征在于,所述判断是否满足预设执行条件的步骤,包括:The method according to claim 3, wherein the step of determining whether the preset execution condition is met comprises:
    基于所述目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件。Determining whether the preset execution condition is satisfied based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
  7. 根据权利要求6所述的方法,其特征在于,所述基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件的步骤,包括:The method according to claim 6, wherein the step of determining whether the preset execution condition is satisfied is determined based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs. include:
    判断目标CTB所属目标编码树单元CTU是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足所述预设执行条件:Determining whether the target coding tree unit CTU to which the target CTB belongs meets at least one of the following conditions, if yes, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not satisfied:
    所述目标CTU中的所有预测单元均为帧内预测单元;All prediction units in the target CTU are intra prediction units;
    所述目标CTU所使用的量化参数大于第二预设阈值;The quantization parameter used by the target CTU is greater than a second preset threshold;
    所述目标CTU中的所有变换单元的平均大小小于第三预设阈值;The average size of all transform units in the target CTU is less than a third preset threshold;
    所述目标CTU中的所有编码单元的平均大小小于第四预设阈值。The average size of all coding units in the target CTU is less than a fourth preset threshold.
  8. 根据权利要求3所述的方法,其特征在于,所述判断是否满足预设执行条件的步骤,包括: The method according to claim 3, wherein the step of determining whether the preset execution condition is met comprises:
    判断在对所述目标CTB所属的目标编码树单元CTU进行去块滤波时的环路滤波强度值是否大于第五预设阈值;如果大于,判定满足预设执行条件;否则,判定不满足所述预设执行条件。Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the condition is not satisfied Preset execution conditions.
  9. 根据权利要求1或2所述的方法,其特征在于,按照所述第一编码原则确定的所述第一编码规则,包括:The method according to claim 1 or 2, wherein the first encoding rule determined according to the first encoding principle comprises:
    编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized string is based on the context model. the way.
  10. 根据权利要求1或2所述的方法,其特征在于,按照所述第一编码原则确定的所述第一编码规则,包括:The method according to claim 1 or 2, wherein the first encoding rule determined according to the first encoding principle comprises:
    编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为等概率编码的方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
  11. 根据权利要求1或2所述的方法,其特征在于,按照所述第一编码原则确定的所述第一编码规则,包括:The method according to claim 1 or 2, wherein the first encoding rule determined according to the first encoding principle comprises:
    编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且针对每一个二值化字符串,该二值化字符串的第一个比特位的编码方式为等概率编码的方式,在该二值化字符串还包括第二个比特位的情况下,该二值化字符串的第二个比特位的编码方式为基于上下文模型的编码方式。Encoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each binarized string, the first bit of the binarized string The coding mode is equal probability coding. When the binarized character string further includes the second bit, the coding mode of the second bit of the binarized character string is based on the context model. .
  12. 根据权利要求1或2所述的方法,其特征在于,按照所述第二编码原则确定的所述第一编码规则,包括:The method according to claim 1 or 2, wherein the first encoding rule determined according to the second encoding principle comprises:
    编码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is based on the context model. the way.
  13. 一种SAO类型的解码方法,其特征在于,所述方法包括:A method for decoding an SAO type, the method comprising:
    按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到所 述目标二值化字符串;其中,所述第一解码规则记录有被编码二值化字符串的熵解码方式,以及各SAO类型与二值化字符串的对应关系;Entropy decoding of the encoded target binarized character string corresponding to the target coding tree block CTB according to the entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule a target binarized character string; wherein the first decoding rule records an entropy decoding manner of the encoded binarized character string, and a correspondence relationship between each SAO type and the binarized character string;
    按照所述第一解码规则中所记录的各SAO类型与二值化字符串的对应关系,确定所述目标二值化字符串所对应的目标SAO类型。Determining, according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule, a target SAO type corresponding to the target binarized character string.
    其中,所述第一解码规则为按照下述解码原则中的任一种所确定的:The first decoding rule is determined according to any one of the following decoding principles:
    第一解码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first decoding principle: the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
    第二解码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应被编码二值化字符串的比特位的熵解码方式为基于上下文模型的解码方式。The second decoding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy decoding method for distinguishing the bits corresponding to the encoded binarized character string respectively for the EO mode and the BO mode is based on The way the context model is decoded.
  14. 根据权利要求13所述的方法,其特征在于,所述第一编码规则为按照所述第一编码原则、第二编码原则以及第三编码原则中的任一种所确定的;The method according to claim 13, wherein the first encoding rule is determined according to any one of the first encoding principle, the second encoding principle, and the third encoding principle;
    所述第三编码原则为:被编码二值化字符串中的每一个比特位的熵解码方式均为等概率解码方式。The third coding principle is that the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode.
  15. 根据权利要求13或14所述的方法,其特征在于,在所述按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到所述目标二值化字符串的步骤之前,所述方法还包括:The method according to claim 13 or 14, wherein the entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule is corresponding to the target coding tree block CTB Before the step of entropy decoding the encoded target binarized string to obtain the target binarized string, the method further includes:
    针对目标编码树块CTB所对应被编码的目标二值化字符串,判断是否满足预设执行条件,所述预设执行条件为:用于表示所述目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件;Determining whether the preset execution condition is met for the target binarized character string corresponding to the target coding tree block CTB, the preset execution condition being: indicating the prediction of the target coding tree unit CTU to which the target CTB belongs a condition with low conversion accuracy;
    如果满足,执行所述按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到所述目标二值化字符串的步骤。If yes, perform entropy decoding on the encoded binarized character string corresponding to the target coding tree block CTB according to the entropy decoding mode of the encoded binarized character string recorded in the preset first decoding rule. The step of obtaining the target binarized string.
  16. 根据权利要求15所述的方法,其特征在于,所述判断是否满足预设执行条件的步骤,包括:The method according to claim 15, wherein the step of determining whether the preset execution condition is met comprises:
    基于目标图像判断是否满足预设执行条件;其中,所述目标图像为所述目标CTU所处的图像。Determining whether the preset execution condition is satisfied based on the target image; wherein the target image is an image in which the target CTU is located.
  17. 根据权利要求16所述的方法,其特征在于,所述基于目标图像判断 是否满足预设执行条件的步骤,包括:The method of claim 16 wherein said determining based on the target image The steps to meet the preset execution conditions, including:
    判断目标图像是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足所述预设执行条件:Determining whether the target image meets at least one of the following conditions, if it is met, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not satisfied:
    所述目标图像为帧内预测图像;The target image is an intra prediction image;
    所述目标图像所使用量化参数大于第一预设阈值;The quantization parameter used by the target image is greater than a first preset threshold;
    所述目标图像的头信息中携带目标标识信息,所述目标标识信息为表明所述目标图像中所有CTB所对应的SAO类型均需要按照所述第一编码规则进行编码的标识信息;The header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule;
    所述目标图像不是双向预测图像。The target image is not a bidirectional predicted image.
  18. 根据权利要求15所述的方法,其特征在于,所述判断是否满足预设执行条件的步骤,包括:The method according to claim 15, wherein the step of determining whether the preset execution condition is met comprises:
    基于所述目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件。Determining whether the preset execution condition is satisfied based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
  19. 根据权利要求18所述的方法,其特征在于,所述基于目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件的步骤,包括:The method according to claim 18, wherein the step of determining whether the preset execution condition is satisfied is determined based on at least one of quantization information, prediction information, and transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs. include:
    判断目标CTB所属目标编码树单元CTU是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足所述预设执行条件:Determining whether the target coding tree unit CTU to which the target CTB belongs meets at least one of the following conditions, if yes, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not satisfied:
    所述目标CTU中的所有预测单元均为帧内预测单元;All prediction units in the target CTU are intra prediction units;
    所述目标CTU所使用的量化参数大于第二预设阈值;The quantization parameter used by the target CTU is greater than a second preset threshold;
    所述目标CTU中的所有变换单元的平均大小小于第三预设阈值;The average size of all transform units in the target CTU is less than a third preset threshold;
    所述目标CTU中的所有编码单元的平均大小小于第四预设阈值。The average size of all coding units in the target CTU is less than a fourth preset threshold.
  20. 根据权利要求15所述的方法,其特征在于,所述判断是否满足预设执行条件的步骤,包括:The method according to claim 15, wherein the step of determining whether the preset execution condition is met comprises:
    判断在对所述目标CTB所属的目标编码树单元CTU进行去块滤波时的环路滤波强度值是否大于第五预设阈值;如果大于,判定满足预设执行条件;否则,判定不满足所述预设执行条件。Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the condition is not satisfied Preset execution conditions.
  21. 根据权利要求13或14所述的方法,其特征在于,按照所述第一解 码原则确定的所述第一解码规则,包括:Method according to claim 13 or 14, characterized in that according to said first solution The first decoding rule determined by the code principle includes:
    解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to EO mode, skip mode and BO mode are 0, 10, 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model The way to decode.
  22. 根据权利要求13或14所述的方法,其特征在于,按照所述第一解码原则确定的所述第一解码规则,包括:The method according to claim 13 or 14, wherein the first decoding rule determined according to the first decoding principle comprises:
    解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为等概率解码的方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
  23. 根据权利要求13或14所述的方法,其特征在于,按照所述第一解码原则确定的所述第一解码规则,包括:The method according to claim 13 or 14, wherein the first decoding rule determined according to the first decoding principle comprises:
    解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且针对每一个被编码二值化字符串,该被编码二值化字符串的第一个比特位的解码方式为等概率解码的方式,在该被编码二值化字符串还包括第二个比特位的情况下,该被编码二值化字符串的第二个比特位的解码方式为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each encoded binarized string, the encoded binary string is The decoding mode of one bit is a method of equal probability decoding, and in the case where the encoded binarized character string further includes the second bit, the decoding of the second bit of the encoded binarized character string The mode is a context model based decoding method.
  24. 根据权利要求13或14所述的方法,其特征在于,按照所述第二解码原则确定的所述第一解码规则,包括:The method according to claim 13 or 14, wherein the first decoding rule determined according to the second decoding principle comprises:
    解码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model. The way to decode.
  25. 一种SAO类型的编码装置,其特征在于,所述装置包括:An SAO type encoding device, characterized in that the device comprises:
    第一确定模块,用于在决策出目标编码树块CTB的目标SAO类型后,按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定所述目标SAO类型所对应的目标二值化字符串,其中,所述第一编码规则中记录有各SAO类型与二值化字符串的对应关系,以及二值化字符串的熵编码方式;a first determining module, configured to determine the target according to a correspondence between each SAO type and a binary string recorded in a preset first encoding rule after determining a target SAO type of the target coding tree block CTB a target binarized character string corresponding to the SAO type, wherein the first encoding rule records a correspondence between each SAO type and a binarized character string, and an entropy encoding mode of the binarized character string;
    熵编码模块,用于按照所述第一编码规则中记录的二值化字符串的熵编 码方式,对所述目标二值化字符串进行熵编码,得到所述目标SAO类型所对应的编码结果;An entropy encoding module, configured to perform entropy coding of the binarized character string recorded in the first encoding rule a code mode, entropy encoding the target binarized character string, and obtaining an encoding result corresponding to the target SAO type;
    其中,所述第一编码规则为按照下述编码原则中的任一种所确定的:Wherein the first coding rule is determined according to any one of the following coding principles:
    第一编码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first coding principle: the length of the binarized string corresponding to the EO mode is less than at least one of the lengths of the binarized strings respectively corresponding to the BO mode and the skip mode;
    第二编码原则:EO模式和BO模式所分别对应二值化字符串的长度相同;且用于区分EO模式和BO模式所分别对应二值化字符串的比特位的熵编码方式为基于上下文模型的编码方式。The second coding principle: the EO mode and the BO mode respectively correspond to the same length of the binarized character string; and the entropy coding mode for distinguishing the bits corresponding to the binarized character string of the EO mode and the BO mode respectively is based on the context model The encoding method.
  26. 根据权利要求25所述的装置,其特征在于,所述第一编码规则为按照所述第一编码原则、所述第二编码原则以及第三编码原则中的任一种所确定的;The apparatus according to claim 25, wherein the first encoding rule is determined according to any one of the first encoding principle, the second encoding principle, and the third encoding principle;
    所述第三编码原则为:二值化字符串中的每一个比特位的熵编码方式均为等概率编码方式。The third coding principle is that the entropy coding mode of each bit in the binarized character string is an equal probability coding mode.
  27. 根据权利要求25或26所述的装置,其特征在于,所述装置还包括:The device according to claim 25 or 26, wherein the device further comprises:
    第一判断模块,用于在决策出目标编码树块CTB的目标SAO类型后,判断是否满足预设执行条件,所述预设执行条件为:用于表示所述目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件;a first determining module, configured to determine whether a preset execution condition is met after the target SAO type of the target coding tree block CTB is determined, where the preset execution condition is: a target coding tree unit used to represent the target CTB CTU predictive transformation accuracy is low;
    相应的,所述第一确定模块,具体用于:Correspondingly, the first determining module is specifically configured to:
    在所述第一判断模块的判断结果为是的情况下,按照预设的第一编码规则中所记录的各SAO类型与二值化字符串的对应关系,确定所述目标SAO类型所对应的目标二值化字符串。If the determination result of the first determining module is YES, determining, according to the correspondence between each SAO type and the binarized character string recorded in the preset first encoding rule, determining the target SAO type Target binarized string.
  28. 根据权利要求27所述的装置,其特征在于,所述第一判断模块,具体用于:The device according to claim 27, wherein the first determining module is specifically configured to:
    基于目标图像判断是否满足预设执行条件;其中,所述目标图像为所述目标CTU所处的图像。Determining whether the preset execution condition is satisfied based on the target image; wherein the target image is an image in which the target CTU is located.
  29. 根据权利要求28所述的装置,其特征在于,所述第一判断模块,具体用于:The device according to claim 28, wherein the first determining module is specifically configured to:
    判断目标图像是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足所述预设执行条件: Determining whether the target image meets at least one of the following conditions, if it is met, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not satisfied:
    所述目标图像为帧内预测图像;The target image is an intra prediction image;
    所述目标图像所使用量化参数大于第一预设阈值;The quantization parameter used by the target image is greater than a first preset threshold;
    所述目标图像的头信息中携带目标标识信息,所述目标标识信息为表明所述目标图像中所有CTB所对应的SAO类型均需要按照所述第一编码规则进行编码的标识信息;The header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule;
    所述目标图像不是双向预测图像。The target image is not a bidirectional predicted image.
  30. 根据权利要求27所述的装置,其特征在于,所述第一判断模块,具体用于:The device according to claim 27, wherein the first determining module is specifically configured to:
    基于所述目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件。Determining whether the preset execution condition is satisfied based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
  31. 根据权利要求30所述的装置,其特征在于,所述第一判断模块,具体用于:The device according to claim 30, wherein the first determining module is specifically configured to:
    判断目标CTB所属目标编码树单元CTU是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足所述预设执行条件:Determining whether the target coding tree unit CTU to which the target CTB belongs meets at least one of the following conditions, if yes, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not satisfied:
    所述目标CTU中的所有预测单元均为帧内预测单元;All prediction units in the target CTU are intra prediction units;
    所述目标CTU所使用的量化参数大于第二预设阈值;The quantization parameter used by the target CTU is greater than a second preset threshold;
    所述目标CTU中的所有变换单元的平均大小小于第三预设阈值;The average size of all transform units in the target CTU is less than a third preset threshold;
    所述目标CTU中的所有编码单元的平均大小小于第四预设阈值。The average size of all coding units in the target CTU is less than a fourth preset threshold.
  32. 根据权利要求27所述的装置,其特征在于,所述第一判断模块,具体用于:The device according to claim 27, wherein the first determining module is specifically configured to:
    判断在对所述目标CTB所属的目标编码树单元CTU进行去块滤波时的环路滤波强度值是否大于第五预设阈值;如果大于,判定满足预设执行条件;否则,判定不满足所述预设执行条件。Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the condition is not satisfied Preset execution conditions.
  33. 根据权利要求25或26所述的装置,其特征在于,按照所述第一编码原则确定的所述第一编码规则,包括:The apparatus according to claim 25 or 26, wherein the first encoding rule determined according to the first encoding principle comprises:
    编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。 Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized string is based on the context model. the way.
  34. 根据权利要求25或26所述的装置,其特征在于,按照所述第一编码原则确定的所述第一编码规则,包括:The apparatus according to claim 25 or 26, wherein the first encoding rule determined according to the first encoding principle comprises:
    编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为等概率编码的方式。Coding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is an equal probability coding method. .
  35. 根据权利要求25或26所述的装置,其特征在于,按照所述第一编码原则确定的所述第一编码规则,包括:The apparatus according to claim 25 or 26, wherein the first encoding rule determined according to the first encoding principle comprises:
    编码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且针对每一个二值化字符串,该二值化字符串的第一个比特位的编码方式为等概率编码的方式,在该二值化字符串还包括第二个比特位的情况下,该二值化字符串的第二个比特位的编码方式为基于上下文模型的编码方式。Encoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each binarized string, the first bit of the binarized string The coding mode is equal probability coding. When the binarized character string further includes the second bit, the coding mode of the second bit of the binarized character string is based on the context model. .
  36. 根据权利要求25或26所述的装置,其特征在于,按照所述第二编码原则确定的所述第一编码规则,包括:The apparatus according to claim 25 or 26, wherein the first encoding rule determined according to the second encoding principle comprises:
    编码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且二值化字符串的每个比特位的熵编码方式均为基于上下文模型的编码方式。Coding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy coding mode of each bit of the binarized character string is based on the context model. the way.
  37. 一种SAO类型的解码装置,其特征在于,所述装置包括:An SAO type decoding device, characterized in that the device comprises:
    熵解码模块,用于按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到所述目标二值化字符串;其中,所述第一解码规则记录有被编码二值化字符串的熵解码方式,以及各SAO类型与二值化字符串的对应关系;An entropy decoding module, configured to entropy decode the encoded target binarized character string corresponding to the target coding tree block CTB according to an entropy decoding manner of the encoded binarized character string recorded in the preset first decoding rule, Obtaining the target binarized character string; wherein the first decoding rule records an entropy decoding manner of the encoded binarized character string, and a correspondence relationship between each SAO type and the binarized character string;
    第二确定模块,用于按照所述第一解码规则中所记录的各SAO类型与二值化字符串的对应关系,确定所述目标二值化字符串所对应的目标SAO类型。The second determining module is configured to determine, according to the correspondence between each SAO type and the binarized character string recorded in the first decoding rule, a target SAO type corresponding to the target binarized character string.
    其中,所述第一解码规则为按照下述解码原则中的任一种所确定的:The first decoding rule is determined according to any one of the following decoding principles:
    第一解码原则:EO模式所对应二值化字符串的长度小于BO模式和跳过模式所分别对应二值化字符串的长度中至少一个;The first decoding principle: the length of the binarized character string corresponding to the EO mode is less than at least one of the lengths of the binarized character strings respectively corresponding to the BO mode and the skip mode;
    第二解码原则:EO模式和BO模式所分别对应二值化字符串的长度相 同;且用于区分EO模式和BO模式所分别对应被编码二值化字符串的比特位的熵解码方式为基于上下文模型的解码方式。The second decoding principle: the EO mode and the BO mode respectively correspond to the length of the binarized string And the entropy decoding method for distinguishing the bits corresponding to the encoded binary string respectively in the EO mode and the BO mode is a context model based decoding mode.
  38. 根据权利要求37所述的装置,其特征在于,所述第一编码规则为按照所述第一编码原则、第二编码原则以及第三编码原则中的任一种所确定的;The apparatus according to claim 37, wherein the first encoding rule is determined according to any one of the first encoding principle, the second encoding principle, and the third encoding principle;
    所述第三编码原则为:被编码二值化字符串中的每一个比特位的熵解码方式均为等概率解码方式。The third coding principle is that the entropy decoding mode of each bit in the encoded binarized character string is an equal probability decoding mode.
  39. 根据权利要求37或38所述的装置,其特征在于,所述装置还包括:The device according to claim 37 or 38, wherein the device further comprises:
    第二判断模块,用于针对目标编码树块CTB所对应被编码的目标二值化字符串,判断是否满足预设执行条件,所述预设执行条件为:用于表示所述目标CTB所属的目标编码树单元CTU的预测变换准确度低的条件;a second determining module, configured to determine, according to the target binarized character string corresponding to the target coding tree block CTB, whether the preset execution condition is met, where the preset execution condition is: used to indicate that the target CTB belongs to a condition that the prediction transform accuracy of the target coding tree unit CTU is low;
    相应的,所述熵解码模块,具体用于:Correspondingly, the entropy decoding module is specifically configured to:
    在所述第二判断模块的判断结果为是的情况下,按照预设的第一解码规则中记录的被编码二值化字符串的熵解码方式,对目标编码树块CTB所对应被编码的目标二值化字符串进行熵解码,得到所述目标二值化字符串。If the determination result of the second judging module is yes, the target coding tree block CTB is encoded according to the entropy decoding manner of the encoded binarized character string recorded in the preset first decoding rule. The target binarized string is entropy decoded to obtain the target binarized string.
  40. 根据权利要求39所述的装置,其特征在于,所述第二判断模块,具体用于:The device according to claim 39, wherein the second determining module is specifically configured to:
    基于目标图像判断是否满足预设执行条件;其中,所述目标图像为所述目标CTU所处的图像。Determining whether the preset execution condition is satisfied based on the target image; wherein the target image is an image in which the target CTU is located.
  41. 根据权利要求40所述的装置,其特征在于,所述第二判断模块,具体用于:The device according to claim 40, wherein the second determining module is specifically configured to:
    判断目标图像是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足所述预设执行条件:Determining whether the target image meets at least one of the following conditions, if it is met, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not satisfied:
    所述目标图像为帧内预测图像;The target image is an intra prediction image;
    所述目标图像所使用量化参数大于第一预设阈值;The quantization parameter used by the target image is greater than a first preset threshold;
    所述目标图像的头信息中携带目标标识信息,所述目标标识信息为表明所述目标图像中所有CTB所对应的SAO类型均需要按照所述第一编码规则进行编码的标识信息;The header information of the target image carries the target identifier information, where the target identifier information is identifier information indicating that the SAO types corresponding to all CTBs in the target image need to be encoded according to the first encoding rule;
    所述目标图像不是双向预测图像。The target image is not a bidirectional predicted image.
  42. 根据权利要求39所述的装置,其特征在于,所述第二判断模块,具 体用于:The device according to claim 39, wherein said second determining module has Body for:
    基于所述目标CTB所属目标编码树单元CTU自身的量化信息、预测信息以及变换信息中的至少一种,判断是否满足预设执行条件。Determining whether the preset execution condition is satisfied based on at least one of the quantization information, the prediction information, and the transformation information of the target coding tree unit CTU of the target CTB to which the target CTB belongs.
  43. 根据权利要求42所述的装置,其特征在于,所述第二判断模块,具体用于:The device according to claim 42, wherein the second determining module is specifically configured to:
    判断目标CTB所属目标编码树单元CTU是否符合如下条件中的至少一种,如果符合,判定满足预设执行条件;否则,判定不满足所述预设执行条件:Determining whether the target coding tree unit CTU to which the target CTB belongs meets at least one of the following conditions, if yes, determining that the preset execution condition is satisfied; otherwise, determining that the preset execution condition is not satisfied:
    所述目标CTU中的所有预测单元均为帧内预测单元;All prediction units in the target CTU are intra prediction units;
    所述目标CTU所使用的量化参数大于第二预设阈值;The quantization parameter used by the target CTU is greater than a second preset threshold;
    所述目标CTU中的所有变换单元的平均大小小于第三预设阈值;The average size of all transform units in the target CTU is less than a third preset threshold;
    所述目标CTU中的所有编码单元的平均大小小于第四预设阈值。The average size of all coding units in the target CTU is less than a fourth preset threshold.
  44. 根据权利要求39所述的装置,其特征在于,所述第二判断模块,具体用于:The device according to claim 39, wherein the second determining module is specifically configured to:
    判断在对所述目标CTB所属的目标编码树单元CTU进行去块滤波时的环路滤波强度值是否大于第五预设阈值;如果大于,判定满足预设执行条件;否则,判定不满足所述预设执行条件。Determining whether the loop filter strength value when performing deblocking filtering on the target coding tree unit CTU to which the target CTB belongs is greater than a fifth preset threshold; if greater than, determining that the preset execution condition is satisfied; otherwise, determining that the condition is not satisfied Preset execution conditions.
  45. 根据权利要求37或38所述的装置,其特征在于,按照所述第一解码原则确定的所述第一解码规则,包括:The apparatus according to claim 37 or 38, wherein the first decoding rule determined according to the first decoding principle comprises:
    解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to EO mode, skip mode and BO mode are 0, 10, 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model The way to decode.
  46. 根据权利要求37或38所述的装置,其特征在于,按照所述第一解码原则确定的所述第一解码规则,包括:The apparatus according to claim 37 or 38, wherein the first decoding rule determined according to the first decoding principle comprises:
    解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为等概率解码的方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is equal probability decoding. The way.
  47. 根据权利要求37或38所述的装置,其特征在于,按照所述第一解码原则确定的所述第一解码规则,包括: The apparatus according to claim 37 or 38, wherein the first decoding rule determined according to the first decoding principle comprises:
    解码规则:EO模式、跳过模式和BO模式所对应的二值化字符串分别为0、10、11;且针对每一个被编码二值化字符串,该被编码二值化字符串的第一个比特位的解码方式为等概率解码的方式,在该被编码二值化字符串还包括第二个比特位的情况下,该被编码二值化字符串的第二个比特位的解码方式为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the EO mode, the skip mode, and the BO mode are 0, 10, and 11 respectively; and for each encoded binarized string, the encoded binary string is The decoding mode of one bit is a method of equal probability decoding, and in the case where the encoded binarized character string further includes the second bit, the decoding of the second bit of the encoded binarized character string The mode is a context model based decoding method.
  48. 根据权利要求37或38所述的装置,其特征在于,按照所述第二解码原则确定的所述第一解码规则,包括:The apparatus according to claim 37 or 38, wherein the first decoding rule determined according to the second decoding principle comprises:
    解码规则:跳过模式、BO模式和EO模式所对应的二值化字符串分别为0、10、11;且被编码二值化字符串的每个比特位的熵解码方式均为基于上下文模型的解码方式。Decoding rules: the binarized strings corresponding to the skip mode, the BO mode, and the EO mode are 0, 10, and 11 respectively; and the entropy decoding mode of each bit of the encoded binarized string is based on the context model. The way to decode.
  49. 一种编码器,其特征在于,包括第一处理器和第一存储器,其中;An encoder, comprising: a first processor and a first memory, wherein
    第一存储器,用于存放计算机程序;a first memory for storing a computer program;
    第一处理器,用于执行第一存储器上所存放的程序时,实现权利要求1-12任一所述的方法步骤。The first processor, when used to execute a program stored on the first memory, implements the method steps of any of claims 1-12.
  50. 一种解码器,其特征在于,包括第二处理器和第二存储器,其中;A decoder, comprising: a second processor and a second memory, wherein
    第二存储器,用于存放计算机程序;a second memory for storing a computer program;
    第二处理器,用于执行第二存储器上所存放的程序时,实现权利要求13-24任一所述的方法步骤。The second processor, when used to execute a program stored on the second memory, implements the method steps of any of claims 13-24.
  51. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1-12任一所述的方法步骤。A computer readable storage medium, wherein the computer readable storage medium stores a computer program, the computer program being executed by a processor to implement the method steps of any of claims 1-12.
  52. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质内存储有计算机程序,所述计算机程序被处理器执行时实现权利要求13-24任一所述的方法步骤。 A computer readable storage medium, wherein the computer readable storage medium stores a computer program, the computer program being executed by a processor to implement the method steps of any of claims 13-24.
PCT/CN2017/106547 2017-10-17 2017-10-17 Coding and decoding method and apparatus, coder, decoder, and storage medium WO2019075638A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201780006030.5A CN108702521B (en) 2017-10-17 2017-10-17 Encoding and decoding method, apparatus, encoder, decoder and storage medium
PCT/CN2017/106547 WO2019075638A1 (en) 2017-10-17 2017-10-17 Coding and decoding method and apparatus, coder, decoder, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/106547 WO2019075638A1 (en) 2017-10-17 2017-10-17 Coding and decoding method and apparatus, coder, decoder, and storage medium

Publications (1)

Publication Number Publication Date
WO2019075638A1 true WO2019075638A1 (en) 2019-04-25

Family

ID=63844087

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/106547 WO2019075638A1 (en) 2017-10-17 2017-10-17 Coding and decoding method and apparatus, coder, decoder, and storage medium

Country Status (2)

Country Link
CN (1) CN108702521B (en)
WO (1) WO2019075638A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115422115B (en) * 2022-11-01 2023-02-24 山东云海国创云计算装备产业创新中心有限公司 Coding method, system, storage medium and equipment based on bus

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130188741A1 (en) * 2012-01-21 2013-07-25 General Instrument Corporation Devices and methods for sample adaptive offset coding and/or selection of band offset parameters
CN103391440A (en) * 2013-07-19 2013-11-13 华为技术有限公司 Binarization encoding processing method and device of syntactic information
CN104303506A (en) * 2012-05-29 2015-01-21 联发科技股份有限公司 Method and apparatus for coding of sample adaptive offset information
CN104396146A (en) * 2012-07-02 2015-03-04 索尼公司 Decoupling enhancements in sample adaptive offset (SAO) for high efficiency video encoder (HEVC)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
BR112014012351A2 (en) * 2011-11-08 2017-05-30 Motorola Mobility Llc devices and methods for coding and / or sample adapted displacement signaling
US9716882B2 (en) * 2012-01-05 2017-07-25 Google Technology Holdings LLC Devices and methods for sample adaptive offset coding and/or selection of edge offset parameters
AU2013290950B2 (en) * 2012-07-16 2016-10-20 Samsung Electronics Co., Ltd. Video encoding method and video encoding apparatus and video decoding method and video decoding apparatus for signaling SAO parameter
CN104486630B (en) * 2014-12-16 2017-10-20 北京金山云网络技术有限公司 H.265 in Video coding under SAO patterns offset statistical method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130188741A1 (en) * 2012-01-21 2013-07-25 General Instrument Corporation Devices and methods for sample adaptive offset coding and/or selection of band offset parameters
CN104303506A (en) * 2012-05-29 2015-01-21 联发科技股份有限公司 Method and apparatus for coding of sample adaptive offset information
CN104396146A (en) * 2012-07-02 2015-03-04 索尼公司 Decoupling enhancements in sample adaptive offset (SAO) for high efficiency video encoder (HEVC)
CN103391440A (en) * 2013-07-19 2013-11-13 华为技术有限公司 Binarization encoding processing method and device of syntactic information

Also Published As

Publication number Publication date
CN108702521A (en) 2018-10-23
CN108702521B (en) 2020-03-31

Similar Documents

Publication Publication Date Title
WO2020253828A1 (en) Coding and decoding method and device, and storage medium
US10523966B2 (en) Coding transform blocks
TWI499285B (en) Determining boundary strength values for deblocking filtering for video coding
US10742984B2 (en) Method and apparatus for multi-table based context adaptive binary arithmetic coding
TW201334543A (en) Determining quantization parameters for deblocking filtering for video coding
CN113812155B (en) Interaction between multiple inter-frame coding and decoding methods
TW202007171A (en) Cross-component coding order derivation
US9112526B2 (en) Binarization of DQP using separate absolute value and sign (SAVS) in CABAC
WO2019085942A1 (en) Sao mode decision-making method, apparatus, electronic device and readable storage medium
CN113711597B (en) Context modeling and selection of multiple transformation matrices
US11350131B2 (en) Signaling coding of transform-skipped blocks
CN110024385B (en) Video encoding/decoding method, apparatus, and recording medium storing bit stream
US11695962B2 (en) Encoding and decoding methods and corresponding devices
WO2019086033A1 (en) Video data decoding method and device
WO2022116317A1 (en) Intra-frame prediction methods, encoder, decoder and storage medium
KR20220036982A (en) Quadratic transformation for video encoding and decoding
JP2024045346A (en) In-loop filtering method and apparatus
CN112369026A (en) Apparatus and method for encoding video data based on one or more reference lines
US20240040129A1 (en) Residual and coefficients coding for video coding
JP2022521933A (en) Coding method, decoding method, decoder, encoder and storage medium
WO2019075638A1 (en) Coding and decoding method and apparatus, coder, decoder, and storage medium
WO2022227082A1 (en) Block division methods, encoders, decoders, and computer storage medium
WO2023083239A1 (en) Image decoding method and apparatus, and image encoding method and apparatus
CN115398911A (en) Method and apparatus for transform and coefficient signaling
CN115299047A (en) Method and apparatus for video encoding and decoding using palette mode

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

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

Country of ref document: EP

Kind code of ref document: A1