X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcavs.c;h=b0fdc3a00f827f0efef29d416019ce1499c4e503;hb=d27edc038a5d59f25b28964b38d9f8d7ce4a6e64;hp=65e12dd1744f20ae8379fbd679febbed3b8062aa;hpb=15784c2bab56508565771cd04b5dda64d6717953;p=ffmpeg diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c index 65e12dd1744..b0fdc3a00f8 100644 --- a/libavcodec/cavs.c +++ b/libavcodec/cavs.c @@ -392,7 +392,7 @@ static inline void mc_dir_part(AVSContext *h,Picture *pic, || full_my < 0-extra_height || full_mx + 16/*FIXME*/ > pic_width + extra_width || full_my + 16/*FIXME*/ > pic_height + extra_height){ - s->dsp.emulated_edge_mc(s->edge_emu_buffer, src_y - 2 - 2*h->l_stride, h->l_stride, + s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src_y - 2 - 2*h->l_stride, h->l_stride, 16+5, 16+5/*FIXME*/, full_mx-2, full_my-2, pic_width, pic_height); src_y= s->edge_emu_buffer + 2 + 2*h->l_stride; emu=1; @@ -401,14 +401,14 @@ static inline void mc_dir_part(AVSContext *h,Picture *pic, qpix_op[luma_xy](dest_y, src_y, h->l_stride); //FIXME try variable height perhaps? if(emu){ - s->dsp.emulated_edge_mc(s->edge_emu_buffer, src_cb, h->c_stride, + s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src_cb, h->c_stride, 9, 9/*FIXME*/, (mx>>3), (my>>3), pic_width>>1, pic_height>>1); src_cb= s->edge_emu_buffer; } chroma_op(dest_cb, src_cb, h->c_stride, chroma_height, mx&7, my&7); if(emu){ - s->dsp.emulated_edge_mc(s->edge_emu_buffer, src_cr, h->c_stride, + s->vdsp.emulated_edge_mc(s->edge_emu_buffer, src_cr, h->c_stride, 9, 9/*FIXME*/, (mx>>3), (my>>3), pic_width>>1, pic_height>>1); src_cr= s->edge_emu_buffer; } @@ -655,7 +655,9 @@ int ff_cavs_next_mb(AVSContext *h) { * ****************************************************************************/ -void ff_cavs_init_pic(AVSContext *h) { +int ff_cavs_init_pic(AVSContext *h) { + MpegEncContext *s = &h->s; + int ret; int i; /* clear some predictors */ @@ -675,6 +677,14 @@ void ff_cavs_init_pic(AVSContext *h) { h->luma_scan[3] = 8*h->l_stride+8; h->mbx = h->mby = h->mbidx = 0; h->flags = 0; + + if (!s->edge_emu_buffer && + (ret = ff_mpv_frame_size_alloc(s, h->picture.f.linesize[0])) < 0) { + av_log(s->avctx, AV_LOG_ERROR, + "get_buffer() failed to allocate context scratch buffers.\n"); + return ret; + } + return 0; } /*****************************************************************************