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

◆ codebook_decode()

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

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

1524{
1526 if (z < 0) return false;
1527 if (len > c->dimensions) len = c->dimensions;
1528
1529#ifdef FL_STB_VORBIS_DIVIDES_IN_CODEBOOK
1530 if (c->lookup_type == 1) {
1531 float last = FL_STBV_CODEBOOK_ELEMENT_BASE(c);
1532 int32_t div = 1;
1533 for (i=0; i < len; ++i) {
1534 int32_t off = (z / div) % c->lookup_values;
1535 float val = FL_STBV_CODEBOOK_ELEMENT_FAST(c,off) + last;
1536 output[i] += val;
1537 if (c->sequence_p) last = val + c->minimum_value;
1538 div *= c->lookup_values;
1539 }
1540 return true;
1541 }
1542#endif
1543
1544 z *= c->dimensions;
1545 if (c->sequence_p) {
1546 float last = FL_STBV_CODEBOOK_ELEMENT_BASE(c);
1547 for (i=0; i < len; ++i) {
1548 float val = FL_STBV_CODEBOOK_ELEMENT_FAST(c,z+i) + last;
1549 output[i] += val;
1550 last = val + c->minimum_value;
1551 }
1552 } else {
1553 float last = FL_STBV_CODEBOOK_ELEMENT_BASE(c);
1554 for (i=0; i < len; ++i) {
1555 output[i] += FL_STBV_CODEBOOK_ELEMENT_FAST(c,z+i) + last;
1556 }
1557 }
1558
1559 return true;
1560}
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
#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, and z.

Referenced by residue_decode().

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