diff options
author | Zhou Zongyi <zhouzy@os.pku.edu.cn> | 2010-09-13 22:08:51 +0000 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2010-09-13 22:08:51 +0000 |
commit | 4383692896499933ab7a4978314067be0edbfdb3 (patch) | |
tree | 44cedf179201c18be296c88c50dd4b8ef58c72e7 | |
parent | 527c91e34a0e1b49dbaede9fa1a7cc81ef8a3b0a (diff) | |
download | ffmpeg-4383692896499933ab7a4978314067be0edbfdb3.tar.gz |
Add R10k decoder.
Original patch by Zhou Zongyi, zhouzy A os pku edu cn, resubmitted by
James Darnley, james.darnley gmail, changes by me.
Originally committed as revision 25115 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | doc/general.texi | 1 | ||||
-rw-r--r-- | libavcodec/Makefile | 1 | ||||
-rw-r--r-- | libavcodec/allcodecs.c | 1 | ||||
-rw-r--r-- | libavcodec/avcodec.h | 3 | ||||
-rw-r--r-- | libavcodec/r210dec.c | 22 | ||||
-rw-r--r-- | libavformat/isom.c | 1 | ||||
-rw-r--r-- | libavformat/riff.c | 1 |
8 files changed, 30 insertions, 1 deletions
@@ -34,6 +34,7 @@ version <next>: - a64 codec - MMS-HTTP support - G.722 ADPCM audio decoder +- R10k video decoder version 0.6: diff --git a/doc/general.texi b/doc/general.texi index a692e040f5..9a3200f49c 100644 --- a/doc/general.texi +++ b/doc/general.texi @@ -460,6 +460,7 @@ following image formats are supported: @tab fourcc: 'smc ' @item QuickTime video (RPZA) @tab @tab X @tab fourcc: rpza +@item R10K AJA Kona 10-bit RGB Codec @tab @tab X @item R210 Quicktime Uncompressed RGB 10-bit @tab @tab X @item Raw Video @tab X @tab X @item RealVideo 1.0 @tab X @tab X diff --git a/libavcodec/Makefile b/libavcodec/Makefile index e0d70281ca..a9bb5298b5 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -289,6 +289,7 @@ OBJS-$(CONFIG_QDRAW_DECODER) += qdrw.o OBJS-$(CONFIG_QPEG_DECODER) += qpeg.o OBJS-$(CONFIG_QTRLE_DECODER) += qtrle.o OBJS-$(CONFIG_QTRLE_ENCODER) += qtrleenc.o +OBJS-$(CONFIG_R10K_DECODER) += r210dec.o OBJS-$(CONFIG_R210_DECODER) += r210dec.o OBJS-$(CONFIG_RA_144_DECODER) += ra144dec.o ra144.o celp_filters.o OBJS-$(CONFIG_RA_144_ENCODER) += ra144enc.o ra144.o celp_filters.o diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c index 31cfaddb7c..bc8831fd94 100644 --- a/libavcodec/allcodecs.c +++ b/libavcodec/allcodecs.c @@ -163,6 +163,7 @@ void avcodec_register_all(void) REGISTER_DECODER (QDRAW, qdraw); REGISTER_DECODER (QPEG, qpeg); REGISTER_ENCDEC (QTRLE, qtrle); + REGISTER_DECODER (R10K, r10k); REGISTER_DECODER (R210, r210); REGISTER_ENCDEC (RAWVIDEO, rawvideo); REGISTER_DECODER (RL2, rl2); diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 484880e818..54cc459357 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -31,7 +31,7 @@ #include "libavutil/cpu.h" #define LIBAVCODEC_VERSION_MAJOR 52 -#define LIBAVCODEC_VERSION_MINOR 88 +#define LIBAVCODEC_VERSION_MINOR 89 #define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ @@ -227,6 +227,7 @@ enum CodecID { CODEC_ID_ANSI, CODEC_ID_A64_MULTI, CODEC_ID_A64_MULTI5, + CODEC_ID_R10K, /* various PCM "codecs" */ CODEC_ID_PCM_S16LE= 0x10000, diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c index cf04070697..b88211eeb7 100644 --- a/libavcodec/r210dec.c +++ b/libavcodec/r210dec.c @@ -63,9 +63,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, for (w = 0; w < avctx->width; w++) { uint32_t pixel = av_be2ne32(*src++); uint16_t r, g, b; + if (avctx->codec_id==CODEC_ID_R210) { b = pixel << 6; g = (pixel >> 4) & 0xffc0; r = (pixel >> 14) & 0xffc0; + } else { + b = pixel << 4; + g = (pixel >> 6) & 0xffc0; + r = (pixel >> 16) & 0xffc0; + } *dst++ = r | (r >> 10); *dst++ = g | (g >> 10); *dst++ = b | (b >> 10); @@ -90,6 +96,7 @@ static av_cold int decode_close(AVCodecContext *avctx) return 0; } +#if CONFIG_R210_DECODER AVCodec r210_decoder = { "r210", AVMEDIA_TYPE_VIDEO, @@ -102,3 +109,18 @@ AVCodec r210_decoder = { CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"), }; +#endif +#if CONFIG_R10K_DECODER +AVCodec r10k_decoder = { + "r10k", + AVMEDIA_TYPE_VIDEO, + CODEC_ID_R10K, + 0, + decode_init, + NULL, + decode_close, + decode_frame, + CODEC_CAP_DR1, + .long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"), +}; +#endif diff --git a/libavformat/isom.c b/libavformat/isom.c index bf2d3b1daf..9064576834 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -77,6 +77,7 @@ const AVCodecTag codec_movvideo_tags[] = { { CODEC_ID_RAWVIDEO, MKTAG('b', '1', '6', 'g') }, { CODEC_ID_RAWVIDEO, MKTAG('b', '4', '8', 'r') }, + { CODEC_ID_R10K, MKTAG('R', '1', '0', 'k') }, /* UNCOMPRESSED 10BIT RGB */ { CODEC_ID_R210, MKTAG('r', '2', '1', '0') }, /* UNCOMPRESSED 10BIT RGB */ { CODEC_ID_V210, MKTAG('v', '2', '1', '0') }, /* UNCOMPRESSED 10BIT 4:2:2 */ diff --git a/libavformat/riff.c b/libavformat/riff.c index 8f2f0a2a99..24d0cce975 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -179,6 +179,7 @@ const AVCodecTag ff_codec_bmp_tags[] = { { CODEC_ID_RAWVIDEO, MKTAG('Y', 'U', 'V', '9') }, { CODEC_ID_RAWVIDEO, MKTAG('Y', 'V', 'U', '9') }, { CODEC_ID_FRWU, MKTAG('F', 'R', 'W', 'U') }, + { CODEC_ID_R10K, MKTAG('R', '1', '0', 'k') }, { CODEC_ID_R210, MKTAG('r', '2', '1', '0') }, { CODEC_ID_V210, MKTAG('v', '2', '1', '0') }, { CODEC_ID_INDEO3, MKTAG('I', 'V', '3', '1') }, |