CN1589023A - Coding and decoding method and device for multiple coded list lengthening based on context - Google Patents

Coding and decoding method and device for multiple coded list lengthening based on context Download PDF

Info

Publication number
CN1589023A
CN1589023A CN 200410058401 CN200410058401A CN1589023A CN 1589023 A CN1589023 A CN 1589023A CN 200410058401 CN200410058401 CN 200410058401 CN 200410058401 A CN200410058401 A CN 200410058401A CN 1589023 A CN1589023 A CN 1589023A
Authority
CN
China
Prior art keywords
code
code table
coefficient
coding
variable length
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.)
Pending
Application number
CN 200410058401
Other languages
Chinese (zh)
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.)
National Source Coding Center Digital Audio And Video Frequency Technology (beijing) Co Ltd
Original Assignee
National Source Coding Center Digital Audio And Video Frequency Technology (beijing) Co Ltd
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 National Source Coding Center Digital Audio And Video Frequency Technology (beijing) Co Ltd filed Critical National Source Coding Center Digital Audio And Video Frequency Technology (beijing) Co Ltd
Priority to CN 200410058401 priority Critical patent/CN1589023A/en
Publication of CN1589023A publication Critical patent/CN1589023A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

This invention relates a multicode list variable-length code/decode method based on the context and its device including scanning a block offset coefficient to form several pairs of sequence to be stored in a buffer storage region, a code list select module compares it with the code list in a two-dimensional variable-length code list storage module to determine the kind of the coding current coefficient block and selects a code list according to the quantization parameter applied by macroblock and coding mode of the macroblock or sub-block to send in into the variable-length code module which images each pair sequence in the buffer zone and the block end labels to variable-code to be written in the stream bared on selected stream list.

Description

