summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2007-07-02 10:21:41 +0000
committerBenoit Fouet <benoit.fouet@free.fr>2007-07-02 10:21:41 +0000
commit35c621e753c29d256dee0932fad59b83bf506ff4 (patch)
tree5966c92896b231b35442cb11e2ac97249b61580c /libavcodec
parentfb44e0706fabbb690d03d8cc042cbe445cbe3694 (diff)
downloadffmpeg-35c621e753c29d256dee0932fad59b83bf506ff4.tar.gz
use properly AVFrame.linesize
patch by Vitor: [vitor1001 gmail com] Originally committed as revision 9458 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/roqvideo.c22
-rw-r--r--libavcodec/roqvideodec.c2
2 files changed, 13 insertions, 11 deletions
diff --git a/libavcodec/roqvideo.c b/libavcodec/roqvideo.c
index 50393b0f77..edccc5f066 100644
--- a/libavcodec/roqvideo.c
+++ b/libavcodec/roqvideo.c
@@ -43,7 +43,7 @@ void ff_apply_vector_2x2(RoqContext *ri, int x, int y, roq_cell *cell)
unsigned char *bptr;
int boffs,stride;
- stride = ri->y_stride;
+ stride = ri->current_frame->linesize[0];
boffs = (y * stride) + x;
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)
bptr[stride ] = cell->y[2];
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[0 ] =
bptr[1 ] =
@@ -71,7 +73,7 @@ void ff_apply_vector_4x4(RoqContext *ri, int x, int y, roq_cell *cell)
unsigned char *bptr;
int boffs,stride;
- stride = ri->y_stride;
+ stride = ri->current_frame->linesize[0];
boffs = (y * stride) + x;
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)
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];
- stride = ri->c_stride;
+ stride = ri->current_frame->linesize[1];
+ boffs = y*stride + x;
+
bptr = ri->current_frame->data[1] + boffs;
bptr[ 0] = bptr[ 1] = bptr[stride ] = bptr[stride +1] =
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
}
for(cp = 0; cp < 3; cp++) {
- int stride = ri->current_frame->linesize[cp];
- block_copy(ri->current_frame->data[cp] + (y*stride) + x,
- ri->last_frame->data[cp] + (my*stride) + mx,
- stride, stride, sz);
+ int outstride = ri->current_frame->linesize[cp];
+ int instride = ri->last_frame ->linesize[cp];
+ block_copy(ri->current_frame->data[cp] + (y*outstride) + x,
+ ri->last_frame->data[cp] + (my*instride) + mx,
+ outstride, instride, sz);
}
-
}
diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c
index 8a3328ecc6..32da3fd919 100644
--- a/libavcodec/roqvideodec.c
+++ b/libavcodec/roqvideodec.c
@@ -180,8 +180,6 @@ static int roq_decode_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, " RoQ: get_buffer() failed\n");
return -1;
}
- s->y_stride = s->current_frame->linesize[0];
- s->c_stride = s->current_frame->linesize[1];
s->buf = buf;
s->size = buf_size;