aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/rawdec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2012-05-27 01:13:37 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2012-05-27 01:13:37 +0200
commitab7d6cb8f770c3b88a8139d1182fcc934062f891 (patch)
tree6943efc1f99b73d79ae6938951619369745dc573 /libavcodec/rawdec.c
parent5c3f79198c016980b8bd5e876761eb42341c3cec (diff)
downloadffmpeg-ab7d6cb8f770c3b88a8139d1182fcc934062f891.tar.gz
Support decoding fourcc YVYU.
Based on work by ami_stuff. Fixes ticket #1352
Diffstat (limited to 'libavcodec/rawdec.c')
-rw-r--r--libavcodec/rawdec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index 8d2390e2aa..dd4355f468 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -235,6 +235,16 @@ static int raw_decode(AVCodecContext *avctx,
line += picture->linesize[0];
}
}
+ if(avctx->codec_tag == AV_RL32("YVYU") &&
+ avctx->pix_fmt == PIX_FMT_YUYV422) {
+ int x, y;
+ uint8_t *line = picture->data[0];
+ for(y = 0; y < avctx->height; y++) {
+ for(x = 0; x < avctx->width - 1; x += 2)
+ FFSWAP(uint8_t, line[2*x + 1], line[2*x + 3]);
+ line += picture->linesize[0];
+ }
+ }
*data_size = sizeof(AVPicture);
return buf_size;