diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-01-03 01:19:23 +0100 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-01-03 21:12:53 +0100 |
commit | 43ff4aed26cba2cce230972add631ab938d33b30 (patch) | |
tree | 55e3e95735f6946b852d3bb97ae5ae7c4722760a /libavcodec/wmalosslessdec.c | |
parent | 713654d9d3a6931a9b4cd0cffa4bb61cd1357977 (diff) | |
download | ffmpeg-43ff4aed26cba2cce230972add631ab938d33b30.tar.gz |
lavc: use get_bitsz to simplify the code
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavcodec/wmalosslessdec.c')
-rw-r--r-- | libavcodec/wmalosslessdec.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/wmalosslessdec.c b/libavcodec/wmalosslessdec.c index e9d0bca616..8a5ffb86a5 100644 --- a/libavcodec/wmalosslessdec.c +++ b/libavcodec/wmalosslessdec.c @@ -422,8 +422,7 @@ static void decode_ac_filter(WmallDecodeCtx *s) s->acfilter_scaling = get_bits(&s->gb, 4); for (i = 0; i < s->acfilter_order; i++) - s->acfilter_coeffs[i] = (s->acfilter_scaling ? - get_bits(&s->gb, s->acfilter_scaling) : 0) + 1; + s->acfilter_coeffs[i] = get_bitsz(&s->gb, s->acfilter_scaling) + 1; } static void decode_mclms(WmallDecodeCtx *s) @@ -436,7 +435,7 @@ static void decode_mclms(WmallDecodeCtx *s) if (1 << cbits < s->mclms_scaling + 1) cbits++; - send_coef_bits = (cbits ? get_bits(&s->gb, cbits) : 0) + 2; + send_coef_bits = get_bitsz(&s->gb, cbits) + 2; for (i = 0; i < s->mclms_order * s->num_channels * s->num_channels; i++) s->mclms_coeffs[i] = get_bits(&s->gb, send_coef_bits); @@ -489,7 +488,7 @@ static int decode_cdlms(WmallDecodeCtx *s) if ((1 << cbits) < s->cdlms[c][i].scaling + 1) cbits++; - s->cdlms[c][i].bitsend = (cbits ? get_bits(&s->gb, cbits) : 0) + 2; + s->cdlms[c][i].bitsend = get_bitsz(&s->gb, cbits) + 2; shift_l = 32 - s->cdlms[c][i].bitsend; shift_r = 32 - s->cdlms[c][i].scaling - 2; for (j = 0; j < s->cdlms[c][i].coefsend; j++) |