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

◆ compute_samples()

static void fl::third_party::vorbis::compute_samples ( int32_t mask,
short * output,
int32_t num_c,
float ** data,
int32_t d_offset,
int32_t len )
static

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

4946{
4947 constexpr int32_t STB_BUFFER_SIZE = 32;
4948 float buffer[STB_BUFFER_SIZE];
4949 int32_t i,j,o,n = STB_BUFFER_SIZE;
4951 for (o = 0; o < len; o += STB_BUFFER_SIZE) {
4952 memset(buffer, 0, sizeof(buffer));
4953 if (o + n > len) n = len - o;
4954 for (j=0; j < num_c; ++j) {
4955 if (channel_position[num_c][j] & mask) {
4956 for (i=0; i < n; ++i)
4957 buffer[i] += data[j][d_offset+o+i];
4958 }
4959 }
4960 for (i=0; i < n; ++i) {
4961 FL_STBV_FASTDEF(temp);
4962 int32_t v = FL_STBV_FAST_SCALED_FLOAT_TO_INT(temp,buffer[i],15);
4963 if ((uint32_t) (v + 32768) > 65535)
4964 v = v < 0 ? -32768 : 32767;
4965 output[o+i] = v;
4966 }
4967 }
4968}
static int8 channel_position[7][6]
void * memset(void *s, int c, size_t n) FL_NOEXCEPT
fl::i32 int32_t
Definition coder.h:220
fl::u32 uint32_t
Definition s16x16x4.h:219
fl::i32 int32_t
Definition s16x16x4.h:220
#define FL_STBV_FAST_SCALED_FLOAT_TO_INT(temp, x, s)
#define FL_STBV_FASTDEF(x)
#define fl_stbv_check_endianness()

References channel_position, FL_NOEXCEPT, fl_stbv_check_endianness, FL_STBV_FAST_SCALED_FLOAT_TO_INT, FL_STBV_FASTDEF, and memset().

Referenced by convert_samples_short().

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