static int advanced_decode_picture_primary_header(VC9Context *v)

{

    GetBitContext *gb = &v->s.gb;

    static const int type_table[4] = { P_TYPE, B_TYPE, I_TYPE, BI_TYPE };

    int type, i;



    if (v->interlace)

    {

        v->fcm = get_bits(gb, 1);

        if (v->fcm) v->fcm = 2+get_bits(gb, 1);

    }



    type = get_prefix(gb, 0, 4);

    if (type > 4 || type < 0) return FRAME_SKIPED;

    v->s.pict_type = type_table[type];

    av_log(v->s.avctx, AV_LOG_INFO, "AP Frame Type: %i\n", v->s.pict_type);



    if (v->tfcntrflag) v->tfcntr = get_bits(gb, 8);

    if (v->broadcast)

    {

        if (!v->interlace) v->rptfrm = get_bits(gb, 2);

        else

        {

            v->tff = get_bits(gb, 1);

            v->rff = get_bits(gb, 1);

        }

    }



    if (v->panscanflag)

    {

#if 0

        for (i=0; i<v->numpanscanwin; i++)

        {

            v->topleftx[i] = get_bits(gb, 16);

            v->toplefty[i] = get_bits(gb, 16);

            v->bottomrightx[i] = get_bits(gb, 16);

            v->bottomrighty[i] = get_bits(gb, 16);

        }

#else

        skip_bits(gb, 16*4*v->numpanscanwin);

#endif

    }

    v->s.no_rounding = !get_bits(gb, 1);

    v->uvsamp = get_bits(gb, 1);

    if (v->finterpflag == 1) v->interpfrm = get_bits(gb, 1);



    switch(v->s.pict_type)

    {

    case I_TYPE: if (decode_i_picture_header(v) < 0) return -1;

    case P_TYPE: if (decode_p_picture_primary_header(v) < 0) return -1;

    case BI_TYPE:

    case B_TYPE: if (decode_b_picture_primary_header(v) < 0) return FRAME_SKIPED;

    default: break;

    }

    return 0;

}

static int advanced_decode_picture_primary_header(VC9Context *v)

{

    GetBitContext *gb = &v->s.gb;

    static const int type_table[4] = { P_TYPE, B_TYPE, I_TYPE, BI_TYPE };

    int type, i;



    if (v->interlace)

    {

        v->fcm = get_bits(gb, 1);

        if (v->fcm) v->fcm = 2+get_bits(gb, 1);

    }



    type = get_prefix(gb, 0, 4);

    if (type > 4 || type < 0) return FRAME_SKIPED;

    v->s.pict_type = type_table[type];

    av_log(v->s.avctx, AV_LOG_INFO, "AP Frame Type: %i\n", v->s.pict_type);



    if (v->tfcntrflag) v->tfcntr = get_bits(gb, 8);

    if (v->broadcast)

    {

        if (!v->interlace) v->rptfrm = get_bits(gb, 2);

        else

        {

            v->tff = get_bits(gb, 1);

            v->rff = get_bits(gb, 1);

        }

    }



    if (v->panscanflag)

    {

#if 0

        for (i=0; i<v->numpanscanwin; i++)

        {

            v->topleftx[i] = get_bits(gb, 16);

            v->toplefty[i] = get_bits(gb, 16);

            v->bottomrightx[i] = get_bits(gb, 16);

            v->bottomrighty[i] = get_bits(gb, 16);

        }

#else

        skip_bits(gb, 16*4*v->numpanscanwin);

#endif

    }

    v->s.no_rounding = !get_bits(gb, 1);

    v->uvsamp = get_bits(gb, 1);

    if (v->finterpflag == 1) v->interpfrm = get_bits(gb, 1);



    switch(v->s.pict_type)

    {

    case I_TYPE: if (decode_i_picture_header(v) < 0) return -1;

    case P_TYPE: if (decode_p_picture_primary_header(v) < 0) return -1;

    case BI_TYPE:

    case B_TYPE: if (decode_b_picture_primary_header(v) < 0) return FRAME_SKIPED;

    default: break;

    }

    return 0;

}

#endif #endif     case BI_TYPE:     int type, i;     case I_TYPE: if (decode_i_picture_header(v) < 0) return -1;     default: break;     return 0;     default: break;
static int FUNC_0(VC9Context *VAR_0)

{

    GetBitContext *gb = &VAR_0->s.gb;

    static const int VAR_1[4] = { P_TYPE, B_TYPE, I_TYPE, BI_TYPE };

    int VAR_2, VAR_3;



    if (VAR_0->interlace)

    {

        VAR_0->fcm = get_bits(gb, 1);

        if (VAR_0->fcm) VAR_0->fcm = 2+get_bits(gb, 1);

    }



    VAR_2 = get_prefix(gb, 0, 4);

    if (VAR_2 > 4 || VAR_2 < 0) return FRAME_SKIPED;

    VAR_0->s.pict_type = VAR_1[VAR_2];

    av_log(VAR_0->s.avctx, AV_LOG_INFO, "AP Frame Type: %VAR_3\n", VAR_0->s.pict_type);



    if (VAR_0->tfcntrflag) VAR_0->tfcntr = get_bits(gb, 8);

    if (VAR_0->broadcast)

    {

        if (!VAR_0->interlace) VAR_0->rptfrm = get_bits(gb, 2);

        else

        {

            VAR_0->tff = get_bits(gb, 1);

            VAR_0->rff = get_bits(gb, 1);

        }

    }



    if (VAR_0->panscanflag)

    {

#if 0

        for (VAR_3=0; VAR_3<VAR_0->numpanscanwin; VAR_3++)

        {

            VAR_0->topleftx[VAR_3] = get_bits(gb, 16);

            VAR_0->toplefty[VAR_3] = get_bits(gb, 16);

            VAR_0->bottomrightx[VAR_3] = get_bits(gb, 16);

            VAR_0->bottomrighty[VAR_3] = get_bits(gb, 16);

        }

#else

        skip_bits(gb, 16*4*VAR_0->numpanscanwin);

#endif

    }

    VAR_0->s.no_rounding = !get_bits(gb, 1);

    VAR_0->uvsamp = get_bits(gb, 1);

    if (VAR_0->finterpflag == 1) VAR_0->interpfrm = get_bits(gb, 1);



    switch(VAR_0->s.pict_type)

    {

    case I_TYPE: if (decode_i_picture_header(VAR_0) < 0) return -1;

    case P_TYPE: if (decode_p_picture_primary_header(VAR_0) < 0) return -1;

    case BI_TYPE:

    case B_TYPE: if (decode_b_picture_primary_header(VAR_0) < 0) return FRAME_SKIPED;

    default: break;

    }

    return 0;

}

static int FUNC_0(VC9Context *VAR_0)
{ GetBitContext *gb = &VAR_0->s.gb; static const int VAR_1[4] = { P_TYPE, B_TYPE, I_TYPE, BI_TYPE }; int VAR_2, VAR_3; if (VAR_0->interlace)
{ VAR_0->fcm = get_bits(gb, 1); if (VAR_0->fcm) VAR_0->fcm = 2+get_bits(gb, 1); } VAR_2 = get_prefix(gb, 0, 4); if (VAR_2 > 4 || VAR_2 < 0) return FRAME_SKIPED; VAR_0->s.pict_type = VAR_1[VAR_2]; av_log(VAR_0->s.avctx, AV_LOG_INFO, "AP Frame Type: %VAR_3\n", VAR_0->s.pict_type); if (VAR_0->tfcntrflag) VAR_0->tfcntr = get_bits(gb, 8); if (VAR_0->broadcast)
{ if (!VAR_0->interlace) VAR_0->rptfrm = get_bits(gb, 2); else
{ VAR_0->tff = get_bits(gb, 1); VAR_0->rff = get_bits(gb, 1); } } if (VAR_0->panscanflag)
{ #if 0
for (VAR_3=0; VAR_3<VAR_0->numpanscanwin; VAR_3++) { VAR_0->topleftx[VAR_3] = get_bits(gb, 16); VAR_0->toplefty[VAR_3] = get_bits(gb, 16); VAR_0->bottomrightx[VAR_3] = get_bits(gb, 16); VAR_0->bottomrighty[VAR_3] = get_bits(gb, 16); } #else
skip_bits(gb, 16*4*VAR_0->numpanscanwin); #endif
} VAR_0->s.no_rounding = !get_bits(gb, 1); VAR_0->uvsamp = get_bits(gb, 1); if (VAR_0->finterpflag == 1) VAR_0->interpfrm = get_bits(gb, 1); switch(VAR_0->s.pict_type)
{ case I_TYPE: if (decode_i_picture_header(VAR_0) < 0) return -1; case P_TYPE: if (decode_p_picture_primary_header(VAR_0) < 0) return -1; case BI_TYPE:
case B_TYPE: if (decode_b_picture_primary_header(VAR_0) < 0) return FRAME_SKIPED; default: break; } return 0; }