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
residual error
module
decoded
coefficient
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN 200610157417
Other languages
Chinese (zh)
Other versions
CN101198051A (en
Inventor
何铁军
汤加跃
石岭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Shenyang electronic Limited by Share Ltd
Original Assignee
Arkmicro Technologies Inc
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 Arkmicro Technologies Inc filed Critical Arkmicro Technologies Inc
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
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

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

Implementation method and device based on H.264 entropy decoder
Technical field
The invention belongs to integrated circuit digital multimedia processing technology field, relate in particular to a kind of hardware MAE that aims in video communication (media accelerator engine multimedia accelerating engine) and go up method and the device of realizing entropy decoder.
Background technology
Video coding and decoding technology is one of digital multimedia storage and transmission key technologies for application, and the core of video coding comprises: predictive coding, transition coding, entropy coding.As the entropy coding of video coding important component part, be to utilize the method for removing the video data redundancy to reach video data is carried out compression effects.
Entropy coding comprises variable-length encoding and two kinds of coding methods of arithmetic coding.Typical variable-length encoding comprises: H.261, adopt H.263 among the MPEG (Motion Picture Experts Group)-2, the 3D-VLC coding that adopts among the MPEG-4, and H.264/AVC (the H.264 video coding suggestion of the ITU-T of international telecommunication association or the international standard 14496-10 of ISO/IEC are the tenth part of MPEG-4 standard) middle CAVLC (Context-based Adaptive Variable Length Coding) that adopts encodes.Wherein 2D-VLC coding and 3D-VLC coding adopt single code table to encode, and the volume of code table is less, and hardware is realized fairly simple; And the CAVLC coding is dynamically adjusted the code table that uses according to the situation of the syntax elements of having encoded, can obtain very high compression ratio, and cost performance is higher.Most typical in the arithmetic coding is to adopt the CABAC arithmetic coding in H.264/AVC, variable-length encoding relatively, owing to can carry out modeling to context, the probability that source symbol is occurred has estimation more accurately, therefore code efficiency is higher, but compares variable-length encoding, its computation complexity height, hardware is realized complicated, therefore adopts few at present.In general, CAVLC coding is used for the application that real-time is had relatively high expectations more, as visual telephone etc.Though and the CABAC code efficiency is higher, the image encoded quality is better, because the coding more complicated is difficult to use in the higher application of rate request, is used for the application of digital multimedia more, as digital radio and television and digital video storage etc.
The video data that the entropy decoding was encoded entropy coding exactly reduces accurately and reliably, the video data of encoding for the video encoding standard of using H.264/AVC, at two kinds of entropy coding modes that exist, entropy decoder is decoded to the video data of encoding through CAVLC and CABAC respectively.Yet because CAVLC 2D-VLC coding and 3D-VLC coding than before is complicated, the CABAC computation complexity is very high, therefore will need expend suitable resource to the video data decoding of supporting two kinds of entropy coding modes simultaneously.In the IC design, pure ASIC hardware is realized also quite difficulty, also just because of this reason, current H.264 entropy decoding generally just adopts the mode of pure software to realize on computers, the hard-wired entropy decoder of minority is also only supported the CAVLC coded system, it is better so just to have limited performance, the application of the CABAC coding method that compression ratio is higher.
Summary of the invention
Technical problem to be solved by this invention is how to adopt a kind of simple effective method, realizes the entropy decoding to two kinds of video data encoders of CAVLC and CABAC on MAE, can guarantee the quality and the decoding efficiency of decoding, and simple in structure being easy to again realized.
The objective of the invention is to disclose a kind of method and device of among the MAE that H.264 decodes entropy coding residual error data etc. being decoded that be exclusively used in, because the method for the invention has adopted cooperative work of software and hardware, make entropy decoder under the prerequisite that guarantees acquisition reliable decoding efficient and decoding quality, greatly reduce the complexity and the computation complexity of structure, thereby effectively solved the contradiction between structure and the efficient, realized decoding smoothly CAVLC and CABAC entropy coding code stream.
Based on the implementation method of H.264 entropy decoder, it is characterized in that: this method has adopted cooperative work of software and hardware, uses the part that takies ample resources in the decode procedure instead the software program method and realizes, comprises the steps:
Step 1: entropy decoding control module (6) is selected decoding process according to the entropy coding mode flags: promptly be that the CAVLC encoding code stream is decoded or the CABAC encoding code stream is decoded;
Step 2: the decoding type selected according to step 1 is that unit decodes to CAVLC or CABAC encoding code stream with sheet (slice) data;
Step 3: after decoding is finished, judge whether last sheet data into CAVLC or CABAC encoding code stream, if not, return step 2 and continue the data of next sheet (Slice) are decoded, otherwise decode procedure finishes.
Implementation method based on H.264 entropy decoder, describedly use the part that takies ample resources in the decode procedure instead the software program method and realize, it is characterized in that: described software program method is meant the mode of utilizing embedded cpu to replace hardware circuit to carry out computing, rather than simple finger is realized some computing function in the entropy decoding with computer software.
The implementation method of described entropy decoder based on H.264, it is characterized in that: the selected decoding type of the basis described in this method step 2 is that unit decodes to the CAVLC encoding code stream with the sheet data, and wherein said decoding to the CAVLC encoding code stream also comprises following concrete steps:
Step 2.1: entropy decoding control module (6) is sent commencing signal to software module (4), begins to find the solution and relevant variable and the parameter of decoding;
Step 2.2: after software module (4) is received commencing signal from entropy decoding control module (6), also finally obtain required encoded data stream via ue/se/te decoding unit (2), obtain required macroblock parameters and other syntactic elements except that residual error coefficient through decoding by BSI peek module (1);
Step 2.3: after entropy decoding control module (6) is received the end signal that software module (4) sends, send to CAVLC residual error decoding module (3) and to separate the residual error commencing signal;
Step 2.4:CAVLC residual error decoding module (3) begins residual error decoding after receiving the commencing signal that entropy decoding control module (6) sends, and obtains the required coded data of decoding by the BSI module (1) of fetching data, and obtains the residual error coefficient value of luminance block and chrominance block;
Step 2.5: whether what judge decoding is last macro block of sheet data, if not, then turn back to step 2.1 and continue to separate next macro block, otherwise decoding finishes.
The implementation method of described entropy decoder based on H.264, it is characterized in that: to be unit decode to the CAVLC encoding code stream with the sheet data is that described decoding to single macro block comprises following step by realization that each macro block of forming the sheet data is decoded:
Step 1: find the solution and relevant variable and the parameter of macro block decoding by software module;
Step 2: obtain decoding after the required parameter of required current macro and adjacent macroblocks decoding according to above-mentioned steps 1, macro block is decoded according to the order of chrominance block after the first luminance block;
Step 3: luminance block is decoded; With the 4x4 piece is basic decoding unit, promptly a 4x4 luminance block is carried out the piece decoding at every turn, earlier direct current (DC) coefficient of luminance block is decoded, and then the ac coefficient (AC) of luminance block is decoded;
Step 4: after the luminance block of having decoded, chrominance block is decoded; With the 4x4 piece is basic decoding unit, according to the order of Cr piece behind the first Cb piece, and the DC coefficient of the chrominance block of decoding earlier, the ac coefficient of the chrominance block of decoding again;
Step 5: repeat above-mentioned steps, continue to separate next macro block.
The implementation method of described entropy decoder based on H.264, the selected decoding process of these method step 2 described bases is that unit decodes to the CABAC encoding code stream with the sheet data, and it is characterized in that: wherein said decoding to the CABAC encoding code stream also comprises following concrete steps:
Step 2.1 ': the required context model of CABAC decoding is carried out initialization, and the initialization probability interval;
Step 2.2 ': entropy decoding control module (6) is sent commencing signal to software module (4), begins other syntactic elements except that residual error coefficient, motion vector mvd_l0, the mvd_l1 decoding, and find the solution the macroblock parameters of using in the residual error decoding;
Step 2.3 ': after software module (4) is received commencing signal from entropy decoding control module (6), also finally obtain required encoded data stream by BSI peek module (1) via binary arithmetic decoding unit (5), decoding obtains required macroblock parameters and other syntactic elements except that residual error coefficient;
Step 2.4 ': entropy decoding control module (6) is sent to CABAC residual error decoding module (7) and is separated the residual error commencing signal;
Step 2.5 ': CABAC residual error decoding module (7) begins residual error decoding after receiving the commencing signal that entropy decoding control module (6) sends, also finally obtain required encoded data stream by BSI peek module (1) via binary arithmetic decoding unit (5), decoding obtains the residual error coefficient value of brightness (luma) and colourity (chroma) piece;
Step 2.6 ': whether the macro block of judging decoding is last macro block of sheet (slice), if not, then turn back to step 2.1 ' continue to separate next macro block, otherwise decoding finishes.
The implementation method of the entropy decoder based on H.264 of the present invention, it is characterized in that: described to be unit decode to the CABAC encoding code stream is that described decoding to single macro block comprises following step by realization that each macro block of forming the sheet data is decoded with the sheet data:
Step 1: context model and probability interval are carried out initialization;
Step 2: begin other syntactic elements beyond the residual error coefficient are decoded, and macroblock parameters and other parameters that will use in the residual error decoding by adopting software approach to find the solution;
Step 3: the order according to colourity after the first brightness is decoded to residual error macro block;
Step 4: to the decoding of luminance block; With 4x4 piece or 8x8 piece is base unit, earlier the brightness DC coefficient is decoded, and more remaining brightness ac coefficient is decoded, and finishes the decode procedure to luminance block;
Step 5: to the decoding of chrominance block; Order according to Cr piece behind the first Cb is that unit decodes to two chrominance block Cb and Cr piece with the 4x4 piece, separates the DC coefficient of Cb and Cr piece earlier, and then separates the ac coefficient of Cb and Cr piece;
Step 6: repeat above-mentioned steps, continue to separate next macro block.
The invention also discloses a kind of entropy decoder device based on H.264, this device comprises as lower module:
The BSI module of peeking: be responsible for obtaining the required bit stream data of decoding, when receiving the peek request of other modules, return the bit stream data of respective length from the outside;
The ue/se/te decoding unit: the decoding request that the receiving software module is sent is also returned decoded parameter value;
CAVLC residual error decoding module: with ' 4X4 piece ' is unit, the relevant parameter that decoding obtains according to software module, residual error coefficient to brightness and colourity is decoded, and sends end signal to entropy decoding control module after decoding is finished, and the residual error coefficient that decoding is come out deposits counter-scanning RAM in;
Software module: parameter and variable that residual error decoding needs are decoded, find the solution the parameter relevant by the ue/se/e decoding unit with CAVLC, find the solution the parameter relevant with CABAC by the binary arithmetic decoding unit, the parameter that finally obtains offers CAVCL again or CABAC residual error decoding module is used;
Binary arithmetic decoding unit: when the parameter of decoding relevant,, return the binary result that obtains through decoding when the decoding request of receiving that software module is sent with macro block; In addition carry out the CABAC residual error decoding the time, when receiving the decoding request that CABAC residual error decoding module is sent, return the binary result that obtains through decoding;
Entropy decoding control module: control whole decoding process, elder generation's Control Software module is found the solution relevant parameter, be responsible for sending the beginning decoded signal to CAVLC residual error decoding module or CABAC residual error decoding module, after receiving the decoding end signal, the corresponding residual error coefficient that decoding is obtained writes counter-scanning RAM;
CABAC residual error decoding module: with ' 4X4 ' piece or ' 8X8 ' piece is unit, the relevant parameter that decoding obtains according to software module, residual error coefficient to brightness and colourity is decoded, send end signal to entropy decoding control module after decoding is finished, the residual error coefficient that decoding is come out deposits counter-scanning RAM in;
Counter-scanning RAM: the residual error coefficient that storage obtains through the decoding of CAVLC residual error decoding module or CABAC residual error decoding module.
Remarkable beneficial effect of the present invention is: in the decode procedure of CAVLC and CABAC, especially in decode procedure to the CABAC code stream, the CABAC decoding itself is exactly the process of a complexity, and when other syntactic elements beyond the residual error are decoded, the coded system of CABAC has determined the complexity of decoding, incident is the complexity of calculating, in the ASIC design, if adopting pure hardware fully realizes, this not only will take a large amount of hardware resources, and will certainly increase the difficulty of design greatly.
The present invention proposes a kind of method of among the MAE that H.264 decodes entropy coding residual error data etc. being decoded that is exclusively used in, owing to adopted cooperative work of software and hardware, using the part that takies great amount of hardware resources in the decode procedure instead software mode realizes, make entropy decoder under the prerequisite that guarantees acquisition reliable decoding efficient and decoding quality, greatly reduce the complexity of structure and the complexity of calculating, thereby effectively solved the contradiction between speed and the efficient, realized decoding smoothly CAVLC and CABAC entropy coding code stream.And, owing to adopt solution of the present invention, make entropy decoder can be applied in the actual circuit design, owing to support the decoding of CABAC, can accelerate the H.264 application aspect multimedia video, can be used for the stored digital of SD and other real-time application, as video storage, VOIP, video telephone etc.
Description of drawings
Fig. 1 realizes schematic diagram for the hardware configuration of entropy decoder of the present invention;
The schematic diagram that Fig. 2 selects for the entropy decoding schema;
Fig. 3 is for carrying out the method flow diagram of CAVLC decoding to the data of a macro block;
Fig. 4 is for carrying out the method flow diagram of CAVLC decoding to a 4x4 blocks of data piece;
Fig. 5 is for carrying out the method flow diagram of CABAC decoding to the data of a macro block;
Fig. 6 is for carrying out the method flow diagram that CABAC decodes to a 4x4 piece or 8x8 blocks of data;
Fig. 7 is the subordinate list that illustrates to the parameter in the 4x4 piece;
Embodiment
Below with reference to Figure of description, specify implementation procedure of the present invention.As shown in Figure 1: the entropy decoder device based on H.264 of the present invention, this device comprises as lower module:
The BSI module 1 of peeking: be responsible for obtaining the required bit stream data of decoding, when receiving the peek request of other modules, return the bit stream data of respective length from the outside;
Ue/se/te decoding unit 2: the ue that the receiving software module is sent, se or te decoding request, and return decoded parameter value;
CAVLC residual error decoding module 3: with ' 4X4 piece ' is unit, the relevant parameter that decoding obtains according to software module, residual error coefficient to brightness and colourity is decoded, and sends end signal to entropy decoding control module after decoding is finished, and the residual error coefficient that decoding is come out deposits counter-scanning RAM in;
Software module 4: some are all decoded with local parameter and variable to residual error decoding needs, find the solution the parameter relevant by the ue/se/te decoding unit with CAVLC, find the solution the parameter relevant with CABAC by the binary arithmetic decoding unit, the parameter that finally obtains offers CAVCL again or CABAC residual error decoding module is used;
Binary arithmetic decoding unit 5: except software module need be by this module when the decoding parameter relevant with residual error, when carrying out the CABAC residual error decoding, CABAC residual error decoding module sends the decoding request to this module, through decoding, returns and obtains binary result;
Entropy decoding control module 6: control whole decoding process, elder generation's Control Software module is found the solution relevant parameter, be responsible for sending the beginning decoded signal to CAVLC residual error decoding module or CABAC residual error decoding module, after receiving the decoding end signal, the corresponding residual error coefficient that decoding is obtained writes counter-scanning RAM;
CABAC residual error decoding module 7: with ' 4X4 ' piece or ' 8X8 ' piece is unit, the relevant parameter that decoding obtains according to software module, residual error coefficient to brightness and colourity is decoded, send end signal to entropy decoding control module after decoding is finished, the residual error coefficient that decoding is come out deposits counter-scanning RAM. in
Counter-scanning RAM8: according to the signal that CAVLC residual error decoding module or CABAC residual error decoding module are sent, the residual error coefficient that storage obtains through CAVLC residual error decoding module or the decoding of CABAC residual error decoding module.
Entropy decoding at first will be determined the coded system of encoding code stream, and the determining of coded system obtains according to the coding mode sign, and as shown in Figure 2, the presentation code mode is the CAVLC coding when coding mode sign entropy_mode_flag=0; The presentation code mode is the CABAC coding when coding mode sign entropy_mode_flag=1, according to the corresponding coding/decoding method of the coding mode selection of judging.
Decode procedure below in conjunction with accompanying drawing 1 explanation entropy decoder:
Step 1: determined after the coded system of code stream entropy decoding control module 6 type that decision is decoded according to coded system: promptly be to decode to the decoding of CAVLC encoding code stream or to the CABAC encoding code stream; If separate the CAVLC encoding code stream, then enter step 2 and carry out, if separate the CABAC encoding code stream, then enter step 3 and carry out;
Step 2: carry out the CAVLC decoding;
Step 3: carry out the CABAC decoding;
Step 4: after step (2) or step (3) are finished, turn back to step (1), the data that continue to separate next sheet (slice).
As shown in Figure 1, the concrete steps of the described CAVLC of the carrying out decoding of above-mentioned steps (2) are:
Step 2.1: entropy decoding control module 6 is sent commencing signal to software module 4, finds the solution and the relevant non-residual error syntactic element of decoding, and as mb_type, sub_mb_type, motion vector mvd_l0, mvd_l1 etc.;
Step 2.2: after software module 4 is received commencing signal from entropy decoding control module 6, also finally obtain required encoded data stream by BSI peek module 1 via ue/se/te module 2, decoding obtains required other syntactic elements except that macroblock parameters and residual error coefficient;
Step 2.3: after entropy decoding control module 6 is received the end signal that software module 4 sends, send to CAVLC residual error decoding module 3 and to separate the residual error commencing signal;
Step 2.4:CAVLC residual error decoding module 3 begins residual error decoding after receiving the commencing signal that entropy decoding control module 6 sends, and obtains the required coded data of decoding by the BSI module 1 of fetching data, and final decoding obtains the residual error coefficient value of brightness and chrominance block;
Step 2.5: if decoding is not last macro block of sheet (slice), then turn back to step 2.2, continue to separate next macro block, otherwise finish.
As shown in Figure 1, the described concrete steps to the CABAC decoding of step (3) are:
Step 3.1: the required context model of CABAC decoding is carried out initialization, and the initialization probability interval;
Step 3.2: entropy decoding decoding control module 6 is to 4 commencing signals of software module, begin other syntactic elements such as mb_type beyond the residual error coefficient, sub_mb_type, motion vector mvd_l0, decodings such as mvd_l1, and find the solution macroblock parameters and other parameters that will use in the residual error decoding;
Step 3.3: after software module 4 is received commencing signal from entropy decoding decoding control module 6, also finally obtain required encoded data stream by BSI peek module 1 via binary arithmetic decoding unit 5, decoding obtains required macroblock parameters and other syntactic elements except that residual error coefficient;
Step 3.4: entropy decoding control module 6 is sent to CABAC residual error decoding module 7 and is separated the residual error commencing signal;
Step 3.5:CABAC residual error decoding module 7 begins residual error decoding after receiving the commencing signal that entropy decoding control module 6 sends, also finally obtain required encoded data stream by BSI peek module 1 via binary arithmetic decoding unit 5 equally, final decoding obtains the residual error coefficient value of brightness and chrominance block;
Step 3.6: if decoding is not last macro block of sheet (slice), get back to step 3.2, otherwise finish.
The macro block of sheet data is carried out the flow process of CAVLC decoding below with reference to Fig. 3 explanation:
Step 1: finish by software module and to obtain variable and the parameter relevant, as mb_type, mb_skip_flag, sub_mb_type, mvd_l0, mvd_l1, ref_idx_l0, ref_idx_l1, mb_qp_delta, intra_chroma_pred_mode etc. with macro block decoding;
Step 2: when obtaining decoding after the required parameter of decodings such as required current macro and adjacent macroblocks by step 1, because a macro block comprises one 16 * 16 luminance block and two 8 * 8 chrominance block Cb and Cr, so following order according to colourity after the first brightness is decoded to macro block.
Luminance block is decoded:
Carrying out luminance block when decoding, because luminance block comprises 16 * 16 pixels, is basic decoding unit with 4 * 4 during decoding, promptly at every turn to 4 * 4 decodings, is divided into the decoding of finishing one 16 * 16 luminance block for 16 times.In each 16 * 16 luminance block, each 4 * 4 have a DC coefficient, and 16 4 * 4 luminance block have 16 DC coefficient; During decoding at first direct current (DC) coefficient to 16 brightness decode, then the ac coefficient (AC) of 16 4 * 4 luminance block is decoded, each 4 * 4 ac coefficient piece has 15 ac coefficients.
Chrominance block is decoded:
After 16 * 16 luminance block of having decoded, then to two 8 * 8 chrominance block decodings, same with 4 * 4 be basic decoding unit, the same DC coefficient of decoding earlier.Each 8 * 8 chrominance block has 4 DC coefficient, finish decoding respectively to the DC coefficient of Cb and Cr piece after, again the ac coefficient of Cb and Cr piece is decoded, all be Cr piece behind the first Cb piece to the decoding order of two chrominance block.
Step 3: finish after the decoding to 16 * 16 luminance block and Cb and Cr chrominance block, the data of a macro block just decoding are over, and can continue the decoding of next macro block.
Below with reference to Fig. 44 * 4 of brightness or 4 * 4 residual error coefficients of colourity are carried out the process of CAVLC decoding explanation CAVLC residual error decoding:
Step 401: determining that the coefficient that will decode is luminance factor or chromaticity coefficent, is DC coefficient or ac coefficient;
Step 402: if the colourity DC coefficient is 1, parameter nC=1 is that the colourity DC coefficient is decoded, otherwise nC=(nA+nB)/2, nA wherein, nB represent respectively the decoded residual piece the left side and directly over the number of nonzero coefficient in the reference block.
Step 403: because CAVLC is variable-length encoding, employing be not the code table of fixing, therefore, which code table is the value of the nC that obtains according to step 2 adopt when determining to decode, and is to adopt variable length code table or fixed length code table or do not use code table.
Step 404: table look-up and find the solution numtrailingones, wherein numtrailingones represents the coefficient that trails, i.e. 1 and-1 the number (can comprise 0 between 1 and-1) that begins to run into continuously forward from last high frequency residual error coefficient, the value of numtrailingones is no more than 3.The effect of numtrailingones is, when encoding, coefficient for 4 * 4 medium-high frequency parts mostly is 1,0 ,-1 situation is in the time of coding, can only write down 1,-1 number and sign bit get final product, and need not will whole coefficient value level to be encoded as other residual error coefficient, have improved code efficiency.
Step 405: the coefficient symbols to hangover coefficient trailingones part is decoded, and obtains the value of the amplitude level of trailingones part, 1 or-1.
Step 406: remove the value level of other nonzero coefficients outside the hangover coefficient, add the level value of the hangover coefficient part that obtains in the step 5, obtain the zero coefficient values level[i in 4 * 4], the I here represents the sequence number of amplitude level.
Step 407: try to achieve the value of TotalZeros according to corresponding code table, TotalZeros represents the number of last nonzero coefficient leading zero in 4 * 4.
Step 408: ask each nonzero coefficient to get the value of run, run represents the number of each nonzero coefficient leading zero, uses run[i respectively] expression, wherein i is the sequence number of nonzero coefficient level.
Step 409: finish: according to the level[i that obtains previously], run[i] value just can recover 16 4 * 4 residual error coefficient value from first coefficient of low frequency part.
Illustrate numtrailingones below, numcoeff, TotalZeros, level[j], run[j] implication: 16 residual error coefficients that are 4 * 4 as shown in Figure 7: numtrailingones=3 here, numcoeff=6, TotalZeros=10, level[j], run[j] value indicate in the drawings.Symbol i wherein represents the sequence number of residual error coefficient in 4 * 4 sub-pieces, level[j], run[j] in symbol j represent nonzero coefficient level[j] and zero stroke run[j] sequence number.
A macro block in the sheet data is carried out the flow process of CABAC decoding below with reference to Fig. 5 explanation:
Step 1: context model and probability interval are carried out initialization; CABAC is adaptive binary arithmetic coding, thus be all must carry out initialization earlier to its context model and probability interval in decoding or when coding, in the time of could guaranteeing decoding when encoding use be identical context model and probability interval;
Step 2: begin to other syntactic elements beyond the residual error coefficient, as mb_type, sub_mb_type, motion vector mvd_l0, decodings such as mvd_l1, and find the solution the macroblock parameters that will use in the residual error decoding, because this part need take more ground hardware resource, so adopt the mode of software to finish here;
Step 3 a: following residual error macro block is decoded; A macro block comprises one 16 * 16 luminance block and two 8 * 8 chrominance block Cb and Cr, and the decoding order with CAVLC is the same herein, still according to the order of colourity after the first brightness macro block is decoded;
Step 4: with 4 * 4 or 8 * 8 is that base unit is decoded to brightness.If DC coefficient is arranged, earlier the brightness DC coefficient is decoded, altogether 16 brightness dc coefficients; Be base unit with 4 * 4 then, remaining brightness ac coefficient decoded, totally 16 4 * 4 ac coefficient pieces; If have only ac coefficient, be that base unit is decoded to ac coefficient directly with 4 * 4 or 8 * 8.So just finished the decode procedure of luminance block;
Step 5: the order according to Cr piece behind the Cb of AC coefficient elder generation behind the first DC coefficient is decoded to two chrominance block Cb and Cr piece, separate the DC coefficient of Cb and Cr piece earlier, and then separate the AC coefficient of Cb and Cr piece, each 8 * 8 chrominance block obtains 4 DC coefficients and 60 AC coefficients altogether;
Step 6: continue to separate next macro block.
Is the decode procedure that example illustrates CABAC below with reference to Fig. 6 to separate one 4 * 4 residual error data piece:
Step 601: the value according to sign coded_block_flag determines whether needs are decoded to these 4 * 4.If coded_block_flag=0 represents that these 4 * 4 middle coefficients are zero entirely, so needn't decode, carry out next step when coded_block_flag=1;
Step 602: the amplitude coeffLevel[i that calculates 4 * 4 middle nonzero coefficients], the order from the low frequency to the high frequency is represented the label of coefficient with i;
Step 603: the coeffLevel[i that calculates nonzero coefficient] absolute value abs (coeffLevel[i]);
Step 604: the symbol sign that calculates nonzero coefficient;
Step 605~606: the value that determines nonzero coefficient by the symbol of the top nonzero coefficient that obtains;
Step 607: size and positional information according to existing residual error coefficient, add symbolic information, 16 residual error coefficients of 4 * 4 are recovered, obtain the value of 16 residual error coefficients of 4 * 4;
The said software mode of the present invention is meant the mode of utilizing embedded cpu to replace hardware circuit to carry out computing, rather than simple finger is realized some computing function in the entropy decoding with computer software.
The used example of the present invention just is used for a kind of of decoding function who is supported in the above-mentioned decoder explained; do not represent invention which is intended to be protected to only limit to this; mentioned method and structure among all employing the present invention; perhaps adopt replacement scheme to some part identical function; all at protection range of the presently claimed invention, the technical staff who is engaged in the industry is understood that this.

Claims (4)

1. based on the implementation method of H.264 entropy decoder, it is characterized in that: this method has adopted cooperative work of software and hardware, uses the part that takies ample resources in the decode procedure instead the software program method and realizes, comprises the steps:
Step 1: entropy decoding control module (6) is selected decoding process according to the entropy coding mode flags: promptly be that the CAVLC encoding code stream is decoded or the CABAC encoding code stream is decoded;
Step 2: the decoding type selected according to step 1 is that unit decodes to CAVLC or CABAC encoding code stream with sheet (slice) data;
Step 3: after decoding is finished, judge whether last sheet data into CAVLC or CABAC encoding code stream, if not, return step 2 and continue the data of next sheet (Slice) are decoded, otherwise decode procedure finishes;
The selected decoding type of basis described in this method step 2 is that unit decodes to the CAVLC encoding code stream with the sheet data, and wherein the decoding to the CAVLC encoding code stream also comprises following concrete steps:
Step 2.1: entropy decoding control module (6) is sent commencing signal to software module (4), begins to find the solution and relevant variable and the parameter of decoding;
Step 2.2: after software module (4) is received commencing signal from entropy decoding control module (6), also finally obtain required encoded data stream via ue/se/te decoding unit (2), obtain required macroblock parameters and other syntactic elements except that residual error coefficient through decoding by BSI peek module (1);
Step 2.3: after entropy decoding control module (6) is received the end signal that software module (4) sends, send to CAVLC residual error decoding module (3) and to separate the residual error commencing signal;
Step 2.4:CAVLC residual error decoding module (3) begins residual error decoding after receiving the commencing signal that entropy decoding control module (6) sends, and obtains the required coded data of decoding by the BSI module (1) of fetching data, and obtains the residual error coefficient value of luminance block and chrominance block;
Step 2.5: whether what judge decoding is last macro block of sheet data, if not, then turn back to step 2.1 and continue to separate next macro block, otherwise decoding finishes;
The selected decoding type of these method step 2 described bases is that unit decodes to the CABAC encoding code stream with the sheet data, and the decoding of CABAC encoding code stream is also comprised following concrete steps:
Step 2.1 ': the required context model of CABAC decoding is carried out initialization, and the initialization probability interval;
Step 2.2 ': entropy decoding control module (6) is sent commencing signal to software module (4), begins other syntactic elements except that residual error coefficient, motion vector mvd_l0, the mvd_l1 decoding, and find the solution the macroblock parameters of using in the residual error decoding;
Step 2.3 ': after software module (4) is received commencing signal from entropy decoding control module (6), also finally obtain required encoded data stream by BSI peek module (1) via binary arithmetic decoding unit (5), decoding obtains required macroblock parameters and other syntactic elements except that residual error coefficient;
Step 2.4 ': entropy decoding control module (6) is sent to CABAC residual error decoding module (7) and is separated the residual error commencing signal;
Step 2.5 ': CABAC residual error decoding module (7) begins residual error decoding after receiving the commencing signal that entropy decoding control module (6) sends, also finally obtain required encoded data stream by BSI peek module (1) via binary arithmetic decoding unit (5), decoding obtains the residual error coefficient value of brightness (luma) and colourity (chroma) piece;
Step 2.6 ': whether the macro block of judging decoding is last macro block of sheet (slice), if not, then turn back to step 2.1 ' continue to separate next macro block, otherwise decoding finishes.
2. the implementation method of the entropy decoder based on H.264 according to claim 1, it is characterized in that: it is characterized in that: to be unit decode to the CAVLC encoding code stream with the sheet data is that described decoding to single macro block comprises following step by realization that each macro block of forming the sheet data is decoded:
Step 1: find the solution and relevant variable and the parameter of macro block decoding by software module;
Step 2: obtain decoding after the required parameter of required current macro and adjacent macroblocks decoding according to above-mentioned steps 1, macro block is decoded according to the order of chrominance block after the first luminance block;
Step 3: luminance block is decoded; With the 4x4 piece is basic decoding unit, promptly a 4x4 luminance block is carried out the piece decoding at every turn, earlier direct current (DC) coefficient of luminance block is decoded, and then the ac coefficient (AC) of luminance block is decoded;
Step 4: after the luminance block of having decoded, chrominance block is decoded; With the 4x4 piece is basic decoding unit, according to the order of Cr piece behind the first Cb piece, and the DC coefficient of the chrominance block of decoding earlier, the ac coefficient of the chrominance block of decoding again;
Step 5: repeat above-mentioned steps, continue to separate next macro block.
3. the implementation method of the entropy decoder based on H.264 according to claim 1, it is characterized in that: described to be unit decode to the CABAC encoding code stream is that described decoding to single macro block comprises following step by realization that each macro block of forming the sheet data is decoded with the sheet data:
Step 1: context model and probability interval are carried out initialization;
Step 2: begin other syntactic elements beyond the residual error coefficient are decoded, and macroblock parameters and other parameters that will use in the residual error decoding by adopting software approach to find the solution;
Step 3: the order according to colourity after the first brightness is decoded to residual error macro block;
Step 4: to the decoding of luminance block; With 4x4 piece or 8x8 piece is base unit, earlier the brightness DC coefficient is decoded, and more remaining brightness ac coefficient is decoded, and finishes the decode procedure to luminance block;
Step 5: to the decoding of chrominance block; Order according to Cr piece behind the first Cb is that unit decodes to two chrominance block Cb and Cr piece with the 4x4 piece, separates the DC coefficient of Cb and Cr piece earlier, and then separates the ac coefficient of Cb and Cr piece;
Step 6: repeat above-mentioned steps, continue to separate next macro block.
4. based on H.264 entropy decoder device, it is characterized in that this device comprises as lower module:
The BSI module of peeking: be responsible for obtaining the required bit stream data of decoding, when receiving the peek request of other modules, return the bit stream data of respective length from the outside;
The ue/se/te decoding unit: the decoding request that the receiving software module is sent is also returned decoded parameter value;
CAVLC residual error decoding module: with ' 4X4 piece ' is unit, the relevant parameter that decoding obtains according to software module, residual error coefficient to brightness and colourity is decoded, and sends end signal to entropy decoding control module after decoding is finished, and the residual error coefficient that decoding is come out deposits counter-scanning RAM in;
Software module: parameter and variable that residual error decoding needs are decoded, find the solution the parameter relevant by the ue/se/te decoding unit with CAVLC, find the solution the parameter relevant with CABAC by the binary arithmetic decoding unit, the parameter that finally obtains offers CAVCL again or CABAC residual error decoding module is used;
Binary arithmetic decoding unit: when the parameter of decoding relevant,, return the binary result that obtains through decoding when the decoding request of receiving that software module is sent with macro block; In addition carry out the CABAC residual error decoding the time, when receiving the decoding request that CABAC residual error decoding module is sent, return the binary result that obtains through decoding;
Entropy decoding control module: control whole decoding process, elder generation's Control Software module is found the solution relevant parameter, be responsible for sending the beginning decoded signal to CAVLC residual error decoding module or CABAC residual error decoding module, after receiving the decoding end signal, the corresponding residual error coefficient that decoding is obtained writes counter-scanning RAM;
CABAC residual error decoding module: with ' 4X4 ' piece or ' 8X8 ' piece is unit, the relevant parameter that decoding obtains according to software module, residual error coefficient to brightness and colourity is decoded, send end signal to entropy decoding control module after decoding is finished, the residual error coefficient that decoding is come out deposits counter-scanning RAM in;
Counter-scanning RAM: the residual error coefficient that storage obtains through the decoding of CAVLC residual error decoding module or CABAC residual error decoding module.
CN 200610157417 2006-12-07 2006-12-07 Method and device for implementing entropy decoder based on H.264 Expired - Fee Related 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 Expired - Fee Related 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 (22)

* 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
CN101836454B (en) * 2008-12-03 2012-08-22 联发科技股份有限公司 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
BR112013012814B1 (en) 2010-10-26 2019-10-08 Nec Corporation VIDEO DECODING DEVICE AND VIDEO DECODING METHOD
CN101986708A (en) * 2010-10-29 2011-03-16 北京中星微电子有限公司 Video decoding method and decoder
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
RU2642373C1 (en) * 2011-06-16 2018-01-24 ДжиИ Видео Компрешн, ЭлЭлСи Initialization of context in entropy coding
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
FR2982446A1 (en) 2011-11-07 2013-05-10 France Telecom METHOD FOR ENCODING AND DECODING IMAGES, CORRESPONDING ENCODING AND DECODING DEVICE AND COMPUTER PROGRAMS
FR2982447A1 (en) 2011-11-07 2013-05-10 France Telecom METHOD FOR ENCODING AND DECODING IMAGES, CORRESPONDING ENCODING AND DECODING DEVICE AND COMPUTER PROGRAMS
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
CN110958459B (en) * 2018-09-26 2022-06-03 阿里巴巴集团控股有限公司 Data processing method and device
CN110446047A (en) * 2019-08-16 2019-11-12 苏州浪潮智能科技有限公司 The coding/decoding method and device of video code flow
CN111818335B (en) * 2020-07-03 2022-04-26 Tcl华星光电技术有限公司 Entropy coding method and device and electronic equipment

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
CN101198051B (en) Method and device for implementing entropy decoder based on H.264
US20220094969A1 (en) Image prediction method and apparatus
RU2452128C2 (en) Adaptive coding of video block header information
TWI527465B (en) Coded block flag coding
CN103190147B (en) For combined decoding method and the equipment of the syntactic element of video coding
CN1332563C (en) Coding method of video frequency image jump over macro block
CN101411196B (en) Method and system for coding and decoding information associated with video compression
KR101697154B1 (en) Video encoding method and computer readable redording meduim thereof
CN103139565B (en) For the method to colourity image decoding
KR100612015B1 (en) Method and apparatus for Context Adaptive Binary Arithmetic coding
TW201742458A (en) Binarizing secondary transform index
US20100098155A1 (en) Parallel CABAC Decoding Using Entropy Slices
KR20140120891A (en) Method and apparatus for efficient transform unit encoding
TW201415901A (en) Sequence level flag for sub-picture level coded picture buffer parameters
KR20160086978A (en) Internal bit depth increase in video coding
WO2011100465A1 (en) Video coding with large macroblocks
JP2007251758A (en) Moving image coding apparatus, and method
CN103460698A (en) Combined reference picture list construction and mapping
WO2014110568A1 (en) Chorma intra prediction angle clipping for hevc 4:2:2 video
KR20090028369A (en) Video encoding apparatus and method and video decoding apparatus and method
CA2666055A1 (en) Refinement coefficient coding based on history of corresponding transform coefficient values
RU2656827C2 (en) Improved signaling of the layer identifiers for the working points of the video coder
CN104956674A (en) Devices and methods for context reduction in last significant coefficient position coding
JP2011507450A (en) Variable length coding method and apparatus
CN108464005A (en) Real transform and reverse transformation system in Video coding and method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 518057 Room 406, 4th Building, Phase I, Science and Technology Second Road Software Park, Nanshan High-tech Zone, Shenzhen City, Guangdong Province

Patentee after: Shenzhen Shenyang electronic Limited by Share Ltd

Address before: 518057 Room 406, 4th Building, Phase I, Science and Technology Second Road Software Park, Nanshan High-tech Zone, Shenzhen City, Guangdong Province

Patentee before: Aike Chuangxin Microelectronic Co., Ltd.

CP01 Change in the name or title of a patent holder
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20111005

Termination date: 20201207

CF01 Termination of patent right due to non-payment of annual fee