CN101198051B - Method and device for implementing entropy decoder based on H.264 - Google Patents

Method and device for implementing entropy decoder based on H.264 Download PDF

Info

Publication number
CN101198051B
CN101198051B CN 200610157417 CN200610157417A CN101198051B CN 101198051 B CN101198051 B CN 101198051B CN 200610157417 CN200610157417 CN 200610157417 CN 200610157417 A CN200610157417 A CN 200610157417A CN 101198051 B CN101198051 B CN 101198051B
Authority
CN
China
Prior art keywords
decoding
step
residual
block
module
Prior art date
Application number
CN 200610157417
Other languages
Chinese (zh)
Other versions
CN101198051A (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 200610157417 priority Critical patent/CN101198051B/en
Publication of CN101198051A publication Critical patent/CN101198051A/en
Application granted granted Critical
Publication of CN101198051B publication Critical patent/CN101198051B/en

Links

Abstract

The invention discloses a method for decoding entropy coding residual data and so on which is specially used in an H.264 decoding MAE and a device. Because the method of the invention adopts collaborative work of software and hardware, parts which occupy a large number of resources during the decoding process are realized by means of a software method. The software program method is that: by the means of utilizing an embedded cpu to replace hardware circuits for operation, structural complexity and computation complexity are greatly reduced under the precondition that reliable decoding efficiency and decoding quality of an entropy decoder are guaranteed to be obtained, thereby the contradiction between structure and efficiency is effectively solved and decoding of CAVLC and CABAC entropy coding bit streams is smoothly realized. The entropy decoder comprises a BSI access module, a ue/se/te decoding unit, a CAVLC residual decoding module, a software module, a binary arithmetic decoding unit, an entropy decoding control module, a CABAC residual decoding module and an anti-sweep RAM.

Description

基于H. 264的熵解码器的实现方法及装置 H.-based implementation of the entropy decoder 264 and means

技术领域 FIELD

[0001] 本发明属于集成电路数字多媒体处理技术领域,尤其涉及一种专为在视频通信的硬件MAE(media accelerator engine多媒体加速引擎)上实现熵解码器的方法及装置。 [0001] The present invention belongs to the technical field of digital multimedia processing integrated circuit, particularly to an entropy decoder is designed to enable video communication hardware in the MAE (media accelerator engine acceleration multimedia engine) method and apparatus.

背景技术 Background technique

[0002] 视频编解码技术是数字多媒体存储和传输应用的关键技术之一,视频编码的核心部分包括:预测编码,变换编码,熵编码。 [0002] Video Coding is a key technology of digital multimedia storage and transmission applications, the core of video coding comprising: predictive coding, transform coding, entropy coding. 作为视频编码重要组成部分的熵编码,是利用去除视频数据冗余的方法达到对视频数据进行压缩的效果。 As an important part of the entropy encoding of video encoding, video data is to achieve the effect of compressing the video data using the method of removing the redundancy.

[0003] 熵编码包括变长编码和算术编码两种编码方法。 [0003] Entropy coding comprises variable length encoding and arithmetic encoding two coding methods. 典型的变长编码包括:HJ61、 MPEG (Motion Picture Experts Group) -2 中采用的H. 263, MPEG-4 中采用的3D-VLC 编码,以及H. 264/AVC(国际电信协会ITU-T的H. 264视频编码建议或IS0/IEC的国际标准14496-10 即MPEG-4 标准的第十部分)中采用的CAVLC (Context-based Adaptive Variable Length Coding)编码。 A typical variable-length coding includes: HJ61, MPEG (Motion Picture Experts Group) -2 employed in H. 263, 3D-VLC employed in MPEG-4 encoding, and H. 264 / AVC (ITU-T International Telecommunication Union's H. 264 video coding recommendation or IS0 / IEC international standard 14496-10 MPEG-4 standard that is part of a tenth) CAVLC (Context-based Adaptive Variable Length coding) coding is employed. 其中2D-VLC编码和3D-VLC编码采用单一码表进行编码,码表的体积较小,硬件实现比较简单;而CAVLC编码根据已编码的句法元素的情况,动态调整使用的码表,可以得到很高的压缩比,性价比更高。 2D-VLC coding, and wherein the 3D-VLC coding to encode a single code table, a smaller volume of the code table, a hardware implementation is relatively simple; CAVLC coding according to the situation and encoded syntax elements, dynamically adjusting the code table used can be obtained high compression ratio, the more cost-effective. 算术编码中最典型的是在H. ^4/AVC中采用CABAC算术编码,相对变长编码而言,由于可以对上下文进行建模,对信源符号出现的概率有更准确的估计,因此编码效率更高,但是相比变长编码,它的计算复杂度高,硬件实现复杂,因此目前采用不多。 Arithmetic coding is the use of the most typical CABAC arithmetic coding in H. ^ 4 / AVC, the relatively variable length coding, since the context can be modeled, a more accurate estimation of the probability of occurrence of the source symbols, thus encoding more efficient, but compared to the variable-length coding, its computational complexity is high, the hardware implementation complexity, there is currently little employed. 一般来说,CAVLC编码多用于实时性要求较高的应用,如视频电话等。 In general, the higher the CAVLC coding used for real-time requirements of applications, such as video telephony. 而CABAC虽然编码效率较高,编码的图像质量较好,但由于编码比较复杂,难以用于对速度要求较高的应用中,更多地用于数字多媒体的应用,如数字广播电视和数字视频存储寸。 Although higher and CABAC coding efficiency, the coded image quality is better, but the more complex coding, it is difficult for the high speed application requirements, more for digital multimedia applications, such as digital television broadcasting and digital video storage inch.

[0004] 熵解码就是将熵编码编码过的视频数据准确可靠的还原,对于应用H. 264/AVC 的视频编码标准进行编码的视频数据,针对存在的两种熵编码方式,熵解码器分别对经过CAVLC和CABAC编码过的视频数据进行解码。 [0004] Entropy decoding is accurate and reliable reduction of the entropy coding video data, encoded video data to the application H. 264 / AVC video coding standard, for the presence of two entropy coding mode, the entropy decoder, respectively after CAVLC and CABAC encoding video data is decoded. 然而,由于CAVLC较以前的2D-VLC编码和3D-VLC编码复杂,CABAC计算复杂度很高,因此要对同时支持两种熵编码方式的视频数据解码需要耗费相当的资源。 However, since the CAVLC complex than the previous 2D-VLC coding and 3D-VLC coding, the CABAC high computational complexity, and therefore to support two entropy encoding video data decoding takes considerable resources. 在IC设计中,纯ASIC硬件实现也相当困难,也正是由于这个原因,当前的H. 264熵解码一般只是在计算机上采用纯软件的方式实现,少数硬件实现的熵解码器也只支持CAVLC编码方式,这样就限制了性能更好,压缩比更高的CABAC编码方法的应用。 In IC design, pure ASIC hardware implementation is quite difficult, it is precisely for this reason, the current H. 264 entropy decoding generally only by way of pure software implementation on a computer, a few hardware entropy decoder only supports CAVLC encoding, thus limiting the better performance, the CABAC encoding method applied higher compression ratio.

发明内容 SUMMARY

[0005] 本发明所要解决的技术问题是如何采用一种简单有效的方法,在MAE上实现对CAVLC和CABAC的两种视频编码数据的熵解码,既能保证解码的质量和解码效率,结构简单又易于实现。 [0005] The present invention solves the technical problem is how to use a simple and effective way to achieve entropy decoding CAVLC and CABAC coded video data in both the MAE, and can ensure the quality of the decoded decoding efficiency, simple structure and easy to implement.

[0006] 本发明的目的在于公开了一种专用于H. 264解码MAE中对熵编码残差数据等进行解码的方法及装置,由于本发明所述方法采用了软硬件协同工作,使得熵解码器在保证获得可靠的解码效率和解码质量的前提下,大大降低了结构的复杂度和计算复杂度,从而有效的解决了结构和效率之间的矛盾,顺利的实现了对CAVLC和CABAC熵编码码流的解码。 [0006] The object of the present invention to disclose a method and an apparatus dedicated to the H. 264 decoding MAE entropy decoding encoded residual data and the like, since the present invention uses a method of hardware and software to work together, such that the entropy decoding in ensuring reliable decoding efficiency and quality of decoding the premise, greatly reduces the complexity and computational complexity of the structure to effectively solve the conflict between the structure and efficiency, to achieve a smooth CAVLC and CABAC entropy encoding decoding the code stream.

[0007] 基于H. 264的熵解码器的实现方法,其特征在于:该方法采用了软硬件协同工作,将解码过程中占用大量资源的部分改用软件程序方法实现,包括如下步骤: [0007] H. 264 implementation based on entropy decoder, characterized in that: the method uses a hardware and software to work together, the part of the software program use method of decoding process of a lot of resources occupied implemented, comprising the steps of:

[0008] 步骤1 :熵解码控制模块(6)根据熵编码模式标志选择解码方式:即是对CAVLC编码码流进行解码还是对CABAC编码码流进行解码; [0008] Step 1: entropy decoding control module (6) according to the selected entropy coding mode flag decoding mode: that is, the encoded bit stream for decoding CAVLC or CABAC for decoding the encoded stream;

[0009] 步骤2 :根据步骤1选定的解码类型以片(slice)数据为单位对CAVLC或者CABAC 编码码流进行解码; [0009] Step 2: Step 1 The type of decoding the selected slice (Slice) data units CAVLC or CABAC decoding the encoded stream;

[0010] 步骤3 :解码完成后,判断是否为CAVLC或者CABAC编码码流的最后一个片数据, 若不是,返回步骤2继续对下一个片(Slice)的数据进行解码,否则,解码过程结束。 [0010] Step 3: After decoding, it is determined whether the last slice data CAVLC or CABAC coded stream, if not, returns to step 2 to continue to decode the next slice (the Slice) data, otherwise, the decoding process ends.

[0011] 基于H.沈4的熵解码器的实现方法,所述的将解码过程中占用大量资源的部分改用软件程序方法实现,其特征在于:所述的软件程序方法是指利用嵌入式cpu代替硬件电路进行运算的方式,而不是单纯的指用计算机软件实现熵解码中的某些计算功能。 [0011] Implementation of H. Shen entropy decoder based on 4, according to the decoding process instead of an expensive part of a software program implemented method, comprising: a software program refers to a method of using embedded instead of a hardware circuit for computing cpu manner, rather than simply computing means to achieve certain functions of the entropy decoder using computer software.

[0012] 所述的基于H. 264的熵解码器的实现方法,其特征在于:该方法步骤2中所述的根据选定的解码类型以片数据为单位对CAVLC编码码流进行解码,其中所述的对CAVLC编码码流的解码还包括如下的具体步骤: [0012] The entropy decoder implementation method based on H. 264, wherein: the step 2 in the method according to the CAVLC encoded code stream according to the selected type of decoding to decode the slice data units, wherein decoding the CAVLC encoded code stream further comprises the following steps:

[0013] 步骤2. 1 :熵解码控制模块(6)向软件模块(4)发出开始信号,开始求解与解码有关的变量和参数; [0013] Step 2.1: entropy decoding control module (6) issuing a signal to start a software module (4), starts decoding solved related variables and parameters;

[0014] 步骤2. 2 :软件模块⑷收到来自熵解码控制模块(6)的开始信号后,经由ue/se/ te解码单元(¾并最终通过BSI取数模块(1)得到所需的编码数据流,经解码得到所需的宏块参数以及除残差系数以外的其他语法元素; [0014] Step 2.2: ⑷ software module after receipt of a start signal from the entropy decoding control module (6) via ue / se / te decoding unit (BSI ¾ and finally through the number of modules (1) to give the desired take encoded data stream to obtain the desired decoded macroblock parameters, and other syntax elements other than residual coefficients;

[0015] 步骤2. 3 :熵解码控制模块(6)收到软件模块(4)发出的结束信号后,向CAVLC残差解码模块(¾发出解残差开始信号; [0015] Step 2.3: entropy decoding the control module (6) end signal is received software module (4) issued to the CAVLC residual decoding module (¾ start signal issued residual solution;

[0016] 步骤2. 4 =CAVLC残差解码模块(3)收到熵解码控制模块(6)发来的开始信号后开始残差解码,并通过BSI取数据模块(1)获得解码所需的编码数据,得到亮度块和色度块的残差系数值; [0016] Step 2. 4 = CAVLC residual decoding module (3) is received after the start signal Start residual decoding entropy decoding control module (6) is sent, and takes the data module (1) to obtain the desired decoded by BSI coded data blocks to obtain the luminance and a residual chrominance coefficient value block;

[0017] 步骤2.5 :判断解码的是否为片数据的最后一个宏块,如果不是,则返回到步骤2. 1继续解下一个宏块,否则解码结束。 [0017] Step 2.5: determining whether the last macroblock of slice data is decoded, and if not, returns to step 2.1 a macroblock untied continue, otherwise ends the decoding.

[0018] 所述的基于H. 264的熵解码器的实现方法,其特征在于:以片数据为单位对CAVLC 编码码流进行解码是通过对组成片数据的每个宏块进行解码实现的,所述对单个宏块的解码包括如下的步骤: [0018] The implementation method of the H. 264 decoder entropy-based, characterized in that: in the unit of slice data CAVLC decoding the encoded bit stream for each macroblock is composed by slice data decoding achieved, single decoding of the macroblock comprises the steps of:

[0019] 步骤1 :由软件模块求解与宏块解码相关的变量和参数; [0019] Step 1: solved by a software module associated with a macroblock decoding variables and parameters;

[0020] 步骤2 :根据上述步骤1得到解码所需的当前宏块以及邻近宏块解码所需的参数后,按照先亮度块后色度块的顺序对宏块进行解码; [0020] Step 2: after Step 1 above to give the parameters required for the current macroblock and a neighboring macroblock decoding according to a decoding required, in the order of the first block of the luminance chroma macroblock decoded block;

[0021] 步骤3 :对亮度块进行解码;以4x4块为基本的解码单位,即每次对一个4x4亮度块进行块解码,先对亮度块的直流(DC)系数进行解码,然后再对亮度块的交流系数(AC)进行解码; [0021] Step 3: decoding of the luminance blocks; 4x4 block to decode the basic unit, i.e. each 4x4 luminance block of a block decoding, the first luminance blocks DC (DC) coefficient decoding, then the brightness AC coefficients of the block (AC) for decoding;

[0022] 步骤4 :解码完亮度块后,对色度块进行解码;以虹4块为基本的解码单位,按照先Cb块后Cr块的顺序,先解码色度块的直流系数,再解码色度块的交流系数;[0023] 步骤5 :重复上述步骤,继续解下一个宏块。 [0022] Step 4: After the decoded luminance block, chroma block for decoding; Hong 4 to the basic unit of decoding in the order of the first block of the Cb Cr block to decode the block of chroma DC coefficients, re-decoded AC coefficient chroma blocks; [0023] step 5: repeat the above steps to continue to cast off one macro block.

[0024] 所述基于H. 264的熵解码器的实现方法,该方法步骤2所述的根据选定的解码方式以片数据为单位对CABAC编码码流进行解码,其特征在于:其中所述的对CABAC编码码流的解码还包括如下的具体步骤: [0024] The entropy decoder implemented method of H. 264-based, the method of the step 2 to the selected decoding scheme in units of slice data CABAC decoding the encoded bit stream, wherein: wherein said CABAC decoding the encoded code stream further comprises the following steps:

[0025] 步骤2. 1 ' :对CABAC解码所需的上下文模型进行初始化,并初始化概率区间; [0025] Step 2.1 ': CABAC context model required for decoding is initialized, and initializes the probability interval;

[0026] 步骤2. 2':熵解码控制模块(6)向软件模块(4)发出开始信号,开始对除残差系数以外的其他语法元素、运动向量mvd_10,mvd_ll解码,并求解残差解码中用到的宏块参数; [0026] Step 2.2 ': entropy decoding control module (6) (4) issued to the software module start signal, it starts to other syntax elements other than residual coefficients, motion vectors mvd_10, mvd_ll decoded, and the decoded residual Solution the parameters used in the macroblock;

[0027] 步骤2. 3':软件模块(4)收到来自熵解码控制模块(6)的开始信号后,经由二进制算术解码单元(¾并最终通过BSI取数模块(1)得到所需的编码数据流,解码得到所需的宏块参数以及除残差系数以外的其他语法元素; [0027] Step 2.3 ': software module (4) after receiving the entropy decoding start signal from the control module (6) via binary arithmetic decoding unit (BSI ¾ and finally through access module (1) to give the desired encoded data stream, decoding the macro block to obtain the desired parameters, and other syntax elements other than residual coefficients;

[0028] 步骤2. 4':熵解码控制模块(6)向CABAC残差解码模块(7)发出解残差开始信号; [0028] Step 2.4 ': entropy decoding control module (6) issued residual solution CABAC residual decoding start signal to the module (7);

[0029] 步骤2. 5' =CABAC残差解码模块(7)收到熵解码控制模块(6)发来的开始信号后开始残差解码,经由二进制算术解码单元(5)并最终通过BSI取数模块(1)得到所需的编码数据流,解码得到亮度(Iuma)和色度(chroma)块的残差系数值; [0029] Step 2. 5 '= CABAC residual decoding module (7) receives the start signal starts after the residual decoding entropy decoding control module (6) is sent, and finally through BSI binary arithmetic decoding unit via a taking (5) number of modules (1) to give the desired encoded data stream, decoded luminance (Iuma) and chrominance (chroma) a residual block of coefficient values;

[0030] 步骤2. 6':判断解码的宏块是否为片(slice)的最后一个宏块,如果不是,则返回到步骤2.1'继续解下一个宏块,否则解码结束。 [0030] Step 2.6 ': determining whether the macro block is decoded slice (Slice) of the last macroblock, if not, returns to step 2.1' continue untied a macroblock, or the decoding end.

[0031] 本发明所述的基于H. 264的熵解码器的实现方法,其特征在于:所述的以片数据为单位对CABAC编码码流进行解码是通过对组成片数据的每个宏块进行解码实现的,所述对单个宏块的解码包括如下的步骤: [0031] The entropy decoder implemented method of H. 264 based on which the present invention is characterized in that: said slice data CABAC encoding in units of the code stream is decoded by each macro block of the slice data consisting of carried out, comprising the steps of a single macro block decoded by the decoding implemented:

[0032] 步骤1 :对上下文模型和概率区间进行初始化; [0032] Step 1: context model and the probability interval is initialized;

[0033] 步骤2 :开始对残差系数以外其他语法元素进行解码,并通过采用软件方法求解残差解码中要用到的宏块参数和其他参数; [0033] Step 2: Start macro syntax elements other than residual coefficients decoded and the decoded residual solved by using software to use to process block parameters and other parameters;

[0034] 步骤3 :按照先亮度后色度的顺序对残差宏块进行解码; [0034] Step 3: residual macroblock decoding according to the sequence of the first color luminance;

[0035] 步骤4 :对亮度块的解码;以4x4块或者8x8块为基本单位,先对亮度直流系数进行解码,再对剩余的亮度交流系数进行解码,完成对亮度块的解码过程; [0035] Step 4: decoding luminance blocks; in 4x4 blocks or 8x8 block as a basic unit, to decode the luminance DC coefficients, and then the remaining luminance AC coefficient decoding process completes the decoding of the luminance blocks;

[0036] 步骤5 :对色度块的解码;按照先Cb后Cr块的顺序以4x4块为单位对两个色度块Cb和Cr块进行解码,先解Cb和Cr块的直流系数,然后再解Cb和Cr块的交流系数; [0036] Step 5: decoding chroma blocks; in units of 4x4 blocks two chrominance blocks Cb and Cr block to decode the block in the order of Cr Cb after the first, the first solution and the dc coefficient Cr Cb block, and then Solutions again Cb Cr and AC coefficient block;

[0037] 步骤6 :重复上述步骤,继续解下一个宏块。 [0037] Step 6: Repeat the above steps to continue to cast off one macro block.

[0038] 本发明还公开了一种基于H. 264的熵解码器装置,该装置包括如下模块: [0038] The present invention also discloses an entropy decoder based on H. 264 of the apparatus, the apparatus comprising the following modules:

[0039] BSI取数模块:负责从外部取得解码所需的码流数据,当接收到其他模块的取数请求时,返回相应长度的码流数据; [0039] BSI access module: responsible for obtaining the data required for decoding the code stream from the outside, when the number of fetch requests received by the other modules, return code stream data of a corresponding length;

[0040] ue/se/te解码单元:接收软件模块发送来的解码请求并返回解码后的参数值; [0040] ue / se / te decoding unit: the software module receiving a request sent by the decoding and the decoded return value;

[0041] CAVLC残差解码模块:以'4X4块'为单位,根据软件模块解码得到的相应参数,对亮度和色度的残差系数进行解码,解码完成后向熵解码控制模块发出结束信号,解码出来的残差系数存入反扫描RAM ; [0041] CAVLC residual decoding module: to '4X4 block' as a unit, according to the corresponding parameters obtained by decoding the software module, the residual coefficients of luminance and chrominance decoding end signal sent to the entropy decoded after decoding the control module, decoded residual coefficients stored in the RAM reverse scan;

[0042] 软件模块:对残差解码需要的参数和变量进行解码,通过ue/se/e解码单元求解与CAVLC相关的参数,通过二进制算术解码单元求解与CABAC相关的参数,最终得到的参数再提供给CAVCL或CABAC残差解码模块使用; [0042] software modules: residual decoding parameters and variables required for decoding, by ue / se e decoding unit parameter related to solving / CAVLC, binary arithmetic decoding unit by solving the CABAC related parameters, and then the resulting parameters CAVCL supplied to or CABAC residual decoding module;

[0043] 二进制算术解码单元:在解码与宏块有关的参数时,当收到软件模块发送来的解码请求,经解码返回得到的二进制结果;另外在进行CABAC残差解码的时,当收到CABAC残差解码模块发送来的解码请求时,经解码返回得到的二进制结果; [0043] The binary arithmetic decoding unit: when decoding the macroblock-related parameter, when receiving a software module request sent by the decoding and returns the resulting binary decoded; when performing CABAC residual decoding Further, when receiving decoding CABAC residual decoding module sends a request to return the decoded binary results obtained;

[0044] 熵解码控制模块:控制整个解码流程,先控制软件模块求解相关的参数,负责向CAVLC残差解码模块或者CABAC残差解码模块发出开始解码信号,当接收到解码结束信号后,将解码得到的相应残差系数写入反扫描RAM ; [0044] The entropy decoding control module: controls the entire decoding process, the control software module to solve the relevant parameters, responsible for issuing a start decode signal to CABAC or CAVLC residual decoding module residual decoding module, after receiving the end of the decoded signal, the decoded the corresponding residual coefficients are written in the reverse scanning the RAM;

[0045] CABAC残差解码模块:以'4X4'块或者MX8'块为单位,根据软件模块解码得到的相应参数,对亮度和色度的残差系数进行解码,解码完成后向熵解码控制模块发出结束信号,解码出来的残差系数存入反扫描RAM ; [0045] CABAC residual decoding module: to '4X4' block or MX8 'block unit according to the corresponding parameters obtained by decoding the software module, the residual luminance and chrominance coefficients are decoded, after completion of decoding the entropy decoding control module issued end signal, the decoded residual coefficients stored in the RAM reverse scan;

[0046] 反扫描RAM :存储经CAVLC残差解码模块或者CABAC残差解码模块解码得到的残 [0046] The inverse scanning RAM: storing the residual decoding CAVLC or CABAC residual block obtained residue decoding module

差系数。 Difference coefficient.

[0047] 本发明的显著有益效果在于:在CAVLC和CABAC的解码过程中,尤其是在对CABAC 码流的解码过程中,CABAC解码本身就是一个复杂的过程,而且在对残差以外的其他语法元素进行解码时,CABAC的编码方式决定了解码的复杂性,伴随而来的是计算的复杂度,在ASIC设计中,如果完全采用纯硬件实现,这不仅将会占用大量的硬件资源,而且势必会大大增加设计的难度。 [0047] The significant advantages of the present invention is that: the decoding process CAVLC and CABAC, in particular in the decoding process of the CABAC stream, the CABAC decoding itself is a complex process, but also in other syntax other than residual when the element is decoded, CABAC coding scheme determines the complexity of decoding, accompanied by the computational complexity, in ASIC design, if completely pure hardware implementation, which will not only take up a lot of hardware resources, and bound It will greatly increase the difficulty of the design.

[0048] 本发明提出了一种专用于H. 264解码MAE中对熵编码残差数据等进行解码的方法,由于采用了软硬件协同工作,将解码过程中占用大量硬件资源的部分改用软件方式实现,使得熵解码器在保证获得可靠的解码效率和解码质量的前提下,大大降低了结构的复杂度和计算的复杂度,从而有效的解决了速度和效率之间的矛盾,顺利的实现了对CAVLC 和CABAC熵编码码流的解码。 [0048] The present invention provides a dedicated H. 264 decoding the entropy encoded residual MAE data decoding method, the use of hardware and software to work together, the hardware resource intensive part of the decoding process instead of software implementation, such entropy decoder in ensuring reliable decoding efficiency and quality of decoding the premise, greatly reduces the complexity of the structure and complexity of the calculations, in order to effectively solve the conflict between the speed and efficiency, to achieve smooth CAVLC and CABAC decoding of entropy coding code stream. 而且,由于采用本发明所述的解决方案,使得熵解码器可以应用于实际的电路设计中,由于支持CABAC的解码,可以加快H. 264在多媒体视频方面的应用,可以用于标清的数字存储和其他的实时应用,如视频存储、VOIP、可视电话等。 Further, since the solution of the present invention, such entropy decoder may be applied to an actual circuit design, since the support of the CABAC decoding, can be applied to accelerate the H. 264 multimedia video aspect, it may be used to store digital SD and other real-time applications such as video storage, VOIP, video telephony.

[0049] 附图说明 [0049] BRIEF DESCRIPTION OF DRAWINGS

[0050] 图1为本发明熵解码器的硬件结构实现原理图; [0050] Figure 1 is a hardware configuration of the entropy decoder embodying the principles of the invention FIG;

[0051] 图2为熵解码模式选择的原理图; [0051] FIG. 2 is a schematic diagram of an entropy decoding mode is selected;

[0052] 图3为对一个宏块的数据进行CAVLC解码的方法流程图; [0052] FIG. 3 is a method of data CAVLC decoding macroblock flowchart;

[0053] 图4为对一个4x4子块数据块进行CAVLC解码的方法流程图; [0053] FIG. 4 is a method for a 4x4 sub-block of the data block CAVLC decoding flow chart;

[0054] 图5为对一个宏块的数据进行CABAC解码的方法流程图; [0054] FIG. 5 is a method of data CABAC decoding macroblock flowchart;

[0055] 图6为对一个4x4子块或者8x8子块数据进行CABAC解码的方法流程图; [0055] FIG. 6 is a method for a 4x4 sub-block or sub-block 8x8 CABAC decoding data flowchart;

[0056] 图7为对4x4子块中的参数的举例说明附表; [0056] FIG. 7 is a 4x4 sub-block of the example described Schedule parameter;

[0057] 具体实施方式 [0057] DETAILED DESCRIPTION

[0058] 下面参考说明书附图,具体说明本发明的实现过程。 [0058] The following description with reference to the drawings, detailed description of the implementation process of the present invention. 如附图1所示:本发明所述的基于H. 264的熵解码器装置,该装置包括如下模块: As shown in Figure 1: H. 264-based entropy decoder apparatus according to the present invention comprises the following modules:

[0059] BSI取数模块1 :负责从外部取得解码所需的码流数据,当接收到其他模块的取数请求时,返回相应长度的码流数据; [0059] BSI access module 1: responsible for obtaining the data required for decoding the code stream from the outside, when the number of fetch requests received by the other modules, return code stream data of a corresponding length;

[0060] ue/se/te解码单元2 :接收软件模块发送来的ue,se或者te解码请求,并返回解码后的参数值;[0061] CAVLC残差解码模块3 :以'4X4块'为单位,根据软件模块解码得到的相应参数, 对亮度和色度的残差系数进行解码,解码完成后向熵解码控制模块发出结束信号,解码出来的残差系数存入反扫描RAM ; [0060] ue / se / te decoding unit 2: receiving a software module transmitted ue, se or te decoding request, and returns the parameter value after decoding; [0061] CAVLC residual decoding module 3: '4X4 block' is unit, according to the corresponding parameters obtained by decoding the software module, the residual coefficients of luminance and chrominance decoding end signal sent to the entropy decoding control module after completion of decoding, the decoded residual coefficients stored in the RAM reverse scan;

[0062] 软件模块4 :对残差解码需要的一些全部和局部参数和变量进行解码,通过ue/ se/te解码单元求解与CAVLC相关的参数,通过二进制算术解码单元求解与CABAC相关的参数,最终得到的参数再提供给CAVCL或CABAC残差解码模块使用; [0062] A software module 4: residual decoding some or all of the required parameters and local variables and decoding by ue / se te decoding unit parameter related to solving / CAVLC, CABAC solving the parameters associated with the binary arithmetic decoding unit, finally obtained and supplied to the parameter CAVCL or CABAC residual decoding module;

[0063] 二进制算术解码单元5 :除了软件模块在解码与残差相关的参数时需要借助该模块以外,在进行CABAC残差解码的时候,CABAC残差解码模块向该模块发送解码请求,经解码,返回得到二进制结果; [0063] The binary arithmetic decoding unit 5: a software module in addition to the parameter associated with the residual decoding required by the module except when performing residual decoding CABAC, a residual decoding module CABAC decoding request sent to the module, decoded returns the resulting binary result;

[0064] 熵解码控制模块6 :控制整个解码流程,先控制软件模块求解相关的参数,负责向CAVLC残差解码模块或者CABAC残差解码模块发出开始解码信号,当接收到解码结束信号后,将解码得到的相应残差系数写入反扫描RAM ; [0064] The entropy decoding control module 6: controls the whole decoding process, the control software module to solve the relevant parameters, responsible for issuing a start decode signal to CABAC or CAVLC residual decoding module residual decoding module, after receiving the decoding end signal, decoding respective residual coefficients are written in the reverse scanning the RAM;

[0065] CABAC残差解码模块7 :以'4X4'块或者MX8'块为单位,根据软件模块解码得到的相应参数,对亮度和色度的残差系数进行解码,解码完成后向熵解码控制模块发出结束信号,解码出来的残差系数存入反扫描RAM. [0065] CABAC residual decoding module 7: A '4X4' block or MX8 'block unit according to the corresponding parameters obtained by decoding the software module, the residual luminance and chrominance coefficients are decoded, after completion of decoding the entropy decoding control module issued end signal, into decoded residual coefficients inverse scan RAM.

[0066] 反扫描RAM8 :根据CAVLC残差解码模块或者CABAC残差解码模块发来的信号,存储经CAVLC残差解码模块或者CABAC残差解码模块解码得到的残差系数。 [0066] The inverse scanning RAM8: residual coefficients obtained according to CABAC or CAVLC residual decoding module decoding a residual signal sent by the module, the module storing the residual decoding CAVLC or CABAC residual decoding module.

[0067] 熵解码首先要确定编码码流的编码方式,编码方式的确定是依据编码模式标志得到,如附图2所示,当编码模式标志entr0py_m0de_flag = 0时表示编码方式为CAVLC编码; 当编码模式标志entr0py_m0de_flag = 1时表示编码方式为CABAC编码,根据判断出的编码方式选择相应的解码方法。 [0067] To determine the entropy decoding first encoded stream coding mode, the coding mode was determined according to the coding mode flag, as shown, when the coding mode flag entr0py_m0de_flag = 0 when CAVLC coded coding mode is represented in Figure 2; when the coding entr0py_m0de_flag = mode flag indicating a coding mode for the CABAC encoding, select the appropriate decoding method according to the determined encoding 1.

[0068] 下面结合附图1说明熵解码器的解码过程: [0068] The following description of the entropy decoder decoding process Figure 1:

[0069] 步骤1 :确定了码流的编码方式之后,熵解码控制模块6根据编码方式决定解码的类型:即是对CAVLC编码码流解码还是对CABAC编码码流解码;如果是解CAVLC编码码流, 则进入步骤2执行,如果是解CABAC编码码流,则进入步骤3执行; [0069] Step 1: after determining the encoding stream, the entropy decoding control module 6 determines the type of decoding according to the encoding method: That is CAVLC coded stream decoding or CABAC encoded stream decoding; if solution CAVLC encoded symbols stream, the process proceeds to step 2, if the solution is CABAC encoding code stream, the process proceeds to step 3;

[0070] 步骤2 :进行CAVLC解码; [0070] Step 2: CAVLC decoding;

[0071] 步骤3 :进行CABAC解码; [0071] Step 3: CABAC decoding;

[0072] 步骤4 :步骤(2)或步骤(3)完成后,返回到步骤(1),继续解下一个片(slice)的数据。 [0072] Step 4: Step (2) or step (3) is completed, returning to step (1), continue to cast off a sheet (Slice) data.

[0073] 如附图1所示,上述步骤(2)所述的进行CAVLC解码的具体步骤为: [0073] As the steps shown in figures 1 (2) Specific CAVLC decoding step is performed:

[0074] 步骤2. 1 :熵解码控制模块6向软件模块4发出开始信号,求解与解码有关的非残差语法元素,如mb_type, sub_mb_type,运云力向量mvd_10, mvd_l 1等; [0074] Step 2.1: entropy decoding module 6 sent to the control software module 4 start signal, and the decoded non-residual solving related syntax elements, such as mb_type, sub_mb_type, transported cloud force vector mvd_10, mvd_l 1 and the like;

[0075] 步骤2. 2 :软件模块4收到来自熵解码控制模块6的开始信号后,经由ue/se/te模块2并最终通过BSI取数模块1得到所需的编码数据流,解码得到所需的除宏块参数以及残差系数以外的其他语法元素; [0075] Step 2.2: 4 software module after receiving the entropy decoding start signal control module 6 from, and finally obtain the desired encoded data stream via ue / se / te module 2 by BSI access module 1, decoded other required syntax elements and parameters other than the macro block of residual coefficients;

[0076] 步骤2. 3 :熵解码控制模块6收到软件模块4发出的结束信号后,向CAVLC残差解码模块3发出解残差开始信号; [0076] Step 2.3: entropy decoding the control module 6 receives the end signal sent by a software module 4, issue start signal to the residual solution CAVLC residual decoding module 3;

[0077] 步骤2. 4 =CAVLC残差解码模块3收到熵解码控制模块6发来的开始信号后开始残差解码,并通过BSI取数据模块1获得解码所需的编码数据,最终解码得到亮度和色度块的残差系数值; [0077] Step 2. 4 = CAVLC residual decoding module 3 receives the residual decoding start signal 6 sent after the start of entropy decoding control module, and an encoded data necessary for decoding to obtain data fetch module BSI, finally decoded residual coefficient values ​​of luminance and chroma blocks;

[0078] 步骤2. 5 :如果解码的不是片(slice)的最后一个宏块,则返回到步骤2. 2,继续解下一个宏块,否则结束。 [0078] Step 2.5: If the last macroblock of slice is not decoded (Slice), and returns to step 2.2, a macro block off his continued, otherwise end.

[0079] 如附图1所示,步骤(3)所述的对CABAC解码的具体步骤为: [0079] As shown in the drawings, Step 1 (3) of the specific steps of CABAC decoding is:

[0080] 步骤3. 1 :对CABAC解码所需的上下文模型进行初始化,并初始化概率区间; [0080] Step 3.1: CABAC context model required for decoding is initialized, and initializes the probability interval;

[0081] 步骤3. 2 :熵解码解码控制模块6向软件模块4发开始信号,开始对残差系数以外其他语法元素如mb_type,sub_mb_type,运动向量mvd_10,mvd_ll等解码,并求解残差解码中要用到的宏块参数和其他参数; [0081] Step 3.2: 6 entropy decoding module decoding control software module 4 to send a start signal to start the other syntax elements such as mb_type, sub_mb_type, motion vector mvd_10, mvd_ll the like other than the decoded residual coefficients, and residual decoding Solving macro block to use and other parameters;

[0082] 步骤3. 3 :软件模块4收到来自熵解码解码控制模块6的开始信号后,经由二进制算术解码单元5并最终通过BSI取数模块1得到所需的编码数据流,解码得到所需的宏块参数以及除残差系数以外的其他语法元素; [0082] Step 3.3: a software module 4 receives the start signal from the entropy decoding of the decoding control module 6, and binary arithmetic decoding unit 5 to give the desired final encoded data stream by taking the number of module 1 via the BSI, the decoded macro block and other parameters to be other than the syntax elements of residual coefficients;

[0083] 步骤3. 4 :熵解码控制模块6向CABAC残差解码模块7发出解残差开始信号; [0083] Step 3.4: entropy decoding module 6 issues a control start signal to the residual solution CABAC residual decoding module 7;

[0084] 步骤3. 5 =CABAC残差解码模块7收到熵解码控制模块6发来的开始信号后开始残差解码,同样经由二进制算术解码单元5并最终通过BSI取数模块1得到所需的编码数据流,最终解码得到亮度和色度块的残差系数值; [0084] Step 3. 5 = CABAC residual decoding module 7 receives the residual decoding start entropy decoding module control start signal sent to 6, 5 and finally obtain the desired number by taking BSI module 1 via the same binary arithmetic decoding unit the coded data stream, the residuals finally decoded coefficient values ​​of the luma and chroma blocks;

[0085] 步骤3. 6 :如果解码的不是片(slice)的最后一个宏块,回到步骤3. 2,否则结束。 [0085] Step 3.6: If the last macroblock of slice is not decoded (Slice), and returns to step 3.2, otherwise end.

[0086] 下面参考图3说明对一个片数据的宏块进行CAVLC解码的流程: [0086] Referring to FIG 3 illustrates a flow of the macroblock slice data CAVLC decoding:

[0087] 步骤1 :由软件模块完成求出与宏块解码相关的变量和参数,如mb_type、mb_ skip_flag>sub_mb_type、mvd_10、mvd_ll、ref_idx_10、ref_idx_ll、mb_qp_delta、intra_ chroma_pred_mode 等; [0087] Step 1: By obtaining software module associated with a macroblock decoding variables and parameters, such as mb_type, mb_ skip_flag> sub_mb_type, mvd_10, mvd_ll, ref_idx_10, ref_idx_ll, mb_qp_delta, intra_ chroma_pred_mode the like;

[0088] 步骤2 :由步骤1得到解码时所需的当前宏块以及邻近宏块等解码所需的参数后, 由于一个宏块包含一个16 X 16的亮度块和两个8 X 8的色度块Cb和Cr,所以下面按照先亮度后色度的顺序对宏块进行解码。 [0088] Step 2: After the time necessary to obtain a decoded parameter necessary for decoding the current macroblock and neighboring macroblocks like the step 1, since one luminance macroblock contains a 16 X 16 blocks and two 8 X 8 of colors block of Cb and Cr, so the following according to the sequence of the first luminance-chrominance macroblock is decoded.

[0089] 对亮度块进行解码: [0089] The decoded luminance block:

[0090] 进行亮度块解码时,由于亮度块包含16X 16个像素点,解码时以4X4块为基本的解码单位,即每次对一个4X4块解码,共分16次完成一个16X 16亮度块的解码。 [0090] When the luminance block decoding, since the luminance block comprising 16 pixels points 16X, when decoded 4X4 block as the basic unit of decoding, i.e. every time a 4X4 block decoding, consists of 16 times to complete a luminance block 16X 16 decoding. 在每个16X16亮度块中,每个4X4块有一个直流系数,16个4X4亮度块共有16个直流系数;解码时首先对16个亮度的直流(DC)系数进行解码,然后对16个4X4亮度块的交流系数(AC) 进行解码,每个4X4交流系数块有15个交流系数。 In each 16X16 luma block, each block having a DC coefficient 4X4, 4X4 luma block 16 a total of 16 DC coefficient; First 16 luminance direct current (DC) coefficient decoding for decoding, and the brightness of 16 4X4 AC coefficients of the block (AC) decodes the AC coefficient of each 4X4 block has 15 AC coefficients.

[0091] 对色度块进行解码: [0091] decoding a chrominance block:

[0092] 解码完16X16亮度块后,接着对两个8X8色度块解码,同样的以4X4块为基本的解码单位,同样先解码直流系数。 [0092] After decoding 16X16 luma blocks, chroma blocks and then decoded two 8X8, 4X4 block in the same basic unit of decoding, to decode the same dc coefficient. 每个8 X 8色度块有4个直流系数,分别完成对Cb和Cr 块的直流系数的解码后,再对Cb和Cr块的交流系数进行解码,对两个色度块的解码顺序都是先Cb块后Cr块。 Each 8 X 8 block has four chroma DC coefficients, respectively, after completion of the decoded DC coefficients Cb and Cr blocks, and then AC coefficients Cb and Cr blocks is decoded, the decoding order of the two chrominance blocks are Cr Cb block is the first block.

[0093] 步骤3 :完成对16X 16亮度块和Cb及Cr色度块的解码之后,一个宏块的数据就解码完了,可以继续下一个宏块的解码。 [0093] Step 3: After completion of the decoding 16X 16 luminance blocks and chrominance blocks Cb and Cr, data of one macro block decodes finished, can continue to decode the next macroblock.

[0094] 下面参考图4以对一个亮度4X4块或色度4X4块残差系数进行CAVLC解码说明CAVLC残差解码的过程: [0094] Referring to FIG 4 for a luminance or chrominance block 4X4 4X4 residual block coefficients CAVLC decoding CAVLC residual decoding process described:

[0095] 步骤401 :确定所要解码的系数是亮度系数还是色度系数,是直流系数还是交流系数; [0095] Step 401: determining a coefficient to be decoded chrominance coefficient or brightness coefficient, the coefficient is a DC coefficient or AC;

[0096] 步骤402 :如果色度直流系数为1,参数nC = 1,是对色度直流系数进行解码,否则nC= (nA+nB)/2,其中nA,nB分别表示解码残差块的左边和正上方参考块中非零系数的个数。 [0096] Step 402: If the chroma DC coefficient is 1, the parameter nC = 1, chroma DC coefficient is decoded, otherwise nC = (nA + nB) / 2, where nA, nB denote decoded residual block left and right above the reference number of nonzero coefficients in the block.

[0097] 步骤403 :由于CAVLC是变长编码,采用的不是固定的码表,因此,根据步骤2得到的nC的值决定着进行解码时采用哪一个码表,以及是采用变长码表还是定长码表或者是否使用码表。 [0097] Step 403: Because CAVLC is variable-length coding, is not fixed code table used, and therefore, according to the value nC is obtained in Step 2 determines which of the code table employed when decoding, as well as is the use of variable-length code table or or fixed-length code table whether the code table.

[0098] 步马聚404 :查表求角军numtrailingones,其中numtraiIingones表示拖ϋ系数,艮口从最后一个高频残差系数开始往前连续遇到的1和-1的个数(1和-1之间可以包括0), numtraiIingones的值不超过3。 [0098] Step 404 Poly Ma: ANGULAR lookup military numtrailingones, wherein ϋ numtraiIingones drag coefficient represents the number 1 and -1 Gen opening a high-frequency residual coefficients from the last start continuous forward encountered (and 1 - 1 may comprise between 0), the value of not more than 3 numtraiIingones. numtraiIingones的作用在于,在进行编码的时候,对于4X4块中高频部分的系数多为1,0,-1的情况,编码的时候,可以只记录1,-1的个数以及符号位即可,而无需像其他的残差系数一样要对整个系数值level进行编码,提高了编码效率。 NumtraiIingones effect is that, when performing coding, for a portion of the high frequency coefficients mostly 4X4 blocks, 0, -1, the encoding, they can only record 1, -1, and the number of sign bits can, like other without residual coefficients to be encoded as the value of the entire system level, improving the coding efficiency.

[0099] 步骤405 :对拖尾系数trailingones部分的系数符号进行解码,得到traiIingones部分的幅值level的值,1或者-1。 [0099] Step 405: the coefficient of the coefficient signs trailingones trailing portion is decoded to obtain the value of the amplitude level of traiIingones portion, 1 or -1.

[0100] 步骤406 :解除拖尾系数之外的其他非零系数的值level,加上步骤5中得到的拖尾系数部分的level值,得到4X4块中的非零系数值level [i],这里的I表示幅值level 的序号。 [0100] Step 406: The value of level of nonzero coefficients other than the trailing coefficients of lift, level plus the trailing portion of the value of the coefficient obtained in Step 5, to give a non-zero coefficient value level [i] 4X4 block, where I represents the amplitude level of the serial number.

[0101] 步骤407 :根据相应的码表求得TotalZeros的值,TotaUeros表示4X4中最后一个非零系数前零的个数。 [0101] Step 407: The appropriate code table of calculated values ​​TotalZeros, TotaUeros represents the number before the last nonzero coefficient in the 4X4 zero.

[0102] 步骤408 :求各个非零系数得rim的值,rim表示各非零系数前零的个数,分别用run[i]表示,其中i是非零系数level的序号。 [0102] Step 408: Find each non-zero coefficient values ​​obtained rim, the rim represents the number of zero coefficients before each non-zero, respectively RUN [i], where i is the level number of nonzero coefficients.

[0103] 步骤409 :结束:根据前面得到的level [i],rim[i]的值从低频部分第一个系数就可以恢复16个4X4块的残差系数值。 [0103] Step 409: End: The previously obtained level [i], the value of rim [i] can be restored coefficient values ​​16 4X4 residual blocks from the low frequency portion of a coefficient.

[0104] 下面举ί歹Ij 说明numtrai lingones,numcoeff, TotalZeros, level [ j], run [ j]白勺含义:如附图7所示为一个4X4块的16个残差系数:这里numtrai lingones = 3,numcoeff =6, TotalZeros = 10, level [j], run [j]的值已经在图中注明。 [0104] For the following description ί bad Ij numtrai lingones, numcoeff, TotalZeros, level [j], run [j] White spoon meanings: As shown in the figures 7 to 16 a 4X4 residual block coefficients: where numtrai lingones = 3, numcoeff = 6, TotalZeros = 10, level [j], run [j] value has been indicated in the figure. 其中的符号i表示4X4 子块中残差系数的序号,level [j],rim[j]中的符号j表示非零系数level [j]和零行程run[j]的序号。 Where i represents a symbol number of 4X4 ​​sub-blocks of residual coefficients, level [j], the symbol j rim [j] indicates the non-zero coefficients level [j] and the zero run run [j] of the sequence number.

[0105] 下面参考图5说明对一个片数据中的一个宏块进行CABAC解码的流程: [0105] Referring to FIG. 5 illustrates the flow of data in a slice of a CABAC decoding macroblock of:

[0106] 步骤1 :对上下文模型和概率区间进行初始化;CABAC是自适应的二进制算术编码,所以无论是在解码还是编码时对它的上下文模型和概率区间都必须先进行初始化,才能保证解码时和编码时使用的是相同的上下文模型和概率区间; When the CABAC is adaptive binary arithmetic coding, so it is and its context model probability interval must be initialized when decoding or encoding to ensure that the decoding; context model and the probability interval is initialized: [0106] Step 1 and encoding using the same context model and the probability interval;

[0107] 步骤2 :开始对残差系数以外其他语法元素,如mb_type,sub_mb_type,运动向量mvd_10,mvd_ll等解码,并求解残差解码中要用到的宏块参数,由于这一部分需要占用较多地硬件资源,所以这里采用软件的方式完成; [0107] Step 2: Start syntax elements other than residual coefficients, such mb_type, sub_mb_type, motion vector mvd_10, mvd_ll other decoded and a macroblock in solving residual decoding parameter to use, since this part needs to occupy more the hardware resources, so here is accomplished using software;

[0108] 步骤3 :下面对一个残差宏块进行解码;一个宏块包含一个16X 16的亮度块和两个8 X 8的色度块Cb和Cr,此处和CAVLC的解码顺序一样,仍然按照先亮度后色度的顺序对宏块进行解码;[0109] 步骤4 :以4 X 4块或者8 X 8块为基本单位对亮度进行解码。 [0108] Step 3: Next, a residual macroblock decoding; a macroblock comprising luminance blocks and a 16X 16 two 8 X 8 blocks of chrominance Cb and Cr, and here, like the CAVLC decoding order, still decode the macroblock according to the sequence of the first luminance-chrominance; [0109] step 4: 4 to 4 X-8 X 8 block or blocks as a basic unit of decoding the luminance. 如果有直流系数,先对亮度直流系数进行解码,一共16个亮度dc系数;然后以4X 4块为基本单位,对剩余的亮度交流系数进行解码,共16个4X4交流系数块;如果只有交流系数,直接以4X4块或者8X8块为基本单位对交流系数进行解码。 If the DC coefficient, to the luminance DC coefficient decoding, a total of 16 luminance dc coefficient; then 4X 4 blocks as a basic unit, the remaining luminance AC coefficient decoding, a total of 16 4X4 AC coefficient block; if only AC coefficients , or directly to the 4X4 8X8 block AC coefficient decoding block as a basic unit. 这样就完成了亮度块的解码过程; This completes the process of decoding the luminance blocks;

[0110] 步骤5 :按照先DC系数后AC系数先Cb后Cr块的顺序对两个色度块Cb和Cr块进行解码,先解Cb和Cr块的DC系数,然后再解Cb和Cr块的AC系数,每个8 X 8色度块一共得到4个DC系数和60个AC系数; [0110] Step 5: Cr sequence of AC coefficients after the first block of the two chrominance blocks Cb Cb and Cr block to decode the DC coefficients according to the first, the first solution Cb and Cr block DC coefficient, then blocks Cb and Cr Solutions AC coefficients, each 8 X 8 blocks of chrominance received a total of 4 DC coefficient and 60 AC coefficients;

[0111] 步骤6 :继续解下一个宏块。 [0111] Step 6: Continue untied one macro block.

[0112] 下面参考图6以解一个4X4残差数据块为例来说明CABAC的解码过程: [0112] Referring next to Figure 6 to extract a 4X4 residual block CABAC decoding process will be described as an example of:

[0113] 步骤601 :根据标志c0ded_bl0ck_flag的值决定是否需要对该4X4块进行解码。 [0113] Step 601: The value of the flag determines whether c0ded_bl0ck_flag decodes the 4X4 block. 如果COded_blOCk_flag = 0,表示该4X4块中系数全为零,所以不必进行解码,当codecL block_flag = 1时进行下一步; If COded_blOCk_flag = 0, represents the 4X4 block coefficients are all zero, it is not necessary to decode the next step when codecL block_flag = 1;

[0114] 步骤602 :计算4X4块中非零系数的幅值coeffLevel [i],从低频到高频的顺序, 以i表示系数的标号; [0114] Step 602: calculating the block of non-zero coefficients 4X4 amplitude coeffLevel [i], from low to high sequence, to i represents a numeral coefficients;

[0115]步骤 603 :计算非零系数的coeffLevel [i]的绝对值abs (coeffLevel [i]); [0115] Step 603: calculating nonzero coefficient coeffLevel [i] is the absolute value abs (coeffLevel [i]);

[0116] 步骤604:计算非零系数的符号sign; [0116] Step 604: The sign SIGN nonzero coefficients is calculated;

[0117] 步骤605〜606 :由上面的得到的非零系数的符号决定非零系数的值; [0117] Step 605~606: nonzero coefficients determined by the sign of the nonzero coefficients obtained above;

[0118] 步骤607:根据已有的残差系数的大小和位置信息,加上符号信息,对4X4块的16 个残差系数进行恢复,得到4X4块的16个残差系数的值; [0118] Step 607: The size and location information existing residual coefficients, plus the symbol information, for 16 4X4 residual block coefficients to recover, to give 16 values ​​of the 4X4 residual block coefficients;

[0119] 本发明所说的软件方式,是指利用嵌入式cpu代替硬件电路进行运算的方式,而不是单纯的指用计算机软件实现熵解码中的某些计算功能。 [0119] embodiment of the present invention said software, is the use of embedded hardware instead of cpu circuit for computing, rather than simply computing means to achieve certain functions of the entropy decoding using computer software.

[0120] 本发明所用的实例只是用来对上述解码器中所支持的解码功能的一种解释说明, 并不代表本发明所要保护的范围仅限于此,凡采用本发明中所提及的方法和结构,或者采用对某些部分相同功能的替代方案,均在本发明所要求的保护范围,从事本行业的技术人员对此应予理解。 [0120] Examples of the present invention, only one explanation for the above described supported decoder decoding function, do not represent the scope of the claimed invention limited thereto, where the present invention is a method mentioned and the structure, or to use alternative to the function of some part of the same, are in the scope of the claimed invention, in the industry this should be understood in the art.

Claims (4)

1.基于H. 264的熵解码器的实现方法,其特征在于:该方法采用了软硬件协同工作,将解码过程中占用大量资源的部分改用软件程序方法实现,包括如下步骤:步骤1 :熵解码控制模块(6)根据熵编码模式标志选择解码方式:即是对CAVLC编码码流进行解码还是对CABAC编码码流进行解码;步骤2 :根据步骤1选定的解码类型以片(slice)数据为单位对CAVLC或者CABAC编码码流进行解码;步骤3 :解码完成后,判断是否为CAVLC或者CABAC编码码流的最后一个片数据,若不是,返回步骤2继续对下一个片(Slice)的数据进行解码,否则,解码过程结束;该方法步骤2中所述的根据选定的解码类型以片数据为单位对CAVLC编码码流进行解码,其中对CAVLC编码码流的解码还包括如下的具体步骤:步骤2. 1 :熵解码控制模块(6)向软件模块(4)发出开始信号,开始求解与解码有关的变量和 1. H. 264 implementation based on entropy decoder, characterized in that: the method uses a hardware and software to work together to implement the decoding process instead of an expensive part of the software program, comprising the following steps: Step 1: entropy decoding the control module (6) according to the selected entropy coding mode flag decoding mode: that is, the encoded bit stream for decoding CAVLC or CABAC for decoding the encoded stream; step 2: step 1 the type of decoding the selected slice (slice) data units CAVLC or CABAC encoded stream decoding; step 3: after decoding, determines the last slice data is the CAVLC or CABAC coded stream, if not, returns to step 2 to continue to the next slice (the slice) of decoding data, otherwise, the decoding process ends; according to the selected type of decoding slice data CAVLC encoding unit to decode the code stream, wherein the decoding CAVLC coded stream further comprises the specific method described in step 2 step: step 2.1: entropy decoding control module (6) issuing a signal to start a software module (4), starts decoding solved related variables and 数;步骤2. 2 :软件模块(4)收到来自熵解码控制模块(6)的开始信号后,经由ue/se/te解码单元(¾并最终通过BSI取数模块(1)得到所需的编码数据流,经解码得到所需的宏块参数以及除残差系数以外的其他语法元素;步骤2. 3 :熵解码控制模块(6)收到软件模块⑷发出的结束信号后,向CAVLC残差解码模块(¾发出解残差开始信号;步骤2. 4 =CAVLC残差解码模块(¾收到熵解码控制模块(6)发来的开始信号后开始残差解码,并通过BSI取数据模块(1)获得解码所需的编码数据,得到亮度块和色度块的残差系数值;步骤2.5 :判断解码的是否为片数据的最后一个宏块,如果不是,则返回到步骤2. 1继续解下一个宏块,否则解码结束;该方法步骤2所述的根据选定的解码类型以片数据为单位对CABAC编码码流进行解码,对CABAC编码码流的解码还包括如下的具体步骤:步骤2. 1 Number; Step 2.2: the software modules (4) receives the control start signal from the entropy decoding module (6) via ue / se / te decoding unit (¾ and eventually desired by BSI access module (1) encoded data stream to obtain the desired decoded macroblock parameters, and other syntax elements other than residual coefficients; step 2.3: entropy decoding the control module (6) is received the end signal sent ⑷ software module, the CAVLC residual decoding module (¾ start signal issued residual solution; step 2. 4 = CAVLC residual decoding the decoded residual block starts (¾ entropy decoding start signal is received the control module (6) is sent, and the data taken by BSI module (1) necessary for decoding encoded data obtained, to obtain a residual coefficient values ​​of the luma blocks and chroma blocks; step 2.5: determining whether the decoded slice data is the last macro block, if not, the process returns to step 2. 1 continues untied a macroblock, or the decoding end; the method steps according to the selected type of decoding to the slice data CABAC encoding in units of 2 code stream, the decoding of a CABAC coded stream comprising a further specific step: step 2.1 ' :对CABAC解码所需的上下文模型进行初始化,并初始化概率区间; 步骤2. 2':熵解码控制模块(6)向软件模块(4)发出开始信号,开始对除残差系数以外的其他语法元素、运动向量mvd_10,mvd_ll解码,并求解残差解码中用到的宏块参数;步骤2. 3':软件模块(4)收到来自熵解码控制模块(6)的开始信号后,经由二进制算术解码单元(¾并最终通过BSI取数模块(1)得到所需的编码数据流,解码得到所需的宏块参数以及除残差系数以外的其他语法元素;步骤2. 4':熵解码控制模块(6)向CABAC残差解码模块(7)发出解残差开始信号; 步骤2. 5' =CABAC残差解码模块(7)收到熵解码控制模块(6)发来的开始信号后开始残差解码,经由二进制算术解码单元(¾并最终通过BSI取数模块(1)得到所需的编码数据流,解码得到亮度(Iuma)和色度(chroma)块的残差系数值;步骤2. 6': ': CABAC context model required for decoding is initialized and initialized probability interval; Step 2.2': entropy decoding control module (6) (4) issuing a start signal to the software modules, other than the start of another residual coefficients syntax element, motion vector mvd_10, mvd_ll decoded and solving residual decoding macroblock parameters used in; step 2.3 ': software module (4) after the entropy decoding start signal from the control module (6) is received via binary arithmetic decoding unit (BSI ¾ and ultimately obtained by taking the number of modules (1) required to encode the data stream, the decoded macroblock, and other desired parameters other than the syntax elements of residual coefficients; step 2.4 ': entropy decoding control module (6) issued residual solution CABAC residual decoding start signal to the module (7); step 2. 5 '= CABAC residual decoding module (7) receives the entropy decoding start signal control module (6) sent residual decoding after the start, (1) to give the desired encoded data stream via a binary arithmetic decoding unit (BSI ¾ and finally through access module, decoded luminance (Iuma) and chrominance (chroma) a residual block of coefficient values; step 2.6 ': 断解码的宏块是否为片(slice)的最后一个宏块,如果不是,则返回到步骤2. 1 '继续解下一个宏块,否则解码结束。 Off decoding block is a macro slice (Slice) of the last macroblock, if not, returns to step 2.1 'continue untied a macroblock, or the decoding end.
2.根据权利要求1所述的基于H. 264的熵解码器的实现方法,其特征在于:其特征在于:以片数据为单位对CAVLC编码码流进行解码是通过对组成片数据的每个宏块进行解码实现的,所述对单个宏块的解码包括如下的步骤:步骤1 :由软件模块求解与宏块解码相关的变量和参数;步骤2 :根据上述步骤1得到解码所需的当前宏块以及邻近宏块解码所需的参数后,按照先亮度块后色度块的顺序对宏块进行解码;步骤3 :对亮度块进行解码;以4x4块为基本的解码单位,即每次对一个4x4亮度块进行块解码,先对亮度块的直流(DC)系数进行解码,然后再对亮度块的交流系数(AC)进行解码;步骤4 :解码完亮度块后,对色度块进行解码;以4x4块为基本的解码单位,按照先Cb 块后Cr块的顺序,先解码色度块的直流系数,再解码色度块的交流系数; 步骤5 :重复上述步骤,继 2. The method of claim 1 implemented H. entropy decoder 264 based on claim wherein: wherein: slice data CAVLC encoded code stream is decoded by a unit of each of the slice data consisting of macroblock, said step of decoding a single macro block comprises a decoding implementation: step 1: Solution-related macroblock decoding variables and parameters by the software module; step 2: 1 obtained according to the above the current required for decoding step When the desired macroblock and neighboring macroblocks decoded parameters, the order of the first luminance chrominance blocks of the macroblock decoding block; step 3: the luminance block is decoded; 4x4 block to decode the basic unit, that is, each 4x4 luminance block of a block decoding, the first luminance blocks DC (DC) coefficient decoding, then the AC coefficients of the luminance block (AC) decoding; step 4: after the decoded luminance block, chroma block decoding; 4x4 block in the basic unit of decoding in the order of the first block of the Cb Cr block to decode the block of chroma DC coefficients, AC coefficients of the chrominance re-decoded block; step 5: repeat the above steps, following 续解下一个宏块。 Continued untied one macro block.
3.根据权利要求1所述的基于H. 264的熵解码器的实现方法,其特征在于:所述的以片数据为单位对CABAC编码码流进行解码是通过对组成片数据的每个宏块进行解码实现的,所述对单个宏块的解码包括如下的步骤:步骤1 :对上下文模型和概率区间进行初始化;步骤2 :开始对残差系数以外其他语法元素进行解码,并通过采用软件方法求解残差解码中要用到的宏块参数和其他参数;步骤3 :按照先亮度后色度的顺序对残差宏块进行解码;步骤4 :对亮度块的解码;以4x4块或者8x8块为基本单位,先对亮度直流系数进行解码,再对剩余的亮度交流系数进行解码,完成对亮度块的解码过程;步骤5 :对色度块的解码;按照先Cb后Cr块的顺序以4x4块为单位对两个色度块Cb 和Cr块进行解码,先解Cb和Cr块的直流系数,然后再解Cb和Cr块的交流系数; 步骤6 :重复上述步骤 H. 3. Implementation of decoder 264 entropy-based, characterized in that said according to claim 1: the units of slice data CABAC decoding the encoded bit stream for each macro by slice data consisting of block, said single step comprises decoding the macroblock decoding implementation: step 1: the context models are initialized and the probability interval; step 2: start syntax elements other than the residual coefficient decoding, and by using the software method for solving the macroblock residual and other parameters to use in decoding; step 3: according to the sequence of the first luminance-chrominance residual macroblock decoding; step 4: decoding luminance blocks; to 8x8 or 4x4 blocks block as a basic unit, to decode the luminance DC coefficients, and then the remaining luminance AC coefficient decoding process of decoding the luminance complete block; step 5: decoding chroma blocks; Cr in the order of the first block of the Cb to two block units 4x4 chrominance blocks Cb and Cr block to decode the first solution Cb and Cr block DC coefficient, then the AC coefficients Cb and Cr solution block; step 6: repeat the above steps 继续解下一个宏块。 Continue to cast off a macro block.
4.基于H. 264的熵解码器装置,其特征在于,该装置包括如下模块:BSI取数模块:负责从外部取得解码所需的码流数据,当接收到其他模块的取数请求时,返回相应长度的码流数据;ue/se/te解码单元:接收软件模块发送来的解码请求并返回解码后的参数值; CAVLC残差解码模块:以'4X4块'为单位,根据软件模块解码得到的相应参数,对亮度和色度的残差系数进行解码,解码完成后向熵解码控制模块发出结束信号,解码出来的残差系数存入反扫描RAM ;软件模块:对残差解码需要的参数和变量进行解码,通过ue/se/te解码单元求解与CAVLC相关的参数,通过二进制算术解码单元求解与CABAC相关的参数,最终得到的参数再提供给CAVCL或CABAC残差解码模块使用;二进制算术解码单元:在解码与宏块有关的参数时,当收到软件模块发送来的解码请求,经解码返回得到的二 4. Based on H. 264 entropy decoder means, characterized in that the device comprises the following modules: Take the BSI Number Module: responsible for obtaining the data required for decoding the code stream from the outside, when the number of fetch requests received by the other modules, return code stream data of a corresponding length; ue / se / te decoding unit: the receiving software module and transmitted to the decoding request decodes the return value; the CAVLC residual decoding module: to '4X4 block' as a unit, in accordance with software block decoding corresponding parameters obtained, the residual coefficients of luminance and chrominance decoding end signal sent to the entropy decoding control module after completion of decoding, the decoded residual coefficients stored in the RAM reverse scan; software modules: a residual decoding requires decoding the parameters and variables, by ue / se te decoding unit parameter related to solving / CAVLC, binary arithmetic decoding unit by solving parameters related to CABAC, and then the resulting parameters supplied to CAVCL or CABAC residual decoding module; binary the arithmetic decoding unit: when decoding the macroblock-related parameter, when receiving a software module request sent by the decoding, the decoded two return obtained 制结果;另外在进行CABAC残差解码的时,当收到CABAC残差解码模块发送来的解码请求时,经解码返回得到的二进制结果;熵解码控制模块:控制整个解码流程,先控制软件模块求解相关的参数,负责向CAVLC 残差解码模块或者CABAC残差解码模块发出开始解码信号,当接收到解码结束信号后,将解码得到的相应残差系数写入反扫描RAM ;CABAC残差解码模块:以'4X4'块或者'狀8'块为单位,根据软件模块解码得到的相应参数,对亮度和色度的残差系数进行解码,解码完成后向熵解码控制模块发出结束信号,解码出来的残差系数存入反扫描RAM ;反扫描RAM :存储经CAVLC残差解码模块或者CABAC残差解码模块解码得到的残差系数。 Results; during addition of CABAC residual decoding, when receiving the residual decoding CABAC decoding request sent by the module, returns the decoded binary result obtained; entropy decoding control module: controls the entire decoding process, to the control software module solving related parameter, responsible for issuing a start decode signal to CABAC or CAVLC residual decoding module residual decoding module, after receiving the end of the decoded signal, decoding respective residual coefficients are written in the reverse scan the RAM; CABAC residual decoding module : a '4X4' block or '8-shaped' block unit according to the corresponding parameters obtained by decoding the software module, the residual coefficients of luminance and chrominance decoding end signal sent to the control module after the entropy decoding decoded, decoded the residual coefficients stored in the RAM reverse scan; reverse scan RAM: storing the residual coefficients CAVLC or CABAC residual decoding module obtained a residual decoding module.
CN 200610157417 2006-12-07 2006-12-07 Method and device for implementing entropy decoder based on H.264 CN101198051B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200610157417 CN101198051B (en) 2006-12-07 2006-12-07 Method and device for implementing entropy decoder based on H.264

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200610157417 CN101198051B (en) 2006-12-07 2006-12-07 Method and device for implementing entropy decoder based on H.264

Publications (2)

Publication Number Publication Date
CN101198051A CN101198051A (en) 2008-06-11
CN101198051B true CN101198051B (en) 2011-10-05

Family

ID=39548146

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200610157417 CN101198051B (en) 2006-12-07 2006-12-07 Method and device for implementing entropy decoder based on H.264

Country Status (1)

Country Link
CN (1) CN101198051B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104081781A (en) * 2012-01-20 2014-10-01 弗兰霍菲尔运输应用研究公司 Coding concept allowing parallel processing, transport demultiplexer and video bitstream

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9467699B2 (en) 2008-12-03 2016-10-11 Hfi Innovation Inc. Method for performing parallel coding with ordered entropy slices, and associated apparatus
WO2010063184A1 (en) * 2008-12-03 2010-06-10 Mediatek Inc. Method for performing parallel cabac processing with ordered entropy slices, and associated apparatus
CN101990094B (en) * 2009-08-05 2012-11-21 炬力集成电路设计有限公司 Code stream analysis method and device
CN101986708A (en) * 2010-10-29 2011-03-16 北京中星微电子有限公司 Video decoding method and decoder
ES2608788T3 (en) * 2010-11-26 2017-04-17 Nec Corporation Video decoding device, video decoding method and video decoding program
JP2012124838A (en) * 2010-12-10 2012-06-28 Sony Corp Image decoder, image decoding method, image encoder, image encoding method and program
FR2972588A1 (en) * 2011-03-07 2012-09-14 France Telecom Method for encoding and decoding images, corresponding encoding and decoding device and computer programs
CN102355578B (en) * 2011-05-25 2016-12-07 深圳市云宙多媒体技术有限公司 A kind of entropy decoding method, device
JP2013034163A (en) * 2011-06-03 2013-02-14 Sony Corp Image processing device and image processing method
JP2013034162A (en) 2011-06-03 2013-02-14 Sony Corp Image processing device and image processing method
CN107801025A (en) * 2011-06-16 2018-03-13 Ge视频压缩有限责任公司 Decoder, encoder, the method and storage medium of decoding and encoded video
FR2977111A1 (en) 2011-06-24 2012-12-28 France Telecom Method for encoding and decoding images, corresponding encoding and decoding device and computer programs
US9060173B2 (en) * 2011-06-30 2015-06-16 Sharp Kabushiki Kaisha Context initialization based on decoder picture buffer
US9871537B2 (en) * 2011-10-27 2018-01-16 Qualcomm Incorporated Mapping states in binary arithmetic coder for video coding
CN103379331B (en) * 2012-04-28 2018-10-23 南京中兴新软件有限责任公司 A kind of video code flow decoding method and device
CN105657421B (en) * 2016-01-15 2018-08-31 珠海全志科技股份有限公司 8x8 residual error coefficients block coding method and system
CN106993190B (en) * 2017-03-31 2019-06-21 武汉斗鱼网络科技有限公司 Software-hardware synergism coding method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585495A (en) 2004-06-11 2005-02-23 上海大学 Quick selection of prediction modes in H.264/AVC frame
CN1780398A (en) 2004-11-18 2006-05-31 上海乐金广电电子有限公司 CAVLC decoding method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1585495A (en) 2004-06-11 2005-02-23 上海大学 Quick selection of prediction modes in H.264/AVC frame
CN1780398A (en) 2004-11-18 2006-05-31 上海乐金广电电子有限公司 CAVLC decoding method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张力航等.软硬件协同设计技术在H.264解码器设计中的应用.《电子设计应用》.同济大学超大规模集成电路研究所,2006,(第9期),89-92,97+2.

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104081781A (en) * 2012-01-20 2014-10-01 弗兰霍菲尔运输应用研究公司 Coding concept allowing parallel processing, transport demultiplexer and video bitstream
US9930368B2 (en) 2012-01-20 2018-03-27 Ge Video Compression, Llc Coding concept allowing parallel processing, transport demultiplexer and video bitstream
CN104081781B (en) * 2012-01-20 2018-11-02 Ge视频压缩有限责任公司 A kind of encoder, decoder, decoding method and the method for transmitting solution multiplexing

Also Published As

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

Similar Documents

Publication Publication Date Title
CN101542926B (en) System and method for scalable encoding and decoding of multimedia data using multiple layers
CN100473167C (en) Method for encoding images, and image coder
CN100495931C (en) Signal encoding method, signal decoding method, signal encoding apparatus, signal decoding apparatus
CN102088609B (en) Image information coding device
CN100407224C (en) Bit plane coding and decoding for the macroblock field / frame coding type information
CN1794814B (en) Pipelined deblocking filter
CN100348051C (en) An enhanced in-frame predictive mode coding method
CN101836455B (en) A method and an apparatus for processing a video signal
CN101490968B (en) Parallel processing apparatus for video compression
US7932843B2 (en) Parallel CABAC decoding for video decompression
CN1332563C (en) Coding method of video frequency image jump over macro block
CN101507280B (en) Methods and apparatus for reduced resolution partitioning
CN100380980C (en) Method and device for indicating quantizer parameters in a video coding system
CN101204094B (en) Method for scalably encoding and decoding video signal
CN101783965B (en) Image encoding device, image decoding device, image encoding method, and image decoding method
CN102067608B (en) Fragmented reference in temporal compression for video coding
CN101800898B (en) Coding device and method
CN100581232C (en) Method for coding motion in video sequence
CN100415000C (en) Motion image coding method and motion image coder and recording medium
CN100392671C (en) Method and system of context-based adaptive variable length coding for adaptive block transforms
CN100542305C (en) Image information encoding device and method, and image information decoding device and method
CN101969566B (en) Moving image encoding device and moving image encoding method
CN101411197B (en) Methods and systems for refinement coefficient coding in video compression
CN1297148C (en) Moving picture encoding/transmission system, moving picture encoding/transmission method, and encoding apparatus, decoding apparatus, encoding method decoding method and program usable for the same
CN1200568C (en) Optimum scanning method for change coefficient in coding/decoding image and video

Legal Events

Date Code Title Description
C06 Publication
C10 Entry into substantive examination
C14 Grant of patent or utility model
CP01 Change in the name or title of a patent holder