diff --git a/Source/Core/Core/HW/DVDInterface.cpp b/Source/Core/Core/HW/DVDInterface.cpp index 1aaeb8ce46..46219fb606 100644 --- a/Source/Core/Core/HW/DVDInterface.cpp +++ b/Source/Core/Core/HW/DVDInterface.cpp @@ -375,15 +375,15 @@ static u32 ProcessDTKSamples(short *tempPCM, u32 num_samples) break; } - NGCADPCM::InitFilter(); + StreamADPCM::InitFilter(); } - u8 tempADPCM[NGCADPCM::ONE_BLOCK_SIZE]; + u8 tempADPCM[StreamADPCM::ONE_BLOCK_SIZE]; // TODO: What if we can't read from AudioPos? s_inserted_volume->Read(AudioPos, sizeof(tempADPCM), tempADPCM, false); AudioPos += sizeof(tempADPCM); - NGCADPCM::DecodeBlock(tempPCM + samples_processed * 2, tempADPCM); - samples_processed += NGCADPCM::SAMPLES_PER_BLOCK; + StreamADPCM::DecodeBlock(tempPCM + samples_processed * 2, tempADPCM); + samples_processed += StreamADPCM::SAMPLES_PER_BLOCK; } while (samples_processed < num_samples); for (unsigned i = 0; i < samples_processed * 2; ++i) { @@ -1184,7 +1184,7 @@ void ExecuteCommand(u32 command_0, u32 command_1, u32 command_2, u32 output_addr CurrentStart = NextStart; CurrentLength = NextLength; AudioPos = CurrentStart; - NGCADPCM::InitFilter(); + StreamADPCM::InitFilter(); g_bStream = true; } } diff --git a/Source/Core/Core/HW/StreamADPCM.cpp b/Source/Core/Core/HW/StreamADPCM.cpp index 2d1175bc67..d3ea3d7e1b 100644 --- a/Source/Core/Core/HW/StreamADPCM.cpp +++ b/Source/Core/Core/HW/StreamADPCM.cpp @@ -7,6 +7,9 @@ #include "Common/MathUtil.h" #include "Core/HW/StreamADPCM.h" +namespace StreamADPCM +{ + // STATE_TO_SAVE (not saved yet!) static s32 histl1; static s32 histl2; @@ -44,7 +47,7 @@ static s16 ADPDecodeSample(s32 bits, s32 q, s32& hist1, s32& hist2) return (s16)cur; } -void NGCADPCM::InitFilter() +void InitFilter() { histl1 = 0; histl2 = 0; @@ -52,7 +55,7 @@ void NGCADPCM::InitFilter() histr2 = 0; } -void NGCADPCM::DecodeBlock(s16 *pcm, const u8 *adpcm) +void DecodeBlock(s16* pcm, const u8* adpcm) { for (int i = 0; i < SAMPLES_PER_BLOCK; i++) { @@ -60,3 +63,5 @@ void NGCADPCM::DecodeBlock(s16 *pcm, const u8 *adpcm) pcm[i * 2 + 1] = ADPDecodeSample(adpcm[i + (ONE_BLOCK_SIZE - SAMPLES_PER_BLOCK)] >> 4, adpcm[1], histr1, histr2); } } + +} diff --git a/Source/Core/Core/HW/StreamADPCM.h b/Source/Core/Core/HW/StreamADPCM.h index b938c0dd95..11577b8693 100644 --- a/Source/Core/Core/HW/StreamADPCM.h +++ b/Source/Core/Core/HW/StreamADPCM.h @@ -8,15 +8,16 @@ #include "Common/CommonTypes.h" -class NGCADPCM +namespace StreamADPCM { -public: - enum - { - ONE_BLOCK_SIZE = 32, - SAMPLES_PER_BLOCK = 28 - }; - static void InitFilter(); - static void DecodeBlock(s16 *pcm, const u8 *adpcm); +enum +{ + ONE_BLOCK_SIZE = 32, + SAMPLES_PER_BLOCK = 28 }; + +void InitFilter(); +void DecodeBlock(s16* pcm, const u8* adpcm); + +}