static int standard_decode_picture_header(VC9Context *v)

{

    int status = 0;



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

    skip_bits(&v->gb, 2); //framecnt unused

    if (v->rangered) v->rangeredfrm = get_bits(&v->gb, 1);

    v->pict_type = get_bits(&v->gb, 1);

    if (v->avctx->max_b_frames && !v->pict_type)

    {

        if (get_bits(&v->gb, 1)) v->pict_type = I_TYPE;

        else v->pict_type = P_TYPE;

    }

    else v->pict_type++; //P_TYPE



    switch (v->pict_type)

    {

    case I_TYPE: status = decode_i_picture_header(v); break;

    case BI_TYPE: status = decode_b_picture_header(v); break;

    case P_TYPE: status = decode_p_picture_header(v); break;

    case B_TYPE: status = decode_b_picture_header(v); break;

    }



    if (status == FRAME_SKIPED)

    {

      av_log(v, AV_LOG_INFO, "Skipping frame...\n");

      return status;

    }



    /* AC/DC Syntax */

    v->transacfrm = get_bits(&v->gb, 1);

    if (v->transacfrm) v->transacfrm += get_bits(&v->gb, 1);

    if (v->pict_type == I_TYPE || v->pict_type == BI_TYPE)

    {

        v->transacfrm2 = get_bits(&v->gb, 1);

        if (v->transacfrm2) v->transacfrm2 += get_bits(&v->gb, 1);

    }

    v->transacdctab = get_bits(&v->gb, 1);

   

    return 0;

}

static int standard_decode_picture_header(VC9Context *v)

{

    int status = 0;



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

    skip_bits(&v->gb, 2); 

    if (v->rangered) v->rangeredfrm = get_bits(&v->gb, 1);

    v->pict_type = get_bits(&v->gb, 1);

    if (v->avctx->max_b_frames && !v->pict_type)

    {

        if (get_bits(&v->gb, 1)) v->pict_type = I_TYPE;

        else v->pict_type = P_TYPE;

    }

    else v->pict_type++; 



    switch (v->pict_type)

    {

    case I_TYPE: status = decode_i_picture_header(v); break;

    case BI_TYPE: status = decode_b_picture_header(v); break;

    case P_TYPE: status = decode_p_picture_header(v); break;

    case B_TYPE: status = decode_b_picture_header(v); break;

    }



    if (status == FRAME_SKIPED)

    {

      av_log(v, AV_LOG_INFO, "Skipping frame...\n");

      return status;

    }



    

    v->transacfrm = get_bits(&v->gb, 1);

    if (v->transacfrm) v->transacfrm += get_bits(&v->gb, 1);

    if (v->pict_type == I_TYPE || v->pict_type == BI_TYPE)

    {

        v->transacfrm2 = get_bits(&v->gb, 1);

        if (v->transacfrm2) v->transacfrm2 += get_bits(&v->gb, 1);

    }

    v->transacdctab = get_bits(&v->gb, 1);

   

    return 0;

}

static int FUNC_0(VC9Context *VAR_0)

{

    int VAR_1 = 0;



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

    skip_bits(&VAR_0->gb, 2); 

    if (VAR_0->rangered) VAR_0->rangeredfrm = get_bits(&VAR_0->gb, 1);

    VAR_0->pict_type = get_bits(&VAR_0->gb, 1);

    if (VAR_0->avctx->max_b_frames && !VAR_0->pict_type)

    {

        if (get_bits(&VAR_0->gb, 1)) VAR_0->pict_type = I_TYPE;

        else VAR_0->pict_type = P_TYPE;

    }

    else VAR_0->pict_type++; 



    switch (VAR_0->pict_type)

    {

    case I_TYPE: VAR_1 = decode_i_picture_header(VAR_0); break;

    case BI_TYPE: VAR_1 = decode_b_picture_header(VAR_0); break;

    case P_TYPE: VAR_1 = decode_p_picture_header(VAR_0); break;

    case B_TYPE: VAR_1 = decode_b_picture_header(VAR_0); break;

    }



    if (VAR_1 == FRAME_SKIPED)

    {

      av_log(VAR_0, AV_LOG_INFO, "Skipping frame...\n");

      return VAR_1;

    }



    

    VAR_0->transacfrm = get_bits(&VAR_0->gb, 1);

    if (VAR_0->transacfrm) VAR_0->transacfrm += get_bits(&VAR_0->gb, 1);

    if (VAR_0->pict_type == I_TYPE || VAR_0->pict_type == BI_TYPE)

    {

        VAR_0->transacfrm2 = get_bits(&VAR_0->gb, 1);

        if (VAR_0->transacfrm2) VAR_0->transacfrm2 += get_bits(&VAR_0->gb, 1);

    }

    VAR_0->transacdctab = get_bits(&VAR_0->gb, 1);

   

    return 0;

}

static int FUNC_0(VC9Context *VAR_0)
{ int VAR_1 = 0; if (VAR_0->finterpflag) VAR_0->interpfrm = get_bits(&VAR_0->gb, 1); skip_bits(&VAR_0->gb, 2); if (VAR_0->rangered) VAR_0->rangeredfrm = get_bits(&VAR_0->gb, 1); VAR_0->pict_type = get_bits(&VAR_0->gb, 1); if (VAR_0->avctx->max_b_frames && !VAR_0->pict_type)
{ if (get_bits(&VAR_0->gb, 1)) VAR_0->pict_type = I_TYPE; else VAR_0->pict_type = P_TYPE; } else VAR_0->pict_type++; switch (VAR_0->pict_type)
{ case I_TYPE: VAR_1 = decode_i_picture_header(VAR_0); break; case BI_TYPE: VAR_1 = decode_b_picture_header(VAR_0); break; case P_TYPE: VAR_1 = decode_p_picture_header(VAR_0); break; case B_TYPE: VAR_1 = decode_b_picture_header(VAR_0); break; } if (VAR_1 == FRAME_SKIPED)
{ av_log(VAR_0, AV_LOG_INFO, "Skipping frame...\n"); return VAR_1; } VAR_0->transacfrm = get_bits(&VAR_0->gb, 1); if (VAR_0->transacfrm) VAR_0->transacfrm += get_bits(&VAR_0->gb, 1); if (VAR_0->pict_type == I_TYPE || VAR_0->pict_type == BI_TYPE)
{ VAR_0->transacfrm2 = get_bits(&VAR_0->gb, 1); if (VAR_0->transacfrm2) VAR_0->transacfrm2 += get_bits(&VAR_0->gb, 1); } VAR_0->transacdctab = get_bits(&VAR_0->gb, 1); return 0; }