posts - 36, comments - 30, trackbacks - 0, articles - 0

完整的分析mpeg2 video

Posted on 2007-05-27 17:59 vcommon 阅读(4502) 评论(5)  编辑 收藏 引用

举例分析:

首先是一段例子:

Test.m2v

 

00 00 01 B3 08 00 80 23 00 FA 20 30 00 00 01 B5

 

根据13813-2 Table 6-1 Start code values: 00 00 01 B3 sequence_header_code.根据6.2.2节(附)                                               

horizontal_size_value(12 bits)08 0 = 128

vertical_size_value(12 bits)0 80 = 128

aspect_ratio_information(4 bits)  = 2

frame_rate_code (4 bits) = 3

bit_rate_value18 bits = 00 FA 2>>2 = 0000 0000 1111 1010 00 = 1000

marker_bit(1 bit) = 1

vbv_buffer_size_value(10 bits) = 0 0000 0011 0 = 6

constrained_parameters_flag(1 bit) = 0
load_intra_quantiser_matrix( 1bit) = 0

load_non_intra_quantiser_matrix(1bit) = 0

 

00 00 01 b5 extension_start_code

 

14 82 00 01 00 00 00 00 01 B5 23 05 05 05 02 02

04 00 00 00 00 01 B2

extension_start_code_identifier(4 bits) = 1

profile_and_level_indication(8 bit) = 48

progressive_sequence( 1 bit) = 0

chroma_format(2 bits) = 01

horizontal_size_extension(2bit) = 0

vertical_size_extension(2 bit) = 0

bit_rate_extension(12 bit) = 0 0000 0000 000

marker_bit(1 bit) = 1

vbv_buffer_size_extension(8 bits) = 00

low_delay(1 bit) = 0

frame_rate_extension_n(2 bit) = 00

frame_rate_extension_d(5 bit) = 00000

 

接着,下组是Extension and user data  00 00 01 B5 extension_start_code,所以接下来是extension_data( i )

extension_start_code_identifier4bit = 2, Sequence Display Extension ID

