summaryrefslogtreecommitdiff
path: root/libavcodec/r210dec.c
diff options
context:
space:
mode:
authorZhou Zongyi <zhouzy@os.pku.edu.cn>2010-09-13 22:08:51 +0000
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>2010-09-13 22:08:51 +0000
commit4383692896499933ab7a4978314067be0edbfdb3 (patch)
tree44cedf179201c18be296c88c50dd4b8ef58c72e7 /libavcodec/r210dec.c
parent527c91e34a0e1b49dbaede9fa1a7cc81ef8a3b0a (diff)
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
Diffstat (limited to 'libavcodec/r210dec.c')
-rw-r--r--libavcodec/r210dec.c22
1 files changed, 22 insertions, 0 deletions
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