A kind of based on contextual many code tables variable-length code decode method and coding and decoding device
Technical field
The invention belongs to digital audio/video encoding and decoding technique field, relate to a kind of entropy encoding/decoding method that is used for the video estimation residual error coefficient encoding and decoding, specifically a kind of based on contextual many code tables variable-length code decode method and coding and decoding device.
Background technology
Video coding and decoding technology is key technologies for application such as digital media storage and transmission.Core technology in the video coding system comprises predictive coding, transition coding, entropy coding.Wherein, entropy coding is to the syntactic element that produces in the cataloged procedure, carries out the comentropy coding as motion vector mv, piece prediction residual coefficient etc., and its effect is a statistical redundancy of removing data.
Video encoding standard had the coding method of piece prediction residual coefficient in the past: international video encoding standard H.261 with the entropy coder two-dimensional variable length of motion picture expert group MPEG-2 (Motion Picture ExpertsGroup) standard coding 2D-VLC (2 Dimension VariableLength Coding), H.263 with the 3D-VLC entropy coder of MPEG-4 standard, the international standard 14496-10 of suggestion of the H.264 video coding of the ITU-T of international telecommunication association or ISO/IEC be MPEG-4 standard the 10th part video encoding standard H.264/AVC based on context variable-length encoding (CAVLC, Context-based Adaptive Variable LengthCoding) entropy coder and based on context binary arithmetic coding (CABAC, Contex-based Adaptive Binary Arithmetic Coding) entropy coder.
The 2D-VLC entropy coder adopts (level to the coding of piece residual error coefficient, run)+coded system of EOB, level represents through the discrete cosine transform dct transform and the nonzero coefficient of the residual image piece after quantizing, and run represent by tradition in a zigzag this nonzero coefficient of zig-zag scanning sequency value between first nonzero coefficient before it be 0 coefficient number, EOB (End of Block) is an end of block flag, EOB monopolizes a position in code table, promptly EOB distributes a code word separately.The 3D-VLC entropy coder is combined in (level with EOB, run) count centering, form three-dimensional amount (level, run, last), last represents that whether current nonzero coefficient is last nonzero coefficient in the piece, vacateed like this that EOB occupies in the code table than the short code word, and utilized the joint probability of level, run and EOB, so code efficiency increases.H.264/AVC the CAVLC entropy coder of video encoding standard is opened coding with level, run branch, and this encoder has made full use of upper and lower civilian information, and has carried out good optimization at 4 * 4 block sizes, has therefore obtained higher code efficiency.Above various entropy coders belong to variable length encoder, its coding basic principle is Huffman (Huffman) coding, be about to the symbol short code word code of big probability, and the little symbol of probability of occurrence is encoded with long code word, thereby finally reach the shortest purpose of mean code length.H.264/AVC the CABAC entropy coder of video encoding standard belongs to arithmetic encoder, the performance of arithmetic encoder is higher than variable length encoder, and, the probability of occurrence of source symbol had more accurately estimate, so code efficiency is very high because CABAC can carry out modeling to context well.But than variable length encoder, the computation complexity height of arithmetic encoder, hardware is realized complexity simultaneously, is equivalent to exchange the raising of code efficiency for high complexity soft, hardware.
Therefore, consider that variable-length encoding is the higher entropy coding scheme of a kind of cost performance from software and hardware implementation complexity two aspects of code efficiency and algorithm.In variable length encoder, the 2D-VLC entropy coder has utilized the joint probability of level and run, efficient is higher than the CAVLC entropy coder and divides the mode of opening coding with level and run on the reason, and than the 3D-VLC encoder, the volume of 2D-VLC code table is littler, so the 2D-VLC entropy coder has been taken into account the implementation complexity of coding efficiency and hardware.But traditional 2D-VLC entropy coder adopts the single code table that obtains by global statistics to encode, and its shortcoming is that single code table can not adapt to the variation of local probability distribution well, causes code efficiency not high.
Summary of the invention
In order to overcome above-mentioned the deficiencies in the prior art, the object of the present invention is to provide a kind ofly based on contextual many code tables variable-length code decode method and coding and decoding device, to improve code efficiency, reduce the complexity of encoding and decoding.
It is a kind of based on contextual many code tables variable-length code decode method and coding and decoding device that another object of the present invention is to provide, to reduce the memory requirements of many code tables.
In order to finish the foregoing invention task, the overall technological scheme that the present invention adopts is: a kind of based on contextual many code tables variable length encoding method, may further comprise the steps:
Step 1: in a zigzag scan module carries out zigzag scanning to image block prediction residual coefficient, form image block nonzero coefficient and by this nonzero coefficient of zigzag scanning sequency before it between first nonzero coefficient value be that 0 the several of coefficient number also deposit in the memory buffer sequence several sequence;
Step 2: code table select module according to the type of residual error coefficient through with two-dimensional variable length coding code table memory module in code table relatively determine the code table type of the current coefficient block of coding;
Step 3: code table selects module according to the quantization parameter of the image block place macro block employing of residual error coefficient and the coding mode of place macro block or sub-piece, selects a code table to send into the variable-length encoding module from a plurality of code tables of selected type;
Step 4: the variable-length encoding module according to selected code table with several each to sequence in the memory buffer several to and end of block flag be mapped as variable length code, and the variable length code after will encoding is write in the code stream.
The type of the image block prediction residual coefficient in the described step 1 comprises the chromatic component residual error coefficient type that inter prediction obtains in luminance component residual error coefficient type that the resulting luminance component residual error coefficient of infra-frame prediction type, inter prediction obtain and the frame.
Code table in the described step 3 is one or more code tables that comprise inter prediction chromatic component residual error coefficient type in luminance component residual error coefficient type that infra-frame prediction obtains, luminance component residual error coefficient type that inter prediction obtains and the frame.
Macro block in the described step 3 or subblock coding pattern comprise infra-frame prediction macro block mode and inter prediction macro block mode, the infra-frame prediction macro block mode is the direction of infra-frame prediction, the inter prediction macro block mode is the inter prediction mode of macro block, prediction direction comprises forward prediction, back forecast, bi-directional predicted, and prediction mode is for being the pairing prediction mode of different masses size to macroblock partition.
The method of from a plurality of code tables, selecting a code table in the described step 3 comprise quantization parameter that the image block place macro block according to residual error coefficient adopts select code table, according to residual error coefficient image block place macro block or subblock coding model selection code table with simultaneously according to three kinds of methods of quantization parameter and coding mode selection code table.
Described step 4 further comprises the steps:
Several to whether being included in the code table in the sequence of step 41, determination number obtain being used for the codeword number of its coding if then directly table look-up, otherwise calculate the codeword number that is used for its coding from code table;
Step 42, according to code word type and exponent number thereof that current code table adopts, calculate several right variable length codes by codeword number, write into code stream;
Step 43, to judge whether to have compiled several all in the sequence several right, is then to adopt current code table encoding block end mark, finishes the coding of this piece, otherwise change step 41.
Calculating in the described step 41 is specially by formula:
Codeword number=(abs (level)-LEVRUN[run]) * 32+8+run*2 compute codeword numbering and determination number to the nonzero coefficient of the residual image piece of sequence behind transform and quantization whether less than 0, not then codeword number to be successively decreased 1, it is the initial value that then keeps codeword number, wherein, level is through discrete cosine transform and the nonzero coefficient of the image block of the residual error coefficient after quantizing, run for by this nonzero coefficient of zigzag scanning sequency before it between first nonzero coefficient value be 0 coefficient number, LEVRUN[] be (level, run) several right maximum abs (level) values that comprised in the current code table.
Code word type in the described step 42 is exponential type Columbus sign indicating number.
Code word type in the described step 42 is mixed type Columbus sign indicating number.
Implement described code device based on contextual many code tables variable length encoding method, comprise and be used for zigzag scan module that image block prediction residual coefficient is scanned, be used to store several memory buffers to sequence, the variable-length encoding module, be used to store the two-dimensional variable length coding code table memory module of two-dimentional code table, also comprise and be used to select image block prediction residual coefficient type, macroblock quantization parameter, the code table of a plurality of code tables of macro block or subblock coding pattern is selected module, this module input connects the residual error coefficient type, macroblock quantization parameter, macro block or subblock coding mode input signal line, its code table numbering output connects the variable-length encoding module, and its code table type is relatively held with two-dimensional variable length coding code table memory module and is connected.
A kind of based on contextual many code tables variable length decoding method, may further comprise the steps:
Step 1, code table select module to select the code table type of the current residual error coefficient piece of decoding according to image block prediction residual coefficient type;
Step 2, code table select module to select a code table to decode according to the image block of prediction residual coefficient from a plurality of code tables of selected type at the quantization parameter that macro block adopted and the coding mode of place macro block or sub-piece;
Step 3, variable length decoding module decode all of current prediction residual coefficient block according to current code table from the variable length code code stream several to sequence, and deposit in the memory buffer;
Step 4, in a zigzag otherwise scan module above-mentioned severally is reduced to image block prediction residual coefficient to sequence by the font scanning sequency with decoded.
Implement described decoding device based on contextual many code tables variable length decoding method, otherwise comprise the several zigzag scan modules that sequence carried out word scanning that are used for decoding, be used to store several memory buffers to sequence, the variable length decoding module, be used to store the two-dimensional variable length coding code table memory module of two-dimentional code table, also comprise and be used to select image block prediction residual coefficient type, macroblock quantization parameter, the code table of a plurality of code tables of macro block or subblock coding pattern is selected module, this module input connects the residual error coefficient block type, macroblock quantization parameter, macro block or subblock coding mode input signal line, its code table numbering output connects the variable length decoding module, and its code table type is relatively held with two-dimensional variable length coding code table memory module and is connected.
The present invention has tangible advantage and good effect.The present invention has designed a plurality of code tables under the different context situations, the probability distribution of mating source symbol under the different context situations during coding by the selection of code table better, 2D-VLC entropy coder in the variable length encoder has been utilized the joint probability technology of level and run combine with a plurality of code table technology, improve the efficient of encoding and decoding, reduced the complexity of encoding and decoding.
Description of drawings
Fig. 1 is a coding main flow chart of the present invention;
Fig. 2 is that code device of the present invention constitutes block diagram;
Fig. 3 is a diagram of code patterns between macroblock frame;
Fig. 4 carries out zigzag scanning to the piece coefficient to form several to sequence process schematic diagram;
Fig. 5 is the present invention's 4 * 4 residual error coefficient block encoding flow charts;
Fig. 6 is that decoding device of the present invention constitutes block diagram;
Fig. 7 is the present invention 4 * 4 residual error coefficient piece decoding process figure.
Embodiment
The present invention is further detailed explanation below in conjunction with the drawings and specific embodiments.
For improving code efficiency, the code length of source symbol or the probability of occurrence that code assignment will be mated source symbol better in the time of must making coding.Therefore the present invention designs the different residual error coefficients that a plurality of code tables mate under the different context situations and distributes, and promptly will design the coding that a code table is used for the residual error coefficient that this kind branch plants at an exemplary distribution of residual error coefficient.
See also Fig. 1, Fig. 2, the main flow chart and the device of the present invention's coding constitute block diagram.Code device based on contextual many code tables variable length encoding method of the present invention, comprise and be used for zigzag scan module that image block prediction residual coefficient is scanned, be used to store several memory buffers to sequence, the variable-length encoding module, be used to store the two-dimensional variable length code table memory module of two-dimentional code table, this device also comprises and is used to select the residual error coefficient block type, macroblock quantization parameter, the code table of a plurality of code tables of macro block or subblock coding pattern is selected module, this module input connects the residual error coefficient block type, macroblock quantization parameter, macro block or subblock coding mode input signal line, its code table numbering output connects the variable-length encoding module, and its code table type is relatively held with two-dimensional variable length code table memory module and is connected.At first the zigzag scan module of encoder carries out traditional zigzag zig-zag scanning to image block prediction residual coefficient, form image residual error coefficient piece nonzero coefficient level and by this nonzero coefficient of zigzag scanning sequency before it between first nonzero coefficient value be the several of 0 coefficient number run to sequence (level, and deposit in the memory buffer of encoder run).
Then, code table select module according to the type of piece residual error coefficient through with two-dimensional variable length coding code table memory module in code table relatively determine the code table type of the current coefficient block of coding.Code table is selected the module based on contextual information to select a code table to send into the variable-length encoding module from a plurality of code tables of selected type to encode;
Code table selects module to be used for selecting the contextual information of code table to comprise among the present invention:
1, prediction residual coefficient type
The present invention is divided into 3 classes with the prediction residual coefficient, adopts the residual error coefficient chroma of the resulting chromatic component of inter prediction in the resulting luminance component residual error coefficient of infra-frame prediction luma_intra, employing inter prediction resulting luminance component residual error coefficient luma_inter and the employing frame.At above 3 class residual error coefficients, the present invention has 3 class code tables, and promptly inter prediction chromatic component residual error coefficient code table is respectively applied for its coding in infra-frame prediction luminance component residual error coefficient code table, inter prediction luminance component residual error coefficient code table and the frame.
2, quantization parameter
Residual error coefficient after the difference of quantization parameter can cause quantizing has different distributions, for example residual error coefficient is after big quantization parameter quantizes, the nonzero coefficient number reduces a lot, it is very little that the value of nonzero coefficient also becomes, like this through scanning (the level that forms in a zigzag, run) several right, the level value is less, and the run value is bigger; And after little quantization parameter quantized, the amplitude that residual error coefficient nonzero coefficient number reduces was smaller, and it is few that its value also reduces, like this through scanning formation in a zigzag (level, run) several right, the level value is bigger, the run value is less.Therefore residual error coefficient its distribution after different quantization parameters quantizes is different, so quantization parameter is a kind of effective contextual information, can be used to carry out code table and selects.
3, macro-block coding pattern
Advanced video encoding standard has all adopted the multi-mode strategy of coding according to qualifications as H.264 reaching when AVS-M encodes to macro block.When the I frame is encoded, adopt multi-direction Predicting Technique, a plurality of prediction direction promptly corresponding a plurality of coding modes; When the P frame is encoded, adopt the interframe movement estimation technique of variable-block size, the difference of block size also corresponding various modes; In B frame when coding, on the basis of motion estimation techniques between P frame variable-block sized frames, increased forward prediction, back forecast, bi-directional predicted situation again, therefore derives more coding mode again.Coding mode also is a kind of contextual information, and the difference of coding mode also can cause the distribution difference of residual error coefficient, and code table designs at different distributions just, therefore can utilize above these coding mode information to carry out the foundation that code table is selected as entropy coder.The convenient code table selection of carrying out entropy coder with these coding mode information of the present invention.
Shown in diagram of code patterns between Fig. 3 macroblock frame.P frame macro block pixels size is 16 * 16, its interframe encoding mode comprises inter16 * 16, inter16 * 8, inter8 * 16, P8 * 8, for 8 * 8 sub-pieces under P8 * 8 patterns, also have inter8 * 8, inter8 * 4, inter4 * 8, inter4 * 4 four kind of pattern, these coding modes are all corresponding, when macro block was carried out the interframe movement estimation, macro block was divided into several portions, and each part is carried out independent estimation and independent motion vector is arranged.The final pattern of the best of selecting is encoded to current macro.
At last, whether determination number is included in the code table to sequence, obtain being used for the codeword number of its coding if then directly from code table, table look-up, otherwise calculate the codeword number that is used for its coding, code word type and exponent number thereof according to current code table employing, calculate several coding codewords by codeword number to sequence, write into code stream, it is several to sequence to judge whether to have compiled all, not then to continue determination number whether sequence is included in code table and coding, otherwise then adopt current code table encoding block end mark, finish the coding of this piece
Be to keep lower computation complexity, the present invention adopts variable length encoding method, adopt comprise several to sequence (level, run) and the 2D-VLC technology of the EOB of end of block flag.Simultaneously, for keeping the lower memory requirements of many code tables, the present invention adopts exponential type Columbus (Golomb) sign indicating number and mixed type Columbus (Golomb) sign indicating number with regular texture.Because exponential type Golomb sign indicating number and mixed type Golomb sign indicating number have regular texture, code word by several 0, add that some information bits position constitutes for one 1, and the relation that the value of the value of information bit position and codeword number has more direct available formula to describe, therefore calculate generated codeword by codeword number and do not have high complexity, code word can generate under the prerequisite of low computation complexity in real time, this makes code table storage is mapping relations between from the source symbol to the coding codeword, and the Huffman (Huffman) of fict avriable length codes such as Moving Picture Experts Group-2 entropy coder sign indicating number, therefore, the code table memory requirements is low, even adopt many code tables also to keep lower code table memory space.
The present invention adopts 4 luma_intra type code table (VLCx_intra, x=0~3), 9 luma_inter type code table (VLCx_inter, x=0~8) the brightness residual coefficient of type and interframe type macro block in the difference coded frame, adopt 1 code table (VLC_chroma) coding colourity residual error coefficient in addition, these code tables all are the 2D-VLC code table, and its form is as shown in table 1.
Table 1 VLC_chroma code table
Each code table has defined that (level, run) and the mapping relations between EOB and the code word, i.e. codeword number CodeNumber is as dark part numeral in the table 1.Only list in the table 1 under level>0 situation (level, the distribution condition of CodeNumber run), level<0 o'clock (level, CodeNumber distribution method run) is as follows:
CodeNumber(-abs(level),run)=Code_Number(abs(level),run)+1。
Can see that contained CodeNumber scope is 0~38 in the 2D-VLC code table, this is an empirical value, also can be greater or lesser scope, for exceed the code table scope (level run) adopts specific rule to be its distribution CodeNumber.
Each code table adopts exponential type Exp-Golomb sign indicating number or mixed type Hybrid-Golomb sign indicating number.
Table 2 has been listed the codeword structure of part Exp-Golomb sign indicating number, the corresponding relation of CodeNumber and code word, and the 2D-VLC code table that adopts this constructive code.
Table 2 is used for the Exp-Golomb sign indicating number of 2D-VLC code table
Exponent number (K) Codeword structure Code length L Codeword number (CodeNumber) Adopt the code table of this codeword structure
??K=1 ?1x0 ?2 ??2 L/2-2+INFO ?VLC1_intra, ?VLC1_inter,VLC2_inter ?VLC3_inter
?01x1x0 ?4
?001x2x1x0 ?6
?0001x3x2x1x0 ?8
?00001x4x3x2x1x0 ?10
?... ...
??K=0 ?1 ?1 ??2 L/2-1+INFO ?VLC2_intra,VLC3_intra ?VLC4_inter,VLC5_inter ?VLC6_inter,VLC7_inter ?VLC8_inter ?VLC_chroma
?01x0 ?3
?001x1x0 ?5
?0001x2x1x0 ?7
?00001x3x2x1x0 ?9
?... ?...
Table 3 has been listed the codeword structure of section H ybrid-Golomb sign indicating number, the corresponding relation of CodeNumber and code word, and the 2D-VLC code table that adopts this structure.
Table 3 is used for the Hybrid-Golomb sign indicating number of 2D-VLC code table
Rank Codeword structure Code length L Codeword number (CodeNumber) Adopt the code table of this codeword structure
K=2 ?1x1x0 ?3 ????2 (L+2)/2-4+INFO ? ?VLC0_intra, ?VLC0_inter,
?01x1x0 ?4
?001x2x1x0 ?6 ????8+INFO,0≤INFO≤2 K(2 (L-K-2)/2-1)-1
?001x3x2x1x0 ?7 ????8+2 K(2 (L-K-3)/2-1)+INFO-2 K+1(2 (L-K-3)/2-1), ????2 K+1(2 (L-K-3)/2-1)≤INFO≤2 (K+L-1)/2-1)
?... ?... ????...
The value of INFO is calculated by following formula in table 2 and table 3:
INFO = Σ i = 0 n x i · 2 i ,
Wherein INFO is a variable, and its value is calculated by following formula, is used for determining the codeword number of a variable length code, x iBe the symbol on codeword structure hurdle in table 2 and the table 3, its value is 0 or 1, and the first code word 1x1x0 that goes as codeword structure hurdle in the table 3 uses x i, i=0,1 represents x1x0, and the value of n is 1 at this moment.
For the brightness residual coefficient (luma_intra) that adopts infra-frame prediction to obtain, select code table with quantization parameter QP (Quantization Parameter), select code table for the brightness residual coefficient (luma_inter) that inter prediction obtains with quantization parameter and inter-frame forecast mode, inter-frame forecast mode comprises: inter16 * 16, inter16 * 8, inter8 * 16, inter8 * 8, inter8 * 4, inter4 * 8, inter4 * 4.For chromaticity coefficent (chroma), adopt 1 independent code table encoding and decoding.
For the encoding and decoding of chroma coefficient, in all QP scopes, under various coding modes, with code table VLC_chroma encoding and decoding.For the encoding and decoding of luma_intra coefficient, when QP<=29, option code Table V LC0_intra encoding and decoding; When 30<=QP<=33, option code Table V LC1_intra encoding and decoding; When 34<=QP<=37, option code Table V LC2_intra encoding and decoding; When 38<=QP, option code Table V LC3_intra encoding and decoding.For the encoding and decoding of luma_inter coefficient, select code table according to the predictive mode of the QP value of current macro and 4 * 4 place macro blocks or 8 * 8 sub-pieces, selective rule is as shown in table 4.
The code table of table 4 Inter prediction residue coefficient is selected
Macro-block coding pattern (Mb_type) Block coding mode (Block_type)
?QP ?Inter16×16 ?Inter16×8 ?Inter8×16 ?Inter8×8 ?Inter8×4 ?Inter4×8 ?Inter4×4
?0~29 ?VLC2_inter ?VLC2_inter ?VLC2_inter ?VLC3_inter ?VLC3_inter ?VLC3_inter ?VLC0_inter
?30~33 ?VLC6_inter ?VLC6_inter ?VLC6_inter ?VLC7_inter ?VLC8_inter ?VLC8_inter ?VLC1_inter
?34~37 ?VLC6_inter ?VLC6_inter ?VLC6_inter ?VLC7_inter ?VLC8_inter ?VLC8_inter ?VLC4_inter
?38~51 ?VLC6_inter ?VLC6_inter ?VLC6_inter ?VLC7_inter ?VLC8_inter ?VLC8_inter ?VLC5_inter
Concerning coding side, when (level, when run) exceeding the code table scope, expression can not obtain current (level, run) pairing CodeNumber value by table look-at from code table.At this moment must with specific rule calculate current (its rule is as follows for level, CodeNumber run):
Number by following formula compute codeword:
Codeword number=(abs (level)-LEVRUN[run]) * 32+8+run*2
And determination number to the nonzero coefficient of the residual image piece behind transform and quantization of sequence whether less than 0, be not then codeword number to be successively decreased 1, be the initial value that then keeps codeword number.Wherein, level is the nonzero coefficient through the residual image piece after discrete cosine transform and the quantification, run for by this nonzero coefficient of zigzag scanning sequency before it between first nonzero coefficient value be 0 coefficient number, LEVRUN[] be (level, run) several right maximum abs (level) values that comprised in the current code table.For the 2D-VLC code table shown in the table 1, array LEVRUN[0~16] value be:
LEVRUN[16]={9,3,2,2,1,1,1,0,0,0,0,0,0,0,0,0};
Consult Fig. 5, the coding method figure of one embodiment of the invention 4 * 4 residual error coefficient pieces.
Step 1, to 4 * 4 image block residual error coefficient zig-zag scanning form (level, run) several to sequence;
Step 2, (inter_luma, intra_luma chroma) select the code table type of the current coefficient block of coding according to the coefficient block type;
The coding mode of step 3, the quantization parameter that is adopted according to 4 * 4 residual block place macro blocks and place macro block or 8 * 8 sub-pieces is selected the coding code table;
Step 4, adopt current code table, press zig-zag scanning and form (level, run) several right sequencings, (level to scanning formation, run) several to sequential coding, if (level, run) be included in the middle of the code table, then directly tabling look-up from code table obtains being used for the codeword number CodeNumber of its coding, if (level, run) exceed the code table scope, then calculate the codeword number CodeNumber that is used for its coding according to ad hoc rules, code word type and exponent number thereof according to current code table adopts calculate (level by CodeNumber, run) coding codeword is write into code stream;
Step 5, repeating step 1,2,3, own up to having encoded (level, run) several right, otherwise adopt current code table encoding block end mark EOB, finish the coding of this piece.
See also Fig. 6, Fig. 7, the present invention is based on contextual many code tables decoding device and constitute block diagram and coding/decoding method flow chart.
The present invention is based on contextual many code tables variable length decoding device is identical with the code device formation, only the direction of data flow is different, variable length encoder changes length variable decoder into, comprise and be used for otherwise the several of decoding are carried out the zigzag scan module that font scanned and be reduced to image block prediction residual coefficient to sequence, be used to store several memory buffers to sequence, the variable length decoding module, be used to store the two-dimensional variable length coding code table memory module of two-dimentional code table, this device also comprises and is used to select the residual error coefficient block type, macroblock quantization parameter, the code table of a plurality of code tables of macro block or subblock coding pattern is selected module, this module input connects the residual error coefficient block type, macroblock quantization parameter, macro block or subblock coding mode input signal line, its code table numbering output connects the variable length decoding module, and its code table type is relatively held with two-dimensional variable length coding code table memory module and is connected.
Decoding is reciprocal process with coding.With 4 * 4 residual error coefficient pieces is example, and concrete coding/decoding method is as follows:
Step 1, (inter_luma, intra_luma chroma) select the code table type of the current coefficient block of decoding according to the coefficient block type;
The coding mode of step 2, the quantization parameter that is adopted according to 4 * 4 residual block place macro blocks and place macro block or 8 * 8 sub-pieces is selected the decoding code table;
Step 3, code word type Exp-Golomb sign indicating number or Hybrid-Golomb sign indicating number and exponent number thereof according to current code table, from code stream, parse CodeNumber, if CodeNumber>=39, CodeNumber obtains (level with the ad hoc rules decoding, run), if CodeNumber<39, look into current code table decoding CodeNumber, obtain a syntactic element, if syntactic element is EOB, then the decoding of current block coefficient finishes and finishes decoding, if syntactic element be (level, run) several right, with current (level, run) several to depositing buffering area in, from code stream, resolve next CodeNumber;
Step 4, (level run) is reduced to the piece residual error coefficient with decoded with the zig-zag method for scanning.
If the CodeNumber that from code stream, parses>=39, expression can not be from current code table table look-at obtain CodeNumber pairing (level, run).At this moment, need calculate with specific rule (level, run).Its process is as follows:
If its end bit of the binary representation of codeword number is 1, then putting indexed variable sign is 0, and codeword number is increased 1, otherwise indexed variable sign is 1, tries to achieve run and level by following method.
run=((CodeNumber-8)%32)/2;
level=((CodeNumber-8)/32)+LEVRUN[run]。
If indexed variable is 1, the level value negate that will obtain by following formula.
Above embodiment is the unrestricted technical scheme of the present invention in order to explanation only, those of ordinary skill in the art is to be understood that: can make amendment or be equal to replacement the present invention, and not breaking away from any modification or partial replacement of the spirit and scope of the present invention, it all should be encompassed in the middle of the claim scope of the present invention.

