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

◆ convert_channels_short_interleaved()

static void fl::third_party::vorbis::convert_channels_short_interleaved ( int32_t buf_c,
short * buffer,
int32_t data_c,
float ** data,
int32_t d_offset,
int32_t len )
static

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

5036{
5037 int32_t i;
5039 if (buf_c != data_c && buf_c <= 2 && data_c <= 6) {
5040 FL_ASSERT(buf_c == 2, "buf_c must be 2");
5041 for (i=0; i < buf_c; ++i)
5042 compute_stereo_samples(buffer, data_c, data, d_offset, len);
5043 } else {
5044 int32_t limit = buf_c < data_c ? buf_c : data_c;
5045 int32_t j;
5046 for (j=0; j < len; ++j) {
5047 for (i=0; i < limit; ++i) {
5048 FL_STBV_FASTDEF(temp);
5049 float f = data[i][d_offset+j];
5050 int32_t v = FL_STBV_FAST_SCALED_FLOAT_TO_INT(temp, f,15);//data[i][d_offset+j],15);
5051 if ((uint32_t) (v + 32768) > 65535)
5052 v = v < 0 ? -32768 : 32767;
5053 *buffer++ = v;
5054 }
5055 for ( ; i < buf_c; ++i)
5056 *buffer++ = 0;
5057 }
5058 }
5059}
#define FL_ASSERT(x, MSG)
Definition assert.h:6
static void compute_stereo_samples(short *output, int32_t num_c, float **data, int32_t d_offset, int32_t len) FL_NOEXCEPT
fl::u32 uint32_t
Definition coder.h:219
fl::i32 int32_t
Definition coder.h:220
#define FL_STBV_FAST_SCALED_FLOAT_TO_INT(temp, x, s)
#define FL_STBV_FASTDEF(x)
#define fl_stbv_check_endianness()

References compute_stereo_samples(), FL_ASSERT, FL_NOEXCEPT, fl_stbv_check_endianness, FL_STBV_FAST_SCALED_FLOAT_TO_INT, and FL_STBV_FASTDEF.

Referenced by stb_vorbis_get_frame_short_interleaved(), and stb_vorbis_get_samples_short_interleaved().

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