static void mpeg_decode_sequence_extension(MpegEncContext *s)

{

    int horiz_size_ext, vert_size_ext;

    int bit_rate_ext, vbv_buf_ext, low_delay;

    int frame_rate_ext_n, frame_rate_ext_d;



    skip_bits(&s->gb, 8); /* profil and level */

    skip_bits(&s->gb, 1); /* progressive_sequence */

    skip_bits(&s->gb, 2); /* chroma_format */

    horiz_size_ext = get_bits(&s->gb, 2);

    vert_size_ext = get_bits(&s->gb, 2);

    s->width |= (horiz_size_ext << 12);

    s->height |= (vert_size_ext << 12);

    bit_rate_ext = get_bits(&s->gb, 12);  /* XXX: handle it */

    s->bit_rate = ((s->bit_rate / 400) | (bit_rate_ext << 12)) * 400;

    skip_bits1(&s->gb); /* marker */

    vbv_buf_ext = get_bits(&s->gb, 8);

    low_delay = get_bits1(&s->gb);

    frame_rate_ext_n = get_bits(&s->gb, 2);

    frame_rate_ext_d = get_bits(&s->gb, 5);

    if (frame_rate_ext_d >= 1)

        s->frame_rate = (s->frame_rate * frame_rate_ext_n) / frame_rate_ext_d;

    dprintf("sequence extension\n");

    s->mpeg2 = 1;

}

static void mpeg_decode_sequence_extension(MpegEncContext *s)

{

    int horiz_size_ext, vert_size_ext;

    int bit_rate_ext, vbv_buf_ext, low_delay;

    int frame_rate_ext_n, frame_rate_ext_d;



    skip_bits(&s->gb, 8); 

    skip_bits(&s->gb, 1); 

    skip_bits(&s->gb, 2); 

    horiz_size_ext = get_bits(&s->gb, 2);

    vert_size_ext = get_bits(&s->gb, 2);

    s->width |= (horiz_size_ext << 12);

    s->height |= (vert_size_ext << 12);

    bit_rate_ext = get_bits(&s->gb, 12);  

    s->bit_rate = ((s->bit_rate / 400) | (bit_rate_ext << 12)) * 400;

    skip_bits1(&s->gb); 

    vbv_buf_ext = get_bits(&s->gb, 8);

    low_delay = get_bits1(&s->gb);

    frame_rate_ext_n = get_bits(&s->gb, 2);

    frame_rate_ext_d = get_bits(&s->gb, 5);

    if (frame_rate_ext_d >= 1)

        s->frame_rate = (s->frame_rate * frame_rate_ext_n) / frame_rate_ext_d;

    dprintf("sequence extension\n");

    s->mpeg2 = 1;

}

static void FUNC_0(MpegEncContext *VAR_0)

{

    int VAR_1, VAR_2;

    int VAR_3, VAR_4, VAR_5;

    int VAR_6, VAR_7;



    skip_bits(&VAR_0->gb, 8); 

    skip_bits(&VAR_0->gb, 1); 

    skip_bits(&VAR_0->gb, 2); 

    VAR_1 = get_bits(&VAR_0->gb, 2);

    VAR_2 = get_bits(&VAR_0->gb, 2);

    VAR_0->width |= (VAR_1 << 12);

    VAR_0->height |= (VAR_2 << 12);

    VAR_3 = get_bits(&VAR_0->gb, 12);  

    VAR_0->bit_rate = ((VAR_0->bit_rate / 400) | (VAR_3 << 12)) * 400;

    skip_bits1(&VAR_0->gb); 

    VAR_4 = get_bits(&VAR_0->gb, 8);

    VAR_5 = get_bits1(&VAR_0->gb);

    VAR_6 = get_bits(&VAR_0->gb, 2);

    VAR_7 = get_bits(&VAR_0->gb, 5);

    if (VAR_7 >= 1)

        VAR_0->frame_rate = (VAR_0->frame_rate * VAR_6) / VAR_7;

    dprintf("sequence extension\n");

    VAR_0->mpeg2 = 1;

}

static void FUNC_0(MpegEncContext *VAR_0)
{ int VAR_1, VAR_2; int VAR_3, VAR_4, VAR_5; int VAR_6, VAR_7; skip_bits(&VAR_0->gb, 8); skip_bits(&VAR_0->gb, 1); skip_bits(&VAR_0->gb, 2); VAR_1 = get_bits(&VAR_0->gb, 2); VAR_2 = get_bits(&VAR_0->gb, 2); VAR_0->width |= (VAR_1 << 12); VAR_0->height |= (VAR_2 << 12); VAR_3 = get_bits(&VAR_0->gb, 12); VAR_0->bit_rate = ((VAR_0->bit_rate / 400) | (VAR_3 << 12)) * 400; skip_bits1(&VAR_0->gb); VAR_4 = get_bits(&VAR_0->gb, 8); VAR_5 = get_bits1(&VAR_0->gb); VAR_6 = get_bits(&VAR_0->gb, 2); VAR_7 = get_bits(&VAR_0->gb, 5); if (VAR_7 >= 1)
VAR_0->frame_rate = (VAR_0->frame_rate * VAR_6) / VAR_7; dprintf("sequence extension\n"); VAR_0->mpeg2 = 1; }