]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cavs.c
Merge commit '511cf612ac979f536fd65e14603a87ca5ad435f3'
[ffmpeg] / libavcodec / cavs.c
index 65e12dd1744f20ae8379fbd679febbed3b8062aa..b0fdc3a00f827f0efef29d416019ce1499c4e503 100644 (file)
@@ -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;
 }
 
 /*****************************************************************************