int intel_h263_decode_picture_header(MpegEncContext *s)

{

    int format;



    /* picture header */

    if (get_bits_long(&s->gb, 22) != 0x20) {

        av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");

        return -1;

    }

    s->picture_number = get_bits(&s->gb, 8); /* picture timestamp */



    if (get_bits1(&s->gb) != 1) {

        av_log(s->avctx, AV_LOG_ERROR, "Bad marker\n");

        return -1;	/* marker */

    }

    if (get_bits1(&s->gb) != 0) {

        av_log(s->avctx, AV_LOG_ERROR, "Bad H263 id\n");

        return -1;	/* h263 id */

    }

    skip_bits1(&s->gb);	/* split screen off */

    skip_bits1(&s->gb);	/* camera  off */

    skip_bits1(&s->gb);	/* freeze picture release off */



    format = get_bits(&s->gb, 3);

    if (format != 7) {

        av_log(s->avctx, AV_LOG_ERROR, "Intel H263 free format not supported\n");

        return -1;

    }

    s->h263_plus = 0;



    s->pict_type = I_TYPE + get_bits1(&s->gb);

    

    s->unrestricted_mv = get_bits1(&s->gb); 

    s->h263_long_vectors = s->unrestricted_mv;



    if (get_bits1(&s->gb) != 0) {

        av_log(s->avctx, AV_LOG_ERROR, "SAC not supported\n");

        return -1;	/* SAC: off */

    }

    if (get_bits1(&s->gb) != 0) {

        s->obmc= 1;

        av_log(s->avctx, AV_LOG_ERROR, "Advanced Prediction Mode not supported\n");

//        return -1;	/* advanced prediction mode: off */

    }

    if (get_bits1(&s->gb) != 0) {

        av_log(s->avctx, AV_LOG_ERROR, "PB frame mode no supported\n");

        return -1;	/* PB frame mode */

    }



    /* skip unknown header garbage */

    skip_bits(&s->gb, 41);



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

    skip_bits1(&s->gb);	/* Continuous Presence Multipoint mode: off */



    /* PEI */

    while (get_bits1(&s->gb) != 0) {

        skip_bits(&s->gb, 8);

    }

    s->f_code = 1;



    s->y_dc_scale_table=

    s->c_dc_scale_table= ff_mpeg1_dc_scale_table;



    return 0;

}

int intel_h263_decode_picture_header(MpegEncContext *s)

{

    int format;



    

    if (get_bits_long(&s->gb, 22) != 0x20) {

        av_log(s->avctx, AV_LOG_ERROR, "Bad picture start code\n");

        return -1;

    }

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



    if (get_bits1(&s->gb) != 1) {

        av_log(s->avctx, AV_LOG_ERROR, "Bad marker\n");

        return -1;	

    }

    if (get_bits1(&s->gb) != 0) {

        av_log(s->avctx, AV_LOG_ERROR, "Bad H263 id\n");

        return -1;	

    }

    skip_bits1(&s->gb);	

    skip_bits1(&s->gb);	

    skip_bits1(&s->gb);	



    format = get_bits(&s->gb, 3);

    if (format != 7) {

        av_log(s->avctx, AV_LOG_ERROR, "Intel H263 free format not supported\n");

        return -1;

    }

    s->h263_plus = 0;



    s->pict_type = I_TYPE + get_bits1(&s->gb);

    

    s->unrestricted_mv = get_bits1(&s->gb); 

    s->h263_long_vectors = s->unrestricted_mv;



    if (get_bits1(&s->gb) != 0) {

        av_log(s->avctx, AV_LOG_ERROR, "SAC not supported\n");

        return -1;	

    }

    if (get_bits1(&s->gb) != 0) {

        s->obmc= 1;

        av_log(s->avctx, AV_LOG_ERROR, "Advanced Prediction Mode not supported\n");



    }

    if (get_bits1(&s->gb) != 0) {

        av_log(s->avctx, AV_LOG_ERROR, "PB frame mode no supported\n");

        return -1;	

    }



    

    skip_bits(&s->gb, 41);



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

    skip_bits1(&s->gb);	



    

    while (get_bits1(&s->gb) != 0) {

        skip_bits(&s->gb, 8);

    }

    s->f_code = 1;



    s->y_dc_scale_table=

    s->c_dc_scale_table= ff_mpeg1_dc_scale_table;



    return 0;

}

int FUNC_0(MpegEncContext *VAR_0)

{

    int VAR_1;



    

    if (get_bits_long(&VAR_0->gb, 22) != 0x20) {

        av_log(VAR_0->avctx, AV_LOG_ERROR, "Bad picture start code\n");

        return -1;

    }

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



    if (get_bits1(&VAR_0->gb) != 1) {

        av_log(VAR_0->avctx, AV_LOG_ERROR, "Bad marker\n");

        return -1;	

    }

    if (get_bits1(&VAR_0->gb) != 0) {

        av_log(VAR_0->avctx, AV_LOG_ERROR, "Bad H263 id\n");

        return -1;	

    }

    skip_bits1(&VAR_0->gb);	

    skip_bits1(&VAR_0->gb);	

    skip_bits1(&VAR_0->gb);	



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

    if (VAR_1 != 7) {

        av_log(VAR_0->avctx, AV_LOG_ERROR, "Intel H263 free VAR_1 not supported\n");

        return -1;

    }

    VAR_0->h263_plus = 0;



    VAR_0->pict_type = I_TYPE + get_bits1(&VAR_0->gb);

    

    VAR_0->unrestricted_mv = get_bits1(&VAR_0->gb); 

    VAR_0->h263_long_vectors = VAR_0->unrestricted_mv;



    if (get_bits1(&VAR_0->gb) != 0) {

        av_log(VAR_0->avctx, AV_LOG_ERROR, "SAC not supported\n");

        return -1;	

    }

    if (get_bits1(&VAR_0->gb) != 0) {

        VAR_0->obmc= 1;

        av_log(VAR_0->avctx, AV_LOG_ERROR, "Advanced Prediction Mode not supported\n");



    }

    if (get_bits1(&VAR_0->gb) != 0) {

        av_log(VAR_0->avctx, AV_LOG_ERROR, "PB frame mode no supported\n");

        return -1;	

    }



    

    skip_bits(&VAR_0->gb, 41);



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

    skip_bits1(&VAR_0->gb);	



    

    while (get_bits1(&VAR_0->gb) != 0) {

        skip_bits(&VAR_0->gb, 8);

    }

    VAR_0->f_code = 1;



    VAR_0->y_dc_scale_table=

    VAR_0->c_dc_scale_table= ff_mpeg1_dc_scale_table;



    return 0;

}

int FUNC_0(MpegEncContext *VAR_0)
{ int VAR_1; if (get_bits_long(&VAR_0->gb, 22) != 0x20) { av_log(VAR_0->avctx, AV_LOG_ERROR, "Bad picture start code\n"); return -1; } VAR_0->picture_number = get_bits(&VAR_0->gb, 8); if (get_bits1(&VAR_0->gb) != 1) { av_log(VAR_0->avctx, AV_LOG_ERROR, "Bad marker\n"); return -1; } if (get_bits1(&VAR_0->gb) != 0) { av_log(VAR_0->avctx, AV_LOG_ERROR, "Bad H263 id\n"); return -1; } skip_bits1(&VAR_0->gb); skip_bits1(&VAR_0->gb); skip_bits1(&VAR_0->gb); VAR_1 = get_bits(&VAR_0->gb, 3); if (VAR_1 != 7) { av_log(VAR_0->avctx, AV_LOG_ERROR, "Intel H263 free VAR_1 not supported\n"); return -1; } VAR_0->h263_plus = 0; VAR_0->pict_type = I_TYPE + get_bits1(&VAR_0->gb); VAR_0->unrestricted_mv = get_bits1(&VAR_0->gb); VAR_0->h263_long_vectors = VAR_0->unrestricted_mv; if (get_bits1(&VAR_0->gb) != 0) { av_log(VAR_0->avctx, AV_LOG_ERROR, "SAC not supported\n"); return -1; } if (get_bits1(&VAR_0->gb) != 0) { VAR_0->obmc= 1; av_log(VAR_0->avctx, AV_LOG_ERROR, "Advanced Prediction Mode not supported\n"); } if (get_bits1(&VAR_0->gb) != 0) { av_log(VAR_0->avctx, AV_LOG_ERROR, "PB frame mode no supported\n"); return -1; } skip_bits(&VAR_0->gb, 41); VAR_0->qscale = get_bits(&VAR_0->gb, 5); skip_bits1(&VAR_0->gb); while (get_bits1(&VAR_0->gb) != 0) { skip_bits(&VAR_0->gb, 8); } VAR_0->f_code = 1; VAR_0->y_dc_scale_table=
VAR_0->c_dc_scale_table= ff_mpeg1_dc_scale_table; return 0; }