diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2003-04-21 15:15:59 +0000 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2003-04-21 15:15:59 +0000 |
commit | 0a05e4940bc6ae8bf66a7435e5cc994707e783b1 (patch) | |
tree | f9a286d2c4eb5ff153d811d396fff4def5541dfd | |
parent | 0a9ad8d13dd008666e860dd3c5ace729773107d8 (diff) | |
download | ffmpeg-0a05e4940bc6ae8bf66a7435e5cc994707e783b1.tar.gz |
fixed PIX_FMT_YUV422 conversions
Originally committed as revision 1806 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/imgconvert.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 82d4d5665f..f9cea4e57e 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -538,8 +538,8 @@ static void yuv422_to_yuv420p(AVPicture *dst, AVPicture *src, p1 = src->data[0]; lum1 = dst->data[0]; - cb1 = dst->data[0]; - cr1 = dst->data[0]; + cb1 = dst->data[1]; + cr1 = dst->data[2]; for(;height >= 2; height -= 2) { p = p1; @@ -582,9 +582,9 @@ static void yuv422_to_yuv422p(AVPicture *dst, AVPicture *src, p1 = src->data[0]; lum1 = dst->data[0]; - cb1 = dst->data[0]; - cr1 = dst->data[0]; - for(;height >= 2; height -= 2) { + cb1 = dst->data[1]; + cr1 = dst->data[2]; + for(;height > 0; height--) { p = p1; lum = lum1; cb = cb1; @@ -615,9 +615,9 @@ static void yuv422p_to_yuv422(AVPicture *dst, AVPicture *src, p1 = dst->data[0]; lum1 = src->data[0]; - cb1 = src->data[0]; - cr1 = src->data[0]; - for(;height >= 2; height -= 2) { + cb1 = src->data[1]; + cr1 = src->data[2]; + for(;height > 0; height--) { p = p1; lum = lum1; cb = cb1; @@ -632,10 +632,10 @@ static void yuv422p_to_yuv422(AVPicture *dst, AVPicture *src, cb++; cr++; } - p1 += src->linesize[0]; - lum1 += dst->linesize[0]; - cb1 += dst->linesize[1]; - cr1 += dst->linesize[2]; + p1 += dst->linesize[0]; + lum1 += src->linesize[0]; + cb1 += src->linesize[1]; + cr1 += src->linesize[2]; } } |