diff options
author | foo86 <foobaz86@gmail.com> | 2017-01-07 12:26:43 +0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-01-07 11:28:12 -0300 |
commit | 000638431ccc206f280d8246855062afe0284f80 (patch) | |
tree | ca9da98be449c2d63189a66b0f873a65267b719f /libavcodec/dca_xll.c | |
parent | 20e8be0c20c7b51964fa4d317073bd36b983eb55 (diff) | |
download | ffmpeg-000638431ccc206f280d8246855062afe0284f80.tar.gz |
avcodec/dca: add support for 20-bit XLL
Fixes ticket #6063.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/dca_xll.c')
-rw-r--r-- | libavcodec/dca_xll.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/dca_xll.c b/libavcodec/dca_xll.c index 1d616c298c..1320aaf28f 100644 --- a/libavcodec/dca_xll.c +++ b/libavcodec/dca_xll.c @@ -143,7 +143,7 @@ static int chs_parse_header(DCAXllDecoder *s, DCAXllChSet *c, DCAExssAsset *asse // Storage unit width c->storage_bit_res = get_bits(&s->gb, 5) + 1; - if (c->storage_bit_res != 16 && c->storage_bit_res != 24) { + if (c->storage_bit_res != 16 && c->storage_bit_res != 20 && c->storage_bit_res != 24) { avpriv_request_sample(s->avctx, "%d-bit XLL storage resolution", c->storage_bit_res); return AVERROR_PATCHWELCOME; } @@ -1415,9 +1415,12 @@ int ff_dca_xll_filter_frame(DCAXllDecoder *s, AVFrame *frame) switch (p->storage_bit_res) { case 16: avctx->sample_fmt = AV_SAMPLE_FMT_S16P; + shift = 16 - p->pcm_bit_res; break; + case 20: case 24: avctx->sample_fmt = AV_SAMPLE_FMT_S32P; + shift = 24 - p->pcm_bit_res; break; default: return AVERROR(EINVAL); @@ -1438,7 +1441,6 @@ int ff_dca_xll_filter_frame(DCAXllDecoder *s, AVFrame *frame) s->output_mask); } - shift = p->storage_bit_res - p->pcm_bit_res; for (i = 0; i < avctx->channels; i++) { int32_t *samples = s->output_samples[ch_remap[i]]; if (frame->format == AV_SAMPLE_FMT_S16P) { |