CN116527904B - Entropy coding method, entropy decoding method and related devices - Google Patents
Entropy coding method, entropy decoding method and related devices Download PDFInfo
- Publication number
- CN116527904B CN116527904B CN202310797299.7A CN202310797299A CN116527904B CN 116527904 B CN116527904 B CN 116527904B CN 202310797299 A CN202310797299 A CN 202310797299A CN 116527904 B CN116527904 B CN 116527904B
- Authority
- CN
- China
- Prior art keywords
- data
- length code
- signed
- fixed
- unsigned
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 153
- 230000005540 biological transmission Effects 0.000 claims abstract description 65
- 238000013139 quantization Methods 0.000 claims description 46
- 238000004590 computer program Methods 0.000 claims description 12
- 238000006243 chemical reaction Methods 0.000 claims description 5
- 238000007906 compression Methods 0.000 abstract description 78
- 230000006835 compression Effects 0.000 abstract description 78
- 238000005516 engineering process Methods 0.000 abstract description 36
- 238000013473 artificial intelligence Methods 0.000 abstract description 16
- 238000012545 processing Methods 0.000 description 18
- 238000004891 communication Methods 0.000 description 10
- 230000008569 process Effects 0.000 description 9
- 238000003058 natural language processing Methods 0.000 description 8
- 238000013144 data compression Methods 0.000 description 6
- 230000014509 gene expression Effects 0.000 description 6
- 238000004422 calculation algorithm Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 5
- 238000000605 extraction Methods 0.000 description 5
- 238000012795 verification Methods 0.000 description 5
- 238000004458 analytical method Methods 0.000 description 4
- 238000010801 machine learning Methods 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000015556 catabolic process Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000000295 complement effect Effects 0.000 description 2
- 238000006731 degradation reaction Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 241000282412 Homo Species 0.000 description 1
- 241001465754 Metazoa Species 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000003139 buffering effect Effects 0.000 description 1
- 238000012669 compression test Methods 0.000 description 1
- 238000000205 computational method Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 238000007405 data analysis Methods 0.000 description 1
- 238000007418 data mining Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000009365 direct transmission Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000005065 mining Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
- 239000013598 vector Substances 0.000 description 1
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/48—Methods or arrangements for coding, decoding, compressing or decompressing digital video signals using compressed domain processing techniques other than decoding, e.g. modification of transform coefficients, variable length coding [VLC] data or run-length data
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
本申请提供了一种熵编码方法、熵解码方法及相关装置,应用于人工智能领域,包括:对只量化数据进行无符号码定长编码,得到无符号定长码;根据预测残差数据确定位指示信息和非对称值域标志位,得到传输值域,以确定编码方式;根据编码方式对预测残差数据进行编码,得到有符号定长码;对只量化数据进行编码,得到无符号变长码;对预测残差数据进行编码,得到有符号变长码;从无符号定长码、有符号定长码、无符号变长码和有符号变长码中选取比特数最少的一个,作为压缩数据。与现有技术相比,本申请在实现同等的图像压缩质量的基础上,能够降低芯片的带宽要求和功耗,而在相同的芯片带宽要求和功耗的基础上,能够提高图像压缩效率和图像压缩质量。
This application provides an entropy coding method, an entropy decoding method and related devices, which are applied in the field of artificial intelligence, including: performing unsigned fixed-length coding on quantized data to obtain an unsigned fixed-length code; determining based on prediction residual data bit indication information and asymmetric value range flag bits to obtain the transmission value range to determine the encoding method; encode the prediction residual data according to the encoding method to obtain a signed fixed-length code; encode only the quantized data to obtain an unsigned variable Long code; encode the prediction residual data to obtain a signed variable length code; select the one with the smallest number of bits from the unsigned fixed length code, signed fixed length code, unsigned variable length code and signed variable length code, as compressed data. Compared with the existing technology, this application can reduce the bandwidth requirements and power consumption of the chip on the basis of achieving the same image compression quality, and can improve the image compression efficiency and power consumption on the basis of the same chip bandwidth requirements and power consumption. Image compression quality.
Description
技术领域Technical field
本申请涉及人工智能技术领域,尤其涉及一种熵编码方法、熵解码方法及相关装置。The present application relates to the field of artificial intelligence technology, and in particular to an entropy coding method, an entropy decoding method and related devices.
背景技术Background technique
图像压缩通常分别参考帧压缩和视频接口压缩,参考帧压缩属于浅压缩技术的一种,能够对存储在帧存储器中的数据进行压缩,以减少外部带宽和功耗。在目标码率有上界的视频压缩中,参考帧越多,预测的精确度越高,图像的质量越好,然而芯片主频一般在400兆赫兹上下,在处理部分图像数据时,只使用一个参考帧都已经超过存储器处理能力的上界,且在实际应用中,一般只能规划存储器工作期70%的有效带宽下,视频压缩的质量就更差。因此,目前图像压缩对芯片的带宽和功耗要求高,增加了芯片的复杂度,从而降低了图像的压缩效率,降低了图像的压缩质量。Image compression usually refers to frame compression and video interface compression respectively. Reference frame compression is a type of shallow compression technology that can compress data stored in frame memory to reduce external bandwidth and power consumption. In video compression with an upper bound on the target bit rate, the more reference frames, the higher the prediction accuracy and the better the image quality. However, the main frequency of the chip is generally around 400 MHz. When processing some image data, only A reference frame has exceeded the upper bound of memory processing capabilities, and in practical applications, generally only 70% of the effective bandwidth of the memory working period can be planned, and the quality of video compression is even worse. Therefore, current image compression has high requirements on the bandwidth and power consumption of the chip, which increases the complexity of the chip, thereby reducing the image compression efficiency and reducing the image compression quality.
发明内容Contents of the invention
本申请实施例的主要目的在于提出一种熵编码方法、熵解码方法及相关装置,旨在提高图像压缩的效率和质量。The main purpose of the embodiments of this application is to propose an entropy coding method, an entropy decoding method and related devices, aiming to improve the efficiency and quality of image compression.
为实现上述目的,本申请实施例的第一方面提出了一种熵编码方法,所述熵编码方法包括:In order to achieve the above object, the first aspect of the embodiment of the present application proposes an entropy coding method. The entropy coding method includes:
获取原始图像中帧图像数据的只量化数据和预测残差数据;Obtain only the quantized data and prediction residual data of the frame image data in the original image;
对所述只量化数据进行无符号定长编码,得到无符号定长码;Perform unsigned fixed-length encoding on the quantized-only data to obtain an unsigned fixed-length code;
根据所述预测残差数据确定位指示信息和非对称值域标志位;Determine bit indication information and asymmetric range flag bits according to the prediction residual data;
根据所述位指示信息和所述非对称值域标志位,得到有符号定长编码的传输值域,以确定有符号定长编码的编码方式,所述非对称值域标志位在同一所述位指示信息下对应的两个所述传输值域的开闭情况相反;According to the bit indication information and the asymmetric value field flag bit, the transmission value field of the signed fixed-length encoding is obtained to determine the encoding mode of the signed fixed-length encoding. The asymmetric value field flag bit is in the same The opening and closing conditions of the two corresponding transmission value fields under the bit indication information are opposite;
根据所述编码方式对所述预测残差数据进行有符号定长编码,得到有符号定长码;Perform signed fixed-length coding on the prediction residual data according to the coding method to obtain a signed fixed-length code;
对所述只量化数据进行无符号变长编码,得到无符号变长码;Perform unsigned variable length coding on the quantized-only data to obtain an unsigned variable length code;
对所述预测残差数据进行有符号变长编码,得到有符号变长码;Perform signed variable length coding on the prediction residual data to obtain a signed variable length code;
从所述无符号定长码、所述有符号定长码、所述无符号变长码和所述有符号变长码中选取比特数最少的一个,作为所述帧图像数据的压缩数据。The one with the smallest number of bits is selected from the unsigned fixed-length code, the signed fixed-length code, the unsigned variable-length code and the signed variable-length code as the compressed data of the frame image data.
在一些实施例,所述根据所述预测残差数据确定位指示信息和非对称值域标志位,包括:In some embodiments, determining bit indication information and asymmetric range flags based on the prediction residual data includes:
根据所述预测残差数据,确定所述预测残差数据的绝对值最大数据;According to the prediction residual data, determine the maximum absolute value data of the prediction residual data;
根据所述绝对值最大数据以及对应的所述预测残差数据的符号,确定所述位指示信息和非对称值域标志位。The bit indication information and the asymmetric value range flag are determined according to the absolute maximum data and the corresponding sign of the prediction residual data.
在一些实施例,所述根据所述位指示信息和所述非对称值域标志位,得到有符号定长编码的传输值域,包括:In some embodiments, obtaining a signed fixed-length encoded transmission value domain based on the bit indication information and the asymmetric value domain flag bit includes:
当所述位指示信息大于0时,根据所述位指示信息,确定边界信息;When the bit indication information is greater than 0, determine the boundary information according to the bit indication information;
当所述非对称值域标志位为1时,将所述边界信息的负数端设置为开区间、所述边界信息的正数端设置为闭区间,得到所述有符号定长码的传输值域;When the asymmetric value range flag is 1, set the negative end of the boundary information to an open interval and the positive end of the boundary information to a closed interval to obtain the transmission value of the signed fixed-length code area;
当所述非对称值域标志位为0时,将所述边界信息的负数端设置为闭区间、所述边界信息的正数端设置为开区间,得到所述有符号定长码的传输值域。When the asymmetric value domain flag bit is 0, the negative end of the boundary information is set as a closed interval and the positive end of the boundary information is set as an open interval to obtain the transmission value of the signed fixed-length code area.
在一些实施例,所述根据所述位指示信息,确定边界信息,包括:In some embodiments, determining boundary information based on the bit indication information includes:
将所述位指示信息减1,得到相减结果;Subtract 1 from the bit indication information to obtain the subtraction result;
将第一预设数值作为底数、所述相减结果作为指数进行幂运算,得到正边界;The first preset value is used as the base and the subtraction result is used as the exponent for exponentiation to obtain a positive boundary;
计算所述正边界对应数值的相反数,得到负边界;Calculate the opposite number of the corresponding value of the positive boundary to obtain the negative boundary;
根据所述正边界和所述负边界,确定边界信息。Boundary information is determined based on the positive boundary and the negative boundary.
在一些实施例,所述对所述预测残差数据进行有符号变长编码,得到有符号变长码,包括:In some embodiments, performing signed variable length coding on the prediction residual data to obtain a signed variable length code includes:
当所述预测残差数据大于0或小于0时,根据所述预测残差数据,确定符号位;When the prediction residual data is greater than 0 or less than 0, determine the sign bit according to the prediction residual data;
对所述预测残差数据的绝对值进行无符号变长编码,得到第一编码;Perform unsigned variable-length coding on the absolute value of the prediction residual data to obtain a first coding;
根据所述第一编码和所述符号位,得到有符号变长码。According to the first code and the sign bit, a signed variable length code is obtained.
在一些实施例,所述对所述预测残差数据的绝对值进行无符号变长编码,得到第一编码,包括:In some embodiments, performing unsigned variable length coding on the absolute value of the prediction residual data to obtain the first coding includes:
将所述预测残差数据的绝对值与第二预设数值相加;Add the absolute value of the prediction residual data to the second preset value;
对相加的结果进行二进制转换,得到第二编码;Perform binary conversion on the addition result to obtain the second code;
根据所述第二编码的比特数,确定编码前缀;Determine a coding prefix according to the number of bits of the second code;
根据所述编码前缀和所述第二编码,得到第一编码。According to the encoding prefix and the second encoding, a first encoding is obtained.
在一些实施例,所述对所述预测残差数据进行有符号变长编码,得到有符号变长码,还包括:In some embodiments, performing signed variable length coding on the prediction residual data to obtain a signed variable length code further includes:
当所述预测残差数据等于0时,对所述预测残差数据进行无符号变长编码,得到有符号变长码。When the prediction residual data is equal to 0, unsigned variable length coding is performed on the prediction residual data to obtain a signed variable length code.
在一些实施例,所述获取原始图像中帧图像数据的只量化数据和预测残差数据,包括:In some embodiments, obtaining only the quantized data and prediction residual data of the frame image data in the original image includes:
获取原始图像中的帧图像数据;Get the frame image data in the original image;
根据预设的量化参数对所述帧图像数据进行量化,得到只量化数据;Quantize the frame image data according to preset quantization parameters to obtain only quantized data;
对所述只量化数据进行像素预测,得到预测残差数据。Perform pixel prediction on the quantized-only data to obtain prediction residual data.
在一些实施例,在从所述无符号定长码、所述有符号定长码、所述无符号变长码和所述有符号变长码中选取比特数最少的一个,作为所述帧图像数据的压缩数据之后,所述熵编码方法还包括:In some embodiments, the one with the smallest number of bits is selected from the unsigned fixed-length code, the signed fixed-length code, the unsigned variable-length code, and the signed variable-length code as the frame. After compressing the image data, the entropy encoding method also includes:
将所述压缩数据输入至视频缓存检验器进行检验;Input the compressed data to a video cache checker for verification;
当所述视频缓存检验器处于上溢出状态时,对所述量化参数进行增加调整,并将调整后的所述量化参数作为预设的量化参数;When the video cache checker is in an overflow state, increase and adjust the quantization parameter, and use the adjusted quantization parameter as a preset quantization parameter;
根据所述量化参数,重复获取所述帧图像数据对应的压缩数据,直至所述视频缓存检验器处于非上溢出状态;According to the quantization parameter, repeatedly obtain the compressed data corresponding to the frame image data until the video buffer checker is in a non-overflow state;
输出所述视频缓存检验器处于非上溢出状态时对应的所述压缩数据。Output the compressed data corresponding to when the video cache checker is in a non-overflow state.
为实现上述目的,本申请实施例的第二方面提出了一种熵解码方法,所述熵解码方法包括:In order to achieve the above purpose, the second aspect of the embodiment of the present application proposes an entropy decoding method. The entropy decoding method includes:
获取压缩数据,所述压缩数据根据上述第一方面所述的熵编码方法生成;Obtain compressed data, the compressed data being generated according to the entropy coding method described in the first aspect;
根据所述压缩数据,确定编码类型,所述编码类型包括无符号定长编码、有符号定长编码、无符号变长编码和有符号变长编码;Determine a coding type according to the compressed data, and the coding type includes unsigned fixed-length coding, signed fixed-length coding, unsigned variable-length coding, and signed variable-length coding;
根据所述编码类型对所述压缩数据进行解码,得到解码数据;Decode the compressed data according to the encoding type to obtain decoded data;
根据所述解码数据,确定帧图像数据。Based on the decoded data, frame image data is determined.
在一些实施例,所述根据所述解码数据,确定帧图像数据包括:In some embodiments, determining frame image data according to the decoded data includes:
当所述解码数据为预测残差数据时,确定所述解码数据的预测方式和量化参数;When the decoded data is prediction residual data, determine the prediction method and quantization parameters of the decoded data;
根据所述预测方式对所述解码数据进行反预测,得到只量化数据;Perform reverse prediction on the decoded data according to the prediction method to obtain only quantized data;
根据所述量化参数对所述只量化数据进行反量化,得到帧图像数据。The quantized-only data is inversely quantized according to the quantization parameter to obtain frame image data.
为实现上述目的,本申请实施例的第四方面提出了一种熵编码装置,包括:In order to achieve the above object, the fourth aspect of the embodiment of the present application proposes an entropy coding device, including:
获取单元,用于获取原始图像中帧图像数据的只量化数据和预测残差数据;An acquisition unit used to acquire only quantized data and prediction residual data of the frame image data in the original image;
第一编码单元,用于对所述只量化数据进行无符号定长编码,得到无符号定长码;The first coding unit is used to perform unsigned fixed-length coding on the quantized-only data to obtain an unsigned fixed-length code;
信息确定单元,用于根据所述预测残差数据确定位指示信息和非对称值域标志位;An information determination unit, configured to determine bit indication information and asymmetric value range flags based on the prediction residual data;
值域确定单元,用于根据所述位指示信息和所述非对称值域标志位,得到有符号定长编码的传输值域,以确定有符号定长编码的编码方式,所述非对称值域标志位在同一所述位指示信息下对应的两个所述传输值域的开闭情况相反第二编码单元,用于根据所述编码方式对所述预测残差数据进行有符号定长编码,得到有符号定长码;A value domain determination unit, configured to obtain the transmission value domain of the signed fixed-length encoding according to the bit indication information and the asymmetric value domain flag bit, so as to determine the encoding method of the signed fixed-length encoding, the asymmetric value The opening and closing conditions of the two transmission value fields corresponding to the field flag bit under the same bit indication information are opposite. The second coding unit is used to perform signed fixed-length coding on the prediction residual data according to the coding method. , get the signed fixed-length code;
第三编码单元,用于对所述只量化数据进行无符号变长编码,得到无符号变长码;The third coding unit is used to perform unsigned variable length coding on the quantized-only data to obtain an unsigned variable length code;
第四编码单元,用于对所述预测残差数据进行有符号变长编码,得到有符号变长码;The fourth coding unit is used to perform signed variable length coding on the prediction residual data to obtain a signed variable length code;
比较单元,用于从所述无符号定长码、所述有符号定长码、所述无符号变长码和所述有符号变长码中选取比特数最少的一个,作为所述帧图像数据的压缩数据。A comparison unit configured to select the one with the smallest number of bits from the unsigned fixed-length code, the signed fixed-length code, the unsigned variable-length code, and the signed variable-length code as the frame image. Compressed data of data.
为实现上述目的,本申请实施例的第四方面提出了一种电子设备,所述电子设备包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现上述第一方面所述的熵编码方法或上述第二方面所述的熵解码方法。In order to achieve the above object, a fourth aspect of the embodiment of the present application proposes an electronic device. The electronic device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the above is implemented. The entropy coding method described in the first aspect or the entropy decoding method described in the above second aspect.
为实现上述目的,本申请实施例的第五方面提出了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面所述的熵编码方法或上述第二方面所述的熵解码方法。In order to achieve the above object, the fifth aspect of the embodiment of the present application proposes a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the above-mentioned first aspect is implemented. The entropy coding method described above or the entropy decoding method described in the second aspect above.
本申请提出的熵编码方法、熵解码方法及相关装置,其对只量化数据分别进行编码,得到无符号定长码和无符号变长码,并对预测残差数据进行编码,得到有符号定长码和有符号变长码,融合了变长编码和定长编码,并从中选取压缩效率最优的编码方式,即比特数最少的编码结果对应的编码方式,对应的编码结果作为压缩数据,另外,本申请根据非对称值域标志位确定有符号定长编码的传输值域,且不同非对称值域标志位在同一位指示信息下对应的两个传输值域的开闭情况相反,能够提高有符号定长码的信息密度,提高了编码效率,与现有技术相比,在实现同等的图像压缩质量的基础上,本申请能够有效地降低芯片的带宽要求和功耗,而在相同的芯片带宽要求和功耗的基础上,本申请能够提高图像的压缩效率,提高了图像的压缩质量。The entropy coding method, entropy decoding method and related devices proposed in this application separately encode the quantized data to obtain unsigned fixed-length codes and unsigned variable-length codes, and encode the prediction residual data to obtain signed fixed-length codes. Long codes and signed variable length codes combine variable length coding and fixed length coding, and select the coding method with the best compression efficiency, that is, the coding method corresponding to the coding result with the smallest number of bits, and the corresponding coding result is used as compressed data. In addition, this application determines the transmission value domain of signed fixed-length coding based on the asymmetric value domain flag bit, and the opening and closing conditions of the two transmission value domains corresponding to different asymmetric value domain flag bits under the same indication information are opposite, and it can It improves the information density of signed fixed-length codes and improves coding efficiency. Compared with the existing technology, on the basis of achieving the same image compression quality, this application can effectively reduce the bandwidth requirements and power consumption of the chip, while maintaining the same Based on the chip bandwidth requirements and power consumption, this application can improve the image compression efficiency and improve the image compression quality.
附图说明Description of drawings
图1是本申请实施例提供的熵编码方法的流程图;Figure 1 is a flow chart of an entropy coding method provided by an embodiment of the present application;
图2是本申请实施例提供的熵编码方法的信息确定的流程图;Figure 2 is a flow chart of information determination of the entropy coding method provided by the embodiment of the present application;
图3是本申请实施例提供的熵编码方法的确定传输值域的流程图;Figure 3 is a flow chart for determining the transmission value range of the entropy coding method provided by the embodiment of the present application;
图4是本申请实施例提供的熵编码方法的计算边界信息的流程图;Figure 4 is a flow chart for calculating boundary information of the entropy coding method provided by the embodiment of the present application;
图5是本申请实施例提供的熵编码方法的有符号变长码编码的流程图;Figure 5 is a flow chart of signed variable length code coding of the entropy coding method provided by the embodiment of the present application;
图6是本申请实施例提供的熵编码方法的确定第一编码的流程图;Figure 6 is a flow chart for determining the first encoding of the entropy encoding method provided by the embodiment of the present application;
图7是本申请实施例提供的熵编码方法的有符号变长码编码的另一流程图;Figure 7 is another flow chart of signed variable length code coding of the entropy coding method provided by the embodiment of the present application;
图8是本申请实施例提供的熵编码方法的计算只量化数据和预测参数的另一流程图;Figure 8 is another flowchart of calculating only quantized data and prediction parameters in the entropy coding method provided by the embodiment of the present application;
图9是本申请实施例提供的熵编码方法的检验的流程图;Figure 9 is a flow chart of the verification of the entropy coding method provided by the embodiment of the present application;
图10是本申请实施例提供的熵解码方法的主要流程图;Figure 10 is a main flow chart of the entropy decoding method provided by the embodiment of the present application;
图11是本申请实施例提供的熵解码方法的确定帧图像数据的流程图;Figure 11 is a flow chart for determining frame image data in the entropy decoding method provided by the embodiment of the present application;
图12是本申请实施例提供的熵编码方法的示意图;Figure 12 is a schematic diagram of the entropy coding method provided by the embodiment of the present application;
图13是本申请实施例提供的熵解码方法的示意图;Figure 13 is a schematic diagram of the entropy decoding method provided by the embodiment of the present application;
图14是是本申请实施例提供的熵编码装置的结构示意图;Figure 14 is a schematic structural diagram of an entropy coding device provided by an embodiment of the present application;
图15是本申请实施例提供的电子设备的硬件结构示意图。Figure 15 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clear, the present application will be further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application and are not used to limit the present application.
需要说明的是,虽然在装置示意图中进行了功能模块划分,在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于装置中的模块划分,或流程图中的顺序执行所示出或描述的步骤。说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be noted that although the functional modules are divided in the device schematic diagram and the logical sequence is shown in the flow chart, in some cases, the modules can be divided into different modules in the device or the order in the flow chart can be executed. The steps shown or described. The terms "first", "second", etc. in the description, claims, and above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific sequence or sequence.
除非另有定义,本文所使用的所有的技术和科学术语与属于本申请的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本申请实施例的目的,不是旨在限制本申请。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
首先,对本申请中涉及的若干名词进行解析:First, let’s analyze some terms involved in this application:
人工智能(artificial intelligence,AI):是研究、开发用于模拟、延伸和扩展人的智能的理论、方法、技术及应用系统的一门新的技术科学;人工智能是计算机科学的一个分支,人工智能企图了解智能的实质,并生产出一种新的能以人类智能相似的方式做出反应的智能机器,该领域的研究包括机器人、语言识别、图像识别、自然语言处理和专家系统等。人工智能可以对人的意识、思维的信息过程的模拟。人工智能还是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。Artificial intelligence (AI): It is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence; artificial intelligence is a branch of computer science, artificial intelligence Intelligence attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a manner similar to human intelligence. Research in this field includes robotics, language recognition, image recognition, natural language processing, and expert systems. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
机器学习,是一种数据分析技术,让计算机执行人和动物与生俱来的活动:从经验中学习。机器学习算法使用计算方法直接从数据中“学习”信息,而不依赖于预定方程模型。当可用于学习的样本数量增加时,这些算法可自适应提高性能。它是人工智能核心,是使计算机具有智能的根本途径。Machine learning is a data analysis technique that allows computers to do what humans and animals are born with: learning from experience. Machine learning algorithms use computational methods to "learn" information directly from data without relying on predetermined equation models. These algorithms can adaptively improve performance as the number of samples available for learning increases. It is the core of artificial intelligence and the fundamental way to make computers intelligent.
自然语言处理(natural language processing,NLP): NLP用计算机来处理、理解以及运用人类语言(如中文、英文等),NLP属于人工智能的一个分支,是计算机科学与语言学的交叉学科,又常被称为计算语言学。自然语言处理包括语法分析、语义分析、篇章理解等。自然语言处理常用于机器翻译、手写体和印刷体字符识别、语音识别及文语转换、信息意图识别、信息抽取与过滤、文本分类与聚类和观点挖掘等技术领域,它涉及与语言处理相关的数据挖掘、机器学习、知识获取、知识工程、人工智能研究和与语言计算相关的语言学研究等。Natural language processing (NLP): NLP uses computers to process, understand and use human languages (such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject of computer science and linguistics. It's called computational linguistics. Natural language processing includes syntax analysis, semantic analysis, text understanding, etc. Natural language processing is often used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, and opinion mining. It involves language processing-related Data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research and linguistic research related to language computing, etc.
信息抽取(Information Extraction):从自然语言文本中抽取指定类型的实体、关系、事件等事实信息,并形成结构化数据输出的文本处理技术。信息抽取是从文本数据中抽取特定信息的一种技术。文本数据是由一些具体的单位构成的,例如句子、段落、篇章,文本信息正是由一些小的具体的单位构成的,例如字、词、词组、句子、段落或是这些具体的单位的组合。抽取文本数据中的名词短语、人名、地名等都是文本信息抽取,当然,文本信息抽取技术所抽取的信息可以是各种类型的信息。Information Extraction: Text processing technology that extracts specified types of factual information such as entities, relationships, events, etc. from natural language text and forms structured data output. Information extraction is a technique for extracting specific information from text data. Text data is composed of some specific units, such as sentences, paragraphs, and chapters. Text information is composed of some small specific units, such as words, words, phrases, sentences, paragraphs, or a combination of these specific units. . Extracting noun phrases, person names, place names, etc. from text data is text information extraction. Of course, the information extracted by text information extraction technology can be various types of information.
视频压缩,又称为视频编码,是指通过压缩技术,将原始视频格式的文件转换成另一种视频格式文件的方式。视频图像数据有很强的相关性,也就是说有大量的冗余信息。其中冗余信息可分为空域冗余信息和时域冗余信息。视频压缩家属就是将数据中的冗余信息去掉(去除数据之间的相关性),压缩技术包含帧内图像数据压缩技术、帧间图像数据压缩技术和熵编码压缩技术。Video compression, also known as video encoding, refers to the method of converting original video format files into another video format file through compression technology. Video image data has strong correlation, which means there is a lot of redundant information. The redundant information can be divided into air domain redundant information and time domain redundant information. The video compression family is to remove redundant information in the data (removing the correlation between data). Compression technology includes intra-frame image data compression technology, inter-frame image data compression technology and entropy coding compression technology.
浅压缩,又称夹层压缩,是一种视频压缩级别,可以有效降低视频带宽,并能保持视频整体质量,压缩比通常为2:1到8:1。Shallow compression, also known as mezzanine compression, is a video compression level that can effectively reduce video bandwidth while maintaining the overall video quality. The compression ratio is usually 2:1 to 8:1.
参考帧压缩,是视频压缩技术中的一种,属于浅压缩技术。参考帧压缩是一种减少视频编码器访存带宽的有效方案,不仅可以减小读参考帧像素的带宽,还能减少编码器向外存写入重建帧像素的带宽,参考帧压缩为图像压缩比,即压缩前所占空间与实际所占空间的比值,在2至3倍附近的接近透明质量的压缩技术。Reference frame compression is one of the video compression technologies and is a shallow compression technology. Reference frame compression is an effective solution to reduce the memory access bandwidth of the video encoder. It can not only reduce the bandwidth of reading reference frame pixels, but also reduce the bandwidth of the encoder writing reconstructed frame pixels to external memory. Reference frame compression is image compression. Ratio, that is, the ratio of the space occupied before compression to the actual space occupied, is a compression technology that is close to transparent quality in the vicinity of 2 to 3 times.
熵编码,即编码过程中按熵原理不丢失任何信息的编码。根据信息论的原理,可以找到最佳数据压缩编码的方法,数据压缩的理论极限是信息熵。如果要求编码过程中不丢失信息量,即要求保存信息熵,这种信息保持编码叫熵编码,是根据消息出现概率的分布特性而进行的,是无损数据压缩编码。常见的熵编码有:香农(Shannon)编码、哈夫曼(Huffman)编码和算术编码(arithmetic coding)。在视频编码中,熵编码把一系列用来表示视频序列的元素符号转变为一个用来传输或是存储的压缩码流。输入的符号可能包括量化后的变换系数,运动向量,头信息(宏块头,图像头,序列的头等)以及附加信息(对于正确解码来说重要的标记位信息)。Entropy coding refers to coding that does not lose any information according to the entropy principle during the coding process. According to the principles of information theory, the optimal data compression encoding method can be found. The theoretical limit of data compression is information entropy. If the amount of information is not lost during the encoding process, that is, information entropy is required to be preserved. This information-preserving encoding is called entropy encoding. It is performed based on the distribution characteristics of the message appearance probability and is a lossless data compression encoding. Common entropy codes include: Shannon coding, Huffman coding and arithmetic coding. In video coding, entropy coding converts a series of element symbols used to represent a video sequence into a compressed code stream for transmission or storage. The input symbols may include quantized transform coefficients, motion vectors, header information (macroblock headers, image headers, sequence headers, etc.) and additional information (mark bit information important for correct decoding).
熵解码与熵编码的过程一一对应,熵解码可分为四部分:“判断语法元素”、“算术解码”、“更新上下文”和“反二值化”。“判断语法元素”部分按照标准中严格定义的编码顺序同步进行分析,得到当前需要解码出哪一种语法元素。“算术解码”部分先根据判断语法元素给出的上下文模型种类查表得到上下文模型,根据上下文模型里的数据解码引擎解析出当前解码区间范围和偏移量,进一步得到解码出的具体二进制字符。“更新上下文”根据解码的二进制字符,上下文模型进行自适应更新以备下一次解码使用。“反二值化”模块将二进制字符还原为语法元素的真实值,至此一个语法元素解析完成。此语法元素会送回“判断语法元素”模块决定下一个语法元素的种类以及上下文模型的类型。The processes of entropy decoding and entropy coding correspond one to one. Entropy decoding can be divided into four parts: "judging syntax elements", "arithmetic decoding", "updating context" and "anti-binarization". The "Judging Grammar Elements" part performs simultaneous analysis according to the coding order strictly defined in the standard to obtain which grammar element currently needs to be decoded. The "arithmetic decoding" part first obtains the context model by looking up the table according to the context model type given by the judgment syntax element, and parses the current decoding interval range and offset according to the data decoding engine in the context model, and further obtains the specific decoded binary characters. "Update context" According to the decoded binary characters, the context model is adaptively updated for the next decoding. The "anti-binarization" module restores the binary characters to the real values of the syntax elements, and the parsing of one syntax element is completed. This grammar element will be sent back to the "Judge Grammar Element" module to determine the type of next grammar element and the type of context model.
图像压缩通常分别参考帧压缩和视频接口压缩,参考帧压缩属于浅压缩技术的一种,能够对存储在帧存储器中的数据进行压缩,以减少外部带宽和功耗。在目标码率有上界的视频压缩中,参考帧越多,预测的精确度越高,图像的质量越好,然而芯片主频一般在400兆赫兹上下,在处理部分图像数据时,只使用一个参考帧都已经超过存储器处理能力的上界,且在实际应用中,一般只能规划存储器工作期70%的有效带宽下,视频压缩的质量就更差。因此,目前图像压缩对芯片的带宽和功耗要求高,增加了芯片的复杂度,从而降低了图像的压缩效率,降低了图像的压缩质量。Image compression usually refers to frame compression and video interface compression respectively. Reference frame compression is a type of shallow compression technology that can compress data stored in frame memory to reduce external bandwidth and power consumption. In video compression with an upper bound on the target bit rate, the more reference frames, the higher the prediction accuracy and the better the image quality. However, the main frequency of the chip is generally around 400 MHz. When processing some image data, only A reference frame has exceeded the upper bound of memory processing capabilities, and in practical applications, generally only 70% of the effective bandwidth of the memory working period can be planned, and the quality of video compression is even worse. Therefore, current image compression has high requirements on the bandwidth and power consumption of the chip, which increases the complexity of the chip, thereby reducing the image compression efficiency and reducing the image compression quality.
基于此,本申请提供一种熵编码方法、熵解码方法及相关装置,本申请实施例提供的熵编码方法融合了变长编码和定长编码,并从中选取压缩效率最优的编码方式对应的编码结果作为压缩数据,另外,本申请根据非对称值域标志位确定有符号定长编码的传输值域,能够提高有符号定长码的信息密度,提高了编码效率,与现有技术相比,在实现同等的图像压缩质量的基础上,本申请能够有效地降低芯片的带宽要求和功耗,而在相同的芯片带宽要求和功耗的基础上,本申请能够提高图像的压缩效率,提高了图像的压缩质量。Based on this, the present application provides an entropy coding method, an entropy decoding method and related devices. The entropy coding method provided by the embodiment of the present application combines variable length coding and fixed length coding, and selects the coding method with the optimal compression efficiency from them. The encoding result is used as compressed data. In addition, this application determines the transmission value range of the signed fixed-length code based on the asymmetric value range flag bit, which can improve the information density of the signed fixed-length code and improve the coding efficiency. Compared with the existing technology , on the basis of achieving the same image compression quality, this application can effectively reduce the bandwidth requirements and power consumption of the chip, and on the basis of the same chip bandwidth requirements and power consumption, this application can improve the image compression efficiency and improve improves the image compression quality.
本申请实施例提供的熵编码方法、熵解码方法及相关装置,具体通过如下实施例进行说明,首先描述本申请实施例中的熵编码方法。The entropy coding method, entropy decoding method and related devices provided by the embodiments of the present application are specifically described through the following embodiments. First, the entropy coding method in the embodiment of the present application is described.
本申请实施例可以基于人工智能技术对相关的数据进行获取和处理。其中,人工智能(Artificial Intelligence,AI)是利用数字计算机或者数字计算机控制的机器模拟、延伸和扩展人的智能,感知环境、获取知识并使用知识获得最佳结果的理论、方法、技术及应用系统。The embodiments of this application can obtain and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or digital computer-controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. .
人工智能基础技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理技术、操作/交互系统、机电一体化等技术。人工智能软件技术主要包括计算机视觉技术、机器人技术、生物识别技术、语音处理技术、自然语言处理技术以及机器学习/深度学习等几大方向。Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation/interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, robotics technology, biometric technology, speech processing technology, natural language processing technology, and machine learning/deep learning.
本申请实施例提供的熵编码方法,涉及人工智能技术领域。本申请实施例提供的熵编码方法可应用于终端中,也可应用于服务器端中,还可以是运行于终端或服务器端中的软件。在一些实施例中,终端可以是智能手机、平板电脑、笔记本电脑、台式计算机等;服务器端可以配置成独立的物理服务器,也可以配置成多个物理服务器构成的服务器集群或者分布式系统,还可以配置成提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、CDN以及大数据和人工智能平台等基础云计算服务的云服务器;软件可以是实现熵编码方法的应用等,但并不局限于以上形式。The entropy coding method provided by the embodiment of the present application relates to the field of artificial intelligence technology. The entropy coding method provided by the embodiments of the present application can be applied in the terminal or the server, or can be software running in the terminal or the server. In some embodiments, the terminal can be a smartphone, a tablet, a laptop, a desktop computer, etc.; the server can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers. A cloud that can be configured to provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Server; the software can implement the application of entropy coding method, etc., but is not limited to the above form.
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。The application may be used in a variety of general or special purpose computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, including Distributed computing environment for any of the above systems or devices, etc. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including storage devices.
需要说明的是,在本申请的各个具体实施方式中,当涉及到需要根据用户信息、用户行为数据,用户历史数据以及用户位置信息等与用户身份或特性相关的数据进行相关处理时,都会先获得用户的许可或者同意,而且,对这些数据的收集、使用和处理等,都会遵守相关法律法规和标准。此外,当本申请实施例需要获取用户的敏感个人信息时,会通过弹窗或者跳转到确认页面等方式获得用户的单独许可或者单独同意,在明确获得用户的单独许可或者单独同意之后,再获取用于使本申请实施例能够正常运行的必要的用户相关数据。It should be noted that in each specific implementation of the present application, when it comes to relevant processing based on user information, user behavior data, user historical data, user location information and other data related to user identity or characteristics, the first step is to perform relevant processing. Obtain the user's permission or consent, and the collection, use and processing of this data will comply with relevant laws, regulations and standards. In addition, when the embodiment of this application needs to obtain the user's sensitive personal information, it will obtain the user's separate permission or separate consent through a pop-up window or jump to a confirmation page. After clearly obtaining the user's separate permission or separate consent, it will then Obtain necessary user-related data for normal operation of the embodiment of the present application.
参照图1,图1是本申请实施例提供的熵编码方法的流程图。本申请实施例提供的熵编码方法包括但不限于以下步骤:Referring to Figure 1, Figure 1 is a flow chart of an entropy coding method provided by an embodiment of the present application. The entropy coding method provided by the embodiment of this application includes but is not limited to the following steps:
步骤S100、获取原始图像中帧图像数据的只量化数据和预测残差数据。Step S100: Obtain only quantized data and prediction residual data of the frame image data in the original image.
步骤S200、对只量化数据进行无符号定长编码,得到无符号定长码。Step S200: Perform unsigned fixed-length coding on the quantized data to obtain an unsigned fixed-length code.
步骤S300、根据预测残差数据确定位指示信息和非对称值域标志位。Step S300: Determine the bit indication information and the asymmetric range flag bit according to the prediction residual data.
步骤S400、根据位指示信息和非对称值域标志位,得到有符号定长编码的传输值域,以确定有符号定长编码的编码方式,非对称值域标志位在同一位指示信息下对应的两个传输值域的开闭情况相反。Step S400: According to the bit indication information and the asymmetric value domain flag bit, obtain the transmission value domain of the signed fixed-length encoding to determine the encoding method of the signed fixed-length encoding. The asymmetric value domain flag bit corresponds to the same bit indication information. The opening and closing conditions of the two transmission value fields are opposite.
步骤S500、根据有符号定长编码的编码方式对预测残差数据进行有符号定长编码,得到有符号定长码。Step S500: Perform signed fixed-length coding on the prediction residual data according to the coding method of signed fixed-length coding to obtain a signed fixed-length code.
步骤S600、对只量化数据进行无符号变长编码,得到无符号变长码。Step S600: Perform unsigned variable length coding on the quantized data to obtain an unsigned variable length code.
步骤S700、对预测残差数据进行有符号变长编码,得到有符号变长码。Step S700: Perform signed variable length coding on the prediction residual data to obtain a signed variable length code.
步骤S800、从无符号定长码、有符号定长码、无符号变长码和有符号变长码中选取比特数最少的一个,作为帧图像数据的压缩数据。Step S800: Select the one with the smallest number of bits from the unsigned fixed-length code, the signed fixed-length code, the unsigned variable-length code, and the signed variable-length code as the compressed data of the frame image data.
需要说明的是,本申请实施例提供的熵编码方法对只量化数据分别进行编码,得到无符号定长码和无符号变长码,并对预测残差数据进行编码,得到有符号定长码和有符号变长码,融合了变长编码和定长编码,并从中选取压缩效率最优的编码方式,即占用码位最小的编码结果对应的编码方式,对应的编码结果作为压缩数据,另外,本申请根据非对称值域标志位确定有符号定长编码的传输值域,不同非对称值域标志位在同一位指示信息下对应的两个传输值域的开闭情况相反,能够提高有符号定长码的信息密度,提高了编码效率,与现有技术相比,在实现同等的图像压缩质量的基础上,本申请能够有效地降低芯片的带宽要求和功耗,而在相同的芯片带宽要求和功耗的基础上,本申请能够提高图像的压缩效率,提高了图像的压缩质量。It should be noted that the entropy coding method provided by the embodiment of the present application separately codes the quantized data to obtain an unsigned fixed-length code and an unsigned variable-length code, and codes the prediction residual data to obtain a signed fixed-length code. and signed variable-length code, which combines variable-length coding and fixed-length coding, and selects the coding method with the best compression efficiency, that is, the coding method corresponding to the coding result that occupies the smallest code bits, and the corresponding coding result is used as compressed data. In addition , this application determines the transmission value domain of signed fixed-length coding based on the asymmetric value domain flag bit. The opening and closing conditions of the two transmission value domains corresponding to different asymmetric value domain flag bits under the same indication information are opposite, which can improve the efficiency of the code. The information density of the symbol fixed-length code improves the coding efficiency. Compared with the existing technology, on the basis of achieving the same image compression quality, this application can effectively reduce the bandwidth requirements and power consumption of the chip, while using the same chip On the basis of bandwidth requirements and power consumption, this application can improve image compression efficiency and improve image compression quality.
需要说明的是,熵编码是一种进行无损数据压缩的技术,其是图像压缩方法中的一种常见方法。It should be noted that entropy coding is a technology for lossless data compression, which is a common method among image compression methods.
在一些实施例的步骤S100中,只量化数据和预测残差数据分别与帧图像数据一一对应,只量化数据由帧图像数据经量化生成,其为无符号数据,而预测残差数据为只量化数据经像素预测所得,其为有符号数。In step S100 of some embodiments, the quantized-only data and the prediction residual data correspond to the frame image data one-to-one respectively. The quantized-only data is generated by quantization of the frame image data and is unsigned data, while the prediction residual data is only Quantized data is predicted by pixels and is a signed number.
在一些实施例的步骤S200中,无符号定长码的长度固定,且其长度,即无符号定长码对应的位指示信息由只量化数据的数值最大值决定,该最大值对应的二进制编码中的最高有效比特位为1,更高的比特位皆为0,从该最大值的最低有效位开始到最高有效位为1的位为止的总比特位数即为无符号定长码的比特位长度。无符号定长码的长度固定,无论只量化数据对应的数值再小,其长度始终固定。In step S200 of some embodiments, the length of the unsigned fixed-length code is fixed, and its length, that is, the bit indication information corresponding to the unsigned fixed-length code is determined by the numerical maximum value of only the quantized data, and the binary code corresponding to the maximum value The most significant bit in is 1, and the higher bits are all 0. The total number of bits starting from the least significant bit of the maximum value to the bit with the most significant bit being 1 is the bits of the unsigned fixed-length code bit length. The length of the unsigned fixed-length code is fixed. No matter how small the value corresponding to the quantized data is, its length is always fixed.
需要说明的是,本申请首先通过最少无符号位数方法MinUnsignedBit(图像宏块对应的只量化数据中统计出来的无符号数中的最大值m)对无符号数进行处理,当输入无符号数为0时,最少无符号位数方法返回0,无符号数最少位数m为0,而当输入无符号数不等于0时,通过逆向位扫描方法BitScanReverse将无符号数作为非零无符号数输入,返回二进制数中与高位全零区域相邻的,最高位为1的位置对应的位映射数值X,最大无符号位数方法返回X+1,X+1即为输入的无符号数的最少位数,即为无符号定长码对应的位指示信息。每个无符号数都只取其二进制编码位数中的低位部分的位指示信息m个位进行传输,特别地,当位指示信息等于0时,不需要传输任何一个无符号的预测残差数据,因为它们都同时为0,只需要传输位指示信息即可。It should be noted that this application first processes unsigned numbers through the minimum unsigned bit method MinUnsignedBit (the maximum value m among the unsigned numbers counted in the quantized data corresponding to the image macroblock). When the unsigned number is input When it is 0, the minimum unsigned number method returns 0, and the minimum unsigned number m is 0. When the input unsigned number is not equal to 0, the reverse bit scanning method BitScanReverse treats the unsigned number as a non-zero unsigned number. Input, return the bit mapping value The minimum number of digits is the bit indication information corresponding to the unsigned fixed-length code. Each unsigned number only takes m bits of the bit indication information of the low-order part of its binary coded number of bits for transmission. In particular, when the bit indication information is equal to 0, there is no need to transmit any unsigned prediction residual data. , because they are both 0 at the same time, only the bit indication information needs to be transmitted.
在一些实施例的步骤S300中,位指示信息为有符号定长码的位数,而非对称值域标志位与传输值域的左右开闭相对应,二者相结合能够确定有符号定长编码传输值域。In step S300 of some embodiments, the bit indication information is the number of bits of the signed fixed-length code, and the asymmetric value field flag bit corresponds to the left and right opening and closing of the transmission value field. The combination of the two can determine the signed fixed-length code. Encoded transfer value range.
在一些实施例的步骤S400中,位指示信息为有符号定长码的位数,而非对称值域标志位与传输值域的左右开闭相对应,根据该对应关系,能够确定编码方式,当位指示信息相同时,非对称值域标志位对应的两个传输值域的开闭情况相反,例如,当位指示信息为2时,非对称值域标志位对应的两个传输值域分别为(-2,2]和[-2,2)。In step S400 of some embodiments, the bit indication information is the number of bits of the signed fixed-length code, and the asymmetric value field flag bit corresponds to the left and right opening and closing of the transmission value field. According to this correspondence, the encoding method can be determined, When the bit indication information is the same, the opening and closing conditions of the two transmission value fields corresponding to the asymmetric value field flag bit are opposite. For example, when the bit indication information is 2, the two transmission value fields corresponding to the asymmetric value field flag bit are respectively are (-2,2] and [-2,2).
在一些实施例的步骤S500中,有符号定长码设置有符号位,符号位用于表示预测残差数据的正负。In step S500 of some embodiments, the signed fixed-length code is set with a sign bit, and the sign bit is used to represent the sign of the prediction residual data.
在一些实施例的步骤S600中,无符号变长码的长度为变化值,无符号变长码的长度会跟随预测残差数据的大小而改变,只量化数据越大,无符号变长码越长。In step S600 in some embodiments, the length of the unsigned variable length code is a changing value. The length of the unsigned variable length code will change with the size of the prediction residual data. Only the larger the quantized data, the longer the unsigned variable length code. long.
在一些实施例的步骤S700中,无符号定长码设置有符号位,符号位用于表示预测残差数据的正负。In step S700 of some embodiments, the unsigned fixed-length code is set with a sign bit, and the sign bit is used to represent the sign of the prediction residual data.
在一些实施例的步骤S800中,不同编码数据对应的无符号定长码、无符号变长码、有符号定长码和有符号变长码的比特数均不相同,从无符号定长码、有符号定长码、无符号变长码和有符号变长码中选取比特数最少的一个,作为帧图像数据的压缩数据,其占用码位最小,对应的压缩效率更高,压缩质量更佳。In step S800 of some embodiments, the number of bits of unsigned fixed-length codes, unsigned variable-length codes, signed fixed-length codes and signed variable-length codes corresponding to different encoded data is different. , signed fixed-length code, unsigned variable-length code and signed variable-length code, select the one with the smallest number of bits as the compressed data of the frame image data. It occupies the smallest number of code bits, and the corresponding compression efficiency is higher and the compression quality is better. good.
可以理解的是,参照图2,步骤S300包括但不限于以下步骤:It can be understood that, referring to Figure 2, step S300 includes but is not limited to the following steps:
步骤S310、根据预测残差数据,确定预测残差数据的绝对值最大数据。Step S310: Determine the maximum absolute value of the prediction residual data based on the prediction residual data.
步骤S320、根据绝对值最大数据以及对应的预测残差数据的符号,确定位指示信息和非对称值域标志位。Step S320: Determine the bit indication information and the asymmetric range flag bit according to the sign of the maximum absolute value data and the corresponding prediction residual data.
需要说明的是,位指示信息为定长码的位数,定长码对应的块数据头通常包括定长码的长度指示值,即位指示信息,因此,位指示信息为0或正整数。It should be noted that the bit indication information is the number of bits of the fixed-length code. The block data header corresponding to the fixed-length code usually includes the length indication value of the fixed-length code, that is, the bit indication information. Therefore, the bit indication information is 0 or a positive integer.
需要说明的是,通过最少有符号位数方法MinSignedBit(图像宏块残差对应的预测参数数据中统计出来的有符号数的绝对值最大值M,M对应预测残差数据中有符号数的正负符号情况)得到有符号二进制数的最少位数m,m即为有符号数的位指示信息,具体的,MinSignedBit中通过MinUnsignedBit求出M的最小位数n;当n等于0时,返回n;当n不等于0时,如果M对应的预测残差数据只有正数或者只有负数,且M等于2的n-1次幂,即2n-1(也就是1左移n-1个二进制位)时,返回n; 当n不等于0时,如果M对应的预测残差数据只有正数或者只有负数,且M不等于2的n-1次幂,即2n-1(也就是1左移n-1个二进制位)时,返回n+1;当n不等于0时,如果M对应的预测残差数据同时有正数和负数时,返回n+1。而非对称值域标志位与半开半闭区间的传输值域的左右开闭相对应,其计算方法如下,通过MinUnsignedBit(M)求出M的最小位数n,当n等于0时,所有预测残差数据都等于0,不需要传输非对称值域标志位,只需要传输位指示信息;当n不等于0时,如果M对应的预测残差数据只有正数且M等于2n -1时,非对称值域标志位取值为1; 当n不等于0时,如果M对应的预测残差数据只有负数,且M等于2n-1时,非对称值域标志位取值为0;当n不等于0时,如果M对应的预测残差数据同时有正数和负数时,非对称值域标志位取值为0。It should be noted that through the minimum signed number method MinSignedBit (the maximum absolute value M of the signed number counted in the prediction parameter data corresponding to the image macroblock residual, M corresponds to the positive signed number in the prediction residual data Negative sign case) Obtain the minimum number of digits m of the signed binary number, m is the bit indication information of the signed number. Specifically, in MinSignedBit, MinUnsignedBit is used to find the minimum number of digits n of M; when n is equal to 0, n is returned ; When n is not equal to 0, if the prediction residual data corresponding to M has only positive numbers or only negative numbers, and M is equal to the n-1 power of 2, that is, 2 n-1 (that is, 1 is shifted left by n-1 binary bit), return n; when n is not equal to 0, if the prediction residual data corresponding to M has only positive numbers or only negative numbers, and M is not equal to the n-1 power of 2, that is, 2 n-1 (that is, 1 When n-1 binary bits are shifted to the left), n+1 is returned; when n is not equal to 0, if the prediction residual data corresponding to M has both positive and negative numbers, n+1 is returned. The asymmetric value range flag bit corresponds to the left and right opening and closing of the transmission value domain in the half-open and half-closed interval. The calculation method is as follows. The minimum number of digits n in M is found through MinUnsignedBit (M). When n is equal to 0, all The prediction residual data are all equal to 0, and there is no need to transmit the asymmetric value domain flag bit, only the bit indication information needs to be transmitted; when n is not equal to 0, if the prediction residual data corresponding to M has only positive numbers and M is equal to 2 n -1 When , the asymmetric value range flag bit is 1; when n is not equal to 0, if the prediction residual data corresponding to M has only negative numbers, and M is equal to 2 n-1 , the asymmetric value range flag bit is 0 ; When n is not equal to 0, if the prediction residual data corresponding to M has both positive and negative numbers, the asymmetric value range flag value is 0.
可以理解的是,参照图3,步骤S400包括但不限于以下步骤:It can be understood that, referring to Figure 3, step S400 includes but is not limited to the following steps:
步骤S410、当位指示信息大于0时,根据位指示信息,确定边界信息。Step S410: When the bit indication information is greater than 0, determine the boundary information according to the bit indication information.
步骤S420、当非对称值域标志位为1时,将边界信息的负数端设置为开区间、边界信息的正数端设置为闭区间,得到有符号定长码的传输值域。Step S420: When the asymmetric value range flag is 1, set the negative end of the boundary information to an open interval and the positive end of the boundary information to a closed interval to obtain the transmission value range of the signed fixed-length code.
步骤S430、当非对称值域标志位为0时,将边界信息的负数端设置为闭区间、边界信息的正数端设置为开区间,得到有符号定长码的传输值域。Step S430: When the asymmetric value range flag is 0, set the negative end of the boundary information to a closed interval and the positive end of the boundary information to an open interval to obtain the transmission value range of the signed fixed-length code.
需要说明的是,现有技术中的有符号定长码一般都是对称的传输值域,因为有符号,所以最小表达要用两个位以上去表达,即位指示信息大于等于2,例如2个位时候表达的值域是闭区间[-1,1],只表达3个值,2个位时实际上可以表达4个值;3个位时表达的值域是[-3,3],只表达7个值,3个位时实际上可以表达8个值;…;N个位时表达的值域是闭区间[-2N-1-1),((2N-1-1)],只表达2N–1个值,N个位时实际上可以表达2N个值。显然,有符号定长码中有一个值是浪费的,为解决这一问题,现有技术中的传输值域是以负数端为闭区间、正数端为开区间的半开半闭区间,其具体范围如下:It should be noted that signed fixed-length codes in the prior art generally have symmetric transmission value fields. Because they are signed, the minimum expression must be expressed by more than two bits, that is, the bit indication information is greater than or equal to 2, for example, 2 When using 2 bits, the value range expressed is a closed interval [-1, 1], which only expresses 3 values. When using 2 bits, 4 values can actually be expressed; when using 3 bits, the value range expressed is [-3, 3], Only 7 values are expressed, and 8 values can actually be expressed with 3 bits;...; the value range expressed with N bits is a closed interval [-2 N-1 -1), ((2 N-1 -1) ], only expresses 2 N -1 values, and with N bits, it can actually express 2 N values. Obviously, one value in the signed fixed-length code is a waste. To solve this problem, in the existing technology The transmission value range is a half-open and half-closed interval with the negative end as the closed interval and the positive end as the open interval. The specific range is as follows:
1个位,表达[-1,1),取值为-1、0。1 bit, expression [-1,1), the value is -1, 0.
2个位,表达[-2,2), 取值为-2、-1、0、1。2 digits, expressed as [-2,2), the values are -2, -1, 0, 1.
3个位,表达[-4,4),取值为-4、-3、-2、-1、0、1、2、3。3 digits, expressed as [-4,4), the values are -4, -3, -2, -1, 0, 1, 2, 3.
以此类推,N个位,表达[-2N-1,2N-1),有2N种取值。By analogy, N bits express [-2 N-1 ,2 N-1 ), and there are 2 N values.
而上述的传输值域不够灵活,无法满足预测残差数据中的数据刚好处于取相反数的传输值域的情况。The above-mentioned transmission value range is not flexible enough to satisfy the situation where the data in the prediction residual data happens to be in the inverse transmission value range.
需要说明的是,针对有符号定长码,本申请的块数据头增加非对称值域标志位,来标定有符号定长码值域的左右开闭空间,非对称值域标志位为0时,表示有符号定长码采用常规补码截断方式,即有符号定长码的传输值域的负数端为闭区间、正数端为开区间,而当非对称值域标志位为1时,表示有符号定长码采用取相反数后截断方式,即有符号定长码的传输值域的负数端为开区间、正数端为闭区间。本申请中有符号定长码的设置方式能够满足预测残差数据刚好处于取反的传输值域的情况,提高了有符号定长码的灵活程度,并且在解决具有对称的传输值域的定长码的码值浪费问题的同时又能够提高非对称定长码的信息密度。It should be noted that for signed fixed-length codes, the block data header of this application adds an asymmetric value domain flag bit to calibrate the left and right opening and closing spaces of the signed fixed-length code value domain. When the asymmetric value domain flag bit is 0 , indicating that the signed fixed-length code adopts the conventional complement truncation method, that is, the negative end of the transmission value range of the signed fixed-length code is a closed interval and the positive end is an open interval. When the asymmetric value range flag is 1, It means that the signed fixed-length code adopts the inverse and then truncated method, that is, the negative end of the transmission value range of the signed fixed-length code is an open interval and the positive end is a closed interval. The setting method of the signed fixed-length code in this application can satisfy the situation that the prediction residual data happens to be in the inverted transmission value domain, improves the flexibility of the signed fixed-length code, and solves the problem of fixed-length code with symmetrical transmission value domain. While solving the problem of code value waste in long codes, it can also improve the information density of asymmetric fixed-length codes.
在一些实施例的步骤S410中,当位指示信息等于0时,不需要计算也不需要传输非对称值域标志位,不需要传输任何一个有符号的预测残差数据,因为它们都同时为0,只需要传输位指示信息,而当位指示信息大于0时,根据位指示信息,确定边界信息。In step S410 of some embodiments, when the bit indication information is equal to 0, there is no need to calculate or transmit the asymmetric range flag bit, and there is no need to transmit any signed prediction residual data because they are all 0 at the same time. ,Only the bit indication information needs to be transmitted, and when the bit indication information is greater than 0, the boundary information is determined based on the bit indication information.
在一些实施例的步骤S420中,非对称值域标志位与定长码的传输值域的左右开闭相对应,当位指示信息大于0且非对称值域标志位为1时,有符号定长码的传输值域的负数端为开区间、正数端为闭区间。传输值域的边界信息由位指示信息进行确定。负数端为开区间、正数端为闭区间的传输值域能够适应正数端值域占优的情况。In step S420 of some embodiments, the asymmetric value domain flag bit corresponds to the left and right opening and closing of the transmission value domain of the fixed-length code. When the bit indication information is greater than 0 and the asymmetric value domain flag bit is 1, the signed fixed-length The negative end of the transmission value range of the long code is an open interval, and the positive end is a closed interval. The boundary information of the transmission value field is determined by the bit indication information. The transmission value range in which the negative end is an open interval and the positive end is a closed interval can adapt to the situation where the positive end value domain dominates.
在一些实施例的步骤S430中,当位指示信息大于0且非对称值域标志位为0时,有符号定长码采用常规补码截断方式,即有符号定长码的传输值域的负数端为闭区间、正数端为开区间。两种不同传输值域的定长码的设置方法能够同时满足正数端值域占优或者负数端值域占优的情况,从而提高编码效率。In step S430 of some embodiments, when the bit indication information is greater than 0 and the asymmetric value domain flag bit is 0, the signed fixed-length code adopts the conventional complement truncation method, that is, the negative number of the transmission value domain of the signed fixed-length code The end is a closed interval, and the positive end is an open interval. The setting method of two fixed-length codes with different transmission value ranges can simultaneously satisfy the situation where the positive end value domain is dominant or the negative end value domain is dominant, thereby improving coding efficiency.
可以理解的是,参照图4,步骤S410均包括但不限于以下步骤:It can be understood that, referring to Figure 4, step S410 includes but is not limited to the following steps:
步骤S411、将位指示信息减1,得到相减结果。Step S411: Subtract 1 from the bit indication information to obtain the subtraction result.
步骤S412、将第一预设数值作为底数、相减结果作为指数进行幂运算,得到正边界。Step S412: Use the first preset value as the base and the subtraction result as the exponent for exponentiation to obtain a positive boundary.
步骤S413、计算正边界对应数值的相反数,得到负边界。Step S413: Calculate the inverse of the value corresponding to the positive boundary to obtain the negative boundary.
步骤S414、根据正边界和负边界,确定边界信息。Step S414: Determine boundary information based on the positive boundary and negative boundary.
需要说明的是,当位指示信息为N时,指数为N-1,另外,熵编码为二进制,第一预设数值设置为2,即底数为2,幂运算得到的结果为2N-1,即正边界为2N-1。计算正边界对应数值的相反数,得到负边界,则负边界为-2N-1。最终得到的边界包括正边界和负边界,并根据此确定有符号定长码的传输值域。It should be noted that when the bit indication information is N, the exponent is N-1. In addition, the entropy encoding is binary, the first preset value is set to 2, that is, the base is 2, and the result of the exponentiation operation is 2 N-1 , that is, the positive boundary is 2 N-1 . Calculate the opposite number of the corresponding value of the positive boundary to obtain the negative boundary, then the negative boundary is -2 N-1 . The final boundaries include positive boundaries and negative boundaries, and the transmission value range of the signed fixed-length code is determined based on this.
需要说明的是,步骤S340中有符号定长码的传输值域为(-2N-1,2N-1],步骤S360中有符号定长码的传输值域为[-2N-1,2N-1),两个半开半闭区间的传输值域的开闭情况互为相反。It should be noted that the transmission value range of the signed fixed-length code in step S340 is (-2 N-1,2 N-1 ], and the transmission value range of the signed fixed-length code in step S360 is [-2 N-1 ,2 N-1 ), the opening and closing conditions of the transmission value fields of the two half-open and half-closed intervals are opposite to each other.
需要说明的是,当非对称值域标志位为1时,有符号定长码的传输值域的负数端为开区间、正数端为闭区间,其具体范围如下:It should be noted that when the asymmetric value domain flag bit is 1, the negative end of the transmission value domain of the signed fixed-length code is an open interval and the positive end is a closed interval. The specific range is as follows:
1个位,表达(-1,1],取值为0、1。1 bit, expressing (-1,1], with values 0 and 1.
2个位,表达(-2,2], 取值为-1、0、1、2。2 digits, expressing (-2,2], the values are -1, 0, 1, 2.
3个位,表达(-4,4],取值为-3、-2、-1、0、1、2、3、4。3 digits, expressing (-4,4], the values are -3, -2, -1, 0, 1, 2, 3, 4.
以此类推,N个位,表达(-2N-1,2N-1],有2N种取值。By analogy, N bits express (-2 N-1 ,2 N-1 ], and there are 2 N kinds of values.
在一些实施例中,首选的编码方案一,定长码的长度为大于0的固定值N,当非对称值域标志位为0时,对于预测残差数据进行处理时,将预测残差数据的二进制数只取位指示信息N指示的低N位数据作为预测残差数据的编码值。例如,当位指示信息为4时,-2可以表示为1110,-8可以表示为1000,0表示为0000,3表示为0011。另外,当非对称值域标志位为1时,对于预测残差数据进行处理时,将预测残差数据取相反数后转化为二进制数,只取位指示信息N指示的低N位数据作为预测残差数据的编码值。例如,当位指示信息为4时,-2可以表示为0010,-7可以表示为0111,0表示为0000,8可以表示为1000,3可以表示为1101。In some embodiments, the preferred encoding scheme is one. The length of the fixed-length code is a fixed value N greater than 0. When the asymmetric range flag is 0, when the prediction residual data is processed, the prediction residual data will be The binary number only takes the low N-bit data indicated by the bit indication information N as the coded value of the prediction residual data. For example, when the bit indication information is 4, -2 can be expressed as 1110, -8 can be expressed as 1000, 0 can be expressed as 0000, and 3 can be expressed as 0011. In addition, when the asymmetric range flag is 1, when processing the prediction residual data, the prediction residual data is inverted and converted into a binary number, and only the low N-bit data indicated by the bit indication information N is taken as the prediction The encoded value of the residual data. For example, when the bit indication information is 4, -2 can be expressed as 0010, -7 can be expressed as 0111, 0 can be expressed as 0000, 8 can be expressed as 1000, and 3 can be expressed as 1101.
在一些实施例中,可选的编码端实施方案二,定长码的长度为大于0的固定值N,当非对称值域标志位为0时,对于预测残差数据进行处理时,将预测残差数据对应的数值减去传输值域中的最小值-2N-1得差值,再将差值转化为二进制数只取位指示信息N指示的低N位数据作为预测残差数据的编码值。例如,当位指示信息为4时,传输值域中的最小值-2N-1等于-8, -2可以表示为0110,-8可以表示为0000,0表示为1000,3表示为1011。另外,当非对称值域标志位为1时,对于预测残差数据进行处理时,将预测残差数据对应的数值减去传输值域中的最小值-2N-1+1得差值,再将差值转化为二进制数只取位指示信息N指示的低N位数据作为预测残差数据的编码值。例如,当位指示信息为4,传输值域中的最小值-2N-1+1等于-7时,-2可以表示为0101,-7可以表示为0000,0表示为0111,8可以表示为1111,3可以表示为1010。In some embodiments, optional encoding end implementation 2, the length of the fixed-length code is a fixed value N greater than 0. When the asymmetric value domain flag is 0, when processing the prediction residual data, the prediction The value corresponding to the residual data is subtracted from the minimum value -2 N-1 in the transmission value domain to get the difference, and then the difference is converted into a binary number. Only the low N-bit data indicated by the bit indication information N is taken as the predicted residual data. Encoded value. For example, when the bit indication information is 4, the minimum value -2 N-1 in the transmission value field is equal to -8, -2 can be represented as 0110, -8 can be represented as 0000, 0 can be represented as 1000, and 3 can be represented as 1011. In addition, when the asymmetric value domain flag bit is 1, when processing the prediction residual data, the minimum value in the transmission value domain -2 N-1 +1 is subtracted from the value corresponding to the prediction residual data to obtain the difference. The difference is then converted into a binary number, and only the lower N-bit data indicated by the bit indication information N is taken as the coded value of the prediction residual data. For example, when the bit indication information is 4 and the minimum value in the transmission value domain -2 N-1 +1 is equal to -7, -2 can be represented as 0101, -7 can be represented as 0000, 0 can be represented as 0111, and 8 can be represented is 1111,3 can be expressed as 1010.
以上只是罗列算法上相对比较简单的两种具体实施方案,但并不代表限定编码实施的具体细节,例如可选的编码实施方案二中减去的数字,实际上可以为其它常数。但并不影响非对称值域才是真正的提高熵编码信息密度的核心方案。The above is just a list of two specific implementations that are relatively simple in terms of algorithm, but does not limit the specific details of the encoding implementation. For example, the number subtracted in the optional encoding implementation two may actually be other constants. But it does not affect the asymmetric value range, which is the real core solution to improve the information density of entropy coding.
可以理解的是,参照图5,步骤S700包括但不限于以下步骤:It can be understood that, referring to Figure 5, step S700 includes but is not limited to the following steps:
步骤S710、当预测残差数据大于0或小于0时,根据预测残差数据,确定符号位。Step S710: When the prediction residual data is greater than 0 or less than 0, determine the sign bit based on the prediction residual data.
步骤S720、对预测残差数据的绝对值进行无符号编码,得到第一编码。Step S720: Perform unsigned coding on the absolute value of the prediction residual data to obtain the first coding.
步骤S730、根据第一编码和符号位,得到有符号变长码。Step S730: Obtain a signed variable length code based on the first code and the sign bit.
需要说明的是,本申请的有符号变长码,即有符号定长码中符号位的设置更加充分地节省了有效阶码,省下阶码前置阶码表达位,进一步提高了编码效率。It should be noted that the signed variable-length code of the present application, that is, the setting of the sign bit in the signed fixed-length code more fully saves the effective exponent code, saves the exponent code expression bit in front of the exponent code, and further improves the coding efficiency. .
在一些实施例的步骤S710中,符号位与预测残差数据的正负号相对应,当预测残差数据模为正整数时,符号位可以设置为1,而当符号位为负整数时,符号位设置为0。也可以,当预测残差为正整数时,符号位可以设置为0,而当符号位为负整数时,符号位设置为1。In step S710 of some embodiments, the sign bit corresponds to the sign of the prediction residual data. When the prediction residual data modulus is a positive integer, the sign bit can be set to 1, and when the sign bit is a negative integer, The sign bit is set to 0. Alternatively, the sign bit can be set to 0 when the prediction residual is a positive integer, and to 1 when the sign bit is a negative integer.
在一些实施例的步骤S730中,符号位与第一编码相组合得到有符号变长码,符号位可以设置于第一编码的前方或者后方,本申请中,符号位设置于第一编码的后方,为有符号定长码的末位置。In step S730 of some embodiments, the sign bit is combined with the first code to obtain a signed variable length code. The sign bit can be set before or after the first code. In this application, the sign bit is set after the first code. , is the last position of the signed fixed-length code.
需要说明的是,变长码又称为K阶变长指数码、K阶哥伦布编码。哥伦布编码的设计本意是用于编码连续的无符号数的,但是它可以非常容易地通过正负数逐个交叠的方式映射扩展至有符号数的数域,数字交叠成序列:0、-1、1、-2、2、-3、3、-4、4……给予非负整数偶数编号,给予负整数奇数编号,设置x为有符号数,index为映射后的无符号数下标,则:It should be noted that variable length codes are also called K-order variable-length exponential codes and K-order Golomb codes. The Columbus code was originally designed to encode continuous unsigned numbers, but it can be easily mapped and extended to the number field of signed numbers by overlapping positive and negative numbers one by one. The numbers overlap into a sequence: 0, - 1, 1, -2, 2, -3, 3, -4, 4... Give non-negative integers even numbers, give negative integers odd numbers, set x to be a signed number, and index to be the mapped unsigned subscript ,but:
If(x>=0)If(x>=0)
index=2x;index=2x;
ElseElse
index=-2x-1;index=-2x-1;
由上可知现有技术的变长指数编码的有符号数扩展,符号位都是直接占用0阶变长指数编码的一个码值下标来影射表达的,具体的,无符号0阶指数变长码与对应的传输值集以及有符号0阶指数变长码与对应的传输值集如表1所示。It can be seen from the above that in the signed number extension of the variable-length exponent encoding in the prior art, the sign bit directly occupies a code value subscript of the 0-order variable-length exponent encoding to allude to the expression. Specifically, the unsigned 0-order variable-length exponent is expressed The code and the corresponding transmission value set and the signed 0th-order exponential variable length code and the corresponding transmission value set are shown in Table 1.
表1Table 1
其中,X为0或1,而本申请中的数值0直接用0阶无符号变长指数编码,除0以外的数的有符号扩展采用升一阶的方式,也就是用1阶的无符号变长指数编码来扩展符号,即设置符号位S放在最后,具体如表2所示。Among them, Variable length exponential coding is used to extend the sign, that is, the sign bit S is set at the end, as shown in Table 2.
表2Table 2
将具体数值对应的原有符号0阶指数变长码的使用位数与本申请有符号0阶指数变长码进行比较,得到的结果如表3所示。Compare the number of bits used in the original signed 0th-order exponential variable-length code corresponding to the specific value with the signed 0th-order exponential variable-length code of this application, and the results obtained are shown in Table 3.
表3table 3
表3只统计了在正态分布非常靠近中心的符号的情况,在非常靠近中心的时候,概率变化相对较小,但这并不影响编码效率分析的一般性。改良后的方式可以有更大的概率用更少的比特数表达给定的数值。代价只是少部分数值用多了一个比特。Table 3 only counts the symbols that are very close to the center of the normal distribution. When very close to the center, the probability change is relatively small, but this does not affect the generality of the coding efficiency analysis. The improved method has a greater probability of expressing a given value with fewer bits. The cost is just one extra bit for a small number of values.
可以理解的是,参照图6,步骤S720包括但不限于以下步骤:It can be understood that, referring to Figure 6, step S720 includes but is not limited to the following steps:
步骤S721、将预测残差数据的绝对值与第二预设数值相加。Step S721: Add the absolute value of the prediction residual data to the second preset value.
步骤S722、对相加的结果进行二进制转换,得到第二编码。Step S722: Perform binary conversion on the addition result to obtain the second code.
步骤S723、根据第二编码的比特数,确定编码前缀。Step S723: Determine the encoding prefix according to the number of bits of the second encoding.
步骤S724、根据编码前缀和第二编码,得到第一编码。Step S724: Obtain the first code based on the coding prefix and the second code.
在一些实施例的步骤S721中,本申请为二进制编码,因此第二预设数值设置为1。In step S721 of some embodiments, the application is binary encoding, so the second preset value is set to 1.
在一些实施例的步骤S723中,编码前缀与第二编码的比特数相对应,具体地,第二编码的比特数减1得到编码前缀的位数,且编码前缀的数值均为0。In step S723 of some embodiments, the encoding prefix corresponds to the number of bits of the second encoding. Specifically, the number of bits of the second encoding is subtracted by 1 to obtain the number of bits of the encoding prefix, and the values of the encoding prefix are all 0.
在一些实施例的步骤S724中,编码前缀设置于第二编码前方,可以得到第一编码。In step S724 of some embodiments, the encoding prefix is set in front of the second encoding, so that the first encoding can be obtained.
需要说明的是,假设预测残差数据为-7,首先对预测残差数据的绝对值与第二预设数值相加,得到8,然后进行二进制转换,得到的第二编码为1000,第二编码的比特数为4,由此得到编码前缀为000,因此,第一编码为0001000。预测残差数据为负数,其对应的符号位设置为0,那么预测残差数据最终对应的有符号变长码为00010000。也可以,预测残差数据为负数,其对应的符号位设置为1,那么预测残差数据最终对应的有符号变长码为00010001。当预测残差数据为正数时,符号位的处理正好和预测残差数据为负数时相反。It should be noted that, assuming that the prediction residual data is -7, first add the absolute value of the prediction residual data to the second preset value to get 8, and then perform binary conversion, and the second code obtained is 1000, and the second The number of encoding bits is 4, so the encoding prefix is 000, so the first encoding is 0001000. The prediction residual data is a negative number, and its corresponding sign bit is set to 0. Then the final signed variable length code corresponding to the prediction residual data is 00010000. Alternatively, the prediction residual data is a negative number and its corresponding sign bit is set to 1, then the final signed variable length code corresponding to the prediction residual data is 00010001. When the prediction residual data is positive, the sign bit is processed exactly opposite to when the prediction residual data is negative.
可以理解的是,参照图7,步骤S700还包括但不限于以下步骤:It can be understood that, referring to Figure 7, step S700 also includes but is not limited to the following steps:
步骤S740、当预测残差数据等于0时,对预测残差数据进行无符号变长编码,得到有符号变长码。Step S740: When the prediction residual data is equal to 0, unsigned variable length coding is performed on the prediction residual data to obtain a signed variable length code.
需要说明的是,因为0是无符号数,直接用0阶无符号变长指数编码,其对应的有符号变长码为1。It should be noted that because 0 is an unsigned number, it is directly encoded with the 0-order unsigned variable-length exponent, and its corresponding signed variable-length code is 1.
需要说明的是,在本申请中,定长码用于预测残差数据处于小数值时的编码,以表4所示的十位像素位宽的宽高都为8的8x8的数据块距离,该数据块经像素预测后,得到的预测残差数据最优为4,其对应的有符号变长码的长度为6,最优数据字节大小为8*8*6/8=48字节,优于使用10比特的不经过数位压缩的无符号定长码进行表示时的数据字节大小为8*8*10/8=80字节。另外,该数据块中的最大数值为12,对应的二进制码位1100,直接传输无符号编码对应的数据量为8*8*4/8=32字节,显然通过定长码传输的数据量更多,更加优于无符号编码和变长码。It should be noted that in this application, the fixed-length code is used for encoding when the prediction residual data is at a small value. With the ten-digit pixel width shown in Table 4 and the 8x8 data block distance with a width and height of 8, After pixel prediction of this data block, the optimal prediction residual data obtained is 4, the length of the corresponding signed variable length code is 6, and the optimal data byte size is 8*8*6/8=48 bytes , which is better than using a 10-bit unsigned fixed-length code without digital compression. The data byte size is 8*8*10/8=80 bytes. In addition, the maximum value in this data block is 12, and the corresponding binary code bit is 1100. The amount of data corresponding to direct transmission of unsigned encoding is 8*8*4/8=32 bytes. Obviously, the amount of data transmitted through fixed-length code More, better than unsigned encoding and variable length code.
另外,按本申请步骤S300描述的无符号定长编码方式,该数据块中的最大数值为12,对应的二进制码位1100,按本申请步骤S800直接传输无符号定长编码对应的数据字节为8*8*4/8=32字节,显然通过无符号定长码传输的数据更少,信息密度更高,更加优于有符号变长码。本申请中无符号变长编码直接用0阶无符号变长指数编码,如果采用无符号变长码,0对应的无符号变长码的字节大小是1,4对应的无符号变长码的字节大小是5,8和12对应的无符号变长码的字节大小是7,平均用位是5,对应的数据字节大小为8*8*5/8=40字节,依然是无符号定长编码更优。In addition, according to the unsigned fixed-length encoding method described in step S300 of this application, the maximum value in the data block is 12, and the corresponding binary code bit is 1100. According to step S800 of this application, the data bytes corresponding to the unsigned fixed-length encoding are directly transmitted. It is 8*8*4/8=32 bytes. Obviously, less data is transmitted through unsigned fixed-length code, and the information density is higher, which is better than signed variable-length code. In this application, the unsigned variable length encoding directly uses the 0-order unsigned variable length index encoding. If the unsigned variable length code is used, the byte size of the unsigned variable length code corresponding to 0 is 1, and the byte size of the unsigned variable length code corresponding to 4 The byte size is 5, the byte size of the unsigned variable length code corresponding to 8 and 12 is 7, the average bit size is 5, and the corresponding data byte size is 8*8*5/8=40 bytes, still It is unsigned fixed-length encoding that is better.
按本申请中S374步骤中描述的方法编码的有符号定长码的方式时,得到的预测残差数据最优为4,位指示信息的最优为3,正数端占优,非对称值域标志位为1,传输值域为(-4,4],数据字节大小是8*8*3/8=24字节,仅付出多了一个非对称值域标志位的代价。它是这里面使用位数最少,信息密度最高的编码方式.When the signed fixed-length code is encoded according to the method described in step S374 of this application, the optimal prediction residual data obtained is 4, the optimal bit indication information is 3, the positive end is dominant, and the asymmetric value The domain flag bit is 1, the transmission value domain is (-4,4], the data byte size is 8*8*3/8=24 bytes, only the price of one more asymmetric value domain flag bit is paid. It is The encoding method with the fewest number of bits and the highest information density is used here.
这里明显地指出本申请中的取最优编码的实际意义与具体的实施方式。The practical significance and specific implementation of optimal encoding in this application are clearly pointed out here.
表4Table 4
可以理解的是,参照图8,步骤S100包括但不限于以下步骤:It can be understood that, referring to Figure 8, step S100 includes but is not limited to the following steps:
步骤S110、获取原始图像中的帧图像数据。Step S110: Obtain frame image data in the original image.
步骤S120、根据预设的量化参数对帧图像数据进行量化,得到只量化数据。Step S120: Quantize the frame image data according to preset quantization parameters to obtain quantized data.
步骤S130、对只量化数据进行像素预测,得到预测残差数据。Step S130: Perform pixel prediction on the quantized-only data to obtain prediction residual data.
需要说明的是,只量化数据和预测残差数据分别与帧图像数据一一对应,只量化数据由帧图像数据经量化生成,其为无符号数据,而预测残差数据为只量化数据经像素预测所得,其为有符号数。只量化数据和预测残差数据的设置便于进行无符号编码和有符号编码。It should be noted that the quantized-only data and the prediction residual data correspond to the frame image data one-to-one respectively. The quantized-only data is generated from the frame image data through quantization, which is unsigned data, while the prediction residual data is the quantized-only data through pixels. The predicted value is a signed number. The settings of only quantized data and prediction residual data facilitate unsigned encoding and signed encoding.
需要说明的是,量化能够在不降低视觉效果的前提下减少编码长度,减少视觉恢复中不必要的信息。It should be noted that quantization can reduce the encoding length without reducing the visual effect and reduce unnecessary information in visual recovery.
需要说明的是,预测主要包括对只量化数据进行相邻元素(如像素)预测、串预测、块预测等,产生预测残差数据。在图像编码中,宏块是编码的基本单位,在YUV420格式中,每一个宏块包括4个8×8的亮度块和2个8×8的色度块,共6个图像块。对熵编码中,图像块每一点为一个系数,这个系数表示经过熵编码之前的编码步骤得到的预测残差数据。It should be noted that prediction mainly includes adjacent element (such as pixel) prediction, string prediction, block prediction, etc. on quantized data to generate prediction residual data. In image coding, macroblocks are the basic unit of coding. In the YUV420 format, each macroblock includes four 8×8 brightness blocks and two 8×8 chrominance blocks, a total of 6 image blocks. In entropy coding, each point of the image block is a coefficient, and this coefficient represents the prediction residual data obtained by the coding step before entropy coding.
可以理解的是,参照图9,步骤S800之后还包括但不限于以下步骤:It can be understood that, referring to Figure 9, step S800 also includes but is not limited to the following steps:
步骤S910、将压缩数据输入至视频缓存检验器进行检验。Step S910: Input the compressed data to the video cache checker for verification.
步骤S920、当视频缓存检验器处于上溢出状态时,对量化参数进行增加调整,并将调整后的量化参数作为预设的量化参数。Step S920: When the video cache checker is in an overflow state, the quantization parameter is increased and adjusted, and the adjusted quantization parameter is used as a preset quantization parameter.
步骤S930、根据量化参数,重复获取帧图像数据对应的压缩数据,直至视频缓存检验器处于非上溢出状态。Step S930: Repeatly obtain the compressed data corresponding to the frame image data according to the quantization parameter until the video buffer checker is in a non-overflow state.
步骤S940、输出视频缓存检验器处于非上溢出状态时对应的压缩数据。Step S940: Output the compressed data corresponding to when the video cache checker is in a non-overflow state.
需要说明的是,视频缓存检验器(Video Buffering Verifier,VBV)是一个当输入码流遵从数字视/音频制定压缩专家组的标准(MovingPictureExpertsGroup,MPEG)时,不会溢出的解码缓冲器模型。将得到压缩数据输入至视频缓存检验器进行检验,当视频缓存检验器处于上溢出状态时,对量化参数进行增加调整,并将调整后的量化参数作为预设的量化参数,根据量化参数,重复获取帧图像数据对应的压缩数据,直至视频缓存检验器处于非上溢出状态,将频缓存检验器处于非上溢出状态时对应的压缩数据进行输出,使得最终得到的压缩数据满足MPEG要求,提高了压缩质量。It should be noted that the Video Buffering Verifier (VBV) is a decoding buffer model that will not overflow when the input code stream complies with the standards of the Digital Video/Audio Compression Experts Group (MovingPictureExpertsGroup, MPEG). Input the obtained compressed data to the video cache checker for verification. When the video cache checker is in the overflow state, the quantization parameters are increased and adjusted, and the adjusted quantization parameters are used as the preset quantization parameters. According to the quantization parameters, repeat Obtain the compressed data corresponding to the frame image data until the video buffer checker is in a non-overflow state, and output the corresponding compressed data when the frequency buffer checker is in a non-overflow state, so that the final compressed data meets MPEG requirements and improves Compression quality.
需要说明的是,本申请的图像质量下降是由量化产生的,而量化是否产生图像质量下降是由缓冲区模型,即视频缓存检验器决定的,也就是由码率控制决定。It should be noted that the image quality degradation in this application is caused by quantization, and whether quantization causes image quality degradation is determined by the buffer model, that is, the video cache checker, that is, by the code rate control.
需要说明的是,压缩数据的结构为:It should be noted that the structure of compressed data is:
预测模式|是否定长码|定长码长度指示值|QP值|像素压缩数据|…|像素压缩数据。Prediction mode | Whether to use negative long code | Fixed length code length indication value | QP value | Pixel compression data |... | Pixel compression data.
那么,压缩数据的宏块头的具体结构为:Then, the specific structure of the macroblock header of compressed data is:
预测模式|是否定长码|定长码长度指示值|QP值。Prediction mode | Whether to use negative long code | Fixed length code length indication value | QP value.
定长码传输:Fixed length code transmission:
预测模式|是否定长码|定长码长度指示值|QP值。Prediction mode | Whether to use negative long code | Fixed length code length indication value | QP value.
变长码传输:Variable length code transmission:
预测模式|是否定长码|QP值|变长码像素压缩数据的字节长度。Prediction mode | Is it a negative long code | QP value | The byte length of the variable length code pixel compressed data.
需要说明的是,QP值为量化参数,不同的像素位宽对应不同的最大量化参数,最大量化参数MaxQp的计算公式如下:It should be noted that the QP value is a quantization parameter. Different pixel bit widths correspond to different maximum quantization parameters. The calculation formula of the maximum quantization parameter MaxQp is as follows:
If(像素位宽是偶数)If (pixel width is an even number)
{{
MaxQp=4*像素位宽/2;MaxQp=4*pixel width/2;
}}
ElseElse
{{
MaxQp=4*(像素位宽+1)/2;MaxQp=4*(pixel width+1)/2;
}}
当像素位宽为10的时候,最大量化参数为20,字段长度是5,而像素位宽为7的时候,最大量化参数为16,字段长度是5。When the pixel bit width is 10, the maximum quantization parameter is 20, and the field length is 5. When the pixel bit width is 7, the maximum quantization parameter is 16, and the field length is 5.
需要说明的是,预测模式为3个比特,其中0表示上预测,1表示左预测,2表示左上预测,3表示右上预测,4表示直流中值预测,5表示只量化模式,6、7表示保留。It should be noted that the prediction mode is 3 bits, of which 0 represents upper prediction, 1 represents left prediction, 2 represents upper left prediction, 3 represents upper right prediction, 4 represents DC median prediction, 5 represents quantization mode only, 6 and 7 represent reserve.
需要说明的是,是否定长码占位1比特,当该值为0时,压缩数据为变长码,在预测模式为只量化模式,即无符号编码时,压缩数据是无符号变长码,其它为有符号变长码。当是否定长码对应的值为1时,压缩数据为定长码,在预测模式为只量化模式,即无符号编码时,压缩数据是无符号定长码,其它为有符号定长码。It should be noted that the negative long code occupies 1 bit. When the value is 0, the compressed data is a variable length code. When the prediction mode is quantization only mode, that is, unsigned encoding, the compressed data is an unsigned variable length code. , the others are signed variable length codes. When the value corresponding to the negative long code is 1, the compressed data is a fixed-length code. When the prediction mode is quantization-only mode, that is, unsigned coding, the compressed data is an unsigned fixed-length code, and the other is a signed fixed-length code.
需要说明的是,定长码长度指示值由两部分组成,其中4个比特是位指示信息,其具体大小为预测残差数据或只量化数据的绝对值的最大值,另外一个比特是非对称值域标志位,这个比特是动态的,只在有符号定长码传输时存在。如果位指示信息为0,表示所要传输的预测残差数据或只量化数据为0,所有预测残差数据或只量化数据都不需要传输,只需要传输位指示信息。It should be noted that the fixed-length code length indication value consists of two parts, 4 of which are bit indication information, whose specific size is the maximum value of the absolute value of the prediction residual data or only quantized data, and the other bit is an asymmetric value. Domain flag bit, this bit is dynamic and only exists when signed fixed-length code is transmitted. If the bit indication information is 0, it means that the prediction residual data or only quantized data to be transmitted is 0. All prediction residual data or only quantized data does not need to be transmitted, and only the bit indication information needs to be transmitted.
需要说明的是,定长码除固定字节长度的宏块头外,其像素压缩数据是可以直接计算出来的,也就是不需要传输压缩数据的字节长度信息,在解码端,能够从当前宏块头直接定位到下一个宏块头的首字节。It should be noted that, in addition to the macro block header with a fixed byte length, the pixel compression data of the fixed-length code can be directly calculated, that is, there is no need to transmit the byte length information of the compressed data. At the decoding end, it can be obtained from the current macro The block header is positioned directly to the first byte of the next macroblock header.
需要说明的是,变长码的宏块头也是固定长度的,里面包含了可选的变长码像素压缩数据的字节长度,同样可以在解码端从当前宏块头直接定位到下一个宏块头的首字节。It should be noted that the macro block header of the variable length code is also of fixed length, which contains the byte length of the optional variable length code pixel compression data. It can also be directly positioned from the current macro block header to the next macro block header at the decoding end. First byte.
需要说明的是,参照图12,本申请首先对帧图像数据进行量化,得到只量化数据,只量化数据可直接进行无符号变长编码,首先得到无符号变长码,并将无符号变长码,即无符号变长码输出至中间缓冲,并与无符号定长码进行比特数比较,判断哪个最优,并将性能更优的无符号编码进行输出,另外,还对只量化数据进行像素预测,得到预测残差数据,对预测残差数据进行有符号编码,得到有符号变长码和有符号定长码,并将性能更优的有符号编码进行输出,之后,比较输出的有符号编码和无符号编码,得到性能最优的编码,即压缩数据,压缩数据对应的编码占用的比特位数最少,将压缩数据输入至视频缓存检验器进行检验,当视频缓存检验器处于上溢出状态时,对量化参数进行增加调整,并将调整后的量化参数作为预设的量化参数,根据量化参数,重复获取帧图像数据对应的压缩数据,直至视频缓存检验器处于非上溢出状态,将视频缓存检验器处于非上溢出状态时对应的压缩数据进行输出,使得最终得到的压缩数据满足传输要求,提高了压缩质量。本申请根据像素预测的统计结果,融合了变长和定长熵编码方法,并在有符号变长码部分采用了变长指数码方式,0因为是无符号数,用0阶无符号变长指数码去表达,除0之外的有符号数,设置符号位,更加充分地节省了有效阶码,省下阶码前置阶码表达位,进一步提高了编码效率,而在有符号定长码部分设置非对称值域标志位,以标定有符号定长码传输值域的左右开闭空间,提高了定长码的编码效率。It should be noted that, referring to Figure 12, this application first quantizes the frame image data to obtain only quantized data. The only quantized data can be directly subjected to unsigned variable length encoding. First, an unsigned variable length code is obtained, and the unsigned variable length code is obtained. code, that is, the unsigned variable-length code is output to the intermediate buffer, and the number of bits is compared with the unsigned fixed-length code to determine which one is the best, and the unsigned code with better performance is output. In addition, only the quantized data is Pixel prediction, obtain prediction residual data, perform signed coding on the prediction residual data, obtain signed variable length code and signed fixed length code, and output the signed coding with better performance, and then compare the outputs with Signed encoding and unsigned encoding are used to obtain the encoding with the best performance, that is, compressed data. The encoding corresponding to the compressed data occupies the least number of bits. The compressed data is input to the video cache checker for verification. When the video cache checker is in overflow state, the quantization parameters are increased and adjusted, and the adjusted quantization parameters are used as the preset quantization parameters. According to the quantization parameters, the compressed data corresponding to the frame image data is repeatedly obtained until the video cache checker is in a non-overflow state, and the When the video cache checker is in a non-overflow state, the corresponding compressed data is output, so that the final compressed data meets the transmission requirements and improves the compression quality. Based on the statistical results of pixel prediction, this application combines variable-length and fixed-length entropy coding methods, and uses variable-length exponential coding in the signed variable-length code part. Since 0 is an unsigned number, 0-order unsigned variable-length code is used. Index codes are used to express signed numbers other than 0. Setting the sign bit fully saves the effective exponent code and saves the exponent code expression bit in front of the exponent code, which further improves the coding efficiency. In the case of signed fixed-length The code part is set with asymmetric value domain flag bits to calibrate the left and right opening and closing spaces of the signed fixed-length code transmission value domain, which improves the coding efficiency of the fixed-length code.
另外,参照图10,本申请实施例还提供一种熵解码方法,熵解码方法包括但不限于以下步骤:In addition, referring to Figure 10, this embodiment of the present application also provides an entropy decoding method. The entropy decoding method includes but is not limited to the following steps:
步骤S1010、获取压缩数据,压缩数据根据上述的熵编码方法生成。Step S1010: Obtain compressed data. The compressed data is generated according to the above-mentioned entropy coding method.
步骤S1020、根据压缩数据,确定编码类型,编码类型包括无符号定长编码、有符号定长编码、无符号变长编码和有符号变长编码。Step S1020: Determine the encoding type according to the compressed data. The encoding type includes unsigned fixed-length encoding, signed fixed-length encoding, unsigned variable-length encoding, and signed variable-length encoding.
步骤S1030、根据编码类型对压缩数据进行解码,得到解码数据。Step S1030: Decode the compressed data according to the encoding type to obtain decoded data.
步骤S1040、根据解码数据,确定帧图像数据。Step S1040: Determine frame image data according to the decoded data.
需要说明的是,本申请提供的熵解码方法的压缩数据为无符号定长码、无符号变长码、有符号定长码和有符号变长码的其中一种,首先根据压缩数据,确定编码类型,编码类型与无符号定长码、无符号变长码、有符号定长码和有符号变长码相对应,根据编码类型对压缩数据进行解码,得到解码数据,根据解码数据,确定帧图像数据该熵解码方法与上述的熵编码方式相对应,能够提高视频压缩的压缩效率,提高了视频的压缩质量。It should be noted that the compressed data of the entropy decoding method provided by this application is one of unsigned fixed-length code, unsigned variable-length code, signed fixed-length code and signed variable-length code. First, according to the compressed data, determine Coding type, the coding type corresponds to unsigned fixed-length code, unsigned variable-length code, signed fixed-length code and signed variable-length code. The compressed data is decoded according to the coding type to obtain decoded data. According to the decoded data, determine This entropy decoding method of frame image data corresponds to the above-mentioned entropy encoding method, which can improve the compression efficiency of video compression and improve the compression quality of the video.
需要说明的是,本申请提供的熵编码方法和熵解码方法能够实现透明质量的2-3倍浅压缩,现采用22个超高清序列进行编解码压缩测试,测试结果如表5所示。其中,序列22为随机噪声,由此可见,本申请提供的熵编码方法和熵解码方法对无法预测的随机噪声,可以很好地收敛并维持高质量,而对于其余序列部分达到完全无损,并达到人眼无法分辨的误差精度。It should be noted that the entropy encoding method and entropy decoding method provided by this application can achieve 2-3 times shallow compression with transparent quality. 22 ultra-high definition sequences are now used for encoding and decoding compression tests. The test results are shown in Table 5. Among them, sequence 22 is random noise. It can be seen that the entropy encoding method and entropy decoding method provided by this application can converge well and maintain high quality for unpredictable random noise, while it is completely lossless for the remaining sequence parts, and Achieving error precision that is indistinguishable to the human eye.
表5table 5
需要说明的是,当在参考帧压缩还是视频接口压缩的场景下,很有可能会面临多重压缩的使用场景,本申请提供的编解码方法与20至30倍压缩率的算法串联编解码时的结果如表6所示,本申请提供的编解码方法与80至120倍压缩率的算法串联编解码时的结果如表7所示。It should be noted that when using reference frame compression or video interface compression, it is very likely to face multiple compression usage scenarios. When the encoding and decoding method provided by this application is serially encoded and decoded with an algorithm with a compression rate of 20 to 30 times, The results are shown in Table 6, and the results when the encoding and decoding method provided by this application are concatenated with an algorithm with a compression rate of 80 to 120 times are encoded and decoded in series, as shown in Table 7.
表6Table 6
表7Table 7
由表6、表7可得,本申请在于其他压缩编解码器串联时,质量或码率带来的影响极小,基本可以忽略,达到透明的串联效果。It can be seen from Table 6 and Table 7 that in this application, when other compression codecs are connected in series, the impact on quality or bit rate is minimal and can be basically ignored, achieving a transparent series effect.
可以理解的是,参照图11,步骤S1040包括但不限于以下步骤:It can be understood that, referring to Figure 11, step S1040 includes but is not limited to the following steps:
步骤S1041、当解码数据为预测残差数据时,确定解码数据的预测方式和量化参数。Step S1041: When the decoded data is prediction residual data, determine the prediction method and quantization parameter of the decoded data.
步骤S1042、根据预测方式对解码数据进行反预测,得到只量化数据。Step S1042: Back-predict the decoded data according to the prediction method to obtain quantized-only data.
步骤S1043、根据量化参数对只量化数据进行反量化,得到帧图像数据。Step S1043: Inverse quantize the quantized data according to the quantization parameters to obtain frame image data.
需要说明的是,与步骤S130相对应,需要预测方式对解码数据进行反预测,得到只量化数据,与步骤S120相对应,需要根据量化参数对只量化数据进行反量化,最终得到原始图像数据。It should be noted that, corresponding to step S130, the decoded data needs to be inversely predicted using a prediction method to obtain quantized-only data. Corresponding to step S120, the quantized-only data needs to be inversely quantized according to the quantization parameters to finally obtain the original image data.
需要说明的是,当解码数据为只量化数据时,直接根据步骤S1043进行反量化,得到帧图像数据。It should be noted that when the decoded data is only quantized data, inverse quantization is directly performed according to step S1043 to obtain frame image data.
需要说明的是,参照图13,接收到压缩数据后,判断压缩数据是否经过预测,当压缩数据经过预测时,确定压缩数据的预测方式和有符号编码方式,即编码类型,并根据预测方式和有符号编码方式对压缩数据进行还原,若压缩数据未经过预测,确定压缩数据的无符号编码方式,即编码类型,并根据无符号编码方式对压缩数据进行还原。最后根据量化参数对还原得到的数据进行反量化,得到帧图像数据。It should be noted that, referring to Figure 13, after receiving the compressed data, it is determined whether the compressed data has been predicted. When the compressed data has been predicted, the prediction method and signed coding method of the compressed data, that is, the coding type, are determined according to the prediction method and The compressed data is restored using the signed encoding method. If the compressed data has not been predicted, the unsigned encoding method of the compressed data, that is, the encoding type, is determined, and the compressed data is restored according to the unsigned encoding method. Finally, the restored data is inversely quantized according to the quantization parameters to obtain frame image data.
另外,参照图14,本申请实施例还提供一种熵编码装置,包括:In addition, referring to Figure 14, this embodiment of the present application also provides an entropy coding device, including:
获取单元100,用于获取原始图像中帧图像数据的只量化数据和预测残差数据。The acquisition unit 100 is used to acquire only quantized data and prediction residual data of the frame image data in the original image.
第一编码单元200,用于对只量化数据进行无符号定长编码,得到无符号定长码。The first encoding unit 200 is used to perform unsigned fixed-length encoding on the quantized data to obtain an unsigned fixed-length code.
信息确定单元300,用于根据预测残差数据确定位指示信息和非对称值域标志位。The information determining unit 300 is configured to determine the bit indication information and the asymmetric value range flag bit according to the prediction residual data.
值域确定单元400,用于根据位指示信息和非对称值域标志位,得到有符号定长编码的传输值域,以确定有符号定长编码的编码方式,非对称值域标志位在同一位指示信息下对应的两个传输值域的开闭情况相反。The value domain determination unit 400 is used to obtain the transmission value domain of the signed fixed-length encoding according to the bit indication information and the asymmetric value domain flag bit, so as to determine the encoding method of the signed fixed-length code. The asymmetric value domain flag bit is in the same The opening and closing conditions of the two corresponding transmission value fields under the bit indication information are opposite.
第二编码单元500,用于根据编码方式对预测残差数据进行有符号定长编码,得到有符号定长码。The second encoding unit 500 is configured to perform signed fixed-length encoding on the prediction residual data according to the encoding method to obtain a signed fixed-length code.
第三编码单元600,用于对只量化数据进行无符号变长编码,得到无符号变长码。The third encoding unit 600 is used to perform unsigned variable length encoding on the quantized data to obtain an unsigned variable length code.
第四编码单元700,用于从无符号定长码、有符号定长码、无符号变长码和有符号变长码中选取比特数最少的一个,作为帧图像数据的压缩数据。The fourth encoding unit 700 is used to select the one with the smallest number of bits from the unsigned fixed-length code, the signed fixed-length code, the unsigned variable-length code, and the signed variable-length code as the compressed data of the frame image data.
比较单元800,用于比较无符号定长码、有符号定长码、无符号变长码和有符号变长码的比特数,确定帧图像数据的压缩数据。The comparison unit 800 is used to compare the number of bits of the unsigned fixed-length code, the signed fixed-length code, the unsigned variable-length code and the signed variable-length code, and determine the compressed data of the frame image data.
该熵编码装置的具体实施方式与上述熵编码方法的具体实施例基本相同,在此不再赘述。The specific implementation of the entropy coding device is basically the same as the specific implementation of the above-mentioned entropy coding method, and will not be described again here.
本申请实施例还提供了一种电子设备,电子设备包括存储器和处理器,存储器存储有计算机程序,处理器执行计算机程序时实现上述熵编码方法或熵解码方法。该电子设备可以为包括平板电脑、车载电脑等任意智能终端。An embodiment of the present application also provides an electronic device. The electronic device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, it implements the above-mentioned entropy encoding method or entropy decoding method. The electronic device can be any smart terminal including a tablet computer, a vehicle-mounted computer, etc.
请参阅图15,图15示意了另一实施例的电子设备的硬件结构,电子设备包括:Please refer to Figure 15. Figure 15 illustrates the hardware structure of an electronic device according to another embodiment. The electronic device includes:
处理器901,可以采用通用的CPU(CentralProcessingUnit,中央处理器)、微处理器、应用专用集成电路(ApplicationSpecificIntegratedCircuit,ASIC)、或者一个或多个集成电路等方式实现,用于执行相关程序,以实现本申请实施例所提供的技术方案。The processor 901 can be implemented by a general CPU (Central Processing Unit, central processing unit), a microprocessor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement The technical solutions provided by the embodiments of this application.
存储器902,可以采用只读存储器(ReadOnlyMemory,ROM)、静态存储设备、动态存储设备或者随机存取存储器(RandomAccessMemory,RAM)等形式实现。存储器902可以存储操作系统和其他应用程序,在通过软件或者固件来实现本说明书实施例所提供的技术方案时,相关的程序代码保存在存储器902中,并由处理器901来调用执行本申请实施例的熵编码方法或熵解码方法。The memory 902 can be implemented in the form of read-only memory (ReadOnlyMemory, ROM), static storage device, dynamic storage device, or random access memory (RandomAccessMemory, RAM). The memory 902 can store operating systems and other application programs. When implementing the technical solutions provided by the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 902 and called by the processor 901 to execute the implementation of this application. Examples of entropy encoding methods or entropy decoding methods.
输入/输出接口903,用于实现信息输入及输出。Input/output interface 903 is used to implement information input and output.
通信接口904,用于实现本设备与其他设备的通信交互,可以通过有线方式(例如USB、网线等)实现通信,也可以通过无线方式(例如移动网络、WIFI、蓝牙等)实现通信。The communication interface 904 is used to realize communication interaction between this device and other devices. Communication can be achieved through wired methods (such as USB, network cables, etc.) or wireless methods (such as mobile network, WIFI, Bluetooth, etc.).
总线905,在设备的各个组件(例如处理器901、存储器902、输入/输出接口903和通信接口904)之间传输信息。Bus 905 carries information between the various components of the device (eg, processor 901, memory 902, input/output interface 903, and communication interface 904).
其中处理器901、存储器902、输入/输出接口903和通信接口904通过总线905实现彼此之间在设备内部的通信连接。The processor 901, the memory 902, the input/output interface 903 and the communication interface 904 implement communication connections between each other within the device through the bus 905.
本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现上述熵编码方法或熵解码方法。Embodiments of the present application also provide a computer-readable storage medium that stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned entropy encoding method or entropy decoding method.
存储器作为一种非暂态计算机可读存储介质,可用于存储非暂态软件程序以及非暂态性计算机可执行程序。此外,存储器可以包括高速随机存取存储器,还可以包括非暂态存储器,例如至少一个磁盘存储器件、闪存器件、或其他非暂态固态存储器件。在一些实施方式中,存储器可选包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至该处理器。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。As a non-transitory computer-readable storage medium, memory can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory may include high-speed random access memory and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory located remotely from the processor, and the remote memory may be connected to the processor via a network. Examples of the above-mentioned networks include but are not limited to the Internet, intranets, local area networks, mobile communication networks and combinations thereof.
本申请实施例提供的熵编码方法、熵解码方法及相关装置,该熵编码方法对只量化数据分别进行编码,得到无符号定长码和无符号变长码,并对预测参数进行编码,得到有符号定长码和有符号变长码,融合了变长编码和定长编码,并从中选取压缩效率最优的编码方式,即占用码位最小的编码结果对应的编码方式,对应的编码结果作为压缩数据,另外,本申请根据非对称值域标志位确定有符号定长编码的传输值域,能够提高有符号定长码的信息密度,提高了编码效率,与现有技术相比,在实现同等的图像压缩质量的基础上,本申请能够有效地降低芯片的带宽要求和功耗,而在相同的芯片带宽要求和功耗的基础上,本申请能够提高图像的压缩效率,提高了图像的压缩质量。The entropy coding method, the entropy decoding method and related devices provided by the embodiments of the present application. The entropy coding method separately codes the quantized data to obtain an unsigned fixed-length code and an unsigned variable-length code, and codes the prediction parameters to obtain Signed fixed-length codes and signed variable-length codes combine variable-length coding and fixed-length coding, and select the coding method with the best compression efficiency, that is, the coding method corresponding to the coding result that occupies the smallest code bits, and the corresponding coding result As compressed data, in addition, this application determines the transmission value domain of the signed fixed-length code based on the asymmetric value domain flag bit, which can improve the information density of the signed fixed-length code and improve the coding efficiency. Compared with the existing technology, On the basis of achieving the same image compression quality, this application can effectively reduce the bandwidth requirements and power consumption of the chip. On the basis of the same chip bandwidth requirements and power consumption, this application can improve the compression efficiency of the image and improve the image quality. compression quality.
本申请实施例描述的实施例是为了更加清楚的说明本申请实施例的技术方案,并不构成对于本申请实施例提供的技术方案的限定,本领域技术人员可知,随着技术的演变和新应用场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。The embodiments described in the embodiments of the present application are for the purpose of more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art will know that with the evolution of technology and new technologies, As application scenarios arise, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
本领域技术人员可以理解的是,图中示出的技术方案并不构成对本申请实施例的限定,可以包括比图示更多或更少的步骤,或者组合某些步骤,或者不同的步骤。Those skilled in the art can understand that the technical solutions shown in the figures do not limit the embodiments of the present application, and may include more or fewer steps than those shown in the figures, or combine certain steps, or different steps.
以上所描述的装置实施例仅仅是示意性的,其中作为分离部件说明的单元可以是或者也可以不是物理上分开的,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The device embodiments described above are only illustrative, and the units described as separate components may or may not be physically separate, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
本领域普通技术人员可以理解,上文中所公开方法中的全部或某些步骤、系统、设备中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。Those of ordinary skill in the art can understand that all or some steps, systems, and functional modules/units in the devices disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof.
本申请的说明书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。The terms "first", "second", "third", "fourth", etc. (if present) in the description of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe specific objects. Sequence or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the application described herein can be practiced in sequences other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, e.g., a process, method, system, product, or apparatus that encompasses a series of steps or units and need not be limited to those explicitly listed. Those steps or elements may instead include other steps or elements not expressly listed or inherent to the process, method, product or apparatus.
应当理解,在本申请中,“至少一个(项)”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,用于描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:只存在A,只存在B以及同时存在A和B三种情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b或c中的至少一项(个),可以表示:a,b,c,“a和b”,“a和c”,“b和c”,或“a和b和c”,其中a,b,c可以是单个,也可以是多个。It should be understood that in this application, "at least one (item)" refers to one or more, and "plurality" refers to two or more. "And/or" is used to describe the relationship between associated objects, indicating that there can be three relationships. For example, "A and/or B" can mean: only A exists, only B exists, and A and B exist simultaneously. , where A and B can be singular or plural. The character "/" generally indicates that the related objects are in an "or" relationship. “At least one of the following” or similar expressions thereof refers to any combination of these items, including any combination of a single item (items) or a plurality of items (items). For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c" ”, where a, b, c can be single or multiple.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,上述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the above units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or may be Integrated into another system, or some features can be ignored, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
上述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place, or they may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括多指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例的方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等各种可以存储程序的介质。Integrated units may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as independent products. Based on this understanding, the technical solution of the present application is essentially or contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc. that can store programs. medium.
以上参照附图说明了本申请实施例的优选实施例,并非因此局限本申请实施例的权利范围。本领域技术人员不脱离本申请实施例的范围和实质内所作的任何修改、等同替换和改进,均应在本申请实施例的权利范围之内。The preferred embodiments of the embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of rights of the embodiments of the present application. Any modifications, equivalent substitutions and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of rights of the embodiments of the present application.
Claims (14)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310797299.7A CN116527904B (en) | 2023-07-03 | 2023-07-03 | Entropy coding method, entropy decoding method and related devices |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310797299.7A CN116527904B (en) | 2023-07-03 | 2023-07-03 | Entropy coding method, entropy decoding method and related devices |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN116527904A CN116527904A (en) | 2023-08-01 |
| CN116527904B true CN116527904B (en) | 2023-09-12 |
Family
ID=87405102
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202310797299.7A Active CN116527904B (en) | 2023-07-03 | 2023-07-03 | Entropy coding method, entropy decoding method and related devices |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN116527904B (en) |
Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2012023611A (en) * | 2010-07-15 | 2012-02-02 | Mitsubishi Electric Corp | Dynamic image encoding device, dynamic image decoding device, dynamic image encoding method, and dynamic image decoding method |
| CN109495211A (en) * | 2018-09-30 | 2019-03-19 | 湖南瑞利德信息科技有限公司 | A kind of channel coding and coding/decoding method |
| WO2020171668A1 (en) * | 2019-02-24 | 2020-08-27 | 엘지전자 주식회사 | Method and device for image decoding using residual information including context-coded sign information in image coding system |
| CN111641827A (en) * | 2019-03-02 | 2020-09-08 | 上海天荷电子信息有限公司 | Data compression method and device for prediction residual entropy coding by switching multiple schemes |
| CN112437300A (en) * | 2020-11-23 | 2021-03-02 | 武汉理工大学 | Distributed video coding method based on self-adaptive interval overlapping factor |
| CN112737729A (en) * | 2019-10-28 | 2021-04-30 | 哈尔滨工业大学(深圳) | Data transmission method and device, computer equipment and storage medium |
| CN113519155A (en) * | 2019-01-02 | 2021-10-19 | 弗劳恩霍夫应用研究促进协会 | Unified Transform Type Signaling and Transform Type Dependent Transform Coefficient Level Coding |
| CN114424547A (en) * | 2019-07-05 | 2022-04-29 | 威诺瓦国际有限公司 | Quantization of residual in video coding |
| CN115086664A (en) * | 2021-03-13 | 2022-09-20 | 腾讯科技(深圳)有限公司 | Decoding method, encoding method, decoder and encoder for unmatched pixels |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9167252B2 (en) * | 2010-12-01 | 2015-10-20 | Texas Instruments Incorporated | Quantization matrix compression in video coding |
| AU2019247481B2 (en) * | 2018-04-04 | 2023-07-06 | Kakadu R & D Pty Ltd | A further improved method and apparatus for image compression |
| CN118474372A (en) * | 2019-02-19 | 2024-08-09 | Lg 电子株式会社 | Video decoding method using residual information in video coding system and apparatus therefor |
| CN115769581A (en) * | 2020-06-16 | 2023-03-07 | 谷歌有限责任公司 | Dynamic method for symbol encoding |
-
2023
- 2023-07-03 CN CN202310797299.7A patent/CN116527904B/en active Active
Patent Citations (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2012023611A (en) * | 2010-07-15 | 2012-02-02 | Mitsubishi Electric Corp | Dynamic image encoding device, dynamic image decoding device, dynamic image encoding method, and dynamic image decoding method |
| CN109495211A (en) * | 2018-09-30 | 2019-03-19 | 湖南瑞利德信息科技有限公司 | A kind of channel coding and coding/decoding method |
| CN113519155A (en) * | 2019-01-02 | 2021-10-19 | 弗劳恩霍夫应用研究促进协会 | Unified Transform Type Signaling and Transform Type Dependent Transform Coefficient Level Coding |
| WO2020171668A1 (en) * | 2019-02-24 | 2020-08-27 | 엘지전자 주식회사 | Method and device for image decoding using residual information including context-coded sign information in image coding system |
| CN111641827A (en) * | 2019-03-02 | 2020-09-08 | 上海天荷电子信息有限公司 | Data compression method and device for prediction residual entropy coding by switching multiple schemes |
| CN114424547A (en) * | 2019-07-05 | 2022-04-29 | 威诺瓦国际有限公司 | Quantization of residual in video coding |
| CN112737729A (en) * | 2019-10-28 | 2021-04-30 | 哈尔滨工业大学(深圳) | Data transmission method and device, computer equipment and storage medium |
| CN112437300A (en) * | 2020-11-23 | 2021-03-02 | 武汉理工大学 | Distributed video coding method based on self-adaptive interval overlapping factor |
| CN115086664A (en) * | 2021-03-13 | 2022-09-20 | 腾讯科技(深圳)有限公司 | Decoding method, encoding method, decoder and encoder for unmatched pixels |
Non-Patent Citations (1)
| Title |
|---|
| Based on discrete orthogonal tchebichef transform for image compression;Li Ji 等;Computer Engineering and Design;第34卷(第12期);第4261-4266页 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN116527904A (en) | 2023-08-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112399181B (en) | Image coding and decoding method, device and storage medium | |
| CN111131828B (en) | An image compression method, device, electronic device and storage medium | |
| CN107743239B (en) | A method and device for encoding and decoding video data | |
| US20200177919A1 (en) | Method for Producing Video Coding and Programme-Product | |
| TWI694712B (en) | Method and apparatus for range derivation in context adaptive binary arithmetic coding | |
| CN102859884B (en) | adaptive entropy coding | |
| KR102165070B1 (en) | Coding of video syntax elements using context tree | |
| WO2012159301A1 (en) | Method, device and medium for video entropy encoding and entropy decoding | |
| CN102098508A (en) | Multimedia signature coding and decoding | |
| JP2008118307A (en) | Encoding apparatus and control method thereof | |
| US11336891B2 (en) | Coding method and system with improved transform domain coefficient computation | |
| CN108235013B (en) | HEVC-based low-period CABAC decoder and decoding method thereof | |
| US20150326859A1 (en) | Video quantization-parameter encoding method, video quantization-parameter decoding method, device, and program | |
| BR112020000415B1 (en) | Method to compress, method to decompress, compressed dataset corresponding to an uncompressed dataset, device to compress, and device to decompress | |
| CN105409129B (en) | Encoder device, decoder device and method | |
| TW202019176A (en) | Picture coding device, picture coding method, and picture coding program, and picture decoding device, picture decoding method, and picture decoding program | |
| KR101696589B1 (en) | Method for decoding video quantization parameter | |
| CN116527904B (en) | Entropy coding method, entropy decoding method and related devices | |
| US20230188726A1 (en) | Dynamic Method for Symbol Encoding | |
| Niedermayer | Ffv1 video codec specification | |
| CN116074525B (en) | Coefficient decoding method and device, image decoder and electronic equipment | |
| CN115802060A (en) | Semantic communication video transmission method and related equipment | |
| CN112449186B (en) | Encoding method, decoding method, corresponding devices, electronic equipment and storage medium | |
| CN114556790A (en) | Probability estimation for entropy coding | |
| JP4936574B2 (en) | Encoding apparatus and control method thereof |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |