static void free_picture(MpegEncContext *s, Picture *pic){

    int i;



    if(pic->data[0] && pic->type!=FF_BUFFER_TYPE_SHARED){

        free_frame_buffer(s, pic);

    }



    av_freep(&pic->mb_var);

    av_freep(&pic->mc_mb_var);

    av_freep(&pic->mb_mean);

    av_freep(&pic->mbskip_table);

    av_freep(&pic->qscale_table);

    av_freep(&pic->mb_type_base);

    av_freep(&pic->dct_coeff);

    av_freep(&pic->pan_scan);

    pic->mb_type= NULL;

    for(i=0; i<2; i++){

        av_freep(&pic->motion_val_base[i]);

        av_freep(&pic->ref_index[i]);

    }



    if(pic->type == FF_BUFFER_TYPE_SHARED){

        for(i=0; i<4; i++){

            pic->base[i]=

            pic->data[i]= NULL;

        }

        pic->type= 0;

    }

}

static void free_picture(MpegEncContext *s, Picture *pic){

    int i;



    if(pic->data[0] && pic->type!=FF_BUFFER_TYPE_SHARED){

        free_frame_buffer(s, pic);

    }



    av_freep(&pic->mb_var);

    av_freep(&pic->mc_mb_var);

    av_freep(&pic->mb_mean);

    av_freep(&pic->mbskip_table);

    av_freep(&pic->qscale_table);

    av_freep(&pic->mb_type_base);

    av_freep(&pic->dct_coeff);

    av_freep(&pic->pan_scan);

    pic->mb_type= NULL;

    for(i=0; i<2; i++){

        av_freep(&pic->motion_val_base[i]);

        av_freep(&pic->ref_index[i]);

    }



    if(pic->type == FF_BUFFER_TYPE_SHARED){

        for(i=0; i<4; i++){

            pic->base[i]=

            pic->data[i]= NULL;

        }

        pic->type= 0;

    }

}

    av_freep(&pic->qscale_table);
static void FUNC_0(MpegEncContext *VAR_0, Picture *VAR_1){

    int VAR_2;



    if(VAR_1->data[0] && VAR_1->type!=FF_BUFFER_TYPE_SHARED){

        free_frame_buffer(VAR_0, VAR_1);

    }



    av_freep(&VAR_1->mb_var);

    av_freep(&VAR_1->mc_mb_var);

    av_freep(&VAR_1->mb_mean);

    av_freep(&VAR_1->mbskip_table);

    av_freep(&VAR_1->qscale_table);

    av_freep(&VAR_1->mb_type_base);

    av_freep(&VAR_1->dct_coeff);

    av_freep(&VAR_1->pan_scan);

    VAR_1->mb_type= NULL;

    for(VAR_2=0; VAR_2<2; VAR_2++){

        av_freep(&VAR_1->motion_val_base[VAR_2]);

        av_freep(&VAR_1->ref_index[VAR_2]);

    }



    if(VAR_1->type == FF_BUFFER_TYPE_SHARED){

        for(VAR_2=0; VAR_2<4; VAR_2++){

            VAR_1->base[VAR_2]=

            VAR_1->data[VAR_2]= NULL;

        }

        VAR_1->type= 0;

    }

}

static void FUNC_0(MpegEncContext *VAR_0, Picture *VAR_1){ int VAR_2; if(VAR_1->data[0] && VAR_1->type!=FF_BUFFER_TYPE_SHARED){ free_frame_buffer(VAR_0, VAR_1); } av_freep(&VAR_1->mb_var); av_freep(&VAR_1->mc_mb_var); av_freep(&VAR_1->mb_mean); av_freep(&VAR_1->mbskip_table); av_freep(&VAR_1->qscale_table); av_freep(&VAR_1->mb_type_base); av_freep(&VAR_1->dct_coeff); av_freep(&VAR_1->pan_scan); VAR_1->mb_type= NULL; for(VAR_2=0; VAR_2<2; VAR_2++){ av_freep(&VAR_1->motion_val_base[VAR_2]); av_freep(&VAR_1->ref_index[VAR_2]); } if(VAR_1->type == FF_BUFFER_TYPE_SHARED){ for(VAR_2=0; VAR_2<4; VAR_2++){ VAR_1->base[VAR_2]=
VAR_1->data[VAR_2]= NULL; } VAR_1->type= 0; } }