summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2016-08-13 01:44:52 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2016-08-13 01:44:52 +0200
commitceab04fb5db89052b3d8abcb57b137de24ed42b0 (patch)
treefccbf10764ab2615a0a7ddb3805d3e50fc91df1f /libavcodec
parentbc7031265441a47595eadc39a44080e4e1fe208f (diff)
lavc/raw: Support QT b64a ARGB64 rawvideo.
Decoder based on a patch by v0lt, v0lt rambler ru Fixes ticket #5657.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/raw.c1
-rw-r--r--libavcodec/rawdec.c11
-rw-r--r--libavcodec/rawenc.c8
-rw-r--r--libavcodec/version.h2
4 files changed, 21 insertions, 1 deletions
diff --git a/libavcodec/raw.c b/libavcodec/raw.c
index d36b68bfae..d6aaf7637f 100644
--- a/libavcodec/raw.c
+++ b/libavcodec/raw.c
@@ -225,6 +225,7 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = {
{ AV_PIX_FMT_ABGR, MKTAG('A', 'B', 'G', 'R') },
{ AV_PIX_FMT_GRAY16BE,MKTAG('b', '1', '6', 'g') },
{ AV_PIX_FMT_RGB48BE, MKTAG('b', '4', '8', 'r') },
+ { AV_PIX_FMT_RGBA64BE,MKTAG('b', '6', '4', 'a') },
/* vlc */
{ AV_PIX_FMT_YUV410P, MKTAG('I', '4', '1', '0') },
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index f97a839f5d..1bde67993a 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -453,6 +453,17 @@ static int raw_decode(AVCodecContext *avctx, void *data, int *got_frame,
}
}
+ if (avctx->codec_tag == AV_RL32("b64a") &&
+ avctx->pix_fmt == AV_PIX_FMT_RGBA64BE) {
+ uint8_t *dst = frame->data[0];
+ uint64_t v;
+ int x;
+ for (x = 0; x >> 3 < avctx->width * avctx->height; x += 8) {
+ v = AV_RB64(&dst[x]);
+ AV_WB64(&dst[x], v << 16 | v >> 48);
+ }
+ }
+
if (avctx->field_order > AV_FIELD_PROGRESSIVE) { /* we have interlaced material flagged in container */
frame->interlaced_frame = 1;
if (avctx->field_order == AV_FIELD_TT || avctx->field_order == AV_FIELD_TB)
diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c
index d83705645c..a2d5ccc0a6 100644
--- a/libavcodec/rawenc.c
+++ b/libavcodec/rawenc.c
@@ -69,6 +69,14 @@ static int raw_encode(AVCodecContext *avctx, AVPacket *pkt,
int x;
for(x = 1; x < frame->height*frame->width*2; x += 2)
pkt->data[x] ^= 0x80;
+ } else if (avctx->codec_tag == AV_RL32("b64a") && ret > 0 &&
+ frame->format == AV_PIX_FMT_RGBA64BE) {
+ uint64_t v;
+ int x;
+ for (x = 0; x < frame->height * frame->width; x++) {
+ v = AV_RB64(&pkt->data[8 * x]);
+ AV_WB64(&pkt->data[8 * x], v << 48 | v >> 16);
+ }
}
pkt->flags |= AV_PKT_FLAG_KEY;
*got_packet = 1;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 306c28097e..2362a9d40c 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -29,7 +29,7 @@
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 51
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \