Commit Graph
61 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 c162eb3d74 sceAudiocodec: Match hardware setup, framing, errors and timing; fix Atrac3 polarity
Checked against pspautotests audio/audiocodec, recorded on a PSP.

- Atrac3+: at3Related selects headered (mpeg.prx) or raw (libatrac3plus)
  frames, instead of sniffing for the sync word. The header's size field
  is 10 bits, as the context's. Header errors 0x211/0x213, bad frames
  0x20a, all returning SCE_AVCODEC_ERROR_INVALID_DATA with nothing read.
- The first successfully decoded Atrac3+ frame, and the first two AAC
  frames, produce no output. Checked sample-for-sample against hardware.
- Atrac3: the parameter at 0x28 selects the frame layout, as
  libatrac3plus.prx's table maps it. We used to read its low bit as a
  joint-stereo flag, which decoded mono (0x0F) streams as stereo garbage.
  AtracCtx2 had the table's fields swapped the same way.
- at3_standalone's Atrac3 output was inverted relative to the PSP's
  (sceAtrac too). Negate the IMDCT scale.
- CheckNeedMem sizes (AAC is 0x658c), codec 0x1004/0x1005, Init
  validation (AAC sample rate, Atrac3 parameter, Atrac3+ channels), and
  ReleaseEDRAM clearing edramAddr.
- Every call that reaches the ME now blocks for its measured time, and
  decode time is modelled per codec and frame size.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-28 16:57:41 -06:00
Henrik Rydgård ebc151f8f2 Warning fixes 2026-08-11 22:36:47 +02:00
Henrik Rydgård 651a972019 More sceAudioCodec implementation work. Atrac3+ partially works now. 2025-04-02 17:26:59 +02:00
Henrik Rydgård 569f6effa8 at3_standalone: Make all allocations aligned.
Replace av_realloc with regular realloc, as there's no aligned_realloc
and pointers are not compatible with regular free.
2025-03-26 18:03:13 +01:00
Henrik Rydgård 4ea7f46f81 Atrac3+: Try to work around Code Lyoko issue
Now we don't generate an error code when the channel configuration doesn't match the packets.

See the code comment for what I've been able to figure out so far.

See issue #19994
2025-02-19 12:46:25 -06:00
Henrik Rydgård d04074a542 Atrac3 (not +): Keep decoding even on broken frames.
Fixes some music in some unofficial game mods, whose music got broken
in 1.18. Was reported through e-mail by Miguel.
2025-01-04 01:11:26 +01:00
Henrik Rydgård 083543cc14 Unrelated logging improvement 2025-01-03 21:14:22 +01:00
Henrik Rydgård d5bfc1b5eb Finish up this cleanup (move _M_SSE compat define out of Common.h) 2024-12-19 16:23:20 +01:00
Henrik Rydgård ea3a4ed526 Minor optimization 2024-09-10 17:42:52 +02:00
Henrik Rydgård e263283bd3 compat.h cleanup 2024-09-10 15:23:53 +02: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 fe91f246b2 Bump a few minimum-cmake-version statements 2024-05-20 10:04:11 +02:00
Henrik Rydgård 090d1f8d0e atrac3: Add a cross platform restrict modifier, use it for the vector math functions
Also remove redundant parameters.

There are a bunch of other places where we could use this, so just
experimenting here.

