mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-04-20 19:44:46 +00:00
ajm_at9: Return superframes decoded in a single job
This commit is contained in:
parent
d41bb9c57c
commit
d0a7f59a13
2 changed files with 7 additions and 4 deletions
|
@ -449,9 +449,10 @@ int PS4_SYSV_ABI sceAjmBatchStartBuffer(u32 context, const u8* batch, u32 batch_
|
|||
const auto& in_buffer = input_run_buffers[i];
|
||||
const auto& out_buffer = output_run_buffers[i];
|
||||
|
||||
const auto [in_remain, out_remain, num_frames] = p_instance->Decode(
|
||||
reinterpret_cast<u8*>(in_buffer.p_address), in_buffer.header.size,
|
||||
reinterpret_cast<u8*>(out_buffer.p_address), out_buffer.header.size);
|
||||
const u8* in_address = reinterpret_cast<u8*>(in_buffer.p_address);
|
||||
u8* out_address = reinterpret_cast<u8*>(out_buffer.p_address);
|
||||
const auto [in_remain, out_remain, num_frames] = p_instance->Decode(in_address, in_buffer.header.size,
|
||||
out_address, out_buffer.header.size);
|
||||
|
||||
if (p_stream != nullptr) {
|
||||
p_stream->input_consumed += in_buffer.header.size - in_remain;
|
||||
|
|
|
@ -65,6 +65,7 @@ std::tuple<u32, u32, u32> AjmAt9Decoder::Decode(const u8* in_buf, u32 in_size, u
|
|||
Atrac9GetCodecInfo(handle, &codec_info);
|
||||
|
||||
int bytes_used = 0;
|
||||
int num_superframes = 0;
|
||||
|
||||
const auto ShouldDecode = [&] {
|
||||
if (in_size <= 0 || out_size <= 0) {
|
||||
|
@ -97,11 +98,12 @@ std::tuple<u32, u32, u32> AjmAt9Decoder::Decode(const u8* in_buf, u32 in_size, u
|
|||
in_buf += bytes_remain;
|
||||
in_size -= bytes_remain;
|
||||
bytes_remain = codec_info.superframeSize;
|
||||
num_superframes++;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_TRACE(Lib_Ajm, "Decoded {} samples, frame count: {}", decoded_samples, frame_index);
|
||||
return std::tuple(in_size, out_size, num_frames);
|
||||
return std::tuple(in_size, out_size, num_superframes);
|
||||
}
|
||||
|
||||
} // namespace Libraries::Ajm
|
||||
|
|
Loading…
Add table
Reference in a new issue