WO2020001210A1 - 图像的编码、解码方法及装置、电子设备及系统 - Google Patents

图像的编码、解码方法及装置、电子设备及系统 Download PDF

Info

Publication number
WO2020001210A1
WO2020001210A1 PCT/CN2019/088325 CN2019088325W WO2020001210A1 WO 2020001210 A1 WO2020001210 A1 WO 2020001210A1 CN 2019088325 W CN2019088325 W CN 2019088325W WO 2020001210 A1 WO2020001210 A1 WO 2020001210A1
Authority
WO
WIPO (PCT)
Prior art keywords
coefficient
size
parameter
coefficient group
value
Prior art date
Application number
PCT/CN2019/088325
Other languages
English (en)
French (fr)
Inventor
李明
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN201810681664.7A external-priority patent/CN110650343B/zh
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Priority to EP19826712.2A priority Critical patent/EP3817385A4/en
Priority to JP2020571788A priority patent/JP7271580B2/ja
Priority to US17/255,044 priority patent/US11647196B2/en
Priority to KR1020217002590A priority patent/KR102569844B1/ko
Publication of WO2020001210A1 publication Critical patent/WO2020001210A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/119Adaptive subdivision aspects, e.g. subdivision of a picture into rectangular or non-rectangular coding blocks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/102Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or selection affected or controlled by the adaptive coding
    • H04N19/129Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
    • 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/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/117Filters, e.g. for pre-processing or post-processing
    • 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/146Data rate or code amount at the encoder output
    • H04N19/147Data rate or code amount at the encoder output according to rate distortion criteria
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/10Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
    • H04N19/134Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding characterised by the element, parameter or criterion affecting or controlling the adaptive coding
    • H04N19/157Assigned coding mode, i.e. the coding mode being predefined or preselected to be further used for selection of another element or parameter
    • H04N19/159Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
    • 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/18Methods 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 set of transform coefficients
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/503Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving temporal prediction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/50Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding
    • H04N19/593Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using predictive coding involving spatial prediction techniques
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/70Methods or arrangements for coding, decoding, compressing or decompressing digital video signals characterised by syntax aspects related to video coding, e.g. related to compression standards

Definitions

  • the present application relates to the field of communications, and in particular, to an image encoding and decoding method and device, an electronic device, and a system.
  • Digital video (Video) and picture (Picture) compression coding technology uses the correlation between pixel values in the video and the image to remove the redundancy existing in the video and the image.
  • Image compression utilizes the spatial domain correlation between adjacent pixel points (Sample) in the image. By using adjacent encoded pixels to predict the pixels to be encoded, it reduces the number of adjacent pixels in the spatial domain. Redundancy. This type of method is commonly referred to as intra prediction (Intra Prediction).
  • Digital video consists of a series of continuous images.
  • digital video compression also uses the correlation between adjacent images in the time domain. For example, motion estimation (Motion Estimation) and motion compensation (Motion Compensation) are used.
  • Method using the encoded image as a reference to predict the current encoded image. This type of method is often called Inter Prediction.
  • the encoder uses intra prediction and inter prediction methods to determine the prediction value of the encoding block, calculate the difference between the encoding block sample value and the prediction value, and use it as the encoding block. Residual.
  • the encoder may transform the prediction difference.
  • the prediction difference of the coding block can be expressed as a two-dimensional matrix of M ⁇ x, where M and N are both positive integers, and M and N may be equal or unequal.
  • the encoder transforms the two-dimensional matrix and processes the data in the two-dimensional matrix obtained after the transformation to obtain the transformation coefficient (Coefficient) to be entropy encoded.
  • the processing The data may be quantized, or the data may not be quantized.
  • the encoder scans the transform coefficients represented by the two-dimensional matrix, and encodes the transform coefficients.
  • a two-dimensional matrix of encoder transformation coefficients is divided into one or more 4 ⁇ 4 fixed-size coefficient groups (CG).
  • CG fixed-size coefficient groups
  • the encoder uses the specified scan order to sequentially encode the transform coefficients in the 4x4 block. This method has the following main drawbacks: it uses a fixed-size coefficient group, which prevents the encoder from selecting the most efficient encoding coefficient encoding method according to the distribution of the transformation coefficients in the two-dimensional matrix.
  • a flag bit indicating whether the coefficient group contains a non-zero transform coefficient needs to be encoded for each coefficient group.
  • the coding overhead of the flag bit is large.
  • Embodiments of the present invention provide an image encoding and decoding method and device, an electronic device, and a system, so as to at least solve a fixed-size coefficient group in the related art, so that an encoder cannot select the optimal coefficient according to the distribution of transform coefficients in a two-dimensional matrix The problem of efficient coding coefficient coding.
  • an image coding method which includes: determining a prediction value of a coding block, calculating a prediction difference value between the coding block and the prediction value, and performing the prediction difference value one or more times.
  • To obtain transformation data and use the transformation data to determine transformation coefficients; determine the scanning mode of the transformation coefficients and the size of the coefficient group, divide the transformation coefficient into one or more coefficient groups, and according to the scanning mode Scanning the transform coefficients contained in each of the coefficient groups, transforming the transform coefficients into one or more syntax elements; encoding the size of the coefficient group and the value of the syntax elements, and writing the encoded bits into Code stream.
  • determining the prediction value of the encoding block includes at least one of the following methods: using one or more encoded images as a reference image to determine the prediction value of the encoding block; or determining the prediction value of the encoding block; The encoded part in the image is used as a reference to determine the prediction value of the encoded block.
  • using the transformation data to determine a transformation coefficient includes: when it is judged that the transformation data is quantized, performing quantization processing on the transformation data to obtain the transformation coefficient; when it is judged that the transformation data is not quantized , The transformation coefficient is set using the transformation data.
  • determining the size of the coefficient group of the transformation coefficient includes: determining the size of the coefficient group of the transformation coefficient according to a preset candidate value.
  • determining the size of the coefficient group of the transformation coefficient according to the preset candidate value includes using a method of rate-distortion optimization to determine the size of the coefficient group of the transformation coefficient from the candidate value.
  • the number of encoding bits of the transform coefficient is calculated when the value in the candidate value is used as the size of the coefficient group, and the value in the candidate value that can minimize the number of encoding bits is selected as the transform coefficient.
  • the size of the coefficient group is calculated when the value in the candidate value is used as the size of the coefficient group, and the value in the candidate value that can minimize the number of encoding bits is selected as the transform coefficient.
  • determining the size of the coefficient group of the transformation coefficient according to the preset candidate value includes: determining the size of the coefficient group of the transformation coefficient according to the distribution of the transformation coefficient.
  • the distribution of the transform coefficients is detected by scanning the transform coefficients, and detecting the concentration of non-zero coefficients in the transform coefficients, where the concentration of the non-zero coefficients refers to the transform coefficients The number of zero-valued coefficients between the non-zero coefficients, and the smaller the number of zero-valued coefficients, the higher the degree of concentration of the non-zero coefficients; selecting from the candidate values the candidate value that makes the degree of concentration the highest The value in is used as the size of the coefficient group of the transformation coefficient.
  • the candidate value includes at least one: one or more fixed values; one or more configured values; and a value of a size of a coefficient group used by the coded block adjacent to the coded block.
  • the method further includes: writing the candidate value identification parameter into one or more of the code stream.
  • the identification parameter is used to indicate the candidate value of the configuration;
  • the data unit in the code stream includes at least one of the following: one or more parameter sets, a slice header, and a block layer Data unit.
  • the preset candidate identification parameter of the size of the coefficient group includes at least one of the following: the size of the coefficient group, the side length of the coefficient group, and the width and height of the coefficient group.
  • writing the identification parameter into the code stream using one or more of the following methods includes: writing the maximum value and the minimum value of the identification parameter into the code stream; and writing the identification parameter Write the maximum value of the coefficient group and the maximum division level of the coefficient group into the code stream; write the difference between the maximum value of the identification parameter and the maximum and minimum values of the size of the coefficient group into the code Write the minimum value of the identification parameter and the maximum upward division level of the coefficient group into the code stream; between the minimum value of the identification parameter and the maximum and minimum values of the size of the coefficient group Is written into the code stream.
  • writing the identification parameter into the code stream using one or more of the following methods further includes: writing a default value of the identification parameter into the code stream.
  • the identification parameter of a preset candidate value of the size of the coefficient group includes: the identification parameter is one or more flags indicating whether the size of the corresponding coefficient group is included in the candidate value Coefficient group size.
  • the identification parameter of the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to the preset one or more prediction modes.
  • the identification parameter of the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to one or more preset transformations.
  • the identification parameter of the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to the preset one or more transformation types.
  • the identification parameter of the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to the preset one or more quantization parameters; or The identification parameter indicates a size of one or more coefficient groups corresponding to a preset value range of one or more quantization parameters.
  • the identification parameter of the preset candidate value of the size of the coefficient group includes: the identification parameter indicates a size of one or more coefficient groups corresponding to a preset profile / level / level Profile / Tier / Level .
  • determining the size of the coefficient group of the transform coefficient includes: setting the size of the coefficient group of the transform coefficient in the encoding block to the first encoding parameter according to the first encoding parameter of the encoding block.
  • the transform type and quantization parameter used by the included transform block is not limited to be the transform block.
  • setting the size of the coefficient group of the transform coefficient in the encoding block to the size of the coefficient group corresponding to the first encoding parameter includes: when the When the size of the transform block included in the coding block is equal to the first preset value, the size of the coefficient group is set to the size of the coefficient group corresponding to the first preset value.
  • setting the size of the coefficient group of the transform coefficient in the encoding block to the size of the coefficient group corresponding to the first encoding parameter includes: when the When the prediction mode of the coding block is equal to the first preset mode, the size of the coefficient group is set to the size of the coefficient group corresponding to the first preset mode.
  • setting the size of the coefficient group of the transform coefficient in the encoding block to the size of the coefficient group corresponding to the first encoding parameter includes: when the When the transformation type used by the transformation block included in the encoding block is equal to the first transformation type, the size of the coefficient group is set to the size of the coefficient group corresponding to the first transformation type.
  • setting the size of the coefficient group of the transform coefficient in the encoding block to the size of the coefficient group corresponding to the first encoding parameter includes: when the When the value of the quantization parameter is equal to the second preset value, the size of the coefficient group is set to the size of the coefficient group corresponding to the second preset value; or, when the value of the quantization parameter is in the first preset value, When the value range is set, the size of the coefficient group is set to the size of the coefficient group corresponding to the first preset value range.
  • the scanning method for determining the transformation coefficient includes: determining a scanning method for the transformation coefficient according to a preset candidate scanning method, wherein the scanning method is performed on a two-dimensional matrix of the transformation coefficients. The processing order of the elements.
  • determining a scan mode for the transform coefficient according to a preset candidate scan mode includes: using a method of rate-distortion optimization to determine a scan mode of the transform coefficient from the candidate scan modes.
  • the number of encoding bits of the transform coefficient is calculated when the scan mode in the candidate scan mode is used, and the scan mode in the candidate scan mode that minimizes the number of encoding bits is selected as the transform coefficient. scanning method.
  • determining a scan mode for the transform coefficient according to a preset candidate scan mode includes: determining a scan mode of the transform coefficient according to a distribution situation of the transform coefficient.
  • the distribution of the transform coefficients is detected by scanning the transform coefficients, and detecting the concentration of non-zero coefficients in the transform coefficients, where the concentration of the non-zero coefficients refers to the transform coefficients
  • concentration of the non-zero coefficients refers to the transform coefficients
  • the number of zero-valued coefficients between the non-zero coefficients, the smaller the number of zero-valued coefficients, the higher the degree of concentration of the non-zero coefficients selecting from the candidate scanning methods the candidate that can make the degree of concentration the highest
  • the scanning method among the values is used as the scanning method of the transform coefficient.
  • the candidate scanning modes include at least one of: one or more fixed scanning modes; one or more scanning modes configured; and a scanning mode used by the coded block adjacent to the coded block.
  • the method further includes: writing the parameter of the candidate scan mode into one or more data units of the code stream,
  • the candidate scanning mode parameter is used to indicate the configured candidate scanning mode.
  • the data unit in the code stream includes at least one of the following: one or more parameter sets, a slice header, and a block-level data unit.
  • the candidate scanning mode parameters further include: a processing order of elements in the two-dimensional matrix of the transformation coefficients.
  • the candidate scanning mode parameters further include a default value of the scanning mode parameters.
  • the candidate scanning mode parameter includes: the candidate scanning mode parameter is one or more flags indicating whether a corresponding scanning mode is included in the candidate scanning mode.
  • the candidate scanning mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to a preset one or more prediction modes.
  • the candidate scanning mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to one or more preset transformations.
  • the candidate scanning mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to a preset one or more transformation types.
  • the candidate scanning mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to the preset one or more quantization parameters; or the candidate scanning mode parameter indicates a preset One or more scanning modes corresponding to one or more quantization parameter value ranges.
  • the candidate scanning mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to a preset Profile / Tier / Level.
  • the determining the scanning mode of the transform coefficient includes: setting the scanning mode of the transform coefficient in the coding block to correspond to the second coding parameter according to the second coding parameter of the transform block.
  • the type of transformation used by the block and the size of the coding block; the scanning method is the processing order of the elements in the two-dimensional matrix of the transformation coefficients.
  • setting the scanning mode of the transform coefficients in the encoding block to the scanning mode of the coefficient group corresponding to the second encoding parameter includes: when the encoding When the size of the transform block included in the block is equal to the third preset value, the scan mode of the transform coefficient is set to the scan mode corresponding to the third preset value.
  • setting the scanning mode of the transform coefficients in the encoding block to the scanning mode of the coefficient group corresponding to the second encoding parameter includes: when the encoding When the prediction mode of the block is equal to the second preset mode, the scanning mode of the transform coefficient is set to the scanning mode corresponding to the second preset mode.
  • setting the scanning mode of the transform coefficients in the encoding block to the scanning mode of the coefficient group corresponding to the second encoding parameter includes: when the encoding When the transformation type used by the transformation block included in the block is equal to the second transformation type, the scanning mode of the transformation coefficient is set to the scanning mode corresponding to the second transformation type.
  • setting the scanning mode of the transform coefficients in the encoding block to the scanning mode of the coefficient group corresponding to the second encoding parameter includes: when the encoding When the block size is equal to the fourth preset value, the scan mode of the transform coefficient is set to the scan mode corresponding to the fourth preset value.
  • determining the scanning mode and the size of the coefficient group of the transformation coefficient includes using a method of rate-distortion optimization to jointly determine the size and scanning mode of the coefficient group of the transformation coefficient.
  • the transforming the transform coefficient into one or more syntax elements includes: dividing the transform coefficient into one or more coefficient groups according to the size and scanning mode of the coefficient group, and according to the The scanning mode scans the transformation coefficients contained in the coefficient group, and represents the transformation coefficients as at least one of the following syntax elements: a syntax element indicating a starting position of a non-zero coefficient; and a syntax element indicating a non-zero coefficient in the coefficient group ; A syntax element indicating a non-zero coefficient position in the coefficient group; a syntax element indicating a non-zero coefficient value in the coefficient group.
  • the encoding the size of the coefficient group and the value of the syntax element and writing the encoded bits into a code stream includes: using the size of the coefficient group used by the transformation coefficient to use one of the following The method performs encoding: encoding the size of the coefficient group; encoding the value of the index number corresponding to the size of the coefficient group; setting a flag bit corresponding to the size of the coefficient group, and encoding the value of the flag bit.
  • encoding the size of the coefficient group and the value of the syntax element and writing the encoded bits into a code stream includes: writing the encoded bits into a data unit in the code stream, the code stream
  • the data unit in contains at least one of the following: one or more parameter sets, a slice header, and a block-level data unit.
  • an image decoding method including: analyzing a code stream to determine a predicted value of a decoded block; analyzing the code stream to determine a scan mode and a coefficient of a transform coefficient in the decoded block; The size of the group and the value of the syntax element related to the transform coefficient; processing the coefficient group in the decoding block according to the scanning method and the size of the coefficient group, and converting the syntax element into the coefficient group Transform coefficients in the processing; process the transform coefficients to obtain the restored values of the transform coefficients; perform one or more transforms on the restored values of the transform coefficients to obtain the predicted difference value of the decoded block; use the predicted values And the prediction difference to determine a recovery value of the decoded block.
  • parsing the code stream and determining the predicted value of the decoded block includes at least one of the following methods: parsing the code stream to obtain inter prediction parameters of the decoded block; and according to the inter prediction A parameter that uses one or more decoded images as reference images to determine a prediction value of the decoded block. Or, parse the code stream to obtain the intra prediction parameters of the decoded block; and based on the intra prediction parameters, use the decoded part in the image where the decoded block is located as a reference to determine the prediction of the decoded block value.
  • parsing the code stream and determining a size of a coefficient group of a transform coefficient in the decoded block includes: parsing the code stream, obtaining a first coefficient group parameter from a data unit in the code stream, and The first coefficient group parameter determines the size of the coefficient group; wherein the data unit in the code stream includes at least one of the following: one or more parameter sets, a slice header, and a block-level data unit.
  • determining the size of the coefficient group according to the first coefficient group parameter includes: using the first coefficient group parameter to set the size of the coefficient group.
  • determining the size of the coefficient group according to the first coefficient group parameter includes: the first coefficient group parameter indicates an adjacent decoded block of the decoded block, and using the adjacent decoded block The size of the coefficient group sets the size of the coefficient group.
  • determining the size of the coefficient group according to the first coefficient group parameter includes: determining, according to the first coefficient group parameter, a coefficient group of a transform coefficient of the decoding block from candidate values of the coefficient group size. the size of.
  • the first coefficient group parameter includes an index number
  • the size of the coefficient group is set using the size of the coefficient group corresponding to the index number in the candidate value.
  • the first coefficient group parameter includes a flag bit
  • the size of the coefficient group is set using the size of the coefficient group corresponding to the flag bit in the candidate value.
  • the candidate value of the size of the coefficient group is one or more fixed values.
  • the first coefficient group parameter includes an identification parameter, and the identification parameter is used to configure a candidate value for the size of the coefficient group.
  • the identification parameter includes at least one of the following: the size of the coefficient group, the side length of the coefficient group, and the width and height of the coefficient group.
  • using one or more of the following methods to use the identification parameter to configure a candidate value for the size of the coefficient group includes: obtaining a maximum value and a minimum value of the identification parameter, and determining according to a preset division manner A value of the identification parameter other than the maximum value and the minimum value, using the value of the identification parameter to set the candidate value; obtaining a maximum value of the identification parameter and a maximum division level of the coefficient group, Determine a value other than the maximum value of the identification parameter according to the preset division method, and use the value of the identification parameter to set the candidate value; obtain the maximum value of the identification parameter and the coefficient group A difference between a maximum value and a minimum value of the size, determining a value other than the maximum value of the identification parameter according to the preset division manner, and setting the candidate value using the value of the identification parameter; obtaining The minimum value of the identification parameter and the maximum division level of the coefficient group are determined according to the preset division manner, and values other than the minimum value of the identification parameter are used, and the identification parameter is used.
  • the preset division manner includes at least one of the following: quarter division division, three division division division, and bisection division division.
  • using the identification parameter to configure a candidate value for the size of the coefficient group includes using the default value of the identification parameter to set the candidate value.
  • using the identification parameter to configure a candidate value for the size of the coefficient group includes: the identification parameter is one or more flag bits indicating whether the size of the corresponding coefficient group is included in the candidate value, Setting a size of a coefficient group included in the candidate value according to the identification parameter.
  • using the identification parameter to configure a candidate value for the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to a preset Profile / Tier / Level, and according to the identification The parameter sets a size of a coefficient group included in the candidate value.
  • determining the size of the coefficient group according to the first coefficient group parameter includes: the first parameter group parameter includes a first decoding parameter of the decoding block, and according to the first decoding of the decoding block Parameter, setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter, wherein the first decoding parameter includes at least one of the following: the size of a transform block included in the decoding block , A prediction mode of the decoded block, a transform type used by a transform block included in the decoded block, and a quantization parameter.
  • the setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter includes: when a size of a transform block included in the decoding block is equal to a first preset value, Setting the size of the coefficient group to the size of the coefficient group corresponding to the first preset value.
  • a size of a coefficient group corresponding to the first preset value is obtained according to the parameters of the first parameter group.
  • setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter includes: when the prediction mode of the decoded block is equal to the first preset mode, setting the coefficient The size of the group is set to the size of the coefficient group corresponding to the first preset mode.
  • a size of a coefficient group corresponding to the first preset mode is obtained according to the parameters of the first parameter group.
  • setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter includes: when a transformation type used by a transformation block included in the decoding block is equal to a first transformation type , Setting the size of the coefficient group to the size of the coefficient group corresponding to the first transformation type.
  • a size of a coefficient group corresponding to the first transformation type is obtained according to the parameters of the first parameter group.
  • setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter includes: when the value of the quantization parameter is equal to a second preset value, setting the coefficient The size of the group is set to the size of the coefficient group corresponding to the second preset value; or, when the value of the quantization parameter is within the first preset value range, the size of the coefficient group is set to the The size of the coefficient group corresponding to the first preset value range is described.
  • a size of a coefficient group corresponding to the second preset value is obtained according to the parameters of the first parameter group.
  • a size of a coefficient group corresponding to the first preset value range is obtained according to the parameters of the first parameter group.
  • the parsing the code stream and determining a scan mode of the transform coefficient includes: analyzing a data unit in the code stream to obtain a first scan mode parameter, and determining the first scan mode parameter according to the first scan mode parameter.
  • a data unit in the code stream includes at least one of the following: one or more parameter sets , Slice header, block-level data unit.
  • parsing a data unit in the code stream to obtain a first scanning mode parameter, and determining a scanning mode of the transform coefficient according to the first scanning mode parameter includes using a scan indicated by the first scanning mode parameter.
  • the mode is the scanning mode of the transform coefficient.
  • using the scanning mode indicated by the first scanning mode parameter as the scanning mode of the transform coefficient includes: the first scanning mode parameter indicates an adjacent decoded block of the decoding block, and using the The scanning mode of adjacent decoded blocks sets the scanning mode of the transform coefficients.
  • using the scanning mode indicated by the first scanning mode parameter as the scanning mode of the transform coefficient further includes: determining a scanning mode of the transform coefficient from the candidate scanning modes according to the first scanning mode parameter.
  • the first scan mode parameter includes a scan mode index number, and the scan mode corresponding to the scan mode corresponding to the candidate scan mode is set using the scan mode index number.
  • the method further includes: the first scanning mode parameter includes a scanning mode indication flag, and the scanning mode of the transform coefficient is set using the scanning mode corresponding to the scanning mode indication flag in the candidate scanning mode.
  • the candidate scanning mode includes at least one of: one or more fixed scanning modes; and using the first scanning mode parameter to configure the candidate scanning mode.
  • using the first scan mode parameter to configure the candidate scan mode includes: the first scan mode parameter includes a default scan mode, and using the default scan mode to set the candidate scan mode.
  • using the first scanning mode parameter to configure the candidate scanning mode includes: the first candidate scanning mode parameter includes one or more candidate scanning mode indication flags, and using the candidate scanning mode indication flag The corresponding scanning mode sets the candidate scanning mode.
  • using the first scanning mode parameter to configure the candidate scanning mode includes: using the first scanning mode parameter to instruct one or more scanning modes corresponding to a preset Profile / Tier / Level to set the candidate scanning method.
  • using the first scanning mode parameter to configure the candidate scanning mode includes using a correspondence relationship between a position of the transform coefficient indicated by the first scanning mode parameter and a position of the scanned transform coefficient. Setting the candidate scan mode.
  • the data unit in the code stream is parsed to obtain a first scanning mode parameter, and the scanning mode of the transform coefficient is determined according to the first scanning mode parameter; including: the first scanning mode parameter includes the decoding A second decoding parameter of the block; determining a scanning method of the transform coefficient according to the second decoding parameter, wherein the second decoding parameter includes at least one of the following: a size of a transform block included in the decoded block, A prediction mode of the decoded block, a transform type used by a transform block included in the decoded block, and a size of the decoded block.
  • setting the scanning mode of the transform coefficient to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter includes: when a size of a transform block included in the decoding block is equal to a third When the preset value is set, the scan mode of the transform coefficient is set to the scan mode corresponding to the third preset value.
  • a scanning mode corresponding to the third preset value is obtained according to the parameters of the first parameter group.
  • setting the scanning mode of the transform coefficient to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter includes: when a prediction mode of the decoded block is equal to a second preset mode , Setting the scanning mode of the transform coefficient to the scanning mode corresponding to the second preset mode.
  • a scanning mode corresponding to the second preset mode is obtained.
  • setting a scanning mode of the transform coefficient to a scanning mode corresponding to the second decoding parameter includes: when a transform type used by a transform block included in the decode block is equal to In the second transformation type, the scanning mode of the transformation coefficient is set to the scanning mode corresponding to the second transformation type.
  • a scanning manner corresponding to the second transformation type is obtained.
  • setting the scanning mode of the transform coefficient to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter includes: when the size of the decoding block is equal to a fourth preset value, The scanning mode of the transform coefficient is set to the scanning mode corresponding to the fourth preset value.
  • a scanning manner corresponding to a fourth preset value is obtained according to the parameters of the first parameter group.
  • the code stream is parsed to determine a value of a syntax element related to a transform coefficient, including: the syntax element includes at least one of the following: a syntax element indicating a start position of a non-zero coefficient; and an indication that the coefficient group includes a non- Syntax elements of 0 coefficients; syntax elements indicating non-zero coefficient positions in the coefficient group; syntax elements indicating values of non-zero coefficients in the coefficient group.
  • the processing the transformation coefficients to obtain a restored value of the transformation coefficients includes: when determining that the transformation coefficients are subjected to scaling scaling processing, performing scaling processing on the transformation data to obtain the transformation coefficients. When it is judged that the transformation data is not subjected to scaling processing, the transformation coefficient is used to set the restoration value of the transformation coefficient.
  • the method before processing the transform coefficients, further includes: parsing the code stream to obtain a third parameter for constructing a recovered value of the predicted difference of the decoded block; according to the The third parameter is to determine whether to perform scaling processing on the transformation coefficient.
  • the method further includes: performing a loop filtering process on the sum of the predicted value and the predicted difference value.
  • an image encoding device including: a first determining module, configured to determine a prediction value of a coding block, and calculating a prediction difference value between the coding block and the prediction value; transform A module configured to perform one or more transformations on the predicted difference to obtain transformation data, and use the transformation data to determine transformation coefficients; a second determination module is used to determine a scanning mode of the transformation coefficients and a coefficient group Size, divide the transform coefficient into one or more coefficient groups, scan the transform coefficients contained in each of the coefficient groups according to the scanning method, and convert the transform coefficients into one or more syntax elements; an encoding module For encoding the size of the coefficient group and the value of the syntax element, and writing the encoded bits into a code stream.
  • an image decoding device including: a decoding module configured to analyze a code stream, determine a prediction value of the decoded block, and scan a transform coefficient in the decoded block. The value of the size of the coefficient group and the value of the syntax element related to the transform coefficient; a conversion module, configured to process the coefficient group in the decoded block according to the scanning mode and the size of the coefficient group, and convert the syntax Elements are transformed into transformation coefficients in the coefficient group; a processing module is configured to process the transformation coefficients to obtain a restored value of the transformation coefficients; a transformation module is configured to process the transformation coefficients, and The data is transformed one or more times to obtain a predicted difference value of the decoded block; a calculation module is configured to use the predicted value and the predicted difference to determine a restored value of the decoded block.
  • an electronic device including: the above-mentioned encoding device, acquisition device, and storage device; wherein the acquisition device is configured to acquire an image corresponding to the encoding block, and The image is preprocessed and output; the storage device is configured to receive the output code stream, and store the code stream after performing system layer processing.
  • an electronic device including the decoding device, a receiving device, and a display device described above, wherein the receiving device is configured to receive a code stream; the display device is configured to: The restored image is displayed.
  • a storage medium is further provided.
  • the storage medium stores a computer program, and the computer program is configured to execute the steps in any one of the foregoing method embodiments when running.
  • FIG. 1 is a block diagram of a hardware structure of a mobile terminal according to an image encoding method according to an embodiment of the present invention
  • FIG. 2 is a flowchart of an image encoding method according to an embodiment of the present invention.
  • FIG. 3 is a data processing flowchart of a size of a coding coefficient group according to an embodiment of the present invention.
  • FIG. 4 is a data processing flowchart of encoding a scanning mode parameter according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of decoding an image according to an embodiment of the present invention.
  • FIG. 6 is a data processing flowchart of analyzing the size of a coefficient group according to an embodiment of the present invention.
  • FIG. 7 is a data processing flowchart for analyzing parameters of a scanning mode according to an embodiment of the present invention.
  • FIG. 8 is a structural block diagram of an image encoding device according to an embodiment of the present invention.
  • FIG. 9 is a structural block diagram of another image encoding device according to an embodiment of the present invention.
  • FIG. 10 is a structural block diagram of an image decoding device according to an embodiment of the present invention.
  • FIG. 11 is a structural block diagram of another image decoding device according to an embodiment of the present invention.
  • FIG. 12 is a diagram of an electronic device including an encoding device for the image shown above;
  • FIG. 13 is a diagram of an electronic device including a decoding device for the image shown above;
  • FIG. 14 is an electronic system including the electronic device shown above.
  • a video refers to an image sequence composed of images.
  • the bitstream refers to a bitstream generated by a video encoder encoding a video, and also refers to a bitstream generated by the video encoder that encodes a video generated by the video encoder after being processed by a system layer.
  • the video stream by decoding the bitstream and / or media file.
  • the system layer processing is an encapsulation operation performed on a video code stream, for example, encapsulating the video code stream as a data payload into a transport stream, or encapsulating the video code stream as a payload into a media file.
  • the system layer processing also includes packaging a transport stream or media file containing a video code stream as a data payload into a stream for transmission or a file for storage.
  • the data unit generated by the system layer processing is also referred to as a system layer data unit.
  • Information added to the system layer data unit (such as the header information of the system layer data unit) during the system layer processing of the encapsulated data payload is also provided. This is called system-level information.
  • the sub-stream refers to a part of the stream obtained by performing an extraction operation from the stream, and decoding the sub-stream can obtain a video image.
  • the video image can be a video image that is better than a video image obtained by decoding the stream.
  • An image with a low resolution may also be an image with a lower frame rate than a video obtained by decoding the code stream, and the video image may include a part of the video image obtained by decoding the code stream.
  • FIG. 1 is a block diagram of a hardware structure of a mobile terminal according to an image encoding method according to an embodiment of the present invention.
  • the mobile terminal 10 may include one or more (only one shown in FIG. 1) a processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA) ) And a memory 104 for storing data.
  • the above-mentioned mobile terminal may further include a transmission device 106 and an input-output device 108 for communication functions.
  • FIG. 1 is only an illustration, and does not limit the structure of the mobile terminal.
  • the mobile terminal 10 may further include more or fewer components than those shown in FIG. 1, or have a different configuration from that shown in FIG. 1.
  • the memory 104 may be used to store a computer program, for example, a software program and module of application software, such as a computer program corresponding to an image encoding method in the embodiment of the present invention.
  • the processor 102 runs the computer program stored in the memory 104 In order to execute various functional applications and data processing, the method described above is implemented.
  • the memory 104 may include a high-speed random access memory, and may further include a non-volatile memory, such as one or more magnetic storage devices, a flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include memories remotely disposed with respect to the processor 102, and these remote memories may be connected to the mobile terminal 10 through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • the transmission device 106 is used for receiving or transmitting data via a network.
  • a specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal 10.
  • the transmission device 106 includes a network adapter (Network Interface Controller, NIC for short), which can be connected to other network equipment through a base station so as to communicate with the Internet.
  • the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.
  • RF radio frequency
  • FIG. 2 is a flowchart of an image encoding method according to an embodiment of the present invention. As shown in FIG. 2, the process includes the following: step:
  • Step S202 Determine a prediction value of the encoding block, and calculate a prediction difference between the encoding block and the prediction value;
  • Step S204 Perform one or more transformations on the predicted difference to obtain transformation data, and use the transformation data to determine transformation coefficients;
  • Step S206 Determine the scanning mode and the size of the coefficient group of the transformation coefficients, divide the transformation coefficients into one or more coefficient groups, and scan the transformation coefficients included in each of the coefficient groups according to the scanning mode, and The transform coefficient is converted into one or more syntax elements;
  • Step S208 encode the size of the coefficient group and the value of the syntax element, and write the encoded bits into the code stream.
  • determining the prediction value of the encoding block includes at least one of the following methods: using one or more encoded images as a reference image to determine the prediction value of the encoding block; or determining the prediction value of the encoding block; The encoded part in the image is used as a reference to determine the prediction value of the encoded block.
  • using the transformation data to determine a transformation coefficient includes: when it is judged that the transformation data is quantized, performing quantization processing on the transformation data to obtain the transformation coefficient; when it is judged that the transformation data is not quantized , The transformation coefficient is set using the transformation data.
  • determining the size of the coefficient group of the transformation coefficient includes: determining the size of the coefficient group of the transformation coefficient according to a preset candidate value.
  • determining the size of the coefficient group of the transformation coefficient according to the preset candidate value includes using a method of rate-distortion optimization to determine the size of the coefficient group of the transformation coefficient from the candidate value.
  • the number of encoding bits of the transform coefficient is calculated when the value in the candidate value is used as the size of the coefficient group, and the value in the candidate value that can minimize the number of encoding bits is selected as the transform coefficient.
  • the size of the coefficient group is calculated when the value in the candidate value is used as the size of the coefficient group, and the value in the candidate value that can minimize the number of encoding bits is selected as the transform coefficient.
  • determining the size of the coefficient group of the transformation coefficient according to the preset candidate value includes: determining the size of the coefficient group of the transformation coefficient according to the distribution of the transformation coefficient.
  • the distribution of the transform coefficients is detected by scanning the transform coefficients, and detecting the concentration of non-zero coefficients in the transform coefficients, where the concentration of the non-zero coefficients refers to the transform coefficients
  • concentration of the non-zero coefficients refers to the transform coefficients
  • the number of zero-valued coefficients between the non-zero coefficients the smaller the number of the zero-valued coefficients is, the higher the degree of concentration of the non-zero coefficients; selecting from the candidate values the candidate value that makes the degree of concentration the highest The value in is used as the size of the coefficient group of the transformation coefficient.
  • the candidate value includes at least one: one or more fixed values; one or more configured values; and a value of a size of a coefficient group used by the coded block adjacent to the coded block.
  • the method further includes: writing the candidate value identification parameter into one or more of the code stream.
  • the identification parameter is used to indicate the candidate value of the configuration;
  • the data unit in the code stream includes at least one of the following: one or more parameter sets, a slice header, and a block layer Data unit.
  • the preset candidate identification parameter of the size of the coefficient group includes at least one of the following: the size of the coefficient group, the side length of the coefficient group, and the width and height of the coefficient group.
  • writing the identification parameter into the code stream using one or more of the following methods includes: writing the maximum value and the minimum value of the identification parameter into the code stream; and writing the identification parameter Write the maximum value of the coefficient group and the maximum division level of the coefficient group into the code stream; write the difference between the maximum value of the identification parameter and the maximum and minimum values of the size of the coefficient group into the code Write the minimum value of the identification parameter and the maximum upward division level of the coefficient group into the code stream; between the minimum value of the identification parameter and the maximum and minimum values of the size of the coefficient group Is written into the code stream.
  • writing the identification parameter into the code stream using one or more of the following methods further includes: writing a default value of the identification parameter into the code stream.
  • the identification parameter of a preset candidate value of the size of the coefficient group includes: the identification parameter is one or more flags indicating whether the size of the corresponding coefficient group is included in the candidate value Coefficient group size.
  • the identification parameter of the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to the preset one or more prediction modes.
  • the identification parameter of the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to one or more preset transformations.
  • the identification parameter of the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to the preset one or more transformation types.
  • the identification parameter of the preset candidate value of the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to the preset one or more quantization parameters; or The identification parameter indicates a size of one or more coefficient groups corresponding to a preset value range of one or more quantization parameters.
  • the identification parameter of the preset candidate value of the size of the coefficient group includes: the identification parameter indicates a size of one or more coefficient groups corresponding to a preset profile / level / level Profile / Tier / Level .
  • determining the size of the coefficient group of the transform coefficient includes: setting the size of the coefficient group of the transform coefficient in the encoding block to the first encoding parameter according to the first encoding parameter of the encoding block.
  • the transform type and quantization parameter used by the included transform block is not limited to be the transform block.
  • setting the size of the coefficient group of the transform coefficient in the encoding block to the size of the coefficient group corresponding to the first encoding parameter includes: when the When the size of the transform block included in the coding block is equal to the first preset value, the size of the coefficient group is set to the size of the coefficient group corresponding to the first preset value.
  • setting the size of the coefficient group of the transform coefficient in the encoding block to the size of the coefficient group corresponding to the first encoding parameter includes: when the When the prediction mode of the coding block is equal to the first preset mode, the size of the coefficient group is set to the size of the coefficient group corresponding to the first preset mode.
  • setting the size of the coefficient group of the transform coefficient in the encoding block to the size of the coefficient group corresponding to the first encoding parameter includes: when the When the transformation type used by the transformation block included in the encoding block is equal to the first transformation type, the size of the coefficient group is set to the size of the coefficient group corresponding to the first transformation type.
  • setting the size of the coefficient group of the transform coefficient in the encoding block to the size of the coefficient group corresponding to the first encoding parameter includes: when the When the value of the quantization parameter is equal to the second preset value, the size of the coefficient group is set to the size of the coefficient group corresponding to the second preset value; or, when the value of the quantization parameter is in the first preset value, When the value range is set, the size of the coefficient group is set to the size of the coefficient group corresponding to the first preset value range.
  • the scanning method for determining the transformation coefficient includes: determining a scanning method for the transformation coefficient according to a preset candidate scanning method, wherein the scanning method is performed on a two-dimensional matrix of the transformation coefficients. The processing order of the elements.
  • determining a scan mode for the transform coefficient according to a preset candidate scan mode includes: using a method of rate-distortion optimization to determine a scan mode of the transform coefficient from the candidate scan modes.
  • the number of encoding bits of the transform coefficient is calculated when the scan mode in the candidate scan mode is used, and the scan mode in the candidate scan mode that minimizes the number of encoding bits is selected as the transform coefficient. scanning method.
  • determining a scan mode for the transform coefficient according to a preset candidate scan mode includes: determining a scan mode of the transform coefficient according to a distribution situation of the transform coefficient.
  • the distribution of the transform coefficients is detected by scanning the transform coefficients, and detecting the concentration of non-zero coefficients in the transform coefficients, where the concentration of the non-zero coefficients refers to the transform coefficients
  • concentration of the non-zero coefficients refers to the transform coefficients
  • the number of zero-valued coefficients between the non-zero coefficients, the smaller the number of zero-valued coefficients, the higher the degree of concentration of the non-zero coefficients selecting from the candidate scanning methods the candidate that can make the degree of concentration the highest
  • the scanning method among the values is used as the scanning method of the transform coefficient.
  • the candidate scanning modes include at least one of: one or more fixed scanning modes; one or more scanning modes configured; and a scanning mode used by the coded block adjacent to the coded block.
  • the method further includes: writing the parameter of the candidate scan mode into one or more data units of the code stream,
  • the candidate scanning mode parameter is used to indicate the configured candidate scanning mode.
  • the data unit in the code stream includes at least one of the following: one or more parameter sets, a slice header, and a block-level data unit.
  • the candidate scanning mode parameters further include: a processing order of elements in the two-dimensional matrix of the transformation coefficients.
  • the candidate scanning mode parameters further include a default value of the scanning mode parameters.
  • the candidate scanning mode parameter includes: the candidate scanning mode parameter is one or more flags indicating whether a corresponding scanning mode is included in the candidate scanning mode.
  • the candidate scanning mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to a preset one or more prediction modes.
  • the candidate scanning mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to one or more preset transformations.
  • the candidate scanning mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to a preset one or more transformation types.
  • the candidate scanning mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to the preset one or more quantization parameters; or the candidate scanning mode parameter indicates a preset One or more scanning modes corresponding to one or more quantization parameter value ranges.
  • the candidate scanning mode parameter includes: the candidate scanning mode parameter indicates one or more scanning modes corresponding to a preset Profile / Tier / Level.
  • the determining the scanning mode of the transform coefficient includes: setting the scanning mode of the transform coefficient in the coding block to correspond to the second coding parameter according to the second coding parameter of the transform block.
  • the type of transformation used by the block and the size of the coding block; the scanning method is the processing order of the elements in the two-dimensional matrix of the transformation coefficients.
  • setting the scanning mode of the transform coefficients in the encoding block to the scanning mode of the coefficient group corresponding to the second encoding parameter includes: when the encoding When the size of the transform block included in the block is equal to the third preset value, the scan mode of the transform coefficient is set to the scan mode corresponding to the third preset value.
  • setting the scanning mode of the transform coefficients in the encoding block to the scanning mode of the coefficient group corresponding to the second encoding parameter includes: when the encoding When the prediction mode of the block is equal to the second preset mode, the scanning mode of the transform coefficient is set to the scanning mode corresponding to the second preset mode.
  • setting the scanning mode of the transform coefficients in the encoding block to the scanning mode of the coefficient group corresponding to the second encoding parameter includes: when the encoding When the transformation type used by the transformation block included in the block is equal to the second transformation type, the scanning mode of the transformation coefficient is set to the scanning mode corresponding to the second transformation type.
  • setting the scanning mode of the transform coefficients in the encoding block to the scanning mode of the coefficient group corresponding to the second encoding parameter includes: when the encoding When the block size is equal to the fourth preset value, the scan mode of the transform coefficient is set to the scan mode corresponding to the fourth preset value.
  • determining the scanning mode and the size of the coefficient group of the transformation coefficient includes using a method of rate-distortion optimization to jointly determine the size and scanning mode of the coefficient group of the transformation coefficient.
  • the transforming the transform coefficient into one or more syntax elements includes: dividing the transform coefficient into one or more coefficient groups according to the size and scanning mode of the coefficient group, and according to the The scanning mode scans the transformation coefficients contained in the coefficient group, and represents the transformation coefficients as at least one of the following syntax elements: a syntax element indicating a starting position of a non-zero coefficient; and a syntax element indicating a non-zero coefficient in the coefficient group ; A syntax element indicating a non-zero coefficient position in the coefficient group; a syntax element indicating a non-zero coefficient value in the coefficient group.
  • the encoding the size of the coefficient group and the value of the syntax element and writing the encoded bits into a code stream includes: using the size of the coefficient group used by the transformation coefficient to use one of the following The method performs encoding: encoding the size of the coefficient group; encoding the value of the index number corresponding to the size of the coefficient group; setting a flag bit corresponding to the size of the coefficient group, and encoding the value of the flag bit.
  • encoding the size of the coefficient group and the value of the syntax element and writing the encoded bits into a code stream includes: writing the encoded bits into a data unit in the code stream, the code stream
  • the data unit in contains at least one of the following: one or more parameter sets, a slice header, and a block-level data unit.
  • the image may be divided into a plurality of maximum coding units.
  • the largest coding unit is a square image area.
  • An image may be divided into one or more slices, and each slice may include an integer maximum coding unit or a non-integer maximum coding unit.
  • the image may also be divided into one or more tiles, and each tile may include an integer number of maximum coding units or a non-integer number of maximum coding units.
  • the dividing unit 201 may be configured to divide the image in a fixed manner, or may be configured to dynamically adjust the division manner of the image. For example, in order to fit the maximum transmission unit (MTU) of the network, a dynamic segmentation method is used to ensure that the number of encoded bits per segment does not exceed the MTU limit.
  • MTU maximum transmission unit
  • the maximum coding unit is divided into one or more coding blocks, and the divided coding blocks may be further divided into more coding blocks.
  • the division method may use one or more of quad-tree division, binary-tree division, and tri-tree division.
  • a commonly used rate-distortion optimization (RDO) method is used to determine a prediction value of a coding block and output parameters related to inter prediction and intra prediction used to obtain the prediction value.
  • RDO rate-distortion optimization
  • an inter prediction value of a coded block is determined.
  • the reference image is used to construct one or more reference image lists (Reference List).
  • Each reference image list includes one or more reference images, and a matching block of a coding block in the reference image is determined.
  • a prediction value of a coding block is constructed using the matching block, and a difference (ie, a prediction difference) between the coding block and the prediction value is calculated.
  • Output parameters used to indicate the position of the matching block including the reference image list indication, reference image index (Motion Vector, MV), etc., where the reference image list indication is used to indicate where the reference image containing the matching block is located Reference image list, the reference image index is used to indicate that the reference image list contains the reference image of the matching block, and the MV is used to indicate the relative position offset between the encoding block and the matching block in the same image pixel coordinate system.
  • reference image list indication is used to indicate where the reference image containing the matching block is located Reference image list
  • the reference image index is used to indicate that the reference image list contains the reference image of the matching block
  • the MV is used to indicate the relative position offset between the encoding block and the matching block in the same image pixel coordinate system.
  • the predicted value of the coding block is calculated by using the adjacent restored pixels of the coding block as the input value of the filter.
  • the filter may be an interpolation filter or a low-pass filter (E.g. filters for calculating DC values).
  • a matching block of the coding block is searched in a part of the image where the coding block is located, and the matching block is used as a prediction value of the coding block.
  • the method of optimizing the RDO using rate distortion determines a method (ie, an intra prediction mode) and a predicted value for calculating a prediction value of the coded block.
  • the output parameters in the above process include parameters for indicating an intra prediction mode.
  • the prediction difference may be expressed as a two-dimensional matrix of N ⁇ M, where N and M are both positive integers, and N and M may be equal or unequal
  • a transformation method may be represented by a transformation matrix.
  • a rectangular block having the same size and shape as the encoding block here, a square is a special case of a rectangle
  • the prediction difference may be divided into multiple rectangular blocks (including height or width) Is a case of one pixel) and the rectangular blocks are sequentially transformed in turn.
  • the data is quantized by using a scalar quantizer, and a quantization parameter (Quantization Parameter) (QP) of the quantizer is determined by the control unit.
  • QP quantization Parameter
  • the control unit may use an existing bit rate control method to determine the quantization step size of the quantizer, and determine the QP according to the correspondence between the quantization step size and the QP.
  • the output of the quantization process is the quantized value of the coefficient (that is, the "Level" value), which can usually be represented by a two-dimensional matrix.
  • the same QP as in the quantization process may also be used to perform a scaling operation on the quantized value of the coefficient to obtain a restored value of the coefficient.
  • the data obtained by transforming the prediction difference is directly inversely transformed.
  • the restored value of the coefficient is processed by inverse transformation to obtain a restored value of the prediction difference.
  • this embodiment further includes filtering performed by a filter formed by cascading two filters, namely, deblocking filtering and sample value adaptive additive offset compensation filter (Sample Adaptive Offset (SAO)).
  • the filter may include a neural network filter.
  • the operation of filtering the data in the image buffer may be performed at the image layer, that is, after the restoration values of all the encoded blocks in the image are written to the image buffer, the The data is filtered.
  • the operation of filtering the data in the image buffer may be performed at the block layer, that is, when the recovered data of a coding block is no longer used as reference data for subsequent coding blocks, Restore the data for filtering.
  • the RDO method is used to determine the filter parameters as the output parameters of the filtering process.
  • the filter parameters include indication information of a used filter, filter coefficients, and control parameters of the filter.
  • the coded data of the image is binarized and entropy coded, and the parameters are converted into a field consisting of one or more "0" and "1" bits in accordance with the standard, and according to the code stream syntax structure in the standard ( Syntax Structure) organizes fields into code streams.
  • the encoded data includes texture data and non-texture data of an image.
  • the texture data is mainly the transform coefficients of the coded block;
  • the non-texture data includes all data except the texture data, including the output parameters in the foregoing various processing processes, and parameters such as parameter sets, header information, and auxiliary information.
  • the processed texture data is a transformation coefficient expressed in the form of a two-dimensional matrix of M ⁇ N, where M and N are positive integers, M and N may be equal, and M and N may not be equal.
  • the two-dimensional matrix may correspond to one transform block.
  • a “transform block” is used to refer to the transform coefficients expressed in the form of a two-dimensional matrix.
  • the transform coefficient is a quantized value (that is, a “Level” value) of the coefficient output during the quantization process; otherwise, when the quantization is not used for the coding block.
  • the transform coefficient is data obtained by transforming the prediction difference output during a transform.
  • the size of the coefficient group can be determined.
  • the coefficient group includes W ⁇ H transform coefficients, where W and H are positive integers, W and H may be equal, W and H may not be equal, and W ⁇ M and H ⁇ N.
  • the size of the coefficient group used is determined from the preset candidate values for the transform block.
  • the preset candidate value can be a fixed value or a configurable value.
  • identification information related to the size of the coefficient group may be encoded in one or more of the following data units and written into the code stream, where the identification information is used to indicate
  • the set usable size of the coefficient group includes: one or more Parameter Sets, Slice Headers, and Coding Units.
  • the size of the coefficient group of the transform block may be determined using an implicit derivation.
  • the size of the preset corresponding coefficient group may be selected according to one or more coding parameters such as a coding mode, a transform block size, a quantization parameter, and a transform type used by the transform block of the coding block where the transform block is located.
  • the size is set to use 4x4 and 8x8 coefficient groups.
  • the method can be extended to the case where the size of more coefficient groups is used.
  • the size of the coefficient group can be determined using one of the methods described below or a combination of methods.
  • the size of the coefficient group can be set according to the height and width of the transform block. For example, when the smaller value of the height and width of the transform block is greater than 16, the height and width are used. The smaller value of is equal to a rectangular coefficient group of 8, and the smaller value of height and width is used.
  • the size of the coefficient group corresponding to the transform block in the coding block of the inter prediction mode is set to 8x8 (the size of the coefficient group used by the 8x8 and 4x4 transform blocks is set to 4x4)
  • the intra prediction mode is set to
  • the size of the coefficient group corresponding to the transform block in the coding block is 8x8 (the size of the coefficient group used by the transform block of 16x16, 8x8, and 4x4 is set to 4x4).
  • each coefficient group will have a corresponding flag bit to identify whether the transformation coefficients in the coefficient group are all 0 ( Or to identify whether the coefficient group contains non-zero transform coefficients). Therefore, when a larger coefficient group is used, it may contain all zero-value coefficients, which can be represented by using one of the flag bits. Compared with the case of using a smaller coefficient group, using a larger coefficient group when the quantization parameter is larger can effectively reduce the coding overhead of the flag bit.
  • the size of the coefficient group is set to 8x8 (the transformation of 8x8 and 4x4 is set)
  • the size of the coefficient group used by the block is 4x4); otherwise, the size of the coefficient group is set to 4x4.
  • the size of the coefficient group is set to 8x8 (the size of the coefficient group used by the 8x8 and 4x4 transform blocks is set to 4x4).
  • the size of the coefficient group is set to 4x4.
  • the size of the coefficient group is set to 8x8 (set the size of the coefficient group used by the transform block of 8x8 and 4x4 to be 4x4 ).
  • KLT Karhunen-Loève Transform
  • the scanning mode refers to a processing order of elements in a two-dimensional matrix of transform coefficients.
  • a one-dimensional M row and N column (or M row and N column and 1 column) can be equivalently obtained.
  • matrix You can preset one or more scan modes of the transform coefficient matrix, for example, Zig-zag scan order, Horizontal scan order, Vertical scan, Diagonal scan Sequence (such as Diagonal up-right scan sequence, etc.). Select the scan mode from the preset scan modes for the transform block. You can use the same set of coefficients in the transform block and the transform coefficients in the coefficient group.
  • the scanning method may also use different scanning methods for the coefficient groups in the transform block and the transform coefficients in the coefficient group.
  • an implicit derivation manner may be used to determine a scanning manner of the transform coefficient matrix of the transform block.
  • the preset corresponding scanning mode may be selected according to one or more coding parameters such as the coding mode and the coding size of the coding block where the transform block is located. For example, if the inter prediction mode is set to correspond to the diagonal upper-right scan method, the intra prediction mode when the size of the coded block is greater than 8x8 is used to correspond to the intra-frame when the coded block size is less than or equal to 8x8.
  • the prediction mode corresponds to a scanning method that uses an intra prediction direction to indicate the direction, and a mode that does not use directional prediction, such as a direct current (DC) mode and a planar mode, uses a diagonal upper right scanning method.
  • the intra prediction directions can be classified.
  • Each type corresponds to different scanning methods.
  • the vertical direction and the intra prediction directions offset by a specified angle from left to right in the vertical direction correspond to the vertical scanning method.
  • the horizontal scanning method and the intra prediction direction shifted up and down by a specified angle in the horizontal direction correspond to the horizontal scanning method, and may include a 45-degree angle and the intra prediction direction shifted up and down the designated angle in the angular direction using a diagonal scan method.
  • a scanning method is selected for the encoding block according to one or more encoding parameters such as the encoding mode and the encoding block size.
  • the scan mode of the transform block is determined according to the distribution of the transform coefficients in the transform block.
  • the distribution refers to scanning (or inverse scanning order) the transform coefficients in the transform block using a scanning method to detect the concentration of non-zero coefficients in the transform block.
  • the scan order or reverse scan order
  • a scan mode that can maximize the concentration of non-zero coefficients is selected from the candidate scan modes as the scan mode of the transform block.
  • an available candidate scanning method is sequentially adopted as the scan method of the transform block, the number of encoding bits of the transform coefficient in the transform block is calculated, and a selectable The candidate scanning mode that minimizes the number of encoding bits is used as the scanning mode of the transform block.
  • the available candidate scanning methods refer to the preset scanning methods that can be used to encode the transform block. For example, you can configure the encoding block for a specific prediction mode without using one or more specified scanning methods; for example, you can configure the size of one or more specific encoding blocks or transform blocks without using a specified one Or multiple scanning methods.
  • the information indicating the scanning mode used by the transform block is encoded in one or more of the following data units and written into the code stream, including: one or more parameter sets, a slice header, an encoding unit, and a transform block data unit.
  • an adaptive scanning manner may be determined for the transform block.
  • the various scanning methods used are processing the coefficient groups in the transform block and the transform coefficients in the coefficient group in a fixed order, and different scanning methods define different scanning orders.
  • the “adaptive scanning method” mentioned here refers to a flexible but not fixed processing order for the coefficient groups in the transform block, and a flexible but not fixed processing order for the transform coefficients in the coefficient group.
  • One implementation method is to construct a scanning method according to the distribution of the transform coefficients in the transform block, so that the non-zero coefficient concentration in the transform block is the highest. Generally, according to the scan order (or reverse scan order), the less the zero-valued coefficient is, the higher the concentration of the non-zero coefficient is considered.
  • Another implementation method is that when the size of the coefficient group in the transform block has been determined, constructing a scanning method can minimize the sum of the number of encoding bits of the transform coefficient in the transform block and the number of overhead bits encoding the scanning method. .
  • the scanning mode needs to be encoded.
  • One method is to encode a correspondence table between the positions of the transform coefficients in the transform block and the scanned positions. For example, the coordinate position in the transform block is equal to (m, n The scan coefficient corresponding to the transformation coefficient (or the index sequence number is equal to m ⁇ nTbS + n, where nTbS is the width of the transform block) is equal to k.
  • the equivalent information indicated by the correspondence table in the code stream is: the position coordinates in the transform block of the transform coefficient obtained by parsing the code stream with a position number equal to k are (m, n) (or an index number) (Equal to m ⁇ nTbS + n, where nTbS is the width of the transform block).
  • the information of the scanning mode used by the transform block is encoded in one or more of the following data units and written into the code stream, including: one or more parameter sets, slice headers, encoding units, and transform block data units.
  • the transform coefficients in the transform block are divided into one or more coefficient groups, and the elements in the transform coefficient matrix are processed according to the determined scanning mode.
  • the forward or reverse order of the scanning method is used to sequentially process the coefficient groups in the transform coefficient matrix.
  • the forward or reverse order of the scanning method is used to sequentially process the transform coefficients in the coefficient group.
  • the scanning order for the coefficient group and the scanning order for the transform coefficients in the coefficient group may be the same or different.
  • the bits generated by encoding the transform block are written into a code stream, and the bits represent one or more of the following information: the size of the coefficient group used by the transform block, the scanning method used by the transform block, and the transform coefficients in the transform block.
  • FIG. 3 is a data processing flowchart for encoding the size of a coefficient group according to an embodiment of the present invention.
  • the output of the processing flow is a code stream after encoding the size-related parameters of the coefficient group.
  • Step 301 Encode the size of a coefficient group in a parameter set data unit.
  • the setting parameters for the size of the coefficient group are encoded in the parameter set data unit.
  • the parameter set data unit refers to a parameter set data unit for carrying parameter data applicable to the entire sequence, for example, a video parameter set (VPS), a sequence parameter set in the H.265 / HEVC standard (Sequence Parameter Set, SPS).
  • the parameter set data unit may further include a parameter set data unit for carrying parameter data suitable for an image, for example, an adaptive parameter set (APS), an image parameter set in the H.265 / HEVC standard (Picture Parameter Set, PPS).
  • the APS or PPS in this case is equivalent A parameter set data unit carrying parameter data applicable to the entire sequence.
  • a method of setting or adopting a default setting may be used to cover the corresponding data in the parameter set data unit applicable to the sequence with the data in the parameter set data unit applicable to the image.
  • the values of the fields related to the size of the coefficient group in the parameter set data unit are set according to the configuration file, these fields are encoded, and the encoded bits are written into the code stream corresponding to the parameter set data unit.
  • the configuration file records parameter settings used in the initialization process.
  • the size of the coefficient group used to encode the transform coefficient of the coding block may be selected from the sizes of more than one candidate coefficient group.
  • the flag indicates "not allowed" only the size of the coefficient group set by default is used to encode the transform coefficients.
  • the default value of the size of the coefficient group can be encoded in the parameter set data unit.
  • the minimum transform block size is set to 8x8, according to the parameter setting in the configuration file, 4x4 or 8x8 is used as the default value of the size of the coefficient group to be encoded in the parameter set data unit.
  • one encoding method is that the encoding of the default value of the size of the coefficient group may not depend on any flag bit; optionally, another encoding method is that the foregoing flag bit indicates that "multiple types are not allowed In the case of "coefficient group size", the default value of the size of the coefficient group is encoded in the parameter set data unit.
  • the size of the allowed coefficient groups is encoded.
  • one encoding method is to encode the maximum and minimum allowable coefficient groups in the parameter set data unit.
  • the size of other allowable coefficient groups can be derived from the set maximum to minimum (For example, according to the quad tree method) to perform implicit derivation, for example, to set and encode the maximum and minimum allowable coefficient group sizes are 32x32 and 4x4, then according to the aforementioned quad tree method, the parameter set data unit field
  • the size of the allowable coefficient group indicated includes: 32x32, 16x16, 8x8, and 4x4.
  • the second encoding method is to encode the size of the maximum allowable coefficient group and the maximum division level according to the division method (such as the quad tree method) in the parameter set data unit.
  • the maximum allowable coefficient group The size is 32x32, and the maximum allowable division level is 3 layers, then the allowable coefficient group sizes indicated by the fields of the parameter set data unit include: 32x32, 16x16, 8x8, and 4x4.
  • the maximum The difference between the size of the minimum allowed coefficient group and the maximum allowed division level replaces the maximum division level.
  • the third encoding method is to encode the size of the minimum allowable coefficient group and the maximum upward level according to the division method (such as the quad tree method) in the parameter set data unit.
  • the allowable coefficient group size indicated by the field of the parameter set data unit includes: 32x32, 16x16, 8x8, and 4x4.
  • the maximum and minimum values can be used.
  • the difference between the sizes of the allowed coefficient groups is used instead of the maximum upward level.
  • an encoding method is to encode the maximum and minimum allowable coefficient group side lengths in the parameter set data unit.
  • the maximum side length can be set from the maximum to the The smallest derivation method (for example, according to the dichotomy) is used for implicit derivation. For example, if the maximum and minimum side lengths are set and encoded are 16 and 4, respectively, then the allowable coefficient group indicated by the field of the parameter set data unit is available.
  • the side length includes 16, 8 and 4, and the size of the corresponding coefficient group (in the form of "width x height") includes: 16x16, 16x8, 16x4, 8x16, 8x8, 8x4, 4x16, 4x8, and 4x4.
  • the second encoding method is to encode the side length of the maximum allowable coefficient group and the maximum division level according to the division method (such as the dichotomization method) in the parameter set data unit. For example, set and encode the side of the maximum allowable coefficient group.
  • the length is 16, the maximum division level is 2, then the available side length of the allowable coefficient group indicated by the field of the parameter set data unit includes 16, 8, and 4, and the size of the corresponding indicated coefficient group includes: 16x16, 16x8, 16x4, 8x16, 8x8, 8x4, 4x16, 4x8, and 4x4.
  • the maximum division level can be replaced with the difference between the maximum and minimum allowed coefficient group side lengths.
  • the third encoding method is to encode the side length of the minimum allowable coefficient group and the maximum upward level according to the division method (such as the dichotomization method) in the parameter set data unit. For example, set and encode the side of the minimum allowable coefficient group. The length is 4 and the maximum upward level is 2. Then the available side length of the allowable coefficient group indicated by the field of the parameter set data unit includes 16, 8, 4 and the size of the corresponding indicated coefficient group includes: 16x16, 16x8, 16x4, 8x16, 8x8, 8x4, 4x16, 4x8, and 4x4.
  • the maximum upward level can be replaced by the difference between the side lengths of the largest and smallest allowed coefficient groups.
  • the fourth encoding method is to set flag bits for the available side lengths in the parameter set data unit, and the flag bits are used to indicate whether the corresponding side lengths are allowed.
  • the available side lengths include 32, 16 , 8 and 4 and the allowed side lengths are 16, 8, and 4, set the flag bit corresponding to "side length 32" to "not allowed” in the parameter set data unit and encode, and set the "side length 16,
  • the 3 flag bits corresponding to “8 and 4” are set to “allow use” and encoded, then the available side length of the allowable coefficient group indicated by the field of the parameter set data unit includes 16, 8, 4, and the corresponding indicated coefficient Group sizes include: 16x16, 16x8, 16x4, 8x16, 8x8, 8x4, 4x16, 4x8, and 4x4.
  • an encoding method is to encode the maximum and minimum allowable values of the width and height of the coefficient group in the parameter set data unit.
  • the set width and The derivation method of the height from the largest to the smallest is used for implicit derivation.
  • the maximum and minimum allowable values for setting and encoding the width of the coefficient group are 16 and 4, respectively.
  • the maximum and minimum allowed values are 8 and 4, respectively.
  • the width of the allowable coefficient group indicated by the field of the parameter set data unit includes 16, 8 and 4, and the height of the indicated allowable coefficient group includes 8 And 4, the size of the indicated coefficient group (in the form of "width x height") includes: 16x8, 16x4, 8x8, 8x4, 4x8, and 4x4.
  • the second encoding method is to encode the width of the maximum allowable coefficient group and the maximum division level according to the division method (such as a binary method) in the parameter set data unit, and encode the height of the maximum allowable coefficient group and the division method ( For example, set the maximum allowable coefficient group width to 16 and the maximum division level to 2, and set the maximum allowable coefficient group height to 8 and the maximum division level to 1.
  • the width of the allowable coefficient group indicated by the field of the parameter set data unit includes 16, 8 and 4, and the height of the indicated allowable coefficient group includes 8 and 4, corresponding to the size of the indicated coefficient group (using the The form of "width x height" includes: 16x8, 16x4, 8x8, 8x4, 4x8, and 4x4.
  • the difference between the width of the maximum and minimum allowable coefficient groups can be used instead of the maximum division level.
  • the third encoding method is to encode the width of the smallest allowable coefficient group and the maximum upward level according to the division method (such as the dichotomization method) in the parameter set data unit, and encode the height of the smallest allowable coefficient group and the division method ( For example, set the maximum allowable coefficient group width to 4 and set the maximum allowable coefficient group to 2, and set the minimum allowable coefficient group to 4 and set the maximum allowable coefficient group to 1. , Then the width of the allowable coefficient group indicated by the field of the parameter set data unit includes 16, 8 and 4, and the height of the indicated allowable coefficient group includes 8 and 4, corresponding to the size of the indicated coefficient group (using the The form of "width x height" includes: 16x8, 16x4, 8x8, 8x4, 4x8, and 4x4.
  • the difference between the maximum and minimum allowable coefficient group widths can be used instead of the maximum upward level.
  • the fourth encoding method is to set flag bits for the available width and height respectively in the parameter set data unit, and the flag bits are used to indicate whether the corresponding width and height are allowed.
  • the flag bit corresponding to "width 32" is set to "not in the parameter set data unit" "Allow use” and encoding, set the 3 flags corresponding to "Width 16, 8 and 4" to “Allow use” and encoding, and set the 2 flags corresponding to "Height 32 and 16" to "Not allowed” And encode, set the two flag bits corresponding to "height 8 and 4" to "allowable” and encode, then the allowable coefficient group width indicated by the field of the parameter set data unit includes 16, 8 and 4,
  • the height of the indicated allowed coefficient group includes 8 and 4
  • the size of the corresponding indicated coefficient group (in the form of "width x height”) includes: 16x8, 16x4, 8x8, 8x4, 4x8, and 4x4.
  • an encoding method is to set flag bits for the size of the available coefficient groups in the parameter set data unit, and the flag bits are used to indicate whether the size of the corresponding parameter group is allowed to be used.
  • the parameter set data unit The flag bits corresponding to the sizes of the six kinds of coefficient groups are set to “allowed to use” and encoded, and the flag bits corresponding to the sizes of the other 16x16, 8x16, and 4x16 types of coefficient groups are set to “not allowed” and encoded.
  • the above-mentioned method may be used to set the size of the allowed coefficient group for coding blocks using different coding modes, respectively.
  • the allowed coefficient group size set for the intra mode encoding block is 8x8 and 4x4 and encoded
  • the allowed coefficient group size set for the inter mode encoding block is 16x16, 8x8, and 4x4 and encoded
  • the field size of the parameter set data unit indicates that the allowable coefficient groups for the transform block in the intra prediction mode coding block are 8x8 and 4x4, and the allowable coefficient groups for the transform block in the inter prediction mode coding block.
  • the sizes are 16x16, 8x8, and 4x4.
  • the above-mentioned method may be used to set the size of the allowable coefficient groups for the transform blocks using different transform times, respectively.
  • the allowable set of coefficients set for transform blocks using a single transform is 8x8 and 4x4 and encoded
  • the allowable set of coefficients set for transform blocks using multiple transforms is 16x16, 8x8, and 4x4 and encoded
  • the size of the allowable coefficient group indicated by the field of the parameter set data unit for the transform block using one transformation is 8x8 and 4x4
  • the allowable coefficient group size of the transform block using multiple transformations is 16x16, 8x8 And 4x4.
  • the above-mentioned method may be used to set the size of the allowable coefficient group for the transform blocks using different transform methods, respectively.
  • the allowable coefficient sets for transform blocks using transforms based on the DCT design are 8x8 and 4x4 in size and encoded
  • the allowable coefficient sets for transform blocks using transforms based on the DST are set
  • the size is 16x16, 8x8, and 4x4 and encoded
  • the allowed coefficient group size set for the transform block using the transform designed based on KLT is 32x32, 16x16, 8x8, and 4x4 and encoded.
  • the field of the parameter set data unit The indicated allowable coefficient groups for transform blocks using transforms based on the DCT design are 8x8 and 4x4, and the allowable coefficient groups for transform blocks using transforms based on the DST design are 16x16, 8x8 And 4x4, the allowable coefficient group sizes for transform blocks using transforms based on KLT are 32x32, 16x16, 8x8, and 4x4.
  • a control parameter for switching the size of the allowable coefficient group is set and encoded.
  • a quantization parameter is used as a control parameter for switching the size of an allowable coefficient group, for example, in the manner of quantization parameter definition in the H.265 / HEVC standard, when the quantization parameter is greater than or equal to 37, The size is 16x16, 8x8, and 4x4; when the quantization parameter value is less than 37 but greater than or equal to 27, the allowable coefficient group size is 8x8; when the quantization parameter value is less than 27, the allowable coefficient group size is 4x4,
  • the foregoing method is used to set the division interval of the quantization parameter in the parameter set data unit, and the size of the coefficient group allowed in each interval, and encode.
  • the size of the usable coefficient group is set in advance in Profile / Tier / Level. For different Profile / Tier / Level, one or more values can be used.
  • the size of the coefficient group For example, for lower levels (such as those corresponding to encoding 640x480 and below), use the size of the coefficient group with a default value equal to 4x4; for higher levels (such as those corresponding to encoding 720p, 1080p, 2K, etc.) Large-resolution video), 8x8, 4x4 coefficient group sizes can be used; for the highest level (for example, encoding 4K, 8K and other super-resolution videos), three coefficient groups of 16x16, 8x8, 4x4 can be used the size of.
  • the indication information of Profile / Tier / Level is encoded.
  • An optional code stream organization method using the above method is as follows, for the size of the allowed coding coefficient group.
  • the fields of the code stream organization method are located in one or more parameter set data units.
  • the fields included in the bitstream generated by the bitstream organization method are as follows:
  • log2_min_cg_side_length represents the minimum side length of the coefficient group.
  • the minimum side length of the coefficient group is equal to (1 ⁇ log2_min_cg_side_length).
  • " ⁇ " is an arithmetic right shift operator.
  • log2_min_cg_side_length uses ue (v) method for entropy coding.
  • log2_diff_max_cg_side_length represents the difference between the maximum side length and the minimum side length of the coefficient group.
  • the maximum side length of the coefficient group is equal to (1 ⁇ (log2_min_cg_side_length + log2_diff_max_cg_side_length)).
  • log2_diff_max_cg_side_length uses ue (v) method for entropy coding.
  • the parameter setting method in Table 1 is as follows. For example, when only the coefficient group with the default size of 4x4 is used in the configuration file, the value of log2_min_cg_side_length is set to 2, the log2_diff_max_cg_side_length is set to 0, the two fields are encoded using the ue (v) method, and the encoded bits are Write the code stream.
  • the available side lengths of the allowable coefficient groups indicated by the fields of the parameter set data unit include 16, 8, 4, and the sizes of the corresponding indicated coefficient groups include: 16x16, 16x8, 16x4, 8x16, 8x8, 8x4, 4x16, 4x8, and 4x4.
  • Another optional code stream organization method using the above method is as follows, which is used to encode the allowed coefficient group size of the transform block in the coding block using the inter mode and the intra mode.
  • the fields of the code stream organization method are located in one or more parameter set data units.
  • the fields included in the bitstream generated by the bitstream organization method are as follows:
  • log2_min_cg_side_length represents the minimum side length of the coefficient group.
  • the minimum side length of the coefficient group is equal to (1 ⁇ log2_min_cg_side_length).
  • " ⁇ " is an arithmetic right shift operator.
  • log2_min_cg_side_length uses ue (v) method for entropy coding.
  • log2_diff_max_inter_cg_side_length represents the difference between the maximum side length and the minimum side length of the coefficient group of the transform block in the coding block using the inter prediction mode.
  • the maximum side length of the coefficient group is equal to (1 ⁇ (log2_min_cg_side_length + log2_diff_max_cg_side_length)).
  • log2_diff_max_cg_side_length uses ue (v) method for entropy coding.
  • log2_diff_max_intra_cg_side_length represents the difference between the maximum side length and the minimum side length of the coefficient group of the transform block in the coding block using the intra prediction mode.
  • the maximum side length of the coefficient group is equal to (1 ⁇ (log2_min_cg_side_length + log2_diff_max_cg_side_length)).
  • log2_diff_max_cg_side_length uses ue (v) method for entropy coding.
  • the parameter setting method in Table 2 is as follows. For example, when only the coefficient group with the default size of 4x4 is used in the configuration file, set the value of log2_min_cg_side_length to 2 and set the values of log2_diff_max_inter_cg_side_length and log2_diff_max_intra_cg_side_length to 0. Use the method of ue (v) to set two Encode and write the encoded bits into the bitstream. In this case, the sizes of the coefficient groups used for the coding block of the inter prediction mode and the coding block of the intra prediction mode are both 4 ⁇ 4.
  • the method encodes three fields and writes the encoded bits into the code stream.
  • the available side lengths of the allowable coefficient groups indicated by the fields of the parameter set data unit include 16, 8, 4, and the sizes of the corresponding indicated coefficient groups include: 16x16, 16x8, 16x4, 8x16, 8x8, 8x4, 4x16, 4x8, and 4x4.
  • the same allowed set of coefficients is used for the transform block in the coding block of the inter prediction mode and the coding block of the intra prediction mode.
  • log2_min_cg_side_length is used when the minimum 4x4 coefficient group, the inter prediction mode coding block allows the maximum 16x16 coefficient group, and the intra prediction mode coding block allows the maximum 8x8 coefficient group.
  • the value of is set to 2
  • the value of log2_diff_max_inter_cg_side_length is set to 2
  • the value of log2_diff_max_intra_cg_side_length is set to 1
  • all three fields are encoded using the ue (v) method, and the encoded bits are written to the code stream.
  • the available side lengths of the allowable coefficient groups used by the coding block of the inter mode indicated by the field of the parameter set data unit include 16, 8 and 4, and the sizes of the corresponding indicated coefficient groups include: 16x16, 16x8, 16x4, 8x16, 8x8, 8x4, 4x16, 4x8, and 4x4, the coding block of the intra prediction mode indicated by the parameter set data unit field, the available side lengths of the allowed coefficient groups include 8 and 4, corresponding to the indicated coefficients Group sizes include: 8x8, 8x4, 4x8, and 4x4.
  • the coded blocks in the inter prediction mode and the coded blocks in the intra prediction mode use not exactly the same allowed coefficient groups.
  • Step S302 the size of the coding coefficient group in the slice header information data unit.
  • the setting parameter of the size of the coefficient group is encoded in the slice header information data unit.
  • a parameter set index (parameter set identifier) of a parameter set of the segment referrer is encoded in a segment header information data unit.
  • the size of the usable coefficient group set in the referenced parameter set may be used.
  • information on the size of a usable coefficient group may be encoded in the slice header information to correspondingly cover corresponding parameter settings in a parameter set referenced by the slice.
  • the encoding method used is the same as the method of encoding the size of the coefficient group in the parameter set except for the method of indicating the size of the coefficient group by encoding Profile / Tier / Level in step S301, but the encoding bit is written into the code of the fragment header information data unit flow.
  • the size of the usable coefficient group may be encoded in the slice header information.
  • the encoding method used is the same as the method of encoding the size of the coefficient group in the parameter set except for the method of indicating the size of the coefficient group by encoding Profile / Tier / Level in step S301, but the encoding bit is written into the code of the fragment header information data unit flow.
  • step S303 the size of the coefficient group is encoded in the block layer data unit.
  • the parameter of the size of the coefficient group is encoded in a block-level data unit.
  • a parameter indicating a size of a coefficient group used by a transform block in a coding block is coded.
  • one encoding method is to encode the size of the coefficient group, such as the width and height of the coefficient group, in the block-level data unit.
  • one encoding method is to encode an index value in a block-level data unit, where the index value corresponds to the size of a coefficient group.
  • one encoding method is to encode one or more flag information in a block layer data unit, where the flag information is used to indicate a size of a coefficient group used by a transform block in the coding block and the flag information indication.
  • the encoded one transform block is the same, and the encoded transform block may be an encoded transform block (such as the above adjacent block, left adjacent block, etc.) in the same image as the transform block, or may be The coded blocks (immediate-domain neighboring blocks) in which the transform block is not in the same image are described. For example, in the block layer data unit, the flag information “same as the coefficient group size of the upper neighboring transform block” is encoded.
  • FIG. 4 is a data processing flowchart of encoding a scanning mode parameter according to an embodiment of the present invention.
  • the output of the processing flow is a code stream after encoding the parameters related to the scanning mode.
  • Step S401 encoding a scanning mode parameter in a parameter set data unit.
  • the scanning mode parameters are encoded in the parameter set data unit.
  • the parameter set data unit encodes the indication of the allowed scanning method.
  • the scanning method may be a preset fixed path scanning method or a non-fixed path scanning method.
  • the coordinate correspondence relationship between the transform coefficients before and after scanning is encoded in the parameter set data unit. For example, the post-scanning serial number position corresponding to the transform coefficient (or the index number equal to m ⁇ nTbS + n, where nTbS is the width of the transform block) at the coordinate position in the transform block is equal to k.
  • the size of the usable coefficient group is set in advance in Profile / Tier / Level.
  • one or more scan modes are set. .
  • the default diagonal upper right, horizontal and vertical scanning methods are used; for higher levels (for example, encoding 720p, 1080p, 2K) (Such as larger resolution video), in addition to the three default scanning methods used for the lower level mentioned above, you can also use the Zig-zag scanning method, other diagonal scanning methods (such as diagonal lower right, diagonal lower left, etc.) );
  • a scanning method of a non-fixed scanning path may also be used.
  • the indication information of Profile / Tier / Level is encoded.
  • the coordinate correspondence relationship between the coding transformation coefficients before and after scanning For example, the post-scanning serial number position corresponding to the transform coefficient (or the index number equal to m ⁇ nTbS + n, where nTbS is the width of the transform block) at the coordinate position in the transform block is equal to k.
  • step S402 the scanning mode parameters are encoded in the slice header information data unit.
  • the scanning mode parameters are encoded in the slice header information data unit.
  • a parameter set index (parameter set identifier) of a parameter set of the segment referrer is encoded in a segment header information data unit.
  • a usable scanning method set in the referenced parameter set may be used.
  • the available scanning mode parameters may be encoded in the slice header information to correspond to corresponding parameter settings in the parameter set covering the slice reference.
  • the encoding method used is the same as the method for encoding the scanning mode parameters in the parameter set except for the method of indicating the scanning mode by encoding Profile / Tier / Level in step S401, but the encoding bits are written into the code stream of the fragment header information data unit.
  • the available scanning mode parameter may be encoded in the slice header information.
  • the encoding method used is the same as the method for encoding the scanning mode parameters in the parameter set except for the method that indicates the scanning mode by encoding Profile / Tier / Level in step S401, but the encoding bit is written into the code of the fragment header information data unit flow.
  • the coordinate corresponding relationship between the coding transformation coefficients before and after scanning is encoded in the slice header information data unit.
  • the post-scanning serial number position corresponding to the transform coefficient or the index number equal to m ⁇ nTbS + n, where nTbS is the width of the transform block) at the coordinate position in the transform block is equal to k.
  • Step S403 encode the scanning mode parameters in the block-level data unit.
  • the scanning mode parameters are encoded in block-level data units.
  • encoding is used to indicate a scanning mode parameter used by the transform block in the encoding block.
  • an encoding method is to encode an index value in a block-level data unit, where the index value corresponds to a scanning mode.
  • one encoding method is to encode the coordinate correspondence between the transform coefficients before and after scanning in a block-level data unit. For example, the post-scanning serial number position corresponding to the transform coefficient (or the index number equal to m ⁇ nTbS + n, where nTbS is the width of the transform block) at the coordinate position in the transform block is equal to k.
  • one encoding method is to encode one or more flag information in a block-level data unit, where the flag information is used to indicate a scanning method used by a transform block in the coding block and an already-existing scan indicated by the flag information.
  • An encoded transform block is the same, and the encoded transform block may be an encoded transform block (such as the neighboring block above, the left neighboring block, etc.) in the same image as the transform block, or may be the transform For coded blocks (immediate-domain neighboring blocks) in which the block is not in the same image, for example, in the block layer data unit, the flag information of “same as the scanning method of the upper neighboring transform block” is coded.
  • the method according to the above embodiments can be implemented by means of software plus a necessary universal hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present application can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, and optical disk), and includes several instructions for making a terminal
  • the device (which may be a mobile phone, a computer, a server, or a network device, etc.) executes the methods described in the embodiments of the present application.
  • FIG. 5 is a flowchart of decoding an image according to an embodiment of the present invention. As shown in FIG. 5, the process includes the following steps:
  • Step S502 Parse the bitstream to determine the predicted value of the decoded block.
  • Step S504 Parse the code stream to determine the scanning mode of the transform coefficients in the decoded block, the size of the coefficient group, and the values of the syntax elements related to the transform coefficients.
  • Step S506 Process the coefficient groups in the decoded block according to the scanning mode and the size of the coefficient groups, and convert the syntax elements into transform coefficients in the coefficient groups;
  • Step S508 processing the transformation coefficients to obtain a restored value of the transformation coefficients
  • Step S510 Perform one or more transformations on the restored value of the transform coefficients to obtain the predicted difference value of the decoded block;
  • Step S512 Use the predicted value and the predicted difference to determine a recovered value of the decoded block.
  • parsing the code stream and determining the predicted value of the decoded block includes at least one of the following methods: parsing the code stream to obtain inter prediction parameters of the decoded block; and according to the inter prediction A parameter that uses one or more decoded images as reference images to determine a prediction value of the decoded block. Or, parse the code stream to obtain the intra prediction parameters of the decoded block; and based on the intra prediction parameters, use the decoded part in the image where the decoded block is located as a reference to determine the prediction of the decoded block value.
  • parsing the code stream and determining a size of a coefficient group of a transform coefficient in the decoded block includes: parsing the code stream, obtaining a first coefficient group parameter from a data unit in the code stream, and The first coefficient group parameter determines the size of the coefficient group; wherein the data unit in the code stream includes at least one of the following: one or more parameter sets, a slice header, and a block-level data unit.
  • determining the size of the coefficient group according to the first coefficient group parameter includes: using the first coefficient group parameter to set the size of the coefficient group.
  • determining the size of the coefficient group according to the first coefficient group parameter includes: the first coefficient group parameter indicates an adjacent decoded block of the decoded block, and using the adjacent decoded block The size of the coefficient group sets the size of the coefficient group.
  • determining the size of the coefficient group according to the first coefficient group parameter includes: determining, according to the first coefficient group parameter, a coefficient group of a transform coefficient of the decoding block from candidate values of the coefficient group size. the size of.
  • the first coefficient group parameter includes an index number
  • the size of the coefficient group is set using the size of the coefficient group corresponding to the index number in the candidate value.
  • the first coefficient group parameter includes a flag bit
  • the size of the coefficient group is set using the size of the coefficient group corresponding to the flag bit in the candidate value.
  • the candidate value of the size of the coefficient group is one or more fixed values.
  • the first coefficient group parameter includes an identification parameter, and the identification parameter is used to configure a candidate value for the size of the coefficient group.
  • the identification parameter includes at least one of the following: the size of the coefficient group, the side length of the coefficient group, and the width and height of the coefficient group.
  • using one or more of the following methods to use the identification parameter to configure a candidate value for the size of the coefficient group includes: obtaining a maximum value and a minimum value of the identification parameter, and determining according to a preset division manner A value of the identification parameter other than the maximum value and the minimum value, using the value of the identification parameter to set the candidate value; obtaining a maximum value of the identification parameter and a maximum division level of the coefficient group, Determine a value other than the maximum value of the identification parameter according to the preset division method, and use the value of the identification parameter to set the candidate value; obtain the maximum value of the identification parameter and the coefficient group A difference between a maximum value and a minimum value of the size, determining a value other than the maximum value of the identification parameter according to the preset division manner, and setting the candidate value using the value of the identification parameter; obtaining The minimum value of the identification parameter and the maximum division level of the coefficient group are determined according to the preset division manner, and values other than the minimum value of the identification parameter are used, and the identification parameter is used.
  • the preset division manner includes at least one of the following: quarter division division, three division division division, and bisection division division.
  • using the identification parameter to configure a candidate value for the size of the coefficient group includes using the default value of the identification parameter to set the candidate value.
  • using the identification parameter to configure a candidate value for the size of the coefficient group includes: the identification parameter is one or more flag bits indicating whether the size of the corresponding coefficient group is included in the candidate value, Setting a size of a coefficient group included in the candidate value according to the identification parameter.
  • using the identification parameter to configure a candidate value for the size of the coefficient group includes: the identification parameter indicates the size of one or more coefficient groups corresponding to a preset Profile / Tier / Level, and according to the identification The parameter sets a size of a coefficient group included in the candidate value.
  • determining the size of the coefficient group according to the first coefficient group parameter includes: the first parameter group parameter includes a first decoding parameter of the decoding block, and according to the first decoding of the decoding block Parameter, setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter, wherein the first decoding parameter includes at least one of the following: the size of a transform block included in the decoding block , A prediction mode of the decoded block, a transform type used by a transform block included in the decoded block, and a quantization parameter.
  • the setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter includes: when a size of a transform block included in the decoding block is equal to a first preset value, Setting the size of the coefficient group to the size of the coefficient group corresponding to the first preset value.
  • a size of a coefficient group corresponding to the first preset value is obtained according to the parameters of the first parameter group.
  • setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter includes: when the prediction mode of the decoded block is equal to the first preset mode, setting the coefficient The size of the group is set to the size of the coefficient group corresponding to the first preset mode.
  • a size of a coefficient group corresponding to the first preset mode is obtained according to the parameters of the first parameter group.
  • setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter includes: when a transformation type used by a transformation block included in the decoding block is equal to a first transformation type , Setting the size of the coefficient group to the size of the coefficient group corresponding to the first transformation type.
  • a size of a coefficient group corresponding to the first transformation type is obtained according to the parameters of the first parameter group.
  • setting the size of the coefficient group to the size of the coefficient group corresponding to the first decoding parameter includes: when the value of the quantization parameter is equal to a second preset value, setting the coefficient The size of the group is set to the size of the coefficient group corresponding to the second preset value; or, when the value of the quantization parameter is within the first preset value range, the size of the coefficient group is set to the The size of the coefficient group corresponding to the first preset value range is described.
  • a size of a coefficient group corresponding to the second preset value is obtained according to the parameters of the first parameter group.
  • a size of a coefficient group corresponding to the first preset value range is obtained according to the parameters of the first parameter group.
  • the parsing the code stream and determining a scan mode of the transform coefficient includes: analyzing a data unit in the code stream to obtain a first scan mode parameter, and determining the first scan mode parameter according to the first scan mode parameter.
  • a data unit in the code stream includes at least one of the following: one or more parameter sets , Slice header, block-level data unit.
  • parsing a data unit in the code stream to obtain a first scanning mode parameter, and determining a scanning mode of the transform coefficient according to the first scanning mode parameter includes using a scan indicated by the first scanning mode parameter.
  • the mode is the scanning mode of the transform coefficient.
  • using the scanning mode indicated by the first scanning mode parameter as the scanning mode of the transform coefficient includes: the first scanning mode parameter indicates an adjacent decoded block of the decoding block, and using the The scanning mode of adjacent decoded blocks sets the scanning mode of the transform coefficients.
  • using the scanning mode indicated by the first scanning mode parameter as the scanning mode of the transform coefficient further includes: determining a scanning mode of the transform coefficient from the candidate scanning modes according to the first scanning mode parameter.
  • the first scan mode parameter includes a scan mode index number, and the scan mode corresponding to the scan mode corresponding to the candidate scan mode is set using the scan mode index number.
  • the method further includes: the first scanning mode parameter includes a scanning mode indication flag, and the scanning mode of the transform coefficient is set using the scanning mode corresponding to the scanning mode indication flag in the candidate scanning mode.
  • the candidate scanning mode includes at least one of: one or more fixed scanning modes; and using the first scanning mode parameter to configure the candidate scanning mode.
  • using the first scan mode parameter to configure the candidate scan mode includes: the first scan mode parameter includes a default scan mode, and using the default scan mode to set the candidate scan mode.
  • using the first scanning mode parameter to configure the candidate scanning mode includes: the first candidate scanning mode parameter includes one or more candidate scanning mode indication flags, and using the candidate scanning mode indication flag The corresponding scanning mode sets the candidate scanning mode.
  • using the first scanning mode parameter to configure the candidate scanning mode includes: using the first scanning mode parameter to instruct one or more scanning modes corresponding to a preset Profile / Tier / Level to set the candidate scanning method.
  • using the first scanning mode parameter to configure the candidate scanning mode includes using a correspondence relationship between a position of the transform coefficient indicated by the first scanning mode parameter and a position of the scanned transform coefficient. Setting the candidate scan mode.
  • the data unit in the code stream is parsed to obtain a first scanning mode parameter, and the scanning mode of the transform coefficient is determined according to the first scanning mode parameter; including: the first scanning mode parameter includes the decoding A second decoding parameter of the block; determining a scanning method of the transform coefficient according to the second decoding parameter, wherein the second decoding parameter includes at least one of the following: a size of a transform block included in the decoded block, A prediction mode of the decoded block, a transform type used by a transform block included in the decoded block, and a size of the decoded block.
  • setting the scanning mode of the transform coefficient to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter includes: when a size of a transform block included in the decoding block is equal to a third When the preset value is set, the scan mode of the transform coefficient is set to the scan mode corresponding to the third preset value.
  • a scanning mode corresponding to the third preset value is obtained according to the parameters of the first parameter group.
  • setting the scanning mode of the transform coefficient to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter includes: when a prediction mode of the decoded block is equal to a second preset mode , Setting the scanning mode of the transform coefficient to the scanning mode corresponding to the second preset mode.
  • a scanning mode corresponding to the second preset mode is obtained.
  • setting a scanning mode of the transform coefficient to a scanning mode corresponding to the second decoding parameter includes: when a transform type used by a transform block included in the decode block is equal to In the second transformation type, the scanning mode of the transformation coefficient is set to the scanning mode corresponding to the second transformation type.
  • a scanning manner corresponding to the second transformation type is obtained.
  • setting the scanning mode of the transform coefficient to the scanning mode corresponding to the second decoding parameter according to the second decoding parameter includes: when the size of the decoding block is equal to a fourth preset value, The scanning mode of the transform coefficient is set to the scanning mode corresponding to the fourth preset value.
  • a scanning manner corresponding to a fourth preset value is obtained according to the parameters of the first parameter group.
  • the code stream is parsed to determine a value of a syntax element related to a transform coefficient, including: the syntax element includes at least one of the following: a syntax element indicating a start position of a non-zero coefficient; and an indication that the coefficient group includes a non- Syntax elements of 0 coefficients; syntax elements indicating non-zero coefficient positions in the coefficient group; syntax elements indicating values of non-zero coefficients in the coefficient group.
  • the processing the transformation coefficients to obtain a restored value of the transformation coefficients includes: when determining that the transformation coefficients are subjected to scaling scaling processing, performing scaling processing on the transformation data to obtain the transformation coefficients. When it is judged that the transformation data is not subjected to scaling processing, the transformation coefficient is used to set the restoration value of the transformation coefficient.
  • the method before processing the transform coefficients, further includes: parsing the code stream to obtain a third parameter for constructing a recovered value of the predicted difference of the decoded block; according to the The third parameter is to determine whether to perform scaling processing on the transformation coefficient.
  • the method further includes: performing a loop filtering process on the sum of the predicted value and the predicted difference value.
  • the input code stream is parsed (Parsing), and the entropy decoding method and the binarization method specified in the standard are used to convert one or more "0" and "1" bit strings corresponding to each field in the code stream.
  • the value of the corresponding parameter According to the value of the parameter, the values of other parameters are derived, for example, when the value of the flag bit in the code stream indicates that the decoded block is the first decoded block in the image, it will be used to indicate where the decoded block is located.
  • the address parameter of the first decoded block in the image in the slice is set to 0.
  • the parameter for constructing the decoded block prediction difference recovery value is a transformation coefficient that can be expressed in the form of a two-dimensional matrix, where M and N are positive integers, M and N may be equal, and M and N may not be equal.
  • the two-dimensional matrix may correspond to one transform block.
  • a “transform block” is used to refer to the transform coefficients expressed in the form of a two-dimensional matrix.
  • the restored transformation coefficient corresponds to a quantized value output during the quantization process in the encoder in Embodiment 1 (that is, " Level "value); conversely, when the parsing bitstream obtaining instruction information indicates that the transform block is not scaled, the restored transform coefficient corresponds to data obtained by transforming the prediction difference by the encoder.
  • the size of the coefficient group is determined, and the coefficient group includes W ⁇ H transform coefficients, where W and H are positive integers, W and H may be equal, W and H may not be equal, and W ⁇ M, H ⁇ N .
  • W and H are positive integers
  • W and H may be equal
  • W and H may not be equal
  • W ⁇ M, H ⁇ N One or more coefficient groups form a transform block
  • the size of the used coefficient group may be a preset fixed value, or the size of the usable coefficient group may be obtained by analyzing one or more of the following data units in the code stream, including: one or more parameter sets (Parameter Set), slice header (Slice Header), coding unit (Coding Unit).
  • Parameter Set Parameter Set
  • slice header Slice Header
  • Coding Unit Coding Unit
  • the size of the coefficient group may be determined using an implicit derivation.
  • the coefficient group of the transform block may be determined according to one or more parameters such as the coding mode (Coding Mode) of the decode block where the transform block is obtained, the transform block size, quantization parameters, and the type of transform used by the transform block. the size of.
  • the size is set so that two types of coefficient groups of 4x4 and 8x8 can be used.
  • the method can be extended to the case where the size of more coefficient groups is used.
  • the size of the usable coefficient group can be a parameter obtained by analyzing the code stream, or it can be a fixed configuration value.
  • the size of the coefficient group can be determined using one of the methods described below or a combination of methods.
  • the size of the coefficient group can be set according to the height and width of the transform block. For example, when the smaller value of the height and width of the transform block is greater than 16, the height and width are used. The smaller value of is equal to a rectangular coefficient group of 8, and the smaller value of height and width is used.
  • the size of the coefficient group corresponding to the transform block in the decoding block of the inter prediction mode is set to 8x8 (the size of the coefficient group used by the transform block of 8x8 and 4x4 is set to 4x4)
  • the intra prediction mode is set to
  • the size of the coefficient group corresponding to the transform block in the decoded block is 8x8 (the size of the coefficient group used by the transform block of 16x16, 8x8, and 4x4 is set to 4x4).
  • the value of the size of the coefficient group used by the transform block it contains is determined according to the quantization parameter of the decoded block. Taking the setting method of the quantization parameter in the H.265 / HEVC standard as an example, in one implementation, when the value of the quantization parameter is greater than or equal to 37, the size of the coefficient group is set to 8x8 (the transformation of 8x8 and 4x4 is set) The size of the coefficient group used by the block is 4x4); otherwise, the size of the coefficient group is set to 4x4.
  • the size of the coefficient group is set to 8x8 (the size of the coefficient group used by the transform block of 8x8 and 4x4 is set to 4x4).
  • the size of the coefficient group is set to 4x4.
  • the size of the coefficient group is set to 8x8 (set the size of the coefficient group used by the 8x8 and 4x4 transform blocks to be 4x4 ).
  • the size of the coefficient group is set to 8x8 (the size of the coefficient group used by the transformation blocks of 8x8 and 4x4 is set to 4x4).
  • the following one or more data units in the code stream are parsed to obtain identification information used to indicate the size of the coefficient group of the transform block, including: one or more parameter sets, a slice header, and an encoding unit Transform block data unit.
  • a scanning manner of the transform coefficient is determined.
  • the scanning method indicates the processing order of the elements in the two-dimensional matrix of transform coefficients.
  • the processing order also corresponds to the aforementioned encoder writing the transform coefficients.
  • the order of the stream Therefore, correspondingly, in the processing flow, in combination with other related parameters (such as non-zero coefficient flag bits, etc.), according to the sequence of obtaining the transformation coefficients in the code stream by analyzing the code stream, the scanning mode indicates each transformation coefficient. Position in the transform block.
  • the encoder of the aforementioned encoder writes the transform coefficient whose coordinate position in the transform block is (m, n) in the kth order, and obtains the kth transform coefficient from the codestream.
  • This transform coefficient is set to the element whose coordinate position is (m, n) in the transform block.
  • the elements in a two-dimensional matrix of M rows and N columns are sequentially read in the order (positive order or reverse order) indicated by the scanning method, and a 1-row M x A one-dimensional matrix with N columns (or M rows and 1 column).
  • the one-dimensional matrix of the 1 row M ⁇ N columns (or M ⁇ N N rows and 1 columns) obtained by decoding the code stream can be rearranged into an encoding
  • the input matrix of the router is a two-dimensional matrix with M rows and N columns.
  • Diagonal scan order (eg, diagonal up-right scan order, etc.)
  • an implicit derivation manner may be used to determine a scanning manner of the transform coefficient matrix of the transform block.
  • the scanning mode of the transform block may be determined according to one or more parameters such as a coding mode (Coding Mode), a decode block size, and a transform block size of the decode block where the transform block is obtained by analyzing the code stream.
  • the intra prediction mode when the size of the decoded block is greater than 8x8 is set to correspond to the diagonal upper right scan mode, and the frame when the decoded block size is 8x8 or less is set.
  • the prediction mode corresponds to a scanning method that uses an intra prediction direction to indicate the direction, and a mode that does not use directional prediction, such as a direct current (DC) mode and a planar mode, uses a diagonal upper right scanning method.
  • DC direct current
  • the intra-prediction directions can be classified, and each type corresponds to different scanning methods.
  • the vertical prediction direction and the intra-prediction directions offset by a specified angle from left to right correspond to the vertical scanning method, the horizontal direction, and the horizontal direction.
  • the intra-prediction direction shifted up and down by the specified angle corresponds to using the horizontal scanning method, and can also include a 45-degree angle and the intra-prediction direction shifted up and down by the specified angle in the diagonal direction using the diagonal scan method.
  • the following one or more data units in the code stream are parsed to obtain information indicating a scanning mode used by the transform block, including: one or more parameter sets, a slice header, an encoding unit, and a transform block data unit.
  • the following one or more data units in the code stream are parsed to obtain information of the scanning mode, including: one or more parameter sets, a slice header, an encoding unit, and a transform block data unit.
  • a method for expressing the scanning mode information is: a correspondence table between the positions of the transform coefficients in the transform block and the scanned positions. It should be noted that, in the foregoing encoder, the correspondence table indicates transformation The scan position corresponding to the transform coefficient (or the index number equal to m ⁇ nTbS + n, where nTbS is the width of the transform block) at the coordinate position in the block is equal to k.
  • the equivalent information indicated by the correspondence table is that the position coordinates of the transform coefficient in the transform block where the position sequence number equal to k obtained by parsing the code stream is (m, n) (or the index sequence number) (Equal to m ⁇ nTbS + n, where nTbS is the width of the transform block).
  • the various scanning methods determined are processing the coefficient groups in the transform block and the transform coefficients in the coefficient group in a fixed order. Different scanning methods have different definitions. Scan order.
  • the transform coefficients in the transform block are parsed. According to the size of the transform block and the size of the coefficient group, the position of each coefficient group included in the transform block is determined. The position of the coefficient group may be expressed as a position coordinate of an upper-left coefficient in the coefficient group in a transform block (or a decoded image).
  • the coefficient groups are sequentially processed according to the order indicated by the scanning mode. For a coefficient group, the value of the corresponding element in the coefficient group is set to the value of the transformation coefficient obtained by analyzing the code stream according to the order indicated by the scanning mode.
  • the parsing unit sets all the coefficients contained in the coefficient group to 0.
  • the processing order for the coefficient groups in the transform block and the processing order for the transform coefficients in the coefficient group may be the same or different.
  • the method is further configured to construct a predicted value of the decoded block according to the parameter for constructing a predicted value of the decoded block.
  • the prediction value of the decoded block is constructed according to the decoded image stored in the partially decoded image buffer that has been partially restored in the currently decoded image.
  • each reference picture list includes one or more reference pictures
  • the reference pictures include: reference picture list indication, reference picture
  • the index and the motion vector determine one or more matching blocks of the decoded block in the reference image, and use the output inter prediction value as the prediction value of the decoded block.
  • the current decoded image where the decoded block is located is used as a reference image to obtain the intra prediction value of the decoded block.
  • the intra prediction refers to a prediction value obtained by using only data in an image in which a decoding block is located as a reference. In this case, the part that has been partially recovered in the currently decoded image is used.
  • a method similar to the implementation of a method is used to determine the adjacent recovered pixel points of the decoded block, and used as reference pixel points for intra prediction.
  • An intra prediction mode is determined according to the parameters for constructing the prediction value of the decoded block, and the intra prediction value of the decoded block is calculated using the same method as in the first embodiment.
  • the parameter for constructing the prediction value of the decoded block indicates the position of the matching block of the decoded block in the current partial decoded image
  • the matched block is used as the intra prediction value of the decoded block.
  • the determined intra prediction value is used as the prediction value of the decoded block.
  • the quantization value (that is, the "Level” value) of the QP and coefficients in the parameters for constructing the decoded block prediction difference recovery value is used as an input of the scaling operation (Scaling).
  • scaling operation Scaling
  • the quantization parameter QP a scaling operation is performed on the quantized value of the coefficient to obtain a restored value of the transform coefficient. Therefore, the inverse quantization unit may also be called a scaling unit.
  • the obtained recovery value of the transformation coefficients and the transformation parameter among the parameters used to construct the decoded block prediction difference restoration value is determined not to use the scaling operation on the current decoded block.
  • the output transform coefficient is used for inverse transform.
  • a recovery value of the prediction difference of the decoded block is obtained.
  • the "inverse transform” described here is relative to the "transform” in the encoder.
  • a transform method is defined, that is, a transform method used to convert a restored value of a transform coefficient into a restored value of a prediction difference.
  • a restoration value of the decoded block is calculated, and the restored value of the decoded block is stored in an image buffer.
  • the image buffer may be a piece of storage space allocated separately during an image decoding process.
  • the filter parameters include indication information of a used filter, filter coefficients, and control parameters of the filter. Filtering the data in the image buffer by using a filter in combination with the filter parameters to obtain a decoded image of the image.
  • the filter in this embodiment may be formed by cascading one or more filters.
  • two filters are cascaded, namely, deblocking filtering and sample value adaptive additive offset compensation filter (Sample Adaptive Offset (SAO)).
  • SAO Sample Adaptive Offset
  • Neural network filters can also be included.
  • the operation of filtering the data in the image buffer may be performed at the image layer, that is, after the restoration values of all decoded blocks in the image are written into the image buffer, the image is buffered.
  • the data in the buffer is filtered.
  • the operation of filtering the data in the image buffer may be performed at the block layer, that is, when the recovered data of a decoding block is no longer used as reference data for subsequent decoding blocks, Restore the data for filtering.
  • FIG. 6 is a data processing flowchart of analyzing a size of a coefficient group according to an embodiment of the present invention. As shown in Figure 6,
  • Step S601 Analyze the size of the coefficient group in the parameter set data unit. Analyze the code stream corresponding to the parameter set data unit in the data stream to obtain the size of the coefficient group that can be used in the decoding process.
  • the parameter set data unit refers to a parameter set data unit for carrying parameter data applicable to the entire sequence, for example, a Video Parameter Set (VPS) in the H.265 / HEVC standard 2. Sequence Parameter Set (SPS).
  • the parameter set data unit may further include a parameter set data unit for carrying parameter data suitable for an image, for example, an adaptive parameter set (APS), an image parameter set in the H.265 / HEVC standard (Picture Parameter Set, PPS).
  • APS adaptive parameter set
  • PPS Picture Parameter Set
  • the parameters in APS or PPS remain unchanged for each image in the entire sequence, that is, the parameters in APS or PPS are applicable to each image in the entire sequence
  • the APS or PPS in this case is equivalent
  • a parameter set data unit carrying parameter data applicable to the entire sequence may be overwritten in the parameter set data unit applicable to the sequence according to the instruction information obtained by parsing the code stream in the data stream or using the default setting method. Corresponding data.
  • the code stream of the parameter set data unit in the data stream is parsed, and a flag bit indicating whether the size of multiple coefficient groups is allowed is obtained in the parameter set data unit.
  • the flag bit indicates "allowed use"
  • the size of the coefficient group used to decode the transform coefficient of the decoded block may be determined from the sizes of more than one candidate coefficient group.
  • the flag indicates "not allowed” only the size of the coefficient group set by default is used to decode the transform coefficients.
  • a default value of the size of the coefficient group can be obtained in the parameter set data unit.
  • the parameter may be a parameter directly indicating the size of the coefficient group, or may be a value indicating whether the size of the corresponding coefficient group is a default value of the size of the coefficient group Flag bit.
  • the obtained flag bit indicates that the size of multiple coefficient groups is not allowed, continue to parse the fields after the flag bit to obtain the default value of the size of the coefficient group.
  • the sizes of the coefficient groups allowed are parsed.
  • an analysis method is to parse the parameter set data unit to obtain the maximum and minimum allowable coefficient group sizes.
  • the set can be derived from the largest to the smallest. (For example, according to the quad tree method) to perform implicit derivation, for example, to parse and obtain the maximum and minimum allowable coefficient group sizes are 32x32 and 4x4, then according to the aforementioned quad tree method, the parameter set data unit field
  • the size of the indicated allowable coefficient group includes: 32x32, 16x16, 8x8, and 4x4.
  • the second analysis method is to parse the parameter set data unit to obtain the maximum allowed coefficient group size and the maximum division level according to the division method (such as the quad tree method).
  • the size of the allowable coefficient group indicated by the field of the parameter set data unit includes: 32x32, 16x16, 8x8, and 4x4.
  • the maximum and minimum The difference between the sizes of the allowed coefficient groups can also appear in the code stream at the maximum division level.
  • an analysis method is to parse the parameter set data unit to obtain the maximum and minimum allowable coefficient group side lengths.
  • the maximum side length can be set from the largest to the smallest. (For example, according to the dichotomy) to perform implicit derivation, for example, to parse and obtain the maximum and minimum side lengths of 16 and 4, respectively, then the available side of the allowable coefficient group indicated by the field of the parameter set data unit
  • the length includes 16, 8, and 4, and the size of the corresponding coefficient group (in the form of "width x height") includes: 16x16, 16x8, 16x4, 8x16, 8x8, 8x4, 4x16, 4x8, and 4x4.
  • the second analysis method is to parse the parameter set data unit to obtain the side length of the maximum allowable coefficient group and the maximum division level according to the division method (such as the dichotomization method). For example, parse and obtain the side length of the maximum allowable coefficient group. Is 16, the maximum division level is 2, then the available side lengths of the allowable coefficient groups indicated by the fields of the parameter set data unit include 16, 8 and 4, and the sizes of the corresponding indicated coefficient groups include: 16x16, 16x8, 16x4 , 8x16, 8x8, 8x4, 4x16, 4x8, and 4x4. Alternatively, the difference between the side lengths of the maximum and minimum allowed coefficient groups can also appear in the codestream at the maximum division level.
  • the division method such as the dichotomization method
  • the third analysis method is to parse the parameter set data unit to obtain the side length of the minimum allowed coefficient group and the maximum upward level according to the division method (for example, dichotomy). For example, parse and obtain the side length of the minimum allowed coefficient group.
  • the available side lengths of the allowable coefficient groups indicated by the field of the parameter set data unit include 16, 8 and 4, and the sizes of the corresponding indicated coefficient groups include: 16x16, 16x8, 16x4 , 8x16, 8x8, 8x4, 4x16, 4x8, and 4x4.
  • the difference between the side lengths of the maximum and minimum allowable coefficient groups can also appear in the code stream at the highest upward level.
  • the fourth analysis method is to parse the parameter set data unit to obtain a flag bit corresponding to the available side length, and the flag bit is used to indicate whether the corresponding side length is allowed to be used. For example, when the available side length includes 32, At 16, 8, and 4, the parsing parameter set data unit obtained a flag bit corresponding to "side length 32" indicating "not allowed", and three flag bits corresponding to "side length 16, 8 and 4" indicating "allowing use", Then the available side lengths of the allowable coefficient groups indicated by the fields of the parameter set data unit include 16, 8, 4, and the sizes of the corresponding indicated coefficient groups include: 16x16, 16x8, 16x4, 8x16, 8x8, 8x4, 4x16, 4x8 and 4x4.
  • an analysis method is to parse the parameter set data unit to obtain the maximum and minimum allowable values of the width and height of the coefficient group.
  • the set width and height may be used. Implicit derivation from the largest to the smallest (for example, according to the dichotomy), for example, parsing and obtaining the maximum and minimum allowed values of the width of the coefficient group are 16 and 4, respectively, and parsing and obtaining the maximum of the height of the coefficient group And minimum allowable values are 8 and 4, respectively, then the width of the allowable coefficient group indicated by the field of the parameter set data unit includes 16, 8 and 4, and the height of the allowable coefficient group indicated includes 8 and 4.
  • the size of the corresponding indicated coefficient group includes: 16x8, 16x4, 8x8, 8x4, 4x8, and 4x4.
  • the second analysis method is to parse the parameter set data unit to obtain the width of the maximum allowable coefficient group and the maximum division level according to the division method (such as bisection method), to obtain the height of the maximum allowable coefficient group and according to the division method (such as Dividing method), for example, parsing and obtaining the maximum allowable coefficient group width is 16, the maximum division level is 2, parsing and obtaining the maximum allowable coefficient group height is 8, and the maximum division level is 1, Then the width of the allowable coefficient group indicated by the field of the parameter set data unit includes 16, 8 and 4, and the height of the indicated allowable coefficient group includes 8 and 4, corresponding to the size of the indicated coefficient group (with " The form of "width x height” includes: 16x8, 16x4, 8x8, 8x4, 4x8, and 4x4.
  • the difference between the widths of the maximum and minimum allowable coefficient groups can also appear in the code at the maximum division level.
  • the difference between the maximum and minimum allowed coefficient group heights can also appear in the code stream at the maximum division level.
  • the third analysis method is to obtain the minimum allowable coefficient group width and the maximum upward level according to the division method (for example, dichotomy), and obtain the minimum allowable coefficient group height and according to the division method (such as Dichotomous method), for example, parsing and obtaining the minimum allowable coefficient group with a width of 4 and maximum upwards with a level of 2; parsing and obtaining with the minimum allowable coefficient group with a height of 4 and a maximum upwards with a level of 1,
  • the width of the allowable coefficient group indicated by the field of the parameter set data unit includes 16, 8 and 4
  • the height of the indicated allowable coefficient group includes 8 and 4, corresponding to the size of the indicated coefficient group (with "
  • the form of "width x height” includes: 16x8, 16x4, 8x8, 8x4, 4x8, and 4x4.
  • the difference between the widths of the maximum and minimum allowable coefficient groups can also appear in the code at the highest upward level.
  • the difference between the height of the maximum and minimum allowable coefficient groups can also appear in the code in the largest upward level.
  • the fourth parsing method is to parse the parameter set data unit to obtain flag bits corresponding to the available width and height respectively, and the flag bits are used to indicate whether the corresponding width and height are allowed to be used during the decoding process. For example, when available When the width and height include 32, 16, 8, and 4, the parsing parameter set data unit obtains the flag bit corresponding to "width 32" indicating “not allowed” and the three flag bits corresponding to "width 16, 8 and 4" The two flag bits corresponding to "allowed use” and "height 32 and 16" indicate “not allowed”, and the two flag bits corresponding to "height 8 and 4" indicate “allowable”, then the parameter set data unit
  • the width of the allowable coefficient group indicated by the field includes 16, 8, and 4, and the height of the allowable coefficient group indicated includes 8 and 4, corresponding to the size of the indicated coefficient group (in "width x height” (Formal representation) includes: 16x8, 16x4, 8x8, 8x4, 4x8, and 4x4.
  • an analysis method is to parse the parameter set data unit to obtain a flag bit corresponding to the size of the available coefficient group, and the flag bit is used to indicate whether the size of the corresponding parameter group is allowed to be used.
  • the 9 flag bits obtained by the parsing parameter set data unit acquisition indicate that "16x16 is not allowed Use, 16x8 allowed, 16x4 allowed, 8x16 not allowed, 8x8 allowed, 8x4 allowed, 4x16 allowed, 4x8 allowed, and 4x4 allowed ", 16x8, 16x4, 8x8, 8x4, 4x8, and 4x4 As the size of the coefficient group allowed in the decoding process.
  • the above-mentioned method may be used to obtain the size of the coefficient group allowed to be used for decoding blocks of different coding modes (Coding mode).
  • the parsing parameter set data unit obtains information indicating that the size of the allowable coefficient group for the transform block in the intra prediction mode decoding block is 8x8 and 4x4, and the obtainment information indicates that the transform block in the inter prediction mode decoding block is available for the transform block. Allowed coefficient group sizes are 16x16, 8x8, and 4x4.
  • the above-mentioned method can be used to obtain the size of the coefficient group allowed to be used by the transform block with different transform times.
  • the parsing parameter set data unit obtains an indication that the sizes of allowable coefficient groups for transform blocks using one transform are 8x8 and 4x4, and the sizes of allowable coefficient groups for transform blocks using multiple transforms are 16x16, 8x8, and 4x4.
  • the above-mentioned method may be used to obtain the size of the coefficient group allowed by the transform block using different transform modes.
  • the parsing parameter set data unit obtains an indication of the size of the allowable coefficient groups for transform blocks using transforms based on the DCT design.
  • the sizes of allowable coefficient groups for transform blocks using transforms based on the DST design are 8x8 and 4x4.
  • the sizes are 16x16, 8x8, and 4x4, and the allowable coefficient group sizes for transform blocks using transforms designed based on KLT are 32x32, 16x16, 8x8, and 4x4.
  • the parameter set data unit is parsed to obtain a control parameter for switching the size of the allowable coefficient group.
  • a quantization parameter is used as a control parameter for switching the size of an allowable coefficient group
  • the foregoing method is used to analyze the parameter set data unit to obtain the division interval of the quantization parameter and the size of the coefficient group allowed in each interval.
  • An example of the switching method is: as in the quantization parameter definition method in the H.265 / HEVC standard, when the quantization parameter is greater than or equal to 37, the size of the allowed coefficient group is 16x16, 8x8, and 4x4; when the quantization parameter value is less than When 37 but greater than or equal to 27, the allowed coefficient group size is 8x8; when the quantization parameter value is less than 27, the allowed coefficient group size is 4x4,
  • the size of the usable coefficient group is set in advance in Profile / Tier / Level.
  • one or more values can be used.
  • the size of the coefficient group For example, for lower levels (such as those corresponding to decoding video streams with resolutions of 640x480 and below), use the size of the coefficient group with a default value equal to 4x4; for higher levels (such as corresponding to decoding 720p, 1080p, 2K) (Such as large-resolution video code streams), you can use the size of 8x8, 4x4 two coefficient groups; for the highest level (such as corresponding to decoding 4K, 8K and other large-resolution video code streams), you can use 16x16, 8x8 , 4x4 three kinds of coefficient group size. Analyze the parameter set data unit, obtain the profile / Tier / Level instructions, and determine the size of the coefficient group that can be used.
  • An optional example code stream organization method is as follows (the code stream organization method is the same as the method shown in Table 1), and the fields of the code stream organization method are located in one or more parameter set data units. Using the above method, the code stream field in Table 3 is parsed to obtain the size of the coefficient group allowed in the decoding process.
  • log2_min_cg_side_length represents the minimum side length of the coefficient group.
  • the minimum side length of the coefficient group is equal to (1 ⁇ log2_min_cg_side_length).
  • " ⁇ " is an arithmetic right shift operator.
  • log2_diff_max_cg_side_length represents the difference between the maximum side length and the minimum side length of the coefficient group.
  • the maximum side length of the coefficient group is equal to (1 ⁇ (log2_min_cg_side_length + log2_diff_max_cg_side_length)).
  • log2_diff_max_cg_side_length is entropy decoded using the method ue (v).
  • An example of determining the size of the coefficient group by analyzing the corresponding fields of the syntax elements in the code stream in Table 3 is as follows. For example, the method of ue (v) is used to parse log2_min_cg_side_length to obtain a value equal to 2, and the method of ue (v) is used to parse log2_diff_max_cg_side_length to obtain a value equal to 0. It is determined that only the coefficient group with a default size of 4x4 is used in the decoding process.
  • determine the available side length of the coefficient group that can be used during decoding includes 16 , 8, 4
  • the sizes of the available coefficient groups corresponding to the indication include: 16x16, 16x8, 16x4, 8x16, 8x8, 8x4, 4x16, 4x8, and 4x4.
  • An optional example code stream organization method is as follows (the code stream organization method is the same as the method shown in Table 2), and the fields of the code stream organization method are located in one or more parameter set data units.
  • the code stream field in Table 4 is parsed to obtain the size of the coefficient group allowed in the decoding process.
  • the bitstream field in Table 4 may indicate the size of the transform block in the decoding block using the inter mode and the intra mode that allows the use of different coefficient groups.
  • log2_min_cg_side_length represents the minimum side length of the coefficient group.
  • the minimum side length of the coefficient group is equal to (1 ⁇ log2_min_cg_side_length).
  • " ⁇ " is an arithmetic right shift operator.
  • log2_diff_max_inter_cg_side_length represents the difference between the maximum and minimum side lengths of the coefficient group of the transform block in the decoded block using the inter prediction mode.
  • the maximum side length of the coefficient group is equal to (1 ⁇ (log2_min_cg_side_length + log2_diff_max_cg_side_length)).
  • log2_diff_max_cg_side_length is entropy decoded using the method ue (v).
  • log2_diff_max_intra_cg_side_length represents the difference between the maximum and minimum side lengths of the coefficient group of the transform block in the decoded block using the intra prediction mode.
  • the maximum side length of the coefficient group is equal to (1 ⁇ (log2_min_cg_side_length + log2_diff_max_cg_side_length)).
  • log2_diff_max_cg_side_length is entropy decoded using the method ue (v).
  • An example of determining the size of the coefficient group by analyzing the corresponding fields of the syntax elements in the code stream in Table 4 is as follows. For example, use the ue (v) method to parse log2_min_cg_side_length to obtain a value equal to 2, and use the ue (v) method to parse log2_diff_max_inter_cg_side_length and log2_diff_max_intra_cg_side_length to obtain the values of the two syntax elements are set to 0.
  • the decoded blocks of the prediction mode and the decoded blocks of the intra prediction mode only use a coefficient group with a default size of 4x4.
  • the available side lengths of the coefficient groups allowed during the decoding process include 16, 8, 4, and the sizes of the corresponding indicated coefficient groups include: 16x16, 16x8, 16x4, 8x16, 8x8, 8x4, 4x16, 4x8 and 4x4.
  • the same allowed set of coefficients is used for the transform block in the decode block of the inter prediction mode and the decode block of the intra prediction mode.
  • the available side lengths of the coefficient groups that can be used for decoding the inter-mode decoding block during the decoding process include 16, 8 and 4, and the sizes of the corresponding indicated coefficient groups include: 16x16, 16x8, 16x4, 8x16, 8x8, 8x4, 4x16, 4x8, and 4x4.
  • Available side lengths include 8 and 4, and the corresponding indicated coefficient group sizes include: 8x8, 8x4, 4x8, and 4x4.
  • the transform coefficient blocks in the inter prediction mode decoding block and the intra prediction mode decoding block use not exactly the same allowed coefficient groups.
  • Step S602 Analyze the size of the coefficient group in the slice header information data unit. Analyze the code stream corresponding to the slice header information data unit in the data stream to obtain the size of the coefficient group that can be used in the decoding process.
  • Analyze the parameter set index of the parameter set of the parameter reference (refer to), activate the reference parameter set, and obtain the size of the usable coefficient group set in the parameter set.
  • the analysis method used is the same as the method for obtaining the size of the coefficient group by analyzing the parameter set data unit in step S601 except for the method of obtaining the size of the coefficient group by analyzing Profile / Tier / Level.
  • the field corresponding to the size-related syntax unit of the coefficient group that can be used in the fragment header information is parsed to obtain the decoding process of the fragment.
  • the analysis method used is the same as the method for obtaining the size of the coefficient group by analyzing the parameter set data unit in step S601 except for the method of obtaining the size of the coefficient group by analyzing Profile / Tier / Level.
  • Step S603 Parse the size of the coefficient group in the block-level data unit. Analyze the code stream corresponding to the block-level data unit in the data stream to obtain the size of the coefficient group that can be used in the decoding process.
  • Parse the block layer data unit to obtain a parameter indicating the size of the coefficient group used by the transform block in the decoded block.
  • a parsing method is to parse a field corresponding to a syntax element in a block layer data unit indicating a size of a coefficient group used for decoding a transform block, such as a width and a height of a coefficient group.
  • one parsing method is to parse a block-level data unit to obtain one or more index values, which correspond to the size of a coefficient group.
  • a parsing method is to parse a block-level data unit to obtain one or more flag information, where the flag information is used to indicate a size of a coefficient group used by a transform block in the decoded block and a value indicated by the flag information.
  • the decoded transform block is the same.
  • the decoded transform block may be a decoded transform block (such as the above neighboring block, left neighboring block, etc.) in the same image as the transform block, or it may be For decoded blocks (immediate domain neighboring blocks) in which the transform block is not in the same image, one example of the flag information may be flag information indicating "the same size as the coefficient group of the upper neighboring transform block".
  • FIG. 7 is a data processing flowchart for analyzing a scanning mode parameter according to an embodiment of the present invention.
  • the input of the processing flow is a code stream related to the scanning method in the data stream
  • the output of the processing flow is a scanning method that is allowed in the decoding process and a scanning method used in decoding the transform block in the decoded block.
  • Step S701 Parse the scanning mode parameters in the parameter set data unit. Analyze the code stream corresponding to the parameter set data unit in the data stream to obtain the scanning method that can be used in the decoding process.
  • the scanning method may be a scanning method of a fixed path preset in, or a scanning method of a non-fixed path.
  • a scanning method of a non-fixed path optionally, parsing the parameter set data unit to obtain the coordinate correspondence relationship of the transformation coefficients before and after scanning. For example, the post-scanning serial number position corresponding to the transform coefficient (or the index number equal to m ⁇ nTbS + n, where nTbS is the width of the transform block) at the coordinate position in the transform block is equal to k.
  • the size of the usable coefficient group is set in advance in Profile / Tier / Level.
  • one or more scan modes are set. .
  • the default diagonal upper right, horizontal and vertical scanning methods are used; for higher levels (for example, encoding 720p, 1080p, 2K) (Such as larger resolution video), in addition to the three default scanning methods that can be used for lower levels, you can also use Zig-zag scanning methods, other diagonal scanning methods (such as diagonal bottom right, diagonal bottom left Etc.);
  • a scanning method with a non-fixed scanning path can also be used.
  • the parsing parameter set data unit obtain the profile / Tier / Level indication information, and determine the scanning method that can be used in the decoding process.
  • the parameter set data unit is analyzed to obtain the coordinate correspondence between the transform coefficients before and after scanning. For example, the post-scanning serial number position corresponding to the transform coefficient (or the index number equal to m ⁇ nTbS + n, where nTbS is the width of the transform block) at the coordinate position in the transform block is equal to k.
  • Step S702 Parse the scanning mode parameters in the slice header information unit. Analyze the code stream corresponding to the slice header information data unit in the data stream to obtain the scanning method that can be used in the decoding process.
  • an available scanning mode set in the referenced parameter set may be used.
  • the analysis method used is the same as the method for obtaining the scanning mode parameters in the analysis parameter set other than the method for obtaining the scanning mode by analyzing the Profile / Tier / Level in step S701.
  • a scanning mode parameter when a scanning mode parameter is not included in a parameter set referenced by the slice, parsing the slice header information to obtain a scanning mode parameter that can be used in decoding the slice.
  • the analysis method used is the same as the method for obtaining the scanning mode parameters in the analysis parameter set other than the method for obtaining the scanning mode by analyzing the Profile / Tier / Level in step S701.
  • the slice header information data unit is parsed to obtain the coordinate correspondence between the transform coefficients before and after scanning.
  • the post-scanning serial number position corresponding to the transform coefficient or the index number equal to m ⁇ nTbS + n, where nTbS is the width of the transform block) at the coordinate position in the transform block is equal to k.
  • Step S703 Parse the scanning mode parameters in the block-level data unit. Analyze the code stream corresponding to the block-level data unit in the data stream to obtain the scanning method used in the process of decoding a decoded block.
  • a parsing method is to parse one or more index values in a block-level data unit, and the index values correspond to a scanning mode.
  • one analysis method is to analyze the coordinate correspondence between the transformation coefficients in the block-level data unit before and after scanning, such as the transformation coefficient in the transformation block whose coordinate position is equal to (m, n) (or the index number equals m ⁇ nTbS + n , Where nTbS is the width of the transform block) and the number position after scanning is equal to k.
  • a parsing method is to parse one or more flag information in a block-level data unit, where the flag information is used to indicate a scanning mode used by a transform block in the decoded block and an already-existing scan indicated by the flag information.
  • the decoded transform block is the same, and the decoded transform block may be a decoded transform block (such as the neighboring block above, the left neighboring block, etc.) in the same image as the transform block, or it may be the transform
  • the flag information may be flag information indicating "the same as the scanning mode of the upper neighboring transform block".
  • the method according to the above embodiments can be implemented by means of software plus a necessary universal hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present application can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, and optical disk), and includes several instructions for making a terminal
  • the device (which may be a mobile phone, a computer, a server, or a network device, etc.) executes the methods described in the embodiments of the present application.
  • module may implement a combination of software and / or hardware for a predetermined function.
  • the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and conceived.
  • FIG. 8 is a structural block diagram of an image encoding device according to an embodiment of the present invention. As shown in FIG. 8, the device includes a first determination module 82, a transformation module 84, a second determination module 86, and an encoding module 88.
  • a first determining module 82 configured to determine a prediction value of a coding block, and calculate a prediction difference between the coding block and the prediction value;
  • a transformation module 84 configured to perform one or more transformations on the prediction difference to obtain transformation data, and use the transformation data to determine transformation coefficients;
  • the second determining module 86 is configured to determine a scan mode and a size of a coefficient group of the transform coefficients, divide the transform coefficients into one or more coefficient groups, and scan each of the coefficient groups included in the coefficient groups according to the scan mode. Transform coefficients, transforming the transform coefficients into one or more syntax elements;
  • the encoding module 88 is configured to encode the size of the coefficient group and the value of the syntax element, and write the encoded bits into a code stream.
  • FIG. 9 is a structural block diagram of another image encoding device according to an embodiment of the present invention.
  • the second determination module 86 further includes a CG size determination unit 92, The scanning method determining unit 94 and the transform coefficient processing unit 96.
  • the encoding module 88 further includes a code stream generating unit 98.
  • the second determining module 86 is configured to determine a size and a scanning mode of the coefficient group of the transform block.
  • the input data of the second determining module 86 includes a data stream 900 and a data stream 901, and the output data is a data stream 903.
  • the data stream 900 is output data of the first determination module 82 (including the size and coding mode of the coding block where the transform block is located), and output data of the transform module 84 (including the size of the transform block and quantization parameters).
  • the data stream 901 is a transform coefficient in the transform block.
  • the transform coefficient of the data stream 901 is the output data of the transform module 84 in the foregoing encoder; In the case of quantization, the transform coefficient of the data stream 901 is the quantized output data in the transform module 84.
  • the data stream 902 is an internal data stream in the second determination module 86, and is a bidirectional data stream between the CG size determination unit 92 and the scanning mode determination unit 94.
  • the CG size determining unit 92 transmits the size of the coefficient group to the scanning mode determining unit 94 through the data stream 902; the scanning mode determining unit 94 transmits a parameter indicating the scanning mode to the CG size determining unit 92 through the data stream 902.
  • the data stream 903 is output data of the second determination module 86, and is a size of a coefficient group used for entropy coding the transform block and a parameter indicating a scanning mode.
  • the data stream 903 also includes flag information as to whether the size of the coefficient group used by the transform block and the parameter indicating the scanning mode need to be encoded.
  • the method for determining the size of the coefficient group described in the first embodiment of the CG size determining unit 92 determines the size of the coefficient group, and includes the value of the size of the coefficient group into the data stream 903.
  • the parameters used by the CG size determining unit 92 come from the parameters passed in the data stream 900 and the data stream 901, and the scanning mode parameters are obtained from the data stream 902 when needed.
  • the scanning mode determining unit 94 uses the method for determining a scanning mode of a transform coefficient in a transform block described in Embodiment 1, determines a scanning mode, and includes a parameter indicating the scanning mode into the data stream 903.
  • the parameters used by the scanning mode determination unit 94 are derived from parameters passed in the data stream 900 and the data stream 901, and the value of the coefficient group size obtained from the data stream 902 when needed.
  • the second determining module 86 may use the method of RDO to jointly determine the size of the coefficient group used by the transform block and the scanning method of the transform coefficients in the transform block.
  • An optional implementation method is that the second determination module 86 transmits each candidate scan mode of the scan mode determination unit 94 to the CG size determination unit 92 through the data stream 902 in order; the CG size determination unit 92 determines each candidate scan mode.
  • the size of the coefficient group of the transform block; the second determination module 86 calculates the number of encoding bits generated by encoding the transform block by using each candidate scan mode and the size of the coefficient group of the transform block; the second determination module 86 selects encoding
  • the candidate scan mode and the size of the coefficient group corresponding to the minimum number of bits include the values indicating the parameters of the scan mode and the size of the coefficient group into the data stream 903.
  • the second determining module 86 may use the method of RDO to jointly determine the size of the coefficient group used by the transform block and the scanning method of the transform coefficients in the transform block.
  • Another optional implementation method is that the second determining module 86 transmits the values of the candidate coefficient groups of the CG size determining unit 92 to the scanning mode determining unit 94 through the data stream 902 in turn; the scanning mode determining unit 94 Determine the scan mode of the transform block under the size of each candidate coefficient group; the second determination module 86 calculates the number of encoding bits generated by encoding the transform block using the size and scan mode of each candidate coefficient group; the second determination module 86 Select the size and scanning method of the candidate coefficient group corresponding to the minimum number of coded bits, and include the value indication of the size of the coefficient group and the parameters of the scanning method into the data stream 903.
  • the transform coefficient processing unit 96 performs parameterized representation of the transform parameters in the transform block.
  • the input data of the transform coefficient processing unit 96 is a data stream 901 and a data stream 903, and the output is a data stream 904.
  • the transform coefficient processing unit 96 divides the transform coefficients of the transform block in the data stream 901 into one or more coefficient groups according to the size of the coefficient group in the data stream 903. According to the parameter indicating the scanning mode in the data stream 903, the The transform coefficients are scanned and the transform coefficients are parameterized.
  • the transformation coefficient processing unit 96 sequentially processes the coefficient groups in the transformation coefficient matrix by using the scanning order indicated by the parameter indicating the scanning mode in the data stream 903.
  • the transformation coefficient processing unit 96 uses the scanning order indicated by the parameter indicating the scanning mode in the data stream 903 to sequentially process the transformation coefficients in the coefficient group.
  • the scan order of the coefficient groups by the transform coefficient processing unit 96 and the scan order of the transform coefficients in the coefficient groups may be the same or different.
  • the transform coefficient processing unit 96 records the position of the last non-zero transform coefficient, and includes data indicating the position into the data stream 904.
  • the transform coefficient processing unit 96 starts from the coefficient group containing the last non-zero transform coefficient, and sequentially determines whether the coefficients in each coefficient group are all 0 values according to the scanning order indicated by the parameter indicating the scanning mode in the data stream 903.
  • a flag bit of the transform coefficient (or indicating whether each coefficient group includes a non-zero transform coefficient), and the value of the flag bit is included in the data stream 904.
  • the transformation coefficient processing unit 96 determines the order of each transformation coefficient in the coefficient group according to the scanning order indicated by the parameter indicating the scanning mode in the data stream 903. Whether the flag value is 0, and the flag bit is included in the data stream 904.
  • the transformation coefficient processing unit 96 determines, for transformation coefficients whose value is not equal to 0, a symbol parameter used to indicate the sign of the transformation coefficient (for indicating a positive value or a negative value), converts the value of the transformation coefficient to its absolute value, and converts the symbol
  • the absolute values of the parameters and transform coefficients include the incoming data stream 904.
  • the transform coefficient processing unit 96 when the flag information in the data stream 903 indicates that the size of the coefficient group used by the transform block needs to be encoded, the transform coefficient processing unit 96 includes the size of the coefficient group in the data stream 903 into the data stream 904; When the flag information in the data stream 903 indicates that the scanning mode used by the transform block needs to be encoded, the transform coefficient processing unit 96 includes a parameter in the data stream 903 indicating the scanning mode into the data stream 904. The data stream 904 is output data of the transform coefficient processing unit 96.
  • the code stream generating unit 98 encodes a parameter representing a transform coefficient in the transform block, generates a binary coded bit, and writes the coded bit into the code stream.
  • the input data of the code stream generating unit is a data stream 904 and a data stream 905, and the output is a data stream 906.
  • the data stream 905 is one or more parameters such as the size of the coefficient group and the scanning method in the configuration parameters of the encoder.
  • the configuration parameter is used to indicate the size of the coefficient group that can be used by the transform block.
  • the configuration parameter can also be used For indicating the scanning method that can be used by the transform block.
  • the code stream generating unit 98 does not need to encode the parameters related to the size of the available coefficient groups included in the data stream 905.
  • the code stream generating unit 98 does not need to encode the parameters related to the available scanning methods included in the data stream 905.
  • the code stream generating unit 98 uses an entropy coding method to encode data in the data stream 904 and the data stream 905 to obtain binary coded bits, write the coded bits into the code stream, and obtain a data stream 906.
  • the organization manner of the fields in the bitstream is defined by a video coding standard.
  • the entropy coding methods that the code stream generating unit 98 can use include equal-length coding, unequal-length coding, arithmetic coding, and the like.
  • the data flow refers to the entry parameters and return parameters of the functions on the software implementation, the data passed on the bus on the hardware implementation, and the data shared between the storage units (including register shared data).
  • each of the above modules can be implemented by software or hardware.
  • it can be implemented by the following methods, but is not limited to the above: the above modules are all located in the same processor; The forms are located in different processors.
  • module may implement a combination of software and / or hardware for a predetermined function.
  • devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and conceived.
  • FIG. 10 is a structural block diagram of an image decoding device according to an embodiment of the present invention. As shown in FIG. 10, the device includes a decoding module 1002, a conversion module 1004, a processing module 1006, a conversion module 1008, and a calculation module 1010.
  • a decoding module 1002 is configured to analyze a code stream and determine a prediction value of the decoded block, a scan mode of a transform coefficient in the decoded block, a size of a coefficient group, and a value of a syntax element related to the transform coefficient;
  • a conversion module 1004 configured to process the coefficient group in the decoded block according to the scanning mode and the size of the coefficient group, and convert the syntax element into a transformation coefficient in the coefficient group;
  • a processing module 1006 configured to process the transformation coefficients to obtain a restored value of the transformation coefficients
  • a transform module 1008 configured to process the transform coefficients and transform the processed data one or more times to obtain a predicted difference value of the decoded block
  • a calculation module 1010 is configured to determine a recovery value of the decoded block using the prediction value and the prediction difference value.
  • FIG. 11 is a structural block diagram of another image decoding device according to an embodiment of the present invention, as shown in FIG. 11,
  • the decoding module 1002 determines the size and scanning method of the coefficient group of the transform block.
  • the input data of the decoding module 1002 includes a data stream 11000, and the output data is a data stream 11001.
  • the data stream 11000 is a code stream and is input data of a decoder.
  • the decoding module 1002 parses the data stream 11000 according to the code stream organization structure and the entropy decoding method of each field defined in the video coding standard to obtain one or more parameter set data units, one or more slice data units (including Slice header data unit and slice data data unit).
  • the decoding module 1002 parses the slice data data units to obtain block layer data units of one or more decoded blocks.
  • the parameters related to the size of the coefficient group and the scanning mode included in the data unit obtained by the decoding module 1002 include the size of the coefficient group and the scanning mode parameter used by the transform block included in the current decoding block into the data stream 11001.
  • the data stream 11001 is output data of the decoding module 1002.
  • the entropy decoding methods that can be used by the decoding module 1002 include: a method of entropy decoding of codewords generated using equal-length encoding, a method of entropy decoding of codewords generated using unequal-length encoding, and codewords generated using arithmetic coding Method for entropy coding.
  • the decoding module 1002 reads related parameters from the obtained data unit, and determines the size of the coefficient group used to decode the transform coefficients in the transform block.
  • the decoding module 1002 can obtain parameters related to the size of the usable coefficient group in the parameter set data unit, and determine candidates that can be used in the decoding process.
  • Coefficient group size can be obtained according to the field data contained in each data unit in the data stream 11000.
  • the decoding module 1002 can obtain parameters related to the size of the usable coefficient group in the slice header information data unit, and determine the available parameters in the decoding process. The size of the candidate coefficient group.
  • the decoding module 1002 can obtain the parameter related to the size of the coefficient group from the slice header information data unit, and correspondingly cover the parameter obtained from the parameter set data unit as a parameter that can be used in decoding the slice The parameter used for the size of the coefficient group.
  • the decoding module 1002 uses parameters in the block-level data unit to determine the size of the coefficient group used by the transform block in the decoded block.
  • the decoding module 1002 includes the size of the coefficient group into the incoming data stream 11001.
  • the decoding module 1002 reads related parameters from the obtained data unit, and determines a scanning mode for decoding the transform coefficients in the transform block.
  • the decoding module 1002 can obtain parameters related to the available scanning modes in the parameter set data unit, and determine the scanning modes available in the decoding process.
  • the available scanning method obtained by the decoding module 1002 in the parameter set data unit may be a fixed path scanning method, that is, the scanning method of the scanning path has been set in the decoder in advance.
  • the available scanning method obtained by the decoding module 1002 in the parameter set data unit may be a scanning method of a non-fixed path, that is, the scanning path written in the parameter set data unit code stream in the foregoing embodiment 3.
  • the decoding module 1002 obtains parameters related to the scanning mode in the parameter set data unit.
  • the parameter conversion describes the coordinate correspondence between the transformation coefficients before and after scanning, for example, the coordinate position in the transformation block is equal to (m, n).
  • the scan coefficient corresponding to the transform coefficient (or the index number is equal to m ⁇ nTbS + n, where nTbS is the width of the transform block) is equal to k.
  • the decoding module 1002 can obtain parameters related to the available scanning methods in the slice header information data unit, and determine the candidate scans that can be used in the decoding process.
  • the decoding module 1002 may obtain the scanning mode-related parameters obtained from the slice header information data unit, and correspondingly cover the parameters obtained from the parameter set data unit as a scanning mode that can be used in decoding the slice.
  • the decoding module 1002 uses parameters in the block layer data unit to determine the scanning method used for the transform block in the decoded block.
  • the decoding module 1002 enters the scan mode parameters that can be used in the decoding process into the data stream 11001.
  • the decoding module 1002 does not need to analyze the code stream, but obtains the usable coefficients by reading the information stored in the decoder in advance.
  • the number and value of group sizes In particular, if the scanning method available on the decoder is fixed, the decoding module 1002 does not need to parse the code stream, but obtains the available scanning method by reading information stored in the decoder in advance.
  • the decoding module 1002 parses the data unit corresponding to the transform block in the bitstream. In addition to the size of the coefficient group and the scanning method, it also obtains parameters related to the transform coefficient, including parameters indicating one or more of the following information: the last non- The position of 0 coefficients, whether the transformation coefficients contained in the coefficient group are all 0 (or equivalent to whether the coefficient group contains non-zero transformation coefficients), the value of the transformation coefficient (or the sign of the transformation coefficient, and the absolute value of the transformation coefficient) . The decoding module 1002 also includes the above parameters into the data stream 11001.
  • the processing module 1006 determines a restored value of the transform coefficients in the transform block.
  • the input data of the transform coefficient recovery unit is a data stream 11001, and the output is a data stream 11002.
  • the data stream 11002 contains the transform coefficients of the transform blocks in the decoded block.
  • the transformation coefficients can be expressed in the form of a two-dimensional matrix of Mx, where M and N are positive integers, M and N can be equal, and M and N can be unequal.
  • the two-dimensional matrix may correspond to one transform block.
  • a “transform block” is used to refer to the transform coefficients expressed in the form of a two-dimensional matrix.
  • the processing module 1006 outputs the transform coefficient included in the data stream 11002.
  • the recovery value corresponds to the quantization value (ie, the "Level" value) of the coefficient output by the quantization unit 209 in the foregoing encoder.
  • the decoder uses the data stream 11002 as the input data of the inverse quantization unit 305; otherwise, when the decoding module 1002 parses the code stream In the case where the obtaining instruction information indicates that the scaling block is not scaled, the processing module 1006 outputs the transformation coefficient recovery value contained in the output data stream 11002 corresponding to the prediction difference output by the transformation unit 84 in the foregoing encoder for transformation After the obtained data, the decoder uses the data stream 11002 as the input data of the inverse transform unit 306.
  • the processing module 1006 determines the position of each coefficient group included in the transformation block according to the size of the transformation block and the size of the coefficient group.
  • the position of the coefficient group may be expressed as a position coordinate of an upper-left coefficient in the coefficient group in a transform block (or a decoded image).
  • the processing module 1006 sequentially processes the coefficient groups according to the order indicated by the scanning mode in the data stream 11001. For a coefficient group, the processing module 1006 sets the value of the corresponding element in the coefficient group to the value of the transformation coefficient obtained by analyzing the code stream according to the order indicated by the scanning mode.
  • the parsing unit includes the coefficient group The coefficients are all set to 0.
  • the processing module 1006 when the processing module 1006 obtains the last non-zero coefficient position from the data stream 11001, according to the scanning order, the processing module 1006 sets the values of other coefficients after the last non-zero coefficient position to 0.
  • the processing order of the processing module 1006 for the coefficient groups in the transform block and the processing order for the coefficients in the coefficient group may be the same or different.
  • the processing module 1006 includes the restored transform block (that is, a transform coefficient expressed in a two-dimensional matrix form (or other data form equivalent to the two-dimensional matrix)) into the data stream 11002.
  • the data flow refers to the entry parameters and return parameters of the functions on the software implementation, the data passed on the bus on the hardware implementation, and the data shared between the storage units (including register shared data).
  • each of the above modules can be implemented by software or hardware.
  • it can be implemented by the following methods, but is not limited to the above: the above modules are all located in the same processor; The forms are located in different processors.
  • FIG. 12 is a diagram of an electronic device including an encoding device for the image shown above. As shown in FIG. 12, the device includes: an acquisition unit 1202, an image encoding device 1204, and a storage or transmission unit 1206.
  • the acquisition unit 1202 acquires a video or an image.
  • the acquisition unit 1202 may include at least one camera for capturing natural video or natural images; optionally, the acquisition unit 1202 may also be configured with a camera for acquiring depth video or depth images; alternatively, the acquisition unit may be configured with an infrared camera ; Optionally, the acquisition unit can also be equipped with a remote sensing camera.
  • the acquisition unit 1202 may be a device or a device including a video or an image generated by radiation transmission or scanning.
  • the input unit 1202 may perform pre-processing on the input video or image, for example, auto focus, auto white balance, auto exposure, backlight compensation, noise reduction, sharpening, stitching, increase or decrease image resolution, increase or Reduce video frame rate, virtual view composition, etc.
  • the acquisition unit 1202 may also receive video or images output by other devices or units.
  • the acquisition unit 1202 may be a constituent unit in a transcoder, and the transcoder inputs part of the decoded image to the acquisition unit 1202.
  • the acquisition unit 1202 receives a video or an image transmitted from another device through a data connection.
  • the collecting unit 1202 may also collect other media information, such as audio.
  • the collection unit 1202 may also receive artificially generated information, such as text, subtitles, computer-generated pictures or videos, and the like.
  • the image encoding device 1204 is an encoder shown in FIG. 2.
  • the input of the image encoding device 1204 is a video or an image output by the acquisition unit 1202.
  • the image encoding device 1204 encodes a video or an image, and outputs a video or image code stream.
  • the storage or sending unit 1206 receives the video or image code stream output by the image encoding device 1204, and performs system layer processing on the video or image code stream, for example, encapsulation according to standards such as a transmission protocol and a media file format.
  • the storage or sending unit 1206 stores the obtained transport stream or media file processed by the system layer into the memory of the electronic device, or sends it through a wired or wireless network.
  • the input of the storage or sending unit 1206 may also include an audio code stream, text, subtitles, pictures, and the like.
  • the storage or sending unit 1206 packs the code streams output by the input and image encoding device 1204 into a transport stream or a media file according to standards such as a media file format and a transmission protocol.
  • the electronic device described in this embodiment may be a device capable of generating or processing a video or image stream in a video communication application, for example, a mobile phone, a computer, a media server, a portable mobile terminal, a digital video camera, a digital camera, a television broadcasting system device, Content distribution network equipment, surveillance cameras, conference television system equipment, etc.
  • FIG. 13 is a diagram of an electronic device including a decoding device for the image shown above. As shown in Figure 13, it includes:
  • the receiving unit 1302 receives a video or image code stream.
  • the receiving unit 1302 receives a video or image code stream from a wired or wireless network, or reads the memory of the electronic device to obtain a video or image code stream, or receives a video or image code stream transmitted from another device through a data connection.
  • the input of the receiving unit 1302 may also be a transport stream or a media file containing a video or image code stream.
  • the receiving unit 1302 extracts a video or image code stream from the received transport stream or media file according to standards such as a transmission protocol and a media file format.
  • the receiving unit 1302 outputs a video or image code stream to an image decoding device 1304.
  • the output of the receiving unit 1302 may also include an audio code stream, text, subtitles, and pictures.
  • the receiving unit 1302 passes these outputs to a corresponding processing unit in the electronic device.
  • the receiving unit 1302 outputs an audio code stream to an audio decoder included in the electronic device.
  • the image decoding device 1304 is a decoder shown in FIG. 3.
  • the input of the image decoding device 1304 is a video or image code stream output by the receiving unit 1302.
  • the image decoding device 1304 decodes the video or image code stream, and outputs the decoded recovered video or image.
  • the rendering unit 1306 receives the decoded recovered video or image output by the decoding device 1304 that receives the image.
  • the presentation unit 1306 presents the decoded recovered video or image to a viewer.
  • the presentation unit 1306 may be an integral part of the electronic device, such as a display screen; it may also be an independent device connected to the electronic device through a data connection, such as a projector, a display, and the like.
  • the rendering unit 1306 may perform post-processing on the decoded recovered video or image, such as auto focus, auto white balance, auto exposure adjustment, backlight compensation, noise reduction, sharpening, stitching, increase or decrease image resolution, Increase or decrease video frame rate, virtual view composition, etc.
  • the input of the presentation unit 1306 may also include media data output from other units of the electronic device, such as audio, text, subtitles, pictures, and so on.
  • the input of the presentation unit 1306 also includes artificially generated data, such as marked data such as the underline of the local lecturer on key content in the distance education application.
  • the presentation unit 1306 superimposes the input media data and displays it to the viewer.
  • the electronic device described in this embodiment may be a device capable of decoding or processing a video or image stream in a video communication application, for example, a mobile phone, a computer, a set-top box, a television, a player, a media server, a portable mobile terminal, a digital video camera, Digital cameras, television broadcasting system equipment, content distribution network equipment, conference television system equipment, etc.
  • FIG. 14 is an electronic system including the electronic device shown above. As shown in Figure 14,
  • the source device 1402 is an electronic device shown in FIG. 12.
  • the storage or transmission network 1404 may include a memory of a device or an electronic system, an external storage for reading and writing data through a data connection, and may also include a data transmission network composed of a wired network and a wireless network.
  • the storage or transmission network 1404 provides a storage or data transmission network for the storage or transmission unit 803 in the source device 1402.
  • the sink device 1406 is an electronic device shown in FIG. 13.
  • the receiving unit 901 in the sink device 1406 receives the video or image code stream provided by the storage or transmission network 1404, the transport stream containing the video or image code stream, or the media file containing the video or image code stream.
  • the electronic system described in this embodiment may be a system or device capable of generating, storing, or transmitting and decoding a video or image stream in a video communication application, such as a mobile phone, a computer, an IPTV system, an OTT system, an Internet multimedia system, and a digital television Broadcasting systems, surveillance systems, portable mobile terminals, digital video cameras, digital cameras, conference television system equipment, etc.
  • a video communication application such as a mobile phone, a computer, an IPTV system, an OTT system, an Internet multimedia system, and a digital television Broadcasting systems, surveillance systems, portable mobile terminals, digital video cameras, digital cameras, conference television system equipment, etc.
  • An embodiment of the present invention further provides a storage medium.
  • the storage medium stores a computer program, where the computer program is configured to execute the steps in any one of the foregoing method embodiments when running.
  • the foregoing storage medium may include, but is not limited to, a U disk, a read-only memory (ROM), a random access memory (Random Access Memory, RAM), A variety of media that can store computer programs, such as removable hard disks, magnetic disks, or optical disks.
  • ROM read-only memory
  • RAM Random Access Memory
  • modules or steps of the present application may be implemented by a general-purpose computing device, and they may be concentrated on a single computing device or distributed on a network composed of multiple computing devices.
  • they may be implemented with program code executable by a computing device, so that they may be stored in a storage device and executed by the computing device, and in some cases, may be in a different order than here
  • the steps shown or described are performed, or they are separately made into individual integrated circuit modules, or multiple modules or steps in them are made into a single integrated circuit module for implementation.
  • this application is not limited to any particular combination of hardware and software.

Landscapes

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

Abstract

本申请提供了一种图像的编码、解码方法及装置、电子设备及系统。其中,图像的编码方法包括:确定编码块的预测值,计算所述编码块与所述预测值的预测差值;对所述预测差值进行至少一次的变换,得到变换数据,使用所述变换数据确定变换系数;确定所述变换系数的扫描方式和系数组的大小,将所述变换系数划分成至少一个系数组,根据所述扫描方式扫描每个所述系数组中包含的变换系数,将所述变换系数转换为至少一个语法元素;对所述系数组的大小和所述语法元素的取值进行编码,将编码比特写入码流。

Description

图像的编码、解码方法及装置、电子设备及系统
本公开要求在2018年06月27日提交中国专利局、申请号为201810681664.7的中国专利申请的优先权,该申请的全部内容通过引用结合在本公开中。
技术领域
本申请涉及通信领域,具体而言,涉及一种图像的编码、解码方法及装置、电子设备及系统。
背景技术
数字视频(Video)和图像(Picture)的压缩编码技术利用视频和图像中像素点采样值之间的相关性来去除视频和图像中存在的冗余。图像压缩利用图像中相邻像素点(Pixel)样值(Sample)之间的空间域相关性,通过使用相邻已编码像素点预测待编码像素点的方法,降低了空间域相邻像素点之间的冗余。这类方法通常称为帧内预测(Intra Prediction)。数字视频由一系列连续图像组成。数字视频压缩除利用单帧图像中空间域相邻像素点之间相关性外,还利用了时域相邻图像之间的相关性,例如,使用运动估计(Motion Estimation)和运动补偿(Motion Compensation)的方法,使用已编码图像作为参考对当前编码图像进行预测。这类方法通常称为帧间预测(Inter Prediction)。
在编码过程中,编码器使用帧内预测、帧间预测的方法,确定编码块的预测值,计算所述编码块样值与所述预测值之间的差值,将其作为所述编码块的预测差值(Residual)。为进一步降低预测差值中存在的空间域冗余,编码器可以对预测差进行变换(Transformation)。通常,所述编码块的预测差可以表示为一个M x N的二维矩阵,其中,M和N均为正整数,M和N可以相等,也可以不相等。编码器对该二维矩阵进行变换,并对变换后得到的二维矩阵中的数据进行处理,得到待进行熵编码的变换系数(Coefficient),例如,H.265/HEVC标准中,所述处理可以是对所述数据进行量化(Quantization),也可以是不对所述数据进行量化。编码器对二维矩阵表示的变换系数进行扫描,对变换系数进行编码。在H.265/HEVC标准中,编码器变换系数的二维矩阵分割成一个或多个4x4固定大小的系数组(Coefficient Group,CG)。编码器使用指定的扫描顺序,依次对4x4块中的变换系数进行编码。这种方法存在如下主要缺陷是采用了固定大小的系数组,致使编码器无法根据二维矩阵中变换系数的分布情况选择最有效的编码系数编码方式,例如,系数组的大小固定为4x4块时,按照系数扫描顺序(实际上是逆序),从包含最后一个非0系数的系数组开始,需 要为每个系数组编码一个用于表示该系数组中是否包含非0变换系数的标志位,这样,当变换系数矩阵中存在数量较多的非0系数时,该标志位的编码开销较大。
发明内容
本发明实施例提供了一种图像的编码、解码方法及装置、电子设备及系统,以至少解决相关技术中固定大小的系数组,致使编码器无法根据二维矩阵中变换系数的分布情况选择最有效的编码系数编码方式的问题。
根据本申请的一个实施例,提供了一种图像编码方法,包括:确定编码块的预测值,计算所述编码块与所述预测值的预测差值;对所述预测差值进行一次或者多次的变换,得到变换数据,使用所述变换数据确定变换系数;确定所述变换系数的扫描方式和系数组的大小,将所述变换系数划分成一个或多个系数组,根据所述扫描方式扫描每个所述系数组中包含的变换系数,将所述变换系数转换为一个或多个语法元素;对所述系数组的大小和所述语法元素的取值进行编码,将编码比特写入码流。
可选地,确定所述编码块的预测值,包括以下方法的至少之一:将一个或者多个已编码的图像作为参考图像,确定编码块的预测值;或,将所述编码块所在的图像中的已编码部分作为参考,确定所述编码块的预测值。
可选地,使用所述变换数据确定变换系数,包括:当判断对所述变换数据进行量化时,对所述变换数据进行量化处理,得到所述变换系数;当判断不对所述变换数据进行量化时,使用所述变换数据设置所述变换系数。
可选地,确定所述变换系数的系数组的大小,包括:根据预设的候选值确定所述变换系数的系数组的大小。
可选地,根据预设的所述候选值确定所述变换系数的系数组的大小,包括:使用率失真优化的方法,从所述候选值中确定所述变换系数的系数组的大小。
可选地,计算使用所述候选值中的数值作为系数组的大小时所述变换系数的编码比特数,选择可使得所述编码比特数最小的所述候选值中的数值作为所述变换系数的系数组的大小。
可选地,根据预设的所述候选值确定所述变换系数的系数组的大小,包括:根据所述变换系数的分布情况确定所述变换系数的系数组的大小。
可选地,所述变换系数的分布情况是对所述变换系数进行扫描后检测所述变换系数中非0系数的集中程度,其中,所述非0系数的集中程度指的是所述变换系数的非0系数之间0值系数的数量,所述0值系数的数量越小表示非0 系数的集中程度越高;从所述候选值中选择可使得所述集中程度最高的所述候选值中的数值作为所述变换系数的系数组的大小。
可选地,所述候选值包括至少之一:一个或多个固定数值;配置的一个或多个数值;所述编码块相邻已编码块使用的系数组的大小的取值。
可选地,所述系数组的大小的预设的候选值是所述配置的一个或多个数值时,所述方法还包括:将所述候选值标识参数写入所述码流的一个或多个数据单元中,其中,所述标识参数用于指示所述配置的所述候选值;所述码流中的数据单元包含以下至少之一:一个或多个参数集,分片头,块层数据单元。
可选地,所述系数组的大小的预设的候选值的标识参数,包括以下至少之一:系数组的大小,系数组的边长,系数组的宽度和高度。
可选地,使用以下一种或多种方法,将所述标识参数写入所述码流,包括:将所述标识参数的最大值和最小值写入所述码流;将所述标识参数的最大值和所述系数组的最大划分层次写入所述码流;将所述标识参数的最大值和所述系数组的大小的最大值与最小值之间的差值写入所述码流;将所述标识参数的最小值和所述系数组的最大向上划分层次写入所述码流;将所述标识参数的最小值和所述系数组的大小的最大值与最小值之间的差值写入所述码流。
可选地,使用以下一种或多种方法将所述标识参数写入所述码流,还包括:将所述标识参数的默认值写入所述码流。
可选地,所述系数组的大小的预设的候选值的标识参数,包括:所述标识参数是一个或多个标志位,指示对应的系数组的大小是否是所述候选值中包含的系数组的大小。
可选地,所述系数组的大小的预设的候选值的标识参数,包括:所述标识参数指示预设的一个或多个预测模式对应的一个或多个系数组的大小。
可选地,所述系数组的大小的预设的候选值的标识参数,包括:所述标识参数指示预设的一次或多次变换对应的一个或多个系数组的大小。
可选地,所述系数组的大小的预设的候选值的标识参数,包括:所述标识参数指示预设的一个或多个变换类型对应的一个或多个系数组的大小。
可选地,所述系数组的大小的预设的候选值的标识参数,包括:所述标识参数指示预设的一个或多个量化参数对应的一个或多个系数组的大小;或者,所述标识参数指示预设的一个或多个量化参数取值范围对应的一个或多个系数组的大小。
可选地,所述系数组的大小的预设的候选值的标识参数,包括:所述标识 参数指示预设的档次/等级/级别Profile/Tier/Level对应的一个或多个系数组的大小。
可选地,所述确定所述变换系数的系数组的大小,包括:根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,其中,所述第一编码参数至少包括以下其中之一:所述编码块中包含的变换块的大小、所述编码块的预测模式、所述编码块中包含的变换块使用的变换类型、量化参数。
可选地,根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,包括:当所述编码块中包含的变换块的大小等于第一预设值时,将所述系数组的大小设置为所述第一预设值对应的系数组的大小。
可选地,根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,包括:当所述编码块的预测模式等于第一预设模式时,将所述系数组的大小设置为所述第一预设模式对应的系数组的大小。
可选地,根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,包括:当所述编码块中包含的变换块使用的变换类型等于第一变换类型时,将所述系数组的大小设置为所述第一变换类型对应的系数组的大小。
可选地,根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,包括:当所述量化参数的取值等于第二预设值时,将所述系数组的大小设置为所述第二预设值对应的系数组的大小;或者,当所述量化参数的取值在第一预设取值范围内时,将所述系数组的大小设置为所述第一预设取值范围对应的系数组的大小。
可选地,所述确定所述变换系数的扫描方式,包括:根据预设的候选扫描方式为所述变换系数确定扫描方式,其中,所述扫描方式为对所述变换系数的二维矩阵中元素的处理顺序。
可选地,根据预设的候选扫描方式为所述变换系数确定扫描方式,包括:使用率失真优化的方法,从所述候选扫描方式中确定所述变换系数的扫描方式。
可选地,计算使用所述候选扫描方式中的扫描方式时所述变换系数的编码比特数,选择可使得所述编码比特数最小的所述候选扫描方式中的扫描方式作为所述变换系数的扫描方式。
可选地,根据预设的候选扫描方式为所述变换系数确定扫描方式,包括: 根据所述变换系数的分布情况确定所述变换系数的扫描方式。
可选地,所述变换系数的分布情况是对所述变换系数进行扫描后检测所述变换系数中非0系数的集中程度,其中,所述非0系数的集中程度指的是所述变换系数的非0系数之间0值系数的数量,所述0值系数的数量越小表示非0系数的集中程度越高;从所述候选扫描方式中选择可使得所述集中程度最高的所述候选值中的扫描方式作为所述变换系数的扫描方式。
可选地,所述候选扫描方式包括至少之一:一个或多个固定扫描方式;配置的一个或多个扫描方式;所述编码块相邻已编码块使用的扫描方式。
可选地,所述候选扫描方式是所述配置的一个或多个扫描方式时,所述方法还包括:将所述候选扫描方式参数写入所述码流的一个或多个数据单元中,其中,所述候选扫描方式参数用于指示所述配置的所述候选扫描方式;所述码流中的数据单元包含以下至少之一:一个或多个参数集,分片头,块层数据单元。
可选地,所述候选扫描方式参数,还包括:所述变换系数的二维矩阵中元素的处理顺序。
可选地,所述候选扫描方式参数,还包括:所述扫描方式参数的默认值。
可选地,所述候选扫描方式参数,包括:所述候选扫描方式参数是一个或多个标志位,指示对应的扫描方式是否包含在所述候选扫描方式中。
可选地,所述候选扫描方式参数,包括:所述候选扫描方式参数指示预设的一个或多个预测模式对应的一个或多个扫描方式。
可选地,所述候选扫描方式参数,包括:所述候选扫描方式参数指示预设的一次或多次变换对应的一个或多个扫描方式。
可选地,所述候选扫描方式参数,包括:所述候选扫描方式参数指示预设的一个或多个变换类型对应的一个或多个扫描方式。
可选地,所述候选扫描方式参数,包括:所述候选扫描方式参数指示预设的一个或多个量化参数对应的一个或多个扫描方式;或者,所述候选扫描方式参数指示预设的一个或多个量化参数取值范围对应的一个或多个扫描方式。
可选地,所述候选扫描方式参数,包括:所述候选扫描方式参数指示预设的Profile/Tier/Level对应的一个或多个扫描方式。
可选地,所述确定所述变换系数的扫描方式,包括:根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式;其中,所述第二编码参数至少包括以下其中之一: 所述编码块中包含的变换块的大小、所述编码块的预测模式、所述编码块中包含的变换块使用的变换类型、所述编码块的大小;所述扫描方式为对所述变换系数的二维矩阵中元素的处理顺序。
可选地,根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式,包括:当所述编码块中包含的变换块的大小等于第三预设值时,将所述变换系数的扫描方式设置为所述第三预设值对应的扫描方式。
可选地,根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式,包括:当所述编码块的预测模式等于第二预设模式时,将所述变换系数的扫描方式设置为所述第二预设模式对应的扫描方式。
可选地,根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式,包括:当所述编码块中包含的变换块使用的变换类型等于第二变换类型时,将所述变换系数的扫描方式设置为所述第二变换类型对应的扫描方式。
可选地,根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式,包括:当所述编码块的大小等于第四预设值时,将所述变换系数的扫描方式设置为所述第四预设值对应的扫描方式。
可选地,所述确定所述变换系数的扫描方式和系数组的大小,包括:使用率失真优化的方法,联合确定所述变换系数的系数组的大小和扫描方式。
可选地,所述将所述变换系数转换为一个或多个语法元素,包括:根据所述系数组的大小和扫描方式,将所述变换系数划分成一个或多个系数组,根据所述扫描方式扫描所述系数组中包含的变换系数,将所述变换系数表示为以下语法元素的至少之一:指示非0系数起始位置的语法元素;指示系数组中包含非0系数的语法元素;指示系数组中非0系数位置的语法元素;指示系数组中非0系数取值的语法元素。
可选地,所述对所述系数组的大小和所述语法元素的取值进行编码,将编码比特写入码流,包括:将所述变换系数使用的系数组的大小使用以下之一的方法进行编码:编码所述系数组的大小;编码所述系数组的大小对应的索引序号的取值;设置所述系数组的大小对应的标志位,编码所述标志位的取值。
可选地,所述对所述系数组的大小和所述语法元素的取值进行编码,将编码比特写入码流,包括:将编码比特写入码流中的数据单元,所述码流中的数 据单元包含以下至少之一:一个或多个参数集,分片头,块层数据单元。
根据本申请的另一个实施例,提供了一种图像的解码方法,包括:解析码流,确定解码块的预测值;解析所述码流,确定所述解码块中变换系数的扫描方式、系数组的大小和变换系数相关的语法元素的取值;根据所述扫描方式和所述系数组的大小,对所述解码块中的系数组进行处理,将所述语法元素转换为所述系数组中的变换系数;对所述变换系数进行处理,得到变换系数的恢复值;对所述变换系数的恢复值进行一次或多次变换,得到所述解码块的预测差值;使用所述预测值和所述预测差确定所述解码块的恢复值。
可选地,解析所述码流,确定所述解码块的预测值,包括以下方法的至少之一:解析所述码流,获取所述解码块的帧间预测参数;根据所述帧间预测参数,将一个或者多个已解码的图像作为参考图像,确定所述解码块的预测值。或,解析所述码流,获取所述解码块的帧内预测参数;根据所述帧内预测参数,将所述解码块所在的图像中的已解码部分作为参考,确定所述解码块的预测值。
可选地,解析所述码流,确定所述解码块中变换系数的系数组的大小,包括:解析所述码流,从所述码流中的数据单元获取第一系数组参数,根据所述第一系数组参数确定所述系数组的大小;其中,所述码流中的数据单元包含以下至少之一:一个或多个参数集,分片头,块层数据单元。
可选地,根据所述第一系数组参数确定所述系数组的大小,包括:使用所述第一系数组参数设置所述系数组的大小。
可选地,根据所述第一系数组参数确定所述系数组的大小,包括:所述第一系数组参数指示了所述解码块的相邻已解码块,使用所述相邻已解码块的系数组的大小设置所述系数组的大小。
可选地,根据所述第一系数组参数确定所述系数组的大小,包括:根据所述第一系数组参数从系数组的大小的候选值中确定所述解码块的变换系数的系数组的大小。
可选地,所述第一系数组参数包含索引序号,使用所述索引序号在所述候选值中对应的系数组的大小设置所述系数组的大小。
可选地,所述第一系数组参数包含标志位,使用所述标志位在所述候选值中对应的系数组的大小设置所述系数组的大小。
可选地,所述系数组的大小的候选值是一个或多个固定数值。
可选地,所述第一系数组参数中包含标识参数,使用所述标识参数配置所述系数组的大小的候选值。
可选地,所述标识参数包括以下至少之一:系数组的大小,系数组的边长,系数组的宽度和高度。
可选地,使用以下一种或多种方法,使用所述标识参数配置所述系数组的大小的候选值,包括:获得所述标识参数的最大值和最小值,按照预设的划分方式确定所述标识参数除所述最大值和最小值之外的取值,使用所述标识参数的取值设置所述候选值;获得所述标识参数的最大值和所述系数组的最大划分层次,按照所述预设的划分方式确定所述标识参数的最大值之外的取值,使用所述标识参数的取值设置所述候选值;获得所述标识参数的最大值和所述系数组的大小的最大值与最小值之间的差值,按照所述预设的划分方式确定所述标识参数的最大值之外的取值,使用所述标识参数的取值设置所述候选值;获得所述标识参数的最小值和所述系数组的最大向上划分层次,按照所述预设的划分方式确定所述标识参数的最小值之外的取值,使用所述标识参数的取值设置所述候选值;获得所述标识参数的最小值和所述系数组的大小的最大值与最小值之间的差值,按照所述预设的划分方式确定所述标识参数的最小值之外的取值,使用所述标识参数的取值设置所述候选值。
可选地,所述预设的划分方式包括以下至少之一:四分式划分,三分式划分,二分式划分。
可选地,使用所述标识参数配置所述系数组的大小的候选值,包括:使用所述标识参数的默认值设置所述候选值。
可选地,使用所述标识参数配置所述系数组的大小的候选值,包括:所述标识参数是一个或多个指示对应的系数组的大小是否包含在所述候选值中的标志位,根据所述标识参数设置所述候选值中包含的系数组的大小。
可选地,使用所述标识参数配置所述系数组的大小的候选值,包括:所述标识参数指示预设的Profile/Tier/Level对应的一个或多个系数组的大小,根据所述标识参数设置所述候选值中包含的系数组的大小。
可选地,根据所述第一系数组参数确定所述系数组的大小,包括:所述第一参数组参数中包含所述解码块的第一解码参数,根据所述解码块的第一解码参数,将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,其中,所述第一解码参数至少包括以下其中之一:所述解码块中包含的变换块的大小、所述解码块的预测模式、所述解码块中包含的变换块使用的变换类型、量化参数。
可选地,所述将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,包括:当所述解码块中包含的变换块的大小等于第一预设值时,将所 述系数组的大小设置为所述第一预设值对应的系数组的大小。
可选地,根据所述第一参数组参数,获得与所述第一预设值相对应的系数组的大小。
可选地,所述将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,包括:当所述解码块的预测模式等于第一预设模式时,将所述系数组的大小设置为所述第一预设模式对应的系数组的大小。
可选地,根据所述第一参数组参数,获得与所述第一预设模式相对应的系数组的大小。
可选地,所述将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,包括:当所述解码块中包含的变换块使用的变换类型等于第一变换类型时,将所述系数组的大小设置为所述第一变换类型对应的系数组的大小。
可选地,根据所述第一参数组参数,获得与所述第一变换类型相对应的系数组的大小。
可选地,所述将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,包括:当所述量化参数的取值等于第二预设值时,将所述系数组的大小设置为所述第二预设值对应的系数组的大小;或者,当所述量化参数的取值在第一预设取值范围内时,将所述系数组的大小设置为所述第一预设取值范围对应的系数组的大小。
可选地,根据所述第一参数组参数,获得与所述第二预设值相对应的系数组的大小。或者,根据所述第一参数组参数,获得与所述第一预设取值范围相对应的系数组的大小。
可选地,所述对所述码流进行解析,确定所述变换系数的扫描方式,包括:解析所述码流中的数据单元获取第一扫描方式参数,根据所述第一扫描方式参数确定所述变换系数的扫描方式;其中,所述扫描方式为对所述变换系数的二维矩阵中元素的处理顺序;所述码流中的数据单元包含以下至少之一:一个或多个参数集,分片头,块层数据单元。
可选地,解析所述码流中的数据单元获取第一扫描方式参数,根据所述第一扫描方式参数确定所述变换系数的扫描方式,包括:使用所述第一扫描方式参数指示的扫描方式作为所述变换系数的扫描方式。
可选地,使用所述第一扫描方式参数指示的扫描方式作为所述变换系数的扫描方式,包括:所述第一扫描方式参数指示了所述解码块的相邻已解码块,使用所述相邻已解码块的扫描方式设置所述变换系数的扫描方式。
可选地,使用所述第一扫描方式参数指示的扫描方式作为所述变换系数的扫描方式,还包括:根据所述第一扫描方式参数从候选扫描方式中确定所述变换系数的扫描方式。
可选地,所述第一扫描方式参数包含扫描方式索引序号,使用所述扫描方式索引序号在所述候选扫描方式中对应的扫描方式设置所述变换系数的扫描方式。
可选地,还包括:所述第一扫描方式参数包含扫描方式指示标志位,使用所述扫描方式指示标志位在所述候选扫描方式中对应的扫描方式设置所述变换系数的扫描方式。
可选地,所述候选扫描方式包括至少之一:一个或多个固定扫描方式;使用所述第一扫描方式参数配置所述候选扫描方式。
可选地,使用所述第一扫描方式参数配置所述候选扫描方式,包括:所述第一扫描方式参数包含默认扫描方式,使用所述默认扫描方式设置所述候选扫描方式。
可选地,使用所述第一扫描方式参数配置所述候选扫描方式,包括:所述第一候选扫描方式参数包含一个或多个候选扫描方式指示标志位,使用所述候选扫描方式指示标志位对应的扫描方式设置所述候选扫描方式。
可选地,使用所述第一扫描方式参数配置所述候选扫描方式,包括:使用所述第一扫描方式参数指示预设的Profile/Tier/Level对应的一个或多个扫描方式设置所述候选扫描方式。
可选地,使用所述第一扫描方式参数配置所述候选扫描方式,包括:使用所述第一扫描方式参数指示的所述变换系数的位置与扫描后的变换系数的位置之间的对应关系设置所述候选扫描方式。
可选地,解析所述码流中的数据单元获取第一扫描方式参数,根据所述第一扫描方式参数确定所述变换系数的扫描方式;包括:所述第一扫描方式参数包含所述解码块的第二解码参数;根据所述第二解码参数,确定所述变换系数的扫描方式,其中所述第二解码参数至少包括以下其中之一:所述解码块中包含的变换块的大小、所述解码块的预测模式、所述解码块中包含的变换块使用的变换类型、所述解码块的大小。
可选地,根据所述第二解码参数,将所述变换系数的扫描方式设置为所述第二解码参数对应的扫描方式,包括:当所述解码块中包含的变换块的大小等于第三预设值时,将所述变换系数的扫描方式设置为所述第三预设值对应的扫描方式。
可选地,根据所述第一参数组参数,获得与所述第三预设值相对应的扫描方式。
可选地,根据所述第二解码参数,将所述变换系数的扫描方式设置为所述第二解码参数对应的扫描方式,包括:当所述解码块的预测模式等于第二预设模式时,将所述变换系数的扫描方式设置为所述第二预设模式对应的扫描方式。
可选地,根据所述第一参数组参数,获得与所述第二预设模式相对应的扫描方式。
可选地,根据所述第二解码参数,将所述变换系数的扫描方式设置为所述第二解码参数对应的扫描方式,包括:当所述解码块中包含的变换块使用的变换类型等于第二变换类型时,将所述变换系数的扫描方式设置为所述第二变换类型对应的扫描方式。
可选地,根据所述第一参数组参数,获得与所述第二变换类型相对应的扫描方式。
可选地,根据所述第二解码参数,将所述变换系数的扫描方式设置为所述第二解码参数对应的扫描方式,包括:当所述解码块的大小等于第四预设值时,将所述变换系数的扫描方式设置为所述第四预设值对应的扫描方式。
可选地,根据所述第一参数组参数,获得与第四预设值相对应的扫描方式。
可选地,解析所述码流,确定变换系数相关的语法元素的取值,包括:所述语法元素包括以下至少之一:指示非0系数起始位置的语法元素;指示系数组中包含非0系数的语法元素;指示系数组中非0系数位置的语法元素;指示系数组中非0系数取值的语法元素。
可选地,所述对所述变换系数进行处理,得到变换系数的恢复值,包括:当判断对所述变换系数进行伸缩Scaling处理时,对所述变换数据进行伸缩处理,得到所述变换系数的恢复值;当判断不对所述变换数据进行伸缩处理时,使用所述变换系数设置所述变换系数的恢复值。
可选地,所述对所述变换系数进行处理之前,所述方法还包括:解析所述码流,获取用于构造所述解码块的预测差值的恢复值的第三参数;根据所述第三参数,判断是否对所述变换系数进行伸缩处理。
可选地,使用所述预测值和所述预测差值确定所述解码块的恢复值,所述方法还包括:对所述预测值和所述预测差值的和值进行环路滤波处理。
根据本发明的另一个实施例,提供了一种图像的编码装置,包括:第一确定模块,用于确定编码块的预测值,计算所述编码块与所述预测值的预测差值; 变换模块,用于对所述预测差值进行一次或者多次的变换,得到变换数据,使用所述变换数据确定变换系数;第二确定模块,用于确定所述变换系数的扫描方式和系数组的大小,将所述变换系数划分成一个或多个系数组,根据所述扫描方式扫描每个所述系数组中包含的变换系数,将所述变换系数转换为一个或多个语法元素;编码模块,用于对所述系数组的大小和所述语法元素的取值进行编码,将编码后的比特写入码流。
根据本申请的另一个实施例,提供了一种图像的解码装置,包括:解码模块,用于对码流进行解析,确定所述解码块的预测值,所述解码块中变换系数的扫描方式、系数组的大小和变换系数相关的语法元素的取值;转换模块,用于根据所述扫描方式和所述系数组的大小,对所述解码块中的系数组进行处理,将所述语法元素转换为所述系数组中的变换系数;处理模块,用于对所述变换系数进行处理,得到变换系数的恢复值;变换模块,用于对所述变换系数进行处理,并将处理后的数据进行一次或多次变换,得到所述解码块的预测差值;计算模块,用于使用所述预测值和所述预测差确定所述解码块的恢复值。
根据本申请的另一个实施例,提供了一种电子设备,包括:上述的编码装置,采集设备以及存储设备;其中,所述采集设备,用于采集所述编码块对应的图像,并对所述图像进行预处理后输出;所述存储设备,用于接收输出的码流,并在对所述码流进行系统层处理后进行存储。
根据本申请的另一个实施例,提供了一种电子设备,包括:上述的解码装置,接收设备以及显示设备,其中,所述接收设备,用于对码流进行接收;所述显示设备,用于将恢复后的图像进行显示。
根据本申请的又一个实施例,还提供了一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
通过本申请,由于允许使用非固定大小的系数组对变换系数矩阵进行编码和解码,因此,可以解决固定大小的系数组,致使编码器无法根据二维矩阵中变换系数的分布情况选择最有效的编码系数编码方式的问题,从而有效降低系数组标志位的编码开销,提高了对变换系数的编码效率。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限 定。在附图中:
图1是本发明实施例的一种图像的编码方法的移动终端的硬件结构框图;
图2是根据本发明实施例的一种图像的编码方法的流程图;
图3是根据本发明实施例的一种编码系数组的大小的数据处理流程图;
图4是根据本发明实施例的一种编码扫描方式参数的数据处理流程图;
图5是根据本发明实施例的一种图像的解码的流程图;
图6是根据本发明实施例的一种解析系数组的大小的数据处理流程图;
图7是根据本发明实施例的一种解析扫描方式参数的数据处理流程图;
图8是根据本发明实施例的一种图像的编码装置的结构框图;
图9是根据本发明实施例的另一种图像的编码装置的结构框图;
图10是根据本发明实施例的一种图像的解码装置的结构框图;
图11是根据本发明实施例的另一种图像的解码装置的结构框图;
图12是一种包含上述所示图像的编码装置的电子设备图;
图13是一种包含上述所示图像的解码装置的电子设备图;
图14是一种包含上述所示电子设备的电子系统。
具体实施方式
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
下述实施例中,视频指的是由图像组成的图像序列。所述码流指的是视频编码器对视频进行编码产生的码流,也指对视频编码器编码视频产生的码流经过系统层处理后得到的包含所述视频编码器编码视频产生的码流的传输流和/或媒体文件,对所述码流进行解码可以获得视频。所述系统层处理是对视频码流进行的封装操作,例如,将视频码流作为数据载荷封装成传输流,或将视频码流作为载荷封装成媒体文件。所述系统层处理也包括将包含视频码流的传输流或媒体文件作为数据载荷封装成用于传输的流或者用于存储的文件。所述系统层处理生成的数据单元也称为系统层数据单元,在所述系统层处理封装数据载荷过程中在所述系统层数据单元中添加的信息(例如系统层数据单元的头信息等)称为系统层信息。所述子码流指的是从码流中进行抽取操作得到的部分码 流,对所述子码流进行解码可以获得视频图像,该视频图像可以是比解码所述码流获得的视频图像的分辨率低的图像,也可以是比解码所述码流获得视频的帧率低的图像,该视频图像包含的可以是解码所述码流获得的视频图像中的部分内容。
实施例1
本申请实施例一所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图1是本发明实施例的一种图像的编码方法的移动终端的硬件结构框图。如图1所示,移动终端10可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和用于存储数据的存储器104,可选地,上述移动终端还可以包括用于通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本发明实施例中的一种图像的编码方法方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106用于经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其用于通过无线方式与互联网进行通讯。
在本实施例中提供了一种运行于上述移动终端的图像的编码方法方法,图2是根据本发明实施例的一种图像的编码方法的流程图,如图2所示,该流程包括如下步骤:
步骤S202,确定编码块的预测值,计算所述编码块与所述预测值的预测差 值;
步骤S204,对所述预测差值进行一次或者多次的变换,得到变换数据,使用所述变换数据确定变换系数;
步骤S206,确定所述变换系数的扫描方式和系数组的大小,将所述变换系数划分成一个或多个系数组,根据所述扫描方式扫描每个所述系数组中包含的变换系数,将所述变换系数转换为一个或多个语法元素;
步骤S208,对所述系数组的大小和所述语法元素的取值进行编码,将编码比特写入码流。
可选地,确定所述编码块的预测值,包括以下方法的至少之一:将一个或者多个已编码的图像作为参考图像,确定编码块的预测值;或,将所述编码块所在的图像中的已编码部分作为参考,确定所述编码块的预测值。
可选地,使用所述变换数据确定变换系数,包括:当判断对所述变换数据进行量化时,对所述变换数据进行量化处理,得到所述变换系数;当判断不对所述变换数据进行量化时,使用所述变换数据设置所述变换系数。
可选地,确定所述变换系数的系数组的大小,包括:根据预设的候选值确定所述变换系数的系数组的大小。
可选地,根据预设的所述候选值确定所述变换系数的系数组的大小,包括:使用率失真优化的方法,从所述候选值中确定所述变换系数的系数组的大小。
可选地,计算使用所述候选值中的数值作为系数组的大小时所述变换系数的编码比特数,选择可使得所述编码比特数最小的所述候选值中的数值作为所述变换系数的系数组的大小。
可选地,根据预设的所述候选值确定所述变换系数的系数组的大小,包括:根据所述变换系数的分布情况确定所述变换系数的系数组的大小。
可选地,所述变换系数的分布情况是对所述变换系数进行扫描后检测所述变换系数中非0系数的集中程度,其中,所述非0系数的集中程度指的是所述变换系数的非0系数之间0值系数的数量,所述0值系数的数量越小表示非0系数的集中程度越高;从所述候选值中选择可使得所述集中程度最高的所述候选值中的数值作为所述变换系数的系数组的大小。
可选地,所述候选值包括至少之一:一个或多个固定数值;配置的一个或多个数值;所述编码块相邻已编码块使用的系数组的大小的取值。
可选地,所述系数组的大小的预设的候选值是所述配置的一个或多个数值时,所述方法还包括:将所述候选值标识参数写入所述码流的一个或多个数据 单元中,其中,所述标识参数用于指示所述配置的所述候选值;所述码流中的数据单元包含以下至少之一:一个或多个参数集,分片头,块层数据单元。
可选地,所述系数组的大小的预设的候选值的标识参数,包括以下至少之一:系数组的大小,系数组的边长,系数组的宽度和高度。
可选地,使用以下一种或多种方法,将所述标识参数写入所述码流,包括:将所述标识参数的最大值和最小值写入所述码流;将所述标识参数的最大值和所述系数组的最大划分层次写入所述码流;将所述标识参数的最大值和所述系数组的大小的最大值与最小值之间的差值写入所述码流;将所述标识参数的最小值和所述系数组的最大向上划分层次写入所述码流;将所述标识参数的最小值和所述系数组的大小的最大值与最小值之间的差值写入所述码流。
可选地,使用以下一种或多种方法将所述标识参数写入所述码流,还包括:将所述标识参数的默认值写入所述码流。
可选地,所述系数组的大小的预设的候选值的标识参数,包括:所述标识参数是一个或多个标志位,指示对应的系数组的大小是否是所述候选值中包含的系数组的大小。
可选地,所述系数组的大小的预设的候选值的标识参数,包括:所述标识参数指示预设的一个或多个预测模式对应的一个或多个系数组的大小。
可选地,所述系数组的大小的预设的候选值的标识参数,包括:所述标识参数指示预设的一次或多次变换对应的一个或多个系数组的大小。
可选地,所述系数组的大小的预设的候选值的标识参数,包括:所述标识参数指示预设的一个或多个变换类型对应的一个或多个系数组的大小。
可选地,所述系数组的大小的预设的候选值的标识参数,包括:所述标识参数指示预设的一个或多个量化参数对应的一个或多个系数组的大小;或者,所述标识参数指示预设的一个或多个量化参数取值范围对应的一个或多个系数组的大小。
可选地,所述系数组的大小的预设的候选值的标识参数,包括:所述标识参数指示预设的档次/等级/级别Profile/Tier/Level对应的一个或多个系数组的大小。
可选地,所述确定所述变换系数的系数组的大小,包括:根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,其中,所述第一编码参数至少包括以下其中之一:所述编码块中包含的变换块的大小、所述编码块的预测模式、所述编码块中包含的变换块使用的变换类型、量化参数。
可选地,根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,包括:当所述编码块中包含的变换块的大小等于第一预设值时,将所述系数组的大小设置为所述第一预设值对应的系数组的大小。
可选地,根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,包括:当所述编码块的预测模式等于第一预设模式时,将所述系数组的大小设置为所述第一预设模式对应的系数组的大小。
可选地,根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,包括:当所述编码块中包含的变换块使用的变换类型等于第一变换类型时,将所述系数组的大小设置为所述第一变换类型对应的系数组的大小。
可选地,根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,包括:当所述量化参数的取值等于第二预设值时,将所述系数组的大小设置为所述第二预设值对应的系数组的大小;或者,当所述量化参数的取值在第一预设取值范围内时,将所述系数组的大小设置为所述第一预设取值范围对应的系数组的大小。
可选地,所述确定所述变换系数的扫描方式,包括:根据预设的候选扫描方式为所述变换系数确定扫描方式,其中,所述扫描方式为对所述变换系数的二维矩阵中元素的处理顺序。
可选地,根据预设的候选扫描方式为所述变换系数确定扫描方式,包括:使用率失真优化的方法,从所述候选扫描方式中确定所述变换系数的扫描方式。
可选地,计算使用所述候选扫描方式中的扫描方式时所述变换系数的编码比特数,选择可使得所述编码比特数最小的所述候选扫描方式中的扫描方式作为所述变换系数的扫描方式。
可选地,根据预设的候选扫描方式为所述变换系数确定扫描方式,包括:根据所述变换系数的分布情况确定所述变换系数的扫描方式。
可选地,所述变换系数的分布情况是对所述变换系数进行扫描后检测所述变换系数中非0系数的集中程度,其中,所述非0系数的集中程度指的是所述变换系数的非0系数之间0值系数的数量,所述0值系数的数量越小表示非0系数的集中程度越高;从所述候选扫描方式中选择可使得所述集中程度最高的所述候选值中的扫描方式作为所述变换系数的扫描方式。
可选地,所述候选扫描方式包括至少之一:一个或多个固定扫描方式;配 置的一个或多个扫描方式;所述编码块相邻已编码块使用的扫描方式。
可选地,所述候选扫描方式是所述配置的一个或多个扫描方式时,所述方法还包括:将所述候选扫描方式参数写入所述码流的一个或多个数据单元中,其中,所述候选扫描方式参数用于指示所述配置的所述候选扫描方式;所述码流中的数据单元包含以下至少之一:一个或多个参数集,分片头,块层数据单元。
可选地,所述候选扫描方式参数,还包括:所述变换系数的二维矩阵中元素的处理顺序。
可选地,所述候选扫描方式参数,还包括:所述扫描方式参数的默认值。
可选地,所述候选扫描方式参数,包括:所述候选扫描方式参数是一个或多个标志位,指示对应的扫描方式是否包含在所述候选扫描方式中。
可选地,所述候选扫描方式参数,包括:所述候选扫描方式参数指示预设的一个或多个预测模式对应的一个或多个扫描方式。
可选地,所述候选扫描方式参数,包括:所述候选扫描方式参数指示预设的一次或多次变换对应的一个或多个扫描方式。
可选地,所述候选扫描方式参数,包括:所述候选扫描方式参数指示预设的一个或多个变换类型对应的一个或多个扫描方式。
可选地,所述候选扫描方式参数,包括:所述候选扫描方式参数指示预设的一个或多个量化参数对应的一个或多个扫描方式;或者,所述候选扫描方式参数指示预设的一个或多个量化参数取值范围对应的一个或多个扫描方式。
可选地,所述候选扫描方式参数,包括:所述候选扫描方式参数指示预设的Profile/Tier/Level对应的一个或多个扫描方式。
可选地,所述确定所述变换系数的扫描方式,包括:根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式;其中,所述第二编码参数至少包括以下其中之一:所述编码块中包含的变换块的大小、所述编码块的预测模式、所述编码块中包含的变换块使用的变换类型、所述编码块的大小;所述扫描方式为对所述变换系数的二维矩阵中元素的处理顺序。
可选地,根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式,包括:当所述编码块中包含的变换块的大小等于第三预设值时,将所述变换系数的扫描方式设置为所述第三预设值对应的扫描方式。
可选地,根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式,包括:当所述编码块的预测模式等于第二预设模式时,将所述变换系数的扫描方式设置为所述第二预设模式对应的扫描方式。
可选地,根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式,包括:当所述编码块中包含的变换块使用的变换类型等于第二变换类型时,将所述变换系数的扫描方式设置为所述第二变换类型对应的扫描方式。
可选地,根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式,包括:当所述编码块的大小等于第四预设值时,将所述变换系数的扫描方式设置为所述第四预设值对应的扫描方式。
可选地,所述确定所述变换系数的扫描方式和系数组的大小,包括:使用率失真优化的方法,联合确定所述变换系数的系数组的大小和扫描方式。
可选地,所述将所述变换系数转换为一个或多个语法元素,包括:根据所述系数组的大小和扫描方式,将所述变换系数划分成一个或多个系数组,根据所述扫描方式扫描所述系数组中包含的变换系数,将所述变换系数表示为以下语法元素的至少之一:指示非0系数起始位置的语法元素;指示系数组中包含非0系数的语法元素;指示系数组中非0系数位置的语法元素;指示系数组中非0系数取值的语法元素。
可选地,所述对所述系数组的大小和所述语法元素的取值进行编码,将编码比特写入码流,包括:将所述变换系数使用的系数组的大小使用以下之一的方法进行编码:编码所述系数组的大小;编码所述系数组的大小对应的索引序号的取值;设置所述系数组的大小对应的标志位,编码所述标志位的取值。
可选地,所述对所述系数组的大小和所述语法元素的取值进行编码,将编码比特写入码流,包括:将编码比特写入码流中的数据单元,所述码流中的数据单元包含以下至少之一:一个或多个参数集,分片头,块层数据单元。
可选地,图像可以被划分成多个最大编码单元。最大编码单元是一个正方形的图像区域。图像可以划分成一个或多个分片(Slice),每个分片中可以包含整数个最大编码单元,也可以包含非整数个最大编码单元。可选地,图像还可以划分成一个或多个瓦片(Tile),每个瓦片中可以包含整数个最大编码单元,也可以包含非整数个最大编码单元。划分单元201可以被配置为按照固定的方式对图像进行划分,也可以被配置为动态调整图像的划分方式。例如,为了适 配网络的最大传输单元(Maximum Transmission Unit,MTU),采用动态分片划分的方法,保证每个分片的编码比特数不超过MTU的限制。
可选地,将最大编码单元划分为一个或多个编码块,划分得到的编码块可以进一步进行划分成更多的编码块。划分方式可以采用四叉树划分、二叉树划分、三叉树划分中的一种或多种。
可选地,使用常用的率失真优化(Rate-Distortion Optimization,RDO)的方法,确定编码块的预测值以及得到该预测值使用的帧间预测、帧内预测相关的输出参数。
可选地,对一个或多个已解码图像作为参考图像,确定编码块的帧间预测值。首先使用所述参考图像,构造一个或多个参考图像列表(Reference List),每个参考图像列表中包含一个或多个参考图像,确定编码块在所述参考图像中的匹配块。使用所述匹配块构造编码块的预测值,并且计算编码块与所述预测值之间的差值(即预测差)。输出用于指示匹配块位置的参数,包括参考图像列表指示、参考图像索引(Reference Index)、运动矢量(Motion Vector,MV)等,其中,参考图像列表指示用于指示包含匹配块的参考图像所在的参考图像列表,参考图像索引用于指示参考图像列表中包含匹配块的参考图像,MV用于指示编码块与匹配块在同一个图像像素点坐标系下相互之间的相对位置偏移量。
可选地,以所述编码块相邻的已恢复像素作为滤波器的输入值来计算编码块的预测值,这里,所述的滤波器可以是插值滤波器,也可以是低通滤波器(例如用于计算DC值的滤波器)。特殊地,在所述编码块所在图像中已经部分恢复的部分中搜索所述编码块的匹配块,将匹配块作为所述编码块的预测值。使用率失真优化RDO的方法确定用于计算所述编码块预测值的方法(即帧内预测模式)以及预测值。上述过程中的输出参数包括用于指示帧内预测模式的参数。
可选地,还用于计算编码块的原始值与预测值之间的预测差。所述预测差可以表示为一个N x M的二维矩阵,其中,N和M均为正整数,N和M可以相等,也可以不相等
可选地,从信号处理的角度,一种变换方法可以用一个变换矩阵来表示。可以使用与所述编码块大小和形状相同的矩形块(这里,正方形是矩形的一种特例)作为预测差的变换块,也可以将所述预测差划分成多个矩形块(包括高度或宽度为一个像素的情况)并分别对矩形块依次进行变换处理。
可选地,使用标量量化器对所述数据进行量化,量化器的量化参数(Quantization Parameter,QP)由控制单元确定。例如,控制单元可以使用已有 的码率控制方法,确定量化器的量化步长,并根据量化步长与QP的对应关系确定QP。经过量化过程输出的是系数的量化值(即“Level”值),通常可以使用一个二维矩阵进行表示。
可选地,还可以使用与量化过程中相同的QP,对所述系数的量化值进行缩放(Scaling)操作,得到系数的恢复值。
可选地,当确定不对所述编码块进行量化时(例如,使用RDO的方法确定是否对所述编码块进行量化),将预测差进行变换后得到的数据直接进行反变换。
可选地,通过逆变换对所述系数的恢复值进行处理,得到预测差的恢复值。
可选地,还用于进行滤波。具体地,在本实施例中还包括由去方块滤波(Deblocking)和采样值自适应加性偏移量补偿滤波器(Sample Adaptive Offset,SAO)两个滤波器级联构成的滤波器进行的滤波方法。在该过滤器中也可以包括神经网络滤波器。可选地,对图像缓冲区中的数据进行滤波的操作可以在图像层进行操作,即等待所述图像中的全部编码块的恢复值均写入了图像缓冲区后,对图像缓冲区中的数据进行滤波处理。可选地,对所述图像缓冲区中的数据进行滤波的操作可以在块层进行操作,即当某个编码块的恢复数据不再用做后续编码块的参考数据时,对该编码块的恢复数据进行滤波处理。使用RDO方法确定滤波器参数,并将其作为滤波过程的输出参数。所述滤波器参数包括所使用的滤波器的指示信息、滤波器系数、滤波器的控制参数。
可选地,对图像的编码数据进行二值化和熵编码,将参数转换为符合标准的由一个或多个“0”、“1”比特组成的字段,并根据标准中码流语法结构(Syntax Structure)将字段组织成码流。所述的编码数据包括图像的纹理数据和非纹理数据。其中,所述纹理数据主要是编码块的变换系数;非纹理数据包括除纹理数据外的其他所有数据,包括前述中各个处理过程中的输出参数、以及参数集、头信息、辅助信息等参数。
可选地,处理的纹理数据是以M x N二维矩阵形式表示的变换系数,其中,M和N是正整数,M和N可以相等,M和N也可以不相等。所述二维矩阵可以对应于一个变换块,以下叙述中使用“变换块”指代所述以M x N二维矩阵形式表示的变换系数。这里,在所述对所述编码块使用量化的情况下,所述变换系数是量化过程中输出的是系数的量化值(即“Level”值);反之,在所述不对所述编码块使用量化的情况下,所述变换系数是变换过程中输出的所述预测差进行变换后得到的数据。
可选地,能够确定系数组的大小。系数组包含W x H个变换系数,其中, W和H是正整数,W和H可以相等,W和H也可以不相等,并且W≤M、H≤N。为变换块从预设的候选值中确定所使用的系数组的大小。预设的候选值可以是固定的值,也可以是可配置的值。在预设的候选值是可以配置的值的情况下,可以在以下一个或多个数据单元中编码与系数组的大小相关的标识信息并将其写入码流,所述标识信息用于指示所述设置的可使用的系数组的大小,包括:一个或多个参数集(Parameter Set)、分片头(Slice Header)、编码单元(Coding Unit)。
可选地,可以使用隐含推导的方式确定所述变换块的系数组的大小。可以根据所述变换块所在编码块的编码模式、变换块大小、量化参数、变换块使用的变换类型等一个或多个编码参数,选择预先设定的对应系数组的大小。下述示例中,设置为可以使用4x4和8x8两种系数组的大小。所述方法可以扩展到使用更多系数组的大小的情况。可以使用下述示例中的一种方法或联合使用多种方法确定系数组的大小。
例如,设定当编码块中变换块的大小大于16x16时将系数组的大小设置为8x8,设定当编码块中变换块的大小小于或等于16x16时将系数组的大小设置为4x4。对于非正方形的矩形变换块,可以根据变换块的高度和宽度来设定对应使用的系数组的大小,例如,当变换块的高度和宽度中的较小值大于16时,使用高度和宽度中的较小值等于8的矩形系数组,反之,使用高度和宽度中的较小值等于4的矩形系数组。
例如,设定帧间预测模式的编码块中的变换块对应使用的系数组的大小是8x8(设定8x8和4x4的变换块使用的系数组的大小是4x4),设定帧内预测模式的编码块中的变换块对应使用的系数组的大小是8x8(设定16x16、8x8和4x4的变换块使用的系数组的大小是4x4)。
例如,通常情况下,量化参数较大时,二维矩阵中存在更多的0值变换系数,由于每个系数组都会有一个对应标志位来标识该系数组中的变换系数是否都是0(或者是标识该系数组中是否包含非0变换系数),因此,采用较大的系数组时,其中包含可能都是0值系数,使用1个所述标志位即可表示。较之使用较小的系数组的情况,在量化参数较大时采用较大的系数组可以有效降低了所述标志位的编码开销。以H.265/HEVC标准中量化参数的设置方式为例,一种实施方式时,当量化参数的取值大于或等于37时,将系数组的大小设置为8x8(设定8x8和4x4的变换块使用的系数组的大小是4x4);反之,将系数组的大小设置为4x4。
例如,对于使用基于离散余弦变换(Discrete Cosine Transform,DCT)设计的变换的编码块,将系数组的大小设置为8x8(设定8x8和4x4的变换块使用的 系数组的大小是4x4)。对于使用基于离散正弦变换(Discrete Sine Transform,DST)设计的变换的编码块,将系数组的大小设置为4x4。对于使用基于卡胡南-洛夫变换(Karhunen-Loève Transform,KLT)设计的变换的编码块,将系数组的大小设置为8x8(设定8x8和4x4的变换块使用的系数组的大小是4x4)。对于使用二次或多次变换的编码块,将系数组的大小设置为8x8(设定8x8和4x4的变换块使用的系数组的大小是4x4)。
可选地,还能够用于确定变换块中变换系数的扫描方式。所述扫描方式指的是对变换系数二维矩阵中元素的处理顺序。通常情况下,按照扫描方式所指示的顺序依次读取一个M行N列的二维矩阵中的元素,可以等价得到一个1行M x N列(或者M x N行1列)的一维矩阵。可以预设一种或多种变换系数矩阵的扫描方式,例如,“之”(Zig-zag)扫描顺序、水平扫描(Horizontal scan)顺序、垂直扫描(Vertical scan)、对角扫描(Diagonal scan)顺序(例如对角右上扫描(Diagonal up-right scan)顺序,等。为变换块从预设的扫描方式中选择扫描方式。可以为变换块中的系数组、系数组中的变换系数使用相同的扫描方式,也可以为变换块中的系数组、系数组中的变换系数使用不同的扫描方式。
可选地,可以使用隐含推导的方式确定所述变换块的变换系数矩阵的扫描方式。可以根据所述变换块所在编码块的编码模式、变换块大小等一个或多个编码参数,选择预先设定的对应扫描方式。例如,设定帧间预测模式对应使用对角右上扫描方式,设定编码块的大小大于8x8时的帧内预测模式对应使用对角右上扫描方式,设定编码块大小小于等于8x8时的帧内预测模式对应使用帧内预测方向指示方向的扫描方式、直流(DC)模式和平面(Planar)模式等不使用方向性预测的模式使用对角右上扫描方式。为减少预设的扫描方式数量,可以将帧内预测方向进行分类,各类对应不同的扫描方式,例如,垂直方向以及垂直方向上左右偏移指定角度的帧内预测方向对应使用垂直扫描方式,水平方向以及水平方向上上下偏移指定角度的帧内预测方向对应使用水平扫描方式,还可以包括45度角度以及角度方向上上下偏移指定角度的帧内预测方向使用对角扫描方式。根据所述编码模式、编码块大小等一个或多个编码参数,为所述编码块选择扫描方式。
可选地,在已经确定了变换块的系数组的大小的情况下,根据变换块中变换系数的分布情况确定所述变换块的扫描方式。所述分布情况指的是使用扫描方式对变换块中的变换系数进行扫描(或逆扫描顺序),检测变换块中非0系数的集中程度。通常情况下,按照扫描顺序(或逆扫描顺序)非0系数之间0值系数越少认为非0系数的集中程度越高。从候选扫描模式中选择可使得非0系数集中程度最高的扫描方式作为所述变换块的扫描方式。另一种实施方式是,在已经确定了变换块中系数组的大小的情况下,依次采用可用候选扫描方式作 为所述变换块的扫描方式,计算变换块中变换系数的编码比特数,选择可使得编码比特数最小的候选扫描方式作为所述变换块的扫描方式。其中,所述可用候选扫描方式指的是预设的扫描方式中,可用于编码所述变换块的扫描方式。例如,可以配置针对特定预测模式的编码块,不使用指定的一种或多种扫描方式;例如,可以配置对于某一个或多个特定的编码块或变换块的大小,不使用指定的一种或多种扫描方式。在以下一个或多个数据单元中编码用于指示变换块使用的扫描方式的信息并将其写入码流,包括:一个或多个参数集、分片头、编码单元、变换块数据单元。
可选地,可以为变换块确定自适应的扫描方式。在前述方法中,使用的各种扫描方式均是按照固定的顺序处理变换块中的系数组、系数组中的变换系数,不同的扫描方式定义不同的扫描顺序。这里所述的“自适应的扫描方式”,指的是对变换块中的系数组采用灵活而非固定的处理顺序,对系数组中的变换系数采用灵活而非固定的处理顺序。一种实施方法是,根据变换块中变换系数的分布情况,构造一种扫描方式,使得变换块中非0系数的集中程度最高。通常情况下,按照扫描顺序(或逆扫描顺序)非0系数之间0值系数越少认为非0系数的集中程度越高。另一种实施方法是,在已经确定了变换块中系数组的大小的情况下,构造一种扫描方式可使得变换块中变换系数的编码比特数与编码该扫描方式的开销比特数之和最小。在确定了扫描方式后,需要对扫描方式进行编码,一种方法是编码变换块中变换系数的位置与扫描后的位置之间的对应关系表,例如,变换块中坐标位置等于(m,n)的变换系数(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)对应的扫描后序号位置等于k。需要说明的是,码流中所述对应关系表指示的等价信息是:解析码流获得的位置序号等于k的变换系数在变换块中的位置坐标是(m,n)(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)。在以下一个或多个数据单元中编码变换块使用的扫描方式的信息并将其写入码流,包括:一个或多个参数集、分片头、编码单元、变换块数据单元。
可选地,根据系数组的大小,将变换块中的变换系数划分成一个或多个系数组,按照所确定扫描方式对变换系数矩阵中的元素进行处理。使用扫描方式的正序或逆序,依次对变换系数矩阵中的系数组进行处理。对于每个系数组,使用扫描方式的正序或逆序,依次对该系数组中的变换系数进行处理。这里,对系数组的扫描顺序和对系数组中变换系数的扫描顺序可以是相同的,也可以是不同的。将编码所述变换块产生的比特写入码流,所述比特表示以下一项或多项信息:变换块使用的系数组的大小、变换块使用的扫描方式、变换块中的变换系数。
图3是根据本发明实施例的一种编码系数组的大小的数据处理流程图;所 述处理流程的输出是对系数组的大小相关参数进行编码后的码流。
步骤301,在参数集数据单元中编码系数组的大小。对系数组的大小的设置参数在参数集数据单元中进行编码。
所述参数集数据单元指的是用于携载适用于整个序列的参数数据的参数集数据单元,例如,H.265/HEVC标准中的视频参数集(Video Parameter Set,VPS)、序列参数集(Sequence Parameter Set,SPS)。所述参数集数据单元还可以包括用于携载适用于图像的参数数据的参数集数据单元,例如,适配参数集(Adaptive Parameter Set,APS)、H.265/HEVC标准中的图像参数集(Picture Parameter Set,PPS)。特别地,当APS或PPS中的参数对整个序列中的每个图像都保持不变,即APS或PPS中的参数适用于整个序列中的每个图像时,这种情况下的APS或PPS相当于携载了适用于整个序列的参数数据的参数集数据单元。可选地,特别地,可以设置、或采用默认设置的方法,使用适用于图像的参数集数据单元中的数据覆盖适用于序列的参数集数据单元中的对应数据。
根据配置文件设置参数集数据单元中与系数组的大小相关的字段的取值,对这些字段进行编码,将编码比特写入参数集数据单元对应的码流。这里,所述配置文件中记载的是用于对进行初始化过程中的参数设置。
在参数集数据单元中设置是否允许使用多种系数组的大小的标志位。当该标志位指示“允许使用”时,对编码块进行编码的过程中,可以从多于一种的候选系数组的大小选择用于编码所述编码块变换系数的系数组的大小。当该标志为指示“不允许使用”时,仅使用默认设定的系数组的大小对变换系数进行编码。
可以在参数集数据单元中编码系数组的大小的默认值。例如,当设置最小的变换块大小是8x8时,根据所述配置文件中的参数设置,将4x4或8x8作为系数组的大小的默认值在参数集数据单元中进行编码。可选地,一种编码方法是,对系数组的大小的默认值的编码可以不依赖于任何标志位;可选地,另一种编码方法是,在前述标志位指示“不允许使用多种系数组的大小”的情况下,在参数集数据单元中编码系数组的大小的默认值。
当前述标志位指示“允许使用多种系数组的大小”时,对允许使用的系数组的大小进行编码。
可选地,一种编码方法是,在参数集数据单元中编码最大和最小允许使用的系数组的大小,对其他可允许使用的系数组的大小,可以按照设定的从最大到最小的推导方式(例如按照四叉树方式)进行隐含推导,例如,设置并编码最大和最小允许使用的系数组的大小分别是32x32和4x4,那么根据前述的四叉 树方式,参数集数据单元的字段所指示的可允许使用的系数组的大小包括:32x32、16x16、8x8和4x4。第二种编码方法是,在参数集数据单元中编码最大允许使用的系数组的大小和按照划分方式(例如四叉树方式)的最大划分层次,例如,设置并编码最大允许使用的系数组的大小是32x32,设定最多容许的划分层次是3层,那么参数集数据单元的字段所指示的可允许使用的系数组的大小包括:32x32、16x16、8x8和4x4,可替换地,可使用最大和最小允许使用的系数组的大小之间的差值替代最大划分层次,在上述示例中,可将所述最大和最小允许值之间的差值表示为log232–log24=3。第三种编码方法是,在参数集数据单元中编码最小允许使用的系数组的大小和按照划分方式(例如四叉树方式)的最大向上层次,例如,设置并编码最小允许使用的系数组的大小是4x4,设定最多向上层次是3层,那么参数集数据单元的字段所指示的可允许使用的系数组的大小包括:32x32、16x16、8x8和4x4,可替换地,可使用最大和最小允许使用的系数组的大小之间的差值替代最大向上层次,在上述示例中,可将所述最大和最小允许值之间的差值表示为log232–log24=3。
可选地,一种编码方法是,在参数集数据单元中编码最大和最小允许使用的系数组的边长,对其他可允许使用的系数组的大小,可以按照设定的边长从最大到最小的推导方式(例如按照二分方式)进行隐含推导,例如,设置并编码最大和最小的边长分别是16和4,那么参数集数据单元的字段所指示的可允许使用的系数组的可用边长包括16、8和4,对应指示的系数组的大小(以“宽度x高度”的形式表示)包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4。第二种编码方法是,在参数集数据单元中编码最大允许使用的系数组的边长和按照划分方式(例如二分方式)的最大划分层次,例如,设置并编码最大允许使用的系数组的边长为16、最大划分层次为2,那么参数集数据单元的字段所指示的可允许使用的系数组的可用边长包括16、8、4,对应指示的系数组的大小包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4,可替换地,可使用最大和最小允许使用的系数组的边长之间的差值替代最大划分层次,在上述示例中,可将所述最大和最小允许值之间的差值表示为log216–log24=2。第三种编码方法是,在参数集数据单元中编码最小允许使用的系数组的边长和按照划分方式(例如二分方式)的最大向上层次,例如,设置并编码最小允许使用的系数组的边长为4、最大向上层次为2,那么参数集数据单元的字段所指示的可允许使用的系数组的可用边长包括16、8、4,对应指示的系数组的大小包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4,可替换地,可使用最大和最小允许使用的系数组的边长之间的差值替代最大向上层次,在上述示例中,可将所述最大和最小允许值之间的差值表示为log216–log24=2。第四种编码方法是,在参数集数据单元中为可用的边长分别设置标志 位,所述标志位用于指示是否允许使用其对应的边长,例如,当可用的边长包括32、16、8和4而允许使用的边长是16、8和4时,在参数集数据单元中将“边长32”对应的标志位设置为“不允许使用”并编码,将“边长16、8和4”对应的3个标志位设置为“允许使用”并编码,那么参数集数据单元的字段所指示的可允许使用的系数组的可用边长包括16、8、4,对应指示的系数组的大小包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4。
可选地,一种编码方法是,在参数集数据单元中编码系数组的宽度和高度的最大和最小允许使用的值,对其他可允许使用的系数组的大小,可以按照设定的宽度和高度从最大到最小的推导方式(例如按照二分方式)进行隐含推导,例如,设置并编码系数组的宽度的最大和最小的允许使用值分别是16和4、设置并编码系数组的高度的最大和最小允许使用的值分别是8和4,那么参数集数据单元的字段所指示的可允许使用的系数组的宽度包括16、8和4,指示的可允许使用的系数组的高度包括8和4,对应指示的系数组的大小(以“宽度x高度”的形式表示)包括:16x8、16x4、8x8、8x4、4x8和4x4。第二种编码方法是,在参数集数据单元中编码最大允许使用的系数组的宽度和按照划分方式(例如二分方式)的最大划分层次,编码最大允许使用的系数组的高度和按照划分方式(例如二分方式)的最大划分层次,例如,设置并编码最大允许使用的系数组的宽度为16、最大划分层次为2,设置并编码最大允许使用的系数组的高度为8、最大划分层次为1,那么参数集数据单元的字段所指示的可允许使用的系数组的宽度包括16、8和4,指示的可允许使用的系数组的高度包括8和4,对应指示的系数组的大小(以“宽度x高度”的形式表示)包括:16x8、16x4、8x8、8x4、4x8和4x4,可替换地,可使用最大和最小允许使用的系数组的宽度之间的差值替代最大划分层次,在上述示例中,可将所述最大和最小允许值之间的差值表示为log216–log24=2,可替换地,可使用最大和最小允许使用的系数组的高度之间的差值替代最大划分层次,在上述示例中,可将所述最大和最小允许值之间的差值表示为log28–log24=1。第三种编码方法是,在参数集数据单元中编码最小允许使用的系数组的宽度和按照划分方式(例如二分方式)的最大向上层次,编码最小允许使用的系数组的高度和按照划分方式(例如二分方式)的最大向上层次,例如,设置并编码最小允许使用的系数组的宽度为4、最大向上层次为2,设置并编码最小允许使用的系数组的高度为4、最大向上层次为1,那么参数集数据单元的字段所指示的可允许使用的系数组的宽度包括16、8和4,指示的可允许使用的系数组的高度包括8和4,对应指示的系数组的大小(以“宽度x高度”的形式表示)包括:16x8、16x4、8x8、8x4、4x8和4x4,可替换地,可使用最大和最小允许使用的系数组的宽度之间的差值替代最大向上层次,在上述示例中,可将所述最大和最小允许值之间的差值表 示为log216–log24=2,可替换地,可使用最大和最小允许使用的系数组的高度之间的差值替代最大向上层次,在上述示例中,可将所述最大和最小允许值之间的差值表示为log28–log24=1。第四种编码方法是,在参数集数据单元中为可用的宽度和高度分别设置标志位,所述标志位用于指示是否允许使用其对应的宽度和高度,例如,当可用的宽度和高度均包括32、16、8和4,而允许使用的宽度是16、8和4、允许使用的高度是8和4时,在参数集数据单元中将“宽度32”对应的标志位设置为“不允许使用”并编码,将“宽度16、8和4”对应的3个标志位设置为“允许使用”并编码,将“高度32和16”对应的2个标志位设置为“不允许使用”并编码,将“高度8和4”对应的2个标志位设置为“允许使用”并编码,那么参数集数据单元的字段所指示的可允许使用的系数组的宽度包括16、8和4,指示的可允许使用的系数组的高度包括8和4,对应指示的系数组的大小(以“宽度x高度”的形式表示)包括:16x8、16x4、8x8、8x4、4x8和4x4。
可选地,一种编码方法是,在参数集数据单元中为可用的系数组的大小分别设置标志位,所述标志位用于指示是否允许使用其对应的参数组的大小。例如,当可用的系数组的大小包括16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4时,在允许使用16x8、16x4、8x8、8x4、4x8和4x4时,在参数集数据单元中将这6种系数组的大小对应的标志位设置为“允许使用”并编码,将其他16x16、8x16和4x16这3种系数组的大小对应的标志位设置为“不允许使用”并编码。
可选地,在参数集数据单元中,可以使用上述的方法分别为使用不同编码模式的编码块设置允许使用的系数组的大小。例如,为帧内模式编码块设置的允许使用的系数组的大小为8x8和4x4并编码、为帧间模式编码块设置的允许使用的系数组的大小为16x16、8x8和4x4并编码,那么,参数集数据单元的字段所指示的对于使用帧内预测模式编码块中的变换块可允许的系数组的大小是8x8和4x4,对于使用帧间预测模式编码块中的变换块可允许的系数组的大小是16x16、8x8和4x4。
可选地,在参数集数据单元中,可以使用上述的方法分别为使用不同变换次数的变换块设置允许使用的系数组的大小。例如,为使用一次变换的变换块设置的允许使用的系数组的大小为8x8和4x4并编码、为使用多次变换的变换块设置的允许使用的系数组的大小为16x16、8x8和4x4并编码,那么,参数集数据单元的字段所指示的对于使用一次变换的变换块可允许的系数组的大小是8x8和4x4,对于使用多次变换的变换块可允许的系数组的大小是16x16、8x8和4x4。
可选地,在参数集数据单元中,可以使用上述的方法分别为使用不同变换方式的变换块设置允许使用的系数组的大小。例如,为使用以DCT为基础设计的变换的变换块设置的允许使用的系数组的大小为8x8和4x4并编码、为使用以DST为基础设计的变换的变换块设置的允许使用的系数组的大小为16x16、8x8和4x4并编码,为使用以KLT为基础设计的变换的变换块设置的允许使用的系数组的大小为32x32、16x16、8x8和4x4并编码,那么,参数集数据单元的字段所指示的对于使用以DCT为基础设计的变换的变换块可允许的系数组的大小是8x8和4x4,对于使用以DST为基础设计的变换的变换块可允许的系数组的大小是16x16、8x8和4x4,对于使用以KLT为基础设计的变换的变换块可允许的系数组的大小是32x32、16x16、8x8和4x4。
可选地,在参数集数据单元中,设置并编码用于切换可允许使用的系数组的大小的控制参数。例如,当使用量化参数作为切换可允许使用的系数组的大小的控制参数时,如以H.265/HEVC标准中量化参数的定义方式,当量化参数大于等于37时,允许使用的系数组的大小是16x16、8x8和4x4;当量化参数取值小于37但大于等于27时,允许使用的系数组的大小是8x8;当量化参数取值小于27时,允许使用的系数组的大小是4x4,使用前述方法在参数集数据单元中设置量化参数的划分区间、以及各区间中允许使用的系数组的大小,并编码。
可选地,将可使用的系数组的大小预先设定在档次/等级/级别(Profile/Tier/Level)中,对于不同的Profile/Tier/Level,设置一种或多种取值的可使用的系数组的大小。例如,对于较低的Level(例如对应于编码640x480及其以下分辨率的视频),使用默认值等于4x4的系数组的大小;对于较高的Level(例如对应于编码720p、1080p、2K等较大分辨率的视频),可使用8x8、4x4两种系数组的大小;对于最高的Level(例如对应于编码4K、8K等超大分辨率的视频),可使用16x16、8x8、4x4三种系数组的大小。在参数集数据单元中,编码Profile/Tier/Level的指示信息。
使用上述方法的一种可选用的码流组织方法如下,用于允许使用的编码系数组的大小。所述码流组织方法的字段位于一个或多个参数集数据单元中。所述码流组织方法生成的码流所包含的字段如下:
表1.参数集数据单元中的码流组织
...... Descriptor
log2_min_cg_side_length ue(v)
log2_diff_max_cg_side_length ue(v)
......  
}  
表1中各语法元素(Syntax element)的语义(semantics)如下:
log2_min_cg_side_length表示系数组的最小边长。系数组的最小边长等于(1<<log2_min_cg_side_length)。其中,“<<”是算数右移位运算符。log2_min_cg_side_length使用ue(v)的方法进行熵编码。
log2_diff_max_cg_side_length表示系数组的最大边长与最小边长之间的差值。系数组的最大边长等于(1<<(log2_min_cg_side_length+log2_diff_max_cg_side_length))。log2_diff_max_cg_side_length使用ue(v)的方法进行熵编码。
对表1中的参数设置方法如下示例。例如,当配置文件中,仅使用默认大小是4x4的系数组时,将log2_min_cg_side_length的取值设置为2,将log2_diff_max_cg_side_length设置为0,使用ue(v)的方法对两个字段进行编码,将编码比特写入码流。
例如,当配置文件中,使用最小为4x4的系数组、最大为16x16的系数组时,将log2_min_cg_side_length的取值设置为2,将log2_diff_max_cg_side_length的取值设置为2,使用ue(v)的方法对两个字段进行编码,将编码比特写入码流。如前实施方法所述,参数集数据单元的字段所指示的可允许使用的系数组的可用边长包括16、8、4,对应指示的系数组的大小包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4。
使用上述方法的另一种可选用的码流组织方法如下,用于编码使用帧间模式、帧内模式的编码块中变换块的允许使用的系数组的大小。所述码流组织方法的字段位于一个或多个参数集数据单元中。所述码流组织方法生成的码流所包含的字段如下:
表2.参数集数据单元中的码流组织
...... Descriptor
log2_min_cg_side_length ue(v)
log2_diff_max_inter_cg_side_length ue(v)
log2_diff_max_intra_cg_side_length ue(v)
......  
}  
表2中各语法元素(Syntax element)的语义(semantics)如下:
log2_min_cg_side_length表示系数组的最小边长。系数组的最小边长等于(1<<log2_min_cg_side_length)。其中,“<<”是算数右移位运算符。log2_min_cg_side_length使用ue(v)的方法进行熵编码。
log2_diff_max_inter_cg_side_length表示使用帧间预测模式的编码块中变换块的系数组的最大边长与最小边长之间的差值。系数组的最大边长等于(1<<(log2_min_cg_side_length+log2_diff_max_cg_side_length))。log2_diff_max_cg_side_length使用ue(v)的方法进行熵编码。
log2_diff_max_intra_cg_side_length表示使用帧内预测模式的编码块中变换块的系数组的最大边长与最小边长之间的差值。系数组的最大边长等于(1<<(log2_min_cg_side_length+log2_diff_max_cg_side_length))。log2_diff_max_cg_side_length使用ue(v)的方法进行熵编码。
对表2中的参数设置方法如下示例。例如,当配置文件中,仅使用默认大小是4x4的系数组时,将log2_min_cg_side_length的取值设置为2,将log2_diff_max_inter_cg_side_length和log2_diff_max_intra_cg_side_length的取值均设置为0,使用ue(v)的方法对两个字段进行编码,将编码比特写入码流。这种情况下,对帧间预测模式的编码块和帧内预测模式的编码块使用的系数组的大小均为4x4。
例如,当配置文件中,使用最小为4x4的系数组、最大为16x16的系数组时,将log2_min_cg_side_length的取值设置为2,将log2_diff_max_inter_cg_side_length和log2_diff_max_intra_cg_side_length的取值均设置为2,使用ue(v)的方法对三个字段进行编码,将编码比特写入码流。如前实施方法所述,参数集数据单元的字段所指示的可允许使用的系数组的可用边长包括16、8、4,对应指示的系数组的大小包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4。在这种情况下,对帧间预测模式的编码块和帧内预测模式的编码块中的变换块使用相同的允许使用的系数组。
例如,当配置文件中,使用最小为4x4的系数组、帧间预测模式的编码块允许使用最大为16x16的系数组、帧内预测模式的编码块允许使用最大为8x8 的系数组时,将log2_min_cg_side_length的取值设置为2,将log2_diff_max_inter_cg_side_length的取值设置为2,将log2_diff_max_intra_cg_side_length的取值均设置为1,使用ue(v)的方法对三个字段进行编码,将编码比特写入码流。如前实施方法所述,参数集数据单元的字段所指示的帧间模式的编码块可允许使用的系数组的可用边长包括16、8和4,对应指示的系数组的大小包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4,参数集数据单元字段所指示的帧内预测模式的编码块可允许使用的系数组的可用边长包括8和4,对应指示的系数组的大小包括:8x8、8x4、4x8和4x4。在这种情况下,对帧间预测模式的编码块和帧内预测模式的编码块中的变换块使用不完全相同的允许使用的系数组。
步骤S302,在分片头信息数据单元中编码系数组的大小。对系数组的大小的设置参数在分片头信息数据单元中进行编码。
在分片头信息数据单元中编码所述分片引用(refer to)的参数集的参数集索引序号(parameter set identifier)。对所述分片进行编码的过程中,可以使用所引用的参数集中设定的可使用的系数组的大小。
可选地,特别地,可以在分片头信息中编码可使用的系数组的大小的信息来对应覆盖所述分片引用的参数集中的对应参数设置。使用的编码方法与步骤S301中除通过编码Profile/Tier/Level指示系数组的大小的方法外的其他在参数集中编码系数组的大小的方法相同,但编码比特写入分片头信息数据单元的码流。
可选地,当所述分片引用的参数集中没有包含系数组的大小相关参数时,可以在分片头信息中编码可使用的系数组的大小。使用的编码方法与步骤S301中除通过编码Profile/Tier/Level指示系数组的大小的方法外的其他在参数集中编码系数组的大小的方法相同,但编码比特写入分片头信息数据单元的码流。
步骤S303,在块层数据单元中编码系数组的大小。对系数组的大小的参数在块层数据单元中进行编码。
在块层数据单元中,编码用于指示编码块中变换块使用的系数组的大小的参数。例如,一种编码方法是,在块层数据单元中编码所使用的系数组的大小,如系数组的宽度和高度。例如,一种编码方法是,在块层数据单元中编码一个索引取值,该索引取值对应于一个系数组的大小。例如,一种编码方法是,在块层数据单元中编码一个或多个标志信息,所述标志信息用于指示所述编码块中的变换块所使用的系数组的大小与所述标志信息指示的已编码的一个变换块相同,所述已编码的变换块可以是与所述变换块位于同一个图像中的已编码变换块(如上相邻块、左相邻块等),也可以是所述变换块不在同一个图像中的 已编码块(即时域相邻块),如在块层数据单元中编码“与上相邻变换块的系数组的大小相同”的标志信息。
图4是根据本发明实施例的一种编码扫描方式参数的数据处理流程图。
可选地,所述处理流程的输出是对扫描方式相关参数进行编码后的码流。
步骤S401,在参数集数据单元中编码扫描方式参数。对扫描方式参数在参数集数据单元中进行编码。
在参数集数据单元中编码允许使用的扫描方式的指示信息。其中,扫描方式可以是预设的固定路径的扫描方式,也可以是非固定路径的扫描方式。当使用非固定路径的扫描方式时,可选地,在参数集数据单元中编码变换系数在扫描前后的坐标对应关系。例如,变换块中坐标位置等于(m,n)的变换系数(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)对应的扫描后序号位置等于k。
可选地,将可使用的系数组的大小预先设定在档次/等级/级别(Profile/Tier/Level)中,对于不同的Profile/Tier/Level,设置一种或多种可使用的扫描方式。例如,对于较低的Level(例如对应于编码640x480及其以下分辨率的视频),使用默认的对角右上、水平和垂直扫描方式;对于较高的Level(例如对应于编码720p、1080p、2K等较大分辨率的视频),除前述对较低Level使用的默认的三种扫描方式外,还可使用Zig-zag扫描方式、其他对角扫描方式(例如对角右下、对角左下等);对于最高的Level(例如对应于编码4K、8K等超大分辨率的视频),除前述的扫描方式外,还可以使用非固定扫描路径的扫描方式。在参数集数据单元中,编码Profile/Tier/Level的指示信息。对于非固定路径扫描方式,在参数集数据单元中,编码变换系数在扫描前后的坐标对应关系。例如,变换块中坐标位置等于(m,n)的变换系数(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)对应的扫描后序号位置等于k。
步骤S402,在分片头信息数据单元中编码扫描方式参数。对扫描方式参数在分片头信息数据单元中进行编码。
在分片头信息数据单元中编码所述分片引用(refer to)的参数集的参数集索引序号(parameter set identifier)。对所述分片进行编码的过程中,可以使用所引用的参数集中设定的可使用的扫描方式。
可选地,特别地,可以在分片头信息中编码可使用的扫描方式参数来对应覆盖所述分片引用的参数集中的对应参数设置。使用的编码方法与步骤S401中除通过编码Profile/Tier/Level指示扫描方式的方法外的其他在参数集中编码扫描方式参数的方法相同,但编码比特写入分片头信息数据单元的码流。
可选地,当所述分片引用的参数集中没有包含扫描方式参数时,可以在分片头信息中编码可使用的扫描方式参数。使用的编码方法与步骤S401中除通过编码Profile/Tier/Level指示扫描方式的方法外的其他在参数集中在参数集中编码扫描方式参数的方法相同,但编码比特写入分片头信息数据单元的码流。
可选地,在分片头信息数据单元中编码变换系数在扫描前后的坐标对应关系。例如,变换块中坐标位置等于(m,n)的变换系数(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)对应的扫描后序号位置等于k。
步骤S403,在块层数据单元中编码扫描方式参数。对扫描方式参数在块层数据单元中进行编码。
在块层数据单元中,编码用于指示编码块中变换块使用的扫描方式参数。例如,一种编码方法是,在块层数据单元中编码一个索引取值,该索引取值对应于一个扫描方式。例如,一种编码方法是,在块层数据单元中编码变换系数在扫描前后的坐标对应关系。例如,变换块中坐标位置等于(m,n)的变换系数(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)对应的扫描后序号位置等于k。例如,一种编码方法是,在块层数据单元中编码一个或多个标志信息,所述标志信息用于指示所述编码块中的变换块所使用的扫描方式与所述标志信息指示的已编码的一个变换块相同,所述已编码的变换块可以是与所述变换块位于同一个图像中的已编码变换块(如上相邻块、左相邻块等),也可以是所述变换块不在同一个图像中的已编码块(即时域相邻块),如在块层数据单元中编码“与上相邻变换块的扫描方式相同”的标志信息。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
实施例2
在本实施例中提供了一种运行于上述移动终端的图像的解码方法,图5是根据本发明实施例的一种图像的解码的流程图,如图5所示,该流程包括如下步骤:
步骤S502,解析码流,确定解码块的预测值;
步骤S504,解析所述码流,确定所述解码块中变换系数的扫描方式、系数组的大小和变换系数相关的语法元素的取值;
步骤S506,根据所述扫描方式和所述系数组的大小,对所述解码块中的系数组进行处理,将所述语法元素转换为所述系数组中的变换系数;
步骤S508,对所述变换系数进行处理,得到变换系数的恢复值;
步骤S510,对所述变换系数的恢复值进行一次或多次变换,得到所述解码块的预测差值;
步骤S512,使用所述预测值和所述预测差确定所述解码块的恢复值。
可选地,解析所述码流,确定所述解码块的预测值,包括以下方法的至少之一:解析所述码流,获取所述解码块的帧间预测参数;根据所述帧间预测参数,将一个或者多个已解码的图像作为参考图像,确定所述解码块的预测值。或,解析所述码流,获取所述解码块的帧内预测参数;根据所述帧内预测参数,将所述解码块所在的图像中的已解码部分作为参考,确定所述解码块的预测值。
可选地,解析所述码流,确定所述解码块中变换系数的系数组的大小,包括:解析所述码流,从所述码流中的数据单元获取第一系数组参数,根据所述第一系数组参数确定所述系数组的大小;其中,所述码流中的数据单元包含以下至少之一:一个或多个参数集,分片头,块层数据单元。
可选地,根据所述第一系数组参数确定所述系数组的大小,包括:使用所述第一系数组参数设置所述系数组的大小。
可选地,根据所述第一系数组参数确定所述系数组的大小,包括:所述第一系数组参数指示了所述解码块的相邻已解码块,使用所述相邻已解码块的系数组的大小设置所述系数组的大小。
可选地,根据所述第一系数组参数确定所述系数组的大小,包括:根据所述第一系数组参数从系数组的大小的候选值中确定所述解码块的变换系数的系数组的大小。
可选地,所述第一系数组参数包含索引序号,使用所述索引序号在所述候选值中对应的系数组的大小设置所述系数组的大小。
可选地,所述第一系数组参数包含标志位,使用所述标志位在所述候选值中对应的系数组的大小设置所述系数组的大小。
可选地,所述系数组的大小的候选值是一个或多个固定数值。
可选地,所述第一系数组参数中包含标识参数,使用所述标识参数配置所述系数组的大小的候选值。
可选地,所述标识参数包括以下至少之一:系数组的大小,系数组的边长,系数组的宽度和高度。
可选地,使用以下一种或多种方法,使用所述标识参数配置所述系数组的大小的候选值,包括:获得所述标识参数的最大值和最小值,按照预设的划分方式确定所述标识参数除所述最大值和最小值之外的取值,使用所述标识参数的取值设置所述候选值;获得所述标识参数的最大值和所述系数组的最大划分层次,按照所述预设的划分方式确定所述标识参数的最大值之外的取值,使用所述标识参数的取值设置所述候选值;获得所述标识参数的最大值和所述系数组的大小的最大值与最小值之间的差值,按照所述预设的划分方式确定所述标识参数的最大值之外的取值,使用所述标识参数的取值设置所述候选值;获得所述标识参数的最小值和所述系数组的最大向上划分层次,按照所述预设的划分方式确定所述标识参数的最小值之外的取值,使用所述标识参数的取值设置所述候选值;获得所述标识参数的最小值和所述系数组的大小的最大值与最小值之间的差值,按照所述预设的划分方式确定所述标识参数的最小值之外的取值,使用所述标识参数的取值设置所述候选值。
可选地,所述预设的划分方式包括以下至少之一:四分式划分,三分式划分,二分式划分。
可选地,使用所述标识参数配置所述系数组的大小的候选值,包括:使用所述标识参数的默认值设置所述候选值。
可选地,使用所述标识参数配置所述系数组的大小的候选值,包括:所述标识参数是一个或多个指示对应的系数组的大小是否包含在所述候选值中的标志位,根据所述标识参数设置所述候选值中包含的系数组的大小。
可选地,使用所述标识参数配置所述系数组的大小的候选值,包括:所述标识参数指示预设的Profile/Tier/Level对应的一个或多个系数组的大小,根据所述标识参数设置所述候选值中包含的系数组的大小。
可选地,根据所述第一系数组参数确定所述系数组的大小,包括:所述第一参数组参数中包含所述解码块的第一解码参数,根据所述解码块的第一解码参数,将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,其中,所述第一解码参数至少包括以下其中之一:所述解码块中包含的变换块的大小、所述解码块的预测模式、所述解码块中包含的变换块使用的变换类型、量化参数。
可选地,所述将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,包括:当所述解码块中包含的变换块的大小等于第一预设值时,将所 述系数组的大小设置为所述第一预设值对应的系数组的大小。
可选地,根据所述第一参数组参数,获得与所述第一预设值相对应的系数组的大小。
可选地,所述将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,包括:当所述解码块的预测模式等于第一预设模式时,将所述系数组的大小设置为所述第一预设模式对应的系数组的大小。
可选地,根据所述第一参数组参数,获得与所述第一预设模式相对应的系数组的大小。
可选地,所述将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,包括:当所述解码块中包含的变换块使用的变换类型等于第一变换类型时,将所述系数组的大小设置为所述第一变换类型对应的系数组的大小。
可选地,根据所述第一参数组参数,获得与所述第一变换类型相对应的系数组的大小。
可选地,所述将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,包括:当所述量化参数的取值等于第二预设值时,将所述系数组的大小设置为所述第二预设值对应的系数组的大小;或者,当所述量化参数的取值在第一预设取值范围内时,将所述系数组的大小设置为所述第一预设取值范围对应的系数组的大小。
可选地,根据所述第一参数组参数,获得与所述第二预设值相对应的系数组的大小。或者,根据所述第一参数组参数,获得与所述第一预设取值范围相对应的系数组的大小。
可选地,所述对所述码流进行解析,确定所述变换系数的扫描方式,包括:解析所述码流中的数据单元获取第一扫描方式参数,根据所述第一扫描方式参数确定所述变换系数的扫描方式;其中,所述扫描方式为对所述变换系数的二维矩阵中元素的处理顺序;所述码流中的数据单元包含以下至少之一:一个或多个参数集,分片头,块层数据单元。
可选地,解析所述码流中的数据单元获取第一扫描方式参数,根据所述第一扫描方式参数确定所述变换系数的扫描方式,包括:使用所述第一扫描方式参数指示的扫描方式作为所述变换系数的扫描方式。
可选地,使用所述第一扫描方式参数指示的扫描方式作为所述变换系数的扫描方式,包括:所述第一扫描方式参数指示了所述解码块的相邻已解码块,使用所述相邻已解码块的扫描方式设置所述变换系数的扫描方式。
可选地,使用所述第一扫描方式参数指示的扫描方式作为所述变换系数的扫描方式,还包括:根据所述第一扫描方式参数从候选扫描方式中确定所述变换系数的扫描方式。
可选地,所述第一扫描方式参数包含扫描方式索引序号,使用所述扫描方式索引序号在所述候选扫描方式中对应的扫描方式设置所述变换系数的扫描方式。
可选地,还包括:所述第一扫描方式参数包含扫描方式指示标志位,使用所述扫描方式指示标志位在所述候选扫描方式中对应的扫描方式设置所述变换系数的扫描方式。
可选地,所述候选扫描方式包括至少之一:一个或多个固定扫描方式;使用所述第一扫描方式参数配置所述候选扫描方式。
可选地,使用所述第一扫描方式参数配置所述候选扫描方式,包括:所述第一扫描方式参数包含默认扫描方式,使用所述默认扫描方式设置所述候选扫描方式。
可选地,使用所述第一扫描方式参数配置所述候选扫描方式,包括:所述第一候选扫描方式参数包含一个或多个候选扫描方式指示标志位,使用所述候选扫描方式指示标志位对应的扫描方式设置所述候选扫描方式。
可选地,使用所述第一扫描方式参数配置所述候选扫描方式,包括:使用所述第一扫描方式参数指示预设的Profile/Tier/Level对应的一个或多个扫描方式设置所述候选扫描方式。
可选地,使用所述第一扫描方式参数配置所述候选扫描方式,包括:使用所述第一扫描方式参数指示的所述变换系数的位置与扫描后的变换系数的位置之间的对应关系设置所述候选扫描方式。
可选地,解析所述码流中的数据单元获取第一扫描方式参数,根据所述第一扫描方式参数确定所述变换系数的扫描方式;包括:所述第一扫描方式参数包含所述解码块的第二解码参数;根据所述第二解码参数,确定所述变换系数的扫描方式,其中所述第二解码参数至少包括以下其中之一:所述解码块中包含的变换块的大小、所述解码块的预测模式、所述解码块中包含的变换块使用的变换类型、所述解码块的大小。
可选地,根据所述第二解码参数,将所述变换系数的扫描方式设置为所述第二解码参数对应的扫描方式,包括:当所述解码块中包含的变换块的大小等于第三预设值时,将所述变换系数的扫描方式设置为所述第三预设值对应的扫描方式。
可选地,根据所述第一参数组参数,获得与所述第三预设值相对应的扫描方式。
可选地,根据所述第二解码参数,将所述变换系数的扫描方式设置为所述第二解码参数对应的扫描方式,包括:当所述解码块的预测模式等于第二预设模式时,将所述变换系数的扫描方式设置为所述第二预设模式对应的扫描方式。
可选地,根据所述第一参数组参数,获得与所述第二预设模式相对应的扫描方式。
可选地,根据所述第二解码参数,将所述变换系数的扫描方式设置为所述第二解码参数对应的扫描方式,包括:当所述解码块中包含的变换块使用的变换类型等于第二变换类型时,将所述变换系数的扫描方式设置为所述第二变换类型对应的扫描方式。
可选地,根据所述第一参数组参数,获得与所述第二变换类型相对应的扫描方式。
可选地,根据所述第二解码参数,将所述变换系数的扫描方式设置为所述第二解码参数对应的扫描方式,包括:当所述解码块的大小等于第四预设值时,将所述变换系数的扫描方式设置为所述第四预设值对应的扫描方式。
可选地,根据所述第一参数组参数,获得与第四预设值相对应的扫描方式。
可选地,解析所述码流,确定变换系数相关的语法元素的取值,包括:所述语法元素包括以下至少之一:指示非0系数起始位置的语法元素;指示系数组中包含非0系数的语法元素;指示系数组中非0系数位置的语法元素;指示系数组中非0系数取值的语法元素。
可选地,所述对所述变换系数进行处理,得到变换系数的恢复值,包括:当判断对所述变换系数进行伸缩Scaling处理时,对所述变换数据进行伸缩处理,得到所述变换系数的恢复值;当判断不对所述变换数据进行伸缩处理时,使用所述变换系数设置所述变换系数的恢复值。
可选地,所述对所述变换系数进行处理之前,所述方法还包括:解析所述码流,获取用于构造所述解码块的预测差值的恢复值的第三参数;根据所述第三参数,判断是否对所述变换系数进行伸缩处理。
可选地,使用所述预测值和所述预测差值确定所述解码块的恢复值,所述方法还包括:对所述预测值和所述预测差值的和值进行环路滤波处理。
可选地,对输入码流进行解析(Parsing),使用标准中规定的熵解码方法和二值化方法,将码流中各字段对应的一个或多个“0”、“1”比特串转换成 对应参数的取值。根据所述参数的取值,推导得到其他参数的取值,例如,当码流中的标志位取值指示解码块是图像中的第一个解码块时,将用于指示所述解码块所在分片中第一个解码块在图像中的地址参数设置为0。
可选地,用于构造解码块预测差恢复值的参数是可以用M x N二维矩阵形式表示的变换系数,其中,M和N是正整数,M和N可以相等,M和N也可以不相等。所述二维矩阵可以对应于一个变换块,以下叙述中使用“变换块”指代所述以M x N二维矩阵形式表示的变换系数。这里,当解析码流获得指示信息指示对所述变换块进行伸缩(Scaling)操作的情况下,恢复的所述变换系数对应于实施例1中编码器中量化过程中输出的量化值(即“Level”值);反之,当解析码流获得指示信息指示不对所述变换块进行伸缩操作的情况下,恢复的所述变换系数对应于前述编码器对所述预测差进行变换后得到的数据。
可选地,确定系数组的大小,系数组包含W x H个变换系数,其中,W和H是正整数,W和H可以相等,W和H也可以不相等,并且W≤M、H≤N。一个或多个系数组组成变换块
可选地,使用的系数组的大小可以是预设的固定值,也可以通过解析码流中的以下一个或多个数据单元获得可使用的系数组的大小,包括:一个或多个参数集(Parameter Set)、分片头(Slice Header)、编码单元(Coding Unit)。
可选地,可以使用隐含推导的方式确定系数组的大小。可以根据解析码流获得的所述变换块所在解码块的编码模式(Coding Mode)、变换块大小、量化参数、变换块使用的变换类型等一个或多个参数,确定所述变换块的系数组的大小。下述示例中,与前述编码器实施例相对应,设置为可以使用4x4和8x8两种系数组的大小。所述方法可以扩展到使用更多系数组的大小的情况。可使用的系数组的大小可以是通过解析码流获得的参数,也可以是固定配置的值。可以使用下述示例中的一种方法或联合使用多种方法确定系数组的大小。
例如,设定当解码块中变换块的大小大于16x16时将系数组的大小设置为8x8,设定当解码块中变换块的大小小于或等于16x16时将系数组的大小设置为4x4。对于非正方形的矩形变换块,可以根据变换块的高度和宽度来设定对应使用的系数组的大小,例如,当变换块的高度和宽度中的较小值大于16时,使用高度和宽度中的较小值等于8的矩形系数组,反之,使用高度和宽度中的较小值等于4的矩形系数组。
例如,设定帧间预测模式的解码块中的变换块对应使用的系数组的大小是8x8(设定8x8和4x4的变换块使用的系数组的大小是4x4),设定帧内预测模式的解码块中的变换块对应使用的系数组的大小是8x8(设定16x16、8x8和4x4的变换块使用的系数组的大小是4x4)。
例如,根据解码块的量化参数确定其包含的变换块使用的系数组的大小的取值。以H.265/HEVC标准中量化参数的设置方式为例,一种实施方式时,当量化参数的取值大于或等于37时,将系数组的大小设置为8x8(设定8x8和4x4的变换块使用的系数组的大小是4x4);反之,将系数组的大小设置为4x4。
例如,对于使用基于离散余弦变换(Discrete Cosine Transform,DCT)设计的变换的解码块,将系数组的大小设置为8x8(设定8x8和4x4的变换块使用的系数组的大小是4x4)。对于使用基于离散正弦变换(Discrete Sine Transform,DST)设计的变换的解码块,将系数组的大小设置为4x4。对于使用基于卡胡南-洛夫变换(Karhunen-Loève Transform,KLT)设计的变换的解码块,将系数组的大小设置为8x8(设定8x8和4x4的变换块使用的系数组的大小是4x4)。对于使用二次或多次变换的解码块,将系数组的大小设置为8x8(设定8x8和4x4的变换块使用的系数组的大小是4x4)。
可选地,解析所述码流中的以下一个或多个数据单元,获得用于指示所述变换块的系数组的大小的标识信息,包括:一个或多个参数集、分片头、编码单元、变换块数据单元。
可选地,确定变换系数的扫描方式。在实施例1中前述编码器的处理流程中,所述扫描方式指示了对变换系数二维矩阵中元素的处理顺序,通常情况下,该处理顺序也对应于前述编码器将变换系数写入码流的顺序。因此,对应地,在处理流程中,与其他相关参数(例如非0系数标志位等)相结合,按照通过解析码流获得码流中变换系数的先后顺序,所述扫描方式指示了各变换系数在变换块中的位置。例如,按照扫描顺序,前述编码器的编码器对变换块中坐标位置是(m,n)的变换系数以第k个顺序写入码流,在从码流中获得第k个变换系数后,将该变换系数设置为变换块中坐标位置是(m,n)的元素。通常情况下,在前述编码器的处理流程中,按照扫描方式所指示顺序(正序或逆序)依次读取一个M行N列的二维矩阵中的元素,可以等价得到一个1行M x N列(或者M x N行1列)的一维矩阵。对应地,按照扫描方式指示的顺序(正序或逆序),可以将解码码流得到的所述1行M x N列(或者M x N行1列)的一维矩阵,重新排列成与编码器的输入矩阵一致的M行N列的二维矩阵。与前述编码器相同,可以使用预设的一种或多种变换系数矩阵的扫描方式,例如,“之”(Zia-zag)扫描顺序、水平扫描(Horizontal scan)顺序、垂直扫描(Vertical scan)、对角扫描(Diagonal scan)顺序(例如对角右上扫描(Diagonal up-right scan)顺序,等。
可选地,可以使用隐含推导的方式确定所述变换块的变换系数矩阵的扫描方式。可以根据解析码流获得的所述变换块所在解码块的编码模式(Coding  Mode)、解码块大小、变换块大小等一个或多个参数,确定所述变换块的扫描方式。
例如,设定帧间预测模式对应使用对角右上扫描方式,设定解码块的大小大于8x8时的帧内预测模式对应使用对角右上扫描方式,设定解码块大小小于等于8x8时的帧内预测模式对应使用帧内预测方向指示方向的扫描方式、直流(DC)模式和平面(Planar)模式等不使用方向性预测的模式使用对角右上扫描方式。可选地,可以将帧内预测方向进行分类,各类对应不同的扫描方式,例如,垂直方向以及垂直方向上左右偏移指定角度的帧内预测方向对应使用垂直扫描方式,水平方向以及水平方向上上下偏移指定角度的帧内预测方向对应使用水平扫描方式,还可以包括45度角度以及角度方向上上下偏移指定角度的帧内预测方向使用对角扫描方式。
可选地,解析所述码流中的以下一个或多个数据单元,获得指示变换块使用的扫描方式的信息,包括:一个或多个参数集、分片头、编码单元、变换块数据单元。
可选地,解析所述码流中的以下一个或多个数据单元,获得扫描方式的信息,包括:一个或多个参数集、分片头、编码单元、变换块数据单元。根据所述扫描方式信息,确定所述变换块的扫描方式。所述扫描方式信息的一种表示方法是:变换块中变换系数的位置与扫描后的位置之间的对应关系表,需要说明的是,在前述编码器中,该对应关系表指示的是变换块中坐标位置等于(m,n)的变换系数(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)对应的扫描后序号位置等于k。相对应地,在本实施例中,该对应关系表指示的等价信息是解析码流获得的位置序号等于k的变换系数在变换块中的位置坐标是(m,n)(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)。特别说明的,与所述方法相比较地,在前述方法中,确定的各种扫描方式均是按照固定的顺序处理变换块中的系数组、系数组中的变换系数,不同的扫描方式定义不同的扫描顺序。
可选地,解析变换块中的变换系数。根据变换块的大小和系数组的大小,确定变换块包含的各系数组的位置。所述系数组的位置可以表示为系数组中左上角系数在变换块(或解码图像)中的位置坐标。根据所述扫描方式指示的顺序,依次对系数组进行处理。对于一个系数组,根据所述扫描方式指示的顺序,将系数组中对应元素的取值设置为解析码流获得的变换系数取值。特别地,当解析码流得到指示一个系数组中包含的变换系数均为0(或等价于系数组中不包含非0变换系数)时,解析单元将该系数组中包含的系数全部设置为0。这里,对变换块中系数组的处理顺序和对系数组中变换系数的处理顺序可以是相同 的,也可以是不同的。
可选地,所述还用于根据所述用于构造解码块预测值的参数构造所述解码块的预测值。根据当前解码图像中已经部分恢复的部分解码图像缓冲区中存储的已解码图像构造所述解码块的预测值。
当所述参数指示所述解码块使用帧间预测时,构造一个或多个参考图像列表,每个参考图像列表中包含一个或多个参考图像,参考图像来包括:参考图像列表指示、参考图像索引、运动矢量,在参考图像中确定所述解码块的一个或多个匹配块,将输出的帧间预测值作为所述解码块的预测值。
可选地,使用解码块所在的当前解码图像作为参考图像,获得所述解码块的帧内预测值。这里,帧内预测指的是仅使用解码块所在图像中的数据作为参考得到的预测值。在这种情况下,使用的是当前解码图像中已经部分恢复的部分。
可选地,当所述参数指示所述解码块使用帧内预测时,通过与实施一类似的方法确定所述解码块的相邻已恢复像素点,用做帧内预测的的参考像素点。根据所述用于构造解码块预测值的参数,确定帧内预测模式,使用与实施例一相同的方法计算所述解码块的帧内预测值。特殊地,所述用于构造解码块预测值的参数指示了所述解码块的匹配块在当前部分解码图像中的位置时,将匹配块作为所述解码块的帧内预测值。将确定的帧内预测值作为所述解码块的预测值。
可选地,将所述用于构造解码块预测差恢复值的参数中QP和系数的量化值(即“Level”值)作为缩放操作(Scaling)的输入。通过使用量化参数QP,对所述系数的量化值进行缩放操作,得到变换系数的恢复值。因此,反量化单元也可以称为缩放单元。
可选地,将获取到的所述变换系数的恢复值、用于构造解码块预测差恢复值的参数中的变换参数。需要说明的是,当所述根据输出的用于构造解码块预测差恢复值的参数判断对当前解码块不使用缩放操作时,所述将输出的变换系数用于反变换。
基于与实施例一类似的方法,得到所述解码块的预测差的恢复值。这里需要说明的是,这里所述的“反变换”是相对于编码器中的“变换”来说的。在视频编码标准中,规定变换方法,即将变换系数的恢复值转换为预测差的恢复值所使用的变换方法。
可选地,计算所述解码块的恢复值,并将所述解码块的恢复值存储至图像缓冲区。所述图像缓冲区可以是对图像解码过程中单独分配的一段存储空间。
获取滤波器参数。所述滤波器参数包括所使用的滤波器的指示信息、滤波器系数、滤波器的控制参数。通过使用滤波器结合所述滤波器参数对所述图像缓冲区中的数据进行滤波处理,得到所述图像的解码图像。需要指出的是本实施例中的滤波器可以是一种或多种滤波器级联构成。例如,在H.265/HEVC标准中,由去方块滤波(Deblocking)和采样值自适应加性偏移量补偿滤波器(Sample Adaptive Offset,SAO)两个滤波器级联构成。也可以包括神经网络滤波器。可选地,对所述图像缓冲区中的数据进行滤波的操作可以在图像层进行操作,即等待所述图像中的全部解码块的恢复值均写入了所述图像缓冲区后,对图像缓冲区中的数据进行滤波处理。可选地,对所述图像缓冲区中的数据进行滤波的操作可以在块层进行操作,即当某个解码块的恢复数据不再用做后续解码块的参考数据时,对该解码块的恢复数据进行滤波处理。
图6是根据本发明实施例的一种解析系数组的大小的数据处理流程图。如图6所示,
步骤S601,解析参数集数据单元中的系数组的大小。解析数据流中参数集数据单元对应的码流,获得解码过程中可使用的系数组的大小。
可选地,所述参数集数据单元指的是用于携载适用于整个序列的参数数据的参数集数据单元,例如,H.265/HEVC标准中的视频参数集(Video Parameter Set,VPS)、序列参数集(Sequence Parameter Set,SPS)。所述参数集数据单元还可以包括用于携载适用于图像的参数数据的参数集数据单元,例如,适配参数集(Adaptive Parameter Set,APS)、H.265/HEVC标准中的图像参数集(Picture Parameter Set,PPS)。特别地,当APS或PPS中的参数对整个序列中的每个图像都保持不变,即APS或PPS中的参数适用于整个序列中的每个图像时,这种情况下的APS或PPS相当于携载了适用于整个序列的参数数据的参数集数据单元。可选地,特别地,可以根据解析数据流中的码流获得的指示信息、或采用默认设置的方法,使用适用于图像的参数集数据单元中的数据覆盖适用于序列的参数集数据单元中的对应数据。
可选地,解析数据流中参数集数据单元的码流,在参数集数据单元中获得指示是否允许使用多种系数组的大小的标志位。当该标志位指示“允许使用”时,对解码块进行解码的过程中,可以从多于一种的候选系数组的大小中确定用于解码所述解码块变换系数的系数组的大小。当该标志为指示“不允许使用”时,仅使用默认设定的系数组的大小对变换系数进行解码。
可选地,解析数据流中参数集数据单元的码流,可以在参数集数据单元中获得系数组的大小的默认值。获得用于指示系数组的大小的默认值的参数,所述参数可以是直接指示系数组的大小的参数,也可以是用于指示对应的系数组 的大小是否是系数组的大小的默认值的标志位。可选地,在已获得的标志位指示“不允许使用多种系数组的大小”的情况下,继续解析该标志位之后的字段,获得系数组的大小的默认值。
可选地,当前述标志位指示“允许使用多种系数组的大小时,对允许使用的系数组的大小进行解析。
可选地,一种解析方法是,解析参数集数据单元获取最大和最小允许使用的系数组的大小,对其他可允许使用的系数组的大小,可以按照设定的从最大到最小的推导方式(例如按照四叉树方式)进行隐含推导,例如,解析并获得最大和最小允许使用的系数组的大小分别是32x32和4x4,那么根据前述的四叉树方式,参数集数据单元的字段所指示的可允许使用的系数组的大小包括:32x32、16x16、8x8和4x4。第二种解析方法是,解析参数集数据单元获取最大允许使用的系数组的大小和按照划分方式(例如四叉树方式)的最大划分层次,例如,解析并获得最大允许使用的系数组的大小是32x32,解析并获得最多容许的划分层次是3层,那么参数集数据单元的字段所指示的可允许使用的系数组的大小包括:32x32、16x16、8x8和4x4,可替换地,最大和最小允许使用的系数组的大小之间的差值也可以以最大划分层次出现在码流中,在上述示例中,解析获得的所述最大和最小允许值之间的差值等于3时,将最小允许使用的系数组的大小设置为4x4(即2(log232-3)=4)。第三种解析方法是,解析参数集数据单元获取最小允许使用的系数组的大小和按照划分方式(例如四叉树方式)的最大向上层次,例如,解析并获取最小允许使用的系数组的大小是4x4,解析并获取最大向上层次是3层,那么参数集数据单元的字段所指示的可允许使用的系数组的大小包括:32x32、16x16、8x8和4x4,可替换地,解析获得最大和最小允许使用的系数组的大小之间的差值等于3,将最大允许使用的系数组的大小设置为32x32(即2(log24+3)=32)。
可选地,一种解析方法是,解析参数集数据单元获取最大和最小允许使用的系数组的边长,对其他可允许使用的系数组的大小,可以按照设定的边长从最大到最小的推导方式(例如按照二分方式)进行隐含推导,例如,解析并获取最大和最小的边长分别是16和4,那么参数集数据单元的字段所指示的可允许使用的系数组的可用边长包括16、8和4,对应指示的系数组的大小(以“宽度x高度”的形式表示)包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4。第二种解析方法是,解析参数集数据单元获取最大允许使用的系数组的边长和按照划分方式(例如二分方式)的最大划分层次,例如,解析并获取最大允许使用的系数组的边长为16、最大划分层次为2,那么参数集数据单元的字段所指示的可允许使用的系数组的可用边长包括16、8和4,对应指示的系数组的大小包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4, 可替换地,最大和最小允许使用的系数组的边长之间的差值也可以以最大划分层次出现在码流中,在上述示例中,解析获得的所述最大和最小允许值之间的差值等于2时,将最小允许使用的系数组的大小设置为4x4(即2(log216-2)=4)。第三种解析方法是,解析参数集数据单元获取最小允许使用的系数组的边长和按照划分方式(例如二分方式)的最大向上层次,例如,解析并获取最小允许使用的系数组的边长为4、最大向上层次为2,那么参数集数据单元的字段所指示的可允许使用的系数组的可用边长包括16、8和4,对应指示的系数组的大小包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4,可替换地,最大和最小允许使用的系数组的边长之间的差值也可以以最大向上层次出现在码流中,在上述示例中,解析获得的所述最大和最小允许值之间的差值等于2时,将最大允许使用的系数组的大小设置为16x16(即2(log24+2)=16)。第四种解析方法是,解析参数集数据单元获取对应于可用的边长的标志位,所述标志位用于指示是否允许使用其对应的边长,例如,当的可用的边长包括32、16、8和4时,解析参数集数据单元获得“边长32”对应的标志位指示“不允许使用”、“边长16、8和4”对应的3个标志位指示“允许使用”,那么参数集数据单元的字段所指示的可允许使用的系数组的可用边长包括16、8、4,对应指示的系数组的大小包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4。
可选地,一种解析方法是,解析参数集数据单元获取系数组的宽度和高度的最大和最小允许使用的值,对其他可允许使用的系数组的大小,可以按照设定的宽度和高度从最大到最小的推导方式(例如按照二分方式)进行隐含推导,例如,解析并获取系数组的宽度的最大和最小的允许使用值分别是16和4、解析并获取系数组的高度的最大和最小允许使用的值分别是8和4,那么参数集数据单元的字段所指示的可允许使用的系数组的宽度包括16、8和4,指示的可允许使用的系数组的高度包括8和4,对应指示的系数组的大小(以“宽度x高度”的形式表示)包括:16x8、16x4、8x8、8x4、4x8和4x4。第二种解析方法是,解析参数集数据单元获取最大允许使用的系数组的宽度和按照划分方式(例如二分方式)的最大划分层次,获取最大允许使用的系数组的高度和按照划分方式(例如二分方式)的最大划分层次,例如,解析并获取最大允许使用的系数组的宽度为16、最大划分层次为2,解析并获取最大允许使用的系数组的高度为8、最大划分层次为1,那么参数集数据单元的字段所指示的可允许使用的系数组的宽度包括16、8和4,指示的可允许使用的系数组的高度包括8和4,对应指示的系数组的大小(以“宽度x高度”的形式表示)包括:16x8、16x4、8x8、8x4、4x8和4x4,可替换地,最大和最小允许使用的系数组的宽度之间的差值也可以以最大划分层次出现在码流中,在上述示例中,解析参数集数据单 元获取所述最大和最小允许宽度值之间的差值等于2时,将最小允许使用的系数组的宽度设置为4(即2(log216-2)=4),可替换地,最大和最小允许使用的系数组的高度之间的差值也可以以最大划分层次出现在码流中,在上述示例中,解析参数集数据单元获取所述最大和最小允许高度值之间的差值等于1时,将最小允许使用的系数组的宽度设置为4(即2(log28-1)=4)。第三种解析方法是,解析参数集数据单元获取最小允许使用的系数组的宽度和按照划分方式(例如二分方式)的最大向上层次,获取最小允许使用的系数组的高度和按照划分方式(例如二分方式)的最大向上层次,例如,解析并获取最小允许使用的系数组的宽度为4、最大向上层次为2,解析并获取最小允许使用的系数组的高度为4、最大向上层次为1,那么参数集数据单元的字段所指示的可允许使用的系数组的宽度包括16、8和4,指示的可允许使用的系数组的高度包括8和4,对应指示的系数组的大小(以“宽度x高度”的形式表示)包括:16x8、16x4、8x8、8x4、4x8和4x4,可替换地,最大和最小允许使用的系数组的宽度之间的差值也可以以最大向上层次出现在码流中,在上述示例中,解析参数集数据单元获取所述最大和最小允许宽度值之间的差值等于2时,将最大允许使用的系数组的宽度值设置为16(即2(log24+2)=16),可替换地,最大和最小允许使用的系数组的高度之间的差值也可以以最大向上层次出现在码流中,在上述示例中,解析参数集数据单元获取所述最大和最小允许高度值之间的差值等于1时,将最大允许使用的系数组的高度值设置为8(即2(log24+1)=8)。第四种解析方法是,解析参数集数据单元获取可用的宽度和高度分别对应的标志位,所述标志位用于指示解码过程中是否允许使用其对应的宽度和高度,例如,当的可用的宽度和高度均包括32、16、8和4时,解析参数集数据单元获得“宽度32”对应的标志位指示“不允许使用”、“宽度16、8和4”对应的3个标志位均指示“允许使用”、“高度32和16”对应的2个标志位均指示“不允许使用”、“高度8和4”对应的2个标志位均指示“允许使用”,那么参数集数据单元的字段所指示的可允许使用的系数组的宽度包括16、8和4,指示的可允许使用的系数组的高度包括8和4,对应指示的系数组的大小(以“宽度x高度”的形式表示)包括:16x8、16x4、8x8、8x4、4x8和4x4。
可选地,一种解析方法是,解析参数集数据单元获取可用的系数组的大小对应的标志位,所述标志位用于指示是否允许使用其对应的参数组的大小。例如,当中设置的可用的系数组的大小包括16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4时,解析参数集数据单元获取获取的9个标志位分别指示了“16x16不允许使用、16x8允许使用、16x4允许使用、8x16不允许使用、8x8允许使用、8x4允许使用、4x16不允许使用、4x8允许使用和4x4允许使用”时,将16x8、16x4、8x8、8x4、4x8和4x4作为解码过程中允许使用的系数组的大 小。
可选地,解析参数集数据单元,可以使用上述的方法获得使用不同编码模式(Coding mode)的解码块允许使用的系数组的大小。例如,解析参数集数据单元获得信息指示对于使用帧内预测模式解码块中的变换块可允许的系数组的大小是8x8和4x4,获得信息指示对于使用帧间预测模式解码块中的变换块可允许的系数组的大小是16x16、8x8和4x4。
可选地,解析参数集数据单元,可以使用上述的方法获得使用不同变换次数的变换块允许使用的系数组的大小。例如,解析参数集数据单元获得指示对于使用一次变换的变换块可允许的系数组的大小是8x8和4x4,对于使用多次变换的变换块可允许的系数组的大小是16x16、8x8和4x4。
可选地,解析参数集数据单元,可以使用上述的方法获得使用不同变换方式的变换块允许使用的系数组的大小。例如,解析参数集数据单元获得指示对于使用以DCT为基础设计的变换的变换块可允许的系数组的大小是8x8和4x4,对于使用以DST为基础设计的变换的变换块可允许的系数组的大小是16x16、8x8和4x4,对于使用以KLT为基础设计的变换的变换块可允许的系数组的大小是32x32、16x16、8x8和4x4。
可选地,解析参数集数据单元,获得用于切换可允许使用的系数组的大小的控制参数。例如,当使用量化参数作为切换可允许使用的系数组的大小的控制参数时,使用前述方法解析参数集数据单元获得量化参数的划分区间、以及各区间中允许使用的系数组的大小,获得的切换方式的一种示例是:如H.265/HEVC标准中量化参数的定义方式,当量化参数大于等于37时,允许使用的系数组的大小是16x16、8x8和4x4;当量化参数取值小于37但大于等于27时,允许使用的系数组的大小是8x8;当量化参数取值小于27时,允许使用的系数组的大小是4x4,
可选地,将可使用的系数组的大小预先设定在档次/等级/级别(Profile/Tier/Level)中,对于不同的Profile/Tier/Level,设置一种或多种取值的可使用的系数组的大小。例如,对于较低的Level(例如对应于解码640x480及其以下分辨率的视频码流),使用默认值等于4x4的系数组的大小;对于较高的Level(例如对应于解码720p、1080p、2K等较大分辨率的视频码流),可使用8x8、4x4两种系数组的大小;对于最高的Level(例如对应于解码4K、8K等超大分辨率的视频码流),可使用16x16、8x8、4x4三种系数组的大小。解析参数集数据单元,获得Profile/Tier/Level的指示信息,确定可使用的系数组的大小。
一种可选用的示例码流组织方法如下(该码流组织方法与表1所示方法相 同),所述码流组织方法的字段位于一个或多个参数集数据单元中。使用上述方法,解析表3中的码流字段,获得解码过程中允许使用的系数组的大小。
表3.参数集数据单元中的码流组织
...... Descriptor
log2_min_cg_side_length ue(v)
log2_diff_max_cg_side_length ue(v)
......  
}  
}
表3中各语法元素(Syntax element)的语义(semantics)如下:
log2_min_cg_side_length表示系数组的最小边长。系数组的最小边长等于(1<<log2_min_cg_side_length)。其中,“<<”是算数右移位运算符。码流解析过程中,对log2_min_cg_side_length使用ue(v)的方法进行熵解码。
log2_diff_max_cg_side_length表示系数组的最大边长与最小边长之间的差值。系数组的最大边长等于(1<<(log2_min_cg_side_length+log2_diff_max_cg_side_length))。码流解析过程中,对log2_diff_max_cg_side_length使用ue(v)的方法进行熵解码。
解析表3中语法元素在码流中对应的字段,确定系数组的大小的示例如下。例如,使用ue(v)的方法解析log2_min_cg_side_length获得其取值等于2,使用ue(v)的方法解析log2_diff_max_cg_side_length获得其取值等于0,确定在解码过程仅使用默认大小是4x4的系数组。
例如,使用ue(v)的方法解析log2_min_cg_side_length获得其取值等于2,使用ue(v)的方法解析log2_diff_max_cg_side_length获得其取值等于2,确定解码过程中可允许使用的系数组的可用边长包括16、8、4,对应指示的可用的系数组的大小包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4。
一种可选用的示例码流组织方法如下(该码流组织方法与表2所示方法相同),所述码流组织方法的字段位于一个或多个参数集数据单元中。使用上述方法,解析表4中的码流字段,获得解码过程中允许使用的系数组的大小。表4中的码流字段可以指示使用帧间模式、帧内模式的解码块中变换块的允许使用不同的系数组的大小。
表4.参数集数据单元中的码流组织
...... Descriptor
log2_min_cg_side_length ue(v)
log2_diff_max_inter_cg_side_length ue(v)
log2_diff_max_intra_cg_side_length ue(v)
......  
}  
表4中各语法元素(Syntax element)的语义(semantics)如下:
log2_min_cg_side_length表示系数组的最小边长。系数组的最小边长等于(1<<log2_min_cg_side_length)。其中,“<<”是算数右移位运算符。码流解析过程中,对log2_min_cg_side_length使用ue(v)的方法进行熵解码。
log2_diff_max_inter_cg_side_length表示使用帧间预测模式的解码块中变换块的系数组的最大边长与最小边长之间的差值。系数组的最大边长等于(1<<(log2_min_cg_side_length+log2_diff_max_cg_side_length))。码流解析过程中,对log2_diff_max_cg_side_length使用ue(v)的方法进行熵解码。
log2_diff_max_intra_cg_side_length表示使用帧内预测模式的解码块中变换块的系数组的最大边长与最小边长之间的差值。系数组的最大边长等于(1<<(log2_min_cg_side_length+log2_diff_max_cg_side_length))。码流解析过程中,对log2_diff_max_cg_side_length使用ue(v)的方法进行熵解码。
解析表4中语法元素在码流中对应的字段,确定系数组的大小的示例如下。例如,使用ue(v)的方法解析log2_min_cg_side_length获得其取值等于2,使用ue(v)的方法分别解析log2_diff_max_inter_cg_side_length和log2_diff_max_intra_cg_side_length获得两个语法元素的取值均设置为0,确定在解码过程对帧间预测模式的解码块和帧内预测模式的解码块均仅使用默认大小是4x4的系数组。
例如,使用ue(v)的方法解析log2_min_cg_side_length获得其取值等于2,使用ue(v)的方法分别解析log2_diff_max_inter_cg_side_length和log2_diff_max_intra_cg_side_length获得的取值均等于2。如前实施方法所述,确定解码过程中可允许使用的系数组可用边长包括16、8、4,对应指示的系数组的大小包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4。在这种情况下,对帧间预测模式的解码块和帧内预测模式的解码块中的变换块使用 相同的允许使用的系数组。
例如,使用ue(v)的方法解析log2_min_cg_side_length获得其取值设置等于2,使用ue(v)的方法解析log2_diff_max_inter_cg_side_length获得其取值设置等于2,使用ue(v)的方法解析log2_diff_max_intra_cg_side_length获得其取值均等于1。如前实施方法所述,确定解码过程中对帧间模式的解码块可允许使用的系数组的可用边长包括16、8和4,对应指示的系数组的大小包括:16x16、16x8、16x4、8x16、8x8、8x4、4x16、4x8和4x4,确定解码过程中对帧内预测模式的解码块可允许使用的系数组的可用边长包括8和4,对应指示的系数组的大小包括:8x8、8x4、4x8和4x4。在这种情况下,对帧间预测模式的解码块和帧内预测模式的解码块中的变换块使用不完全相同的允许使用的系数组。
步骤S602,解析分片头信息数据单元中的系数组的大小。解析数据流中分片头信息数据单元对应的码流,获得解码过程中可使用的系数组的大小。
解析所述分片引用(refer to)的参数集的参数集索引序号(parameter set identifier),激活所引用的参数集,获得参数集中设定的可使用的系数组的大小。
可选地,特别地,解析分片头信息数据单元中可使用的系数组的大小相关的语法单元对应的字段,获得解码所述分片过程中可使用的系数组的大小,对应覆盖从所述分片引用的参数集中获得的对应参数。使用的解析方法与步骤S601中除通过解析Profile/Tier/Level获得系数组的大小的方法外的其他解析参数集数据单元获得系数组的大小的方法相同。
可选地,当所述分片引用的参数集中没有包含系数组的大小相关参数时,解析分片头信息中可使用的系数组的大小相关的语法单元对应的字段,获得解码所述分片过程中可使用的系数组的大小。使用的解析方法与步骤S601中除通过解析Profile/Tier/Level获得系数组的大小的方法外的其他解析参数集数据单元获得系数组的大小的方法相同。
步骤S603,解析块层数据单元中的系数组的大小。解析数据流中块层数据单元对应的码流,获得解码过程中可使用的系数组的大小。
解析块层数据单元,获得用于指示解码块中变换块使用的系数组的大小的参数。例如,一种解析方法是,解析块层数据单元中指示解码变换块使用的系数组的大小的语法元素对应的字段,如系数组的宽度和高度。例如,一种解析 方法是,解析块层数据单元获得一个或多个索引取值,该索引取值对应于一个系数组的大小。例如,一种解析方法是,解析块层数据单元获得一个或多个标志信息,所述标志信息用于指示所述解码块中的变换块所使用的系数组的大小与所述标志信息指示的已解码的一个变换块相同,所述已解码的变换块可以是与所述变换块位于同一个图像中的已解码变换块(如上相邻块、左相邻块等),也可以是所述变换块不在同一个图像中的已解码块(即时域相邻块),所述标志信息的一个示例可以是指示“与上相邻变换块的系数组的大小相同”的标志信息。
图7是根据本发明实施例的一种解析扫描方式参数的数据处理流程图。所述处理流程的输入是数据流中的扫描方式相关的码流,所述处理流程的输出是解码过程中可允许使用的扫描方式和对解码块中变换块进行解码过程中使用的扫描方式。
步骤S701,解析参数集数据单元中的扫描方式参数。解析数据流中参数集数据单元对应的码流,获得解码过程中可使用的扫描方式。
解析参数集数据单元中允许使用的扫描方式的指示信息。其中,扫描方式可以是在中预设的固定路径的扫描方式,也可以是非固定路径的扫描方式。对于非固定路径的扫描方式时,可选地,解析参数集数据单元获得变换系数在扫描前后的坐标对应关系。例如,变换块中坐标位置等于(m,n)的变换系数(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)对应的扫描后序号位置等于k。
可选地,将可使用的系数组的大小预先设定在档次/等级/级别(Profile/Tier/Level)中,对于不同的Profile/Tier/Level,设置一种或多种可使用的扫描方式。例如,对于较低的Level(例如对应于编码640x480及其以下分辨率的视频),使用默认的对角右上、水平和垂直扫描方式;对于较高的Level(例如对应于编码720p、1080p、2K等较大分辨率的视频),除前述对较低Level可使用的默认的三种扫描方式外,还可使用Zig-zag扫描方式、其他对角扫描方式(例如对角右下、对角左下等);对于最高的Level(例如对应于编码4K、8K等超大分辨率的视频),除前述对较高Level可使用的扫描方式外,还可以使用非固定扫描路径的扫描方式。解析参数集数据单元中,获得Profile/Tier/Level的指示信息,确定解码过程中可使用的扫描方式。对于非固定路径扫描方式, 解析参数集数据单元,获得变换系数在扫描前后的坐标对应关系。例如,变换块中坐标位置等于(m,n)的变换系数(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)对应的扫描后序号位置等于k。
步骤S702,解析分片头信息单元中的扫描方式参数。解析数据流中分片头信息数据单元对应的码流,获得解码过程中可使用的扫描方式。
解析分片头信息数据单元中参数集索引序号(parameter set identifier),获得所述分片引用(refer to)的参数集。对所述分片进行解码的过程中,可以使用所引用的参数集中设定的可使用的扫描方式。
可选地,特别地,解析分片头信息,获得可使用的扫描方式参数,对应覆盖从所述分片引用的参数集中获得的扫描方式参数。可选地,使用的解析方法与步骤S701中除通过解析Profile/Tier/Level获得扫描方式的方法外的其他解析参数集获得扫描方式参数的方法相同。
可选地,当所述分片引用的参数集中没有包含扫描方式参数时,解析分片头信息获得解码所述分片过程中可使用的扫描方式参数。使用的解析方法与步骤S701中除通过解析Profile/Tier/Level获得扫描方式的方法外的其他解析参数集获得扫描方式参数的方法相同。
可选地,解析分片头信息数据单元获得变换系数在扫描前后的坐标对应关系。例如,变换块中坐标位置等于(m,n)的变换系数(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)对应的扫描后序号位置等于k。
步骤S703,解析块层数据单元中的扫描方式参数。解析数据流中块层数据单元对应的码流,获得解码一个解码块的过程中使用的扫描方式。
解析块层数据单元,获得用于指示所述解码块中变换块使用的扫描方式参数。例如,一种解析方法是,解析块层数据单元中的一个或多个索引取值,该索引取值对应于一个扫描方式。例如,一种解析方法是,解析块层数据单元中变换系数在扫描前后的坐标对应关系,如变换块中坐标位置等于(m,n)的变换系数(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)对应的扫描后序号位置等于k。例如,一种解析方法是,解析块层数据单元中的一个或多个标志信息,所述标志信息用于指示所述解码块中的变换块所使用的扫描方式与所述标志信息指示的已解码的一个变换块相同,所述已解码的变换块可 以是与所述变换块位于同一个图像中的已解码变换块(如上相邻块、左相邻块等),也可以是所述变换块不在同一个图像中的已解码块(即时域相邻块),所述标志信息的一个示例可以是指示“与上相邻变换块的扫描方式相同”的标志信息。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
实施例3
在本实施例中还提供了一种图像的编码装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图8是根据本发明实施例的一种图像的编码装置的结构框图,如图8所示,该装置包括:第一确定模块82,变换模块84,第二确定模块86以及编码模块88。
第一确定模块82,用于确定编码块的预测值,计算所述编码块与所述预测值的预测差值;
变换模块84,用于对所述预测差值进行一次或者多次的变换,得到变换数据,使用所述变换数据确定变换系数;
第二确定模块86,用于确定所述变换系数的扫描方式和系数组的大小,将所述变换系数划分成一个或多个系数组,根据所述扫描方式扫描每个所述系数组中包含的变换系数,将所述变换系数转换为一个或多个语法元素;
编码模块88,用于对所述系数组的大小和所述语法元素的取值进行编码,将编码后的比特写入码流。
图9是根据本发明实施例的另一种图像的编码装置的结构框图,如图9所示,在包括图8中的所有模块外,第二确定模块86还包括:CG大小确定单元92、扫描方式确定单元94以及变换系数处理单元96。编码模块88还包括:码流生成单元98。
第二确定模块86,用于确定变换块的系数组的大小和扫描方式。如图9所示第二确定模块86的输入数据包括数据流900和数据流901,输出数据是数据流903。数据流900是第一确定模块82的输出数据(包括所述变换块所在编码块的大小、编码模式)、变换模块84的输出数据(包括变换块的大小、量化参数)。数据流901是所述变换块中的变换系数,在不对所述变换块使用量化的情况下,数据流901的变换系数是前述编码器中变换模块84的输出数据;在对所述变换块使用量化情况下,数据流901的变换系数是变换模块84中经过量化后的输出数据。数据流902是第二确定模块86中的内部数据流,是CG大小确定单元92与扫描方式确定单元94之间的双向数据流。CG大小确定单元92将系数组的大小通过数据流902传递给扫描方式确定单元94;扫描方式确定单元94将指示扫描方式的参数通过数据流902传递给CG大小确定单元92。数据流903是第二确定模块86的输出数据,是对所述变换块进行熵编码使用的系数组的大小和指示扫描方式的参数。数据流903中还包括是否需要对所述变换块使用的系数组的大小、指示扫描方式的参数进行编码的标志信息。
第二确定模块86中,CG大小确定单元92实施例1中所述的确定系数组的大小的方法,确定系数组的大小,将系数组的大小的取值包括进数据流903。CG大小确定单元92使用的参数来自于数据流900、数据流901中传递的参数,以及在需要时从数据流902中获得扫描方式参数。扫描方式确定单元94使用实施例1中所述的确定变换块中变换系数的扫描方式的方法,确定扫描方式,将指示扫描方式的参数包括进数据流903。扫描方式确定单元94使用的参数来自于数据流900、数据流901中传递的参数,以及在需要时从数据流902中获得系数组的大小的取值。
可选地,第二确定模块86可以使用RDO的方法,联合确定变换块使用的系数组的大小和变换块中变换系数的扫描方式。一种可选用的实施方法是,第二确定模块86将扫描方式确定单元94的各候选扫描方式,依次通过数据流902传递给CG大小确定单元92;CG大小确定单元92确定各候选扫描方式下所述 变换块的系数组的大小;第二确定模块86计算使用各候选扫描方式与变换块的系数组的大小对所述变换块进行编码所产生的编码比特数;第二确定模块86选择编码比特数最小值对应的候选扫描方式和系数组的大小,将指示扫描方式的参数和系数组的大小的取值包括进数据流903。
可选地,第二确定模块86可以使用RDO的方法,联合确定变换块使用的系数组的大小和变换块中变换系数的扫描方式。另一种可选用的实施方法是,第二确定模块86将CG大小确定单元92的各候选系数组的大小的取值,依次通过数据流902传递给扫描方式确定单元94;扫描方式确定单元94确定各候选系数组的大小下所述变换块的扫描方式;第二确定模块86计算使用各候选系数组的大小与扫描方式对所述变换块进行编码所产生的编码比特数;第二确定模块86选择编码比特数最小值对应的候选系数组的大小和扫描方式,将系数组的大小的取值指示和扫描方式的参数包括进数据流903。
变换系数处理单元96对变换块中的变换参数进行参数化表示。变换系数处理单元96的输入数据是数据流901和数据流903,输出是数据流904。变换系数处理单元96根据数据流903中系数组的大小,将数据流901中变换块的变换系数划分成一个或多个系数组;根据数据流903中指示扫描方式的参数,对变换块中的变换系数进行扫描,将变换系数进行参数化表示。变换系数处理单元96使用数据流903中指示扫描方式的参数所指示的扫描顺序,依次对变换系数矩阵中的系数组进行处理。对于每个系数组,变换系数处理单元96使用数据流903中指示扫描方式的参数所指示的扫描顺序,依次对该系数组中的变换系数进行处理。这里,变换系数处理单元96对系数组的扫描顺序和对系数组中变换系数的扫描顺序可以是相同的,也可以是不同的。在扫描的过程中,变换系数处理单元96记录最后一个非0变换系数的位置,将指示该位置的数据包含进数据流904。变换系数处理单元96从包含最后一个非0变换系数的系数组开始,按照数据流903中指示扫描方式的参数所指示的扫描顺序,依次确定用于指示各系数组中的系数是否全部是0值变换系数(或指示各系数组中是否包含非0变换系数)的标志位,将该标志位的取值包含进数据流904。对于前述标志位指示对应系数组中存在非0变换系数的系数组,变换系数处理单元96按照数据流903中指示扫描方式的参数所指示的扫描顺序,依次确定所述系数组中各变换系数的取值是否为0的标志位,并将该标志位包含进数据流904。变换系数处理单元 96对于取值不等于0的变换系数,确定用于指示该变换系数符号(用于指示正值还是负值)的符号参数,将变换系数取值转换为其绝对值,将符号参数和变换系数的绝对值包含进入数据流904。另外,当数据流903中所述标志信息指示需要对所述变换块使用的系数组的大小进行编码时,变换系数处理单元96将数据流903中的系数组的大小包含进数据流904;当数据流903中所述标志信息指示需要对所述变换块使用的扫描方式进行编码时,变换系数处理单元96将数据流903中的指示扫描方式的参数包含进数据流904。数据流904是变换系数处理单元96的输出数据。
码流生成单元98对表示变换块中变换系数的参数进行编码,生成二进制编码比特,并将编码比特写入码流。码流生成单元的输入数据是数据流904和数据流905,输出是数据流906。数据流905是来自于编码器配置参数中的系数组的大小、扫描方式等一个或多个参数,所述配置参数用于指示变换块可以使用的系数组的大小,所述配置参数还可以用于指示变换块可以使用的扫描方式。特别地,如果编码器上可使用的系数组的大小的数量和取值是固定的,码流生成单元98不需要对数据流905中包含的与可使用的系数组的大小相关参数进行编码。特别地,如果编码器上可使用的扫描方式是固定的,码流生成单元98不需要对数据流905中包含的与可使用的扫描方式相关参数进行编码。码流生成单元98使用熵编码的方法,对数据流904和数据流905中的数据进行编码,得到二进制编码比特,将编码比特写入码流,得到数据流906。其中,所述码流中各字段的组织方式由视频编码标准定义。码流生成单元98可使用的熵编码方法包括等长编码、不等长编码、算数编码等。
需要说明的是,数据流指的是软件实现上函数的入口参数和返回参数,硬件实现上总线上传递的数据、存储单元之间共享的数据(包括寄存器共享数据)等。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
实施例4
在本实施例中还提供了一种图像的解码装置,该装置用于实现上述实施例 及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图10是根据本发明实施例的一种图像的解码装置的结构框图,如图10所示,该装置包括:解码模块1002,转换模块1004,处理模块1006、变换模块1008以及计算模块1010。
解码模块1002,用于对码流进行解析,确定所述解码块的预测值,所述解码块中变换系数的扫描方式、系数组的大小和变换系数相关的语法元素的取值;
转换模块1004,用于根据所述扫描方式和所述系数组的大小,对所述解码块中的系数组进行处理,将所述语法元素转换为所述系数组中的变换系数;
处理模块1006,用于对所述变换系数进行处理,得到变换系数的恢复值;
变换模块1008,用于对所述变换系数进行处理,并将处理后的数据进行一次或多次变换,得到所述解码块的预测差值;
计算模块1010,用于使用所述预测值和所述预测差值确定所述解码块的恢复值。
图11是根据本发明实施例的另一种图像的解码装置的结构框图,如图11所示,
解码模块1002确定变换块的系数组的大小和扫描方式。解码模块1002的输入数据包括数据流11000,输出数据是数据流11001。数据流11000是码流,是解码器的输入数据。解码模块1002按照视频编码标准中定义的码流组织结构和各字段的熵解码方法,对数据流11000进行解析,获得一个或多个参数集数据单元、一个或多个分片数据单元(包括分片头(Slice header)数据单元和分片数据(Slice data)数据单元)。解码模块1002解析分片数据数据单元中,获得一个或多个解码块的块层数据单元。解码模块1002获得的数据单元中包含的与系数组大小和扫描方式相关的参数,将当前解码块中包含的变换块使用的系数组的大小和扫描方式参数包含进数据流11001。数据流11001是解码模块1002的输出数据。解码模块1002可使用的熵解码方法包括:对使用等长编码产生的码字进行熵解码的方法、对使用不等长编码产生的码字进行熵解码的方法、对 使用算数编码产生的码字进行熵编码的方法。
解码模块1002从所获得的数据单元中读取相关参数,确定用于解码变换块中变换系数的系数组的大小。可选地,根据数据流11000中各数据单元所包含的字段数据,解码模块1002在参数集数据单元中,可以获得与可使用的系数组的大小相关的参数,确定解码过程中可使用的候选系数组的大小。可选地,根据数据流11000中各数据单元所包含的字段数据,解码模块1002在分片头信息数据单元中,可以获得与可使用的系数组的大小相关的参数,确定解码过程中可使用的候选系数组的大小,特别地,解码模块1002可以从分片头信息数据单元中获得的系数组的大小相关的参数,对应覆盖从参数集数据单元中获得的参数作为解码所述分片过程中可使用的系数组的大小的参数。解码模块1002使用块层数据单元中的参数,确定解码块中变换块所使用系数组的大小。解码模块1002将系数组的大小包含进入数据流11001。
解码模块1002从所获得的数据单元中读取相关参数,确定用于解码变换块中变换系数的扫描方式。可选地,根据数据流11000中各数据单元所包含的字段数据,解码模块1002在参数集数据单元中,可以获得与可使用的扫描方式相关的参数,确定解码过程中可使用的扫描方式。解码模块1002在参数集数据单元中获得的可使用扫描方式可以是固定路径的扫描方式,即在解码器中已经预先设定了扫描路径的扫描方式。特别地,解码模块1002在参数集数据单元中获得的可使用扫描方式可以是非固定路径的扫描方式,即由前述实施例3中写入参数集数据单元码流中的扫描路径。解码模块1002在参数集数据单元获得扫描方式相关的参数,可选地,所述参数转描述的是变换系数在扫描前后的坐标对应关系,例如,变换块中坐标位置等于(m,n)的变换系数(或者是索引序号等于m×nTbS+n,其中nTbS是变换块的宽度)对应的扫描后序号位置等于k。可选地,根据数据流11000中各数据单元所包含的字段数据,解码模块1002在分片头信息数据单元中,可以获得与可使用的扫描方式相关的参数,确定解码过程中可使用的候选扫描方式,特别地,解码模块1002可以从分片头信息数据单元中获得的扫描方式相关的参数,对应覆盖从参数集数据单元中获得的参数作为解码所述分片过程中可使用的扫描方式。解码模块1002使用块层数据单元中的参数,确定解码块中变换块所使用扫描方式。解码模块1002将解码过程中可使用的扫描方式参数进入数据流11001。
特别地,如果解码器上可使用的系数组的大小的数量和取值是固定的,解码模块1002不需要通过解析码流,而是通过读取解码器中预先存储的信息获得可使用的系数组的大小的数量和取值。特别地,如果解码器上可使用的扫描方式是固定的,解码模块1002不需要通过解析码流,而是通过读取解码器中预先存储的信息获得可使用的扫描方式。
解码模块1002解析码流中变换块对应的数据单元,除系数组的大小和扫描方式外,还获得与变换系数相关的参数,包括指示以下一个或多个信息的参数:变换块中最后一个非0系数的位置,系数组中包含的变换系数是否均为0(或等价于系数组中是否包含非0变换系数),变换系数的取值(或者变换系数的符号、变换系数的绝对值)。解码模块1002也将上述参数包含进数据流11001。
处理模块1006确定变换块中变换系数的恢复值。变换系数恢复单元的输入数据是数据流11001,输出是数据流11002。数据流11002中包含的是解码块中变换块的变换系数。数据流11002中,变换系数可以用M x N二维矩阵形式表示,其中,M和N是正整数,M和N可以相等,M和N也可以不相等。所述二维矩阵可以对应于一个变换块,以下叙述中使用“变换块”指代所述以M x N二维矩阵形式表示的变换系数。这里,当解码模块1002解析码流获得指示信息指示对所述变换块进行伸缩(Scaling)(也可称为反量化)操作的情况下,处理模块1006输出数据流11002中包含的所述变换系数恢复值对应于前述编码器中量化单元209输出的是系数的量化值(即“Level”值),解码器将数据流11002作为反量化单元305的输入数据;反之,当解码模块1002解析码流获得指示信息指示不对所述变换块进行伸缩操作的情况下,处理模块1006输出数据流11002中包含的所述变换系数恢复值对应于前述编码器中变换单元84输出的是所述预测差进行变换后得到的数据,解码器将数据流11002作为反变换单元306的输入数据。
处理模块1006根据变换块的大小和系数组的大小,确定变换块包含的各系数组的位置。所述系数组的位置可以表示为系数组中左上角系数在变换块(或解码图像)中的位置坐标。处理模块1006根据数据流11001中扫描方式指示的顺序,依次对系数组进行处理。对于一个系数组,处理模块1006根据所述扫描方式指示的顺序,将系数组中对应元素的取值设置为解析码流获得的变换系数取值。特别地,当处理模块1006从数据流11001中得到指示一个系数组中包含 的变换系数均为0(或等价于系数组中不包含非0变换系数)时,解析单元将该系数组中包含的系数全部设置为0。特别地,当处理模块1006从数据流11001中获得了最后一个非0系数位置时,按照扫描顺序,处理模块1006将最后一个非0系数位置后的其他系数的取值设置为0。特别地,这里,处理模块1006对变换块中系数组的处理顺序和对系数组中变换系数的处理顺序可以是相同的,也可以是不同的。处理模块1006将恢复的变换块(即以二维矩阵形式(或可等价于二维矩阵的其他数据形式)表示的变换系数)包含进数据流11002。
需要说明的是,数据流指的是软件实现上函数的入口参数和返回参数,硬件实现上总线上传递的数据、存储单元之间共享的数据(包括寄存器共享数据)等。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
实施例5
图12是一种包含上述所示图像的编码装置的电子设备图。如图12所示,该装置包括:采集单元1202,图像的编码装置1204以及存储或发送单元1206。
采集单元1202采集视频或图像。采集单元1202可以是包含至少一个摄像头用于采集自然视频或自然图像;可选择地,采集单元1202还可以配置用于采集深度视频或深度图像的摄像头;可选择地,采集单元还可以配置红外摄像头;可选择地,采集单元还可以配置遥感摄像头。采集单元1202可以是包含通过放射线透射或扫描产生视频或图像的装置或设备。
可选择地,采集单元1202中可以对输入视频或图像进行前处理,例如,自动聚焦、自动白平衡、自动曝光、背光补偿、降噪、锐化、拼接、提升或降低图像分辨率、提升或降低视频帧率、虚拟视图合成等。
采集单元1202也可以接收其它设备或单元输出的视频或图像,例如,采集单元1202可以是转码器(Transcoder)中的一个组成单元,Transcoder将部分解码的图像输入采集单元1202。例如,采集单元1202接收通过数据连接从其他设备传递过来的视频或图像。
需要说明的是,除视频或图像外,采集单元1202也可以采集其他媒体信息, 例如音频。采集单元1202也可以接收人工产生的信息,例如文字、字幕、计算机产生的图片或视频等。
图像的编码装置1204是图2所示的编码器。图像的编码装置1204的输入是采集单元1202输出的视频或图像。图像的编码装置1204对视频或图像进行编码,输出视频或图像码流。
存储或发送单元1206接收图像的编码装置1204输出的视频或图像码流,对其进行系统层处理,例如,按照传输协议、媒体文件格式等标准进行打包(Encapsulation)。存储或发送单元1206将系统层处理后的得到的传输流或媒体文件存储至所述电子设备的存储器中,或者通过有线、无线网络进行发送。
需要说明的是,除图像的编码装置1204输出的视频或图像码流外,存储或发送单元1206的输入还可以包括音频码流、文字、字幕、图片等。存储或发送单元1206按照媒体文件格式、传输协议等标准将这些输入与图像的编码装置1204输出的码流打包在传输流或媒体文件中。
本实施例所述的电子设备可以是视频通信应用中能够生成或处理视频或图像码流的设备,例如,手机、计算机、媒体服务器、便携式移动终端、数字摄像机、数字照相机、电视广播系统设备、内容分发网络设备、监控摄像头、会议电视系统设备等。
实施例6:
图13是一种包含上述所示图像的解码装置的电子设备图。如图13所示,包括:
接收单元1302接收视频或图像码流。接收单元1302从有线、无线网络接收视频或图像码流,或者读取所述电子设备存储器获得视频或图像码流,或者接收通过数据连接从其他设备传递过来的视频或图像码流。
接收单元1302的输入还可以是包含视频或图像码流的传输流或媒体文件。接收单元1302根据传输协议、媒体文件格式等标准从接收到的传输流或媒体文件中提取视频或图像码流。
接收单元1302将视频或图像码流输出给图像的解码装置1304。
需要说明的是,除视频或图像码流外,接收单元1302的输出还可以包括音 频码流、文字、字幕、图片等。接收单元1302将这些输出传递给所述电子设备中对应的处理单元。例如,接收单元1302将音频码流输出给所述电子设备中包含的音频解码器。
图像的解码装置1304是图3所示的解码器。图像的解码装置1304的输入是接收单元1302输出的视频或图像码流。图像的解码装置1304对视频或图像码流进行解码,输出解码恢复的视频或图像。
呈现(Rendering)单元1306接收图像的解码装置1304输出的解码恢复的视频或图像。呈现单元1306将解码恢复的视频或图像呈现给观看者(Viewer)。呈现单元1306可以是所述电子设备的一个组成部分,例如显示屏;也可以是通过数据连接与所述电子设备连接的独立设备,例如投影机、显示器等。可选择地,呈现单元1306可以对解码恢复的视频或图像进行后处理,例如自动调焦、自动白平衡、自动曝光调整、背光补偿、降噪、锐化、拼接、提升或降低图像分辨率、提升或降低视频帧率、虚拟视图合成等。
需要说明的是,除所述解码恢复的视频或图像外,呈现单元1306的输入还可以包括来自所述电子设备其他单元输出的媒体数据,例如音频、文字、字幕、图片,等。呈现单元1306的输入还包括人工产生的数据,例如远程教育应用中本地授课者对重点内容的划线等标注数据。呈现单元1306将输入的媒体数据进行叠合后显示给观看者。
本实施例所述的电子设备可以是视频通信应用中能够解码或处理视频或图像码流的设备,例如,手机、计算机、机顶盒、电视机、播放器、媒体服务器、便携式移动终端、数字摄像机、数字照相机、电视广播系统设备、内容分发网络设备、会议电视系统设备等。
实施例7
图14是一种包含上述所示电子设备的电子系统。如图14所示,
信源设备1402是图12所示的电子设备。
存储或传输网络1404可以包括设备或电子系统的存储器、通过数据连接进行数据读写操作的外部存储器;也可以包括有线网络、无线网络组成的数据传 输网络。存储或传输网络1404为信源设备1402中存储或发送单元803提供了存储器或数据传输网络。
信宿设备1406是图13所示的电子设备。信宿设备1406中接收单元901接收存储或传输网络1404提供视频或图像码流、包含视频或图像码流的传输流或者包含视频或图像码流的媒体文件。
本实施例所述的电子系统可以是视频通信应用中能够生成、存储或传输和解码视频或图像码流的系统或设备,例如,手机、计算机、IPTV系统、OTT系统、互联网多媒体系统、数字电视广播系统、监控系统、便携式移动终端、数字摄像机、数字照相机、会议电视系统设备等
实施例8
本发明的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (102)

  1. 一种图像编码方法,包括:
    确定编码块的预测值,计算所述编码块与所述预测值的预测差值;
    对所述预测差值进行至少一次的变换,得到变换数据,使用所述变换数据确定变换系数;
    确定所述变换系数的扫描方式和系数组的大小,将所述变换系数划分成至少一个系数组,根据所述扫描方式扫描每个所述系数组中包含的变换系数,将所述变换系数转换为至少一个语法元素;
    对所述系数组的大小和所述语法元素的取值进行编码,将编码比特写入码流。
  2. 根据权利要求1所述的方法,其中,确定所述编码块的预测值,包括:
    将至少一个已编码的图像作为参考图像,确定编码块的预测值;或,将所述编码块所在的图像中的已编码部分作为参考,确定所述编码块的预测值。
  3. 根据权利要求1所述的方法,其中,使用所述变换数据确定变换系数,包括:
    在确定对所述变换数据进行量化的情况下,对所述变换数据进行量化处理,得到所述变换系数;
    在确定不对所述变换数据进行量化的情况下,使用所述变换数据设置所述变换系数。
  4. 根据权利要求1所述的方法,其中,确定所述变换系数的系数组的大小,包括:
    根据预设的候选值确定所述变换系数的系数组的大小。
  5. 根据权利要求4所述的方法,其中,根据预设的候选值确定所述变换系数的系数组的大小,包括:
    使用率失真优化的方法,从预设的候选值中确定所述变换系数的系数组的大小。
  6. 根据权利要求5所述的方法,其中,使用率失真优化的方法,从预设的候选值中确定所述变换系数的系数组的大小,包括:
    计算使用所述候选值中的数值作为系数组的大小时所述变换系数的编码比特数,选择使得所述编码比特数最小的所述候选值中的数值作为所述变换系数的系数组的大小。
  7. 根据权利要求5所述的方法,其中,根据预设的候选值确定所述变换系 数的系数组的大小,包括:
    根据所述变换系数的分布情况确定所述变换系数的系数组的大小。
  8. 根据权利要求7所述的方法,其中,
    所述变换系数的分布情况是指对所述变换系数进行扫描后检测的所述变换系数中非0系数的集中程度,其中,所述非0系数的集中程度指的是所述变换系数的非0系数之间0值系数的数量,所述0值系数的数量越小表示非0系数的集中程度越高;
    所述根据所述变换系数的分布情况确定所述变换系数的系数组的大小,包括:从所述预设的候选值中选择可使得所述集中程度最高的所述候选值中的数值作为所述变换系数的系数组的大小。
  9. 根据权利要求5所述的方法,其中,所述候选值包括至少之一:
    至少一个固定数值;配置的至少一个数值;所述编码块相邻已编码块使用的系数组的大小的取值。
  10. 根据权利要求9所述的方法,其中,在所述预设的候选值是所述配置的至少一个数值的情况下,还包括:
    将所述候选值的标识参数写入所述码流的至少一个数据单元中,其中,所述标识参数用于指示所述配置的所述至少一个数值;所述码流中的数据单元包含以下至少之一:至少一个参数集,分片头以及块层数据单元。
  11. 根据权利要求10所述的方法,其中,所述候选值的标识参数,包括以下至少之一:
    系数组的大小,系数组的边长,系数组的宽度和高度。
  12. 根据权利要求11所述的方法,其中,将所述候选值的标识参数写入所述码流的至少一个数据单元中,包括:使用以下至少一种方式将所述候选值的标识参数写入所述码流的至少一个数据单元中:
    将所述标识参数的最大值和最小值写入所述码流的至少一个数据单元中;
    将所述标识参数的最大值和所述系数组的最大划分层次写入所述码流的至少一个数据单元中;
    将所述标识参数的最大值和所述系数组的大小的最大值与最小值之间的差值写入所述码流的至少一个数据单元中;
    将所述标识参数的最小值和所述系数组的最大向上划分层次写入所述码流的至少一个数据单元中;
    将所述标识参数的最小值和所述系数组的大小的最大值与最小值之间的差值写入所述码流的至少一个数据单元中。
  13. 根据权利要求11所述的方法,其中,将所述候选值的标识参数写入所述码流的至少一个数据单元中,包括:
    将所述标识参数的默认值写入所述码流的至少一个数据单元中。
  14. 根据权利要求10所述的方法,其中,所述预设的候选值的标识参数,包括:
    所述标识参数是至少一个标志位,指示对应的系数组的大小是否是所述候选值中包含的系数组的大小。
  15. 根据权利要求10所述的方法,其中,所述预设的候选值的标识参数,包括:
    所述标识参数指示预设的至少一个预测模式对应的至少一个系数组的大小。
  16. 根据权利要求10所述的方法,其中,所述预设的候选值的标识参数,包括:
    所述标识参数指示预设的至少一次变换对应的至少一个系数组的大小。
  17. 根据权利要求10所述的方法,其中,所述预设的候选值的标识参数,包括:
    所述标识参数指示预设的至少一个变换类型对应的至少一个系数组的大小。
  18. 根据权利要求10所述的方法,其中,所述预设的候选值的标识参数,包括:
    所述标识参数指示预设的至少一个量化参数对应的至少一个系数组的大小;
    或者,
    所述标识参数指示预设的至少一个量化参数取值范围对应的至少一个系数组的大小。
  19. 根据权利要求10所述的方法,其中,所述预设的候选值的标识参数,包括:
    所述标识参数指示预设的档次/等级/级别Profile/Tier/Level对应的至少一个系数组的大小。
  20. 根据权利要求1所述的方法,其中,所述确定所述变换系数的系数组的大小,包括:
    根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,其中,所述第一编码参数包括以下至少之一:所述编码块中包含的变换块的大小、所述编码块的预测模式、所述编码块中包含的变换块使用的变换类型、量化参数。
  21. 根据权利要求20所述的方法,其中,根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,包括:
    在所述编码块中包含的变换块的大小等于第一预设值的情况下,将所述系数组的大小设置为所述第一预设值对应的系数组的大小。
  22. 根据权利要求20所述的方法,其中,根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,包括:
    在所述编码块的预测模式等于第一预设模式的情况下,将所述系数组的大小设置为所述第一预设模式对应的系数组的大小。
  23. 根据权利要求20所述的方法,其中,根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,包括:
    在所述编码块中包含的变换块使用的变换类型等于第一变换类型的情况下,将所述系数组的大小设置为所述第一变换类型对应的系数组的大小。
  24. 根据权利要求20所述的方法,其中,根据所述编码块的第一编码参数,将所述编码块中所述变换系数的系数组的大小设置为所述第一编码参数对应的系数组的大小,包括:
    在所述量化参数的取值等于第二预设值的情况下,将所述系数组的大小设置为所述第二预设值对应的系数组的大小;
    或者,
    在所述量化参数的取值在第一预设取值范围内时,将所述系数组的大小设置为所述第一预设取值范围对应的系数组的大小。
  25. 根据权利要求1所述的方法,其中,所述确定所述变换系数的扫描方式,包括:
    根据预设的候选扫描方式为所述变换系数确定扫描方式,其中,所述扫描 方式为对所述变换系数的二维矩阵中元素的处理顺序。
  26. 根据权利要求25所述的方法,其中,根据预设的候选扫描方式为所述变换系数确定扫描方式,包括:
    使用率失真优化的方法,从预设的候选扫描方式中确定所述变换系数的扫描方式。
  27. 根据权利要求26所述的方法,其中,使用率失真优化的方法,从预设的候选扫描方式中确定所述变换系数的扫描方式,包括:
    计算使用预设的候选扫描方式中的扫描方式时所述变换系数的编码比特数,选择可使得所述编码比特数最小的所述候选扫描方式中的扫描方式作为所述变换系数的扫描方式。
  28. 根据权利要求25所述的方法,其中,根据预设的候选扫描方式为所述变换系数确定扫描方式,包括:
    根据所述变换系数的分布情况确定所述变换系数的扫描方式。
  29. 根据权利要求28所述的方法,其中,
    所述变换系数的分布情况是指对所述变换系数进行扫描后检测的所述变换系数中非0系数的集中程度,其中,所述非0系数的集中程度指的是所述变换系数的非0系数之间0值系数的数量,所述0值系数的数量越小表示非0系数的集中程度越高;
    所述根据所述变换系数的分布情况确定所述变换系数的扫描方式包括:从预设的候选扫描方式中选择可使得所述集中程度最高的所述候选值中的扫描方式作为所述变换系数的扫描方式。
  30. 根据权利要求25所述的方法,其中,所述候选扫描方式包括至少之一:
    至少一个固定扫描方式;配置的至少一个扫描方式;所述编码块相邻已编码块使用的扫描方式。
  31. 根据权利要求30所述的方法,其中,在所述候选扫描方式是所述配置的至少一个扫描方式的情况下,还包括:
    将候选扫描方式参数写入所述码流的至少一个数据单元中,其中,所述候选扫描方式参数用于指示所述配置的所述候选扫描方式;所述码流中的数据单元包含以下至少之一:至少一个参数集,分片头,块层数据单元。
  32. 根据权利要求31所述的方法,其中,所述候选扫描方式参数,包括:
    所述变换系数的二维矩阵中元素的处理顺序。
  33. 根据权利要求31所述的方法,其中,所述候选扫描方式参数,包括:
    所述候选扫描方式参数的默认值。
  34. 根据权利要求31所述的方法,其中,所述候选扫描方式参数,包括:
    所述候选扫描方式参数是至少一个标志位,指示对应的扫描方式是否包含在所述候选扫描方式中。
  35. 根据权利要求31所述的方法,其中,所述候选扫描方式参数,包括:
    所述候选扫描方式的参数指示预设的至少一个预测模式对应的至少一个扫描方式。
  36. 根据权利要求31所述的方法,其中,所述候选扫描方式参数,包括:
    所述候选扫描方式参数指示预设的至少一次变换对应的至少一个扫描方式。
  37. 根据权利要求31所述的方法,其中,所述候选扫描方式参数,包括:
    所述候选扫描方式参数指示预设的至少一个变换类型对应的至少一个扫描方式。
  38. 根据权利要求31所述的方法,其中,所述候选扫描方式参数,包括:
    所述候选扫描方式参数指示预设的至少一个量化参数对应的至少一个扫描方式;
    或者,
    所述候选扫描方式参数指示预设的至少一个量化参数取值范围对应的至少一个扫描方式。
  39. 根据权利要求31所述的方法,其中,所述候选扫描方式参数,包括:
    所述候选扫描方式参数指示预设的Profile/Tier/Level对应的至少一个扫描方式。
  40. 根据权利要求1所述的方法,其中,所述确定所述变换系数的扫描方式,包括:
    根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式;
    其中,所述第二编码参数至少包括以下其中之一:所述编码块中包含的变换块的大小、所述编码块的预测模式、所述编码块中包含的变换块使用的变换类型、所述编码块的大小;所述扫描方式为对所述变换系数的二维矩阵中元素 的处理顺序。
  41. 根据权利要求40所述的方法,其中,根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式,包括:
    在所述编码块中包含的变换块的大小等于第三预设值的情况下,将所述变换系数的扫描方式设置为所述第三预设值对应的扫描方式。
  42. 根据权利要求40所述的方法,其中,根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式,包括:
    在所述编码块的预测模式等于第二预设模式的情况下,将所述变换系数的扫描方式设置为所述第二预设模式对应的扫描方式。
  43. 根据权利要求40所述的方法,其中,根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式,包括:
    在所述编码块中包含的变换块使用的变换类型等于第二变换类型的情况下,将所述变换系数的扫描方式设置为所述第二变换类型对应的扫描方式。
  44. 根据权利要求40所述的方法,其中,根据所述变换块的第二编码参数,将所述编码块中所述变换系数的扫描方式设置为所述第二编码参数对应的系数组的扫描方式,包括:
    在所述编码块的大小等于第四预设值的情况下,将所述变换系数的扫描方式设置为所述第四预设值对应的扫描方式。
  45. 根据权利要求1所述的方法,其中,所述确定所述变换系数的扫描方式和系数组的大小,包括:
    使用率失真优化的方法,联合确定所述变换系数的系数组的大小和扫描方式。
  46. 根据权利要求1所述的方法,其中,将所述变换系数划分成至少一个系数组,根据所述扫描方式扫描每个所述系数组中包含的变换系数,将所述变换系数转换为至少一个语法元素,包括:
    根据所述系数组的大小和扫描方式,将所述变换系数划分成至少一个系数组,根据所述扫描方式扫描每个所述系数组中包含的变换系数,将所述变换系数表示为以下语法元素的至少之一:
    指示非0系数起始位置的语法元素;
    指示系数组中包含非0系数的语法元素;
    指示系数组中非0系数位置的语法元素;
    指示系数组中非0系数取值的语法元素。
  47. 根据权利要求1所述的方法,其中,对所述系数组的大小进行编码,包括:
    将所述变换系数使用的系数组的大小使用以下之一方式进行编码:
    编码所述系数组的大小;
    编码所述系数组的大小对应的索引序号的取值;
    设置所述系数组的大小对应的标志位,编码所述标志位的取值。
  48. 根据权利要求1所述的方法,其中,将编码比特写入码流,包括:
    将编码比特写入码流中的数据单元,所述码流中的数据单元包含以下至少之一:一个或多个参数集,分片头,块层数据单元。
  49. 一种图像的解码方法,包括:
    解析码流,确定解码块的预测值;
    解析所述码流,确定所述解码块中变换系数的扫描方式、系数组的大小和变换系数相关的语法元素的取值;
    根据所述扫描方式和所述系数组的大小,对所述解码块中的系数组进行处理,将所述语法元素的取值转换为所述系数组中的变换系数;
    对所述变换系数进行处理,得到变换系数的恢复值;
    对所述变换系数的恢复值进行至少一次变换,得到所述解码块的预测差值;
    使用所述预测值和所述预测差值确定所述解码块的恢复值。
  50. 根据权利要求49所述的方法,其中,所述解析码流,确定所述解码块的预测值,包括以下方法的至少之一:
    解析所述码流,获取所述解码块的帧间预测参数;根据所述帧间预测参数,将至少一个已解码的图像作为参考图像,确定所述解码块的预测值。
    或,解析所述码流,获取所述解码块的帧内预测参数;根据所述帧内预测参数,将所述解码块所在的图像中的已解码部分作为参考,确定所述解码块的预测值。
  51. 根据权利要求49所述的方法,其中,解析所述码流,确定所述解码块中变换系数的系数组的大小,包括:
    解析所述码流,从所述码流中的数据单元获取第一系数组参数,根据所述第一系数组参数确定所述系数组的大小;其中,所述码流中的数据单元包含以下至少之一:至少一个参数集,分片头,块层数据单元。
  52. 根据权利要求51所述的方法,其中,根据所述第一系数组参数确定所述系数组的大小,包括:
    使用所述第一系数组参数设置所述系数组的大小。
  53. 根据权利要求51所述的方法,其中,根据所述第一系数组参数确定所述系数组的大小,包括:
    所述第一系数组参数指示了所述解码块的相邻已解码块,使用所述相邻已解码块的系数组的大小设置所述系数组的大小。
  54. 根据权利要求51所述的方法,其中,根据所述第一系数组参数确定所述系数组的大小,包括:
    根据所述第一系数组参数从系数组的大小的候选值中确定所述解码块的变换系数的系数组的大小。
  55. 根据权利要求54所述的方法,还包括:
    所述第一系数组参数包含索引序号,使用所述候选值中与所述索引号对应的系数组的大小来设置所述系数组的大小。
  56. 根据权利要求54所述的方法,还包括:
    所述第一系数组参数包含标志位,使用所述候选值中与所述标志位对应的系数组的大小来设置所述系数组的大小。
  57. 根据权利要求54所述的方法,其中,
    所述系数组的大小的候选值是至少一个固定数值。
  58. 根据权利要求54所述的方法,还包括:
    所述第一系数组参数中包含标识参数,使用所述标识参数配置所述系数组的大小的候选值。
  59. 根据权利要求58所述的方法,其中,所述标识参数包括以下至少之一:
    系数组的大小,系数组的边长,系数组的宽度和高度。
  60. 根据权利要求58所述的方法,其中,使用所述标识参数配置所述系数组的大小的候选值,包括:通过以下至少一种方式,使用所述标识参数配置所述系数组的大小的候选值:
    获得所述标识参数的最大值和最小值,按照预设的划分方式确定所述标识参数除所述最大值和最小值之外的取值,使用所述标识参数的取值设置所述候选值;
    获得所述标识参数的最大值和所述系数组的最大划分层次,按照所述预设的划分方式确定所述标识参数的最大值之外的取值,使用所述标识参数的取值设置所述候选值;
    获得所述标识参数的最大值和所述系数组的大小的最大值与最小值之间的差值,按照所述预设的划分方式确定所述标识参数的最大值之外的取值,使用所述标识参数的取值设置所述候选值;
    获得所述标识参数的最小值和所述系数组的最大向上划分层次,按照所述预设的划分方式确定所述标识参数的最小值之外的取值,使用所述标识参数的取值设置所述候选值;
    获得所述标识参数的最小值和所述系数组的大小的最大值与最小值之间的差值,按照所述预设的划分方式确定所述标识参数的最小值之外的取值,使用所述标识参数的取值设置所述候选值。
  61. 根据权利要求60所述的方法,其中,所述预设的划分方式包括以下至少之一:
    四分式划分,三分式划分,二分式划分。
  62. 根据权利要求59所述的方法,其中,使用所述标识参数配置所述系数组的大小的候选值,包括:
    使用所述标识参数的默认值设置所述候选值。
  63. 根据权利要求59所述的方法,其中,使用所述标识参数配置所述系数组的大小的候选值,包括:
    所述标识参数是至少一个指示对应的系数组的大小是否包含在所述候选值中的标志位,根据所述标识参数设置所述候选值中包含的系数组的大小。
  64. 根据权利要求59所述的方法,其中,使用所述标识参数配置所述系数组的大小的候选值,包括:
    所述标识参数指示预设的Profile/Tier/Level对应的至少一个系数组的大小,根据所述标识参数设置所述候选值中包含的系数组的大小。
  65. 根据权利要求51所述的方法,其中,根据所述第一系数组参数确定所述系数组的大小,包括:
    所述第一参数组参数中包含所述解码块的第一解码参数,根据所述解码块 的第一解码参数,将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,其中,所述第一解码参数至少包括以下其中之一:所述解码块中包含的变换块的大小、所述解码块的预测模式、所述解码块中包含的变换块使用的变换类型、量化参数。
  66. 根据权利要求65所述的方法,其中,所述将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,包括:
    在所述解码块中包含的变换块的大小等于第一预设值的情况下,将所述系数组的大小设置为所述第一预设值对应的系数组的大小。
  67. 根据权利要求66所述的方法,还包括:
    根据所述第一参数组参数,获得与所述第一预设值相对应的系数组的大小。
  68. 根据权利要求65所述的方法,其中,所述将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,包括:
    在所述解码块的预测模式等于第一预设模式的情况下,将所述系数组的大小设置为所述第一预设模式对应的系数组的大小。
  69. 根据权利要求68所述的方法,还包括:
    根据所述第一参数组参数,获得与所述第一预设模式相对应的系数组的大小。
  70. 根据权利要求65所述的方法,其中,所述将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,包括:
    在所述解码块中包含的变换块使用的变换类型等于第一变换类型的情况下,将所述系数组的大小设置为所述第一变换类型对应的系数组的大小。
  71. 根据权利要求70所述的方法,还包括:
    根据所述第一参数组参数,获得与所述第一变换类型相对应的系数组的大小。
  72. 根据权利要求65所述的方法,其中,所述将所述系数组的大小设置为所述第一解码参数对应的系数组的大小,包括:
    在所述量化参数的取值等于第二预设值的情况下,将所述系数组的大小设置为所述第二预设值对应的系数组的大小;
    或者,
    在所述量化参数的取值在第一预设取值范围内的情况下,将所述系数组的大小设置为所述第一预设取值范围对应的系数组的大小。
  73. 根据权利要求72所述的方法,还包括:
    根据所述第一参数组参数,获得与所述第二预设值相对应的系数组的大小。
    或者,
    根据所述第一参数组参数,获得与所述第一预设取值范围相对应的系数组的大小。
  74. 根据权利要求49所述的方法,其中,所述对所述码流进行解析,确定所述变换系数的扫描方式,包括:
    解析所述码流中的数据单元获取第一扫描方式参数,根据所述第一扫描方式参数确定所述变换系数的扫描方式;其中,所述扫描方式为对所述变换系数的二维矩阵中元素的处理顺序;所述码流中的数据单元包含以下至少之一:至少一个参数集,分片头,块层数据单元。
  75. 根据权利要求74所述的方法,其中,根据所述第一扫描方式参数确定所述变换系数的扫描方式,包括:
    使用所述第一扫描方式参数指示的扫描方式作为所述变换系数的扫描方式。
  76. 根据权利要求75所述的方法,其中,使用所述第一扫描方式参数指示的扫描方式作为所述变换系数的扫描方式,包括:
    所述第一扫描方式参数指示了所述解码块的相邻已解码块,使用所述相邻已解码块的扫描方式设置所述变换系数的扫描方式。
  77. 根据权要求75所述的方法,其中,使用所述第一扫描方式参数指示的扫描方式作为所述变换系数的扫描方式,包括:
    根据所述第一扫描方式参数从候选扫描方式中确定所述变换系数的扫描方式。
  78. 根据权利要求77所述的方法,还包括:
    所述第一扫描方式参数包含扫描方式索引序号,使用所述候选扫描方式中与所述扫描方式索引序号对应的扫描方式来设置所述变换系数的扫描方式。
  79. 根据权利要求77所述的方法,还包括:
    所述第一扫描方式参数包含扫描方式指示标志位,使用所述候选扫描方式中与所述扫描方式指示标志位对应的扫描方式来设置所述变换系数的扫描方式。
  80. 根据权利要求77所述的方法,其中,所述候选扫描方式包括至少之一:
    至少一个固定扫描方式;使用所述第一扫描方式参数配置的所述候选扫描方式。
  81. 根据权利要求80所述的方法,其中,使用所述第一扫描方式参数配置所述候选扫描方式,包括:
    所述第一扫描方式参数包含默认扫描方式,使用所述默认扫描方式设置所述候选扫描方式。
  82. 根据权利要求80所述的方法,其中,使用所述第一扫描方式参数配置所述候选扫描方式,包括:
    所述第一候选扫描方式参数包含至少一个候选扫描方式指示标志位,使用所述至少一个候选扫描方式指示标志位对应的扫描方式设置所述候选扫描方式。
  83. 根据权利要求80所述的方法,其中,使用所述第一扫描方式参数配置所述候选扫描方式,包括:
    使用所述第一扫描方式参数指示的预设的Profile/Tier/Level对应的至少一个扫描方式设置所述候选扫描方式。
  84. 根据权利要求80所述的方法,其中,使用所述第一扫描方式参数配置所述候选扫描方式,包括:
    使用所述第一扫描方式参数指示的所述变换系数的位置与扫描后的变换系数的位置之间的对应关系设置所述候选扫描方式。
  85. 根据权利要求74所述的方法,其中,根据所述第一扫描方式参数确定所述变换系数的扫描方式,包括:
    所述第一扫描方式参数包含所述解码块的第二解码参数;
    根据所述第二解码参数,确定所述变换系数的扫描方式,其中所述第二解码参数至少包括以下其中之一:所述解码块中包含的变换块的大小、所述解码块的预测模式、所述解码块中包含的变换块使用的变换类型、所述解码块的大小。
  86. 根据权利要求85所述的方法,其中,根据所述第二解码参数,确定所述变换系数的扫描方式,包括:
    在所述解码块中包含的变换块的大小等于第三预设值的情况下,将所述变换系数的扫描方式设置为所述第三预设值对应的扫描方式。
  87. 根据权利要求86所述的方法,还包括:
    根据所述第一参数组参数,获得与所述第三预设值相对应的扫描方式。
  88. 根据权利要求85所述的方法,其中,根据所述第二解码参数,确定所述变换系数的扫描方式,包括:
    在所述解码块的预测模式等于第二预设模式的情况下,将所述变换系数的扫描方式设置为所述第二预设模式对应的扫描方式。
  89. 根据权利要求88所述的方法,还包括:
    根据所述第一参数组参数,获得与所述第二预设模式相对应的扫描方式。
  90. 根据权利要求85所述的方法,其中,根据所述第二解码参数,确定所述变换系数的扫描方式,包括:
    在所述解码块中包含的变换块使用的变换类型等于第二变换类型的情况下,将所述变换系数的扫描方式设置为所述第二变换类型对应的扫描方式。
  91. 根据权利要求90所述的方法,还包括:
    根据所述第一参数组参数,获得与所述第二变换类型相对应的扫描方式。
  92. 根据权利要求85所述的方法,其中,根据所述第二解码参数,确定所述变换系数的扫描方式,包括:
    在所述解码块的大小等于第四预设值的情况下,将所述变换系数的扫描方式设置为所述第四预设值对应的扫描方式。
  93. 根据权利要求90所述的方法,还包括:
    根据所述第一参数组参数,获得与第四预设值相对应的扫描方式。
  94. 根据权利要求49所述的方法,其中,
    所述语法元素包括以下至少之一:
    指示非0系数起始位置的语法元素;
    指示系数组中包含非0系数的语法元素;
    指示系数组中非0系数位置的语法元素;
    指示系数组中非0系数取值的语法元素。
  95. 根据权利要求49所述的方法,其中,所述对所述变换系数进行处理,得到变换系数的恢复值,包括:
    在判断对所述变换系数进行伸缩Scaling处理的情况下,对所述变换数据进行伸缩处理,得到所述变换系数的恢复值;
    在判断不对所述变换数据进行伸缩处理的情况下,使用所述变换系数设置 所述变换系数的恢复值。
  96. 根据权利要求95的方法,其中,在所述对所述变换系数进行处理之前,还包括:
    解析所述码流,获取用于构造所述解码块的预测差值的恢复值的第三参数;
    根据所述第三参数,判断是否对所述变换系数进行伸缩处理。
  97. 根据权利要求96所述的方法,使用所述预测值和所述预测差值确定所述解码块的恢复值,包括:
    对所述预测值和所述预测差值的和值进行环路滤波处理。
  98. 一种图像的编码装置,位于编码器中,包括:
    第一确定模块,设置为确定编码块的预测值,计算所述编码块与所述预测值的预测差值;
    变换模块,设置为对所述预测差值进行至少一次的变换,得到变换数据,使用所述变换数据确定变换系数;
    第二确定模块,设置为确定所述变换系数的扫描方式和系数组的大小,将所述变换系数划分成至少一个系数组,根据所述扫描方式扫描每个所述系数组中包含的变换系数,将所述变换系数转换为至少一个语法元素;
    编码模块,设置为对所述系数组的大小和所述语法元素的取值进行编码,将编码后的比特写入码流。
  99. 一种图像的解码装置,包括:
    解码模块,设置为对码流进行解析,确定所述解码块的预测值,所述解码块中变换系数的扫描方式、系数组的大小和变换系数相关的语法元素的取值;
    转换模块,设置为根据所述扫描方式和所述系数组的大小,对所述解码块中的系数组进行处理,将所述语法元素转换为所述系数组中的变换系数;
    处理模块,设置为对所述变换系数进行处理,得到变换系数的恢复值;
    变换模块,设置为对所述变换系数进行处理,并将处理后的数据进行至少一次变换,得到所述解码块的预测差值;
    计算模块,设置为使用所述预测值和所述预测差值确定所述解码块的恢复值。
  100. 一种电子设备,包括:如权利要求98所述的编码装置,采集设备以及存储设备,其中,
    所述采集设备,设置为采集所述编码块对应的图像,并对所述图像进行预处理后输出;
    所述存储设备,设置为接收输出的码流,并在对所述码流进行系统层处理后进行存储。
  101. 一种电子设备,包括:如权利要求99所述的解码装置,接收设备以及显示设备,其中,
    所述接收设备,设置为对码流进行接收;
    所述显示设备,设置为将恢复后的图像进行显示。
  102. 一种存储介质,所述存储介质中存储有计算机程序,所述计算机程序被设置为运行时执行所述权利要求1-48以及49-97任一项中所述的方法。
PCT/CN2019/088325 2018-06-27 2019-05-24 图像的编码、解码方法及装置、电子设备及系统 WO2020001210A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP19826712.2A EP3817385A4 (en) 2018-06-27 2019-05-24 PICTURE CODING METHOD AND APPARATUS, PICTURE DECODING METHOD AND APPARATUS, ELECTRONIC DEVICE AND SYSTEM
JP2020571788A JP7271580B2 (ja) 2018-06-27 2019-05-24 画像の符号化・復号化方法および装置、電子機器ならびにシステム
US17/255,044 US11647196B2 (en) 2018-06-27 2019-05-24 Method and apparatus for encoding image, method and apparatus for decoding image, electronic device, and system
KR1020217002590A KR102569844B1 (ko) 2018-06-27 2019-05-24 이미지 인코딩, 디코딩 방법 및 장치, 전자 설비 및 시스템

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810681664.7 2018-06-27
CN201810681664.7A CN110650343B (zh) 2018-06-27 图像的编码、解码方法及装置、电子设备及系统

Publications (1)

Publication Number Publication Date
WO2020001210A1 true WO2020001210A1 (zh) 2020-01-02

Family

ID=68985551

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/088325 WO2020001210A1 (zh) 2018-06-27 2019-05-24 图像的编码、解码方法及装置、电子设备及系统

Country Status (5)

Country Link
US (1) US11647196B2 (zh)
EP (1) EP3817385A4 (zh)
JP (1) JP7271580B2 (zh)
KR (1) KR102569844B1 (zh)
WO (1) WO2020001210A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11876990B2 (en) * 2021-07-13 2024-01-16 Mediatek Inc. Video residual decoding apparatus using storage device to store side information and/or state information for syntax element decoding optimization and associated method
US20230099292A1 (en) * 2021-09-29 2023-03-30 Malini MANOCHA Detection and management of dysfunctions in subterranean operations

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685503A (zh) * 2011-03-10 2012-09-19 华为技术有限公司 变换系数的编码方法、变换系数的解码方法,和装置
US20130202029A1 (en) * 2012-02-05 2013-08-08 General Instrument Corporation Method of determining binary codewords for transform coefficients
CN105872539A (zh) * 2015-02-08 2016-08-17 同济大学 图像编码方法和装置及图像解码方法和装置

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070230564A1 (en) * 2006-03-29 2007-10-04 Qualcomm Incorporated Video processing with scalability
EP2182732A1 (en) * 2008-10-28 2010-05-05 Panasonic Corporation Switching between scans in image coding
CN101931805B (zh) * 2009-06-19 2013-10-23 香港科技大学 采用比特挪移方法的标量量化及其在视频编码中的应用
US8929440B2 (en) * 2010-04-09 2015-01-06 Sony Corporation QP adaptive coefficients scanning and application
US9049444B2 (en) * 2010-12-22 2015-06-02 Qualcomm Incorporated Mode dependent scanning of coefficients of a block of video data
US8964849B2 (en) 2011-11-01 2015-02-24 Blackberry Limited Multi-level significance maps for encoding and decoding
US9743098B2 (en) 2011-11-19 2017-08-22 Blackberry Limited Multi-level significance map scanning
US10574993B2 (en) 2015-05-29 2020-02-25 Qualcomm Incorporated Coding data using an enhanced context-adaptive binary arithmetic coding (CABAC) design
WO2016206590A1 (en) 2015-06-23 2016-12-29 Mediatek Singapore Pte. Ltd. Method and apparatus for transform coefficient coding of non-square blocks
WO2016205999A1 (en) 2015-06-23 2016-12-29 Mediatek Singapore Pte. Ltd. Adaptive coding group for image/video coding
CN116506601A (zh) * 2016-03-11 2023-07-28 数字洞察力有限公司 视频编码方法以及装置
US11228770B2 (en) * 2016-05-16 2022-01-18 Qualcomm Incorporated Loop sample processing for high dynamic range and wide color gamut video coding
KR20180007680A (ko) * 2016-07-13 2018-01-23 한국전자통신연구원 영상 부호화/복호화 방법 및 장치
CN110024399B (zh) 2016-11-28 2024-05-17 韩国电子通信研究院 对图像编码/解码的方法和设备及存储比特流的记录介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102685503A (zh) * 2011-03-10 2012-09-19 华为技术有限公司 变换系数的编码方法、变换系数的解码方法,和装置
US20130202029A1 (en) * 2012-02-05 2013-08-08 General Instrument Corporation Method of determining binary codewords for transform coefficients
CN105872539A (zh) * 2015-02-08 2016-08-17 同济大学 图像编码方法和装置及图像解码方法和装置

Also Published As

Publication number Publication date
JP7271580B2 (ja) 2023-05-11
JP2021532624A (ja) 2021-11-25
EP3817385A1 (en) 2021-05-05
US20210168369A1 (en) 2021-06-03
CN110650343A (zh) 2020-01-03
EP3817385A4 (en) 2022-07-27
KR20210024619A (ko) 2021-03-05
US11647196B2 (en) 2023-05-09
KR102569844B1 (ko) 2023-08-28

Similar Documents

Publication Publication Date Title
TWI766334B (zh) 具有子圖像之視訊解碼
US9344722B2 (en) Scanning of prediction residuals in high efficiency video coding
US11909963B2 (en) Image encoding method, decoding method, encoder, and decoder
CN111373753B (zh) 变换因子级别编码方法及其装置
WO2020119814A1 (zh) 图像重建方法和装置
CN117478915A (zh) 用于构建应用多假设预测的块的mpm列表的编码器、解码器及相应方法
CN113455005A (zh) 用于帧内子分区译码工具所产生的子分区边界的去块效应滤波器
CN113330743A (zh) 编码器、解码器及去块效应滤波器自适应的对应方法
WO2020001210A1 (zh) 图像的编码、解码方法及装置、电子设备及系统
JP2023159400A (ja) ビデオサンプルのブロックを符号化及び復号するための方法、装置、及びシステム
CN112868233B (zh) 编码器、解码器及相应的帧间预测方法
JP7393366B2 (ja) 画像の符号化方法、復号化方法、エンコーダおよびデコーダ
KR20220065880A (ko) 아핀 모션 보상에서 dct 기반 보간 필터 및 향상된 쌍선형 보간 필터의 사용
CN112567739B (zh) 用于视觉媒体编码和解码的平面预测模式
CN110650343B (zh) 图像的编码、解码方法及装置、电子设备及系统
TW202143708A (zh) 用於圖像和視訊解碼的區塊分割
TW202141979A (zh) 用於針對具有基於聯合圖元/變換的量化的視訊解碼的量化參數控制的方法
CN114846789A (zh) 用于指示条带的图像分割信息的解码器及对应方法
CN114930834A (zh) 编码器、解码器及灵活档次配置的对应方法
CN113545060A (zh) 视频编码中的空瓦片编码
CN116188603A (zh) 图像处理方法和装置

Legal Events

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

Ref document number: 19826712

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020571788

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 20217002590

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2019826712

Country of ref document: EP

Effective date: 20210127