static int decode_b_picture_secondary_header(VC9Context *v)

{

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

    int status;



    bitplane_decoding(&v->skip_mb_plane, v);

    if (status < 0) return -1;

#if TRACE

    if (v->mv_mode == MV_PMODE_MIXED_MV)

    {

        status = bitplane_decoding(&v->mv_type_mb_plane, v);

        if (status < 0)

            return -1;

#if TRACE

        av_log(v->s.avctx, AV_LOG_DEBUG, "MB MV Type plane encoding: "

               "Imode: %i, Invert: %i\n", status>>1, status&1);

#endif

    }



    //bitplane

    status = bitplane_decoding(&v->direct_mb_plane, v);

    if (status < 0) return -1;

#if TRACE

    av_log(v->s.avctx, AV_LOG_DEBUG, "MB Direct plane encoding: "

           "Imode: %i, Invert: %i\n", status>>1, status&1);

#endif



    av_log(v->s.avctx, AV_LOG_DEBUG, "Skip MB plane encoding: "

           "Imode: %i, Invert: %i\n", status>>1, status&1);

#endif



    /* FIXME: what is actually chosen for B frames ? */

    v->s.mv_table_index = get_bits(gb, 2); //but using vc9_ tables

    v->cbpcy_vlc = &vc9_cbpcy_p_vlc[get_bits(gb, 2)];



    if (v->dquant)

    {

        vop_dquant_decoding(v);

    }



    if (v->vstransform)

    {

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

        if (v->ttmbf)

        {

            v->ttfrm = get_bits(gb, 2);

            av_log(v->s.avctx, AV_LOG_INFO, "Transform used: %ix%i\n",

                   (v->ttfrm & 2) ? 4 : 8, (v->ttfrm & 1) ? 4 : 8);

        }

    }

    /* Epilog (AC/DC syntax) should be done in caller */

    return 0;

}

static int decode_b_picture_secondary_header(VC9Context *v)

{

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

    int status;



    bitplane_decoding(&v->skip_mb_plane, v);

    if (status < 0) return -1;

#if TRACE

    if (v->mv_mode == MV_PMODE_MIXED_MV)

    {

        status = bitplane_decoding(&v->mv_type_mb_plane, v);

        if (status < 0)

            return -1;

#if TRACE

        av_log(v->s.avctx, AV_LOG_DEBUG, "MB MV Type plane encoding: "

               "Imode: %i, Invert: %i\n", status>>1, status&1);

#endif

    }



    

    status = bitplane_decoding(&v->direct_mb_plane, v);

    if (status < 0) return -1;

#if TRACE

    av_log(v->s.avctx, AV_LOG_DEBUG, "MB Direct plane encoding: "

           "Imode: %i, Invert: %i\n", status>>1, status&1);

#endif



    av_log(v->s.avctx, AV_LOG_DEBUG, "Skip MB plane encoding: "

           "Imode: %i, Invert: %i\n", status>>1, status&1);

#endif



    

    v->s.mv_table_index = get_bits(gb, 2); 

    v->cbpcy_vlc = &vc9_cbpcy_p_vlc[get_bits(gb, 2)];



    if (v->dquant)

    {

        vop_dquant_decoding(v);

    }



    if (v->vstransform)

    {

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

        if (v->ttmbf)

        {

            v->ttfrm = get_bits(gb, 2);

            av_log(v->s.avctx, AV_LOG_INFO, "Transform used: %ix%i\n",

                   (v->ttfrm & 2) ? 4 : 8, (v->ttfrm & 1) ? 4 : 8);

        }

    }

    

    return 0;

}

    bitplane_decoding(&v->skip_mb_plane, v); #endif #if TRACE #endif     return 0;
static int FUNC_0(VC9Context *VAR_0)

{

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

    int VAR_1;



    bitplane_decoding(&VAR_0->skip_mb_plane, VAR_0);

    if (VAR_1 < 0) return -1;

#if TRACE

    if (VAR_0->mv_mode == MV_PMODE_MIXED_MV)

    {

        VAR_1 = bitplane_decoding(&VAR_0->mv_type_mb_plane, VAR_0);

        if (VAR_1 < 0)

            return -1;

#if TRACE

        av_log(VAR_0->s.avctx, AV_LOG_DEBUG, "MB MV Type plane encoding: "

               "Imode: %i, Invert: %i\n", VAR_1>>1, VAR_1&1);

#endif

    }



    

    VAR_1 = bitplane_decoding(&VAR_0->direct_mb_plane, VAR_0);

    if (VAR_1 < 0) return -1;

#if TRACE

    av_log(VAR_0->s.avctx, AV_LOG_DEBUG, "MB Direct plane encoding: "

           "Imode: %i, Invert: %i\n", VAR_1>>1, VAR_1&1);

#endif



    av_log(VAR_0->s.avctx, AV_LOG_DEBUG, "Skip MB plane encoding: "

           "Imode: %i, Invert: %i\n", VAR_1>>1, VAR_1&1);

#endif



    

    VAR_0->s.mv_table_index = get_bits(gb, 2); 

    VAR_0->cbpcy_vlc = &vc9_cbpcy_p_vlc[get_bits(gb, 2)];



    if (VAR_0->dquant)

    {

        vop_dquant_decoding(VAR_0);

    }



    if (VAR_0->vstransform)

    {

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

        if (VAR_0->ttmbf)

        {

            VAR_0->ttfrm = get_bits(gb, 2);

            av_log(VAR_0->s.avctx, AV_LOG_INFO, "Transform used: %ix%i\n",

                   (VAR_0->ttfrm & 2) ? 4 : 8, (VAR_0->ttfrm & 1) ? 4 : 8);

        }

    }

    

    return 0;

}

static int FUNC_0(VC9Context *VAR_0)
{ GetBitContext *gb = &VAR_0->s.gb; int VAR_1; bitplane_decoding(&VAR_0->skip_mb_plane, VAR_0); if (VAR_1 < 0) return -1; #if TRACE
if (VAR_0->mv_mode == MV_PMODE_MIXED_MV)
{ VAR_1 = bitplane_decoding(&VAR_0->mv_type_mb_plane, VAR_0); if (VAR_1 < 0)
return -1; #if TRACE
av_log(VAR_0->s.avctx, AV_LOG_DEBUG, "MB MV Type plane encoding: "
"Imode: %i, Invert: %i\n", VAR_1>>1, VAR_1&1); #endif
} VAR_1 = bitplane_decoding(&VAR_0->direct_mb_plane, VAR_0); if (VAR_1 < 0) return -1; #if TRACE
av_log(VAR_0->s.avctx, AV_LOG_DEBUG, "MB Direct plane encoding: "
"Imode: %i, Invert: %i\n", VAR_1>>1, VAR_1&1); #endif
av_log(VAR_0->s.avctx, AV_LOG_DEBUG, "Skip MB plane encoding: "
"Imode: %i, Invert: %i\n", VAR_1>>1, VAR_1&1); #endif
VAR_0->s.mv_table_index = get_bits(gb, 2); VAR_0->cbpcy_vlc = &vc9_cbpcy_p_vlc[get_bits(gb, 2)]; if (VAR_0->dquant)
{ vop_dquant_decoding(VAR_0); } if (VAR_0->vstransform)
{ VAR_0->ttmbf = get_bits(gb, 1); if (VAR_0->ttmbf)
{ VAR_0->ttfrm = get_bits(gb, 2); av_log(VAR_0->s.avctx, AV_LOG_INFO, "Transform used: %ix%i\n",
(VAR_0->ttfrm & 2) ? 4 : 8, (VAR_0->ttfrm & 1) ? 4 : 8); } } return 0; }