1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:37:46 +00:00

LibAudio+LibDSP: Switch samples to 32-bit float instead of 64-bit float

This has been overkill from the start, and it has been bugging me for a
long time. With this change, we're probably a bit slower on most
platforms but save huge amounts of space with all in-memory sample
datastructures.
This commit is contained in:
kleines Filmröllchen 2022-05-06 22:14:16 +02:00 committed by Linus Groh
parent 39c0f31009
commit 19a4b820c4
16 changed files with 329 additions and 329 deletions

View file

@ -47,17 +47,17 @@ private:
MaybeLoaderError read_side_information(MP3::MP3Frame&);
ErrorOr<size_t, LoaderError> read_scale_factors(MP3::MP3Frame&, InputBitStream& reservoir, size_t granule_index, size_t channel_index);
MaybeLoaderError read_huffman_data(MP3::MP3Frame&, InputBitStream& reservoir, size_t granule_index, size_t channel_index, size_t granule_bits_read);
static AK::Array<double, 576> calculate_frame_exponents(MP3::MP3Frame const&, size_t granule_index, size_t channel_index);
static AK::Array<float, 576> calculate_frame_exponents(MP3::MP3Frame const&, size_t granule_index, size_t channel_index);
static void reorder_samples(MP3::Granule&, u32 sample_rate);
static void reduce_alias(MP3::Granule&, size_t max_subband_index = 576);
static void process_stereo(MP3::MP3Frame&, size_t granule_index);
static void transform_samples_to_time(Array<double, 576> const& input, size_t input_offset, Array<double, 36>& output, MP3::BlockType block_type);
static void synthesis(Array<double, 1024>& V, Array<double, 32>& samples, Array<double, 32>& result);
static void transform_samples_to_time(Array<float, 576> const& input, size_t input_offset, Array<float, 36>& output, MP3::BlockType block_type);
static void synthesis(Array<float, 1024>& V, Array<float, 32>& samples, Array<float, 32>& result);
static Span<MP3::Tables::ScaleFactorBand const> get_scalefactor_bands(MP3::Granule const&, int samplerate);
AK::Vector<AK::Tuple<size_t, int>> m_seek_table;
AK::Array<AK::Array<AK::Array<double, 18>, 32>, 2> m_last_values {};
AK::Array<AK::Array<double, 1024>, 2> m_synthesis_buffer {};
AK::Array<AK::Array<AK::Array<float, 18>, 32>, 2> m_last_values {};
AK::Array<AK::Array<float, 1024>, 2> m_synthesis_buffer {};
static LibDSP::MDCT<36> s_mdct_36;
static LibDSP::MDCT<12> s_mdct_12;