|| 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;
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;
}
*
****************************************************************************/
-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 */
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;
}
/*****************************************************************************