upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/opus_decoder/leonida_opus_decoder.h
diff options
context:
space:
mode:
authorJan Trencansky <jan.trencansky@protonmail.com>2026-11-26 15:05:45 -0500
committerJan Trencansky <jan.trencansky@protonmail.com>2026-11-26 15:05:45 -0500
commit595b1325d922ed05782fc5fd7d0baa5459eadef6 (patch)
tree856ff20ccc812f08a57a447178bd49f41eee30e9 /runtime/opus_decoder/leonida_opus_decoder.h
parent7a761696dcef8cb2415c3000dfc3c4196675263b (diff)
parentfac8b4bb903b6988bd616e8874e77fa026858ffb (diff)
Merge main (fac8b4bb9) into #2230: keep the device-bound dispatch limit and #2378's unfilled draw records
main's #2378 (a draw record of 2^23 vertices or more runs empty and charges nothing) changed indirect_clamp.comp next to this branch's dispatch bound. The .comp, vulkan_indirect_clamp.h and indirect_clamp_test.cpp merged without conflicts and keep both changes. The only conflict was the generated indirect_clamp_spv.h: it is regenerated from the merged indirect_clamp.comp as its header comment says (glslangValidator 16.6.0, -V --target-env vulkan1.2 -Os --spirv-val; spirv-val passes). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/opus_decoder/leonida_opus_decoder.h')
-rw-r--r--runtime/opus_decoder/leonida_opus_decoder.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/runtime/opus_decoder/leonida_opus_decoder.h b/runtime/opus_decoder/leonida_opus_decoder.h
new file mode 100644
index 000000000..d5473510d
--- /dev/null
+++ b/runtime/opus_decoder/leonida_opus_decoder.h
@@ -0,0 +1,44 @@
1#ifndef LEONIDA_OPUS_DECODER_H
2#define LEONIDA_OPUS_DECODER_H
3
4#include <stddef.h>
5#include <stdint.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11/* 120 ms at 48 kHz: the longest Opus packet, in samples per channel. */
12#define LEONIDA_OPUS_MAX_FRAMES 5760u
13
14typedef struct LeonidaOpusDecoder LeonidaOpusDecoder;
15
16enum LeonidaOpusStatus {
17 LEONIDA_OPUS_OK = 0,
18 LEONIDA_OPUS_INVALID_ARGUMENT = 1,
19 LEONIDA_OPUS_INVALID_FORMAT = 2,
20 LEONIDA_OPUS_DECODER_FAILURE = 3,
21 LEONIDA_OPUS_OUT_OF_MEMORY = 4,
22 LEONIDA_OPUS_PANIC = 5,
23 LEONIDA_OPUS_BUFFER_TOO_SMALL = 6,
24};
25
26int32_t leonida_opus_decoder_create(uint32_t sample_rate, uint32_t channels,
27 LeonidaOpusDecoder **out_decoder);
28uint32_t leonida_opus_decoder_channels(const LeonidaOpusDecoder *decoder);
29int32_t leonida_opus_decode_packet(LeonidaOpusDecoder *decoder,
30 const uint8_t *input, size_t input_len,
31 float *out, size_t out_capacity_frames,
32 uint32_t *out_frames);
33int32_t leonida_opus_decoder_reset(LeonidaOpusDecoder *decoder);
34void leonida_opus_decoder_destroy(LeonidaOpusDecoder *decoder);
35/* Test helper: encodes frame_count interleaved f32 frames to one packet at 48 kHz. */
36int32_t leonida_opus_encode_test(const float *input, uint32_t frame_count,
37 uint32_t channels, uint8_t *out,
38 size_t out_capacity, size_t *out_len);
39
40#ifdef __cplusplus
41}
42#endif
43
44#endif