FastLED 3.9.15
Loading...
Searching...
No Matches

◆ compute_accelerated_huffman()

static void fl::third_party::vorbis::compute_accelerated_huffman ( Codebook * c)
static

Definition at line 864 of file stb_vorbis.cpp.hpp.

865{
866 int32_t i, len;
867 for (i=0; i < FL_STBV_FAST_HUFFMAN_TABLE_SIZE; ++i)
868 c->fast_huffman[i] = -1;
869
870 len = c->sparse ? c->sorted_entries : c->entries;
871 #ifdef FL_STB_VORBIS_FAST_HUFFMAN_SHORT
872 if (len > 32767) len = 32767; // largest possible value we can encode!
873 #endif
874 for (i=0; i < len; ++i) {
876 uint32 z = c->sparse ? bit_reverse(c->sorted_codewords[i]) : c->codewords[i];
877 // set table entries for all bit combinations in the higher bits
879 c->fast_huffman[z] = i;
880 z += 1 << c->codeword_lengths[i];
881 }
882 }
883 }
884}
uint32_t z[NUM_LAYERS]
Definition Fire2023.h:93
static uint32_t bit_reverse(uint32_t n) FL_NOEXCEPT
int16 fast_huffman[FL_STBV_FAST_HUFFMAN_TABLE_SIZE]
fl::i32 int32_t
Definition coder.h:220
#define FL_STB_VORBIS_FAST_HUFFMAN_LENGTH
#define FL_STBV_FAST_HUFFMAN_TABLE_SIZE

References bit_reverse(), FL_NOEXCEPT, FL_STB_VORBIS_FAST_HUFFMAN_LENGTH, FL_STBV_FAST_HUFFMAN_TABLE_SIZE, and z.

Referenced by start_decoder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: