TAD: bringing coeff weight back

This commit is contained in:
minjaesong
2025-10-29 01:47:14 +09:00
parent 86864c4b7a
commit f06f339d99
4 changed files with 93 additions and 99 deletions

View File

@@ -22,13 +22,15 @@
/**
* Encode audio chunk with TAD32 codec (PCM32f version)
*
* @param pcm32_stereo Input PCM32fLE stereo samples (interleaved L,R)
* @param num_samples Number of samples per channel (min 1024)
* @param quant_bits Quantization bits 4-12 (default: 7)
* @param use_zstd 1=enable Zstd compression, 0=disable
* @param use_twobitmap 1=enable twobitmap encoding, 0=raw int8_t storage
* @param output Output buffer (must be large enough)
* @return Number of bytes written to output, or 0 on error
* @param pcm32_stereo Input PCM32fLE stereo samples (interleaved L,R)
* @param num_samples Number of samples per channel (min 1024)
* @param quant_bits Quantization bits 4-12 (default: 7)
* @param use_zstd 1=enable Zstd compression, 0=disable
* @param use_twobitmap 1=enable twobitmap encoding, 0=raw int8_t storage
* @param quantiser_scale Quantiser scaling factor (1.0=baseline, 2.0=2x coarser quantization)
* Higher values = more aggressive quantization = smaller files
* @param output Output buffer (must be large enough)
* @return Number of bytes written to output, or 0 on error
*
* Output format:
* uint16 sample_count (samples per channel)
@@ -37,7 +39,8 @@
* * payload (encoded M/S data, optionally Zstd-compressed)
*/
size_t tad32_encode_chunk(const float *pcm32_stereo, size_t num_samples,
int quant_bits, int use_zstd, int use_twobitmap, uint8_t *output);
int quant_bits, int use_zstd, int use_twobitmap,
float quantiser_scale, uint8_t *output);
/**
* Print accumulated coefficient statistics