Claims (12)

1, a kind ofly it is characterized in that based on contextual many code tables variable length encoding method this method may further comprise the steps:
Step 1: in a zigzag scan module carries out zigzag scanning to image block prediction residual coefficient, form image block nonzero coefficient and by this nonzero coefficient of zigzag scanning sequency before it between first nonzero coefficient value be that 0 the several of coefficient number also deposit in the memory buffer sequence several sequence;
Step 2: code table select module according to the type of residual error coefficient through with two-dimensional variable length coding code table memory module in code table relatively determine the code table type of the current coefficient block of coding;
Step 3: code table selects module according to the quantization parameter of the image block place macro block employing of residual error coefficient and the coding mode of place macro block or sub-piece, selects a code table to send into the variable-length encoding module from a plurality of code tables of selected type;
Step 4: the variable-length encoding module according to selected code table with several each to sequence in the memory buffer several to and end of block flag be mapped as variable length code, and the variable length code after will encoding is write in the code stream.
2, according to claim 1 based on contextual many code tables variable length encoding method, it is characterized in that the type of the image block prediction residual coefficient in the described step 1 comprises the chromatic component residual error coefficient type that inter prediction obtains in luminance component residual error coefficient type that the resulting luminance component residual error coefficient of infra-frame prediction type, inter prediction obtain and the frame.
3, according to claim 1 based on contextual many code tables variable length encoding method, it is characterized in that the code table in the described step 3 is one or more code tables that comprise inter prediction chromatic component residual error coefficient type in luminance component residual error coefficient type that infra-frame prediction obtains, luminance component residual error coefficient type that inter prediction obtains and the frame.
4, according to claim 1 based on contextual many code tables variable length encoding method, it is characterized in that, macro block in the described step 3 or subblock coding pattern comprise infra-frame prediction macro block mode and inter prediction macro block mode, the infra-frame prediction macro block mode is the direction of infra-frame prediction, the inter prediction macro block mode is the inter prediction mode of macro block, prediction direction comprises forward prediction, back forecast, bi-directional predicted, and prediction mode is for being the pairing prediction mode of different masses size to macroblock partition.
5, according to claim 1 based on contextual many code tables variable length encoding method, it is characterized in that, the method for from a plurality of code tables, selecting a code table in the described step 3 comprise quantization parameter that the image block place macro block according to residual error coefficient adopts select code table, according to residual error coefficient image block place macro block or subblock coding model selection code table with simultaneously according to three kinds of methods of quantization parameter and coding mode selection code table.
6, according to claim 1ly it is characterized in that based on contextual many code tables variable length encoding method described step 4 further comprises the steps:
Several to whether being included in the code table in the sequence of step 41, determination number obtain being used for the codeword number of its coding if then directly table look-up, otherwise calculate the codeword number that is used for its coding from code table;
Step 42, according to code word type and exponent number thereof that current code table adopts, calculate several right variable length codes by codeword number, write into code stream;
Step 43, to judge whether to have compiled several all in the sequence several right, is then to adopt current code table encoding block end mark, finishes the coding of this piece, otherwise change step 41.
7, many code tables context variable length encoding method according to claim 6 is characterized in that the calculating in the described step 41 is specially by formula:
Codeword number=(abs (level)-LEVRUN[run]) * 32+8+run*2 compute codeword numbering and determination number to the nonzero coefficient of the residual image piece of sequence behind transform and quantization whether less than 0, not then codeword number to be successively decreased 1, it is the initial value that then keeps codeword number, wherein, level is through discrete cosine transform and the nonzero coefficient of the image block of the residual error coefficient after quantizing, run for by this nonzero coefficient of zigzag scanning sequency before it between first nonzero coefficient value be 0 coefficient number, LEVRUN[] be (level, run) several right maximum abs (level) values that comprised in the current code table.
8, many code tables context variable length encoding method according to claim 6 is characterized in that, the code word type in the described step 42 is exponential type Columbus sign indicating number.
9, many code tables context variable length encoding method according to claim 7 is characterized in that, the code word type in the described step 42 is mixed type Columbus sign indicating number.
10, implement the described code device of claim 1 based on contextual many code tables variable length encoding method, comprise and be used for zigzag scan module that image block prediction residual coefficient is scanned, be used to store several memory buffers to sequence, the variable-length encoding module, be used to store the two-dimensional variable length coding code table memory module of two-dimentional code table, it is characterized in that, this device also comprises and is used to select image block prediction residual coefficient type, macroblock quantization parameter, the code table of a plurality of code tables of macro block or subblock coding pattern is selected module, this module input connects the residual error coefficient type, macroblock quantization parameter, macro block or subblock coding mode input signal line, its code table numbering output connects the variable-length encoding module, and its code table type is relatively held with two-dimensional variable length coding code table memory module and is connected.
11, a kind ofly it is characterized in that based on contextual many code tables variable length decoding method this method may further comprise the steps:
Step 1, code table select module to select the code table type of the current residual error coefficient piece of decoding according to image block prediction residual coefficient type;
Step 2, code table select module to select a code table to decode according to the image block of prediction residual coefficient from a plurality of code tables of selected type at the quantization parameter that macro block adopted and the coding mode of place macro block or sub-piece;
Step 3, variable length decoding module decode all of current prediction residual coefficient block according to current code table from the variable length code code stream several to sequence, and deposit in the memory buffer;
Step 4, in a zigzag otherwise scan module above-mentioned severally is reduced to image block prediction residual coefficient to sequence by the font scanning sequency with decoded.
12, implement the described decoding device of claim 11 based on contextual many code tables variable length decoding method, otherwise comprise the several zigzag scan modules that sequence carried out word scanning that are used for decoding, be used to store several memory buffers to sequence, the variable length decoding module, be used to store the two-dimensional variable length coding code table memory module of two-dimentional code table, it is characterized in that, this device also comprises and is used to select image block prediction residual coefficient type, macroblock quantization parameter, the code table of a plurality of code tables of macro block or subblock coding pattern is selected module, this module input connects the residual error coefficient block type, macroblock quantization parameter, macro block or subblock coding mode input signal line, its code table numbering output connects the variable length decoding module, and its code table type is relatively held with two-dimensional variable length coding code table memory module and is connected.
CN 200410058401 2004-08-06 2004-08-06 Coding and decoding method and device for multiple coded list lengthening based on context Pending CN1589023A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200410058401 CN1589023A (en) 2004-08-06 2004-08-06 Coding and decoding method and device for multiple coded list lengthening based on context

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200410058401 CN1589023A (en) 2004-08-06 2004-08-06 Coding and decoding method and device for multiple coded list lengthening based on context

