summaryrefslogtreecommitdiff
path: root/libavcodec/r210dec.c
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2012-01-04 15:10:58 +0100
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2012-01-04 15:37:58 +0100
commit64e4f4836a03e427936c17a651a19658d3e3b474 (patch)
treed69da72fa4792d79a1a647da5bdde8517250171b /libavcodec/r210dec.c
parentdc7ad85c401a0137795e0414f5fe1c2e7f1d7078 (diff)
Add decoder for Avid 1:1 10-bit RGB Packer (AVrp).
Fixes ticket #525. Reviewed-by: Paul B Mahol
Diffstat (limited to 'libavcodec/r210dec.c')
-rw-r--r--libavcodec/r210dec.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c
index 18086c6916..d31033229f 100644
--- a/libavcodec/r210dec.c
+++ b/libavcodec/r210dec.c
@@ -61,8 +61,13 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
for (h = 0; h < avctx->height; h++) {
uint16_t *dst = (uint16_t *)dst_line;
for (w = 0; w < avctx->width; w++) {
- uint32_t pixel = av_be2ne32(*src++);
+ uint32_t pixel;
uint16_t r, g, b;
+ if (avctx->codec_id==CODEC_ID_AVRP) {
+ pixel = av_le2ne32(*src++);
+ } else {
+ pixel = av_be2ne32(*src++);
+ }
if (avctx->codec_id==CODEC_ID_R210) {
b = pixel << 6;
g = (pixel >> 4) & 0xffc0;
@@ -120,3 +125,15 @@ AVCodec ff_r10k_decoder = {
.long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"),
};
#endif
+#if CONFIG_AVRP_DECODER
+AVCodec ff_avrp_decoder = {
+ .name = "avrp",
+ .type = AVMEDIA_TYPE_VIDEO,
+ .id = CODEC_ID_AVRP,
+ .init = decode_init,
+ .close = decode_close,
+ .decode = decode_frame,
+ .capabilities = CODEC_CAP_DR1,
+ .long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"),
+};
+#endif