summaryrefslogtreecommitdiffstats
path: root/libavcodec/ffv1dec_template.c
diff options
context:
space:
mode:
authorJérôme Martinez <jerome@mediaarea.net>2018-02-01 13:11:53 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-02-06 23:07:10 +0100
commit698d5eb5bf83d1afbff3e74bb25a6d486b6bf7e8 (patch)
treea7d623a9ca6762b0627dcaed0a5487adfd98760d /libavcodec/ffv1dec_template.c
parent204c7caf0d77bdfd73196ffee00695222d0ff2cb (diff)
downloadffmpeg-streaming-698d5eb5bf83d1afbff3e74bb25a6d486b6bf7e8.zip
ffmpeg-streaming-698d5eb5bf83d1afbff3e74bb25a6d486b6bf7e8.tar.gz
avcodec/ffv1: Support for RGBA64 and GBRAP16
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/ffv1dec_template.c')
-rw-r--r--libavcodec/ffv1dec_template.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/ffv1dec_template.c b/libavcodec/ffv1dec_template.c
index 37df766..a25b338 100644
--- a/libavcodec/ffv1dec_template.c
+++ b/libavcodec/ffv1dec_template.c
@@ -107,13 +107,14 @@ static av_always_inline int RENAME(decode_line)(FFV1Context *s, int w,
return 0;
}
-static void RENAME(decode_rgb_frame)(FFV1Context *s, uint8_t *src[3], int w, int h, int stride[3])
+static void RENAME(decode_rgb_frame)(FFV1Context *s, uint8_t *src[4], int w, int h, int stride[4])
{
int x, y, p;
TYPE *sample[4][2];
int lbd = s->avctx->bits_per_raw_sample <= 8;
int bits = s->avctx->bits_per_raw_sample > 0 ? s->avctx->bits_per_raw_sample : 8;
int offset = 1 << bits;
+ int transparency = s->transparency;
for (x = 0; x < 4; x++) {
sample[x][0] = RENAME(s->sample_buffer) + x * 2 * (w + 6) + 3;
@@ -125,7 +126,7 @@ static void RENAME(decode_rgb_frame)(FFV1Context *s, uint8_t *src[3], int w, int
memset(RENAME(s->sample_buffer), 0, 8 * (w + 6) * sizeof(*RENAME(s->sample_buffer)));
for (y = 0; y < h; y++) {
- for (p = 0; p < 3 + s->transparency; p++) {
+ for (p = 0; p < 3 + transparency; p++) {
TYPE *temp = sample[p][0]; // FIXME: try a normal buffer
sample[p][0] = sample[p][1];
@@ -158,10 +159,14 @@ static void RENAME(decode_rgb_frame)(FFV1Context *s, uint8_t *src[3], int w, int
*((uint16_t*)(src[0] + x*2 + stride[0]*y)) = g;
*((uint16_t*)(src[1] + x*2 + stride[1]*y)) = b;
*((uint16_t*)(src[2] + x*2 + stride[2]*y)) = r;
+ if (transparency)
+ *((uint16_t*)(src[3] + x*2 + stride[3]*y)) = a;
} else {
*((uint16_t*)(src[0] + x*2 + stride[0]*y)) = b;
*((uint16_t*)(src[1] + x*2 + stride[1]*y)) = g;
*((uint16_t*)(src[2] + x*2 + stride[2]*y)) = r;
+ if (transparency)
+ *((uint16_t*)(src[3] + x*2 + stride[3]*y)) = a;
}
}
}
OpenPOWER on IntegriCloud