ajm_at9: Return superframes decoded in a single job
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled

This commit is contained in:
IndecisiveTurtle 2024-10-28 01:04:08 +02:00
parent 18c883d8b2
commit 58afb5090f
2 changed files with 7 additions and 4 deletions

View file

@ -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;

View file

@ -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