void ff_cavs_init_top_lines(AVSContext *h) {

    /* alloc top line of predictors */

    h->top_qp       = av_malloc( h->mb_width);

    h->top_mv[0]    = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector));

    h->top_mv[1]    = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector));

    h->top_pred_Y   = av_malloc( h->mb_width*2*sizeof(*h->top_pred_Y));

    h->top_border_y = av_malloc((h->mb_width+1)*16);

    h->top_border_u = av_malloc( h->mb_width * 10);

    h->top_border_v = av_malloc( h->mb_width * 10);



    /* alloc space for co-located MVs and types */

    h->col_mv       = av_malloc( h->mb_width*h->mb_height*4*sizeof(cavs_vector));

    h->col_type_base = av_malloc(h->mb_width*h->mb_height);

    h->block        = av_mallocz(64*sizeof(int16_t));

}

void ff_cavs_init_top_lines(AVSContext *h) {

    

    h->top_qp       = av_malloc( h->mb_width);

    h->top_mv[0]    = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector));

    h->top_mv[1]    = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector));

    h->top_pred_Y   = av_malloc( h->mb_width*2*sizeof(*h->top_pred_Y));

    h->top_border_y = av_malloc((h->mb_width+1)*16);

    h->top_border_u = av_malloc( h->mb_width * 10);

    h->top_border_v = av_malloc( h->mb_width * 10);



    

    h->col_mv       = av_malloc( h->mb_width*h->mb_height*4*sizeof(cavs_vector));

    h->col_type_base = av_malloc(h->mb_width*h->mb_height);

    h->block        = av_mallocz(64*sizeof(int16_t));

}

    h->top_qp       = av_malloc( h->mb_width);     h->top_mv[0]    = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector));     h->top_mv[1]    = av_malloc((h->mb_width*2+1)*sizeof(cavs_vector));     h->top_pred_Y   = av_malloc( h->mb_width*2*sizeof(*h->top_pred_Y));     h->top_border_y = av_malloc((h->mb_width+1)*16);     h->top_border_u = av_malloc( h->mb_width * 10);     h->top_border_v = av_malloc( h->mb_width * 10);     h->col_mv       = av_malloc( h->mb_width*h->mb_height*4*sizeof(cavs_vector));     h->col_type_base = av_malloc(h->mb_width*h->mb_height);
void FUNC_0(AVSContext *VAR_0) {

    

    VAR_0->top_qp       = av_malloc( VAR_0->mb_width);

    VAR_0->top_mv[0]    = av_malloc((VAR_0->mb_width*2+1)*sizeof(cavs_vector));

    VAR_0->top_mv[1]    = av_malloc((VAR_0->mb_width*2+1)*sizeof(cavs_vector));

    VAR_0->top_pred_Y   = av_malloc( VAR_0->mb_width*2*sizeof(*VAR_0->top_pred_Y));

    VAR_0->top_border_y = av_malloc((VAR_0->mb_width+1)*16);

    VAR_0->top_border_u = av_malloc( VAR_0->mb_width * 10);

    VAR_0->top_border_v = av_malloc( VAR_0->mb_width * 10);



    

    VAR_0->col_mv       = av_malloc( VAR_0->mb_width*VAR_0->mb_height*4*sizeof(cavs_vector));

    VAR_0->col_type_base = av_malloc(VAR_0->mb_width*VAR_0->mb_height);

    VAR_0->block        = av_mallocz(64*sizeof(int16_t));

}

void FUNC_0(AVSContext *VAR_0) { VAR_0->top_qp       = av_malloc( VAR_0->mb_width); VAR_0->top_mv[0]    = av_malloc((VAR_0->mb_width*2+1)*sizeof(cavs_vector)); VAR_0->top_mv[1]    = av_malloc((VAR_0->mb_width*2+1)*sizeof(cavs_vector)); VAR_0->top_pred_Y   = av_malloc( VAR_0->mb_width*2*sizeof(*VAR_0->top_pred_Y)); VAR_0->top_border_y = av_malloc((VAR_0->mb_width+1)*16); VAR_0->top_border_u = av_malloc( VAR_0->mb_width * 10); VAR_0->top_border_v = av_malloc( VAR_0->mb_width * 10); VAR_0->col_mv       = av_malloc( VAR_0->mb_width*VAR_0->mb_height*4*sizeof(cavs_vector)); VAR_0->col_type_base = av_malloc(VAR_0->mb_width*VAR_0->mb_height); VAR_0->block        = av_mallocz(64*sizeof(int16_t)); }