Publications (1)

Publication Number Publication Date
CN1589023A true CN1589023A (en) 2005-03-02

Family

ID=34603352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200410058401 Pending CN1589023A (en) 2004-08-06 2004-08-06 Coding and decoding method and device for multiple coded list lengthening based on context

Country Status (1)

Country Link
CN (1) CN1589023A (en)

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100440979C (en) * 2005-12-15 2008-12-03 清华大学 Self-adaptive two-dimensional variable length decoding method and device based on context
CN100466743C (en) * 2006-08-07 2009-03-04 清华大学 Method for programmable entropy decoding based on shared storage and countra-quantization
WO2009097810A1 (en) * 2008-01-31 2009-08-13 Huawei Technologies Co., Ltd. A method and device for image entropy encoding and entropy decoding
CN100593954C (en) * 2007-03-28 2010-03-10 中国科学院微电子研究所 Device and method for decoding Columbus code
CN101090501B (en) * 2006-06-13 2010-05-12 财团法人工业技术研究院 Mould search type variable-length code-decode method and device
CN101147401B (en) * 2005-03-25 2010-06-16 三星电子株式会社 Video coding and decoding method using weighted prediction and apparatus for the same
CN101335897B (en) * 2007-06-28 2010-08-25 联想(北京)有限公司 Image compression/decoding method and system
CN101292537B (en) * 2005-11-08 2010-10-20 松下电器产业株式会社 Moving picture coding method, moving picture decoding method, and apparatuses of the same
CN102239640A (en) * 2008-12-09 2011-11-09 日本电信电话株式会社 Encoding method and decoding method, and devices, program and recording medium for the same
CN102256139A (en) * 2010-05-19 2011-11-23 晨星软件研发(深圳)有限公司 Medium coding system, quantized coefficient coding device and quantized coefficient coding method
US8121418B2 (en) 2006-03-27 2012-02-21 Qualcomm Incorporated Methods and systems for significance coefficient coding in video compression
CN102939756A (en) * 2010-04-16 2013-02-20 Sk电信有限公司 Video coding and decoding method and apparatus
CN103004194A (en) * 2010-05-19 2013-03-27 Sk电信有限公司 Image encoding/decoding device and method
CN103384325A (en) * 2013-02-22 2013-11-06 张新安 Quick inter-frame prediction mode selection method for AVS-M video coding
CN104247420A (en) * 2012-04-16 2014-12-24 高通股份有限公司 Transform coefficient coding
CN104717503A (en) * 2009-04-08 2015-06-17 夏普株式会社 Video encoding apparatus and video decoding apparatus
CN105592313A (en) * 2014-10-21 2016-05-18 广东中星电子有限公司 Grouped adaptive entropy coding compression method
CN105704490A (en) * 2010-04-16 2016-06-22 Sk电信有限公司 Video encoding/decoding apparatus and method
CN106464266A (en) * 2014-06-09 2017-02-22 索尼公司 Communication system with coding mechanism and method of operation thereof
CN107197263A (en) * 2011-01-12 2017-09-22 太阳专利托管公司 Picture decoding method and picture decoding apparatus
CN107517384A (en) * 2011-06-16 2017-12-26 Ge视频压缩有限责任公司 Support the entropy code of pattern switching
CN110599493A (en) * 2018-06-12 2019-12-20 财团法人工业技术研究院 Numerical array data image processing device and method and color code table generating method
WO2020062125A1 (en) * 2018-09-29 2020-04-02 富士通株式会社 Image coding method and apparatus, and electronic device
CN111641827A (en) * 2019-03-02 2020-09-08 上海天荷电子信息有限公司 Data compression method and device for prediction residual entropy coding by switching multiple schemes
CN116684003A (en) * 2023-07-27 2023-09-01 南京中科齐信科技有限公司 Quantum communication-based railway line air-ground comprehensive monitoring method and system

Cited By (52)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101147401B (en) * 2005-03-25 2010-06-16 三星电子株式会社 Video coding and decoding method using weighted prediction and apparatus for the same
CN101292537B (en) * 2005-11-08 2010-10-20 松下电器产业株式会社 Moving picture coding method, moving picture decoding method, and apparatuses of the same
CN100440979C (en) * 2005-12-15 2008-12-03 清华大学 Self-adaptive two-dimensional variable length decoding method and device based on context
US8121418B2 (en) 2006-03-27 2012-02-21 Qualcomm Incorporated Methods and systems for significance coefficient coding in video compression
CN101427584B (en) * 2006-03-27 2012-03-21 高通股份有限公司 Methods and systems for significance coefficient coding in video compression
CN101090501B (en) * 2006-06-13 2010-05-12 财团法人工业技术研究院 Mould search type variable-length code-decode method and device
CN100466743C (en) * 2006-08-07 2009-03-04 清华大学 Method for programmable entropy decoding based on shared storage and countra-quantization
CN100593954C (en) * 2007-03-28 2010-03-10 中国科学院微电子研究所 Device and method for decoding Columbus code
CN101335897B (en) * 2007-06-28 2010-08-25 联想(北京)有限公司 Image compression/decoding method and system
WO2009097810A1 (en) * 2008-01-31 2009-08-13 Huawei Technologies Co., Ltd. A method and device for image entropy encoding and entropy decoding
CN102239640A (en) * 2008-12-09 2011-11-09 日本电信电话株式会社 Encoding method and decoding method, and devices, program and recording medium for the same
CN102239640B (en) * 2008-12-09 2015-01-07 日本电信电话株式会社 Encoding method and decoding method, and devices using methods
CN104104391B (en) * 2008-12-09 2017-04-26 日本电信电话株式会社 Encoding method and encoding device
CN104717503B (en) * 2009-04-08 2018-12-04 夏普株式会社 Dynamic image encoding device and moving image decoding apparatus
CN104717502B (en) * 2009-04-08 2018-06-22 夏普株式会社 Dynamic image encoding device and moving image decoding apparatus
CN104717502A (en) * 2009-04-08 2015-06-17 夏普株式会社 Video encoding apparatus and video decoding apparatus
CN104717503A (en) * 2009-04-08 2015-06-17 夏普株式会社 Video encoding apparatus and video decoding apparatus
CN105187827B (en) * 2010-04-16 2019-01-11 Sk电信有限公司 Video encoding/decoding method
US9743085B2 (en) 2010-04-16 2017-08-22 Sk Telecom Co., Ltd. Video encoding/decoding apparatus and method using batch mode together with skip mode
US10250881B2 (en) 2010-04-16 2019-04-02 Sk Telecom Co., Ltd. Video encoding/decoding apparatus and method using batch mode together with skip mode
CN104837016A (en) * 2010-04-16 2015-08-12 Sk电信有限公司 Video decoding apparatus
CN105187827A (en) * 2010-04-16 2015-12-23 Sk电信有限公司 Video encoding/decoding apparatus and method
CN105306943A (en) * 2010-04-16 2016-02-03 Sk电信有限公司 Video encoding method
CN102939756B (en) * 2010-04-16 2016-03-02 Sk电信有限公司 Video encoding/decoding apparatus and method
CN102939756A (en) * 2010-04-16 2013-02-20 Sk电信有限公司 Video coding and decoding method and apparatus
CN105704490A (en) * 2010-04-16 2016-06-22 Sk电信有限公司 Video encoding/decoding apparatus and method
CN104837016B (en) * 2010-04-16 2018-10-09 Sk电信有限公司 Video decoding apparatus
US9451270B2 (en) 2010-04-16 2016-09-20 Sk Telecom Co., Ltd. Video encoding/decoding apparatus and method using batch mode together with skip mode
CN105306943B (en) * 2010-04-16 2018-07-31 Sk电信有限公司 Method for video coding
CN105704490B (en) * 2010-04-16 2018-07-31 Sk电信有限公司 Video encoder
CN103004194B (en) * 2010-05-19 2016-08-17 Sk电信有限公司 Encoding/decoding image equipment and method
CN103004194A (en) * 2010-05-19 2013-03-27 Sk电信有限公司 Image encoding/decoding device and method
CN102256139B (en) * 2010-05-19 2013-10-02 晨星软件研发(深圳)有限公司 Medium coding system, quantized coefficient coding device and quantized coefficient coding method
CN102256139A (en) * 2010-05-19 2011-11-23 晨星软件研发(深圳)有限公司 Medium coding system, quantized coefficient coding device and quantized coefficient coding method
CN107197263B (en) * 2011-01-12 2019-11-19 太阳专利托管公司 Picture decoding method and picture decoding apparatus
US11770536B2 (en) 2011-01-12 2023-09-26 Sun Patent Trust Image coding method, image decoding method, image coding apparatus, image decoding apparatus, and image coding and decoding apparatus
CN107197263A (en) * 2011-01-12 2017-09-22 太阳专利托管公司 Picture decoding method and picture decoding apparatus
US11350096B2 (en) 2011-01-12 2022-05-31 Sun Patent Trust Image coding method, image decoding method, image coding apparatus, image decoding apparatus, and image coding and decoding apparatus
US10638134B2 (en) 2011-01-12 2020-04-28 Sun Patent Trust Image coding method, image decoding method, image coding apparatus, image decoding apparatus, and image coding and decoding apparatus
CN107517384A (en) * 2011-06-16 2017-12-26 Ge视频压缩有限责任公司 Support the entropy code of pattern switching
CN107517384B (en) * 2011-06-16 2020-06-30 Ge视频压缩有限责任公司 Decoder, encoder, decoding method, encoding method, and storage medium
CN104247420A (en) * 2012-04-16 2014-12-24 高通股份有限公司 Transform coefficient coding
CN103384325A (en) * 2013-02-22 2013-11-06 张新安 Quick inter-frame prediction mode selection method for AVS-M video coding
CN106464266B (en) * 2014-06-09 2019-11-15 索尼公司 Communication system and its operating method with encoding mechanism
CN106464266A (en) * 2014-06-09 2017-02-22 索尼公司 Communication system with coding mechanism and method of operation thereof
CN105592313A (en) * 2014-10-21 2016-05-18 广东中星电子有限公司 Grouped adaptive entropy coding compression method
CN105592313B (en) * 2014-10-21 2018-11-13 广东中星电子有限公司 A kind of grouping adaptive entropy coding compression method
CN110599493A (en) * 2018-06-12 2019-12-20 财团法人工业技术研究院 Numerical array data image processing device and method and color code table generating method
WO2020062125A1 (en) * 2018-09-29 2020-04-02 富士通株式会社 Image coding method and apparatus, and electronic device
CN111641827A (en) * 2019-03-02 2020-09-08 上海天荷电子信息有限公司 Data compression method and device for prediction residual entropy coding by switching multiple schemes
CN116684003A (en) * 2023-07-27 2023-09-01 南京中科齐信科技有限公司 Quantum communication-based railway line air-ground comprehensive monitoring method and system
CN116684003B (en) * 2023-07-27 2023-10-24 南京中科齐信科技有限公司 Quantum communication-based railway line air-ground comprehensive monitoring method and system

Similar Documents

Publication Publication Date Title
CN1589023A (en) Coding and decoding method and device for multiple coded list lengthening based on context
CN1214649C (en) Entropy encoding method for encoding video predictive residual error coefficient
CN1200568C (en) Optimum scanning method for change coefficient in coding/decoding image and video
CN1224268C (en) Moving picture coding apparatus and moving picture decoding apparatus
TWI590649B (en) Apparatus for arithmetic decoding of video
KR101622450B1 (en) Video encoding and decoding using transforms
CN100348051C (en) An enhanced in-frame predictive mode coding method
CN101090495B (en) Method and system for processing video data
CN100488254C (en) Entropy coding method and decoding method based on text
KR101573338B1 (en) Method for updating a parameter used to entropy decoding of transform coefficient level, and apparatus for video decoding using the same
KR101918957B1 (en) Encoding method and apparatus for transformming hierarchical variable block and decoding method and apparatus
JP2018046573A (en) Video decoding method and apparatus therefor
CN101895756B (en) Method and system for coding, decoding and reconstructing video image blocks
CN1695168A (en) Video-information encoding method and video-information decoding method
CN103650496A (en) Pixel-based intra prediction for coding in HEVC
CN104994385A (en) Method and apparatus for entropy encoding using hierarchical data unit, and method and apparatus for decoding
TW201540049A (en) Data encoding and decoding
CN1777283A (en) Microblock based video signal coding/decoding method
CN1669235A (en) Method and apparatus for transcoding between hybrid video CODEC bitstreams
CN1149853C (en) Coding and decoding device with movement compensation
CN1268136C (en) Frame field adaptive coding method based on image slice structure
CN100337481C (en) A MPEG-2 to AVS video code stream conversion method and apparatus
CN107343199B (en) Rapid adaptive compensation method for sampling points in HEVC (high efficiency video coding)
CN105120275B (en) The implementation method of parallel CABAC-R algorithm in intra mode decision
KR20110079404A (en) Performance inhancement method of entophy coding and video coding method using the performance inhancement method and appartus thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication