ref: f4d2c034a629726cf5978fdcac7f60c0af2e3add
parent: 1bf1f51c0a2b4e8bef93a1e949d57b33232b6455
author: Gregory Maxwell <[email protected]>
date: Sun Nov 24 01:49:01 EST 2013
Put custom_encoder_init decl behind CUSTOM_MODES. More softclip tests. This removes an unused definition warning when compiling without custom modes.
--- a/include/opus_custom.h
+++ b/include/opus_custom.h
@@ -140,6 +140,7 @@
int channels
) OPUS_ARG_NONNULL(1);
+# ifdef CUSTOM_MODES
/** Initializes a previously allocated encoder state
* The memory pointed to by st must be the size returned by opus_custom_encoder_get_size.
* This is intended for applications which use their own allocator instead of malloc.
@@ -152,12 +153,12 @@
* @param [in] channels <tt>int</tt>: Number of channels
* @return OPUS_OK Success or @ref opus_errorcodes
*/
-OPUS_CUSTOM_EXPORT_STATIC int opus_custom_encoder_init(
+OPUS_CUSTOM_EXPORT int opus_custom_encoder_init(
OpusCustomEncoder *st,
const OpusCustomMode *mode,
int channels
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
-
+# endif
#endif
--- a/tests/test_opus_decode.c
+++ b/tests/test_opus_decode.c
@@ -384,7 +384,7 @@
{
for (j=0;j<1024;j++)
{
- x[j]=(i&511)*(1/128.f)-2.f;
+ x[j]=(i&255)*(1/32.f)-4.f;
}
opus_pcm_soft_clip(&x[i],1024-i,1,s);
for (j=i;j<1024;j++)
@@ -397,7 +397,7 @@
{
for (j=0;j<1024;j++)
{
- x[j]=(i&511)*(1/128.f)-2.f;
+ x[j]=(i&255)*(1/32.f)-4.f;
}
opus_pcm_soft_clip(x,1024/i,i,s);
for (j=0;j<(1024/i)*i;j++)