if (!pic->data[0])
return;
- if(mx&7) extra_width -= 3;
- if(my&7) extra_height -= 3;
-
- if( full_mx < 0-extra_width
- || full_my < 0-extra_height
- || full_mx + 16/*FIXME*/ > pic_width + extra_width
- || full_my + 16/*FIXME*/ > pic_height + extra_height){
+ if (mx & 7)
+ extra_width -= 3;
+ if (my & 7)
+ extra_height -= 3;
+
+ if (full_mx < 0 - extra_width ||
+ full_my < 0 - extra_height ||
+ full_mx + 16 /* FIXME */ > pic_width + extra_width ||
+ full_my + 16 /* FIXME */ > pic_height + extra_height) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer,
+ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->l_stride,
- 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= h->edge_emu_buffer + 2 + 2*h->l_stride;
- emu=1;
+ 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 = h->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?
+ // FIXME try variable height perhaps?
+ qpix_op[luma_xy](dest_y, src_y, h->l_stride);
- if(emu){
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->c_stride, src_cb, h->c_stride,
- 9, 9/*FIXME*/, (mx>>3), (my>>3), pic_width>>1, pic_height>>1);
- src_cb= h->edge_emu_buffer;
+ if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cb,
++ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->c_stride, src_cb,
+ h->c_stride,
+ 9, 9 /* FIXME */,
+ mx >> 3, my >> 3,
+ pic_width >> 1, pic_height >> 1);
+ src_cb = h->edge_emu_buffer;
}
- chroma_op(dest_cb, src_cb, h->c_stride, chroma_height, mx&7, my&7);
-
- if(emu){
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->c_stride, src_cr, h->c_stride,
- 9, 9/*FIXME*/, (mx>>3), (my>>3), pic_width>>1, pic_height>>1);
- src_cr= h->edge_emu_buffer;
+ chroma_op(dest_cb, src_cb, h->c_stride, chroma_height, mx & 7, my & 7);
+
+ if (emu) {
- h->vdsp.emulated_edge_mc(h->edge_emu_buffer, src_cr,
++ h->vdsp.emulated_edge_mc(h->edge_emu_buffer, h->c_stride, src_cr,
+ h->c_stride,
+ 9, 9 /* FIXME */,
+ mx >> 3, my >> 3,
+ pic_width >> 1, pic_height >> 1);
+ src_cr = h->edge_emu_buffer;
}
- chroma_op(dest_cr, src_cr, h->c_stride, chroma_height, mx&7, my&7);
+ chroma_op(dest_cr, src_cr, h->c_stride, chroma_height, mx & 7, my & 7);
}
- static inline void mc_part_std(AVSContext *h,int chroma_height,int delta,
- uint8_t *dest_y,uint8_t *dest_cb,uint8_t *dest_cr,
- int x_offset, int y_offset,qpel_mc_func *qpix_put,
- h264_chroma_mc_func chroma_put,qpel_mc_func *qpix_avg,
- h264_chroma_mc_func chroma_avg, cavs_vector *mv)
+ static inline void mc_part_std(AVSContext *h, int chroma_height, int delta,
+ uint8_t *dest_y,
+ uint8_t *dest_cb,
+ uint8_t *dest_cr,
+ int x_offset, int y_offset,
+ qpel_mc_func *qpix_put,
+ h264_chroma_mc_func chroma_put,
+ qpel_mc_func *qpix_avg,
+ h264_chroma_mc_func chroma_avg,
+ cavs_vector *mv)
{
- qpel_mc_func *qpix_op= qpix_put;
- h264_chroma_mc_func chroma_op= chroma_put;
+ qpel_mc_func *qpix_op = qpix_put;
+ h264_chroma_mc_func chroma_op = chroma_put;
- dest_y += 2*x_offset + 2*y_offset*h->l_stride;
- dest_cb += x_offset + y_offset*h->c_stride;
- dest_cr += x_offset + y_offset*h->c_stride;
- x_offset += 8*h->mbx;
- y_offset += 8*h->mby;
+ dest_y += 2 * x_offset + 2 * y_offset*h->l_stride;
+ dest_cb += x_offset + y_offset*h->c_stride;
+ dest_cr += x_offset + y_offset*h->c_stride;
+ x_offset += 8 * h->mbx;
+ y_offset += 8 * h->mby;
- if(mv->ref >= 0){
+ if (mv->ref >= 0) {
AVFrame *ref = h->DPB[mv->ref].f;
mc_dir_part(h, ref, chroma_height, delta, 0,
dest_y, dest_cb, dest_cr, x_offset, y_offset,
*
****************************************************************************/
- int ff_cavs_init_pic(AVSContext *h) {
-void ff_cavs_init_pic(AVSContext *h)
++int ff_cavs_init_pic(AVSContext *h)
+ {
int i;
/* clear some predictors */
h->mv[MV_FWD_X0] = ff_cavs_dir_mv;
set_mvs(&h->mv[MV_FWD_X0], BLK_16X16);
h->pred_mode_Y[3] = h->pred_mode_Y[6] = NOT_AVAIL;
- h->cy = h->cur.f->data[0];
- h->cu = h->cur.f->data[1];
- h->cv = h->cur.f->data[2];
- h->l_stride = h->cur.f->linesize[0];
- h->c_stride = h->cur.f->linesize[1];
- h->luma_scan[2] = 8*h->l_stride;
- h->luma_scan[3] = 8*h->l_stride+8;
- h->mbx = h->mby = h->mbidx = 0;
- h->flags = 0;
+ h->cy = h->cur.f->data[0];
+ h->cu = h->cur.f->data[1];
+ h->cv = h->cur.f->data[2];
+ h->l_stride = h->cur.f->linesize[0];
+ h->c_stride = h->cur.f->linesize[1];
+ h->luma_scan[2] = 8 * h->l_stride;
+ h->luma_scan[3] = 8 * h->l_stride + 8;
+ h->mbx = h->mby = h->mbidx = 0;
+ h->flags = 0;
+
+ return 0;
}
/*****************************************************************************