From cf3ac54339c42530342ec053b981d7b717404889 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Fri, 29 Apr 2011 20:12:48 +0200 Subject: vorbis: Replace sized int_fast integer types with plain int/unsigned. int/unsigned is the natural memory access type for CPUs, using sized types for temporary variables, counters and similar just increases code size and can possibly cause a slowdown. --- libavcodec/vorbis.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'libavcodec/vorbis.c') diff --git a/libavcodec/vorbis.c b/libavcodec/vorbis.c index d576a20..1a4d613 100644 --- a/libavcodec/vorbis.c +++ b/libavcodec/vorbis.c @@ -51,14 +51,13 @@ unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n) // the two bits[p] > 32 checks should be redundant, all calling code should // already ensure that, but since it allows overwriting the stack it seems // reasonable to check redundantly. -int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, uint_fast32_t num) +int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num) { uint_fast32_t exit_at_level[33] = { 404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - uint_fast8_t i, j; - uint_fast32_t code, p; + unsigned i, j, p, code; #ifdef V_DEBUG GetBitContext gb; @@ -78,8 +77,8 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, uint_fast32_t num) exit_at_level[i+1] = 1 << i; #ifdef V_DEBUG - av_log(NULL, AV_LOG_INFO, " %d. of %d code len %d code %d - ", p, num, bits[p], codes[p]); - init_get_bits(&gb, (uint_fast8_t *)&codes[p], bits[p]); + av_log(NULL, AV_LOG_INFO, " %u. of %u code len %d code %d - ", p, num, bits[p], codes[p]); + init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]); for (i = 0; i < bits[p]; ++i) av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0"); av_log(NULL, AV_LOG_INFO, "\n"); -- cgit v1.1