2024-04-10 16:26:09 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
2024-04-13 07:40:16 +00:00
|
|
|
// Notes
|
|
|
|
//
|
|
|
|
// Performance-wise, these are OK.
|
|
|
|
// For Atrac3+, the bottleneck is two functions: decode_qu_spectra and ff_atrac3p_ipqf. At least the latter is quite SIMD-able.
|
|
|
|
|
2024-04-11 11:34:29 +00:00
|
|
|
// The full external API for the standalone Atrac3/3+ decoder.
|
2024-04-10 16:26:09 +00:00
|
|
|
|
2024-04-11 11:34:29 +00:00
|
|
|
struct ATRAC3Context;
|
|
|
|
struct ATRAC3PContext;
|
2024-04-10 16:26:09 +00:00
|
|
|
|
2024-04-11 14:04:22 +00:00
|
|
|
// If the block_align passed in is 0, tries to audio detect.
|
2024-04-11 14:35:27 +00:00
|
|
|
// flush_buffers should be called when seeking before the next decode_frame.
|
2024-04-11 14:04:22 +00:00
|
|
|
|
|
|
|
ATRAC3Context *atrac3_alloc(int channels, int *block_align, const uint8_t *extra_data, int extra_data_size);
|
2024-04-11 11:34:29 +00:00
|
|
|
void atrac3_free(ATRAC3Context *ctx);
|
2024-04-11 14:35:27 +00:00
|
|
|
void atrac3_flush_buffers(ATRAC3Context *ctx);
|
2024-04-11 15:25:36 +00:00
|
|
|
int atrac3_decode_frame(ATRAC3Context *ctx, float *out_data[2], int *nb_samples, const uint8_t *buf, int buf_size);
|
2024-04-11 11:11:55 +00:00
|
|
|
|
2024-04-11 14:04:22 +00:00
|
|
|
ATRAC3PContext *atrac3p_alloc(int channels, int *block_align);
|
2024-04-11 11:11:55 +00:00
|
|
|
void atrac3p_free(ATRAC3PContext *ctx);
|
2024-04-11 14:35:27 +00:00
|
|
|
void atrac3p_flush_buffers(ATRAC3PContext *ctx);
|
2024-04-11 15:25:36 +00:00
|
|
|
int atrac3p_decode_frame(ATRAC3PContext *ctx, float *out_data[2], int *nb_samples, const uint8_t *buf, int buf_size);
|