Commit 64e4f483 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

Add decoder for Avid 1:1 10-bit RGB Packer (AVrp).

Fixes ticket #525.

Reviewed-by: Paul B Mahol
parent dc7ad85c
......@@ -16,6 +16,7 @@ version next:
- Automatic thread count based on detection number of (available) CPU cores
- y41p Brooktree Uncompressed 4:1:1 12-bit encoder and decoder
- ffprobe -show_error option
- Avid 1:1 10-bit RGB Packer decoder
version 0.9:
......
......@@ -438,6 +438,8 @@ following image formats are supported:
@item Autodesk Animator Flic video @tab @tab X
@item Autodesk RLE @tab @tab X
@tab fourcc: AASC
@item Avid 1:1 10-bit RGB Packer @tab @tab X
@tab fourcc: AVrp
@item AVS (Audio Video Standard) video @tab @tab X
@tab Video encoding used by the Creature Shock game.
@item Beam Software VB @tab @tab X
......
......@@ -91,6 +91,7 @@ OBJS-$(CONFIG_ATRAC1_DECODER) += atrac1.o atrac.o
OBJS-$(CONFIG_ATRAC3_DECODER) += atrac3.o atrac.o
OBJS-$(CONFIG_AURA_DECODER) += cyuv.o
OBJS-$(CONFIG_AURA2_DECODER) += aura.o
OBJS-$(CONFIG_AVRP_DECODER) += r210dec.o
OBJS-$(CONFIG_AVS_DECODER) += avs.o
OBJS-$(CONFIG_BETHSOFTVID_DECODER) += bethsoftvideo.o
OBJS-$(CONFIG_BFI_DECODER) += bfi.o
......
......@@ -79,6 +79,7 @@ void avcodec_register_all(void)
REGISTER_ENCDEC (ASV2, asv2);
REGISTER_DECODER (AURA, aura);
REGISTER_DECODER (AURA2, aura2);
REGISTER_DECODER (AVRP, avrp);
REGISTER_DECODER (AVS, avs);
REGISTER_DECODER (BETHSOFTVID, bethsoftvid);
REGISTER_DECODER (BFI, bfi);
......
......@@ -258,6 +258,7 @@ enum CodecID {
CODEC_ID_Y41P = MKBETAG('Y','4','1','P'),
CODEC_ID_UTVIDEO = 0x800,
CODEC_ID_ESCAPE130 = MKBETAG('E','1','3','0'),
CODEC_ID_AVRP = MKBETAG('A','V','R','P'),
CODEC_ID_G2M = MKBETAG( 0 ,'G','2','M'),
......
......@@ -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
......@@ -21,7 +21,7 @@
#define AVCODEC_VERSION_H
#define LIBAVCODEC_VERSION_MAJOR 53
#define LIBAVCODEC_VERSION_MINOR 50
#define LIBAVCODEC_VERSION_MINOR 51
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
......
......@@ -89,6 +89,7 @@ const AVCodecTag codec_movvideo_tags[] = {
{ CODEC_ID_R10K, MKTAG('R', '1', '0', 'k') }, /* UNCOMPRESSED 10BIT RGB */
{ CODEC_ID_R10K, MKTAG('R', '1', '0', 'g') }, /* UNCOMPRESSED 10BIT RGB */
{ CODEC_ID_R210, MKTAG('r', '2', '1', '0') }, /* UNCOMPRESSED 10BIT RGB */
{ CODEC_ID_AVRP, MKTAG('A', 'V', 'r', 'p') }, /* Avid 1:1 10-bit RGB Packer */
{ CODEC_ID_V210, MKTAG('v', '2', '1', '0') }, /* UNCOMPRESSED 10BIT 4:2:2 */
{ CODEC_ID_V410, MKTAG('v', '4', '1', '0') }, /* UNCOMPRESSED 10BIT 4:4:4 */
{ CODEC_ID_Y41P, MKTAG('Y', '4', '1', 'P') }, /* UNCOMPRESSED 12BIT 4:1:1 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment