diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-05-27 01:13:37 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-05-27 01:13:37 +0200 |
commit | ab7d6cb8f770c3b88a8139d1182fcc934062f891 (patch) | |
tree | 6943efc1f99b73d79ae6938951619369745dc573 /libavcodec/rawdec.c | |
parent | 5c3f79198c016980b8bd5e876761eb42341c3cec (diff) | |
download | ffmpeg-streaming-ab7d6cb8f770c3b88a8139d1182fcc934062f891.zip ffmpeg-streaming-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.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index 8d2390e..dd4355f 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; |