2911{
2915 int32_t really_zero_channel[256];
2916
2917
2918
2922
2923
2924 n2 = n >> 1;
2925
2927
2930 zero_channel[i] = false;
2934 } else {
2937 short *finalY;
2938 uint8 step2_flag[256];
2939 static int32_t range_list[4] = { 256, 128, 86, 64 };
2940 int32_t range = range_list[g->floor1_multiplier-1];
2945 for (j=0; j < g->partitions; ++j) {
2946 int32_t pclass = g->partition_class_list[j];
2947 int32_t cdim = g->class_dimensions[pclass];
2948 int32_t cbits = g->class_subclasses[pclass];
2949 int32_t csub = (1 << cbits)-1;
2951 if (cbits) {
2952 Codebook *c = f->
codebooks + g->class_masterbooks[pclass];
2954 }
2955 for (k=0; k < cdim; ++k) {
2956 int32_t book = g->subclass_books[pclass][cval & csub];
2957 cval = cval >> cbits;
2958 if (book >= 0) {
2963 } else
2965 }
2966 }
2968 step2_flag[0] = step2_flag[1] = 1;
2969 for (j=2; j < g->values; ++j) {
2970 int32_t low, high, pred, highroom, lowroom, room, val;
2971 low = g->neighbors[j][0];
2972 high = g->neighbors[j][1];
2973
2974 pred =
predict_point(g->Xlist[j], g->Xlist[low], g->Xlist[high], finalY[low], finalY[high]);
2975 val = finalY[j];
2976 highroom = range - pred;
2977 lowroom = pred;
2978 if (highroom < lowroom)
2979 room = highroom * 2;
2980 else
2981 room = lowroom * 2;
2982 if (val) {
2983 step2_flag[low] = step2_flag[high] = 1;
2984 step2_flag[j] = 1;
2985 if (val >= room)
2986 if (highroom > lowroom)
2987 finalY[j] = val - lowroom + pred;
2988 else
2989 finalY[j] = pred - val + highroom - 1;
2990 else
2991 if (val & 1)
2992 finalY[j] = pred - ((val+1)>>1);
2993 else
2994 finalY[j] = pred + (val>>1);
2995 } else {
2996 step2_flag[j] = 0;
2997 finalY[j] = pred;
2998 }
2999 }
3000
3001#ifdef FL_STB_VORBIS_NO_DEFER_FLOOR
3002 do_floor(f,
map, i, n, f->floor_buffers[i], finalY, step2_flag);
3003#else
3004
3005 for (j=0; j < g->values; ++j) {
3006 if (!step2_flag[j])
3007 finalY[j] = -1;
3008 }
3009#endif
3010 } else {
3012 zero_channel[i] = true;
3013 }
3014
3015
3016
3017 }
3018 }
3020
3021
3024
3025
3026 memcpy(really_zero_channel, zero_channel,
sizeof(really_zero_channel[0]) * f->
channels);
3027 for (i=0; i <
map->coupling_steps; ++i)
3028 if (!zero_channel[
map->chan[i].magnitude] || !zero_channel[
map->chan[i].angle]) {
3029 zero_channel[
map->chan[i].magnitude] = zero_channel[
map->chan[i].angle] =
false;
3030 }
3031
3033
3034 for (i=0; i <
map->submaps; ++i) {
3037 uint8 do_not_decode[256];
3040 if (
map->chan[j].mux == i) {
3041 if (zero_channel[j]) {
3042 do_not_decode[ch] = true;
3043 residue_buffers[ch] = nullptr;
3044 } else {
3045 do_not_decode[ch] = false;
3047 }
3048 ++ch;
3049 }
3050 }
3051 r =
map->submap_residue[i];
3053 }
3054
3058
3059
3060 for (i =
map->coupling_steps-1; i >= 0; --i) {
3064 for (j=0; j < n2; ++j) {
3065 float a2,m2;
3066 if (m[j] > 0)
3067 if (a[j] > 0)
3068 m2 = m[j], a2 = m[j] - a[j];
3069 else
3070 a2 = m[j], m2 = m[j] + a[j];
3071 else
3072 if (a[j] > 0)
3073 m2 = m[j], a2 = m[j] + a[j];
3074 else
3075 a2 = m[j], m2 = m[j] - a[j];
3076 m[j] = m2;
3077 a[j] = a2;
3078 }
3079 }
3081
3082
3083#ifndef FL_STB_VORBIS_NO_DEFER_FLOOR
3085 if (really_zero_channel[i]) {
3087 } else {
3089 }
3090 }
3091#else
3093 if (really_zero_channel[i]) {
3095 } else {
3096 for (j=0; j < n2; ++j)
3098 }
3099 }
3100#endif
3101
3102
3107
3108
3109
3111
3113
3114
3115
3116
3118
3119
3126 left_start = right_start;
3127 *p_left = left_start;
3128 } else {
3130 *p_left = left_start;
3132 }
3134
3135
3136
3137
3138
3139
3140 }
3141
3142
3144
3147
3148 if (current_end < f->current_loc + (right_end-left_start)) {
3149 if (current_end < f->current_loc) {
3150
3151 *len = 0;
3152 } else {
3154 }
3155 *len += left_start;
3156 if (*len > right_end) *len = right_end;
3158 return true;
3159 }
3160 }
3161
3162
3163
3164
3167 }
3170
3173 *len = right_end;
3175
3176 return true;
3177}
#define FL_ASSERT(x, MSG)
fl::UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
void * memcpy(void *dest, const void *src, size_t n) FL_NOEXCEPT
static void flush_packet(vorb *f) FL_NOEXCEPT
static void inverse_mdct(float *buffer, int32_t n, vorb *f, int32_t blocktype) FL_NOEXCEPT
static int32_t ilog(int32 n) FL_NOEXCEPT
static constexpr int32_t INVALID_BITS
static int32_t predict_point(int32_t x, int32_t x0, int32_t x1, int32_t y0, int32_t y1) FL_NOEXCEPT
static int32_t do_floor(vorb *f, Mapping *map, int32_t i, int32_t n, float *target, YTYPE *finalY, uint8 *step2_flag) FL_NOEXCEPT
static int32_t error(vorb *f, enum STBVorbisError e) FL_NOEXCEPT
static constexpr uint8_t PAGEFLAG_last_page
void * memset(void *s, int c, size_t n) FL_NOEXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type floor(T x) FL_NOEXCEPT
static void decode_residue(vorb *f, float *residue_buffers[], int32_t ch, int32_t n, int32_t rn, uint8 *do_not_decode) FL_NOEXCEPT
static uint32 get_bits(vorb *f, int32_t n) FL_NOEXCEPT
int32_t alloc_buffer_length_in_bytes
int32_t discard_samples_deferred
int32_t current_loc_valid
uint32 known_loc_for_packet
int16 * finalY[FL_STB_VORBIS_MAX_CHANNELS]
float * channel_buffers[FL_STB_VORBIS_MAX_CHANNELS]
int32_t end_seg_with_known_loc
MapRedBlackTree< Key, T, Compare, fl::allocator_slab< char > > map
constexpr enable_if< is_fixed_point< T >::value, T >::type floor(T x) FL_NOEXCEPT
#define FL_STBV_DECODE(var, f, c)
#define FL_STB_VORBIS_MAX_CHANNELS