mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 08:22:32 +00:00
Add support for non-interleaved flag
This commit is contained in:
parent
c33c2b93f3
commit
f733ae8b86
2
externals/LibAtrac9
vendored
2
externals/LibAtrac9
vendored
@ -1 +1 @@
|
||||
Subproject commit a350a4b727b14ded8460649779b43d1ad902f373
|
||||
Subproject commit 3acdcdc78f129c2e6145331ff650fa76dd88d62c
|
@ -14,8 +14,8 @@ extern "C" {
|
||||
|
||||
namespace Libraries::Ajm {
|
||||
|
||||
AjmAt9Decoder::AjmAt9Decoder(AjmFormatEncoding format)
|
||||
: m_format(format), m_handle(Atrac9GetHandle()) {
|
||||
AjmAt9Decoder::AjmAt9Decoder(AjmFormatEncoding format, AjmAt9CodecFlags flags)
|
||||
: m_format(format), m_flags(flags), m_handle(Atrac9GetHandle()) {
|
||||
ASSERT_MSG(m_handle, "Atrac9GetHandle failed");
|
||||
AjmAt9Decoder::Reset();
|
||||
}
|
||||
@ -72,15 +72,16 @@ std::tuple<u32, u32> AjmAt9Decoder::ProcessData(std::span<u8>& in_buf, SparseOut
|
||||
switch (m_format) {
|
||||
case AjmFormatEncoding::S16:
|
||||
ret = Atrac9Decode(m_handle, in_buf.data(), reinterpret_cast<s16*>(m_pcm_buffer.data()),
|
||||
&bytes_used);
|
||||
&bytes_used, True(m_flags & AjmAt9CodecFlags::NonInterleavedOutput));
|
||||
break;
|
||||
case AjmFormatEncoding::S32:
|
||||
ret = Atrac9DecodeS32(m_handle, in_buf.data(), reinterpret_cast<s32*>(m_pcm_buffer.data()),
|
||||
&bytes_used);
|
||||
&bytes_used, True(m_flags & AjmAt9CodecFlags::NonInterleavedOutput));
|
||||
break;
|
||||
case AjmFormatEncoding::Float:
|
||||
ret = Atrac9DecodeF32(m_handle, in_buf.data(),
|
||||
reinterpret_cast<float*>(m_pcm_buffer.data()), &bytes_used);
|
||||
ret =
|
||||
Atrac9DecodeF32(m_handle, in_buf.data(), reinterpret_cast<float*>(m_pcm_buffer.data()),
|
||||
&bytes_used, True(m_flags & AjmAt9CodecFlags::NonInterleavedOutput));
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
|
@ -14,6 +14,12 @@ namespace Libraries::Ajm {
|
||||
|
||||
constexpr s32 ORBIS_AJM_DEC_AT9_MAX_CHANNELS = 8;
|
||||
|
||||
enum AjmAt9CodecFlags : u32 {
|
||||
ParseRiffHeader = 1 << 0,
|
||||
NonInterleavedOutput = 1 << 8,
|
||||
};
|
||||
DECLARE_ENUM_FLAG_OPERATORS(AjmAt9CodecFlags)
|
||||
|
||||
struct AjmSidebandDecAt9CodecInfo {
|
||||
u32 super_frame_size;
|
||||
u32 frames_in_super_frame;
|
||||
@ -22,7 +28,7 @@ struct AjmSidebandDecAt9CodecInfo {
|
||||
};
|
||||
|
||||
struct AjmAt9Decoder final : AjmCodec {
|
||||
explicit AjmAt9Decoder(AjmFormatEncoding format);
|
||||
explicit AjmAt9Decoder(AjmFormatEncoding format, AjmAt9CodecFlags flags);
|
||||
~AjmAt9Decoder() override;
|
||||
|
||||
void Reset() override;
|
||||
@ -45,6 +51,7 @@ private:
|
||||
}
|
||||
|
||||
const AjmFormatEncoding m_format;
|
||||
const AjmAt9CodecFlags m_flags;
|
||||
void* m_handle{};
|
||||
u8 m_config_data[ORBIS_AT9_CONFIG_DATA_SIZE]{};
|
||||
u32 m_superframe_bytes_remain{};
|
||||
|
@ -25,7 +25,8 @@ constexpr int ORBIS_AJM_RESULT_FATAL = 0x80000000;
|
||||
AjmInstance::AjmInstance(AjmCodecType codec_type, AjmInstanceFlags flags) : m_flags(flags) {
|
||||
switch (codec_type) {
|
||||
case AjmCodecType::At9Dec: {
|
||||
m_codec = std::make_unique<AjmAt9Decoder>(AjmFormatEncoding(flags.format));
|
||||
m_codec = std::make_unique<AjmAt9Decoder>(AjmFormatEncoding(flags.format),
|
||||
AjmAt9CodecFlags(flags.codec));
|
||||
break;
|
||||
}
|
||||
case AjmCodecType::Mp3Dec: {
|
||||
|
Loading…
Reference in New Issue
Block a user