Commit 8d183b69 authored by benoit's avatar benoit

use properly AVFrame.linesize

patch by Vitor: [vitor1001 gmail com]


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9458 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent f2ee7b24
...@@ -43,7 +43,7 @@ void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell) ...@@ -43,7 +43,7 @@ void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell)
unsigned char *bptr; unsigned char *bptr;
int boffs,stride; int boffs,stride;
stride = ri->y_stride; stride = ri->current_frame->linesize[0];
boffs = (y * stride) + x; boffs = (y * stride) + x;
bptr = ri->current_frame->data[0] + boffs; bptr = ri->current_frame->data[0] + boffs;
...@@ -52,7 +52,9 @@ void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell) ...@@ -52,7 +52,9 @@ void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell)
bptr[stride ] = cell->y[2]; bptr[stride ] = cell->y[2];
bptr[stride+1] = cell->y[3]; bptr[stride+1] = cell->y[3];
stride = ri->c_stride; stride = ri->current_frame->linesize[1];
boffs = y*stride + x;
bptr = ri->current_frame->data[1] + boffs; bptr = ri->current_frame->data[1] + boffs;
bptr[0 ] = bptr[0 ] =
bptr[1 ] = bptr[1 ] =
...@@ -71,7 +73,7 @@ void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell) ...@@ -71,7 +73,7 @@ void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell)
unsigned char *bptr; unsigned char *bptr;
int boffs,stride; int boffs,stride;
stride = ri->y_stride; stride = ri->current_frame->linesize[0];
boffs = (y * stride) + x; boffs = (y * stride) + x;
bptr = ri->current_frame->data[0] + boffs; bptr = ri->current_frame->data[0] + boffs;
...@@ -80,7 +82,9 @@ void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell) ...@@ -80,7 +82,9 @@ void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell)
bptr[stride*2 ] = bptr[stride*2+1] = bptr[stride*3 ] = bptr[stride*3+1] = cell->y[2]; bptr[stride*2 ] = bptr[stride*2+1] = bptr[stride*3 ] = bptr[stride*3+1] = cell->y[2];
bptr[stride*2+2] = bptr[stride*2+3] = bptr[stride*3+2] = bptr[stride*3+3] = cell->y[3]; bptr[stride*2+2] = bptr[stride*2+3] = bptr[stride*3+2] = bptr[stride*3+3] = cell->y[3];
stride = ri->c_stride; stride = ri->current_frame->linesize[1];
boffs = y*stride + x;
bptr = ri->current_frame->data[1] + boffs; bptr = ri->current_frame->data[1] + boffs;
bptr[ 0] = bptr[ 1] = bptr[stride ] = bptr[stride +1] = bptr[ 0] = bptr[ 1] = bptr[stride ] = bptr[stride +1] =
bptr[ 2] = bptr[ 3] = bptr[stride +2] = bptr[stride +3] = bptr[ 2] = bptr[ 3] = bptr[stride +2] = bptr[stride +3] =
...@@ -112,12 +116,12 @@ static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax ...@@ -112,12 +116,12 @@ static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax
} }
for(cp = 0; cp < 3; cp++) { for(cp = 0; cp < 3; cp++) {
int stride = ri->current_frame->linesize[cp]; int outstride = ri->current_frame->linesize[cp];
block_copy(ri->current_frame->data[cp] + (y*stride) + x, int instride = ri->last_frame ->linesize[cp];
ri->last_frame->data[cp] + (my*stride) + mx, block_copy(ri->current_frame->data[cp] + (y*outstride) + x,
stride, stride, sz); ri->last_frame->data[cp] + (my*instride) + mx,
outstride, instride, sz);
} }
} }
......
...@@ -180,8 +180,6 @@ static int roq_decode_frame(AVCodecContext *avctx, ...@@ -180,8 +180,6 @@ static int roq_decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, " RoQ: get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, " RoQ: get_buffer() failed\n");
return -1; return -1;
} }
s->y_stride = s->current_frame->linesize[0];
s->c_stride = s->current_frame->linesize[1];
s->buf = buf; s->buf = buf;
s->size = buf_size; s->size = buf_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment