Commit Graph

131 Commits

Author SHA1 Message Date
Henrik Rydgård c61595596e Rename mp3Map to g_mp3Map 2025-07-20 19:32:05 +02:00
Henrik Rydgård 52a7709fb5 Log cleanup. Fix very minor memory leak 2025-04-14 22:38:22 +02:00
Henrik Rydgård 3d8233b7f8 Some sceAudiocodec MP3 work. Not yet working in Beats (trying to DisableHLE of sceMp3). 2025-04-07 10:27:53 +02:00
Henrik Rydgård 291e5ef1c6 Move sceMp3 error codes to the big enum 2025-04-03 21:15:09 +02:00
Henrik Rydgård 77e1c9dd69 Work on audiocodec 2025-04-02 13:30:34 +02:00
Henrik Rydgård 4e25f44eef Rename some module-related functions to include HLE where appropriate 2025-03-31 11:17:50 +02:00
Henrik Rydgård 0f840e6240 Move JPEG error codes to the big enum, some include cleanup 2025-03-21 20:44:46 +01:00
Henrik Rydgård 28b2c7f540 HLE log rename part 1: Remove duplicate log functions. Return type should be determined by metadata. 2025-01-29 09:45:39 +01:00
Henrik Rydgård e8be4bbaae Improve code generation for HLE debug logging
Should shrink code size a bit, not expecting much performance change.

This avoids emitting a DoLog call when MAX_LOGLEVEL excludes the log statement,
just like for regular logs.
2025-01-28 17:04:20 +01:00
Henrik Rydgård 2523690584 Flip around so sceDelayResult is always outermost. Start using HLECall. 2025-01-20 12:20:18 +01:00
Henrik Rydgård 2a05dce105 Show sceMp3 in audio codecs window 2024-11-27 10:35:11 +01:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Henrik Rydgård 1b366afa35 Refactor: Change *outBytes to *outSamples in AudioDecoder::Decode. 2024-04-16 15:31:11 +02:00
Henrik Rydgård d402068745 Fix mono output from Atrac decoders. (sceAtrac*MOut* functions) 2024-04-15 11:50:32 +02:00
Henrik Rydgård 5ed77b58ca Improve the AudioDecoder API to avoid having to call a function to get the bytes consumed 2024-04-11 16:49:00 +02:00
Henrik Rydgård 3de85c8d14 Remove more unnecessary accessors 2024-04-11 14:18:07 +02:00
Henrik Rydgård 1938d3b876 More prep for plugging in alternate audio decoders 2024-04-10 12:14:58 +02:00
Henrik Rydgård 32ca7ab59a Minor code cleanups 2024-04-10 12:07:03 +02:00
Henrik Rydgård ddbe0e853b Remove unused code 2024-04-10 00:40:16 +02:00
Henrik Rydgård e19e9b2793 Delete pointless accessors, update some comments 2024-04-10 00:35:48 +02:00
Henrik Rydgård e6403d7157 Split GetPointer into two versions, to help with const correctness 2022-07-24 13:26:19 +02:00
Unknown W. Brackets 864d0200fb Mp3: Delay low level init. 2022-01-27 00:24:10 -08:00
Unknown W. Brackets 914d022eef Mp3: Allow decode with NULL out pointer. 2022-01-27 00:22:44 -08:00
Unknown W. Brackets 4903e14aae Mp3: Cleanup AuCtx constructor. 2022-01-27 00:22:43 -08:00
Unknown W. Brackets f7740edc6d Debugger: Add more metadata for memory usage. 2021-02-15 15:01:21 -08:00
Unknown W. Brackets 8a437b267e Mp3: Correct logging for init. 2021-01-27 07:07:14 -08:00
Unknown W. Brackets 4b4be0f34f Mp3: Always keep sample rate from original mp3.
Our codec context is updated with the source sample rate, so this makes us
not resample at all.

Converting to stereo still seems correct.
2021-01-26 23:50:54 -08:00
Unknown W. Brackets 463fc3c792 Mp3: Allow decode without pcm pointer.
Just like other audio decoding, you're allowed to skip audio.
Also prevents a crash if the mp3 is not yet inited.
2021-01-25 23:51:55 -08:00
Unknown W. Brackets de5488d4df Mp3: Correct error handling for newer sdk versions.
The 6.xx behavior might be important if a game relies on it to add data.
2021-01-25 20:57:34 -08:00
sum2012 e7e36ca21a Add header information 2021-01-25 20:27:56 +08:00
sum2012 72cc39f929 sceMp3Init:Add layerBits and versionBits information 2021-01-25 20:14:02 +08:00
sum2012 25a09288e9 Resample only in 32000Hz 2021-01-24 04:51:26 +08:00
sum2012 8a1b0bd210 build fix 2021-01-23 21:51:18 +08:00
sum2012 64a51e1658 Resample all mp3
Fix #5213
2021-01-22 21:12:07 +08:00
Unknown W. Brackets b8342fb8ec SaveState: Rename ChunkFile files to Serialize.
Makes more sense and less weird than ChunkFileDoMap, etc.
2020-08-10 08:04:05 +00:00
Unknown W. Brackets 1dc5ee424b SaveState: Split out Do types to reduce headers. 2020-08-10 08:03:44 +00:00
Unknown W. Brackets 4b4e3432cd SaveState: Split Do() into a separate header. 2020-08-10 08:03:41 +00:00
Henrik Rydgård ff65b813d9 Assorted warning fixes 2019-05-10 23:26:34 +02:00
Unknown W. Brackets 848108c6ab Mp3: Set as inited only after success. 2019-04-29 04:47:59 -07:00
Unknown W. Brackets 4ee5d2b611 Mp3: Correct seek to specific frame.
Before, it treated it as an (incomplete) seek to a byte position, which
didn't make much sense.  This matches PSP behavior per tests.
2019-04-29 04:47:59 -07:00
Unknown W. Brackets 68d2571681 Mp3: Fix ID3 tag handling.
Just ignore them and handle via frame sync, which is what the PSP does..
2019-04-29 04:47:59 -07:00
Unknown W. Brackets bfa9aa009d Mp3: Properly flush the buffer on reset. 2019-04-29 04:47:59 -07:00
Unknown W. Brackets 925e4d1343 Mp3: Correct delay on decode. 2019-04-28 08:44:46 -07:00
Unknown W. Brackets ac43e55194 Mp3: Loop correctly from an offset.
If the offset points to an ID3 tag or the middle of a frame, that's fine -
it should just search forward to the next sync.  FFmpeg just returns a
decode error, so we do this first.
2019-04-28 08:35:35 -07:00
Unknown W. Brackets a3640f303b Mp3: Correct sum decoded sample count.
It shouldn't consider both channels of stereo.  This could've been causing
some games to think they were playing audio at an incorrect speed.
2019-04-28 07:30:56 -07:00
Unknown W. Brackets bc1e6e12f5 Mp3: Return total frame count in sceMp3GetFrameNum.
This might fix games failing to play mp3s correctly.
2019-04-28 07:10:26 -07:00
Unknown W. Brackets 95d3d99343 Mp3: Fix loop func errors, clamp to -1.
Might matter if some game is checking the result.
2019-04-28 06:36:48 -07:00
Unknown W. Brackets 0d6570e8ad Mp3: Correct sceMp3GetMaxOutputSample.
Was based on output buffer size, rather than frame size, before.

Fixes choppy audio in Velocity.
2019-04-24 14:31:12 -07:00
Unknown W. Brackets be6710ea4a Mp3: Fix errors for a bunch of init getters. 2019-04-24 14:13:46 -07:00
Unknown W. Brackets 5f82258fa1 Mp3: Detect offset headers, reject invalid data.
ID3 handling not really tested.  Left some error codes disabled in case
people are happily playing some custom BGM that the PSP didn't support.
2019-04-24 09:16:21 -07:00