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

◆ do_floor()

static int32_t fl::third_party::vorbis::do_floor ( vorb * f,
Mapping * map,
int32_t i,
int32_t n,
float * target,
YTYPE * finalY,
uint8 * step2_flag )
static

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

2803{
2804 int32_t n2 = n >> 1;
2805 int32_t s = map->chan[i].mux, floor;
2806 floor = map->submap_floor[s];
2807 if (f->floor_types[floor] == 0) {
2808 return error(f, VORBIS_invalid_stream);
2809 } else {
2810 Floor1 *g = &f->floor_config[floor].floor1;
2811 int32_t j,q;
2812 int32_t lx = 0, ly = finalY[0] * g->floor1_multiplier;
2813 for (q=1; q < g->values; ++q) {
2814 j = g->sorted_order[q];
2815 #ifndef FL_STB_VORBIS_NO_DEFER_FLOOR
2816 FL_UNUSED(step2_flag);
2817 if (finalY[j] >= 0)
2818 #else
2819 if (step2_flag[j])
2820 #endif
2821 {
2822 int32_t hy = finalY[j] * g->floor1_multiplier;
2823 int32_t hx = g->Xlist[j];
2824 if (lx != hx)
2825 draw_line(target, lx,ly, hx,hy, n2);
2826 FL_STBV_CHECK(f);
2827 lx = hx, ly = hy;
2828 }
2829 }
2830 if (lx < n2) {
2831 // optimization of: draw_line(target, lx,ly, n,ly, n2);
2832 for (j=lx; j < n2; ++j)
2833 FL_STBV_LINE_OP(target[j], inverse_db_table[ly]);
2834 FL_STBV_CHECK(f);
2835 }
2836 }
2837 return true;
2838}
static int32_t error(vorb *f, enum STBVorbisError e) FL_NOEXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type floor(T x) FL_NOEXCEPT
FL_ALWAYS_INLINE void draw_line(float *output, int32_t x0, int32_t y0, int32_t x1, int32_t y1, int32_t n) FL_NOEXCEPT
static float inverse_db_table[256]
fl::i32 int32_t
Definition coder.h:220
MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > > map
Definition map.h:283
constexpr enable_if< is_fixed_point< T >::value, T >::type floor(T x) FL_NOEXCEPT
#define FL_UNUSED(x)
#define FL_STBV_LINE_OP(a, b)
#define FL_STBV_CHECK(f)

References draw_line(), error(), FL_NOEXCEPT, FL_STBV_CHECK, FL_STBV_LINE_OP, FL_UNUSED, floor(), fl::third_party::vorbis::Floor1::floor1_multiplier, inverse_db_table, fl::third_party::vorbis::Floor1::sorted_order, fl::third_party::vorbis::Floor1::values, VORBIS_invalid_stream, and fl::third_party::vorbis::Floor1::Xlist.

Referenced by vorbis_decode_packet_rest().

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