Reworked ADPCM decoder to allow better streaming

This commit is contained in:
David Marcec 2020-08-14 21:04:28 +10:00
parent 0947f613b1
commit 1b3d86c02f
2 changed files with 92 additions and 30 deletions

View file

@ -85,6 +85,13 @@ struct BehaviorFlags {
};
static_assert(sizeof(BehaviorFlags) == 0x4, "BehaviorFlags is an invalid size");
struct ADPCMContext {
u16 header{};
s16 yn1{};
s16 yn2{};
};
static_assert(sizeof(ADPCMContext) == 0x6, "ADPCMContext is an invalid size");
struct VoiceState {
s64 played_sample_count{};
s32 offset{};
@ -95,7 +102,7 @@ struct VoiceState {
s32 fraction{};
VAddr context_address{};
Codec::ADPCM_Coeff coeff{};
Codec::ADPCMState context{};
ADPCMContext context{};
std::array<s64, 2> biquad_filter_state{};
std::array<s32, AudioCommon::MAX_MIX_BUFFERS> previous_samples{};
u32 external_context_size{};