WO2020172908A1 - 一种量化块的解码方法、装置及电子设备 - Google Patents
一种量化块的解码方法、装置及电子设备 Download PDFInfo
- Publication number
- WO2020172908A1 WO2020172908A1 PCT/CN2019/077292 CN2019077292W WO2020172908A1 WO 2020172908 A1 WO2020172908 A1 WO 2020172908A1 CN 2019077292 W CN2019077292 W CN 2019077292W WO 2020172908 A1 WO2020172908 A1 WO 2020172908A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- value
- decoding
- block
- quantized
- scanning
- Prior art date
- Legal status (The legal status 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 status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/124—Quantisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/90—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using coding techniques not provided for in groups H04N19/10-H04N19/85, e.g. fractals
- H04N19/93—Run-length coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/103—Selection of coding mode or of prediction mode
- H04N19/105—Selection of the reference unit for prediction within a chosen coding or prediction mode, e.g. adaptive choice of position and number of pixels used for prediction
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/117—Filters, e.g. for pre-processing or post-processing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/12—Selection from among a plurality of transforms or standards, e.g. selection between discrete cosine transform [DCT] and sub-band transform or selection between H.263 and H.264
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/129—Scanning of coding units, e.g. zig-zag scan of transform coefficients or flexible macroblock ordering [FMO]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/102—Methods 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/13—Adaptive entropy coding, e.g. adaptive variable length coding [AVLC] or context adaptive binary arithmetic coding [CABAC]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/17—Methods 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/172—Methods 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 picture, frame or field
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/17—Methods 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/176—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/10—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using adaptive coding
- H04N19/169—Methods 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/18—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/60—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding
- H04N19/61—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using transform coding in combination with predictive coding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/70—Methods 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N19/00—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
- H04N19/80—Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
Definitions
- This specification relates to the technical field of video coding and decoding, and in particular to a method, device and electronic device for decoding a quantized block.
- the coding information of each coding unit is usually decoded from the code stream, such as the division method of prediction unit and transform unit, quantization block, prediction information, etc.
- the prediction information perform the corresponding intra or inter prediction to obtain the predicted image block corresponding to the prediction unit, and then inversely quantize the quantized block to obtain the inverse transform block, the inverse transform block is inversely transformed to obtain the residual image block, and the residual image block
- the reconstructed image block is obtained by adding the corresponding predicted image block; the reconstructed image composed of the reconstructed image block is provided for subsequent frame reference after loop filtering.
- the purpose of the present invention is to provide a method, device and electronic device for decoding quantized blocks, so as to solve the need for more time-consuming decoding of quantized coefficients in a run-length decoding method in the prior art, resulting in quantization.
- the decoding efficiency of the block is reduced.
- Step 110 Determine the scanning order of the quantization coefficients in the quantization block according to the determined scanning method
- Step 120 Initialize the scan position of the quantized coefficient in the quantization block according to the scan order, and decode a run length starting from the initial scan position; the scan position is the lower of the quantized coefficient in the scan order Mark
- Step 130 Add the subscript value corresponding to the current scanning position and the value of the next run length starting from the current scanning position to obtain the scanning position of the non-zero coefficient, and the value of the non-zero coefficient corresponding to the scanning position Decode
- Step 140 Determine whether the subscript value of the non-zero coefficient is the maximum subscript value, and when the subscript value of the non-zero coefficient is the maximum subscript value, end the decoding of the quantized block; otherwise, decode the quantized coefficient end flag Bit, and determine whether there is an undecoded non-zero coefficient according to the decoding result of the quantized coefficient end flag bit, and when there is no undecoded non-zero coefficient, end the decoding of the quantized block;
- Step 150 When there is an undecoded non-zero coefficient, update the current scan position, add 1 to the subscript value of the decoded non-zero coefficient as the updated current scan position, and decode from the updated current scan position Start the next run length, and return to step 130.
- the determining the scanning order of the quantization coefficients in the quantization block according to the determined scanning method includes:
- the scanning order of the quantization coefficients in the quantization block is determined according to the zigzag scanning method, so that the two-dimensional quantization block is converted into a one-dimensional array through the scanning order.
- the decoding of a run length includes:
- Step 310 Pre-configure a variable, the initial value of which is zero;
- Step 320 Parse the code stream in turn to obtain binary symbols, and determine whether the binary symbols are 1, if the binary symbols are 1, use the value of the current variable as the value of the run length, and end the run length Decoding; otherwise, update the variable, add 1 to the value of the variable as the value of the updated current variable, and determine whether the value of the current variable is less than the threshold;
- Step 330 when the value of the current variable is less than the threshold, return to step 320;
- Step 340 When the value of the current variable is greater than or equal to the threshold, analyze the subsequent binary symbol string in a zero-order exponential Golomb code manner to obtain the value corresponding to the subsequent binary symbol string, and correspond the subsequent binary symbol string to The value of is added to the threshold as the value of the run length, and the decoding of the run length is ended.
- the threshold is set to 2, 4, 8, 16, or 32.
- the method further includes: assigning the value of the non-zero coefficient obtained by decoding to the corresponding quantization block according to the scanning order The position of the coefficient.
- the residual image block and the corresponding predicted image block are added to obtain a reconstructed image block;
- quantized block is decoded from the code stream by using the foregoing quantized block decoding method.
- the determining module is used to determine the scanning order of the quantized coefficients in the quantized block according to the determined scanning method
- the initialization module is used to initialize the scan position of the quantized coefficient in the quantization block according to the scan order, and decode a run length starting from the initial scan position; the scan position is the quantized coefficient in the scan order Subscript
- the decoding module is used to add the subscript value corresponding to the current scanning position and the value of the next run length starting from the current scanning position to obtain the scanning position of the non-zero coefficient, and the non-zero coefficient corresponding to the scanning position To decode the value;
- the judgment module is used to determine whether the subscript value of the non-zero coefficient is the maximum subscript value, and when the subscript value of the non-zero coefficient is the maximum subscript value, the decoding of the quantized block ends; otherwise, the quantized coefficient is decoded End flag bit, and determine whether there are undecoded non-zero coefficients according to the decoding result of the quantized coefficient end flag bit, and when there are no undecoded non-zero coefficients, end the decoding of the quantized block;
- the update module is used to update the current scan position when there is an undecoded non-zero coefficient, add 1 to the subscript value of the decoded non-zero coefficient as the updated current scan position, and decode the current scan position from the updated The next run length at the beginning of the position, and the decoding module is called.
- the determining module is specifically configured to determine the scanning order of the quantization coefficients in the quantization block according to the zigzag scanning method, so as to convert the two-dimensional quantization block into a one-dimensional array through the scanning order.
- the initialization module is further configured to perform the following operations:
- Step 310 Pre-configure a variable, the initial value of which is zero;
- Step 320 Parse the code stream in turn to obtain binary symbols, and determine whether the binary symbols are 1, if the binary symbols are 1, use the value of the current variable as the value of the run length, and end the run length Decoding; otherwise, update the variable, add 1 to the value of the variable as the value of the updated current variable, and determine whether the value of the current variable is less than the threshold;
- Step 330 when the value of the current variable is less than the threshold, return to step 320;
- Step 340 When the value of the current variable is greater than or equal to the threshold, analyze the subsequent binary symbol string in a zero-order exponential Golomb code manner to obtain the value corresponding to the subsequent binary symbol string, and correspond the subsequent binary symbol string to The value of is added to the threshold as the value of the run length, and the decoding of the run length is ended.
- the decoding module is further used for:
- the value of the non-zero coefficient obtained by decoding is assigned to the position of the corresponding quantization coefficient in the quantization block.
- An electronic device provided by an embodiment of this specification includes a memory, a processor, and a computer program stored in the memory and running on the processor, and the processor implements the above-mentioned method for decoding a quantized block when the program is executed .
- the present invention initializes the scan position of the quantized coefficients by determining the scan order of the quantized coefficients in the quantized block, and decodes a run length; add the subscript value of the current scan position and the value of the run length to obtain the scan position of the non-zero coefficient.
- Decode the value of the non-zero coefficient determine whether the subscript value of the non-zero coefficient is the maximum subscript value, when it is the maximum subscript value, end the decoding of the quantized block; otherwise, determine whether there are undecoded non-zero coefficients, When there is no undecoded non-zero coefficient, the decoding of the quantized block ends; when there is an undecoded non-zero coefficient, add 1 to the subscript value of the non-zero coefficient to obtain the updated current scanning position, and continue with the current The scanning position is the starting scanning position to decode the next run length until the decoding of the quantized block is completed. Based on the solution of the present invention, the decoding efficiency of the quantized block can be improved.
- FIG. 1 is a schematic flowchart of a method for decoding a quantized block provided by an embodiment of this specification
- FIG. 2 is a schematic diagram of the scanning process of a typical 8 ⁇ 8 quantized coefficient block using zigzag scanning mode according to an embodiment of this specification;
- FIG. 3 is a schematic flowchart of a method for decoding run length provided by an embodiment of this specification
- Figure 4 is a schematic structural diagram of a quantized block decoding device provided by an embodiment of this specification.
- FIG. 1 is a schematic flowchart of a method for decoding a quantized block according to an embodiment of the present invention. The method may specifically include the following steps:
- step S110 according to the determined scanning method, the scanning order of the quantized coefficients in the quantized block is determined.
- the quantization block can be expressed as a two-dimensional digital matrix, and different quantization blocks can have different widths and heights, for example: 8 ⁇ 8 quantization coefficient block, 16 ⁇ 16 quantization coefficient block, 32 ⁇ 32 quantization coefficient block Wait.
- the scanning order of the quantized coefficients in the quantized block can be determined according to the zigzag scanning method, so that the two-dimensional quantized block can be converted into a one-dimensional array through the scanning sequence.
- Zigzag scanning is a method of scanning a matrix, which is mostly used for images.
- the video encoding and decoding process Refer to Figure 2, which shows a schematic diagram of the scanning process of a typical 8 ⁇ 8 quantized coefficient block using zigzag scanning mode.
- step S120 the scan position of the quantized coefficient in the quantization block is initialized according to the scan order, and a run length starting from the initial scan position is decoded; the scan position is the quantized coefficient in the scan order The subscript.
- the scanning position of the quantized coefficients in the scanned one-dimensional array is initialized according to the scanning sequence, that is, the quantized coefficients in the scanned quantization block are initialized.
- Initialization operation can be performed on the subscripts of, and the method of the initialization operation can be to mark the subscripts of the quantization coefficients of the corresponding positions as 0, 1, 2, 3, 4... and set the initial scanning position to 0 according to the scanning order.
- the scan position can be represented by POS
- the run length can be represented by Run.
- the run length Run represents the number of consecutive zero coefficients that exist backwards from the current scan position POS. Since the run length Run is determined by the encoding end, Each non-zero coefficient has a Run, and the subscript of the next non-zero coefficient can be determined by the subscript of the quantized coefficient at the starting scan position and the value of Run.
- FIG. 3 is a schematic flowchart of a method for decoding run length provided by an embodiment of the present invention. The method may specifically include the following steps:
- Step 310 Pre-configure a variable, the initial value of which is zero;
- Step 320 Parse the code stream in turn to obtain binary symbols, and determine whether the binary symbols are 1, if the binary symbols are 1, use the value of the current variable as the value of the run length, and end the run length Decoding; otherwise, update the variable, add 1 to the value of the variable as the value of the updated current variable, and determine whether the value of the current variable is less than the threshold;
- Step 330 when the value of the current variable is less than the threshold, return to step 320;
- Step 340 When the value of the current variable is greater than or equal to the threshold, analyze the subsequent binary symbol string in a zero-order exponential Golomb code manner to obtain the value corresponding to the subsequent binary symbol string, and correspond the subsequent binary symbol string to The value of is added to the threshold as the value of the run length, and the decoding of the run length is ended.
- the variable can be represented by L
- the binary symbol can be represented by C
- the threshold can be represented by T
- the value corresponding to the subsequent binary symbol string can be represented by Val
- the code stream is decoded by the arithmetic decoding engine to obtain a binary symbol string containing only "0" and "1", and for the value of the encoded information, the value of the encoded information is converted into a 0/1 symbol string by using a binarization method.
- the process described in this application mainly includes the process of de-binarizing the binary symbol string on the decoding side to obtain the value, especially the process of how the run length Run, a syntax element, is converted from the binary symbol string into a value.
- the threshold set above may be 2, 4, 8, 16, or 32.
- the significance of configuring variables and thresholds is that since the initial value of the variable is zero, and every time a binary symbol in the binary symbol string is parsed, it can be judged according to the analysis result of the binary symbol Whether the value of the current variable is equal to the value of the run length Run, and when the binary symbol is not 1, the value of the variable is increased by 1, so when the value of the variable is less than the threshold, it can be directly determined that the value of the run length Run is equal to the current value The value of the variable.
- the binary symbol in the binary symbol string is divided into two parts, and the front and back parts in the run length are decoded in different ways.
- this application provides an efficient de-binarization method to improve the decoding method of run length, which can reduce the number of binary symbols that need to be resolved in the process of decoding run length. Improve decoding efficiency.
- the above-mentioned method for parsing the subsequent binary symbol string in the manner of zero-order exponential Golomb code may include the following process:
- step S130 the subscript value corresponding to the current scanning position is added to the value of the next run length starting from the current scanning position to obtain the scanning position of the non-zero coefficient, and the non-zero coefficient corresponding to the scanning position The value is decoded.
- the scanned quantized coefficients are regarded as an array, and the scanning position is the subscript of each element in this array.
- the scanning position corresponds to the position of the quantized coefficient in the quantization block, so the one-dimensional array is decoded
- the value of the mid-run length can determine the scanning position of the non-zero coefficient.
- the value of the non-zero coefficient obtained by decoding can also be assigned to the position of the corresponding quantization coefficient in the quantization block according to the scanning order.
- step S140 it is determined whether the subscript value of the non-zero coefficient is the maximum subscript value, and when the subscript value of the non-zero coefficient is the maximum subscript value, the decoding of the quantized block ends; otherwise, the quantized coefficient is decoded
- the end flag bit and according to the decoding result of the quantized coefficient end flag bit, it is determined whether there are undecoded non-zero coefficients, and when there are no undecoded non-zero coefficients, the decoding of the quantized block is ended.
- the decoding by judging whether the subscript value of the non-zero coefficient obtained by the current decoding is the maximum subscript value, it can be determined whether the current non-zero coefficient is the last non-zero coefficient in the one-dimensional array.
- the subscript value is the maximum subscript value, it means that all the non-zero coefficients in the quantized block have been decoded, and the decoding of the current quantized block is ended; if the subscript value of the current non-zero coefficient is not the maximum subscript value, the decoding A quantized coefficient end flag after the non-zero coefficient.
- the quantized coefficient end flag can indicate whether there are non-zero coefficients in the future. In practical applications, multiple methods can be used to decode the quantized coefficient end flag.
- step S150 when there is an undecoded non-zero coefficient, update the current scan position, add 1 to the subscript value of the decoded non-zero coefficient as the updated current scan position, and decode from the updated current scan position. Position the next run length from the beginning, and return to step 130.
- step S150 describes the operation when there are still undecoded non-zero coefficients in the one-dimensional array, adding 1 to the subscript value of the decoded non-zero coefficient to obtain the updated current scanning position , Use the updated current scan position as the starting scan position to decode the next run length, and add the subscript value corresponding to the updated current scan position to the decoded next run length value to get the next non-zero
- the scanning position of the coefficient, and the value of the non-zero coefficient corresponding to the scanning position is decoded. By adding the subscript value of the initial scanning position to the value of the next run length, the scanning position of the next non-zero coefficient is obtained.
- the first scanning position POS after initialization is combined with the The value of a run length Run at the beginning of the scanning position POS is added to obtain the scanning position of the first non-zero coefficient, and then the first non-zero coefficient is decoded; then the subscript value of the first non-zero coefficient is increased by 1, namely POS+Run+1, you can get the starting scan position of the next run length Run, and continue to decode the next run length Run to get the position of the next non-zero coefficient.
- step S130 to step S150 are executed until the decoding of the quantized block is completed.
- the embodiments of this specification also provide a video decoding method, including:
- the residual image block and the corresponding predicted image block are added to obtain a reconstructed image block;
- quantized block is decoded from the code stream by using the foregoing quantized block decoding method.
- the code stream is analyzed to obtain the prediction mode, reference frame index, motion vector, quantization block and other information of each coding unit.
- the quantized block is obtained by decoding according to the method described in the embodiment of this specification. According to information such as prediction mode, reference frame index, motion vector, etc., the predicted image block PRED is generated. Perform inverse quantization and inverse transform operations on the quantized block to obtain the residual image block RESI'.
- the residual image block RESI' is added with the predicted image block PRED to obtain a reconstructed image block RECO; the reconstructed image formed by the reconstructed image block is subjected to deblocking filtering to obtain a reference image for reference in subsequent frames.
- an embodiment of this specification also provides a device for decoding a quantized block.
- Fig. 4 is a device for decoding a quantized block provided by the embodiment of this specification.
- the device 400 mainly includes:
- the determining module 401 is configured to determine the scanning order of the quantization coefficients in the quantization block according to the determined scanning method
- the initialization module 402 is configured to initialize the scanning position of the quantized coefficients in the quantization block according to the scanning order, and decode a run length starting from the initial scanning position; the scanning position is quantized in the scanning order The index of the coefficient;
- the decoding module 403 is configured to add the subscript value corresponding to the current scanning position and the value of the next run length starting from the current scanning position to obtain the scanning position of the non-zero coefficient, and the non-zero coefficient corresponding to the scanning position The value of the coefficient is decoded;
- the judging module 404 is used to determine whether the subscript value of the non-zero coefficient is the maximum subscript value, and when the subscript value of the non-zero coefficient is the maximum subscript value, the decoding of the quantized block ends; otherwise, the decoding quantization Coefficient end flag bit, and determine whether there are undecoded non-zero coefficients according to the decoding result of the quantized coefficient end flag bit, and when there are no undecoded non-zero coefficients, end the decoding of the quantized block;
- the update module 405 is configured to update the current scan position when there is an undecoded non-zero coefficient, add 1 to the subscript value of the decoded non-zero coefficient as the updated current scan position, and decode the current scan position from the updated Scan the next run length starting from the position, and call the decoding module.
- the determining module 401 is specifically configured to determine the scanning order of the quantization coefficients in the quantization block according to the zigzag scanning method, so as to convert the two-dimensional quantization block into a one-dimensional array through the scanning order.
- the initialization module 402 is further configured to perform the following operations:
- Step 310 Pre-configure a variable, the initial value of which is zero;
- Step 320 Parse the code stream in turn to obtain binary symbols, and determine whether the binary symbols are 1, if the binary symbols are 1, use the value of the current variable as the value of the run length, and end the run length Decoding; otherwise, update the variable, add 1 to the value of the variable as the value of the updated current variable, and determine whether the value of the current variable is less than the threshold;
- Step 330 when the value of the current variable is less than the threshold, return to step 320;
- Step 340 When the value of the current variable is greater than or equal to the threshold, analyze the subsequent binary symbol string in a zero-order exponential Golomb code manner to obtain the value corresponding to the subsequent binary symbol string, and correspond the subsequent binary symbol string to The value of is added to the threshold as the value of the run length, and the decoding of the run length is ended.
- the decoding module 403 is further configured to:
- the value of the non-zero coefficient obtained by decoding is assigned to the position of the corresponding quantization coefficient in the quantization block.
- the embodiment of this specification also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, and the processor implements the above-mentioned method for decoding a quantized block when the program is executed. .
- the device, electronic device, and method provided in the embodiments of this specification are corresponding. Therefore, the device and electronic device also have beneficial technical effects similar to the corresponding method. Since the beneficial technical effects of the method have been described in detail above, here The beneficial technical effects of the corresponding devices and electronic equipment will not be repeated.
- program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
- the instructions can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network.
- program modules can be located in local and remote computer storage media including storage devices.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Discrete Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
Abstract
本说明书实施例提供一种量化块的解码方法、装置及电子设备。所述方法包括:确定量化块中量化系数的扫描顺序,初始化量化系数的扫描位置,并解码一个游程长度;将当前扫描位置的下标值与游程长度的值相加得到非零系数的扫描位置,对非零系数的值进行解码;判断非零系数的下标值是否为最大下标值,当为最大下标值时,结束量化块的解码;否则,判断是否还存在未解码的非零系数,当不存在未解码的非零系数时,结束量化块的解码;当存在未解码的非零系数时,将所述非零系数的下标值加1得到更新后的当前扫描位置,继续以当前扫描位置为起始扫描位置解码下一个游程长度,直至完成量化块的解码。采用本申请的技术方案,能够提升量化块的解码效率。
Description
本申请要求享有2019年2月27日提交的名称为“一种量化块的解码方法、装置及电子设备”的中国专利申请CN201910144295.2的优先权,其全部内容通过引用并入本文中。
本说明书涉及视频编解码技术领域,尤其涉及一种量化块的解码方法、装置及电子设备。
视频编解码的过程中,在解码一帧图像时,通常从码流中解码得到每个编码单元的编码信息,如预测单元和变换单元的划分方式、量化块、预测信息等。根据预测信息进行相应的帧内或帧间预测得到预测单元对应的预测图像块,再将量化块经反量化得到反变换块,反变换块经反变换得到残差图像块,将残差图像块同对应的预测图像块相加得到重建图像块;由重建图像块组成的重建图像经过环路滤波之后,提供给后续帧参考。
现有技术中,在对码流进行熵解码得到量化块的过程中,由于量化块的尺寸可能比较大,采用现有的游程解码方式对量化系数进行解码时,往往需要更多的耗时,从而降低了量化块的解码效率。
发明内容
有鉴于此,本发明的目的在于提供一种量化块的解码方法、装置及电子设备,以解决现有技术存在的采用游程解码方式对量化系数进行解码时,需要更 多的耗时,导致量化块的解码效率降低的问题。
为解决上述技术问题,本说明书实施例是这样实现的:
本说明书实施例提供的一种量化块的解码方法,包括:
步骤110:按照确定的扫描方法,确定量化块中量化系数的扫描顺序;
步骤120:根据所述扫描顺序对所述量化块中量化系数的扫描位置进行初始化操作,并解码从初始化扫描位置起始的一个游程长度;所述扫描位置为所述扫描顺序下量化系数的下标;
步骤130:将当前扫描位置对应的下标值与从所述当前扫描位置起始的下一个游程长度的值相加得到非零系数的扫描位置,对该扫描位置所对应的非零系数的值进行解码;
步骤140:确定所述非零系数的下标值是否为最大下标值,当所述非零系数的下标值为最大下标值时,结束量化块的解码;否则,解码量化系数结束标志位,并根据所述量化系数结束标志位的解码结果,判断是否还存在未解码的非零系数,当不存在未解码的非零系数时,结束量化块的解码;
步骤150:当存在未解码的非零系数时,更新所述当前扫描位置,将解码后的非零系数的下标值加1作为更新后的当前扫描位置,解码从更新后的当前扫描位置起始的下一个游程长度,并返回所述步骤130。
可选的,所述按照确定的扫描方法,确定量化块中量化系数的扫描顺序,包括:
按照zigzag扫描方法确定所述量化块中量化系数的扫描顺序,以便通过所述扫描顺序将二维的量化块转换为一维数组。
可选的,所述解码一个游程长度包括:
步骤310:预先配置一变量,所述变量的初始值为零;
步骤320:依次解析码流获得二元符号,并判断所述二元符号是否为1,如果所述二元符号为1,以当前变量的值作为所述游程长度的值,并结束游程长度 的解码;否则更新所述变量,将所述变量的值加1作为更新后的当前变量的值,并判断所述当前变量的值是否小于阈值;
步骤330:当所述当前变量的值小于阈值时,返回所述步骤320;
步骤340:当所述当前变量的值大于等于阈值时,以零阶指数哥伦布码的方式解析后续的二元符号串,得到后续二元符号串对应的值,将所述后续二元符号串对应的值与阈值相加作为所述游程长度的值,并结束游程长度的解码。
可选的,设置所述阈值为2、4、8、16或32。
可选的,所述对该扫描位置所对应的非零系数的值进行解码之后,还包括:根据所述扫描顺序,将解码得到的非零系数的值,赋值到所述量化块中对应量化系数的位置上。
本说明书实施例提供的一种视频解码方法,包括:
从码流中解码得到划分信息、预测信息以及量化块;
根据预测信息通过预测技术得到预测图像块;
量化块经过反量化和反变换得到残差图像块;
残差图像块与对应的预测图像块相加得到重建图像块;
对重建图像块构成的重建图像进行去块效应滤波,获取用于后续帧参考的参考图像;
还包括,采用上述量化块的解码方法从所述码流中解码得到量化块。
本说明书实施例提供的一种量化块的解码装置,包括:
确定模块,用于按照确定的扫描方法,确定量化块中量化系数的扫描顺序;
初始化模块,用于根据所述扫描顺序对所述量化块中量化系数的扫描位置进行初始化操作,并解码从初始化扫描位置起始的一个游程长度;所述扫描位置为所述扫描顺序下量化系数的下标;
解码模块,用于将当前扫描位置对应的下标值与从所述当前扫描位置起始 的下一个游程长度的值相加得到非零系数的扫描位置,对该扫描位置所对应的非零系数的值进行解码;
判断模块,用于确定所述非零系数的下标值是否为最大下标值,当所述非零系数的下标值为最大下标值时,结束量化块的解码;否则,解码量化系数结束标志位,并根据所述量化系数结束标志位的解码结果,判断是否还存在未解码的非零系数,当不存在未解码的非零系数时,结束量化块的解码;
更新模块,用于当存在未解码的非零系数时,更新所述当前扫描位置,将解码后的非零系数的下标值加1作为更新后的当前扫描位置,解码从更新后的当前扫描位置起始的下一个游程长度,并调用所述解码模块。
可选的,所述确定模块具体用于:按照zigzag扫描方法确定所述量化块中量化系数的扫描顺序,以便通过所述扫描顺序将二维的量化块转换为一维数组。
可选的,所述初始化模块进一步用于执行以下操作:
步骤310:预先配置一变量,所述变量的初始值为零;
步骤320:依次解析码流获得二元符号,并判断所述二元符号是否为1,如果所述二元符号为1,以当前变量的值作为所述游程长度的值,并结束游程长度的解码;否则更新所述变量,将所述变量的值加1作为更新后的当前变量的值,并判断所述当前变量的值是否小于阈值;
步骤330:当所述当前变量的值小于阈值时,返回所述步骤320;
步骤340:当所述当前变量的值大于等于阈值时,以零阶指数哥伦布码的方式解析后续的二元符号串,得到后续二元符号串对应的值,将所述后续二元符号串对应的值与阈值相加作为所述游程长度的值,并结束游程长度的解码。
可选的,所述解码模块还进一步用于:
在所述对该扫描位置所对应的非零系数的值进行解码之后,根据所述扫描顺序,将解码得到的非零系数的值,赋值到所述量化块中对应量化系数的位置上。
本说明书实施例提供的一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述一种量化块的解码方法。
本说明书实施例采用的上述至少一个技术方案能够达到以下有益效果:
本发明通过确定量化块中量化系数的扫描顺序,初始化量化系数的扫描位置,并解码一个游程长度;将当前扫描位置的下标值与游程长度的值相加得到非零系数的扫描位置,对非零系数的值进行解码;判断非零系数的下标值是否为最大下标值,当为最大下标值时,结束量化块的解码;否则,判断是否还存在未解码的非零系数,当不存在未解码的非零系数时,结束量化块的解码;当存在未解码的非零系数时,将所述非零系数的下标值加1得到更新后的当前扫描位置,继续以当前扫描位置为起始扫描位置解码下一个游程长度,直至完成量化块的解码。基于本发明的方案,能够提升量化块的解码效率。
为了更清楚的说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见的下面描述中的附图仅仅是本发明的实施例,对于本领域普通人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1是本说明书实施例提供的一种量化块的解码方法的流程示意图;
图2是本说明书实施例提供的典型的8×8量化系数块采用zigzag扫描方式的扫描过程示意图;
图3是本说明书实施例提供的一种解码游程长度方法的流程示意图;
图4是本说明书实施例提供的一种量化块的解码装置的结构示意图。
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本说明书实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
图1为本发明实施例提供的一种量化块的解码方法的流程示意图。该方法具体可以包括以下步骤:
在步骤S110中,按照确定的扫描方法,确定量化块中量化系数的扫描顺序。
在本说明书实施例中,量化块可以表现为二维的数字矩阵,不同量化块可以具有不同的宽高,例如:8×8量化系数块、16×16量化系数块、32×32量化系数块等。在具体实施过程中,可以按照zigzag扫描方法确定量化块中量化系数的扫描顺序,以便通过扫描顺序将二维的量化块转换为一维数组,zigzag扫描是一种扫描矩阵的方法,多用于图像和视频的编解码过程。参见图2,该图示出了一种典型的8×8量化系数块采用zigzag扫描方式的扫描过程示意图,按照斜向的Z字形扫描路径以初始位置为起点依次扫描量化块中的所有量化系数,即可得到该量化块的一维数组。需要说明的是,不同宽高的量化块之间,zigzag扫描方式不变,但是扫描顺序会略有差异。
在步骤S120中,根据所述扫描顺序对所述量化块中量化系数的扫描位置进行初始化操作,并解码从初始化扫描位置起始的一个游程长度;所述扫描位置为所述扫描顺序下量化系数的下标。
在本说明书实施例中,基于步骤S101中扫描得到的一维数组,根据扫描的先后顺序,对扫描得到的一维数组中量化系数的扫描位置进行初始化操作,即对扫描后量化块中量化系数的下标进行初始化操作,初始化操作的方法可以是依照扫描顺序,将对应位置的量化系数的下标依次标记为0、1、2、3、4……,并将初始扫描位置设为0。
进一步地,扫描位置可以用POS来表示,游程长度可以用Run来表示,游 程长度Run表示从当前扫描位置POS向后存在的连续零系数的个数,由于游程长度Run是编码端确定的,因此每一个非零系数都有一个Run,通过起始扫描位置的量化系数的下标与Run的值,便可以确定下一个非零系数的下标。
图3为本发明实施例提供的一种解码游程长度方法的流程示意图。该方法具体可以包括以下步骤:
步骤310:预先配置一变量,所述变量的初始值为零;
步骤320:依次解析码流获得二元符号,并判断所述二元符号是否为1,如果所述二元符号为1,以当前变量的值作为所述游程长度的值,并结束游程长度的解码;否则更新所述变量,将所述变量的值加1作为更新后的当前变量的值,并判断所述当前变量的值是否小于阈值;
步骤330:当所述当前变量的值小于阈值时,返回所述步骤320;
步骤340:当所述当前变量的值大于等于阈值时,以零阶指数哥伦布码的方式解析后续的二元符号串,得到后续二元符号串对应的值,将所述后续二元符号串对应的值与阈值相加作为所述游程长度的值,并结束游程长度的解码。
其中,变量可以用L表示,二元符号可以用C表示,阈值可以用T表示,后续二元符号串对应的值可以用Val表示;那么当L<T时,则游程长度Run的值等于L;当L≥T时,则游程长度Run的值等于Val+T。
具体的,通过算数解码引擎解码码流得到只包含“0”和“1”的二元符号串,对于编码信息的值,采用二值化方法将编码信息的值转换为0/1符号串。本申请描述的过程主要包括解码端将二元符号串进行反二值化法得到数值的过程,尤其是游程长度Run这个语法元素如何从二元符号串转换成数值的过程。
在一个具体实施例中,上述设置的阈值可以为2、4、8、16或32。
在本说明书实施例中,配置变量和阈值的意义在于,由于变量的初始值为零,并且每解析完二元符号串中的一个二元符号时,都可以根据二元符号的解析结果,判断当前变量的值是否等于游程长度Run的值,并当二元符号不为1 时,将变量的值加1,因此当变量的值小于阈值时,便可以直接确定游程长度Run的值就等于当前变量的值。另外,通过将变量与阈值相比较,以阈值作为分界点,将二元符号串中的二元符号划分为前后两部分,并采取不同的方式解码游程长度中的前后部分。相比单一方式的解码游程长度的方法,本申请提供了一种高效的反二值化方法,改进游程长度的解码方式,可以减少解码游程长度过程中需要解析的二元符号个数,极大提升解码效率。
进一步地,上述以零阶指数哥伦布码的方式解析后续的二元符号串的方法可以包括以下过程:
连续解码后续的二元符号,直到解码到二元符号“1”为止,将连续解码中得到的二元符号“0”的个数记为k,然后继续解码k个二元符号,将继续解码的k个二元符号构成一个二进制数VB,先解码出的二元符号位于高位,后解码出的二元符号位于低位。那么以零阶指数哥伦布码的方式解析得到的后续二元符号串对应的值Val等于2
k-1+VB。
在步骤S130中,将当前扫描位置对应的下标值与从所述当前扫描位置起始的下一个游程长度的值相加得到非零系数的扫描位置,对该扫描位置所对应的非零系数的值进行解码。
在本说明书实施例中,将扫描后的量化系数看作一个数组,扫描位置就是这个数组中各个元素的下标,扫描位置与量化块中量化系数的位置一一对应,因此通过解码一维数组中游程长度的值就可以确定非零系数的扫描位置。通过对该扫描位置所对应的非零系数的值进行解码之后,还可以根据扫描顺序,将解码得到的非零系数的值,赋值到量化块中对应量化系数的位置上。
在步骤S140中,确定所述非零系数的下标值是否为最大下标值,当所述非零系数的下标值为最大下标值时,结束量化块的解码;否则,解码量化系数结束标志位,并根据所述量化系数结束标志位的解码结果,判断是否还存在未解码的非零系数,当不存在未解码的非零系数时,结束量化块的解码。
在本说明书实施例中,通过判断当前解码得到的非零系数的下标值是否为 最大下标值,可以确定当前非零系数是否为一维数组中最后的非零系数,当非零系数的下标值为最大下标值时,表示量化块中的非零系数已经全部解码完成,则结束当前量化块的解码;如果当前非零系数的下标值不是最大下标值时,则解码该非零系数后的一个量化系数结束标志位。
在本说明书实施例中,量化系数结束标志位可以表示后面是否还存在非零系数,在现实应用中可以采取多种方法解码量化系数结束标识位。
在步骤S150中,当存在未解码的非零系数时,更新所述当前扫描位置,将解码后的非零系数的下标值加1作为更新后的当前扫描位置,解码从更新后的当前扫描位置起始的下一个游程长度,并返回所述步骤130。
在本说明书实施例中,步骤S150描述了当一维数组中仍存在未解码的非零系数时的操作,将解码后的非零系数的下标值加1,从而得到更新后的当前扫描位置,以更新后的当前扫描位置为起始扫描位置解码下一个游程长度,并将更新后的当前扫描位置所对应的下标值与解码后的下一个游程长度的值相加得到下一个非零系数的扫描位置,对该扫描位置所对应的非零系数的值进行解码。通过将起始扫描位置的下标值与下一个游程长度的值相加,得到下一个非零系数的扫描位置,在本说明书实施例中,通过将初始化后的第一个扫描位置POS与该扫描位置POS起始的一个游程长度Run的值相加得到第一个非零系数的扫描位置,继而解码第一个非零系数;再将第一个非零系数的下标值加1,即将POS+Run+1,便可以得到下一个游程长度Run的起始扫描位置,继续解码下一个游程长度Run,得到下一个非零系数的位置。针对剩余的非零系数,执行步骤S130-步骤S150直至完成量化块的解码。
本说明书实施例还提供一种视频解码方法,包括:
从码流中解码得到划分信息、预测信息以及量化块;
根据预测信息通过预测技术得到预测图像块;
量化块经过反量化和反变换得到残差图像块;
残差图像块与对应的预测图像块相加得到重建图像块;
对重建图像块构成的重建图像进行去块效应滤波,获取用于后续帧参考的参考图像;
还包括,采用上述量化块的解码方法从所述码流中解码得到量化块。
具体的,在一具体应用场景中,在视频解码过程中,对码流进行解析,得到每个编码单元的预测模式、参考帧索引、运动矢量、量化块等信息。解析码流的过程中根据本说明书实施例所述的方法解码得到量化块。根据预测模式、参考帧索引、运动矢量等信息,生成预测图像块PRED。对量化块进行反量化和反变换操作,得到残差图像块RESI’。经残差图像块RESI’加上预测图像块PRED,得到重建图像块RECO;对重建图像块构成的重建图像进行去块效应滤波,获取用于后续帧参考的参考图像。
基于同样的思路,本说明书实施例还提供了一种量化块的解码装置,如图4为本说明书实施例提供的一种量化块的解码装置,该装置400主要包括:
确定模块401,用于按照确定的扫描方法,确定量化块中量化系数的扫描顺序;
初始化模块402,用于根据所述扫描顺序对所述量化块中量化系数的扫描位置进行初始化操作,并解码从初始化扫描位置起始的一个游程长度;所述扫描位置为所述扫描顺序下量化系数的下标;
解码模块403,用于将当前扫描位置对应的下标值与从所述当前扫描位置起始的下一个游程长度的值相加得到非零系数的扫描位置,对该扫描位置所对应的非零系数的值进行解码;
判断模块404,用于确定所述非零系数的下标值是否为最大下标值,当所述非零系数的下标值为最大下标值时,结束量化块的解码;否则,解码量化系数结束标志位,并根据所述量化系数结束标志位的解码结果,判断是否还存在未解码的非零系数,当不存在未解码的非零系数时,结束量化块的解码;
更新模块405,用于当存在未解码的非零系数时,更新所述当前扫描位置,将解码后的非零系数的下标值加1作为更新后的当前扫描位置,解码从更新后的当前扫描位置起始的下一个游程长度,并调用所述解码模块。
根据本申请的实施例,所述确定模块401具体用于:按照zigzag扫描方法确定所述量化块中量化系数的扫描顺序,以便通过所述扫描顺序将二维的量化块转换为一维数组。
根据本申请的实施例,所述初始化模块402进一步用于执行以下操作:
步骤310:预先配置一变量,所述变量的初始值为零;
步骤320:依次解析码流获得二元符号,并判断所述二元符号是否为1,如果所述二元符号为1,以当前变量的值作为所述游程长度的值,并结束游程长度的解码;否则更新所述变量,将所述变量的值加1作为更新后的当前变量的值,并判断所述当前变量的值是否小于阈值;
步骤330:当所述当前变量的值小于阈值时,返回所述步骤320;
步骤340:当所述当前变量的值大于等于阈值时,以零阶指数哥伦布码的方式解析后续的二元符号串,得到后续二元符号串对应的值,将所述后续二元符号串对应的值与阈值相加作为所述游程长度的值,并结束游程长度的解码。
根据本申请的实施例,所述解码模块403还进一步用于:
在所述对该扫描位置所对应的非零系数的值进行解码之后,根据所述扫描顺序,将解码得到的非零系数的值,赋值到所述量化块中对应量化系数的位置上。
本说明书实施例还提供一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述一种量化块的解码方法。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实 施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、电子设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本说明书实施例提供的装置、电子设备与方法是对应的,因此,装置、电子设备也具有与对应方法类似的有益技术效果,由于上面已经对方法的有益技术效果进行了详细说明,因此,这里不再赘述对应装置、电子设备的有益技术效果。
本说明书是参照根据本说明书实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
本说明书可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型 的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践说明书,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
对所公开的实施例的上述说明,使本领域技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神和范围的情况下,在其他实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。
Claims (11)
- 一种量化块的解码方法,其特征在于,包括:步骤110:按照确定的扫描方法,确定量化块中量化系数的扫描顺序;步骤120:根据所述扫描顺序对所述量化块中量化系数的扫描位置进行初始化操作,并解码从初始化扫描位置起始的一个游程长度;所述扫描位置为所述扫描顺序下量化系数的下标;步骤130:将当前扫描位置对应的下标值与从所述当前扫描位置起始的下一个游程长度的值相加得到非零系数的扫描位置,对该扫描位置所对应的非零系数的值进行解码;步骤140:确定所述非零系数的下标值是否为最大下标值,当所述非零系数的下标值为最大下标值时,结束量化块的解码;否则,解码量化系数结束标志位,并根据所述量化系数结束标志位的解码结果,判断是否还存在未解码的非零系数,当不存在未解码的非零系数时,结束量化块的解码;步骤150:当存在未解码的非零系数时,更新所述当前扫描位置,将解码后的非零系数的下标值加1作为更新后的当前扫描位置,解码从更新后的当前扫描位置起始的下一个游程长度,并返回所述步骤130。
- 根据权利要求1所述的方法,其特征在于,所述按照确定的扫描方法,确定量化块中量化系数的扫描顺序,包括:按照zigzag扫描方法确定所述量化块中量化系数的扫描顺序,以便通过所述扫描顺序将二维的量化块转换为一维数组。
- 根据权利要求1所述的方法,其特征在于,所述解码一个游程长度包括:步骤310:预先配置一变量,所述变量的初始值为零;步骤320:依次解析码流获得二元符号,并判断所述二元符号是否为1,如果所述二元符号为1,以当前变量的值作为所述游程长度的值,并结束游程长度的解码;否则更新所述变量,将所述变量的值加1作为更新后的当前变量的值, 并判断所述当前变量的值是否小于阈值;步骤330:当所述当前变量的值小于阈值时,返回所述步骤320;步骤340:当所述当前变量的值大于等于阈值时,以零阶指数哥伦布码的方式解析后续的二元符号串,得到后续二元符号串对应的值,将所述后续二元符号串对应的值与阈值相加作为所述游程长度的值,并结束游程长度的解码。
- 根据权利要求3所述的方法,其特征在于,设置所述阈值为2、4、8、16或32。
- 根据权利要求1所述的方法,其特征在于,所述对该扫描位置所对应的非零系数的值进行解码之后,还包括:根据所述扫描顺序,将解码得到的非零系数的值,赋值到所述量化块中对应量化系数的位置上。
- 一种视频解码方法,其特征在于,包括:从码流中解码得到划分信息、预测信息以及量化块;根据预测信息通过预测技术得到预测图像块;量化块经过反量化和反变换得到残差图像块;残差图像块与对应的预测图像块相加得到重建图像块;对重建图像块构成的重建图像进行去块效应滤波,获取用于后续帧参考的参考图像;还包括,采用权利要求1至5中任一项所述的方法从所述码流中解码得到量化块。
- 一种量化块的解码装置,其特征在于,包括:确定模块,用于按照确定的扫描方法,确定量化块中量化系数的扫描顺序;初始化模块,用于根据所述扫描顺序对所述量化块中量化系数的扫描位置进行初始化操作,并解码从初始化扫描位置起始的一个游程长度;所述扫描位 置为所述扫描顺序下量化系数的下标;解码模块,用于将当前扫描位置对应的下标值与从所述当前扫描位置起始的下一个游程长度的值相加得到非零系数的扫描位置,对该扫描位置所对应的非零系数的值进行解码;判断模块,用于确定所述非零系数的下标值是否为最大下标值,当所述非零系数的下标值为最大下标值时,结束量化块的解码;否则,解码量化系数结束标志位,并根据所述量化系数结束标志位的解码结果,判断是否还存在未解码的非零系数,当不存在未解码的非零系数时,结束量化块的解码;更新模块,用于当存在未解码的非零系数时,更新所述当前扫描位置,将解码后的非零系数的下标值加1作为更新后的当前扫描位置,解码从更新后的当前扫描位置起始的下一个游程长度,并调用所述解码模块。
- 根据权利要求7所述的装置,其特征在于,所述确定模块具体用于:按照zigzag扫描方法确定所述量化块中量化系数的扫描顺序,以便通过所述扫描顺序将二维的量化块转换为一维数组。
- 根据权利要求7所述的装置,其特征在于,所述初始化模块进一步用于执行以下操作:步骤310:预先配置一变量,所述变量的初始值为零;步骤320:依次解析码流获得二元符号,并判断所述二元符号是否为1,如果所述二元符号为1,以当前变量的值作为所述游程长度的值,并结束游程长度的解码;否则更新所述变量,将所述变量的值加1作为更新后的当前变量的值,并判断所述当前变量的值是否小于阈值;步骤330:当所述当前变量的值小于阈值时,返回所述步骤320;步骤340:当所述当前变量的值大于等于阈值时,以零阶指数哥伦布码的方式解析后续的二元符号串,得到后续二元符号串对应的值,将所述后续二元符号串对应的值与阈值相加作为所述游程长度的值,并结束游程长度的解码。
- 根据权利要求7所述的装置,其特征在于,所述解码模块还进一步用于:在所述对该扫描位置所对应的非零系数的值进行解码之后,根据所述扫描顺序,将解码得到的非零系数的值,赋值到所述量化块中对应量化系数的位置上。
- 一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1至5中任一项所述的方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US17/428,806 US11902524B2 (en) | 2019-02-27 | 2019-03-07 | Decoding method and device for quantization block, video decoding method, and electronic device |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910144295.2A CN109788284B (zh) | 2019-02-27 | 2019-02-27 | 一种量化块的解码方法、装置及电子设备 |
| CN201910144295.2 | 2019-02-27 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020172908A1 true WO2020172908A1 (zh) | 2020-09-03 |
Family
ID=66485824
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/077292 Ceased WO2020172908A1 (zh) | 2019-02-27 | 2019-03-07 | 一种量化块的解码方法、装置及电子设备 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US11902524B2 (zh) |
| CN (1) | CN109788284B (zh) |
| WO (1) | WO2020172908A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116527910A (zh) * | 2023-04-11 | 2023-08-01 | 杭州电子科技大学 | 一种基于扫描线并行的率失真优化量化方法 |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110545437B (zh) * | 2019-08-30 | 2021-07-20 | 北京大学 | 系数编码、解码方法、电子设备及介质 |
| CN114079780B (zh) * | 2020-08-20 | 2024-10-25 | 腾讯科技(深圳)有限公司 | 视频解码方法、视频编码方法、装置、设备及存储介质 |
| CN115086656B (zh) * | 2021-03-14 | 2025-03-28 | 腾讯科技(深圳)有限公司 | 视频编解码方法、装置、计算机可读介质及电子设备 |
| CN115086655B (zh) * | 2021-03-14 | 2025-03-25 | 腾讯科技(深圳)有限公司 | 视频编解码方法、装置、计算机可读介质及电子设备 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102377994A (zh) * | 2010-08-05 | 2012-03-14 | 富士通株式会社 | 上下文自适应可变长度编码方法和系统 |
| US8144784B2 (en) * | 2007-07-09 | 2012-03-27 | Cisco Technology, Inc. | Position coding for context-based adaptive variable length coding |
| CN103299638A (zh) * | 2010-12-30 | 2013-09-11 | Sk电信有限公司 | 自适应扫描装置及其扫描方法 |
Family Cites Families (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH099074A (ja) * | 1995-06-20 | 1997-01-10 | Minolta Co Ltd | 画像処理装置 |
| JP4109404B2 (ja) * | 2000-04-26 | 2008-07-02 | 松下電器産業株式会社 | 符号化装置および符号化方法 |
| EP1472882A1 (en) * | 2002-01-22 | 2004-11-03 | Koninklijke Philips Electronics N.V. | Reducing bit rate of already compressed multimedia |
| US7519229B2 (en) * | 2004-03-30 | 2009-04-14 | Apple, Inc. | Video coding system providing separate coding chains for dynamically selected small-size or full-size playback |
| CN101132530A (zh) * | 2006-08-22 | 2008-02-27 | 中兴通讯股份有限公司 | 基于游程编码实现嵌入式图像压缩的方法 |
| WO2008122913A2 (en) * | 2007-04-04 | 2008-10-16 | Nxp B.V. | Decoder for selectively decoding predetermined data units from a coded bit stream |
| CN102238381B (zh) * | 2010-04-29 | 2013-06-19 | 晨星软件研发(深圳)有限公司 | 加速游程长度编码的影像编码方法与影像编码装置 |
| US20120163448A1 (en) * | 2010-12-22 | 2012-06-28 | Qualcomm Incorporated | Coding the position of a last significant coefficient of a video block in video coding |
| WO2013050612A1 (en) * | 2011-10-06 | 2013-04-11 | Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. | Entropy coding buffer arrangement |
| JP5966345B2 (ja) * | 2011-12-21 | 2016-08-10 | ソニー株式会社 | 画像処理装置および方法 |
| CN102752592B (zh) * | 2012-06-20 | 2015-02-11 | 深圳广晟信源技术有限公司 | 视频变换系数的熵编码方法 |
-
2019
- 2019-02-27 CN CN201910144295.2A patent/CN109788284B/zh active Active
- 2019-03-07 US US17/428,806 patent/US11902524B2/en active Active
- 2019-03-07 WO PCT/CN2019/077292 patent/WO2020172908A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8144784B2 (en) * | 2007-07-09 | 2012-03-27 | Cisco Technology, Inc. | Position coding for context-based adaptive variable length coding |
| CN102377994A (zh) * | 2010-08-05 | 2012-03-14 | 富士通株式会社 | 上下文自适应可变长度编码方法和系统 |
| CN103299638A (zh) * | 2010-12-30 | 2013-09-11 | Sk电信有限公司 | 自适应扫描装置及其扫描方法 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116527910A (zh) * | 2023-04-11 | 2023-08-01 | 杭州电子科技大学 | 一种基于扫描线并行的率失真优化量化方法 |
Also Published As
| Publication number | Publication date |
|---|---|
| US11902524B2 (en) | 2024-02-13 |
| US20220345706A1 (en) | 2022-10-27 |
| CN109788284B (zh) | 2020-07-28 |
| CN109788284A (zh) | 2019-05-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11949868B2 (en) | Method and device for selecting context model of quantization coefficient end flag bit | |
| JP2023040013A (ja) | 適応ツリー選択を使用してバイナリ・セットをビデオ符号化およびビデオ復号する方法および装置 | |
| JP4700491B2 (ja) | 適応係数スキャン順序付け | |
| RU2563681C2 (ru) | Отдельное кодирование позиции последнего значимого коэффициента видеоблока при кодировании видео | |
| EP3677027B1 (en) | Mixing of probabilities for entropy coding in video compression | |
| RU2541226C2 (ru) | Кодирование позиции последнего значимого коэффициента в видеоблоке на основе порядка сканирования для блока при кодировании видео | |
| US11051037B2 (en) | Method and apparatus for vector encoding in video coding and decoding | |
| WO2020172908A1 (zh) | 一种量化块的解码方法、装置及电子设备 | |
| CN103563381B (zh) | 对视频数据进行上下文自适应译码 | |
| CN103597838B (zh) | 对末位有效系数的位置进行编码和解码的方法和设备 | |
| JP2021530124A (ja) | ビデオサンプルの変換されたブロックを符号化および復号するための方法、装置、およびシステム | |
| KR20160093061A (ko) | 비디오 코덱에서 신택스 요소 인코딩을 위한 방법 및 장치 | |
| US10070127B2 (en) | Method and apparatus for arithmetic coding and termination | |
| US10652541B2 (en) | Method and device for encoding video data | |
| KR102380579B1 (ko) | 비디오 데이터에 관련된 신택스 엘리먼트를 나타내는 이진 심볼들의 시퀀스의 컨텍스트-적응적 이진 산술 코딩을 위한 방법 및 디바이스 | |
| CN113597757A (zh) | 具有区域数自适应的几何划分的形状自适应离散余弦变换 | |
| KR20160034914A (ko) | 비변환 코딩을 위한 스캐닝 순서 조정 기법 | |
| CN102473315B (zh) | 再次使用树结构编码和解码二元集的方法和装置 | |
| CN108353180A (zh) | 具有延迟重构的视频编码 | |
| CN102648583B (zh) | 用于编码和解码图像的方法、对应的编码和解码装置 | |
| KR20140129624A (ko) | 동영상 처리 방법 및 장치 | |
| US9008448B2 (en) | Method and apparatus for successively encoding/decoding image | |
| US20190191162A1 (en) | Method and device for encoding video data | |
| CN114449277B (zh) | 用于系数代码化的上下文推导的方法和设备 | |
| WO2022205312A1 (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: 19917031 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19917031 Country of ref document: EP Kind code of ref document: A1 |