static int decode_p_picture_primary_header(VC9Context *v)

{

    /* INTERFRM, FRMCNT, RANGEREDFRM read in caller */

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

    int lowquant, pqindex, status = 0;



    pqindex = get_bits(gb, 5);

    if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)

        v->pq = pquant_table[0][pqindex];

    else

    {

        v->pq = pquant_table[v->quantizer_mode-1][pqindex];

    }

    if (pqindex < 9) v->halfpq = get_bits(gb, 1);

    if (v->quantizer_mode == QUANT_FRAME_EXPLICIT)

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

    av_log(v->s.avctx, AV_LOG_DEBUG, "P Frame: QP=%i (+%i/2)\n",

           v->pq, v->halfpq);

    if (v->extended_mv == 1) v->mvrange = get_prefix(gb, 0, 3);

#if HAS_ADVANCED_PROFILE

    if (v->profile > PROFILE_MAIN)

    {

        if (v->postprocflag) v->postproc = get_bits(gb, 1);

    }

    else

#endif

        if (v->multires) v->respic = get_bits(gb, 2);

    lowquant = (v->pquantizer>12) ? 0 : 1;

    v->mv_mode = mv_pmode_table[lowquant][get_prefix(gb, 1, 4)];

    if (v->mv_mode == MV_PMODE_INTENSITY_COMP)

    {

        v->mv_mode2 = mv_pmode_table[lowquant][get_prefix(gb, 1, 3)];

        v->lumscale = get_bits(gb, 6);

        v->lumshift = get_bits(gb, 6);

    }

    return 0;

}

static int decode_p_picture_primary_header(VC9Context *v)

{

    

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

    int lowquant, pqindex, status = 0;



    pqindex = get_bits(gb, 5);

    if (v->quantizer_mode == QUANT_FRAME_IMPLICIT)

        v->pq = pquant_table[0][pqindex];

    else

    {

        v->pq = pquant_table[v->quantizer_mode-1][pqindex];

    }

    if (pqindex < 9) v->halfpq = get_bits(gb, 1);

    if (v->quantizer_mode == QUANT_FRAME_EXPLICIT)

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

    av_log(v->s.avctx, AV_LOG_DEBUG, "P Frame: QP=%i (+%i/2)\n",

           v->pq, v->halfpq);

    if (v->extended_mv == 1) v->mvrange = get_prefix(gb, 0, 3);

#if HAS_ADVANCED_PROFILE

    if (v->profile > PROFILE_MAIN)

    {

        if (v->postprocflag) v->postproc = get_bits(gb, 1);

    }

    else

#endif

        if (v->multires) v->respic = get_bits(gb, 2);

    lowquant = (v->pquantizer>12) ? 0 : 1;

    v->mv_mode = mv_pmode_table[lowquant][get_prefix(gb, 1, 4)];

    if (v->mv_mode == MV_PMODE_INTENSITY_COMP)

    {

        v->mv_mode2 = mv_pmode_table[lowquant][get_prefix(gb, 1, 3)];

        v->lumscale = get_bits(gb, 6);

        v->lumshift = get_bits(gb, 6);

    }

    return 0;

}

#endif         if (v->multires) v->respic = get_bits(gb, 2); #if HAS_ADVANCED_PROFILE         if (v->postprocflag) v->postproc = get_bits(gb, 1); #endif     int lowquant, pqindex, status = 0;     return 0;
static int FUNC_0(VC9Context *VAR_0)

{

    

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

    int VAR_1, VAR_2, VAR_3 = 0;



    VAR_2 = get_bits(gb, 5);

    if (VAR_0->quantizer_mode == QUANT_FRAME_IMPLICIT)

        VAR_0->pq = pquant_table[0][VAR_2];

    else

    {

        VAR_0->pq = pquant_table[VAR_0->quantizer_mode-1][VAR_2];

    }

    if (VAR_2 < 9) VAR_0->halfpq = get_bits(gb, 1);

    if (VAR_0->quantizer_mode == QUANT_FRAME_EXPLICIT)

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

    av_log(VAR_0->s.avctx, AV_LOG_DEBUG, "P Frame: QP=%i (+%i/2)\n",

           VAR_0->pq, VAR_0->halfpq);

    if (VAR_0->extended_mv == 1) VAR_0->mvrange = get_prefix(gb, 0, 3);

#if HAS_ADVANCED_PROFILE

    if (VAR_0->profile > PROFILE_MAIN)

    {

        if (VAR_0->postprocflag) VAR_0->postproc = get_bits(gb, 1);

    }

    else

#endif

        if (VAR_0->multires) VAR_0->respic = get_bits(gb, 2);

    VAR_1 = (VAR_0->pquantizer>12) ? 0 : 1;

    VAR_0->mv_mode = mv_pmode_table[VAR_1][get_prefix(gb, 1, 4)];

    if (VAR_0->mv_mode == MV_PMODE_INTENSITY_COMP)

    {

        VAR_0->mv_mode2 = mv_pmode_table[VAR_1][get_prefix(gb, 1, 3)];

        VAR_0->lumscale = get_bits(gb, 6);

        VAR_0->lumshift = get_bits(gb, 6);

    }

    return 0;

}

static int FUNC_0(VC9Context *VAR_0)
{ GetBitContext *gb = &VAR_0->s.gb; int VAR_1, VAR_2, VAR_3 = 0; VAR_2 = get_bits(gb, 5); if (VAR_0->quantizer_mode == QUANT_FRAME_IMPLICIT)
VAR_0->pq = pquant_table[0][VAR_2]; else
{ VAR_0->pq = pquant_table[VAR_0->quantizer_mode-1][VAR_2]; } if (VAR_2 < 9) VAR_0->halfpq = get_bits(gb, 1); if (VAR_0->quantizer_mode == QUANT_FRAME_EXPLICIT)
VAR_0->pquantizer = get_bits(gb, 1); av_log(VAR_0->s.avctx, AV_LOG_DEBUG, "P Frame: QP=%i (+%i/2)\n",
VAR_0->pq, VAR_0->halfpq); if (VAR_0->extended_mv == 1) VAR_0->mvrange = get_prefix(gb, 0, 3); #if HAS_ADVANCED_PROFILE
if (VAR_0->profile > PROFILE_MAIN)
{ if (VAR_0->postprocflag) VAR_0->postproc = get_bits(gb, 1); } else
#endif
if (VAR_0->multires) VAR_0->respic = get_bits(gb, 2); VAR_1 = (VAR_0->pquantizer>12) ? 0 : 1; VAR_0->mv_mode = mv_pmode_table[VAR_1][get_prefix(gb, 1, 4)]; if (VAR_0->mv_mode == MV_PMODE_INTENSITY_COMP)
{ VAR_0->mv_mode2 = mv_pmode_table[VAR_1][get_prefix(gb, 1, 3)]; VAR_0->lumscale = get_bits(gb, 6); VAR_0->lumshift = get_bits(gb, 6); } return 0; }