This enables autovectorization to work here.
2024-05-02 16:57:15 +02:00
Henrik Rydgård 5536ca4fda Remove more unused code 2024-05-01 12:28:39 +02:00
Henrik Rydgård a93bbf39ba Remove sinewin.cpp/h 2024-05-01 12:28:39 +02:00
Henrik Rydgård b6b869ddee Remove float_dsp.cpp, inline the functions 2024-05-01 12:28:39 +02:00
Henrik Rydgård c6502155ab Delete mathematics.cpp/h 2024-05-01 12:28:39 +02:00
Henrik Rydgård 50bb07a6f5 Minor optimization 2024-05-01 12:28:39 +02:00
Henrik Rydgård e010f8fcc3 Remove generated code for very large FFTs (unused) 2024-05-01 12:28:39 +02:00
Henrik Rydgård 9745fa813f Delete some unused code 2024-05-01 12:28:39 +02:00
Henrik Rydgård 93c32e1e8d Add missing include to get_bits.h 2024-05-01 12:28:39 +02:00
Henrik Rydgård fd315a324a Help the compiler out slightly (it can't see that the pos is constant) 2024-04-13 10:46:44 +02:00
Henrik Rydgård 857584532f Add NEON code too for the atrac3 hotspot 2024-04-13 10:37:38 +02:00
Henrik Rydgård 7b6b7ebe3c Add some SSE code for an atrac hotspot just for fun, remove function pointers 2024-04-13 10:37:35 +02:00
Henrik Rydgård 52111103b8 Simplify the inner loop of ff_atrac3p_ipqf (prepare for SIMD) 2024-04-13 10:35:42 +02:00
Henrik Rydgård 68c192b892 Fix some symbol clashes apparently affecting the docker build 2024-04-13 01:06:18 +02:00
Henrik Rydgård 3409db9b90 Remove line endings from atrac3+ log strings 2024-04-12 13:53:20 +02:00
Henrik Rydgård 6f11b7fe6c Reorder fields in struct VLCcode for less memory use 2024-04-12 13:53:19 +02:00
Henrik Rydgård 88a00f62b9 Fix or supress some warnings 2024-04-12 13:53:19 +02:00
Henrik Rydgård 70a13a4df5 Implement logging for at3_standalone 2024-04-12 11:18:26 +02:00
Henrik Rydgård 39b884cfb3 Atrac3/3+: Improve error handling 2024-04-12 11:18:26 +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 45936e8826 Atrac: Add "flush_buffers" api. The ffmpeg atrac decoder was missing this. 2024-04-11 16:35:27 +02:00
Henrik Rydgård 58cb2ba804 Fix playback of atrac3+ when block align not specified 2024-04-11 16:10:31 +02:00
Henrik Rydgård d4023fb894 Buildfixes
Buildfix

UWP buildfix

libretro buildfix
2024-04-11 16:10:27 +02:00
Henrik Rydgård 6ee008af72 Warning fix, rename some variables to avoid clashes with actual ffmpeg 2024-04-11 14:50:32 +02:00
Henrik Rydgård b35b351802 Finally remove the AVCodecContext 2024-04-11 14:50:29 +02:00
Henrik Rydgård 6ea8efc0e9 Bypass AvCodecContext for atrac3plus, for a simpler API. 2024-04-11 14:39:59 +02:00
Henrik Rydgård 843119411f Stop passing around the AVCodecContext pointer so much 2024-04-11 14:39:59 +02:00
Henrik Rydgård 416ba81d20 Remove the channel_layout stuff 2024-04-11 14:39:59 +02:00
Henrik Rydgård e871133fe6 Buildfixes 2024-04-11 14:39:59 +02:00
Henrik Rydgård 8d89a7cfed Delete more unused stuff 2024-04-11 14:39:59 +02:00
Henrik Rydgård ae87aa4537 Initial CMake/Android.mk support 2024-04-11 14:39:59 +02:00
Henrik Rydgård 0d30728832 Remove context parameter from av_log 2024-04-11 14:39:59 +02:00
Henrik Rydgård e10b90b718 Switch at3_standalone to C++ to avoid namespace clashes 2024-04-11 14:39:59 +02:00
Henrik Rydgård 91df8ebfda FFT cleanup 2024-04-11 14:39:59 +02:00
Henrik Rydgård bbb563cc82 More header cleanup 2024-04-11 14:39:59 +02:00
Henrik Rydgård 9c32761a0a Remove fdsp context 2024-04-11 14:39:59 +02:00
Henrik Rydgård 27e28a5952 Remove samplefmt 2024-04-11 14:39:59 +02:00
Henrik Rydgård 202886f750 Delete attributes.h/compat.h, more 2024-04-11 14:39:59 +02:00