Put custom_encoder_init decl behind CUSTOM_MODES. More softclip tests.

This removes an unused definition warning when compiling without
 custom modes.
This commit is contained in:
Gregory Maxwell 2013-11-24 06:49:01 -08:00
parent 1bf1f51c0a
commit f4d2c034a6
2 changed files with 5 additions and 4 deletions

View file

@ -140,6 +140,7 @@ OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_si
int channels int channels
) OPUS_ARG_NONNULL(1); ) OPUS_ARG_NONNULL(1);
# ifdef CUSTOM_MODES
/** Initializes a previously allocated encoder state /** Initializes a previously allocated encoder state
* The memory pointed to by st must be the size returned by opus_custom_encoder_get_size. * 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. * This is intended for applications which use their own allocator instead of malloc.
@ -152,12 +153,12 @@ OPUS_CUSTOM_EXPORT_STATIC OPUS_WARN_UNUSED_RESULT int opus_custom_encoder_get_si
* @param [in] channels <tt>int</tt>: Number of channels * @param [in] channels <tt>int</tt>: Number of channels
* @return OPUS_OK Success or @ref opus_errorcodes * @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, OpusCustomEncoder *st,
const OpusCustomMode *mode, const OpusCustomMode *mode,
int channels int channels
) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2); ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2);
# endif
#endif #endif

View file

@ -384,7 +384,7 @@ void test_soft_clip(void)
{ {
for (j=0;j<1024;j++) 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); opus_pcm_soft_clip(&x[i],1024-i,1,s);
for (j=i;j<1024;j++) for (j=i;j<1024;j++)
@ -397,7 +397,7 @@ void test_soft_clip(void)
{ {
for (j=0;j<1024;j++) 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); opus_pcm_soft_clip(x,1024/i,i,s);
for (j=0;j<(1024/i)*i;j++) for (j=0;j<(1024/i)*i;j++)