av_freep(&s->non_b_mv4_table);
void MPV_common_end(MpegEncContext *s){    int i;    av_freep(&s->mb_type);    av_freep(&s->mb_var);    av_freep(&s->mc_mb_var);    av_freep(&s->p_mv_table);    av_freep(&s->b_forw_mv_table);    av_freep(&s->b_back_mv_table);    av_freep(&s->b_bidir_forw_mv_table);    av_freep(&s->b_bidir_back_mv_table);    av_freep(&s->b_direct_forw_mv_table);    av_freep(&s->b_direct_back_mv_table);    av_freep(&s->b_direct_mv_table);    av_freep(&s->motion_val);    av_freep(&s->dc_val[0]);    av_freep(&s->ac_val[0]);    av_freep(&s->coded_block);    av_freep(&s->mbintra_table);    av_freep(&s->cbp_table);    av_freep(&s->pred_dir_table);    av_freep(&s->qscale_table);    av_freep(&s->me_scratchpad);    av_freep(&s->me_map);    av_freep(&s->me_score_map);        av_freep(&s->mbskip_table);    av_freep(&s->bitstream_buffer);    av_freep(&s->tex_pb_buffer);    av_freep(&s->pb2_buffer);    av_freep(&s->edge_emu_buffer);        for(i=0;i<3;i++) {        int j;        if(!(s->flags&CODEC_FLAG_DR1)){            av_freep(&s->last_picture_base[i]);            av_freep(&s->next_picture_base[i]);            av_freep(&s->aux_picture_base[i]);        }        s->last_picture_base[i]=        s->next_picture_base[i]=        s->aux_picture_base [i] = NULL;        s->last_picture[i]=        s->next_picture[i]=        s->aux_picture [i] = NULL;        for(j=0; j<REORDER_BUFFER_SIZE; j++){            av_freep(&s->picture_buffer[j][i]);        }    }    s->context_initialized = 0;}