Commit cf3ac543 authored by Diego Biurrun's avatar Diego Biurrun

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.
parent a734fa57
...@@ -51,14 +51,13 @@ unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n) ...@@ -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 // 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 // already ensure that, but since it allows overwriting the stack it seems
// reasonable to check redundantly. // 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] = { uint_fast32_t exit_at_level[33] = {
404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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 }; 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint_fast8_t i, j; unsigned i, j, p, code;
uint_fast32_t code, p;
#ifdef V_DEBUG #ifdef V_DEBUG
GetBitContext gb; GetBitContext gb;
...@@ -78,8 +77,8 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, uint_fast32_t num) ...@@ -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; exit_at_level[i+1] = 1 << i;
#ifdef V_DEBUG #ifdef V_DEBUG
av_log(NULL, AV_LOG_INFO, " %d. of %d code len %d code %d - ", p, num, bits[p], codes[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, (uint_fast8_t *)&codes[p], bits[p]); init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]);
for (i = 0; i < bits[p]; ++i) 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, "%s", get_bits1(&gb) ? "1" : "0");
av_log(NULL, AV_LOG_INFO, "\n"); av_log(NULL, AV_LOG_INFO, "\n");
......
...@@ -38,7 +38,7 @@ typedef struct { ...@@ -38,7 +38,7 @@ typedef struct {
void ff_vorbis_ready_floor1_list(vorbis_floor1_entry * list, int values); void ff_vorbis_ready_floor1_list(vorbis_floor1_entry * list, int values);
unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n) unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n)
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);
void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values, void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
uint_fast16_t * y_list, int * flag, uint_fast16_t * y_list, int * flag,
int multiplier, float * out, int samples); int multiplier, float * out, int samples);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment