CN100542293C - Variable length coding and decoding method and its coding and decoding device - Google Patents

Variable length coding and decoding method and its coding and decoding device Download PDF

Info

Publication number
CN100542293C
CN100542293C CN 200610163459 CN200610163459A CN100542293C CN 100542293 C CN100542293 C CN 100542293C CN 200610163459 CN200610163459 CN 200610163459 CN 200610163459 A CN200610163459 A CN 200610163459A CN 100542293 C CN100542293 C CN 100542293C
Authority
CN
China
Prior art keywords
coefficients
nonzero
number
coefficient
zero
Prior art date
Application number
CN 200610163459
Other languages
Chinese (zh)
Other versions
CN101198054A (en
Inventor
周建同
曾鹏鑫
林四新
熊联欢
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN 200610163459 priority Critical patent/CN100542293C/en
Publication of CN101198054A publication Critical patent/CN101198054A/en
Application granted granted Critical
Publication of CN100542293C publication Critical patent/CN100542293C/en

Links

Abstract

本发明公开了一种变长编码方法,包括步骤:统计当前块中非零系数的个数和幅值大于1的系数个数;将统计得到的非零系数个数编码进码流;将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流;以及将统计得到的幅值大于1的系数个数编码进码流;将当前块中相应非零系数的幅值编码进码流。 The present invention discloses a variable length coding method, comprising the steps of: Statistics nonzero coefficients in the current block number and the number is greater than the amplitude coefficient 1; number of non-zero coefficients into the encoded bit stream obtained statistics; current each nonzero coefficient number encoder symbols and the corresponding zero coefficients before a nonzero coefficient in the block into the code stream; and the number of the coefficients obtained statistical magnitude greater than one feed stream; nonzero coefficients in the block corresponding to the current amplitude encoded into the code stream. 相应的本发明还公开了对应的变长解码方法和变长编解码器。 The present invention also discloses a corresponding a corresponding variable length decoding method and a variable length codec. 本发明可以进一步提高熵编码的编码效率,同时编码过程基于更为简单的码表结构,从而降低切换计算的复杂度及减少内存空间的占用。 The present invention can further improve coding efficiency of the entropy coding, while the encoding process based on a simpler structure code table, thereby reducing the complexity of the calculations and reduce the occupancy of the switching memory space.

Description

变长编解码方法及其编解码器 Variable length coding method and decoding codecs

技术领域 FIELD

本发明涉及视频图像编解码技术领域,尤其是涉及一种变长编解码方法及其编解码器。 The present invention relates to the field of video encoding and decoding technology, and more particularly to a variable length coding method and decoding codec.

背景技术 Background technique

熵编码技术是普遍应用于视频编码领域的技术,其中熵编码处理部分是整 Entropy encoding technique is widely used in the field of video coding technology, wherein the entropy encoding process is an integral part

个视频编码框架的最后一个部分,如图1所示为目前AVS视频编码器的组成框图,可见熵编码处理部分是处在最后一级的,其编码后的码流直接作为传输的比特流。 The last part of a video coding framework, shown as the block diagram of the current AVS video encoder, an entropy encoding process can be seen in part in the final stage, after which the encoded stream transmitted as a bit stream directly. 熵编码的对象是之前所有处理部分生成的一系列语法元素,包括宏块类型信息,参考帧索引信息,块编码方式(CBP, Coded Block Pattern )信息, 量化步长(QP)信息,运动矢量的残差信息,变换和量化后的残差系数信息等。 Entropy encoding a series of objects that all syntax elements before processing section generates, including the macroblock type information, the reference frame index information, block coding mode (CBP, Coded Block Pattern) information, quantization step (QP) information, motion vector residual information, and the residual transform coefficients after quantization information. 在所有这些语法元素中,残差系数的信息量及最终编码后形成的数据量都是最多的,同时它也是最占用编码压缩空间的,因此一直以来残差系数的编码问题都是熵编码技术领域的研究重点。 In all of these syntax elements, the amount of information and data formed after the final coded residual coefficients are the largest, but it is also the space occupied by the encoding compression, so the problem has been coded residual coefficients are entropy coding technology Research focus areas.

在此基础上出现了变长编码(VLC, Variable Length Coding)技术,该技术通过zig-zag扫描图像块,以将图像块系数表示成(非零系数前零系数的个数run,非零系数level)的数对形式,并采用一个变长码来编码此(run, level) 数对,该编码技术通常用于对离散余弦变换(DCT)系数进行变长熵编码,典型的二维变长编码技术(2D-VLC)已经得到MPEG-1、 MPEG-2及H.261标准的采纳。 On this basis, there have been variable length coding (VLC, Variable Length Coding) technique to the image as represented by block coefficients zig-zag scanned image blocks (the number of zero coefficients before a nonzero coefficient RUN, nonzero coefficients level) in the form of numbers, and uses a variable length code encoding the number (RUN, level) pair, the coding techniques generally used for the discrete cosine transform (DCT) coefficient variable length entropy coding, a typical two-dimensional variable length coding (2D-VLC) has been MPEG-1, MPEG-2 and H.261 standards adopted.

在随后发展的H.263、 MPEG-4标准中,为提高块结束标记(EOB, End of Block)的编码效率,进而又提出了三维变长编码(3D-VLC)技术,即通过对(last, run, level)数组进行联合编码,其中last表示此系数是否为块内的最型(包括intra块或inter块等)设计更有针对性的VLC码表的方法。 In subsequent development of the H.263, MPEG-4 standard, in order to improve the end of block marker (EOB, End of Block) code efficiency, and also proposed a three-dimensional variable length coding (3D-VLC) technique, i.e. by (last , run, level) jointly encoded array, where the coefficient indicates whether the last most type (including intra blocks or inter blocks, etc.) in the block design targeted method of VLC code tables is more.

其中在H.264/AVC标准中,已经发展了基于图像上下文的变长熵编码技术, 一种典型的技术是将level及run值分别建立上下文分开编码,此技术已被R264标准所采纳;另一种典型的技术是基于2D-VLC的上下文编码技术,其实现的核心是上下文信息的使用及各个码表的切换使用方法。 Wherein in the H.264 / AVC standard has been developed based on the variable length entropy coding technique image context, a typical technique is to run and level values ​​are coded separately establish context, this technique has been adopted standard R264; other a typical technique is based on the context of 2D-VLC coding technique, its implementation is the core switching method using the code table and the respective context information.

在目前的先进音视频编码第7部分一一移动视频(AVS-P7 )中采用了自适应二维VLC熵编码技术,其编码过程要基于在AVS-P7中已被标准化的18个码表,其中这18个码表被分为3类,分别用于intra块亮度系数、inter块亮度系数及色度块系数的编码。 In the current advanced audio and video coding - Part 7 eleven mobile video (AVS-P7) used in the two-dimensional adaptive VLC entropy coding technique to the coding process based on the AVS-P7 has been standardized code table 18, wherein the 18 code table is divided into three categories, each brightness coefficient for encoding the intra block, the block luminance coefficients and chrominance Inter block coefficients. 如图2所示为在AVS-P7中采用的自适应二维VLC 熵编码设计思想示意图,对于一个4x4块的系数,编码的要点描述如下: 2 is a schematic two-dimensional adaptive VLC entropy coding design employed in the AVS-P7, the points for a block of 4x4 coefficients, coded as follows:

扫描后的块系数采用2D-VLC进行编码,即采用(level, run) + EOB的编码方式; Block coefficients scanned using 2D-VLC encoding, i.e. using the (level, run) + EOB coding scheme;

如图2中,设4x4块系数经zig-zag扫描后形成的(level, run)序列为正向顺序,即从低频到高频的顺序为正向顺序,而这里对上述的(level, run)数对进行编码则釆用逆向顺序,在逆向编码过程中,在18个2D-VLC码表之间切换编码,每次根据前一已编码的level值在多个码表间进行码表切换处理, 其中对第一个系数的编码则采用单独的码表; 2, the 4x4 block coefficients provided by the zig-zag scan form (level, run) sequence is in forward order, i.e. from low to high frequency in the order of forward order, and here of the above (level, run ) encodes the number preclude the use of reverse order, in reverse of the encoding process, between 18 2D-VLC code table switching encoder, the code table each time switching between a plurality of code tables according to the preceding level value encoded process, wherein the first coding coefficients of a single code table is used;

编码过程中对所有语法元素可以采用Exp-Golomb码或Hybrid-Golomb码进行编码。 Encoding process may be employed, or Exp-Golomb Code Hybrid-Golomb codes to encode all syntax elements.

但是上述的2D-VLC熵编码技术的编码效率还比较低,有待于进一步提高编码效率,并且这种编码方式在编码过程中需要在18个码表之间进行自适应切换,因此为存储这些码表将占用大量的内存,其切换过程也较为复杂。 However, the above-described 2D-VLC coding efficiency of the entropy encoding technique is relatively low, the coding efficiency to be further improved, and this requires coding adaptively switching between the tables 18 yards in the encoding process, so as to store these codes table takes a lot of memory, the switching process is more complicated.

发明内容 SUMMARY

本发明提出一种变长编解码方法,以进一步提高熵编码的编码效率,同时 The present invention proposes a variable-length encoding and decoding methods, in order to further improve coding efficiency of the entropy coding, while

13编码过程基于更为简单的码表结构,从而降低切换计算的复杂度及减少内存空间的占用。 13 encoding process based on a simpler structure code table, thereby reducing the complexity of the calculations and reduce the occupancy of the switching memory space.

相应的本发明还提出了一种变长编解码器。 Corresponding to the present invention also proposes a variable-length codec.

为解决上述问题,本发明提出的技术方案如下: To solve the above problems, the present invention proposes the following technical solution:

一种变长编码方法,包括步骤:统计当前块中非零系数的个数和幅值大于l的系数个数;将统计得到的非零系数个数编码进码流;将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流;以及将统计得到的幅值大于1的系数个数编码进码流;将当前块中相应非零系数的幅值编码进码流。 A variable-length coding method, comprising the steps of: Statistics nonzero coefficients in the current block number and greater in magnitude than the number of coefficients l; nonzero coefficient number coding statistics obtained feed stream; each current block before nonzero coefficient number encoder and a corresponding symbol of nonzero coefficients zero coefficients into code stream; and greater than the magnitude of the counted number of coefficients into a code stream coded; coding block corresponding to the magnitude of the current non-zero coefficient feed stream.

一种变长解码方法,包括步骤:解码接收到的当前块的非零系数个数;根据解码得到的非零系数个数,在当前块中解码出对应个数的非零系数符号及对应非零系数前零系数的个数;以及解码当前块的幅值大于1的系数个数;根据解码得到的幅值大于1的系数个数,在当前块中解码出对应的非零系数的幅值。 A variable length decoding method, comprising the steps of: decoding the received number of nonzero coefficients of the current block; The number of nonzero coefficients obtained by decoding, decoding the non-zero coefficients in the current block and the corresponding non-corresponding symbol number the number of zero coefficients before zero coefficients; and decoding the current block is larger than the magnitude of the number of coefficients is 1; 1 is greater than the number of coefficients in accordance with a magnitude obtained by decoding, decoding corresponding to the amplitude of non-zero coefficients in the current block .

一种变长编码器,包括:用于统计当前块中非零系数的个数和幅值大于1 的系数个数的单元;用于将统计得到的非零系数个数编码进码流的单元;用于将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的单元;和用于将统计得到的幅值大于1的系数个数编码进码流的单元;用于将当前块中相应非零系数的幅值编码进码流的单元。 A variable-length encoder, comprising: a current block for counting the number of nonzero coefficients and the number of cells is greater than the amplitude coefficient 1; and means for encoding the nonzero coefficient number statistics obtained feed stream ; means for encoding the number of symbols before each nonzero coefficient and a corresponding nonzero coefficients in the current block into zero coefficients unit code stream; and statistics obtained for the greater in magnitude than the coefficient number encoder feed stream 1 units; the magnitude of the nonzero coefficients corresponding coding block for the current section of the intake stream.

一种变长解码器,包括:用于解码接收到的当前块的非零系数个数的单元; 用于根据解码得到的非零系数个数,在当前块中解码出对应个数的非零系数符号及对应非零系数前零系数的个数的单元;和用于解码当前块的幅值大于1的系数个数的单元;用户根据解码得到的幅值大于1的系数个数,在当前块中解码出对应的非零系数的幅值的单元。 A variable length decoder, comprising: a unit number of nonzero coefficients in the current block for decoding received; according to the number of nonzero coefficients decoded, decoded in the current block corresponding to the number of nonzero symbols and the number of units corresponding to the coefficient of zero coefficients before a nonzero coefficient; and means for decoding the current block is larger than the magnitude of the number of coefficients of unit 1; a user is greater than the number of coefficients decoded according to the magnitude of the current decoded block corresponding to the magnitude of the nonzero coefficients of unit.

一种变长编码方法,包括步骤:统计当前块中非零系数的个数;将统计得到的非零系数个数编码进码流;将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流;以及将当前块中相应非零系数的幅值编码进码流;在码流中编码入用于标识非零系数幅值已编码完的块结束标志。 A variable-length coding method, comprising the steps of: count the number of nonzero coefficients in the current block; nonzero coefficient number coding statistics obtained feed stream; each nonzero coefficient and the corresponding symbol of nonzero coefficients in the current block the number of zero coefficients before encoding into the bit stream; and an amplitude of the corresponding coding block nonzero coefficients in the current feed stream; in the code stream into encoded blocks identified amplitude nonzero coefficients have been coded for ending flag. 一种变长解码方法,包括步骤:解码接收到的当前块的非零系数个数;根据解码得到的非零系数个数,在当前块中解码出对应个数的非零系数符号及对应非零系数前零系数的个数;在当前块中解码出对应的非零系数的幅值;以及解码得到用于标识非零系数幅值已编码完的块结束标志。 A variable length decoding method, comprising the steps of: decoding the received number of nonzero coefficients of the current block; The number of nonzero coefficients obtained by decoding, decoding the non-zero coefficients in the current block and the corresponding non-corresponding symbol number the number of zero coefficients before zero coefficients; decoding corresponding to the amplitude of non-zero coefficients in the current block; and a decoded block is used to identify the magnitude of the nonzero coefficients have been coded end flag.

一种变长编码器,包括:用于统计当前块中非零系数个数的单元;用于将统计得到的非零系数个数编码进码流的单元;用于将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的单元;和用于将当前块中相应非零系数的幅值编码进码流的单元;用于在码流中编码入用于标识非零系数幅 A variable length coder, comprising: means for counting the number of nonzero coefficients in the current block; a unit nonzero coefficient number encoder statistically derived feed stream; means for each current block in the non- the number of zero coefficients before encoding symbols corresponding to non-zero coefficients and the zero coefficients feed unit code stream; and an amplitude of the corresponding coding block into current nonzero coefficient unit code stream; means for encoding the bit stream nonzero coefficients is used to identify web

值已编码完的块结束标志的单元。 Value of the unit block end flag have been coded.

一种变长解码器,包括:用于解码接收到的当前块的非零系数个数的单元; 用于根据解码得到的非零系数个数,在.当前块中解码出对应个数的非零系数符号及对应非零系数前零系数个数的单元';用于在当前块中解码出对应的非零系数幅值的单元;和用于解码得到用于标识非零系^:幅值已编码完的块结束标志的单元。 A variable length decoder, comprising: a unit number of nonzero coefficients in the current block is decoded received; means for decoding according to the number of nonzero coefficients obtained in the current block number corresponding to the non-decoded. symbols and zero coefficients corresponding to the number of zero coefficients before a nonzero coefficient unit '; a decoding unit corresponding to the magnitude of the nonzero coefficients in the current block; and for identifying a nonzero coefficient decoded ^: amplitude It has been coded unit block end flag.

一种变长编码方法,包括步骤:统计当前块中幅值大于1的系数个数;将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流;以及在码流中编码入用于标识非零系数符号已编码完的块结束标志;将统计得到的幅值大于1的系数个数编码进码流;将当前块中相应非零系数的幅值编码进码 It becomes a fixed length encoding method, comprising the steps of: the amplitude of the current block count is greater than the number of coefficients is 1; the number of coded symbols before each nonzero coefficient and a corresponding nonzero coefficients in the current block into zero coefficients stream; and in the identification code stream encoded in the symbol of nonzero coefficients have been coded for a block end flag; statistics obtained greater in magnitude than the coefficient number encoder into a bit stream; the magnitude of the nonzero coefficients in the corresponding coding block current enter code

流o Flow o

一种变长解码方法,包括步骤:在当前块中解码出非零系数符号及对应非零系数前零系数的个数;以及在当前块中解码用于标识非零系数符号已编码完的块结束标志;解码当前块中幅值大于1的系数个数;根据解码得到的幅值大于1的系数个数,在当前块中解码出对应的非零系数的幅值。 A variable length decoding method, comprising the steps of: decoding a symbol and the number of nonzero coefficients before a nonzero coefficient corresponding to zero coefficients in the current block; and decoding the current block to identify blocks of non-zero coefficients have been coded symbol end flag; decoding the current block, the coefficient amplitude is greater than the number of 1; 1 is greater than the number of coefficients in accordance with a magnitude obtained by decoding, decoding corresponding to the amplitude of non-zero coefficients in the current block.

一种变长编码器,包括:用于统计当前块中幅值大于1的系数个数的单元; 用于将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的单元;和用于在码流中编码入用于标识非零系数符号已编码完的块结束标志的单元;用于将统计得到的幅值大于1的系数个数编码进码流的单元;用于将当前块中相应非零系数的幅值编码进码流的单元。 A variable length coder, comprising: means for counting the current block number of coefficients with amplitudes greater than 1; for each of the number of uncoded zero coefficients and a corresponding symbol of nonzero coefficients in the current block zero coefficients unit into the code stream; and a code stream encoded in the symbol unit identification nonzero coefficients have been coded for a block end flag; statistics obtained for the amplitude is greater than the coefficient number encoder feed stream 1 units; the magnitude of the nonzero coefficients corresponding coding block for the current section of the intake stream.

一种变长解码器,包括:用于在当前块中解码出非零系数符号及对应非零系数前零系数个数的单元;用于在当前块中解码用于标识非零系数符号已编码完的块结束标志的单元;用于解码当前块中幅值大于1的系数个数的单元;用于根据解码得到的幅值大于1的系数个数,在当前块中解码出对应的非零系数幅值的单元。 A variable length decoder, comprising: means for decoding the number of zero coefficients before a nonzero coefficient and the symbol corresponding to the nonzero coefficients in the current block; in the current block for decoding a symbol for identifying the coded nonzero coefficients After the end flag cell block; a unit for decoding the current block, the number of coefficients with amplitudes greater than 1; a is greater than the number of coefficients decoded according to the magnitude of the current block decoded in a corresponding nonzero amplitude coefficient unit.

一种变长编码方法,包括步骤:将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流;在码流中编码入用于标识非零系数符号已编码完的块结束标志;将相应非零系数的幅值编码进码流;以及在码流中编码入用于标识非零系数幅值已编码完的块结束标志。 Becomes a fixed length encoding method, comprising the steps of: before each nonzero coefficient number encoder and a corresponding symbol of nonzero coefficients in the current block into zero coefficients stream; code stream into encoded symbols for identifying a nonzero coefficients has previously coded block end flag; the magnitude of the nonzero coefficients into a corresponding encoded stream; and a code stream encoded in the identification block nonzero coefficients have been coded amplitude for the end flag.

一种变长解码方法,包括步骤:在当前块中解码出非零系数符号及对应非零系数前零系数的个数;以及解码出用于标识非零系数符号已编码完的块结束标志;在当前块中解码出对应非零系数的幅值;以及解码出用于标识非零系数幅值已编码完的块结束标志。 A variable length decoding method, comprising the steps of: decoding a symbol and the number of nonzero coefficients before a nonzero coefficient corresponding to zero coefficients in the current block; and a decoding block for identifying non-zero coefficients have been coded symbol end flag; decoding the current block corresponding to the amplitude of non-zero coefficients; and decoding blocks for identifying the magnitude of the nonzero coefficients have been coded end flag.

一种变长编码器,包括:用于将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的单元;用于在码流中编码入用于标识非零系数符号已编码完的块结束标志的单元;和用于将相应非零系数的幅值编码进码流的单元;用于在码流中编码入用于标识非零系数幅值已编码完的块结束标志的单元。 A variable-length encoder, comprising: for each nonzero coefficient number encoder symbols and the corresponding zero coefficients before a nonzero coefficient in the current block code stream into units; used in the code for identifying the encoded stream cell block end flag non-zero coefficients have been coded symbols; and means for encoding the amplitude corresponding nonzero coefficient code stream into units; for codestream coding nonzero coefficients into amplitude for identifying coded After the end of the block unit flag.

一种变长解码器,包括:用于在当前块中解码出非零系数符号及对应非零系数前零系数个数的单元;和用于解码出用于标识非零系数符号已编码完的块结束标志的单元;用于在当前块中解码出对应非零系数幅值的单元;用于解码出用于标识非零系数幅值已编码完的块结束标志的单元。 A variable length decoder comprising: a decoding unit corresponding to the nonzero coefficients and the number of symbols of zero coefficients before a nonzero coefficients in the current block; and for decoding a symbol for identifying non-zero coefficients have been coded block end flag unit; means for decoding in the current block corresponding to the magnitude of the nonzero coefficients; means for block decoding means for identifying non-zero amplitude coefficients have been coded end marker.

本发明能够达到的有益效果如下: The present invention can achieve advantageous effects as follows:

本发明技术方案利用图像块经zig-zag扫描后得到的残差系数经过变换和量化后, 一般来说游程run从低频向高频呈逐渐增大状态,而非零系数幅值却是从低频向高频呈逐渐减小状态的数据源统计特性,提出在对每个当前图像块进行VLC编码时,将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流,并将当前块中相应非零系数的幅值编码进码流,因此与现有方案相比,进一步降低了编码码率,节约了编码码流,从而提高了编码效率, 而且本发明方案不再需要在内存中存储现有技术中的18个码表,而是根据情况进行自行设置所需要的码表,因此节约了多个码表所占用的内存空间,并且降低了在编码过程中在多个码表之间进行切换的复杂度。 Residual coefficient aspect of the present invention by using the image block zig-zag scan obtained after transformation and quantization, run generally run was gradually increased from a low state to a high frequency, the amplitude is not zero coefficients from low frequency It was gradually reduced to a state of high frequency data source statistical characteristics, when the proposed VLC encodes each block of the current image, the number of non-zero coefficients in each encoding symbol and the corresponding zero coefficients before a nonzero coefficient in a current block into stream, and the magnitude of the current coded block into the corresponding non-zero coefficient code stream, as compared with the conventional scheme, the coding rate is further reduced, saving the code stream, thereby improving the coding efficiency, but the present invention no longer need to store the program in the memory table 18 yards in the prior art, but rather to set the desired code table according to its own situation, thus saving memory space occupied by the plurality of code tables, the encoding process and reduce the the complex of switching between a plurality of code tables.

附图说明 BRIEF DESCRIPTION

图1为目前AVS ^见频编码器的组成框图; FIG. 1 is a block diagram illustrating the current ^ composition of the AVS see video encoder;

图2为在AVS-P7中采用的自适应二维VLC熵编码设计思想示意图; 图3为对一个4x4图像块进行VLC编码的实施例处理过程。 FIG 2 is a schematic two-dimensional adaptive VLC entropy coding in the design adopted in AVS-P7; Fig 3 an embodiment of the process a 4x4 image block of a VLC code.

具体实施方式 Detailed ways

由上述现有^_术中图2所示的自适应二维VLC熵编码设计思想示意图可以看出,图像块中经zig-zag扫描后得到的残差系数经过变换和量化后, 一般来说游程nm从低频向高频呈逐渐增大状态,而非零系数幅值却是从低频向高频呈逐渐减小状态,因此本发明技术方案充分考虑利用该数据源的统计特性, 来得到一种新的VLC编码方案,从而提高VLC熵编码的编码效率。 ^ _ From the prior two-dimensional adaptive VLC entropy coding technique schematic design shown in Figure 2 can be seen that residual coefficients after the image block zig-zag scan obtained through the above-described transformed and quantized, in general nm was run gradually increased from a low state to a high frequency, the amplitude is not zero coefficients was gradually decreases from the low state to the high frequency, and therefore the technical solution of the present invention fully contemplates the use of the statistical properties of the data source, to obtain a new kinds of VLC coding scheme, to improve the coding efficiency VLC entropy coding.

根据对数据源的统计特性,本发明提出的VLC编码方案的主要设计思想如下: The statistical properties of the data source, the main design VLC coding scheme proposed in the present invention are as follows:

对图像块(如4 x 4图像块)进行zig-zag扫描,得到系数序列;将得到的系数序列中的非零系数进行符号化处理,如将正的非零系数符号化为1,及将负的非零系数符号化为-l; The image block (e.g., 4 x 4 image blocks) for zig-zag scanning to obtain coefficient sequence; the resulting sequence of coefficients in the nonzero coefficients symbolized process, as will be positive non-zero coefficients into one symbol, and the negative sign nonzero coefficient into -l;

对于每个非零系数,编码该非零系数前的零系数个数和该非零系数的符号sign,即对(run, sign)数对进4亍编码; For each non-zero coefficients, the number of zero coefficients and a sign of the sign of non-zero coefficients before encoding the nonzero coefficient, i.e. for (RUN, sign) of the number 4 into encoded right foot;

然后在得到的系凄t^列中,确定各非零系数的幅值(幅值为非零系数的绝对值),并将相应数目的非零系数幅值作为遗留信息分别进行编码。 The resulting system was then t ^ sad column, determining the magnitude of each nonzero coefficient (amplitude absolute value of the nonzero coefficient), and number of nonzero coefficients corresponding to the amplitude information is encoded as a legacy respectively.

例如对于上述图2中的4x4块,首先按zig-zag方式扫描将得到如下系数序列: For example, 4x4 blocks in FIG 2 above, is first scanned by the zig-zag sequence of coefficients obtained as follows:

9, 2, -3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0; 9, 2, -3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0;

编码端首先将扫描得到的系数序列中包含的非零系数个数numCoefl编码进码流,以上述图2中的4x4块为例,编码端需要首先将numCoefl-4编码进码流; Number of nonzero coefficients numCoefl first end comprising a coding sequence of coefficients scanned in the feed stream to 4x4 block in an example in FIG. 2, the encoder will need to feed numCoefl-4 coded bit stream;

对上述扫描得到的系数序列中的非零系数进行符号化处理,将得到下述系数序列: Coefficients obtained in the scanning sequence of non-zero coefficients symbolic processing, the coefficient sequence to obtain the following:

1, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, o., 1, 1, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, o.,

对于每个非零系数,编码该非零系数前的零系数个数和该非零系数的符 For each non-zero coefficients, the number of zero coefficients and non-zero coefficients before encoding the nonzero coefficients Fu

号,如需要分别对(0, + ), (0, + ), (O,-), (5,+ ) 4个数组进行编码; Letter, if any, respectively (0, +), (0, +), (O, -), (5, +) 4 encoded array;

然后在上述扫描得到的系凄Lf列中,确定各非零系数的幅值,具体如下: 9, 2 3 U Then the scanning lines row Lf sad obtained, the amplitude of each non-zero coefficient is determined as follows: 9, 2 3 U

编码端进而将扫描得到的系数序列中包含的幅值大于1的非零系数个数numCoef2编码进码流,以上述图2中的4x4块为例,编码端进而需要将numCoef2 = 3编码进码流; The number of non-zero coefficients in turn numCoef2 terminal coding sequence of coefficients obtained by scanning the amplitude contained in the feed stream is greater than 1, in the above-described FIG. 2 4x4 blocks, for example, the encoder needs to be further encoded into code numCoef2 = 3 flow;

最后将确定的非零系数的幅值作为遗留信息分别进行编码。 Finally, the determined magnitude of the nonzero coefficient is coded separately as legacy information.

另一方面,如果编码端不选择将扫描得到的系数序列中包含的非零系数个数numCoefl编码进码流,可以考虑在对(0, + ), (0, + ), (O,-), (5,+)4个数组编码完成之后,进而编码进码流一个表示当前块中非零系数编码结束的标志EOB1 ,用于标识在当前块中对非零系数符号已经编码完成。 On the other hand, if the encoder does not select the number of nonzero coefficients numCoefl sequence coding coefficients obtained by scanning feed stream contained, to be considered in the (0, +), (0, +), (O, -) , (5 +) then 4-encoded array, thereby encoded into a bit stream that represents the current block ends nonzero coefficient encoding flag EOB1, for identification has already been encoded symbol of nonzero coefficients in the current block.

另一方面,如果编码端不选捧将扫描得到的系数序列中包含的幅值大于1 的非零系数个数numCoef2编码进码流,可以考虑在编码完非零系数的幅值后, Number of nonzero coefficients numCoef2 encoding the other hand, if an encoder is not holding the selected scan amplitude coefficient sequence obtained contains more than one feed stream can be considered in the previously coded non-zero amplitude coefficient,

18进而编码进码流一个表示当前块中幅值大于1的非零系数编码结束的标志 18 further encoded into a codestream indicating the end of the current non-zero coefficient coding block is greater than the amplitude of the flag 1

EOB2,用于标识在当前块中对非零系数幅值已经编码完成。 EOB2, for identification has already been encoded on the magnitude of the nonzero coefficients in the current block.

如图3所示,为"l安照上述方案的设计思想,对一个4x4图像块进行VLC 编码的实施例处理过程,具体如下: As shown, the design of "l security scheme as described above, for a 4x4 image block of Example 3 VLC encoding process embodiment, as follows:

stepl:首先对当前块按zig-zag方式扫描,得到一个系数序列;基于扫描得到的系数序列统计当前块中非零系数个数numCoefl,并将统计得到的numCoefl编码进码流。 stepl: First, the current block is scanned in zig-zag manner, to obtain a sequence of coefficients; statistical number of nonzero coefficients in the current block numCoefl sequence of scanned coefficients based on the statistics obtained numCoefl and encoded into the code stream.

如果在stepl处理前,能够得到关于该当前块所有系数是否为全零的标记, 则可以判断出当前块的numCoefl —定大于0,即至少存在一个非零系数,这种情况下就需要继续执行下述的step2;否则如果不能够得到关于该当前块所有系数是否为全零的标记,则可以判断出当前块的numCoefl有可能是零,当numCoefl为零时,可以直接结束当前块的熵编码处理。 If the stepl before treatment, with respect to the current block can be obtained if all coefficients of all zeros is labeled, it can be judged that the current block numCoefl - constant greater than 0, i.e., there is at least one nonzero coefficient, it is necessary to continue this case Step2 below; if otherwise not be obtained with respect to the current block whether all coefficients all zero marks, it can be judged that the current block numCoefl there may be zero, when numCoefl is zero, the end may be directly entropy encoding the current block deal with.

step2:开始对当前块中的各系数进行编码,分别对当前块中的各非零系数符号和非零系数前零系数的个数进行编码。 step2: Start of each coefficient in the current block is encoded, respectively, the number of non-zero coefficients before each nonzero coefficient sign and zero coefficients in the current block is encoded.

setp 3:编码当前块中幅值大于1的系数个数numCoef2。 setp 3: encoding of the current amplitude is greater than the number of coefficients in block 1 of numCoef2. step4:判断当前块中幅值大于1的系数个数numCoef2是否为零,如果为零,则直4妄结束当前块的熵编码;否则编码当前块中相应非零系数的幅值。 step4: determining the magnitude of the current block is larger than the number of coefficients numCoef2 1 is zero, if zero, jump to the end of the 4 linear entropy encoding the current block; otherwise, the magnitude of the current block corresponding coded non-zero coefficients. 此外在另一个实施例中,对一个4x4图像块进行VLC编码的处理过程如 Further, in another process embodiment, a 4x4 image block of the VLC coded as

下: under:

Step2:首先对当前块按zig-zag方式扫描,得到一个系凄t^列;开始对当前块中的各系数进行编码,分别对当前块中的各非零系数符号和非零系数前零系数的个数进行编码;然后接着编码进码流一个EOB标志(这里定义为EOB1); Step2: firstly the current block by way of zig-zag scanning, a column-based sad t ^; each start coefficient of a current block is encoded, respectively, before each nonzero coefficient symbols and non-zero coefficients in a current block zero coefficients number of encoding; and then subsequently coded into a code stream EOB flag (defined here as EOB1);

Step4:编码当前块中相应非零系数的幅值;然后接着编码进码流一个EOB 标志(这里定义为EOB2)。 Step4: the amplitude of the current block corresponding coding nonzero coefficients; and then subsequently coded into a code stream EOB flag (as defined herein EOB2).

其中在上述的实施例处理过程中,对于stepl中的编码当前块中非零系数个数numCoefl的编码方式可以但不限于采用下述两种方式: Wherein in the above process embodiments, the encoding for stepl current block number numCoefl encoding the nonzero coefficients may be, but it is not limited to using the following two ways:

方式一,无论当前块是亮度块,色度块,还是帧内编码块还是非帧内编码块都统一按照截断的Golomb编码方法编码当前4x4块中非零系数个数numCoefl ( l<=numCoefl<=16 ),即按照下表1编码numCoefl: A way, regardless of the current block is a luminance block, chroma blocks or intra-coded block or a non-intra-coded block are unified coding method according to Golomb encoding a truncated number of nonzero coefficients in the current block numCoefl 4x4 (l <= numCoefl < = 16), i.e., according to table 1 coding numCoefl:

表1: numCoefl编码码表 Table 1: numCoefl encoded code table

值 码字 The codeword

0 0 00

1 10 110

2 110 2110

3 1110 31110

4 11110 411 110

miio miio

6 1111110 61,111,110

7 imiiio 7 imiiio

8 imuiio 8 imuiio

9 imiiiiio 9 imiiiiio

10 iimmiio 10 iimmiio

11 iiiimimo 11 iiiimimo

12 mimiiiiio 12 mimiiiiio

13 mmmiiiio 13 mmmiiiio

14 mimimmo 14 mimimmo

15 imiiimmii 15 imiiimmii

方式二,如果当前4x4块是图像条带的第一个4x4块,或者它的相邻块所在的宏块是skip宏块,或者它的相邻块是全零块,则直接根据上述方式一中表1给出的码表来编码当前块中的非零系数个数numCoefl;如果当前块不能同时满足上述条件,则需要根据当前4x4块的非零系数个数numCoefl预测值来编码numCoefl ,其具体的编码过程如下: Second approach, if the current 4x4 block is a 4x4 block of the first image slice, macroblock or block is located adjacent to it is the skip macroblock, or its neighboring blocks are all zero block, in accordance with the above-described embodiment is a direct table 1 shows the code table to encode the number of non-zero coefficients in a current block numCoefl; if the current block does not satisfy the above conditions, it is necessary to encode the current numCoefl numCoefl number of nonzero coefficients 4x4 prediction block, which specific encoding process as follows:

Substepl,按照下述不同情况生成当前4 x 4块的不同numCoefl预测值; Substepl, generating a 4 x different numCoefl current prediction value according to the following four different cases;

(1) 如果当前4x4块的左边块和上边块均可用,假设左边块的非零系数个数为left—numCoefl,上边块的为top—numCoefl,则当前块的非零系数个数numCoefl预测值predNumCoefl= (left—numCoefl + top—numCoefl) /2; (1) If the left block of the current block and the upper block 4x4 can be used, assuming that the number of nonzero coefficients in the left block is a left-numCoefl, is a top-numCoefl upper block, the current block number of the nonzero coefficient prediction value numCoefl predNumCoefl = (left-numCoefl + top-numCoefl) / 2;

(2) 如杲当前4x4块只有左边块可用,则numCoefl预测值=left—numCoefl; (2) If the current 4x4 block Gao only the left block is available, then the prediction numCoefl = left-numCoefl value;

20(3 )如果当前4x4块只有上边块可用,则numCoefl预测值predNumCoefHop—numCoefl; 20 (3) only if the current 4x4 block is an upper block is available, then the prediction value numCoefl predNumCoefHop-numCoefl;

Substep2,根据当前4 x 4块的numCoefl预测值,再按照下述3种情况编码当前4 x 4块的numCoefl: Substep2, numCoefl predicted value based on the current 4 x 4 block, and then encoded according to the following three cases the current numCoefl 4 x 4 block:

(1) 如果当前4x4块所在的宏块是intra类型块,且当前4x4块的predNumCoefl满足5<= predNumCoefl<=12,则先把当前4x4块的非零系数个数NumCoefl按照一个预定的映射表映射出一个对应的值,然后基于上述方式一中表1给出的码表来编码该映射值;否则直接基于上述方式一中表1给出的码表来编码当前4 x 4块的非零系数个数NumCoefl 。 (1) If the current macroblock is the intra 4x4 blocks where block type, and the current predNumCoefl 4x4 block satisfies 5 <= predNumCoefl <= 12, the first current nonzero coefficient number NumCoefl 4x4 block according to a predetermined mapping table mapping out a corresponding value, and then the above-described manner based on a code table given in table 1 by encoding the mapped values; otherwise, the above-described manner is directly based on a code table table 1 gives the current nonzero encoded 4 x 4 blocks the number of coefficients NumCoefl. 其中这里的映射表可根振具体实施情况进行具体设定。 Wherein the mapping table where vibration may be root specific implementation specific setting.

(2) 如果当前4x4块所在的宏块是inter类型块,且当前4 x 4块的predNumCoefl满足2<= predNumCoefl<=9,则先4巴当前4x4块的非零系数个数NumCoefl按照一个预定的映射表映射出一个对应的值,然后基于上述方式一中表1给出的码表来编码该映射值;否则直接基于上述方式一中表1给出的码表来编码当前4 x 4块的非零系数个数NumCoefl。 (2) If the current macroblock is inter 4x4 blocks where block type, and the current block of 4 x predNumCoefl 4 satisfies 2 <= predNumCoefl <= 9, the first bar 4 NumCoefl 4x4 current block number of non-zero coefficients according to a predetermined mapping table mapping a corresponding value, and then based on the above-described embodiment a code table given in table 1 by encoding the mapped values; otherwise, the above-described manner based on a code table given in table 1 is encoded direct current 4 x 4 block the number of non-zero coefficients NumCoefl. 其中这里的映射表可根据具体实施情况进行具体设定。 Wherein the mapping table herein can be specifically set according to the specific implementation.

(3 )如果当前4 x 4块是色度块,则直接基于上述表1给出的码表来编码当前4 x 4块的非零系数个数NumCoefl 。 (3) If the current block is a 4 x chrominance block. 4, directly on the code table given in Table 1 to encode the current non-zero coefficient number 4 x NumCoefl 4 blocks.

在上述实施例的Step2中,编码端可以但不限于采用下述两种方式来编码当前块中各非零系数的符号(sign)和相应非零系数前的零系数个数: Step2 In the above-described embodiments, but is not limited to the encoder may use the following two ways encoding symbols (Sign) of each non-zero coefficients in the current block and a corresponding number of zero coefficients before a nonzero coefficient:

方式一:按照从低频到高频的zig-zag方式扫描当前4 x 4块,得到当前4 x4块的系数序列,确定扫描得到的系数序列中非零系数符号sign及它前面的零系数个数runl,然后按照下述映射方法分别将各个runl和sign数组映射成一个符号sym2D: One way: from low to high in accordance with zig-zag scans the current 4 x 4 block, the current coefficient sequence to give 4 x4 block, determining a sequence number of zero coefficients scanned in the coefficient of non-zero coefficients preceding it and sign SIGN runl, and then mapped according to the following methods, respectively, and each sign RunL arrays mapped to one symbol sym2D:

在一帧图像或一个图像条带开始时,首先初始化一个计数数组giSign[2], 在对每个图像块进行zig-zag扫描过程中,每遇到一个正号的非零系数时,giSign[O]加l,而每遇到一个负号的非零系数时,giSign[l]加l,其中giSign[O〗 和giSign[l]是计数数组giSign口]中的两个元素值。 When an image or an image strip when the tape is started, first initializes a count array giSign [2], the zig-zag scan performed for each image block the process, when confronted with a positive sign of the nonzero coefficient, giSign [ two element values ​​O] was added l, but when confronted with a negative sign of the nonzero coefficient, giSign [l] was added l, wherein giSign [O〗 and giSign [l] is a count array giSign port] in.

这样当giSign[0]〉-giSign[l]时,sym2D=2 x mnl+ (level[yy][xx]>0 ) ?0:1; 其中该式中level[yy][xx]表示在当前块中坐标为(xx,yy )的非零系数, (level[yy〗[xx〗>0 ) ?0:1 表示当level[yy][xx]>0 条件成立时, (level[yy][xx]〉0 ) ?0:1直接取0,否则当level[yy][xx]>0条件不成立时, (level[yy][xx]>0) ?0:1直接1。 So that when giSign [0]> - when giSign [l], sym2D = 2 x mnl + (level [yy] [xx]> 0) 0:? 1; in the formula, level [yy] [xx] is shown in the current block nonzero coefficients with coordinates (xx, yy) is, (level [yy〗 [xx〗> 0)? 0: 1 means that when the level [yy] [xx]> 0 condition is satisfied, (level [yy] [xx ]> 0)? 0: 1 0 direct access, or when the level [yy] [xx]> 0 condition is not satisfied, (level [yy] [xx]> 0)? 0: 1 direct 1.

而当giSign[0]〈giSign[l]时,sym2D=2 x runl+ (level[yy][xx]>0) ?1:0; 即(level[yy][xx]>0 ) ?1:0表示当level[yy][xx]〉0条件成立时, (level[yy][xx]>0) ?l:O直接取l,否则(level[yy][xx]〉0) ?0:1直接O。 When giSign [0] <When giSign [l], sym2D = 2 x runl + (level [yy] [xx]> 0) 1: 0; i.e. (level [yy] [xx]> 0) 1:? 0? means that when level [yy] [xx]> 0 condition is satisfied, (level [yy] [xx]> 0) l:?? O direct access to l, otherwise (level [yy] [xx]> 0) 0: 1 direct O.

同时当该计数数组giSign[2]中的元素之和超过一个规定的阈值时,就要更新一下该计数数组giSign[2],例如当giSign[0]+giSign[l]>212时,可以将更新giSign[O]- giSign[0]/24,并更新giSign[l]= giSign[1]/24。 Meanwhile, when giSign the count array element of [2], and more than one predetermined threshold value, it is necessary to update at the count array giSign [2], for example, when giSign [0] + giSign [l]> 212, it is possible to update giSign [O] - giSign [0] / 24, and updates the giSign [l] = giSign [1] / 24.

然后按照截断的Golomb编码方式分别对每个映射得到的符号sym2D进行编码,其中对每个符号sym2D进行编码的伪代码如下: Then according to Golomb encoding truncated separately encoding each symbol mapping sym2D obtained, wherein the pseudo code for encoding each symbol sym2D follows:

For(idx-O; sym2D>=idx&&idx<(16-numCoefl-codedRun) x 2+1; idx++) For (idx-O; sym2D> = idx && idx <(16-numCoefl-codedRun) x 2 + 1; idx ++)

Setflag(sym2D〉idx); Setflag (sym2D> idx);

其中在上述伪代码中,idx用于计数,codedRun表示当前块中已编码的零系数个数;函数Setflag表示当sym2D〉idx条件成立时,在码流中编入l,否则在码流中编入0。 Wherein in the above pseudo code, for counting idx, codedRun represents the number of zero coefficients in the current block is encoded; represents Setflag function when sym2D> idx condition is satisfied when, in the bitstream incorporated L, or in the bitstream encoding enter 0. '按照上述编码过程直至将当前块的NumCoefl个非零系数全部编码完成。 'According to the above process until the coding nonzero coefficients NumCoefl entire coding the current block is completed.

方式二:按照zig-zag方式正向扫描当前块,当遇到第一个非零系数时, 编码该非零系数前的零系数个数runi和该非零系数的符号sign,其中在编码runl时,先判断当前块所在的宏块是亮度块还是色度块,在判断结果是亮度块 Second way: zig-zag manner in accordance with the forward scan of the current block, when encountering the first non-zero coefficients, the number of encoded symbols sign runi zero coefficients and the zero coefficients preceding the nonzero coefficient, wherein the encoding runl when first determine where the macroblock of the current block is a luminance or chrominance block of the block, the block is a luminance determination result

22时还要进而判断当前块所在的宏块是帧内编码块还是帧间编码块,从而根据判断结果选择不同的码表,例如可以在判断结果为当前块所在的宏块是帧内亮度 22 further determines also located macroblock of the current block is an intra block or an inter-coded coding block, select a different code table based on the determination result, for example, the determination result is located macroblock of the current block is an intra luminance

块时,选择预置的码表a;在判断结果为当前块所在的宏块是帧间亮度块时, 选择预置的码表b;在判断结果为当前块所在的宏块是色度块时,选择预置的码表c,然后再根据所选择的码表编码runl,其中预置的码表a、 b、 c可根据具体实施情况进行具体设定;接着在编码sign时,当sign值大于0时在码流中编码进0,当sign值小于0时在码流中编码进1。 When the block, the preset code table selecting a; result of determination is where the current macroblock is an inter block is a luminance block, select a preset code table B; the determination result of the current macro block where a block is a chrominance block when selecting the preset code table C, and then encoded in accordance with code table runl selected, the preset code table in which a, b, c can be specifically set according to the specific implementation; followed in coding the sign, when the sign value greater than 0 when the code stream coded into 0, if the sign value is less than the encoded bit stream into 10:00. 在后续扫描过程中,每遇到一个非零系数,就按照当前块的非零系数个数NumCoefl、前一个已编码的runl值选择一个预置的码表,并基于选择的码表编码当前遇到的非零系数前面的零系数个数nml值,然后接着编码当前遇到的非零系数的符号sign,当sign 值大于0时在码流中编码进0,当sign值小于O时在码流中编码进l。 In the subsequent scanning process, when confronted with a non-zero coefficient, according to the number of non-zero coefficients NumCoefl current block, the previous encoded value selection runl a preset code table, and in case the currently selected code table based coding to zero coefficients preceding a nonzero coefficient value nml number, and then encode the current symbol sign non-zero coefficients encountered when the sign value is greater than 0 in the code stream into 0, when the sign value is smaller than a code O stream into encoded l. 按照上述编码过程直至将当前块的NumCoefl个非零系数全部编码完成。 NumCoefl nonzero coefficients until all of the current block-encoded in the above encoding process.

在上述的实施例step3中,编码端可以但不限于采用下述两种方式来编码当前块中幅值大于1的非零系数个数NumCoef2: In the above embodiment step3 embodiment, the encoder may use, but is not limited to the following two ways to encode the current block is larger than the number of non-zero amplitude coefficient is NumCoef2:

方式一:统计基于zig-zag方式扫描当前4 x 4块而得到的系数序列中包含的幅值大于1的非零系数个数NumCoef2,然后按照截断的Golomb编码方式编码NumCoef2,其中对NumCoef2进行编码的伪代码如下: One way: Statistics zig-zag manner on the magnitude of the current coefficient sequence scan 4 x 4 blocks obtained contained greater than the number of nonzero coefficients NumCoef2 1, and then encoded according to Golomb encoding truncated NumCoef2, wherein the encoding of NumCoef2 the pseudo-code as follows:

For(idx=0; NumCoef2>=idx&&idx<NumCoef 1; idx++) For (idx = 0; NumCoef2> = idx && idx <NumCoef 1; idx ++)

Setflag(NumCoef2〉idx); Setflag (NumCoef2> idx);

其中函数Setflag表示当NumCoeOidx条件成立时,在码流中编入l,否则在码流中编入0。 Wherein the function represents Setflag NumCoeOidx condition is satisfied when, in the bitstream incorporated L, or incorporated in the bitstream 0.

方式二',若当前4x4块是图像条带或图像的第一个块时,可以根据当前块所在的宏块类型、QP值、以及NumCoefl中的至少一个属性值选择一个预置的码表,并基于选择的码表来编码NumCoef2,其中预置的码表可根据具体实施情况进行具体设定。 Second way ', if the current 4x4 block is the first block of the image or image strip, the macro-block type according to a current block is located, the QP value and at least one attribute value of the selected code table NumCoefl a preset, and based on the selected code table is encoded NumCoef2, wherein the preset code table can be specifically set according to the specific implementation. 若当前4x4块不是图像条带或图像的第一个块时, 需要根据当前块的相邻左块和相邻上块的NumCoef2来选择一个预置的码表, If the current 4x4 block is not the first image slice or block of the image, it is necessary to select a code table according to a preset left neighboring blocks of the current block and adjacent blocks NumCoef2,

并基于选择的码表来编码当前块的NumCoef2,同理这个预置的码表也可以根据具体实施情况进行具体设定。 And based on the selected code table to encode the current block NumCoef2, empathy the preset code table can also be specifically set according to the specific implementation.

在上述的实施例step4中,编码端可以但不限于采用下述两种方式来编码当前块中各个非零系数的幅值: In the above embodiment step4, the encoder may use, but is not limited to the following two ways to encode the amplitude of each current nonzero coefficients in the block:

方式一:按照zig-zag方式逆向扫描当前块,当遇到第一个幅值大于1的非零系数时,设其幅值为sym,按照下述伪代码编码该幅值sym: One way: zig-zag manner in accordance with reverse scan current block, when encountering the first non-zero amplitude coefficient is greater than 1, the amplitude is set sym, according to the following pseudo-code that encodes the amplitude sym:

Sym=sym-1; Sym = sym-1;

For(idx=l; idx《sym; idx++) Setflag(sym>idx); For (idx = l; idx "sym; idx ++) Setflag (sym> idx);

其中函数Setflag表示当sym〉idx条件成立时,在码流中编入l,否则在码流中编入0。 Wherein the function represents Setflag when sym> idx condition is satisfied when, in the bitstream incorporated L, or incorporated in the bitstream 0. 继续逆向扫描当前块,在后续每遇到一个非零系数时,按照以下伪代码编码其幅值sym,直到将当前块中所有的非零系数幅值均编码完成: Continue reverse scan current block, when confronted with a subsequent non-zero coefficients, coded according to the following pseudo-code sym amplitude, until all the nonzero coefficients are coded in the amplitude of the current block is completed:

For(idx=l; idx<=sym; idx++) For (idx = l; idx <= sym; idx ++)

Setflag(sym>idx); Setflag (sym> idx);

其中函数Setflag表示当synP"idx条件成立时,在码流中编入l,否则在码流中编入O。 Wherein when the function Setflag represents synP "idx condition is satisfied, the bitstream incorporated L, or incorporated in the bitstream O.

方式二:按照zig-zag方式逆向扫描当前块,当遇到第一个幅值大于1的非零系数时,编码该系数的幅值信息、和在该系数前面的幅值等于1的系数个数run2,假设该幅值大于1的非零系数值为level,则在对该非零系数的幅值进行编码时对level2=|level|4进行编码处理。 Second way: zig-zag manner in accordance with the reverse scan current block, when encountering the first non-zero amplitude coefficient is greater than 1, the amplitude information coefficient is encoded, and is equal to the coefficient a 1 in front of the amplitude coefficient number run2, assuming non-zero amplitude coefficient is greater than 1 level, while the pair level2 = the magnitude of the nonzero coefficients are coded | level | 4 encoding process. 编码当前块的第一个幅值大于1的非零系数之前,根据当前块所在宏块的类型选择一个预置的码表,然后基于选择的码表对level2和run2进行编码;扫描到第二个幅值大于1的非零系数,根据前一已编码的level2选择一个预置的码表,并基于选择的码表编码当前非零系数的level2和run2;以后扫描到每个幅值大于1的非零系数时,均按照上述处理过程进行编码,直至将当前块中所有的幅值大于1的非零系数幅值均编码完成。 Before the first encoding of the current block is larger than the magnitude of the nonzero coefficient of a current block is located according to the type of code table selecting a preset macro block, and then encoded level2 run2 based on the selected code table; Scan to a second nonzero coefficients amplitudes greater than 1, a preset code table according to the previous encoded level2 selected, and the selected code table based level2 encoding of the current nonzero coefficient and RUN2; to each subsequent scan amplitude is greater than 1 when the non-zero coefficients are encoded according to the above process, the current block until all the greater in magnitude than the magnitude of a nonzero coefficients are coded complete.

对应于上述编码端进行VLC编码的实施例处理过程,解码端进行相应解码处理的实施例可以分为四种情况,下面分别介绍: 第一解码实施例: Example corresponds process, VLC decoder to encode the encoding side to the decoding process for the respective embodiments can be divided into four cases, the following were introduced: first decoding Example:

Stepl0:解码端解码接收到的当前块中非零系数个数numCoefl; Stepl0: decoder decodes the received number of nonzero coefficients in the current block numCoefl;

Stepll:进而分别解码当前块中numCoefl个非零系数符号,及其每个非零系数前零系数的个数;按照解码结果,将零系数和非零系数符号按顺序组成系数序列写入到当前图像块数据中; Stepll: Further decoded separately, and the number of zero coefficients before each non-zero coefficients in the current block numCoefl nonzero coefficients symbols; in accordance with the result of decoding the symbols of zero coefficients and non-zero coefficients sequentially written to the current coefficient sequence composed of the image data block;

Stepl2:解码当前块中幅值大于1的非零系数个数numCoef2; Stepl2: decoding the current block is larger than the number of non-zero amplitude coefficient is numCoef2;

Stepl3:若解码得到numCoef2为零,则可以直接结束当前块的解码处理, 否则在接收到的当前块中分别解码相应非零系数的幅值,然后将其对应的写入到当前图像数据块中的相应非零系数符号位上,从而完成解码端的解码处理。 Stepl3: If the decoded numCoef2 zero, then the process directly ends the decoding of the current block, or decoding in the respective magnitude of the nonzero coefficients in the current block received, respectively, then the corresponding image data written to the current block non-zero coefficients on the respective symbol bits, thereby completing the decoding process the decoding end.

第二解码实施例: Second decoding Example:

Step20:解码端解码接收到的当前块中各个非零系数符夸,及其每个非零系数前零系数的个数;按照解码结果,将零系数和非零系数符号按顺序组成系数序列写入到当前图像块数据中; Step20: decoder decodes the current block in each of the received symbols boast nonzero coefficient, and the number of zero coefficients before each non-zero coefficients; in accordance with the decoding result, the coefficient of zero coefficients and non-zero coefficient sequence composed of symbols in order to write into the current image block data;

Step21:然后根据解码到的用于标识非零系数符号已编码完的块结束标志EOB1;进而解码当前块中相应非零系数的幅值,然后将其对应的写入到当前图像数据块中的相应非零系数符号位上,最后根据解码到的用于标识非零系数幅值已编码完的块结束标志EOB2,开始下一块的解码处理。 Step21: The decoding is then used to identify the block of non-zero coefficients have been coded symbol end flag EOB1; further decoding the current block corresponding to the amplitude of non-zero coefficients, then the corresponding image data is written to the current block nonzero coefficients corresponding sign bit, and end flag according to the decoding block to which EOB2 for identifying the magnitude of the nonzero coefficients have been coded, at the start of a decoding process.

第三解码实施例: Third decoding Example:

Step30:解码端解码接收到的当前块中非零系数个数numCoefl; Step30: decoder decodes the received number of nonzero coefficients in the current block numCoefl;

25Step31:进而分别解码当前块中numCoefl个非零系数符号,及其每个非零系数前零系数的个数;按照解码结杲,将零系数和非零系数符号按顺序组成系数序列写入到当前图像块数据中; 25Step31: Further decoded separately, and the number of zero coefficients before each non-zero coefficients in the current block numCoefl nonzero coefficients symbols; decoding result according to Gao, zero coefficients and non-zero coefficients symbols sequentially written into the coefficient sequences consisting of current image block data;

Step32:解码端在接收到的当前块中分别解码相应非零系数的幅值,然后将其对应的写入到当前图像数据块中的相应非零系数符号位上,最后根据解码到的用于标识非零系数幅值已编码完的块结束标志EOB2,开始下一块的解码处理。 Step32: decoding end receiving the current block are decoded corresponding to the magnitude of the nonzero coefficients, and then written into the corresponding non-zero coefficients corresponding to the symbol bit image data of the current block, and finally for decoding according to identifying the amplitude of the nonzero coefficients have been coded block end flag EOB2, at the start of a decoding process.

第四解码实施例: Fourth decoding Example:

Step40:解码端解码接收到的当前块中各个非零系数符号,及其每个非零系数前零系数的个数;按照解码结果,将零系数和非零系数符号按顺序组成系数序列写入到当前图像块数据中; Step40: a decoding of the decoder, and the number of zero coefficients before each non-zero coefficient for each symbol of nonzero coefficients in the current block received; in accordance with the decoding result, the coefficient of zero coefficients and non-zero coefficient sequence composed of symbols written sequentially the current image block data;

Step41:然后根据解码到的用于标识非零系数符号已编码完的块结束标志EOB1,进而解码当前块中幅值大于1的非零系数个数numCoef2; Step41: The decoding is then used to identify the block of non-zero coefficients have been coded symbol end flag EOB1, and further decoding the current block is larger than the number of nonzero coefficients in the magnitude of 1 numCoef2;

Step42:若解码得到numCoef2为零,则可以直接结束当前块的解码处理, 否则在接收到的当前块中分别解码相应非零系数的幅值,然后将其对应的写入到当前图像数据块中的相应非零系数符号位上,从而完成解码端的解码处理。 Step42: If the decoded numCoef2 zero, then the process directly ends the decoding of the current block, or decoding in the respective magnitude of the nonzero coefficients in the current block received, respectively, then the corresponding image data written to the current block non-zero coefficients on the respective symbol bits, thereby completing the decoding process the decoding end. 在上述对当前块进行VLC编码的实施例处理过程中,对于stepl、 step2、 step3和step4中任意一个步骤所给出的两种处理方式,可以进行任意组合从而完成本发明VLC编码的实施例处理过程,这样基于上述的各个处理方式,可以组合出16种VLC编码的实施例,当然本发明技术思想并不局限于这里所给出的16种实施方式,还可以根据设计思想扩展更多的实施过程。 In the above-described embodiment, the process VLC encoding the current block, the two treatments for stepl, step2, step3 step4, and any one of the steps presented may be accomplished in any combination of the VLC encoding process embodiment of the present invention, process, so that each of the above approach can be combined VLC encoder 16 kinds of embodiments, of course, the technical idea of ​​the present invention is not limited to the 16 kinds of embodiments set forth herein can be extended further embodiment according to the design process.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。 Obviously, those skilled in the art can make various modifications and variations to the invention without departing from the spirit and scope of the invention. 这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。 Thus, if these modifications and variations of the present invention fall within the claims of the invention and the scope of equivalents thereof, the present invention intends to include these modifications and variations.

Claims (38)

1、一种变长编码方法,其特征在于,包括步骤: 统计当前块中非零系数的个数和幅值大于1的系数个数; 将统计得到的非零系数个数编码进码流; 将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流;以及将统计得到的幅值大于1的系数个数编码进码流; 将当前块中相应非零系数的幅值编码进码流。 1, a variable-length encoding method comprising the steps of: Statistics nonzero coefficients in the current block number and the number is greater than the amplitude coefficient 1; nonzero coefficient number coding statistics obtained feed stream; the number encoder before each nonzero coefficient of a current block and symbols corresponding to non-zero coefficients into zero coefficients streams; coefficient number encoder and statistics obtained greater in magnitude than the feed stream 1; corresponding to the current block in the non- zero amplitude coefficients into coded stream.
2、 如权利要求1所述的方法,其特征在于,采用截断的Golomb编码方式将当前块中的非零系^t个数编码进码流。 2. The method as claimed in claim 1, wherein the encoding using the Golomb truncated nonzero coefficient in the current block number is encoded into the code ^ t stream.
3、 如权利要求1所述的方法,其特征在于,根据当前块的类型及其当前块非零系数个数的预测值将当前块中的非零系数个数编码进码流。 3. The method as claimed in claim 1, characterized in that, depending on the type of the current block of the current block and the predicted value of the number of non-zero number of nonzero coefficients in the current block coefficient encoding into code stream.
4、 如权利要求1所述的方法,其特征在于,所述将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的过程具体包括:分别将当前块中的每个非零系数符号和该非零系数前零系数的个数映射成对应符号;,采用截断的Golomb编码方式将映射后的符号编码进码流。 4. The method of claim 1, wherein the number of the encoded symbols before each nonzero coefficient and a corresponding nonzero coefficients in the current block into zero coefficients the process stream comprises: a current, respectively, the number of each non-zero coefficient and the previous symbol block of the nonzero coefficient zero coefficients mapped to the corresponding symbol; using Golomb encoding truncated symbols mapped into the encoded bit stream.
5、 如权利要求4所述的方法,其特征在于,所述将非零系数符号和该非零系数前零系数的个数映射成对应符号的过程具体包括:在扫描到每个非零系数时,判断已扫描到的非零系数中正数个数和负数个数的关系;以及在正数个数大于等于负数个数时,若当前扫描到的非零系数是正数,则基于求取的当前扫描到的非零系数前零系数的个数二倍与0的和作为映射后的符号;若当前扫描到的非零系数是负数,则基于求取的当前扫描到的非零系数前零系数的个数二倍与1的和作为映射后的符号;在正数个数小于负数个数时,若当前扫描到的非零系数是正数,则基于求取的当前扫描到的非零系数前零系数的个数二倍与1的和作为映射后的符号;若当前扫描到的非零系数是负数,则基于求取的当前扫描到的非零系数前零系数的个数二倍与0的和作为映射后的符号。 Process 5 A method as claimed in claim 4, wherein said mapping the symbol and the number of nonzero coefficients before the non-zero coefficients into zero coefficients corresponding symbol comprises: scanning to each nonzero coefficient when the relationship is determined to have been scanned, the number of nonzero coefficients and the number of CKS negative number; and upon positive number greater than or equal negative number, if the current scan to the nonzero coefficient is positive, based on ascertained twice the number of the current scan to the zero coefficients before a nonzero coefficient of the mapped symbol and a 0; if the current scan to the nonzero coefficient is negative, nonzero coefficients is obtained based on a current scan to zero before twice the number of coefficients and as a mapped symbol; positive number when the number is less than the negative, if the current scan to the nonzero coefficient is positive, nonzero coefficients ascertained based on the current scan to twice the number of zero coefficients before and after a symbol mapping 1; if the current scan to twice the number of nonzero coefficients is negative, then the current scan based on the previous strike to zero coefficients and non-zero coefficient 0, and as the mapped symbol.
6、 如权利要求l所述的方法,其特征在于,所述将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的过程具体包括:基于zig-zag方式正向扫描当前块,在扫描到第一个非零系数时,编码该扫描到的非零系数前零系数的个数以及该非零系数的符号;后续在每次扫描到一个非零系数时,基于当前块非零系数的个数、前一已编码的非零系数前零系数的个数,来编码当前扫描到的非零系数前零系数的个数,并进而编码当前扫描到的非零系数的符号。 6. A method as claimed in claim l, wherein the number of the encoded symbols before each nonzero coefficient and a corresponding nonzero coefficients in the current block into zero coefficients the process stream comprises: based zig- forward scan a current block zag manner, upon scanning the first nonzero coefficient, encoding the scanned number of zero coefficients before a nonzero coefficient and a symbol of the non-zero coefficients; subsequent to a non-zero during each scan when the coefficients of the current block based on the number of number of non-zero coefficients before a nonzero coefficient before the zero coefficients has been encoded, to encode the number of zero coefficients before a nonzero coefficient to the current scan, and thus to encode the current scan symbol nonzero coefficients.
7、 如权利要求1所述的方法,其特征在于,采用截断的Golomb编码方式将当前块中的幅值大于1的系数个数编码进码流。 7. The method as claimed in claim 1, characterized in that a truncated Golomb coding manner is greater than the magnitude of the current block number of the coefficients into a code stream.
8、 如权利要求1所述的方法,其特征在于,所述将当前块中的幅值大于1的系数个数编码进码流的过程具体包括:判断当前块是否为条带或图像中的第一个块;以及在当前块是第一个块时,根据当前块的属性信息将当前块中幅值大于1的系数个数编码进码流;在当前块不是第一个块时,根据当前块的相邻左块和相邻上块的幅值大于1的系数个数信息将当前块中幅值大于1的系数个数编码进码流。 8. A method as claimed in claim 1, wherein the magnitude of the current block is larger than a coefficient number encoder process feed stream 1 comprises: determining whether the current block or slice image a first block; feed stream and the current block is the first block, the attribute information of the current block in the current block is greater than the magnitude of the coefficient number encoder 1; and when the current block is not the first block, in accordance with adjacent left block of the current block and the neighboring block is larger than the magnitude of the number of coefficients in the current block information in a magnitude greater than the coefficient number encoder into a bit stream.
9、 如权利要求8所述的方法,其特征在于,所述当前块的属性信息为:当前块所在宏块的类型信息;或当前块的量化步长值信息;或当前块的非零系数个数信息。 9. The method according to claim 8, wherein the attribute information of the current block is: type information of the current block is located macroblock; or quantization step size value information of a current block; or the current non-zero coefficient block The number of information.
10、 如权利要求l所述的方法,其特征在于,所述将当前块中相应非零系数的幅值编码进码流的过程具体为:基于zig-zag方式逆向扫描当前块,在扫描到第一个幅值大于1的非零系数时,开始分别将每个扫描到的非零系数编码进码流。 10. The method according to claim l, characterized in that the magnitude of the nonzero coefficients corresponding coded block of the current process feed stream is specifically: reverse scan current block based on the zig-zag manner, to scan the first non-zero coefficient is greater than a magnitude of, respectively, the start of each non-zero coefficient coding scanned into the stream.
11、 如权利要求l所述的方法,其特征在于,所述将当前块中相应非零系数的幅值编码进码流的过程具体包括:基于zig-zag方式逆向扫描当前块,在扫描到第一个幅值大于1的非零系数时,开始编码该扫描到的当前非零系数及其在后续扫描到下一个幅值大于1的非零系数之前所扫描到的幅值等于1的非零系数个数;在后续每次扫描到一个幅值大于1的非零系数时,基于前一已编码的幅值大于1的非零系数,来编码当前扫描到的非零系数及其在后续扫描到下一个幅值大于1的非零系数之前所扫描到的幅值等于1的非零系数个数。 11. The method according to claim l, characterized in that the magnitude of the nonzero coefficients corresponding coded block of the current process feed stream comprises: scanning the current block based on a reverse zig-zag manner, to scan the first non-zero coefficient is greater than a magnitude of the scan to start coding the current nonzero coefficient and prior to the next subsequent scan amplitude is greater than the nonzero coefficient scan amplitude is equal to the non-1 the number of zero coefficients; at each subsequent scan to a nonzero coefficient amplitude is greater than 1, based on the magnitude of the previous coded nonzero coefficients is greater than 1, the non-zero coefficients of the current to and subsequent to scanning scanning until the next non-zero coefficient amplitude is greater than the scanning amplitude is equal to the number of non-zero coefficient.
12、 一种变长解码方法,其特征在于,包括步骤:解码接收到的当前块的非零系数个数;根据解码得到的非零系数个数,在当前块中解码出对应个数的非零系数符号及对应非零系数前零系数的个数;以及解码当前块的幅值大于1的系数个数;根据解码得到的幅值大于1的系数个数,在当前块中解码出对应的非零系数的幅值。 12. A variable length decoding method, comprising the steps of: decoding the received number of nonzero coefficients of the current block; The number of nonzero coefficients obtained by decoding, the current block decoded in a corresponding number of non- symbols and zero coefficients before a nonzero coefficient corresponding to the number of zero coefficients; and decoding the current block is larger than the magnitude of the number of coefficients is 1; 1 is greater than the number of coefficients decoded in accordance with the magnitude of the current block decoded in a corresponding the amplitude of non-zero coefficients.
13、 一种变长编码器,其特征在于,包括:用于统计当前块中非零系数的个数和幅值大于1的系数个数的单元;用于将统计得到的非零系数个数编码进码流的单元;用于将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的单元;和用于将统计得到的幅值大于1的系数个数编码进码流的单元;用于将当前块中相应非零系数的幅值编码进码流的单元。 13, a variable-length encoder comprising: means for counting the current block and the number of nonzero coefficients in the magnitude of the number of coefficients greater than 1; statistics for the number of nonzero coefficients obtained unit encoded into code stream; means for encoding the number of symbols before each nonzero coefficient and a corresponding nonzero coefficients in the current block into zero coefficients codestream unit; and a statistical coefficient is greater than the amplitude obtained 1 number encoder code stream into units; for coding block corresponding to the magnitude of the nonzero coefficients in the current feed stream units.
14、 一种变长解码器,其特征在于,包括:用于解码接收到的当前块的非零系数个数的单元;用于根据解码得到的非零系数个数,在当前块中解码出对应个数的非零系数符号及对应非零系数前零系数的个数的单元;和用于解码当前块的幅值大于1的系数个数的单元; 用户根据解码得到的幅值大于i的系数个数,在当前块中解码出对应的非零系数的幅值的单元。 14, a variable length decoder comprising: a unit number of nonzero coefficients in the current block for decoding received; according to the number of nonzero coefficients obtained by decoding, decoding in the current block symbol and a corresponding nonzero coefficient zero coefficients before a nonzero coefficient number corresponding to the number of cells; and means for decoding the current block is larger than the magnitude of the number of coefficients of unit 1; i is greater than the user depending on the magnitude of the decoded the number of coefficients, the amplitude of the decoded non-zero coefficients corresponding to the cell in the current block.
15、 一种变长编码方法,其特征在于,包括步骤: 统计当前块中非零系数的个数;将统计得到的非零系数个数编码进码流;将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流;以及将当前块中相应非零系数的幅值编码进码流;在码流中编码入用于标识非零系数幅值已编码完的块结束标志。 15, a variable-length encoding method comprising the steps of: count the number of nonzero coefficients in the current block; nonzero coefficient number coding statistics obtained feed stream; each nonzero coefficients in the current block corresponding to the number of coded symbols and non-zero coefficients zero coefficients into code stream; and an amplitude of the corresponding coding block nonzero coefficients in the current feed stream; encoded stream into a code for identifying the magnitude of the nonzero coefficients has been coded end block end sign.
16、 如权利要求15所述的方法,其特征在于,所述将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的过程具体包括:分别将当前块中的每个非零系数符号和该非零系数前零系数的个数映射成对应符号;采用截断的Golomb编码方式将映射后的符号编码进码流。 16. The method as claimed in claim 15, wherein the number of the encoded symbols before each nonzero coefficient and a corresponding nonzero coefficients in the current block into zero coefficients the process stream comprises: a current, respectively, the number of each non-zero coefficient and the previous symbol block of the nonzero coefficient zero coefficients mapped to the corresponding symbol; truncation using the Golomb encoding encoded symbols mapped into the code stream.
17、 如权利要求15所述的方法,其特征在于,所述将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的过程具体包括:基于zig-zag方式正向扫描当前块,在扫描到第一个非零系数时,编码该扫描到的非零系数前零系数的个数以及该非零系数的符号;后续在每次扫描到一个非零系数时,基于当前块非零系数的个数、前一已编码的非零系数前零系数的个数,来编码当前扫描到的非零系数前零系数的个数,并进而编码当前扫描到的非零系数的符号。 17. The method as claimed in claim 15, wherein the number of the encoded symbols before each nonzero coefficient and a corresponding nonzero coefficients in the current block into zero coefficients the process stream comprises: based zig- forward scan a current block zag manner, upon scanning the first nonzero coefficient, encoding the scanned number of zero coefficients before a nonzero coefficient and a symbol of the non-zero coefficients; subsequent to a non-zero during each scan when the coefficients of the current block based on the number of number of non-zero coefficients before a nonzero coefficient before the zero coefficients has been encoded, to encode the number of zero coefficients before a nonzero coefficient to the current scan, and thus to encode the current scan symbol nonzero coefficients.
18、 如权利要求15所述的方法,其特征在于,所述将当前块中相应非零系数的幅值编码进码流的过程具体为:基于zig-zag方式逆向扫描当前块,在扫描到第一个幅值大于1的非零系数时,开始分别将每个扫描到的非零系数编码进码流。 18. The method as claimed in claim 15, wherein the coded block corresponding to the magnitude of the current nonzero coefficient into the process stream is specifically: reverse scan current block based on the zig-zag manner, to scan the first non-zero coefficient is greater than a magnitude of, respectively, the start of each non-zero coefficient coding scanned into the stream.
19、 如权利要求15所述的方法,其特征在于,所述将当前块中相应非零系数的幅值编码进码流的过程具体包括:基于zig-zag方式逆向扫描当前块,在扫描到第一个幅值大于1的非零系数时,开始编码该扫描到的当前非零系数及其在后续扫描到下一个幅值大于1 的非零系数之前所扫描到的幅值等于1的非零系数个数;在后续每次扫描到一个幅值大于1的非零系数时,基于前一已编码的幅值大于1的非零系数,来编码当前扫描到的非零系数及其在后续扫描到下一个幅值大于1的非零系数之前所扫描到的幅值等于1的非零系数个数。 19. The method of claim 15, wherein the coded block corresponding to the magnitude of the nonzero coefficients in the current process into the code stream comprises: scanning the current block based on a reverse zig-zag manner, to scan the first non-zero coefficient is greater than a magnitude of the scan to start coding the current nonzero coefficient and prior to the next subsequent scan amplitude is greater than the nonzero coefficient scan amplitude is equal to the non-1 the number of zero coefficients; at each subsequent scan to a nonzero coefficient amplitude is greater than 1, based on the magnitude of the previous coded nonzero coefficients is greater than 1, the non-zero coefficients of the current to and subsequent to scanning scanning until the next non-zero coefficient amplitude is greater than the scanning amplitude is equal to the number of non-zero coefficient.
20、 一种变长解码方法,其特征在于,包括步骤: 解码接收到的当前块的非零系数个数;根据解码得到的非零系数个数,在当前块中解码出对应个数的非零系数符号及对应非零系数前零系数的个数;在当前块中解码出对应的非零系数的幅值;以及解码得到用于标识非零系数幅值已编码完的块结束标志。 20. A variable length decoding method, comprising the steps of: decoding the received number of nonzero coefficients of the current block; The number of nonzero coefficients obtained by decoding, the current block decoded in a corresponding number of non- the number of zero coefficients before a nonzero coefficient zero symbol and the corresponding coefficients; decoding corresponding to the amplitude of non-zero coefficients in the current block; and a decoded block is used to identify the magnitude of the nonzero coefficients have been coded end flag.
21、 一种变长编码器,其特征在于,包括: 用于统计当前块中非零系数个数的单元;用于将统计得到的非零系数个数编码进码流的单元; 用于将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的单元;和用于将当前块中相应非零系数的幅值编码进码流的单元; 用于在码流+编码入用于标识非零系数幅值已编码完的块结束标志的单元。 21, a variable-length encoder comprising: means for counting the number of nonzero coefficients in the current block; a unit nonzero coefficient number encoder statistically derived feed stream; means for each nonzero coefficient number encoder current symbol and the corresponding zero coefficients before a nonzero coefficient in a block unit into the code stream; and an amplitude of the corresponding coding block into current nonzero coefficient unit code stream; for + code stream encoded in the amplitude of the nonzero coefficient identification unit have been coded for a block end flag.
22、 一种变长解码器,其特征在于,包括:用于解码接收到的当前块的非零系数个数的单元;用于根据解码得到的非零系数个数,在当前块中解码出对应个数的非零系数符号及对应非零系数前零系数个数的单元;用于在当前块中解码出对应的非零系凄t幅值的单元;和用于解码得到用于标识非零系数幅值已编码完的块结束标志的单元。 22. A variable length decoder comprising: a unit number of nonzero coefficients in the current block for decoding received; according to the number of nonzero coefficients obtained by decoding, decoding in the current block symbol and a corresponding nonzero coefficients before a nonzero coefficient unit corresponding to the number of number of zero coefficients; means for decoding desolate t nonzero coefficient corresponding to the amplitude of the unit in the current block; and for identifying a non-decoded amplitude zero coefficients have been coded unit block end flag.
23、 一种变长编码方法,其特征在于,.包括步骤: 统计当前块中幅值大于1的系数个数;将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流;以及在码流中编码入用于标识非零系数符号已编码完的块结束标志; 将统计得到的幅值大于1的系数个数编码进码流; 将当前块中相应非零系数的幅值编码进码流。 23. A variable length coding method, characterized by comprising the step of: the amplitude of the current block count is greater than the number of coefficients is 1; the number before each nonzero coefficients in the current block and symbols corresponding to nonzero coefficients zero coefficients. coded into the bit stream; and a code stream encoded in the symbol block identification nonzero coefficients have been coded for the end flag; statistics obtained greater in magnitude than the coefficient number encoder into the bit stream 1; corresponding to the current block coding nonzero coefficients into amplitude stream.
24、 如权利要求23所述的方法,其特征在于,所述将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的过程具体包括:分别将当前块中的每个非零系数符号和该非零系数前零系数的个数映射成对应符号;采用截断的Golomb编码方式将映射后的符号编码进码流。 24. A method as claimed in claim 23, wherein the number of the encoded symbols before each nonzero coefficient and a corresponding nonzero coefficients in the current block into zero coefficients the process stream comprises: a current, respectively, the number of each non-zero coefficient and the previous symbol block of the nonzero coefficient zero coefficients mapped to the corresponding symbol; truncation using the Golomb encoding encoded symbols mapped into the code stream.
25、 如权利要求23所述的方法,其特征在于,所述将当前块中的各非零系数符号和对应非零系数前零泉数的个数编码进码流的过程具体包括:基于zig-zag方式正向扫描当前块,在扫描到第一个非零系数时,编码该扫描到的非零系数前零系数的个数以及该非零系数的符号;后续在每次扫描到一个非零系数时,基于当前块非零系数的个数、前一已编码的非零系数前零系数的个数,来编码当前扫描到的非零系数前零系数的个数,并进而编码当前扫描到的非零系数的符号。 25. The method as claimed in claim 23, wherein the number of the uncoded zero coefficients springs of the numbers of non-zero symbols and a corresponding nonzero coefficients in the current block into the process stream comprises: based zig -zag forward scan mode of the current block, upon scanning the first nonzero coefficient, encoding the scanned number of zero coefficients before a nonzero coefficient and a symbol of the non-zero coefficients; subsequent to each scan in a non- zero coefficients, the number of the current block based on the number of non-zero coefficients before a nonzero coefficient before the zero coefficients has been encoded, to encode the number of zero coefficients before a nonzero coefficient to the current scan, and thus encode the current scan to the signs of the nonzero coefficients.
26、如权利要求23所述的方法,其特征在于,所述将当前块中相应非零系数的幅值编码进码流的过程具体为:基于zig-zag方式逆向扫描当前块,在扫描到第一个幅值大于1的非零系数时,开始分别将每个扫描到的非零系数编码进码流。 26. A method as claimed in claim 23, wherein the coded block corresponding to the magnitude of the current nonzero coefficient into the process stream is specifically: reverse scan current block based on the zig-zag manner, to scan the first non-zero coefficient is greater than a magnitude of, respectively, the start of each non-zero coefficient coding scanned into the stream.
27、 如权利要求23所述的方法,其特征在于,所迷将当前块中相应非零系数的幅值编码进码流的过程具体包括:基于zig-zag方式逆向扫描当前块,在扫描到笫一个幅值大于1的非零系数时,开始编码该扫描到的当前非零系数及其在后续扫描到下一个幅值大于1 的非零系数之前所扫描到的幅值等于1的非零系数个数;在后续每次扫描到一个幅值大于1的非零系数时,基于前一已编码的幅值大于1的非零系数,来编码当前扫描到的非零系数及其在后续扫描到下一个幅值大于1的非零系数之前所扫描到的幅值等于1的非零系数个数。 27. A method as claimed in claim 23, wherein the amplitude of the fans coding block corresponding nonzero coefficients in the current process into the code stream comprises: scanning the current block based on a reverse zig-zag manner, to scan when the amplitude is greater than a nonzero coefficients Zi 1, the scanning to start coding the current nonzero coefficient and prior to the next subsequent scan amplitude is greater than the non-zero coefficient is equal to zero amplitude scanned 1 the number of coefficients; nonzero coefficient at each subsequent scan to a nonzero coefficient amplitude is greater than 1, based on the magnitude of the previous coded nonzero coefficients is greater than 1, to encode the current scan and the subsequent scans to until the next non-zero coefficient is greater than the magnitude of the scan amplitude is equal to the number of nonzero coefficients is 1.
28、 一种变长解码方法,其特征在于,包括步骤:在当前块中解码出非零系数符号及对应非零系数前零系数的个数;以及在当前块中解码用于标识非零系数符号已编码完的块结束标志; 解码当前块中幅值大于1的系数个数;根据解码得到的幅值大于1的系数个数,在当前块中解码出对应的非零系数的幅值。 28. A variable length decoding method, characterized by comprising the steps of: decoding a symbol and the number of nonzero coefficients before a nonzero coefficient corresponding to zero coefficients in the current block; and decoding the current block for identifying non-zero coefficient symbols have been coded block end flag; decoding the current block is greater than the magnitude of the number of coefficients 1; 1 is greater than the number of coefficients in accordance with a magnitude obtained by decoding, decoding corresponding to the amplitude of non-zero coefficients in the current block. ' '
29、 一种变长编码器,其特征在于,包括: 用于统计当前块中幅值大于1的系数个数的单元;用于将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的单元;一用于在码流中编码入用于标识非零系数符号已编码完的块结束标志的单元;用于将统计得到的幅值大于1的系数个数编码进码流的单元; 用于将当前块中相应非零系数的幅值编码进码流的单元。 29, a variable-length encoder comprising: means for counting the current block number of coefficients with amplitudes greater than 1; nonzero coefficients for each symbol and a corresponding nonzero coefficients in the current block in the previous the number of zero coefficients into coding unit codestream; a cell block into a code stream encoded symbols for identifying non-zero coefficients have been coded for end flag; statistics obtained for the amplitude coefficients is greater than 1, number encoder code stream into units; for coding block corresponding to the magnitude of the nonzero coefficients in the current feed stream units.
30、 一种变长解码器,其特征在于,包括:用于在当前块中解码出非零系数符号及对应非零系数前零系数个数的单元;用于在当前块中解码用于标识非零系数符号已编码完的块结束标志的单元;用于解码当前块中幅值大于1的系数个数的单元;用于根据解码得到的幅值大于1的系数个数,在当前块中解码出对应的非零系数幅值的单元。 30. A variable length decoder comprising: means for decoding the number of zero coefficients before a nonzero coefficient and the symbol corresponding to the nonzero coefficients in the current block; means for decoding in the current block for identifying cell block end flag non-zero coefficients have been coded symbols; means for decoding the current block, the number of coefficients with amplitudes greater than 1; a is greater than the number of coefficients decoded according to the magnitude of the current block a decoding unit corresponding to the magnitude of the nonzero coefficients.
31、 一种变长编码方法,其特征在于,包括步骤:将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流;在码流中编码入用于标识非零系数符号已编码完的块结束标志;将相应非零系数的幅值编码进码流;以及在码流中编码入用于标识非零系数幅值已编码完的块结束标志。 31, a variable-length encoding method comprising the steps of: before each nonzero coefficient number encoder and a corresponding symbol of nonzero coefficients in the current block into zero coefficients stream; in the coded stream for code identifying non-zero coefficients have been coded symbol block end flag; the magnitude of the nonzero coefficients into a corresponding encoded stream; and a code stream encoded in the identification block nonzero coefficients have been coded amplitude for the end flag.
32、 如权利要求31所述的方法,其特征在于,所述将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的过程具体包括:分别将当前块中的每个非零系数符号和该非零系数前零系数的个数映射成对应符号;采用截断的Golomb编码方式将映射后的符号编码进码流。 32. The method according to claim 31, wherein the number of the encoded symbols before each nonzero coefficient and a corresponding nonzero coefficients in the current block into zero coefficients the process stream comprises: a current, respectively, the number of each non-zero coefficient and the previous symbol block of the nonzero coefficient zero coefficients mapped to the corresponding symbol; truncation using the Golomb encoding encoded symbols mapped into the code stream.
33、 如权利要求31所述的方法,其特征在于,所述将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的过程具体包括:基于zig-zag方式正向扫描当前块,在扫描到第一个非零系数时,编码该扫描到的非零系数前零系数的个数以及该非零系数的符号;后续在每次扫描到一个非零系数时,基于当前块非零系数的个数、前一已编码的非零系数前零系数的个数,来编码当前扫描到的非零系数前零系数的个数,并进而编码当前扫描到的非零系数的符号。 33. The method as claimed in claim 31, wherein the number of the encoded symbols before each nonzero coefficient and a corresponding nonzero coefficients in the current block into zero coefficients the process stream comprises: based zig- forward scan a current block zag manner, upon scanning the first nonzero coefficient, encoding the scanned number of zero coefficients before a nonzero coefficient and a symbol of the non-zero coefficients; subsequent to a non-zero during each scan when the coefficients of the current block based on the number of number of non-zero coefficients before a nonzero coefficient before the zero coefficients has been encoded, to encode the number of zero coefficients before a nonzero coefficient to the current scan, and thus to encode the current scan symbol nonzero coefficients.
34、 如权利要求31所述的方法,其特征在于,所述将当前块中相应非零系数的幅值编码进码流的过程具体为:基于zig-zag方式逆向扫描当前块,在扫描到第一个幅值大于1的非零系数时,开始分别将每个扫描到的非零系数编码进码流。 34. The method as claimed in claim 31, wherein the coded block corresponding to the magnitude of the current nonzero coefficient into the process stream is specifically: reverse scan current block based on the zig-zag manner, to scan the first non-zero coefficient is greater than a magnitude of, respectively, the start of each non-zero coefficient coding scanned into the stream.
35、 如权利要求31所述的方法,其特征在于,所述将当前块中相应非零系数的幅值编码进码流的过程具体包括:基于zig-zag方式逆向扫描当前块,在扫描到第一个幅值大于1的非零系数时,开始编码该扫描到的当前非零系数及其在后续扫描到下一个幅值大于1 的非零系数之前所扫描到的幅值等于1的非零系数个数;在后续每次扫描到一个幅值大于1的非零系数时,基于前一已编码的幅值大于1的非零系数,来编码当前扫描到的非零系数及其在后续扫描到下一个幅值大于1的非零系数之前所扫描到的幅值等于1的非零系数个数。 35. The method of claim 31, wherein the coded block corresponding to the magnitude of the nonzero coefficients in the current process into the code stream comprises: scanning the current block based on a reverse zig-zag manner, to scan the first non-zero coefficient is greater than a magnitude of the scan to start coding the current nonzero coefficient and prior to the next subsequent scan amplitude is greater than the nonzero coefficient scan amplitude is equal to the non-1 the number of zero coefficients; at each subsequent scan to a nonzero coefficient amplitude is greater than 1, based on the magnitude of the previous coded nonzero coefficients is greater than 1, the non-zero coefficients of the current to and subsequent to scanning scanning until the next non-zero coefficient amplitude is greater than the scanning amplitude is equal to the number of non-zero coefficient.
36、 一种变长解码方法,其特征在于,包括步骤:在当前块中解码出非零系数符号及对应非零系数前零系数的个数;以及解码出用于标识非零系数符号已编码完的块结束标志; 在当前块中解码出对应非零系数的幅值;以及解码出用于标识非零系数幅值已编码完的块结束标志。 36. A variable length decoding method, characterized by comprising the steps of: decoding a symbol and the number of nonzero coefficients before a nonzero coefficient corresponding to zero coefficients in the current block; and decoding the symbols for identifying non-zero coded coefficients end block end flag; corresponding to the magnitude of the decoded non-zero coefficients in the current block; and decoding blocks for identifying the magnitude of the nonzero coefficients have been coded end flag.
37、 一种变长编码器,其特征在于,包括:用于将当前块中的各非零系数符号和对应非零系数前零系数的个数编码进码流的单元;用于在码流中编码入用于标识非零系数符号已编码完的块结束标志的单元j 和用于将相应非零系数的幅值编码进码流的单元;用于在码流中编码入用于标识非零系数幅值已编码完的块结束标志的单元。 37, a variable-length encoder comprising: means for encoding the number of symbols before each nonzero coefficient and a corresponding nonzero coefficients in the current block into zero coefficients unit code stream; for codestream means for identifying the encoded j nonzero coefficients have been coded symbol block and the end flag for amplitude coding nonzero coefficients corresponding to the code stream into units; used in the code for identifying the non-encoded stream amplitude zero coefficients have been coded unit block end flag.
38、 一种变长解码器,其特征在于,包括:用于在当前块中解码出非零系数符号及对应非零系数前零系数个数的单元;和用于解码出用于标识非零系数符号已编码完的块结束标志的单元; 用于在当前块中解码出对应非零系数幅值的单元;用于解码出用于标识非零系数幅值已编码完的块结束标志的单元。 38. A variable length decoder comprising: means for decoding the number of zero coefficients before a nonzero coefficient and the symbol corresponding to the nonzero coefficients in the current block; and means for decoding for identifying a nonzero cell block end flag coefficients have been coded symbols; a decoding unit corresponding to the magnitude of the nonzero coefficients in the current block; means for decoding the block for identifying the magnitude of the nonzero coefficients have been coded marks the end of the .
CN 200610163459 2006-12-05 2006-12-05 Variable length coding and decoding method and its coding and decoding device CN100542293C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200610163459 CN100542293C (en) 2006-12-05 2006-12-05 Variable length coding and decoding method and its coding and decoding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200610163459 CN100542293C (en) 2006-12-05 2006-12-05 Variable length coding and decoding method and its coding and decoding device

Publications (2)

Publication Number Publication Date
CN101198054A CN101198054A (en) 2008-06-11
CN100542293C true CN100542293C (en) 2009-09-16

Family

ID=39548148

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200610163459 CN100542293C (en) 2006-12-05 2006-12-05 Variable length coding and decoding method and its coding and decoding device

Country Status (1)

Country Link
CN (1) CN100542293C (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024370B (en) * 2011-09-23 2018-03-23 中兴通讯股份有限公司 A motion vector decoding method and the second compression coding means
CN103188486B (en) * 2011-12-28 2016-04-20 联芯科技有限公司 H.263 video coding method and a variable length coding system
CN102752592B (en) * 2012-06-20 2015-02-11 深圳广晟信源技术有限公司 Entropy coding method of video conversion system
CN103428492B (en) * 2013-07-16 2016-11-16 山东大学 An HD presentation AVS coding rapid zig-zag scanning method
CN106162201B (en) * 2015-03-26 2019-02-15 北京君正集成电路股份有限公司 A kind of image data compression method and device based on sign bit grouping

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5574449A (en) 1995-02-24 1996-11-12 Intel Corporation Signal processing with hybrid variable-length and entropy encodidng
CN1741616A (en) 2005-09-23 2006-03-01 联合信源数字音视频技术(北京)有限公司 Adaptive entropy coding/decoding method based on context
CN1774932A (en) 2003-05-16 2006-05-17 思科技术公司 Combined runlength coding and variable length coding for video compression

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5574449A (en) 1995-02-24 1996-11-12 Intel Corporation Signal processing with hybrid variable-length and entropy encodidng
CN1774932A (en) 2003-05-16 2006-05-17 思科技术公司 Combined runlength coding and variable length coding for video compression
CN1741616A (en) 2005-09-23 2006-03-01 联合信源数字音视频技术(北京)有限公司 Adaptive entropy coding/decoding method based on context

Also Published As

Publication number Publication date
CN101198054A (en) 2008-06-11

Similar Documents

Publication Publication Date Title
KR101031561B1 (en) Encoding apparatus and encoding method
KR101095938B1 (en) Apparatus and Method for Encoding and Decoding Moving Picture using Adaptive Scanning
CA2645230C (en) Method and system for coding and decoding information associated with video compression
CN102150428B (en) System and method for video encoding using adaptive segmentation
US7394942B2 (en) Variable length coding method and apparatus for video compression
CN105072442B (en) Video data decoding apparatus
CN100579224C (en) Method and apparatus for lossless video encoding and decoding
JP5128820B2 (en) Coding method skipped macroblocks of the video image
CN101981934B (en) Methods, devices and systems for parallel video encoding and decoding
CN1305311C (en) Image encoder, image decoder, image encoding method, and image decoding method
JP5746363B2 (en) Coding the position of the last valid coefficient in the video block based on the scanning order of the blocks in the video coding
US20130187796A1 (en) Lossless coding technique for cabac in hevc
CN100348051C (en) An enhanced in-frame predictive mode coding method
KR101087400B1 (en) Bitplane coding and decoding for ac prediction status and macroblock field/frame coding type information
US20110310976A1 (en) Joint Coding of Partition Information in Video Coding
KR101586130B1 (en) Coding of transform coefficients for video coding
JP5868995B2 (en) Individual coding position of the last significant coefficient of the video block in a video coding
US20020131506A1 (en) Entropy coding with adaptive syntax
CN103444177B (en) Video coding of transform
CN1327395C (en) Method and system for context-based adaptive binary arithmetic coding
CN100492916C (en) Variable-length code using multiple mapping table and decoding method and apparatus
CN101185083B (en) Hybrid variable length coding method and device for video compression
CN101087416B (en) System and method for compression of digital data
CN101448162B (en) Method for processing video image
KR20190000920A (en) Methods and apparatus for video encoding and decoding binary sets using adaptive tree selection

Legal Events

Date Code Title Description
C06 Publication
C10 Request of examination as to substance
C14 Granted