video_format((3 bit) = 001

colour_description(1bit)=1

  colour_primaries(8) = 05

  transfer_characteristics(8)=05

  matrix_coefficients(8) = 05

display_horizontal_size(14) = 0000 0010 0000 00

marker_bit(1 bit) = 1

display_vertical_size(14) = 0 0000 0100 0000 0

还剩余了3bit 000

 

接下来是00 00 01 b2 user_data_start_codeuser_data(),我们忽略它,因为他是用户自定义的。

 

         00 00 01 B2 4D 50 45 47 2D32 20 56 65 72

69 66 69 63 61 74 69 6F5E20 53 65 71 75 65 6E

63 65 0A 00 00 01 B8

 

00 00 01 B8 group_start_code, group_of_pictures_header

       00 00 01 B8 5FBF 6C 40

time_code(25): 0101 1111 1011 1111 0110 1100 0 = 49022

closed_gop(1): 1

broken_link(1):0

剩余5bit 0 0000

 

                            00 00 01 00 00

0A 58 58 00 00 01 B5

00 00 01 00, picture_start_code, picture_header

temporal_reference(10): 0000 0000 00

picture_coding_type(3): 00 1

vbv_delay(16):001 1000 1001 1

extra_bit_picture(1):0

         

        00 00 01 B5 8F FF F7 CC 00 00 00 01 01

00 00 01 B5: extension_start_code,所以接下来是extension_data( i )

extension_start_code_identifier4bit = 8, Picture Coding Extension ID,6.2.3.1

 

f_code[0][0]   /* forward horizontal */(4): F

f_code[0][1]   /* forward vertical */(4):F

f_code[1][0]   /* backward horizontal */(4):F

f_code[1][1]   /* backward vertical */(4):F

intra_dc_precision(2): 01

picture_structure(2): 11

top_field_first(1):1

frame_pred_frame_dct(1):1

concealment_motion_vectors(1):0

q_scale_type(1):0

intra_vlc_format:(1):1

alternate_scan(1);1

repeat_first_field(1):0

chroma_420_type(1):0

progressive_frame(1);0

composite_display_flag(1):0

 

所以接下来将是picture_data,即是很多slice

00 00 01 01: slice_start_code

Sequence headerhorizontal_size_value Sequence header extention中的horizontal_size 组成了horizontal_size

53 D0 54 90 F1 E7 21 48 18 A0 3C24 B6 F3 4A D2

 

quantiser_scale_code(5): 0101 0 = 10

extra_bit_slice /* with the value “0” */ (1):0

接下来就是macroblock()了。

 

macroblock_address_increment(1-11) — This is a variable length coded integer coded as per Annex B Table B-1,

查表得:macroblock_address_increment  = 1

macroblock_modes()table 6.2.51.

macroblock_type(1-9): Tables B-2 through B-8, selected by picture_coding_type and scalable_mode.

 

1 1101 0000  

查表得:macroblock_type = 1,I picture,no scale

              macroblock_quant = 0

              macroblock_motion_forward = 0

              macroblock_motion_backward = 0

              macroblock_pattern = 0

              macroblock_intra = 1

              spatial_temporal_weight_code_flag = 0

              permitted spatial_temporal_weight_classes:0 ,Intra

所以没有其他结构,block_count = Table 6-20(并根据chroma_format’10’ = ‘4:2:0 see Table 6-5 8-5) 全是block = 6

 

VLC7.2节:

对于前4blcokcc = 0.cc = 0,使用B-12,cc!=0,使用B13

First DCT coefficient(3-24)即是DC系数,根据B-12,B13.

First DCT coefficient = 110, dct_dc_size_luminance = 4,所以dct_dc_differential(=4bit)

dct_dc_differential = 1 000

pattern_code[i] = 1 默认?

First DCT coefficient应该 = 预测值+differential,预测值初始化0,然后[i]的预测值变为1000 = 8, intra_dc_precision((picture_coding_extension) = 01, 所以Precision (bits) = 9 7.4.1

First DCT coefficient = 8*4 = 32

 

 

然后是接下来的AC系数。

53 D0 54        90       F1       E7       21      

48      18        A0       3C      24

B6      F3      4A        D2

0 0101 0100 1001 0000 1111 0001 1110 0111 0010 0001

0100 1000 0001 0100 1010 0000 0011 1100 0010 0100

1011 0110 1111 0011 0100 1010 1101 0010 

根据b-14,B-15得:

ACintra_vlc_format (picture_coding_extension) = 1,macroblock_intra = 1,所以使用B-15

quantiser_scale_code (slice header)= 10, q_scale_type(picture_coding_extension) = 0, quantiser_scale[q_scale_type] = 20.根据7.4.2.3 intra_block,加权系数根据6.2.3.2决定,6.3.11有个默认矩阵。矩阵z字型对应alternate_scan(picturecodeing_extension)决定。

val = val * quantiser_scale[q_scale_type] * w[]/16;

00101: run 2 level 1 len5,run代表0的个数。,AC[1] = 0,AC[2] = 0

0signed,所以AC[3] = 1 计算= 1* 20* 22/16 = 27

10:run 0 level 1 len 2,

0:signed,AC[4]=1 计算 =1*20*16/16 = 20

0 1001

。。。。。。。

最后得到一个block:

32 20 23 27 32 -33 0 0

0 20 0 0 0 0 0 0

0 0 0 0 36 0 0 0

27 0 0 33 0 0 0 0

-27 0 0 0 0 0 0 0

0 -33 36 0 87 0 -60 0

0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0

 

 

根据alterz-zig的排列,dc = 32, ac[1] = 0,ac[2] = 0,ac[3] = 27,ac[4] = 20,……II2-7.3

 

然后经过IDCT:

38 4 -35 7 28 -15 -9 18

…….

 

然后把所有变成一个范围内的Clip.

把所有的block到结束时,就行成了一个完整的Frame.

                     

 

 

 

附录,主要

Table 6-1 — Start code values

Name

start code value

(hexadecimal)

picture_start_code

00

Slice_start_code

01 through AF

Reserved

B0

Reserved

B1

User_data_start_code

B2

sequence_header_code

B3

sequence_error_code

B4

extension_start_code

B5

Reserved

B6

Sequence_end_code

B7

group_start_code

B8

system start codes (see note)

B9 through FF

NOTE - system start codes are defined in Part 1 of this specification

 

6.2.2节:

video_sequence() {

        next_start_code()

        sequence_header()

        if ( nextbits() == extension_start_code ) {

                sequence_extension()

                do {

                        extension_and_user_data( 0 )

                        do {

                                if (nextbits() == group_start_code) {

                                        group_of_pictures_header()

                                        Extension_and_user_data( 1 )

                                }

                                picture_header()

                                picture_coding_extension()

                                extensions_and_user_data( 2 )

                                picture_data()

                        } while ( (nextbits() == picture_start_code) ||

                                        (nextbits() == group_start_code) )

                        if ( nextbits() != sequence_end_code ) {

                                sequence_header()

                                sequence_extension()

                        }

                } while ( nextbits() != sequence_end_code )

        } else {

                /* ISO/IEC 11172-2 */

        }

        sequence_end_code

}

 

6.2.2.1            Sequence header

sequence_header() {

No. of bits

Mnemonic

        sequence_header_code

32

bslbf

        horizontal_size_value

12

uimsbf

        vertical_size_value

12

uimsbf

        aspect_ratio_information

4

uimsbf

        frame_rate_code

4

uimsbf

        bit_rate_value

18

uimsbf

        marker_bit

1

bslbf

        vbv_buffer_size_value

10

uimsbf

        constrained_parameters_flag

1

 

        load_intra_quantiser_matrix

1

 

        if ( load_intra_quantiser_matrix )

 

 

                intra_quantiser_matrix[64]    

8*64

uimsbf

        load_non_intra_quantiser_matrix

1

 

        if ( load_non_intra_quantiser_matrix )

 

 

                non_intra_quantiser_matrix[64]

8*64

uimsbf

        next_start_code()

 

 

}

 

 

 

6.2.2.3            Sequence extension

sequence_extension() {

No. of bits

Mnemonic

        extension_start_code

32

bslbf

        extension_start_code_identifier

4

uimsbf

        profile_and_level_indication

8

uimsbf

        progressive_sequence

1

uimsbf

        chroma_format

2

uimsbf

        horizontal_size_extension

2

uimsbf

        vertical_size_extension

2

uimsbf

        bit_rate_extension

12

uimsbf

        marker_bit

1

bslbf

        vbv_buffer_size_extension

8

uimsbf

        low_delay

1

uimsbf

        frame_rate_extension_n

2

uimsbf

        frame_rate_extension_d

5

uimsbf

        next_start_code()

 

 

}

 

 

 

6.2.2.2            Extension and user data

extension_and_user_data( i ) {

No. of bits

Mnemonic

        while ( ( ( i != 1) && ( nextbits()== extension_start_code ) ) ||

 

 

                        ( nextbits()== user_data_start_code ) ) {

 

 

                if ( nextbits()== extension_start_code )

 

 

                        extension_data( i )

 

 

                if ( nextbits()== user_data_start_code )

 

 

                        user_data()

 

 

        }

 

 

}

 

 

Table 6-2. extension_start_code_identifier codes.

extension_start_code_identifier

Name

0000

reserved

0001

Sequence Extension ID

0010

Sequence Display Extension ID

0011

Quant Matrix Extension ID

0100

Copyright Extension ID

0101

Sequence Scalable Extension ID

0110

reserved

0111

Picture Display Extension ID

1000

Picture Coding Extension ID

1001

Picture Spatial Scalable Extension ID

1010

Picture Temporal Scalable Extension ID

1011

reserved

1100

reserved

...

...

1111

reserved

 

6.2.2.4            Sequence display extension

sequence_display_extension() {

No. of bits

Mnemonic

        extension_start_code_identifier

4

uimsbf

        video_format

3

uimsbf

        colour_description

1

uimsbf

        if ( colour_description ) {

 

 

                colour_primaries

8

uimsbf

                transfer_characteristics

8

uimsbf

                matrix_coefficients

8

uimsbf

        }

 

 

        display_horizontal_size

14

uimsbf

        marker_bit

1

bslbf

        display_vertical_size

14

uimsbf

        next_start_code()

 

 

}

 

 

 

6.2.2.2.2   User data

user_data() {

No. of bits

Mnemonic

        user_data_start_code

32

bslbf

        while( nextbits() != ‘0000 0000 0000 0000 0000 0001’ ) {

 

 

                user_data

8

 

        }

 

 

        next_start_code()

 

 

}

 

 

 

6.2.2.6            Group of pictures header

group_of_pictures_header() {

No. of bits

Mnemonic

        group_start_code

32

bslbf

        time_code

25

bslbf

        closed_gop

1

uimsbf

        broken_link

1

uimsbf

        next_start_code()

 

 

}

 

 

 

6.2.3   Picture header

picture_header()  {

No. of bits

Mnemonic

        picture_start_code

32

bslbf

        temporal_reference

10

uimsbf

        picture_coding_type

3

uimsbf

        vbv_delay

16

uimsbf

        if ( picture_coding_type == 2 || picture_coding_type == 3) {

 

 

                full_pel_forward_vector

1

 

                forward_f_code

3

uimsbf

        }

 

 

        if ( picture_coding_type == 3 ) {

 

 

                full_pel_backward_vector

1

 

                backward_f_code

3

uimsbf

        }

 

 

        while ( nextbits() == '1' ) {

 

 

                extra_bit_picture        /* with the value “1” */

1

uimsbf

                extra_information_picture

8

 

        }

 

 

        extra_bit_picture        /* with the value “0” */

1

uimsbf

        next_start_code()

 

 

}

 

 

 

6.2.3.1            Picture coding extension

picture_coding_extension() {

No . of bits

Mnemonic

        extension_start_code

32

bslbf

        extension_start_code_identifier

4

uimsbf

        f_code[0][0]  /* forward horizontal */

4

uimsbf

        f_code[0][1]  /* forward vertical */

4

uimsbf

        f_code[1][0]  /* backward horizontal */

4

uimsbf

        f_code[1][1]  /* backward vertical */

4

uimsbf

        intra_dc_precision

2

uimsbf

        picture_structure

2

uimsbf

        top_field_first

1

uimsbf

        frame_pred_frame_dct

1

uimsbf

        concealment_motion_vectors

1

uimsbf

        q_scale_type

1

uimsbf

        intra_vlc_format

1

uimsbf

        alternate_scan

1

uimsbf

        repeat_first_field

1

uimsbf

        chroma_420_type

1

uimsbf

        progressive_frame

1

uimsbf

        composite_display_flag

1

uimsbf

        if ( composite_display_flag ) {

 

 

                v_axis

1

uimsbf

                field_sequence

3

uimsbf

                sub_carrier

1

uimsbf

                burst_amplitude

7

uimsbf

                sub_carrier_phase

8

uimsbf

        }

 

 

        next_start_code()

 

 

}

 

 

 

6.2.3.6            Picture data

picture_data() {

No. of bits

Mnemonic

        do {

 

 

                slice()

 

 

        } while ( nextbits() == slice_start_code )

 

 

        next_start_code()

 

 

}

 

 

 

6.2.4   Slice

slice() {

No. of bits

Mnemonic

        slice_start_code

32

bslbf

        if (vertical_size > 2800)

 

 

                slice_vertical_position_extension

3

uimsbf

        if ( <sequence_scalable_extension() is present in the bitstream> )

 

 

                if (scalable_mode == “data partitioning” )

 

 

                        priority_breakpoint

7

uimsbf

        quantiser_scale_code

5

uimsbf

        if ( nextbits() == '1' ) {

 

 

                intra_slice_flag

1

bslbf

                intra_slice

1

uimsbf

                reserved_bits

7

uimsbf

                while ( nextbits() == '1' ) {

 

 

                        extra_bit_slice     /* with the value “1” */

1

uimsbf

                        extra_information_slice

8

 

                }

 

 

        }

 

 

        extra_bit_slice     /* with the value “0” */

1

Uimsbf

        do {

 

 

                macroblock()

 

 

        } while ( nextbits() != '000 0000 0000 0000 0000 0000' )

 

 

        next_start_code()

 

 

}

 

 

 

B.1    Macroblock addressing

Table B-1 --- Variable length codes for macroblock_address_increment

macroblock_address_ increment VLC code

increment value

macroblock_address_ increment VLC code

increment value

1

1

0000 0101 01

18

011

2

0000 0101 00

19

010

3

0000 0100 11

20

0011

4

0000 0100 10

21

0010

5

0000 0100 011

22

0001 1

6

0000 0100 010

23

0001 0

7

0000 0100 001

24

0000 111

8

0000 0100 000

25

0000 110

9

0000 0011 111

26

0000 1011

10

0000 0011 110

27

0000 1010

11

0000 0011 101

28

0000 1001

12

0000 0011 100

29

0000 1000

13

0000 0011 011

30

0000 0111

14

0000 0011 010

31

0000 0110

15

0000 0011 001

32

0000 0101 11

16

0000 0011 000

33

0000 0101 10

17

0000 0001 000

macroblock_escape

Note:              The “macroblock stuffing” entry that is available in ISO/IEC11172-2  is not available in this specification.

B.2    Macroblock type

The properties of the macroblock are determined by the macroblock type VLC according to these tables.

Table B-2 — Variable length codes for macroblock_type in I-pictures

macroblock_type VLC code

 

macroblock_quant

 

 

macroblock_motion_forward

 

 

 

macroblock_motion_backward

 

 

 

 

macroblock_pattern

 

 

 

 

 

macroblock_intra

 

 

 

 

 

 

spatial_temporal_weight_code_flag

 

 

 

 

 

 

 

permitted spatial_temporal_weight_classes

 

 

 

 

 

 

 

Description

 

1

0

0

0

0

1

0

Intra

0

01

1

0

0

0

1

0

Intra, Quant

0

 

Table B-3 — Variable length codes for macroblock_type in P-pictures

macroblock_type VLC code

 

macroblock_quant

 

 

macroblock_motion_forward

 

 

 

macroblock_motion_backward

 

 

 

 

macroblock_pattern

 

 

 

 

 

macroblock_intra

 

 

 

 

 

 

spatial_temporal_weight_code_flag

 

 

 

 

 

 

 

permitted spatial_temporal_weight_classes

 

 

 

 

 

 

 

Description

 

1

0

1

0

1

0

0

MC, Coded

0

01

0

0

0

1

0

0

No MC, Coded

0

001

0

1

0

0

0

0

MC, Not Coded

0

0001 1

0

0

0

0

1

0

Intra

0

0001 0

1

1

0

1

0

0

MC, Coded, Quant

0

0000 1

1

0

0

1

0

0

No MC, Coded, Quant

0

0000 01

1

0

0

0

1

0

Intra, Quant

0

 

Table B-4 — Variable length codes for macroblock_type in B-pictures

macroblock_type VLC code

 

macroblock_quant

 

 

macroblock_motion_forward

 

 

 

macroblock_motion_backward

 

 

 

 

macroblock_pattern

 

 

 

 

 

macroblock_intra

 

 

 

 

 

 

spatial_temporal_weight_code_flag

 

 

 

 

 

 

 

permitted spatial_temporal_weight_classes

 

 

 

 

 

 

 

Description

 

10

0

1

1

0

0

0

Interp, Not Coded

0

11

0

1

1

1

0

0

Interp, Coded

0

010

0

0

1

0

0

0

Bwd, Not Coded

0

011

0

0

1

1

0

0

Bwd, Coded

0

0010

0

1

0

0

0

0

Fwd, Not Coded

0

0011

0

1

0

1

0

0

Fwd, Coded

0

0001 1

0

0

0

0

1

0

Intra

0

0001 0

1

1

1

1

0

0

Interp, Coded, Quant

0

0000 11

1

1

0

1

0

0

Fwd, Coded, Quant

0

0000 10

1

0

1

1

0

0

Bwd, Coded, Quant

0

0000 01

1

0

0

0

1

0

Intra, Quant

0

 

Table B-5 — Variable length codes for macroblock_type in I-pictures with spatial scalability.

macroblock_type VLC code

 

macroblock_quant

 

 

macroblock_motion_forward

 

 

 

macroblock_motion_backward

 

 

 

 

macroblock_pattern

 

 

 

 

 

macroblock_intra

 

 

 

 

 

 

spatial_temporal_weight_code_flag

 

 

 

 

 

 

 

permitted spatial_temporal_weight_classes

 

 

 

 

 

 

 

Description

 

1

0

0

0

1

0

0

Coded, Compatible

4

01

1

0

0

1

0

0

Coded, Compatible, Quant

4

0011

0

0

0

0

1

0

Intra

0

0010

1

0

0

0

1

0

Intra, Quant

0

0001

0

0

0

0

0

0

Not Coded, Compatible

4

 

Table B-6 — Variable length codes for macroblock_type in P-pictures with spatial scalability.

macroblock_type VLC code

 

macroblock_quant

 

 

macroblock_motion_forward

 

 

 

macroblock_motion_backward

 

 

 

 

macroblock_pattern

 

 

 

 

 

macroblock_intra

 

 

 

 

 

 

spatial_temporal_weight_code_flag

 

 

 

 

 

 

 

permitted spatial_temporal_weight_classes

 

 

 

 

 

 

 

Description

 

10

0

1

0

1

0

0

MC, Coded

0

011

0

1

0

1

0

1

MC, Coded, Compatible

1,2,3

0000 100

0

0

0

1

0

0

No MC, Coded

0

0001 11

0

0

0

1

0

1

No MC, Coded, Compatible

1,2,3

0010

0

1

0

0

0

0

MC, Not Coded

0

0000 111

0

0

0

0

1

0

Intra

0

0011

0

1

0

0

0

1

MC, Not coded, Compatible

1,2,3

010

1

1

0

1

0

0

MC, Coded, Quant

0

0001 00

1

0

0

1

0

0

No MC, Coded, Quant

0

0000 110

1

0

0

0

1

0

Intra, Quant

0

11

1

1

0

1

0

1

MC, Coded, Compatible, Quant

1,2,3

0001 01

1

0

0

1

0

1

No MC, Coded, Compatible, Quant

1,2,3

0001 10

0

0

0

0

0

1

No MC, Not Coded, Compatible

1,2,3

0000 101

0

0

0

1

0

0

Coded, Compatible

4

0000 010

1

0

0

1

0

0

Coded, Compatible, Quant

4

0000 011

0

0

0

0

0

0

Not Coded, Compatible

4

 

Table B-7 — Variable length codes for macroblock_type in B-pictures with spatial scalability.

macroblock_type VLC code

 

macroblock_quant

 

 

macroblock_motion_forward

 

 

 

macroblock_motion_backward

 

 

 

 

macroblock_pattern

 

 

 

 

 

macroblock_intra

 

 

 

 

 

 

spatial_temporal_weight_code_flag

 

 

 

 

 

 

 

permitted spatial_temporal_weight_classes

 

 

 

 

 

 

 

Description

 

10

0

1

1

0

0

0

Interp, Not coded

0

11

0

1

1

1

0

0

Interp, Coded

0

010

0

0

1

0

0

0

Back, Not coded

0

011

0

0

1

1

0

0

Back, Coded

0

0010

0

1

0

0

0

0

For, Not coded

0

0011

0

1

0

1

0

0

For, Coded

0

0001 10

0

0

1

0

0

1

Back, Not Coded, Compatible

1,2,3

0001 11

0

0

1

1

0

1

Back, Coded, Compatible

1,2,3

0001 00

0

1

0

0

0

1

For, Not Coded, Compatible

1,2,3

0001 01

0

1

0

1

0

1

For, Coded, Compatible

1,2,3

0000 110

0

0

0

0

1

0

Intra

0

0000 111

1

1

1

1

0

0

Interp, Coded, Quant

0

0000 100

1

1

0

1

0

0

For, Coded, Quant

0

0000 101

1

0

1

1

0

0

Back, Coded, Quant

0

0000 0100

1

0

0

0

1

0

Intra, Quant

0

0000 0101

1

1

0

1

0

1

For, Coded, Compatible, Quant

1,2,3

0000 0110 0

1

0

1

1

0

1

Back, Coded, Compatible, Quant

1,2,3

0000 0111 0

0

0

0

0

0

0

Not Coded, Compatible

4

0000 0110 1

1

0

0

1

0

0

Coded, Compatible, Quant

4

0000 0111 1

0

0

0

1

0

0

Coded, Compatible

4

 

Table B-8 — Variable length codes for macroblock_type in I-pictures, P-pictures and B-pictures with SNR scalability.

macroblock_type VLC code

 

macroblock_quant

 

 

macroblock_motion_forward

 

 

 

macroblock_motion_backward

 

 

 

 

macroblock_pattern

 

 

 

 

 

macroblock_intra

 

 

 

 

 

 

spatial_temporal_weight_code_flag

 

 

 

 

 

 

 

permitted spatial_temporal_weight_classes

 

 

 

 

 

 

 

Description

 

1

0

0

0

1

0

0

Coded

0

01

1

0

0

1

0

0

Coded, Quant

0

001

0

0

0

0

0

0

Not Coded

0

 

Note               There is no differentiation between picture types, since macroblocks are processed identically in I, P and B-pictures. The "Not coded" type is needed, since skipped macroblocks are not allowed at beginning and end of a slice.

 

B.3    Macroblock pattern

Table B-9 --- Variable length codes for coded_block_pattern.

coded_block_pattern VLC code

cbp

coded_block_pattern VLC code

cbp

111

60

0001 1100

35

1101

4

0001 1011

13

1100

8

0001 1010

49

1011

16

0001 1001

21

1010

32

0001 1000

41

1001 1

12

0001 0111

14

1001 0

48

0001 0110

50

1000 1

20

0001 0101

22

1000 0

40

0001 0100

42

0111 1

28

0001 0011

15

0111 0

44

0001 0010