summaryrefslogtreecommitdiffstats
path: root/libavcodec/diracdec.c
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-01-21 14:44:42 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2016-01-21 14:48:32 +0000
commit8248b51e0b94f0151b6a2057ee639d6e0db29f5f (patch)
treec3adcd845fc4d0976b9b16f09080def6209ab77b /libavcodec/diracdec.c
parent73c938dd9f3bc9a04a26d2d75f3c8845c6eed0f1 (diff)
downloadffmpeg-streaming-8248b51e0b94f0151b6a2057ee639d6e0db29f5f.zip
ffmpeg-streaming-8248b51e0b94f0151b6a2057ee639d6e0db29f5f.tar.gz
diracdec: add support for 12 bit videos
The DSP lacked a function needed to convert signed to unsigned. This was ignored when originally adding support and templating for bit depths greater than 8. The 10 bit function was used for 12 bit pictures and resulted in an improper conversion. Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Diffstat (limited to 'libavcodec/diracdec.c')
-rw-r--r--libavcodec/diracdec.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index ee07ff8..8ab4360 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1839,9 +1839,12 @@ static int dirac_decode_frame_internal(DiracContext *s)
if (!s->num_refs) { /* intra */
for (y = 0; y < p->height; y += 16) {
+ int idx = (s->bit_depth - 8) >> 1;
ff_spatial_idwt_slice2(&d, y+16); /* decode */
- s->diracdsp.put_signed_rect_clamped[s->pshift](frame + y*p->stride, p->stride,
- p->idwt_buf + y*p->idwt_stride, p->idwt_stride, p->width, 16);
+ s->diracdsp.put_signed_rect_clamped[idx](frame + y*p->stride,
+ p->stride,
+ p->idwt_buf + y*p->idwt_stride,
+ p->idwt_stride, p->width, 16);
}
} else { /* inter */
int rowheight = p->ybsep*p->stride;
OpenPOWER on IntegriCloud