diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2024-05-08 10:36:38 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2024-06-20 07:08:35 -0400 |
commit | 547b6a570dbad844e79b4ba5eb934f043bab6318 (patch) | |
tree | 0cbdb670d73a2544d33985166c5abfa69e20a590 /lib/rbcodec/codecs/libspeex/speex.c | |
parent | 8ef20383b1e5025f7724e750832de6e28e50680d (diff) | |
download | rockbox-547b6a570dbad844e79b4ba5eb934f043bab6318.tar.gz rockbox-547b6a570dbad844e79b4ba5eb934f043bab6318.zip |
codecs: Update libspeex from 1.2beta3 to 1.2rc1
This is a relatively minor bump, but it's the first step towards
bringing this current.
Change-Id: Iab6c9b0c77f0ba705280434ea74b513364719499
Diffstat (limited to 'lib/rbcodec/codecs/libspeex/speex.c')
-rw-r--r-- | lib/rbcodec/codecs/libspeex/speex.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/lib/rbcodec/codecs/libspeex/speex.c b/lib/rbcodec/codecs/libspeex/speex.c index 92e41f52ae..9836de36b8 100644 --- a/lib/rbcodec/codecs/libspeex/speex.c +++ b/lib/rbcodec/codecs/libspeex/speex.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* Copyright (C) 2002 Jean-Marc Valin | 1 | /* Copyright (C) 2002 Jean-Marc Valin |
2 | File: speex.c | 2 | File: speex.c |
3 | 3 | ||
4 | Basic Speex functions | 4 | Basic Speex functions |
@@ -6,18 +6,18 @@ | |||
6 | Redistribution and use in source and binary forms, with or without | 6 | Redistribution and use in source and binary forms, with or without |
7 | modification, are permitted provided that the following conditions | 7 | modification, are permitted provided that the following conditions |
8 | are met: | 8 | are met: |
9 | 9 | ||
10 | - Redistributions of source code must retain the above copyright | 10 | - Redistributions of source code must retain the above copyright |
11 | notice, this list of conditions and the following disclaimer. | 11 | notice, this list of conditions and the following disclaimer. |
12 | 12 | ||
13 | - Redistributions in binary form must reproduce the above copyright | 13 | - Redistributions in binary form must reproduce the above copyright |
14 | notice, this list of conditions and the following disclaimer in the | 14 | notice, this list of conditions and the following disclaimer in the |
15 | documentation and/or other materials provided with the distribution. | 15 | documentation and/or other materials provided with the distribution. |
16 | 16 | ||
17 | - Neither the name of the Xiph.org Foundation nor the names of its | 17 | - Neither the name of the Xiph.org Foundation nor the names of its |
18 | contributors may be used to endorse or promote products derived from | 18 | contributors may be used to endorse or promote products derived from |
19 | this software without specific prior written permission. | 19 | this software without specific prior written permission. |
20 | 20 | ||
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
22 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 22 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
@@ -49,25 +49,25 @@ | |||
49 | #define MAX_IN_SAMPLES 640 | 49 | #define MAX_IN_SAMPLES 640 |
50 | 50 | ||
51 | #ifndef SPEEX_DISABLE_ENCODER | 51 | #ifndef SPEEX_DISABLE_ENCODER |
52 | void *speex_encoder_init(const SpeexMode *mode) | 52 | EXPORT void *speex_encoder_init(const SpeexMode *mode) |
53 | { | 53 | { |
54 | return mode->enc_init(mode); | 54 | return mode->enc_init(mode); |
55 | } | 55 | } |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | void *speex_decoder_init(const SpeexMode *mode) | 58 | EXPORT void *speex_decoder_init(const SpeexMode *mode) |
59 | { | 59 | { |
60 | return mode->dec_init(mode); | 60 | return mode->dec_init(mode); |
61 | } | 61 | } |
62 | 62 | ||
63 | #ifndef SPEEX_DISABLE_ENCODER | 63 | #ifndef SPEEX_DISABLE_ENCODER |
64 | void speex_encoder_destroy(void *state) | 64 | EXPORT void speex_encoder_destroy(void *state) |
65 | { | 65 | { |
66 | (*((SpeexMode**)state))->enc_destroy(state); | 66 | (*((SpeexMode**)state))->enc_destroy(state); |
67 | } | 67 | } |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | void speex_decoder_destroy(void *state) | 70 | EXPORT void speex_decoder_destroy(void *state) |
71 | { | 71 | { |
72 | (*((SpeexMode**)state))->dec_destroy(state); | 72 | (*((SpeexMode**)state))->dec_destroy(state); |
73 | } | 73 | } |
@@ -90,7 +90,7 @@ int speex_decode_native(void *state, SpeexBits *bits, spx_word16_t *out) | |||
90 | 90 | ||
91 | #ifndef SPEEX_DISABLE_ENCODER | 91 | #ifndef SPEEX_DISABLE_ENCODER |
92 | #ifndef DISABLE_FLOAT_API | 92 | #ifndef DISABLE_FLOAT_API |
93 | int speex_encode(void *state, float *in, SpeexBits *bits) | 93 | EXPORT int speex_encode(void *state, float *in, SpeexBits *bits) |
94 | { | 94 | { |
95 | int i; | 95 | int i; |
96 | spx_int32_t N; | 96 | spx_int32_t N; |
@@ -109,7 +109,7 @@ int speex_encode(void *state, float *in, SpeexBits *bits) | |||
109 | } | 109 | } |
110 | #endif /* #ifndef DISABLE_FLOAT_API */ | 110 | #endif /* #ifndef DISABLE_FLOAT_API */ |
111 | 111 | ||
112 | int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits) | 112 | EXPORT int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits) |
113 | { | 113 | { |
114 | SpeexMode *mode; | 114 | SpeexMode *mode; |
115 | mode = *(SpeexMode**)state; | 115 | mode = *(SpeexMode**)state; |
@@ -118,7 +118,7 @@ int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits) | |||
118 | #endif /* SPEEX_DISABLE_ENCODER */ | 118 | #endif /* SPEEX_DISABLE_ENCODER */ |
119 | 119 | ||
120 | #ifndef DISABLE_FLOAT_API | 120 | #ifndef DISABLE_FLOAT_API |
121 | int speex_decode(void *state, SpeexBits *bits, float *out) | 121 | EXPORT int speex_decode(void *state, SpeexBits *bits, float *out) |
122 | { | 122 | { |
123 | int i, ret; | 123 | int i, ret; |
124 | spx_int32_t N; | 124 | spx_int32_t N; |
@@ -131,7 +131,7 @@ int speex_decode(void *state, SpeexBits *bits, float *out) | |||
131 | } | 131 | } |
132 | #endif /* #ifndef DISABLE_FLOAT_API */ | 132 | #endif /* #ifndef DISABLE_FLOAT_API */ |
133 | 133 | ||
134 | int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out) | 134 | EXPORT int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out) |
135 | { | 135 | { |
136 | SpeexMode *mode = *(SpeexMode**)state; | 136 | SpeexMode *mode = *(SpeexMode**)state; |
137 | return (mode)->dec(state, bits, out); | 137 | return (mode)->dec(state, bits, out); |
@@ -139,12 +139,12 @@ int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out) | |||
139 | 139 | ||
140 | #else | 140 | #else |
141 | 141 | ||
142 | int speex_encode(void *state, float *in, SpeexBits *bits) | 142 | EXPORT int speex_encode(void *state, float *in, SpeexBits *bits) |
143 | { | 143 | { |
144 | return (*((SpeexMode**)state))->enc(state, in, bits); | 144 | return (*((SpeexMode**)state))->enc(state, in, bits); |
145 | } | 145 | } |
146 | 146 | ||
147 | int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits) | 147 | EXPORT int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits) |
148 | { | 148 | { |
149 | int i; | 149 | int i; |
150 | spx_int32_t N; | 150 | spx_int32_t N; |
@@ -155,12 +155,12 @@ int speex_encode_int(void *state, spx_int16_t *in, SpeexBits *bits) | |||
155 | return (*((SpeexMode**)state))->enc(state, float_in, bits); | 155 | return (*((SpeexMode**)state))->enc(state, float_in, bits); |
156 | } | 156 | } |
157 | 157 | ||
158 | int speex_decode(void *state, SpeexBits *bits, float *out) | 158 | EXPORT int speex_decode(void *state, SpeexBits *bits, float *out) |
159 | { | 159 | { |
160 | return (*((SpeexMode**)state))->dec(state, bits, out); | 160 | return (*((SpeexMode**)state))->dec(state, bits, out); |
161 | } | 161 | } |
162 | 162 | ||
163 | int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out) | 163 | EXPORT int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out) |
164 | { | 164 | { |
165 | int i; | 165 | int i; |
166 | spx_int32_t N; | 166 | spx_int32_t N; |
@@ -182,13 +182,13 @@ int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out) | |||
182 | #endif | 182 | #endif |
183 | 183 | ||
184 | #ifndef SPEEX_DISABLE_ENCODER | 184 | #ifndef SPEEX_DISABLE_ENCODER |
185 | int speex_encoder_ctl(void *state, int request, void *ptr) | 185 | EXPORT int speex_encoder_ctl(void *state, int request, void *ptr) |
186 | { | 186 | { |
187 | return (*((SpeexMode**)state))->enc_ctl(state, request, ptr); | 187 | return (*((SpeexMode**)state))->enc_ctl(state, request, ptr); |
188 | } | 188 | } |
189 | #endif | 189 | #endif |
190 | 190 | ||
191 | int speex_decoder_ctl(void *state, int request, void *ptr) | 191 | EXPORT int speex_decoder_ctl(void *state, int request, void *ptr) |
192 | { | 192 | { |
193 | return (*((SpeexMode**)state))->dec_ctl(state, request, ptr); | 193 | return (*((SpeexMode**)state))->dec_ctl(state, request, ptr); |
194 | } | 194 | } |
@@ -196,7 +196,7 @@ int speex_decoder_ctl(void *state, int request, void *ptr) | |||
196 | int nb_mode_query(const void *mode, int request, void *ptr) | 196 | int nb_mode_query(const void *mode, int request, void *ptr) |
197 | { | 197 | { |
198 | const SpeexNBMode *m = (const SpeexNBMode*)mode; | 198 | const SpeexNBMode *m = (const SpeexNBMode*)mode; |
199 | 199 | ||
200 | switch (request) | 200 | switch (request) |
201 | { | 201 | { |
202 | case SPEEX_MODE_FRAME_SIZE: | 202 | case SPEEX_MODE_FRAME_SIZE: |
@@ -219,7 +219,7 @@ int nb_mode_query(const void *mode, int request, void *ptr) | |||
219 | 219 | ||
220 | 220 | ||
221 | 221 | ||
222 | int speex_lib_ctl(int request, void *ptr) | 222 | EXPORT int speex_lib_ctl(int request, void *ptr) |
223 | { | 223 | { |
224 | switch (request) | 224 | switch (request) |
225 | { | 225 | { |