From 64e4f4836a03e427936c17a651a19658d3e3b474 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Wed, 4 Jan 2012 15:10:58 +0100 Subject: Add decoder for Avid 1:1 10-bit RGB Packer (AVrp). Fixes ticket #525. Reviewed-by: Paul B Mahol --- libavcodec/r210dec.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'libavcodec/r210dec.c') 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 -- cgit v1.2.3