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

◆ codebook_decode_step()

static int32_t fl::third_party::vorbis::codebook_decode_step ( vorb * f,
Codebook * c,
float * output,
int32_t len,
int32_t step )
static

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

1563{
1565 float last = FL_STBV_CODEBOOK_ELEMENT_BASE(c);
1566 if (z < 0) return false;
1567 if (len > c->dimensions) len = c->dimensions;
1568
1569#ifdef FL_STB_VORBIS_DIVIDES_IN_CODEBOOK
1570 if (c->lookup_type == 1) {
1571 int32_t div = 1;
1572 for (i=0; i < len; ++i) {
1573 int32_t off = (z / div) % c->lookup_values;
1574 float val = FL_STBV_CODEBOOK_ELEMENT_FAST(c,off) + last;
1575 output[i*step] += val;
1576 if (c->sequence_p) last = val;
1577 div *= c->lookup_values;
1578 }
1579 return true;
1580 }
1581#endif
1582
1583 z *= c->dimensions;
1584 for (i=0; i < len; ++i) {
1585 float val = FL_STBV_CODEBOOK_ELEMENT_FAST(c,z+i) + last;
1586 output[i*step] += val;
1587 if (c->sequence_p) last = val;
1588 }
1589
1590 return true;
1591}
uint32_t z[NUM_LAYERS]
Definition Fire2023.h:93
static int32_t codebook_decode_start(vorb *f, Codebook *c) FL_NOEXCEPT
fl::i32 int32_t
Definition coder.h:220
constexpr enable_if< is_fixed_point< T >::value, T >::type step(T edge, T x) FL_NOEXCEPT
#define FL_STBV_CODEBOOK_ELEMENT_BASE(c)
#define FL_STBV_CODEBOOK_ELEMENT_FAST(c, off)

References codebook_decode_start(), FL_NOEXCEPT, FL_STBV_CODEBOOK_ELEMENT_BASE, FL_STBV_CODEBOOK_ELEMENT_FAST, fl::step(), and z.

Referenced by residue_decode().

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