comparison roqvideo.c @ 5192:3bfa0f33c854 libavcodec

use the right stride patch by Vitor: [vitor1001 gmail com]
author benoit
date Wed, 27 Jun 2007 10:40:29 +0000
parents ab669ac706dc
children 0af35881395e
comparison
equal deleted inserted replaced
5191:4870b71fe348 5192:3bfa0f33c854
50 bptr[0 ] = cell->y[0]; 50 bptr[0 ] = cell->y[0];
51 bptr[1 ] = cell->y[1]; 51 bptr[1 ] = cell->y[1];
52 bptr[stride ] = cell->y[2]; 52 bptr[stride ] = cell->y[2];
53 bptr[stride+1] = cell->y[3]; 53 bptr[stride+1] = cell->y[3];
54 54
55 stride = ri->c_stride;
55 bptr = ri->current_frame->data[1] + boffs; 56 bptr = ri->current_frame->data[1] + boffs;
56 bptr[0 ] = 57 bptr[0 ] =
57 bptr[1 ] = 58 bptr[1 ] =
58 bptr[stride ] = 59 bptr[stride ] =
59 bptr[stride+1] = cell->u; 60 bptr[stride+1] = cell->u;
77 bptr[ 0] = bptr[ 1] = bptr[stride ] = bptr[stride +1] = cell->y[0]; 78 bptr[ 0] = bptr[ 1] = bptr[stride ] = bptr[stride +1] = cell->y[0];
78 bptr[ 2] = bptr[ 3] = bptr[stride +2] = bptr[stride +3] = cell->y[1]; 79 bptr[ 2] = bptr[ 3] = bptr[stride +2] = bptr[stride +3] = cell->y[1];
79 bptr[stride*2 ] = bptr[stride*2+1] = bptr[stride*3 ] = bptr[stride*3+1] = cell->y[2]; 80 bptr[stride*2 ] = bptr[stride*2+1] = bptr[stride*3 ] = bptr[stride*3+1] = cell->y[2];
80 bptr[stride*2+2] = bptr[stride*2+3] = bptr[stride*3+2] = bptr[stride*3+3] = cell->y[3]; 81 bptr[stride*2+2] = bptr[stride*2+3] = bptr[stride*3+2] = bptr[stride*3+3] = cell->y[3];
81 82
83 stride = ri->c_stride;
82 bptr = ri->current_frame->data[1] + boffs; 84 bptr = ri->current_frame->data[1] + boffs;
83 bptr[ 0] = bptr[ 1] = bptr[stride ] = bptr[stride +1] = 85 bptr[ 0] = bptr[ 1] = bptr[stride ] = bptr[stride +1] =
84 bptr[ 2] = bptr[ 3] = bptr[stride +2] = bptr[stride +3] = 86 bptr[ 2] = bptr[ 3] = bptr[stride +2] = bptr[stride +3] =
85 bptr[stride*2 ] = bptr[stride*2+1] = bptr[stride*3 ] = bptr[stride*3+1] = 87 bptr[stride*2 ] = bptr[stride*2+1] = bptr[stride*3 ] = bptr[stride*3+1] =
86 bptr[stride*2+2] = bptr[stride*2+3] = bptr[stride*3+2] = bptr[stride*3+3] = cell->u; 88 bptr[stride*2+2] = bptr[stride*2+3] = bptr[stride*3+2] = bptr[stride*3+3] = cell->u;
107 av_log(ri->avctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n", 109 av_log(ri->avctx, AV_LOG_ERROR, "motion vector out of bounds: MV = (%d, %d), boundaries = (0, 0, %d, %d)\n",
108 mx, my, ri->width, ri->height); 110 mx, my, ri->width, ri->height);
109 return; 111 return;
110 } 112 }
111 113
112 for(cp = 0; cp < 3; cp++) 114 for(cp = 0; cp < 3; cp++) {
113 block_copy(ri->current_frame->data[cp] + (y * ri->y_stride) + x, 115 int stride = ri->current_frame->linesize[cp];
114 ri->last_frame->data[cp] + (my * ri->y_stride) + mx, 116 block_copy(ri->current_frame->data[cp] + (y*stride) + x,
115 ri->y_stride, ri->y_stride, sz); 117 ri->last_frame->data[cp] + (my*stride) + mx,
118 stride, stride, sz);
119 }
120
116 } 121 }
117 122
118 123
119 void ff_apply_motion_4x4(RoqContext *ri, int x, int y, 124 void ff_apply_motion_4x4(RoqContext *ri, int x, int y,
120 int deltax, int deltay) 125 int deltax, int deltay)