WO2020172907A1 - 一种量化系数结束标志位的上下文模型选取方法及装置 - Google Patents
一种量化系数结束标志位的上下文模型选取方法及装置 Download PDFInfo
- Publication number
- WO2020172907A1 WO2020172907A1 PCT/CN2019/077278 CN2019077278W WO2020172907A1 WO 2020172907 A1 WO2020172907 A1 WO 2020172907A1 CN 2019077278 W CN2019077278 W CN 2019077278W WO 2020172907 A1 WO2020172907 A1 WO 2020172907A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- context model
- value
- end flag
- coefficient
- quantization
- Prior art date
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/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/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/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/134—Methods 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/167—Position within a video image, e.g. region of interest [ROI]
-
- 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
- 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/80—Details of filtering operations specially adapted for video compression, e.g. for pixel interpolation
-
- 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/85—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression
- H04N19/86—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using pre-processing or post-processing specially adapted for video compression involving reduction of coding artifacts, e.g. of blockiness
-
- 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/91—Entropy coding, e.g. variable length coding [VLC] or arithmetic coding
Definitions
- This specification relates to the technical field of video coding and decoding, and in particular to a method and device for selecting a context model for the end flag of a quantization coefficient.
- the scanning position is initialized, and the quantized block is scanned in a predetermined scanning order.
- the scanning order through arithmetic coding and decoding, one or more sets of Run-Level pairs are sequentially coded and decoded; Run represents the number of consecutive zero coefficients starting from the current scanning position, and Level represents the coefficient value of the next non-zero coefficient;
- Run-Level pairs After decoding a set of Run-Level pairs, it is necessary to encode and decode a quantized coefficient end flag bit through arithmetic encoding and decoding, thereby indicating whether there are non-zero coefficients that have not been encoded or decoded in the current quantized coefficient block.
- a unit that identifies a certain decoding information is called a syntax element, and a syntax element can be 0 and 1, or a value greater than 1.
- the value of the syntax element is binarized into a binary symbol string according to the rules agreed by the codec standard, and each symbol in the symbol string can be 0 or 1.
- the arithmetic coding and decoding process needs to determine a context model for each binary symbol in the binary symbol string, which includes the binary symbol of the end flag of the quantization coefficient.
- the context model records the probability of occurrence of binary symbols 0 and 1.
- the probability of occurrence of binary symbols 0 and 1 is quite different (for example: binary symbols of different grammatical elements, different binary symbols of the same grammatical element Sign bit, etc.). Therefore, different binary symbols should use different context models.
- the binary symbols of different quantized coefficient end flags are coded and decoded using the same context model, which reduces the coding and decoding efficiency of the quantized coefficient end flag and further reduces the efficiency of video coding and decoding.
- the purpose of the present invention is to provide a method and device for selecting the context model of the quantization coefficient end flag, so as to solve the problem of using the same context model to encode and decode all binary symbols, which reduces the quantization.
- the coding and decoding efficiency of the coefficient end flag bit further reduces the problem of the efficiency of video coding and decoding.
- the scanning position POS is the subscript of the corresponding non-zero coefficient in the scanning order
- the first context model array Configure the first context model array, and use a fixed value as the base, calculate the logarithm value of the value obtained by adding 1 to the scanning position POS, and select the first context model from the first context model array according to the logarithm value ; And the first context model is used to encode or decode the binary symbol of the end flag bit of the current quantization coefficient.
- the scanning order is a zigzag scanning order.
- the fixed value is an integer greater than 1.
- the selecting a first context model from the first context model array according to the logarithmic value specifically includes: rounding down the logarithmic value to obtain an index value, and obtaining an index value from the index value according to the index value.
- the first context model array select the first context model whose subscript is the index value.
- the method further includes: selecting a second context model, generating a third context model according to the first context model and the second context model, and using the third context model for the end flag of the current quantization coefficient Binary symbols are encoded or decoded.
- the selecting the second context model specifically includes:
- the value of the variable is equal to the default value
- the value of the variable is equal to the value of the previous non-zero coefficient of the current non-zero coefficient in the scanning order
- the index value is obtained after the value of the variable is subtracted by 1, and the second context model whose subscript is the index value is selected from the second context model array according to the index value.
- it further includes:
- the negative log value of the probability value of mps1, the negative log value of the probability value of mps2, and the negative log value of the probability value of mps3 are denoted as lgPmps1, lgPmps2, and lgPmps3, respectively.
- the generating a third context model according to the first context model and the second context model includes:
- lgPmps3 (lgPmps1+lgPmps2)>>1;
- mps1 and mps2 are different, and lgPmps1 is less than lgPmps2, then mps3 is equal to mps1. At this time,
- lgPmps3 (1023-((lgPmps2-lgPmps1)>>1));
- lgPmps3 (1023-((lgPmps1-lgPmps2)>>1)).
- the transformation unit subtracts the corresponding predicted image block from the original image block to obtain the first residual image block
- the first residual image block is transformed and quantized to obtain a quantized block
- the quantization block undergoes inverse quantization and inverse transformation to generate a second residual image block
- the residual image block and the corresponding predicted image block are added to obtain a reconstructed image block;
- the acquiring module is used to acquire the scanning position POS of the non-zero coefficient corresponding to the current quantization coefficient end flag bit in a specific scanning order; the scanning position POS is the subscript of the corresponding non-zero coefficient in the scanning order;
- the selection module is configured to configure the first context model array, and use a fixed value as the base to calculate the logarithm of the value obtained by adding 1 to the scanning position POS, and from the first context model array according to the logarithm Select a first context model; and use the first context model as a context model for encoding or decoding the binary symbol of the current quantization coefficient end flag.
- a generating module configured to select a second context model, generate a third context model according to the first context model and the second context model, and use the third context model to quantify the current
- the binary symbol of the coefficient end flag is encoded or decoded.
- An electronic device provided by an embodiment of this specification includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor.
- the processor implements the above-mentioned quantization coefficient end flag when the program is executed.
- the context model selection method includes a processor, and a computer program stored in the memory and capable of running on the processor.
- the present invention obtains the scanning position POS of the non-zero coefficient corresponding to the end flag bit of the current quantization coefficient in a specific scanning order; the scanning position POS is the subscript corresponding to the non-zero coefficient in the scanning order; configuring the first context model Calculate the logarithm of the value obtained by adding 1 to the scanning position POS with a fixed value at the base, and select the first context model from the first context model array according to the logarithm; and The first context model is used to encode or decode the binary symbol of the end flag of the current quantization coefficient. Based on the solution of the present invention, the coding and decoding efficiency of the quantization coefficient end flag can be improved, thereby further improving the efficiency of video coding and decoding.
- FIG. 1 is a schematic flowchart of a method for selecting a context model of a quantization coefficient end flag provided by an embodiment of this specification
- FIG. 2 is a schematic diagram of the scanning sequence 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 another method for selecting a context model of a quantization coefficient end flag provided by an embodiment of this specification
- FIG. 4 is a schematic structural diagram of a context model selection device for quantization coefficient end flag bit provided by an embodiment of this specification
- FIG. 5 is a schematic structural diagram of another device for selecting a context model of a quantization coefficient end flag provided by an embodiment of this specification.
- FIG. 1 is a schematic flowchart of a method for selecting an end flag of a quantization coefficient according to an embodiment of the present invention.
- the method may specifically include the following steps:
- step S110 the scanning position POS of the non-zero coefficient corresponding to the current quantization coefficient end flag bit in a specific scanning sequence is obtained; the scanning position POS is the subscript of the corresponding non-zero coefficient in the scanning sequence.
- the two-dimensional quantized block when encoding and decoding the quantized block, can be converted into a one-dimensional array according to a certain scanning method, and then the one-dimensional array is encoded and decoded. decoding.
- the scanning order of the quantized coefficients in the quantization block can be determined according to the zigzag scanning method. At this time, the corresponding scanning order is the zigzag scanning order.
- Zigzag scanning is a scanning matrix method, which is mostly used in the encoding and decoding process of images and videos. . Refer to Figure 2, which shows a schematic diagram of the scanning sequence of a typical 8 ⁇ 8 quantized coefficient block using the zigzag scanning method.
- All the quantized coefficients in the quantized block are sequentially scanned according to an oblique zigzag scanning path starting from the initial position. , You can get the one-dimensional array of the quantization block. It should be noted that the zigzag scanning mode remains unchanged between quantized blocks of different widths and heights, but the scanning order will be slightly different.
- the scanning position of the quantization coefficient in the quantization block is initialized, that is, the subscripts of the quantization coefficients in the quantization block after scanning are initialized, and the subscripts of the initialized quantization coefficients are marked as 0, 1 in turn , 2, 3, 4..., where the initial scanning position is set to 0; the scanning position POS corresponds to the position of the quantization coefficient in the quantization block.
- the decoding of quantized coefficients based on the run-length decoding method is taken as an example.
- a run-length Run it represents the number of consecutive zero coefficients that exist backward from the current scanning position POS, because each decoded one is non-zero.
- the scanning position of the next non-zero coefficient Level can be determined; then by decoding the current non-zero coefficient Level, the value of the current non-zero coefficient Level is obtained .
- a quantized coefficient end flag can be decoded to indicate whether the non-zero coefficients in the current quantized coefficient block have been completely resolved, so as to avoid decoding a larger run length Run.
- Each quantized coefficient end flag corresponds to a non-zero coefficient, so in the process of decoding the quantized coefficient, when the current quantized coefficient end flag is decoded, the non-zero corresponding to the current quantized coefficient end flag can be obtained The scan position POS of the coefficient in the zigzag scan order.
- a first context model array is configured, and a fixed value is used as the base to calculate the log value of the value obtained by adding 1 to the scanning position POS, and from the first context model array according to the log value Selecting a first context model; and using the first context model to encode or decode the binary symbol of the end flag of the current quantization coefficient.
- the length of the first context model array can be determined by defining the largest quantized coefficient block and according to the maximum value of the scanning position POS of the quantized coefficient block. For example, when the largest block of quantized coefficients is set to 64 ⁇ 64, at this time, it contains at most 4096 quantized coefficients, and the maximum subscript value of non-zero coefficients is 4095, that is, the maximum value of the scanning position POS is 4095.
- a fixed value is used to calculate the logarithm of the value obtained by adding 1 to the scanning position POS.
- selecting the first context model from the first context model array according to the logarithmic value specifically includes: rounding the logarithmic value down to obtain an index value, and selecting the next context model from the first context model array according to the index value.
- the first context model marked as an index value; where the index value can be represented by idx.
- the scanning position POS of the non-zero coefficient is 4095, the non-zero coefficient is already the last quantized coefficient, so there is no need to decode the quantized coefficient end flag of the non-zero coefficient, only the maximum value of the scanning position POS is In the case of 4094, in this case, the logarithmic value of the value obtained after the scanning position POS is incremented by 1 is rounded down to the index idx of 11. At this time, the first context model array contains 12 context models.
- the scanning position POS of the non-zero coefficient corresponding to the current quantization coefficient end flag in a specific scanning sequence is used as the input parameter to calculate the pair of values obtained by adding 1 to the scanning position POS Value, and select the context model from the first context model array based on the logarithmic value.
- Different binary symbols can use the same or different context models.
- the scanning positions POS of the corresponding non-zero coefficients are also different.
- FIG. 3 is a schematic flowchart of another method for selecting the context model of the quantization coefficient end flag provided by an embodiment of the present invention.
- the method may specifically include the following processes:
- step S310 obtain the scanning position POS of the non-zero coefficient corresponding to the current quantization coefficient end flag bit in a specific scanning order; the scanning position POS is the subscript of the corresponding non-zero coefficient in the scanning order;
- a first context model array is configured, and a fixed value is used as the base to calculate the logarithmic value of the value obtained by adding 1 to the scanning position POS, and from the first context model array according to the logarithmic value Select the first context model;
- step S330 a second context model is selected, a third context model is generated according to the first context model and the second context model, and the third context model is used for the binary end flag of the current quantization coefficient. Symbols are encoded or decoded.
- step S310-step S320 are basically the same as the above-mentioned step S110-step S120, and will not be repeated here.
- selecting the second context model may specifically include the following process:
- the value of the variable is equal to the default value
- the value of the variable is equal to the value of the previous non-zero coefficient of the current non-zero coefficient in the scan order
- the index value is obtained after the value of the variable is subtracted by 1, and the second context model whose subscript is the index value is selected from the second context model array according to the index value.
- the quantized coefficients are coded and decoded in sequence according to a specific scanning order. Therefore, by initializing the scanning position of the quantized coefficients, after each run length Run is decoded, the current error in the scanning order can be determined. The scanning position of the zero coefficient, and then determine whether the current non-zero coefficient is the first non-zero coefficient in the scanning order, and the value of the previous non-zero coefficient of the current non-zero coefficient in the scanning order.
- the arbitrary value and the default value are all natural numbers greater than zero.
- step S330 further, mark the high probability symbol of the first context model, the high probability symbol of the second context model, and the high probability symbol of the third context model as mps1, mps2, and mps3;
- the negative log value, the negative log value of the probability value of mps2, and the negative log value of the probability value of mps3 are denoted as lgPmps1, lgPmps2, and lgPmps3, respectively.
- generating the third context model according to the first context model and the second context model may specifically include the following process:
- lgPmps3 (lgPmps1+lgPmps2)>>1;
- mps1 and mps2 are different, and lgPmps1 is less than lgPmps2, then mps3 is equal to mps1. At this time,
- lgPmps3 (1023-((lgPmps2-lgPmps1)>>1));
- lgPmps3 (1023-((lgPmps1-lgPmps2)>>1)).
- the embodiment of this specification also provides a video encoding method, including:
- the transformation unit subtracts the corresponding predicted image block from the original image block to obtain the first residual image block
- the first residual image block is transformed and quantized to obtain a quantized block
- the quantization block undergoes inverse quantization and inverse transformation to generate a second residual image block
- an image block composed of predicted pixels obtained through prediction technology is called a predicted image block; when encoding a frame of image, the image is divided into coding units of different sizes for encoding ;
- the coding unit is divided into one or more prediction units; the coding unit is also divided into one or more transformation units; the coding unit chooses to use the intra mode or the inter mode to predict the prediction unit to obtain the prediction image corresponding to the prediction unit Block; the original image block corresponding to the transform unit is subtracted from the corresponding predicted image block to obtain the residual image block Resi; the residual image block Resi is transformed and quantized to obtain the quantized block; the prediction unit and the transform unit division information, prediction mode, quantized block
- the quantization coefficient end flag in the quantization block is used in the entropy coding process to select the context model according to the method described in the embodiment of this specification; the quantization block is inversely quantized to obtain the inverse transform block; the inverse transform block The residual image block Resi
- 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;
- 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 quantization coefficient end flag in the quantization block selects the context model according to the method described in the embodiment of this specification during the entropy decoding process. 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.
- FIG. 4 is a context model selection device for the quantization coefficient end flag provided by the embodiment of the specification. mainly includes:
- the obtaining module 401 is configured to obtain the scanning position POS of the non-zero coefficient corresponding to the current quantization coefficient end flag bit in a specific scanning order; the scanning position POS is the subscript of the corresponding non-zero coefficient in the scanning order;
- the selection module 402 is configured to configure a first context model array and use a fixed value as the base to calculate the logarithm of the value obtained by adding 1 to the scanning position POS, and to obtain the logarithm from the first context model array according to the logarithm Select the first context model in the, and use the first context model as the context model when encoding or decoding the binary symbol of the current quantization coefficient end flag.
- FIG. 5 is another device for selecting the context model of the quantization coefficient end flag provided by the embodiment of this specification.
- the device mainly includes:
- the acquiring module 501 is configured to acquire the scanning position POS of the non-zero coefficient corresponding to the current quantization coefficient end flag bit in a specific scanning order; the scanning position POS is the subscript of the corresponding non-zero coefficient in the scanning order;
- the selection module 502 is configured to configure a first context model array, and use a fixed value as the base to calculate the logarithm value of the value obtained by adding 1 to the scanning position POS, and obtain the logarithmic value from the first context model array according to the logarithmic value Select the first context model;
- the generation module 503 is configured to select a second context model, generate a third context model according to the first context model and the second context model, and use the third context model to determine the second context model of the current quantization coefficient end flag. Meta symbols are encoded or decoded.
- the embodiment of the present specification also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor.
- the processor implements the above-mentioned quantization coefficient end flag when the program is executed.
- the context model selection method is also provided.
- 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)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
本说明书实施例提供一种量化系数结束标志位的上下文模型选取方法及装置。所述方法包括:获取当前量化系数结束标志位所对应的非零系数在特定扫描顺序下的扫描位置POS;所述扫描位置POS为所述扫描顺序下对应非零系数的下标;配置第一上下文模型数组,并以一固定值为底,计算所述扫描位置POS加1后所得到数值的对数值,根据所述对数值从所述第一上下文模型数组中选择第一上下文模型;并将所述第一上下文模型用于对所述当前量化系数结束标志位的二元符号进行编码或解码。采用本申请的技术方案,能够提升量化系数结束标志位的编解码效率,从而进一步提升视频编解码的效率。
Description
本申请要求享有2019年2月27日提交的名称为“一种量化系数结束标志位的上下文模型选取方法及装置”的中国专利申请CN201910145192.8的优先权,其全部内容通过引用并入本文中。
本说明书涉及视频编解码技术领域,尤其涉及一种量化系数结束标志位的上下文模型选取方法及装置。
视频编解码的过程中,在对量化块进行编解码时,将扫描位置进行初始化操作,按照预定的扫描顺序扫描量化块。在扫描顺序下通过算数编解码,依次编解码一组或多组Run-Level对;Run表示从当前扫描位置开始,连续零系数的个数,Level表示下一个非零系数的系数值;每编解码完一组Run-Level对之后,需要通过算数编解码,来编解码一个量化系数结束标志位,从而表示当前量化系数块中是否还存在未编解码的非零系数。
另外,标识某个解码信息的单元称为一个语法元素,一个语法元素可以是0和1,也可以是大于1的某个值。解码某个语法元素的时候,通过编解码标准约定的规则,将语法元素的值二值化为一个二元符号串,符号串中每一位符号可以是0或者1。
算数编解码过程需要对二元符号串中的每一个二元符号确定一个上下文模型,这其中包括了量化系数结束标志位的二元符号。上下文模型记录了二元符号0和1出现的概率,在不同的场景下,二元符号0和1出现的概率差异较大(例如:不同语法元素的二元符号,同一语法元素不同的二元符号位等)。因 此,不同的二元符号应该使用不同的上下文模型。然而现有技术中,不同的量化系数结束标志位,其二元符号使用的是同一个上下文模型进行编解码,降低了量化系数结束标志位的编解码效率,进一步降低了视频编解码的效率。
发明内容
有鉴于此,本发明的目的在于提供一种量化系数结束标志位的上下文模型选取方法及装置,以解决现有技术存在的使用同一个上下文模型对所有的二元符号进行编解码,降低了量化系数结束标志位的编解码效率,进一步降低了视频编解码的效率的问题。
为解决上述技术问题,本说明书实施例是这样实现的:
本说明书实施例提供的一种量化系数结束标志位的上下文模型选取方法,包括:
获取当前量化系数结束标志位所对应的非零系数在特定扫描顺序下的扫描位置POS;所述扫描位置POS为所述扫描顺序下对应非零系数的下标;
配置第一上下文模型数组,并以一固定值为底,计算所述扫描位置POS加1后所得到数值的对数值,根据所述对数值从所述第一上下文模型数组中选择第一上下文模型;并将所述第一上下文模型用于对所述当前量化系数结束标志位的二元符号进行编码或解码。
可选的,所述扫描顺序为zigzag扫描顺序。
可选的,所述固定值为大于1的整数。
可选的,所述根据所述对数值从所述第一上下文模型数组中选择第一上下文模型,具体包括:将所述对数值向下取整得到索引值,根据所述索引值从所述第一上下文模型数组中,选择下标为所述索引值的第一上下文模型。
可选的,进一步包括:选取第二上下文模型,根据所述第一上下文模型和第二上下文模型生成第三上下文模型,将所述第三上下文模型用于对所述当前 量化系数结束标志位的二元符号进行编码或解码。
可选的,所述选取第二上下文模型,具体包括:
以任意值为长度配置第二上下文模型数组,并预设一变量和默认值;
如果当前非零系数为扫描顺序下的第一个非零系数,则所述变量的值等于所述默认值;
如果当前非零系数为扫描顺序下第一个非零系数后的非零系数,则所述变量的值等于当前非零系数在扫描顺序下的前一个非零系数的值;
当所述变量的值大于所述第二上下文模型数组的长度值时,将所述变量的值修正为所述第二上下文模型数组的长度值;
将所述变量的值减1后得到索引值,根据所述索引值从所述第二上下文模型数组中,选择下标为所述索引值的第二上下文模型。
可选的,进一步包括:
将所述第一上下文模型的大概率符号、第二上下文模型的大概率符号、第三上下文模型的大概率符号,分别记为mps1、mps2和mps3;
将所述mps1概率值的负对数值、mps2概率值的负对数值、mps3概率值的负对数值,分别记为lgPmps1、lgPmps2和lgPmps3。
可选的,所述根据所述第一上下文模型和第二上下文模型生成第三上下文模型,包括:
当mps1和mps2相同,则mps3等于mps1,此时,
lgPmps3=(lgPmps1+lgPmps2)>>1;
当mps1和mps2不同,且lgPmps1小于lgPmps2,则mps3等于mps1,此时,
lgPmps3=(1023-((lgPmps2-lgPmps1)>>1));
当mps1和mps2不同,且lgPmps1大于lgPmps2,则mps3等于mps2,此 时,
lgPmps3=(1023-((lgPmps1-lgPmps2)>>1))。
本说明书实施例提供的一种视频编码方法,包括:
根据预测信息通过预测技术得到预测图像块;
变换单元将原始图像块减去对应的预测图像块得到第一残差图像块;
第一残差图像块经过变换和量化得到量化块;
将划分信息、预测信息以及量化块写入码流;
量化块经过反量化和反变换生成第二残差图像块;
根据第二残差图像块以及预测图像块获取重建图像块;
对重建图像块构成的重建图像进行去块效应滤波,获取用于后续帧参考的参考图像;
还包括,在进行视频编码时,将量化块写入码流的过程中,利用上述方法对量化块中量化系数结束标志位的上下文模型选取。
本说明书实施例提供的一种视频解码方法,包括:
从码流中解码得到划分信息、预测信息以及量化块;
根据预测信息通过预测技术得到预测图像块;
量化块经过反量化和反变换得到残差图像块;
残差图像块与对应的预测图像块相加得到重建图像块;
对重建图像块构成的重建图像进行去块效应滤波,获取用于后续帧参考的参考图像;
还包括,在进行视频解码时,从码流中解码得到量化块的过程中,利用上述方法对量化块中量化系数结束标志位的上下文模型选取。
本说明书实施例提供的一种量化系数结束标志位的上下文模型选取装置,包括:
获取模块,用于获取当前量化系数结束标志位所对应的非零系数在特定扫描顺序下的扫描位置POS;所述扫描位置POS为所述扫描顺序下对应非零系数的下标;
选择模块,用于配置第一上下文模型数组,并以一固定值为底,计算所述扫描位置POS加1后所得到数值的对数值,根据所述对数值从所述第一上下文模型数组中选择第一上下文模型;并将所述第一上下文模型作为对所述当前量化系数结束标志位的二元符号进行编码或解码时的上下文模型。
可选的,进一步包括:生成模块,用于选取第二上下文模型,根据所述第一上下文模型和第二上下文模型生成第三上下文模型,将所述第三上下文模型用于对所述当前量化系数结束标志位的二元符号进行编码或解码。
本说明书实施例提供的一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述一种量化系数结束标志位的上下文模型选取方法。
本说明书实施例采用的上述至少一个技术方案能够达到以下有益效果:
本发明通过获取当前量化系数结束标志位所对应的非零系数在特定扫描顺序下的扫描位置POS;所述扫描位置POS为所述扫描顺序下对应非零系数的下标;配置第一上下文模型数组,并以一固定值为底,计算所述扫描位置POS加1后所得到数值的对数值,根据所述对数值从所述第一上下文模型数组中选择第一上下文模型;并将所述第一上下文模型用于对所述当前量化系数结束标志位的二元符号进行编码或解码。基于本发明的方案,能够提升量化系数结束标志位的编解码效率,从而进一步提升视频编解码的效率。
为了更清楚的说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见的下面描述中 的附图仅仅是本发明的实施例,对于本领域普通人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1是本说明书实施例提供的一种量化系数结束标志位的上下文模型选取方法的流程示意图;
图2是本说明书实施例提供的典型的8×8量化系数块采用zigzag扫描方式的扫描顺序示意图;
图3是本说明书实施例提供的另一种量化系数结束标志位的上下文模型选取方法的流程示意图;
图4是本说明书实施例提供的一种量化系数结束标志位的上下文模型选取装置的结构示意图;
图5是本说明书实施例提供的另一种量化系数结束标志位的上下文模型选取装置的结构示意图。
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本说明书实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
图1为本发明实施例提供的一种量化系数结束标志位的上下文模型选取方法的流程示意图。该方法具体可以包括以下步骤:
在步骤S110中,获取当前量化系数结束标志位所对应的非零系数在特定扫描顺序下的扫描位置POS;所述扫描位置POS为所述扫描顺序下对应非零系数的下标。
在本说明书实施例中,在视频编解码的过程中,对量化块进行编解码时, 可以先将二维的量化块按照某种扫描方式转换成一维数组,然后对一维数组进行编解和解码。在具体实施过程中,可以按照zigzag扫描方法确定量化块中量化系数的扫描顺序,此时对应扫描顺序为zigzag扫描顺序,zigzag扫描是一种扫描矩阵的方法,多用于图像和视频的编解码过程。参见图2,该图示出了一种典型的8×8量化系数块采用zigzag扫描方式的扫描顺序示意图,按照斜向的Z字形扫描路径以初始位置为起点依次扫描量化块中的所有量化系数,即可得到该量化块的一维数组。需要说明的是,不同宽高的量化块之间,zigzag扫描方式不变,但是扫描顺序会略有差异。
依据上述特定的扫描顺序,将量化块中量化系数的扫描位置进行初始化操作,即对扫描后量化块中量化系数的下标进行初始化操作,初始化后的量化系数的下标依次标记为0、1、2、3、4……,其中初始扫描位置设为0;扫描位置POS与量化块中量化系数的位置一一对应。
在本说明书实施例中,以基于游程解码方式对量化系数进行解码为例,通过解码一个游程长度Run,表示从当前扫描位置POS向后存在的连续零系数的个数,由于每解码一个非零系数Level前,都需要解码一个游程长度Run,因此,通过解码一个游程长度Run,可以确定下一个非零系数Level的扫描位置;再通过解码当前非零系数Level,得到当前非零系数Level的值。在解码完成一个游程长度Run和一个非零系数Level之后,可以通过解码一个量化系数结束标志位来表示当前量化系数块中的非零系数是否已经完全解析,以避免解码较大的游程长度Run。每一个量化系数结束标志位都对应一个非零系数,因此在对量化系数进行解码的过程中,在解码到当前量化系数结束标志位时,便可以获取当前量化系数结束标志位所对应的非零系数在zigzag扫描顺序下的扫描位置POS。
在步骤S120中,配置第一上下文模型数组,并以一固定值为底,计算所述扫描位置POS加1后所得到数值的对数值,根据所述对数值从所述第一上下文模型数组中选择第一上下文模型;并将所述第一上下文模型用于对所述当前量化系数结束标志位的二元符号进行编码或解码。
在本说明书实施例中,配置第一上下文模型数组时,可以通过定义最大的量化系数块,根据量化系数块的扫描位置POS的最大值,来确定第一上下文模型数组的长度。例如:将最大的量化系数块定为64×64时,此时,最多包含4096个量化系数,非零系数的最大下标值为4095,也即扫描位置POS的最大值为4095。
在本说明书实施例中,以一固定值为底,计算扫描位置POS加1后所得到数值的对数值,上述固定值可以为大于1的整数,例如:当固定值为2时,根据以下公式计算对数值:n=log
2(pos+1),其中n表示对数值,pos表示非零系数的下标。
在本说明书实施例中,根据对数值从第一上下文模型数组中选择第一上下文模型,具体包括:将对数值向下取整得到索引值,根据索引值从第一上下文模型数组中,选择下标为索引值的第一上下文模型;其中,索引值可以用idx来表示。
进一步地,当非零系数的扫描位置POS为4095时,该非零系数已经是最后一个量化系数,因此不需要解码该非零系数的量化系数结束标志位,只需要考虑扫描位置POS最大值为4094的情形,在该情形下扫描位置POS加1后所得到数值的对数值向下取整的索引值idx为11,此时第一上下文模型数组中包含了12个上下文模型。
在本说明书实施例中,根据当前量化系数结束标志位所对应的非零系数在特定扫描顺序下的扫描位置POS,以扫描位置POS为输入参数,计算扫描位置POS加1后所得到数值的对数值,并根据对数值从第一上下文模型数组中选择上下文模型。不同的二元符号可以使用相同或不同的上下文模型,针对不同的量化系数结束标志位,其对应的非零系数的扫描位置POS也不相同,因此根据不同量化系数结束标志位对应非零系数的扫描位置来合理选择不同的上下文模型;通过本发明的方案,可以高效地选取上下文模型,并提升量化系数结束标志位的编解码效率,从而进一步提升视频编解码的效率。
图3为本发明实施例提供的另一种量化系数结束标志位的上下文模型选取方法的流程示意图。该方法具体可以包括以下过程:
在步骤S310中,获取当前量化系数结束标志位所对应的非零系数在特定扫描顺序下的扫描位置POS;所述扫描位置POS为所述扫描顺序下对应非零系数的下标;
在步骤S320中,配置第一上下文模型数组,并以一固定值为底,计算所述扫描位置POS加1后所得到数值的对数值,根据所述对数值从所述第一上下文模型数组中选择第一上下文模型;
在步骤S330中,选取第二上下文模型,根据所述第一上下文模型和第二上下文模型生成第三上下文模型,将所述第三上下文模型用于对所述当前量化系数结束标志位的二元符号进行编码或解码。
其中,步骤S310-步骤S320与上述步骤S110-步骤S120的处理过程基本一致,在此不再赘述。
在本说明书实施例中,选取第二上下文模型,具体可以包括以下过程:
以任意值为长度配置第二上下文模型数组,并预设一变量和默认值;
如果当前非零系数为扫描顺序下的第一个非零系数,则变量的值等于默认值;
如果当前非零系数为扫描顺序下第一个非零系数后的非零系数,则变量的值等于当前非零系数在扫描顺序下的前一个非零系数的值;
当变量的值大于第二上下文模型数组的长度值时,将变量的值修正为第二上下文模型数组的长度值;
将变量的值减1后得到索引值,根据索引值从第二上下文模型数组中,选择下标为索引值的第二上下文模型。
在本说明书实施例中,量化系数是按照特定的扫描顺序依次进行编解码的,因此,通过对量化系数的扫描位置进行初始化操作,每解码完一个游程长度Run, 便可以确定扫描顺序下当前非零系数的扫描位置,继而判断当前非零系数是否为扫描顺序下的第一个非零系数,以及当前非零系数在扫描顺序下的前一个非零系数的值。
在本说明书实施例中,所述任意值和默认值均为大于0的自然数。
在步骤S330中,进一步地,将第一上下文模型的大概率符号、第二上下文模型的大概率符号、第三上下文模型的大概率符号,分别记为mps1、mps2和mps3;将mps1概率值的负对数值、mps2概率值的负对数值、mps3概率值的负对数值,分别记为lgPmps1、lgPmps2和lgPmps3。
那么,根据第一上下文模型和第二上下文模型生成第三上下文模型,具体可以包括以下过程:
当mps1和mps2相同,则mps3等于mps1,此时,
lgPmps3=(lgPmps1+lgPmps2)>>1;
当mps1和mps2不同,且lgPmps1小于lgPmps2,则mps3等于mps1,此时,
lgPmps3=(1023-((lgPmps2-lgPmps1)>>1));
当mps1和mps2不同,且lgPmps1大于lgPmps2,则mps3等于mps2,此时,
lgPmps3=(1023-((lgPmps1-lgPmps2)>>1))。
本说明书实施例还提供一种视频编码方法,包括:
根据预测信息通过预测技术得到预测图像块;
变换单元将原始图像块减去对应的预测图像块得到第一残差图像块;
第一残差图像块经过变换和量化得到量化块;
将划分信息、预测信息以及量化块写入码流;
量化块经过反量化和反变换生成第二残差图像块;
根据第二残差图像块以及预测图像块获取重建图像块;
对重建图像块构成的重建图像进行去块效应滤波,获取用于后续帧参考的参考图像;
还包括,在进行视频编码时,将量化块写入码流的过程中,利用上述方法对量化块中量化系数结束标志位的上下文模型选取。
具体的,在一具体应用场景中,在视频编码过程中,通过预测技术得到的预测像素组成的图像块称作预测图像块;编码一帧图像时,将图像划分为不同大小的编码单元进行编码;编码单元又划分成一个或多个预测单元;编码单元同时也划分成一个或多个变换单元;编码单元选择使用帧内模式或帧间模式对预测单元进行预测,得到预测单元对应的预测图像块;变换单元对应的原始图像块减去对应的预测图像块得到残差图像块Resi;残差图像块Resi经过变换和量化操作得到量化块;预测单元和变换单元划分信息、预测模式、量化块等通过熵编码写入码流;量化块中的量化系数结束标志位在熵编码的过程中根据本说明书实施例所述的方法选取上下文模型;量化块经过反量化得到反变换块;反变换块经过反变换得到的残差图像块Resi’,残差图像块Resi’同对应的预测图像块相加得到重建图像块;重建图像块组成的重建图像经过环路滤波之后,提供给后续帧参考。
本说明书实施例还提供一种视频解码方法,包括:
从码流中解码得到划分信息、预测信息以及量化块;
根据预测信息通过预测技术得到预测图像块;
量化块经过反量化和反变换得到残差图像块;
残差图像块与对应的预测图像块相加得到重建图像块;
对重建图像块构成的重建图像进行去块效应滤波,获取用于后续帧参考的参考图像;
还包括,在进行视频解码时,从码流中解码得到量化块的过程中,利用上 述方法对量化块中量化系数结束标志位的上下文模型选取。
具体的,在一具体应用场景中,在视频解码过程中,对码流进行解析,得到每个编码单元的预测模式、参考帧索引、运动矢量、量化块等信息。量化块中的量化系数结束标志位在熵解码的过程中根据本说明书实施例所述的方法选取上下文模型。根据预测模式、参考帧索引、运动矢量等信息,生成预测图像块PRED。对量化块进行反量化和反变换操作,得到残差图像块RESI’。经残差图像块RESI’加上预测图像块PRED,得到重建图像块RECO;对重建图像块构成的重建图像进行去块效应滤波,获取用于后续帧参考的参考图像。
基于同样的思路,本说明书实施例还提供了一种量化系数结束标志位的上下文模型选取装置,如图4为本说明书实施例提供的一种量化系数结束标志位的上下文模型选取装置,该装置主要包括:
获取模块401,用于获取当前量化系数结束标志位所对应的非零系数在特定扫描顺序下的扫描位置POS;所述扫描位置POS为所述扫描顺序下对应非零系数的下标;
选择模块402,用于配置第一上下文模型数组,并以一固定值为底,计算所述扫描位置POS加1后所得到数值的对数值,根据所述对数值从所述第一上下文模型数组中选择第一上下文模型;并将所述第一上下文模型作为对所述当前量化系数结束标志位的二元符号进行编码或解码时的上下文模型。
本说明书实施例还提供了另一种量化系数结束标志位的上下文模型选取装置,如图5为本说明书实施例提供的另一种量化系数结束标志位的上下文模型选取装置,该装置主要包括:
获取模块501,用于获取当前量化系数结束标志位所对应的非零系数在特定扫描顺序下的扫描位置POS;所述扫描位置POS为所述扫描顺序下对应非零系数的下标;
选择模块502,用于配置第一上下文模型数组,并以一固定值为底,计算所 述扫描位置POS加1后所得到数值的对数值,根据所述对数值从所述第一上下文模型数组中选择第一上下文模型;
生成模块503,用于选取第二上下文模型,根据所述第一上下文模型和第二上下文模型生成第三上下文模型,将所述第三上下文模型用于对所述当前量化系数结束标志位的二元符号进行编码或解码。
本说明书实施例还提供一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述一种量化系数结束标志位的上下文模型选取方法。
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置、电子设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本说明书实施例提供的装置、电子设备与方法是对应的,因此,装置、电子设备也具有与对应方法类似的有益技术效果,由于上面已经对方法的有益技术效果进行了详细说明,因此,这里不再赘述对应装置、电子设备的有益技术效果。
本说明书是参照根据本说明书实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计 算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。
本说明书可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践说明书,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
对所公开的实施例的上述说明,使本领域技术人员能够实现或使用本发明。对这些实施例的多种修改对本领域技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本发明的精神和范围的情况下,在其他实施例中实现。因此,本发明将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。
Claims (13)
- 一种量化系数结束标志位的上下文模型选取方法,其特征在于,包括:获取当前量化系数结束标志位所对应的非零系数在特定扫描顺序下的扫描位置POS;所述扫描位置POS为所述扫描顺序下对应非零系数的下标;配置第一上下文模型数组,并以一固定值为底,计算所述扫描位置POS加1后所得到数值的对数值,根据所述对数值从所述第一上下文模型数组中选择第一上下文模型;并将所述第一上下文模型用于对所述当前量化系数结束标志位的二元符号进行编码或解码。
- 根据权利要求1所述的方法,其特征在于,所述扫描顺序为zigzag扫描顺序。
- 根据权利要求1所述的方法,其特征在于,所述固定值为大于1的整数。
- 根据权利要求1所述的方法,其特征在于,所述根据所述对数值从所述第一上下文模型数组中选择第一上下文模型,具体包括:将所述对数值向下取整得到索引值,根据所述索引值从所述第一上下文模型数组中,选择下标为所述索引值的第一上下文模型。
- 根据权利要求1所述的方法,其特征在于,进一步包括:选取第二上下文模型,根据所述第一上下文模型和第二上下文模型生成第三上下文模型,将所述第三上下文模型用于对所述当前量化系数结束标志位的二元符号进行编码或解码。
- 根据权利要求5所述的方法,其特征在于,所述选取第二上下文模型,具体包括:以任意值为长度配置第二上下文模型数组,并预设一变量和默认值;如果当前非零系数为扫描顺序下的第一个非零系数,则所述变量的值等于所述默认值;如果当前非零系数为扫描顺序下第一个非零系数后的非零系数,则所述变量的值等于当前非零系数在扫描顺序下的前一个非零系数的值;当所述变量的值大于所述第二上下文模型数组的长度值时,将所述变量的值修正为所述第二上下文模型数组的长度值;将所述变量的值减1后得到索引值,根据所述索引值从所述第二上下文模型数组中,选择下标为所述索引值的第二上下文模型。
- 根据权利要求6所述的方法,其特征在于,进一步包括:将所述第一上下文模型的大概率符号、第二上下文模型的大概率符号、第三上下文模型的大概率符号,分别记为mps1、mps2和mps3;将所述mps1概率值的负对数值、mps2概率值的负对数值、mps3概率值的负对数值,分别记为lgPmps1、lgPmps2和lgPmps3。
- 根据权利要求7所述的方法,其特征在于,所述根据所述第一上下文模型和第二上下文模型生成第三上下文模型,包括:当mps1和mps2相同,则mps3等于mps1,此时,lgPmps3=(lgPmps1+lgPmps2)>>1;当mps1和mps2不同,且lgPmps1小于lgPmps2,则mps3等于mps1,此时,lgPmps3=(1023-((lgPmps2-lgPmps1)>>1));当mps1和mps2不同,且lgPmps1大于lgPmps2,则mps3等于mps2,此时,lgPmps3=(1023-((lgPmps1-lgPmps2)>>1))。
- 一种视频编码方法,其特征在于,包括:根据预测信息通过预测技术得到预测图像块;变换单元将原始图像块减去对应的预测图像块得到第一残差图像块;第一残差图像块经过变换和量化得到量化块;将划分信息、预测信息以及量化块写入码流;量化块经过反量化和反变换生成第二残差图像块;根据第二残差图像块以及预测图像块获取重建图像块;对重建图像块构成的重建图像进行去块效应滤波,获取用于后续帧参考的参考图像;还包括,在进行视频编码时,将量化块写入码流的过程中,利用权利要求1至8中任一项所述的方法对量化块中量化系数结束标志位的上下文模型选取。
- 一种视频解码方法,其特征在于,包括:从码流中解码得到划分信息、预测信息以及量化块;根据预测信息通过预测技术得到预测图像块;量化块经过反量化和反变换得到残差图像块;残差图像块与对应的预测图像块相加得到重建图像块;对重建图像块构成的重建图像进行去块效应滤波,获取用于后续帧参考的参考图像;还包括,在进行视频解码时,从码流中解码得到量化块的过程中,利用权利要求1至8中任一项所述的方法对量化块中量化系数结束标志位的上下文模型选取。
- 一种量化系数结束标志位的上下文模型选取装置,其特征在于,包括:获取模块,用于获取当前量化系数结束标志位所对应的非零系数在特定扫描顺序下的扫描位置POS;所述扫描位置POS为所述扫描顺序下对应非零系数的下标;选择模块,用于配置第一上下文模型数组,并以一固定值为底,计算所述扫描位置POS加1后所得到数值的对数值,根据所述对数值从所述第一上下文 模型数组中选择第一上下文模型;并将所述第一上下文模型作为对所述当前量化系数结束标志位的二元符号进行编码或解码时的上下文模型。
- 根据权利要求11所述的装置,其特征在于,进一步包括:生成模块,用于选取第二上下文模型,根据所述第一上下文模型和第二上下文模型生成第三上下文模型,将所述第三上下文模型用于对所述当前量化系数结束标志位的二元符号进行编码或解码。
- 一种电子设备,包括存储器,处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1至8中任一项所述的方法。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US17/422,297 US11949868B2 (en) | 2019-02-27 | 2019-03-07 | Method and device for selecting context model of quantization coefficient end flag bit |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910145192.8 | 2019-02-27 | ||
CN201910145192.8A CN109788285B (zh) | 2019-02-27 | 2019-02-27 | 一种量化系数结束标志位的上下文模型选取方法及装置 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020172907A1 true WO2020172907A1 (zh) | 2020-09-03 |
Family
ID=66485832
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/077278 WO2020172907A1 (zh) | 2019-02-27 | 2019-03-07 | 一种量化系数结束标志位的上下文模型选取方法及装置 |
Country Status (3)
Country | Link |
---|---|
US (1) | US11949868B2 (zh) |
CN (1) | CN109788285B (zh) |
WO (1) | WO2020172907A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115643110A (zh) * | 2022-12-22 | 2023-01-24 | 河北新龙科技集团股份有限公司 | 基于运行数据的应用软件安全检测方法 |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110365977B (zh) * | 2019-06-10 | 2021-08-10 | 南京威翔科技有限公司 | 一种基于fpga的h.265变换量化方法 |
CN112118448B (zh) * | 2019-06-21 | 2022-09-16 | 杭州海康威视数字技术股份有限公司 | 一种编解码方法、装置及存储介质 |
CN112352431B (zh) * | 2019-09-30 | 2023-01-10 | 浙江大学 | 一种数据编码、解码方法、设备及存储介质 |
US11763138B2 (en) * | 2019-11-27 | 2023-09-19 | Intuit Inc. | Method and system for generating synthetic data using a regression model while preserving statistical properties of underlying data |
CN114071140B (zh) * | 2019-12-03 | 2022-12-23 | 杭州海康威视数字技术股份有限公司 | 解码方法、编码方法、装置、设备及机器可读存储介质 |
CN114979641A (zh) * | 2021-02-21 | 2022-08-30 | 腾讯科技(深圳)有限公司 | 视频编解码方法、装置、计算机可读介质及电子设备 |
EP4307666A1 (en) * | 2021-03-12 | 2024-01-17 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Coefficient encoding method, coefficient decoding method, encoding device, decoding device, and storage medium |
WO2023220946A1 (zh) * | 2022-05-17 | 2023-11-23 | Oppo广东移动通信有限公司 | 视频编解码方法、装置、设备、系统及存储介质 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1980395A (zh) * | 2005-11-30 | 2007-06-13 | 联合信源数字音视频技术(北京)有限公司 | 一种基于上下文的熵编码方法及解码方法 |
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 |
CN107087188A (zh) * | 2011-11-07 | 2017-08-22 | 太格文-Ii有限责任公司 | 图像解码方法及图像解码装置 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7469070B2 (en) * | 2004-02-09 | 2008-12-23 | Lsi Corporation | Method for selection of contexts for arithmetic coding of reference picture and motion vector residual bitstream syntax elements |
CN101267553A (zh) * | 2007-03-12 | 2008-09-17 | 华为技术有限公司 | 一种实现编、解码的方法和装置 |
FR2982446A1 (fr) * | 2011-11-07 | 2013-05-10 | France Telecom | Procede de codage et decodage d'images, dispositif de codage et decodage et programmes d'ordinateur correspondants |
-
2019
- 2019-02-27 CN CN201910145192.8A patent/CN109788285B/zh active Active
- 2019-03-07 US US17/422,297 patent/US11949868B2/en active Active
- 2019-03-07 WO PCT/CN2019/077278 patent/WO2020172907A1/zh active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1980395A (zh) * | 2005-11-30 | 2007-06-13 | 联合信源数字音视频技术(北京)有限公司 | 一种基于上下文的熵编码方法及解码方法 |
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 |
CN107087188A (zh) * | 2011-11-07 | 2017-08-22 | 太格文-Ii有限责任公司 | 图像解码方法及图像解码装置 |
Non-Patent Citations (1)
Title |
---|
GAO, MIN ET AL.: "Optimizations for the entropy coding module in AVS2", INTELLIGENT COMPUTER AND APPLICATIONS, vol. 7, no. 2, 28 April 2017 (2017-04-28), ISSN: 2095-2163, DOI: 20191108115753 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115643110A (zh) * | 2022-12-22 | 2023-01-24 | 河北新龙科技集团股份有限公司 | 基于运行数据的应用软件安全检测方法 |
Also Published As
Publication number | Publication date |
---|---|
US11949868B2 (en) | 2024-04-02 |
US20220078425A1 (en) | 2022-03-10 |
CN109788285B (zh) | 2020-07-28 |
CN109788285A (zh) | 2019-05-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020172907A1 (zh) | 一种量化系数结束标志位的上下文模型选取方法及装置 | |
JP2023040013A (ja) | 適応ツリー選択を使用してバイナリ・セットをビデオ符号化およびビデオ復号する方法および装置 | |
CN115514978B (zh) | 用于在视频压缩中的熵代码化的概率的混合的方法和装置 | |
JP4700491B2 (ja) | 適応係数スキャン順序付け | |
CN115379241B (zh) | 用于对最后有效系数标志进行代码化的方法和设备 | |
JP6176342B2 (ja) | 有意性マップ符号化の計算量低減 | |
JP5881747B2 (ja) | 変換係数の符号化及び復号方法及び装置 | |
US9420303B2 (en) | Method and apparatus for displacement vector component transformation in video coding and decoding | |
CN112543337B (zh) | 视频解码方法、装置、计算机可读介质及电子设备 | |
US20120134426A1 (en) | Method and apparatus for reusing tree structures to encode and decode binary sets | |
CN109788284B (zh) | 一种量化块的解码方法、装置及电子设备 | |
CN108605131B (zh) | 用于编码和解码数据的方法和设备、以及对应记录介质 | |
CN112449185B (zh) | 视频解码方法、编码方法、装置、介质及电子设备 | |
CN114449277B (zh) | 用于系数代码化的上下文推导的方法和设备 | |
CN112449201B (zh) | 解码方法、编码方法、相应的装置、电子设备及存储介质 | |
CN112449187B (zh) | 视频解码方法、编码方法、装置、介质及电子设备 | |
WO2022205312A1 (zh) | 编码系数的处理方法和装置 | |
CN115767096A (zh) | 图像压缩方法、装置、设备及介质 | |
CN110677681A (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: 19916671 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: 19916671 Country of ref document: EP Kind code of ref document: A1 |