diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-27 21:47:32 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-06-28 14:08:21 +0200 |
commit | 9c604b34d435d14d077cb52432dbc13d5b59d9a3 (patch) | |
tree | d1bda4f7867e9e1ed646ac1078b4296086f5af7f /libavcodec/utvideodec.c | |
parent | 1835c5e7a4fd3a1e7c8a51ed410cecbfe6804ade (diff) |
avcodec/utvideodec: hardcode vlc bits
2.5% faster vlc decoding
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/utvideodec.c')
-rw-r--r-- | libavcodec/utvideodec.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index 815b71cfb6..18f11aa3a7 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -73,8 +73,8 @@ static int build_huff10(const uint8_t *src, VLC *vlc, int *fsym) syms[i] = he[i].sym; code += 0x80000000u >> (he[i].len - 1); } - - return ff_init_vlc_sparse(vlc, FFMIN(he[last].len, 11), last + 1, +#define VLC_BITS 11 + return ff_init_vlc_sparse(vlc, VLC_BITS, last + 1, bits, sizeof(*bits), sizeof(*bits), codes, sizeof(*codes), sizeof(*codes), syms, sizeof(*syms), sizeof(*syms), 0); @@ -117,7 +117,7 @@ static int build_huff(const uint8_t *src, VLC *vlc, int *fsym) code += 0x80000000u >> (he[i].len - 1); } - return ff_init_vlc_sparse(vlc, FFMIN(he[last].len, 11), last + 1, + return ff_init_vlc_sparse(vlc, VLC_BITS, last + 1, bits, sizeof(*bits), sizeof(*bits), codes, sizeof(*codes), sizeof(*codes), syms, sizeof(*syms), sizeof(*syms), 0); @@ -196,7 +196,7 @@ static int decode_plane10(UtvideoContext *c, int plane_no, prev = 0x200; for (j = sstart; j < send; j++) { for (i = 0; i < width * step; i += step) { - pix = get_vlc2(&gb, vlc.table, vlc.bits, 3); + pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3); if (pix < 0) { av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n"); goto fail; @@ -302,7 +302,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, prev = 0x80; for (j = sstart; j < send; j++) { for (i = 0; i < width * step; i += step) { - pix = get_vlc2(&gb, vlc.table, vlc.bits, 3); + pix = get_vlc2(&gb, vlc.table, VLC_BITS, 3); if (pix < 0) { av_log(c->avctx, AV_LOG_ERROR, "Decoding error\n"); goto fail; |