64inline fl::u32
fnv1a(fl::u32 hash,
const fl::i16* samples, fl::u32 count) {
65 for (fl::u32 i = 0; i < count; ++i) {
66 const fl::u16 v = (fl::u16)samples[i];
67 hash = (hash ^ (
fl::u8)(v & 0xFF)) * 16777619u;
68 hash = (hash ^ (
fl::u8)(v >> 8)) * 16777619u;
75inline fl::u32
fnv1a_mix(fl::u32 hash, fl::u32 value) {
76 for (
int byte = 0;
byte < 4; ++
byte) {
77 hash = (hash ^ (
fl::u8)((value >> (
byte * 8)) & 0xFF)) * 16777619u;
99 fl::third_party::mp3dec_scratch_t* scratch,
102 out.
fnv1a = 2166136261u;
111 fl::third_party::mp3dec_frame_info_t info;
113 const int samples = fl::third_party::mp3dec_decode_frame_r(
116 if (info.frame_bytes <= 0) {
119 offset += (fl::u32)info.frame_bytes;
121 const fl::u32 count = (fl::u32)samples * (fl::u32)info.channels;
125 out.
hz = (fl::u32)info.hz;
126 out.
channels = (fl::u32)info.channels;
127 out.
layer = (fl::u32)info.layer;
134 fl::u32 actual_hash, fl::u32 expected_samples,
135 fl::u32 actual_samples) {
151 r.
scratch_bytes = (fl::u32)
sizeof(fl::third_party::mp3dec_scratch_t);
163 if (!dec || !scratch || !pcm) {
169 const fl::u32 started = (fl::u32)micros();
170 fl::u32 audio_us = 0;
176 fl::third_party::mp3dec_init(dec.get());
184 audio_us += (fl::u32)(((fl::u64)per_channel * 1000000ull) / s.
hz);
196 const fl::u32 verify_started = (fl::u32)micros();
204 fl::third_party::mp3dec_init(dec.get());
Expected MP3 decodes for the on-device codec check.
pointer get() const FL_NO_EXCEPT
fl::UISlider offset("Offset", 0.0f, 0.0f, 1.0f, 0.01f)
void recordFailure(Result &r, const char *name, fl::u32 expected_hash, fl::u32 actual_hash, fl::u32 expected_samples, fl::u32 actual_samples)
fl::u32 fnv1a(fl::u32 hash, const fl::i16 *samples, fl::u32 count)
fl::u32 fnv1a_mix(fl::u32 hash, fl::u32 value)
Fold one stream's checksum into the run-wide one, so a single reported value covers every stream in o...
Decoded decodeStream(fl::third_party::mp3dec_t *dec, fl::third_party::mp3dec_scratch_t *scratch, fl::i16 *pcm, const mp3_fixture::Stream &stream)
Decode one stream.
const char * first_failure
bool shared_decoder_matched
const fl::u32 kStreamCount
fl::enable_if<!fl::is_array< T >::value, unique_ptr< T > >::type make_unique(Args &&... args) FL_NO_EXCEPT
void * memset(void *s, int c, size_t n) FL_NO_EXCEPT