static void clear_context(MpegEncContext *s)

{

    int i, j, k;



    memset(&s->next_picture, 0, sizeof(s->next_picture));

    memset(&s->last_picture, 0, sizeof(s->last_picture));

    memset(&s->current_picture, 0, sizeof(s->current_picture));

    memset(&s->new_picture, 0, sizeof(s->new_picture));



    memset(s->thread_context, 0, sizeof(s->thread_context));



    s->me.map = NULL;

    s->me.score_map = NULL;

    s->dct_error_sum = NULL;

    s->block = NULL;

    s->blocks = NULL;

    memset(s->pblocks, 0, sizeof(s->pblocks));

    s->ac_val_base = NULL;

    s->ac_val[0] =

    s->ac_val[1] =

    s->ac_val[2] =NULL;

    s->sc.edge_emu_buffer = NULL;

    s->me.scratchpad = NULL;

    s->me.temp =

    s->sc.rd_scratchpad =

    s->sc.b_scratchpad =

    s->sc.obmc_scratchpad = NULL;



    s->parse_context.buffer = NULL;

    s->parse_context.buffer_size = 0;


    s->bitstream_buffer = NULL;

    s->allocated_bitstream_buffer_size = 0;

    s->picture          = NULL;

    s->mb_type          = NULL;

    s->p_mv_table_base  = NULL;

    s->b_forw_mv_table_base = NULL;

    s->b_back_mv_table_base = NULL;

    s->b_bidir_forw_mv_table_base = NULL;

    s->b_bidir_back_mv_table_base = NULL;

    s->b_direct_mv_table_base = NULL;

    s->p_mv_table            = NULL;

    s->b_forw_mv_table       = NULL;

    s->b_back_mv_table       = NULL;

    s->b_bidir_forw_mv_table = NULL;

    s->b_bidir_back_mv_table = NULL;

    s->b_direct_mv_table     = NULL;

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

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

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

                s->b_field_mv_table_base[i][j][k] = NULL;

                s->b_field_mv_table[i][j][k] = NULL;

            }

            s->b_field_select_table[i][j] = NULL;

            s->p_field_mv_table_base[i][j] = NULL;

            s->p_field_mv_table[i][j] = NULL;

        }

        s->p_field_select_table[i] = NULL;

    }



    s->dc_val_base = NULL;

    s->coded_block_base = NULL;

    s->mbintra_table = NULL;

    s->cbp_table = NULL;

    s->pred_dir_table = NULL;



    s->mbskip_table = NULL;



    s->er.error_status_table = NULL;

    s->er.er_temp_buffer = NULL;

    s->mb_index2xy = NULL;

    s->lambda_table = NULL;



    s->cplx_tab = NULL;

    s->bits_tab = NULL;

}
static void clear_context(MpegEncContext *s)

{

    int i, j, k;



    memset(&s->next_picture, 0, sizeof(s->next_picture));

    memset(&s->last_picture, 0, sizeof(s->last_picture));

    memset(&s->current_picture, 0, sizeof(s->current_picture));

    memset(&s->new_picture, 0, sizeof(s->new_picture));



    memset(s->thread_context, 0, sizeof(s->thread_context));



    s->me.map = NULL;

    s->me.score_map = NULL;

    s->dct_error_sum = NULL;

    s->block = NULL;

    s->blocks = NULL;

    memset(s->pblocks, 0, sizeof(s->pblocks));

    s->ac_val_base = NULL;

    s->ac_val[0] =

    s->ac_val[1] =

    s->ac_val[2] =NULL;

    s->sc.edge_emu_buffer = NULL;

    s->me.scratchpad = NULL;

    s->me.temp =

    s->sc.rd_scratchpad =

    s->sc.b_scratchpad =

    s->sc.obmc_scratchpad = NULL;



    s->parse_context.buffer = NULL;

    s->parse_context.buffer_size = 0;


    s->bitstream_buffer = NULL;

    s->allocated_bitstream_buffer_size = 0;

    s->picture          = NULL;

    s->mb_type          = NULL;

    s->p_mv_table_base  = NULL;

    s->b_forw_mv_table_base = NULL;

    s->b_back_mv_table_base = NULL;

    s->b_bidir_forw_mv_table_base = NULL;

    s->b_bidir_back_mv_table_base = NULL;

    s->b_direct_mv_table_base = NULL;

    s->p_mv_table            = NULL;

    s->b_forw_mv_table       = NULL;

    s->b_back_mv_table       = NULL;

    s->b_bidir_forw_mv_table = NULL;

    s->b_bidir_back_mv_table = NULL;

    s->b_direct_mv_table     = NULL;

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

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

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

                s->b_field_mv_table_base[i][j][k] = NULL;

                s->b_field_mv_table[i][j][k] = NULL;

            }

            s->b_field_select_table[i][j] = NULL;

            s->p_field_mv_table_base[i][j] = NULL;

            s->p_field_mv_table[i][j] = NULL;

        }

        s->p_field_select_table[i] = NULL;

    }



    s->dc_val_base = NULL;

    s->coded_block_base = NULL;

    s->mbintra_table = NULL;

    s->cbp_table = NULL;

    s->pred_dir_table = NULL;



    s->mbskip_table = NULL;



    s->er.error_status_table = NULL;

    s->er.er_temp_buffer = NULL;

    s->mb_index2xy = NULL;

    s->lambda_table = NULL;



    s->cplx_tab = NULL;

    s->bits_tab = NULL;

}
static void FUNC_0(MpegEncContext *VAR_0)

{

    int VAR_1, VAR_2, VAR_3;



    memset(&VAR_0->next_picture, 0, sizeof(VAR_0->next_picture));

    memset(&VAR_0->last_picture, 0, sizeof(VAR_0->last_picture));

    memset(&VAR_0->current_picture, 0, sizeof(VAR_0->current_picture));

    memset(&VAR_0->new_picture, 0, sizeof(VAR_0->new_picture));



    memset(VAR_0->thread_context, 0, sizeof(VAR_0->thread_context));



    VAR_0->me.map = NULL;

    VAR_0->me.score_map = NULL;

    VAR_0->dct_error_sum = NULL;

    VAR_0->block = NULL;

    VAR_0->blocks = NULL;

    memset(VAR_0->pblocks, 0, sizeof(VAR_0->pblocks));

    VAR_0->ac_val_base = NULL;

    VAR_0->ac_val[0] =

    VAR_0->ac_val[1] =

    VAR_0->ac_val[2] =NULL;

    VAR_0->sc.edge_emu_buffer = NULL;

    VAR_0->me.scratchpad = NULL;

    VAR_0->me.temp =

    VAR_0->sc.rd_scratchpad =

    VAR_0->sc.b_scratchpad =

    VAR_0->sc.obmc_scratchpad = NULL;



    VAR_0->parse_context.buffer = NULL;

    VAR_0->parse_context.buffer_size = 0;


    VAR_0->bitstream_buffer = NULL;

    VAR_0->allocated_bitstream_buffer_size = 0;

    VAR_0->picture          = NULL;

    VAR_0->mb_type          = NULL;

    VAR_0->p_mv_table_base  = NULL;

    VAR_0->b_forw_mv_table_base = NULL;

    VAR_0->b_back_mv_table_base = NULL;

    VAR_0->b_bidir_forw_mv_table_base = NULL;

    VAR_0->b_bidir_back_mv_table_base = NULL;

    VAR_0->b_direct_mv_table_base = NULL;

    VAR_0->p_mv_table            = NULL;

    VAR_0->b_forw_mv_table       = NULL;

    VAR_0->b_back_mv_table       = NULL;

    VAR_0->b_bidir_forw_mv_table = NULL;

    VAR_0->b_bidir_back_mv_table = NULL;

    VAR_0->b_direct_mv_table     = NULL;

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

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

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

                VAR_0->b_field_mv_table_base[VAR_1][VAR_2][VAR_3] = NULL;

                VAR_0->b_field_mv_table[VAR_1][VAR_2][VAR_3] = NULL;

            }

            VAR_0->b_field_select_table[VAR_1][VAR_2] = NULL;

            VAR_0->p_field_mv_table_base[VAR_1][VAR_2] = NULL;

            VAR_0->p_field_mv_table[VAR_1][VAR_2] = NULL;

        }

        VAR_0->p_field_select_table[VAR_1] = NULL;

    }



    VAR_0->dc_val_base = NULL;

    VAR_0->coded_block_base = NULL;

    VAR_0->mbintra_table = NULL;

    VAR_0->cbp_table = NULL;

    VAR_0->pred_dir_table = NULL;



    VAR_0->mbskip_table = NULL;



    VAR_0->er.error_status_table = NULL;

    VAR_0->er.er_temp_buffer = NULL;

    VAR_0->mb_index2xy = NULL;

    VAR_0->lambda_table = NULL;



    VAR_0->cplx_tab = NULL;

    VAR_0->bits_tab = NULL;

}
static void FUNC_0(MpegEncContext *VAR_0)
{ int VAR_1, VAR_2, VAR_3; memset(&VAR_0->next_picture, 0, sizeof(VAR_0->next_picture)); memset(&VAR_0->last_picture, 0, sizeof(VAR_0->last_picture)); memset(&VAR_0->current_picture, 0, sizeof(VAR_0->current_picture)); memset(&VAR_0->new_picture, 0, sizeof(VAR_0->new_picture)); memset(VAR_0->thread_context, 0, sizeof(VAR_0->thread_context)); VAR_0->me.map = NULL; VAR_0->me.score_map = NULL; VAR_0->dct_error_sum = NULL; VAR_0->block = NULL; VAR_0->blocks = NULL; memset(VAR_0->pblocks, 0, sizeof(VAR_0->pblocks)); VAR_0->ac_val_base = NULL; VAR_0->ac_val[0] =
VAR_0->ac_val[1] =
VAR_0->ac_val[2] =NULL; VAR_0->sc.edge_emu_buffer = NULL; VAR_0->me.scratchpad = NULL; VAR_0->me.temp =
VAR_0->sc.rd_scratchpad =
VAR_0->sc.b_scratchpad =
VAR_0->sc.obmc_scratchpad = NULL; VAR_0->parse_context.buffer = NULL; VAR_0->parse_context.buffer_size = 0; VAR_0->bitstream_buffer = NULL; VAR_0->allocated_bitstream_buffer_size = 0; VAR_0->picture          = NULL; VAR_0->mb_type          = NULL; VAR_0->p_mv_table_base  = NULL; VAR_0->b_forw_mv_table_base = NULL; VAR_0->b_back_mv_table_base = NULL; VAR_0->b_bidir_forw_mv_table_base = NULL; VAR_0->b_bidir_back_mv_table_base = NULL; VAR_0->b_direct_mv_table_base = NULL; VAR_0->p_mv_table            = NULL; VAR_0->b_forw_mv_table       = NULL; VAR_0->b_back_mv_table       = NULL; VAR_0->b_bidir_forw_mv_table = NULL; VAR_0->b_bidir_back_mv_table = NULL; VAR_0->b_direct_mv_table     = NULL; for (VAR_1 = 0; VAR_1 < 2; VAR_1++) { for (VAR_2 = 0; VAR_2 < 2; VAR_2++) { for (VAR_3 = 0; VAR_3 < 2; VAR_3++) { VAR_0->b_field_mv_table_base[VAR_1][VAR_2][VAR_3] = NULL; VAR_0->b_field_mv_table[VAR_1][VAR_2][VAR_3] = NULL; } VAR_0->b_field_select_table[VAR_1][VAR_2] = NULL; VAR_0->p_field_mv_table_base[VAR_1][VAR_2] = NULL; VAR_0->p_field_mv_table[VAR_1][VAR_2] = NULL; } VAR_0->p_field_select_table[VAR_1] = NULL; } VAR_0->dc_val_base = NULL; VAR_0->coded_block_base = NULL; VAR_0->mbintra_table = NULL; VAR_0->cbp_table = NULL; VAR_0->pred_dir_table = NULL; VAR_0->mbskip_table = NULL; VAR_0->er.error_status_table = NULL; VAR_0->er.er_temp_buffer = NULL; VAR_0->mb_index2xy = NULL; VAR_0->lambda_table = NULL; VAR_0->cplx_tab = NULL; VAR_0->bits_tab = NULL; }