From e6a0be8ee6a0675dc7c959a0c3cf9d3f7219b682 Mon Sep 17 00:00:00 2001 From: Jean-Marc Valin <jmvalin@jmvalin.ca> Date: Thu, 27 Oct 2011 13:43:43 -0400 Subject: [PATCH] Makes OPUS_SET_VOICE_RATIO private Let's put it back in if/when we have a clearer view of voice/music detection --- include/opus_defines.h | 17 ----------------- src/opus_private.h | 20 ++++++++++++++++++++ tests/test_opus_api.c | 3 ++- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/include/opus_defines.h b/include/opus_defines.h index 61ba8942c..50ff16c11 100644 --- a/include/opus_defines.h +++ b/include/opus_defines.h @@ -95,8 +95,6 @@ extern "C" { #define OPUS_GET_PACKET_LOSS_PERC_REQUEST 4015 #define OPUS_SET_DTX_REQUEST 4016 #define OPUS_GET_DTX_REQUEST 4017 -#define OPUS_SET_VOICE_RATIO_REQUEST 4018 -#define OPUS_GET_VOICE_RATIO_REQUEST 4019 #define OPUS_SET_VBR_CONSTRAINT_REQUEST 4020 #define OPUS_GET_VBR_CONSTRAINT_REQUEST 4021 #define OPUS_SET_FORCE_CHANNELS_REQUEST 4022 @@ -259,21 +257,6 @@ extern "C" { * @hideinitializer */ #define OPUS_GET_SIGNAL(x) OPUS_GET_SIGNAL_REQUEST, __opus_check_int_ptr(x) -/** Configures the encoder's expected percentage of voice - * opposed to music or other signals. - * - * @note This interface is currently more aspiration than actuality. It's - * ultimately expected to bias an automatic signal classifier, but it currently - * just shifts the static bitrate to mode mapping around a little bit. - * - * @param[in] x <tt>int</tt>: Voice percentage in the range 0-100, inclusive. - * @hideinitializer */ -#define OPUS_SET_VOICE_RATIO(x) OPUS_SET_VOICE_RATIO_REQUEST, __opus_check_int(x) -/** Gets the encoder's configured voice ratio value, @see OPUS_SET_VOICE_RATIO - * - * @param[out] x <tt>int*</tt>: Voice percentage in the range 0-100, inclusive. - * @hideinitializer */ -#define OPUS_GET_VOICE_RATIO(x) OPUS_GET_VOICE_RATIO_REQUEST, __opus_check_int_ptr(x) /** Configures the encoder's intended application. * The initial value is a mandatory argument to the encoder_create function. diff --git a/src/opus_private.h b/src/opus_private.h index 555f8b07b..ea7acb74c 100644 --- a/src/opus_private.h +++ b/src/opus_private.h @@ -36,6 +36,26 @@ #define MODE_HYBRID 1001 #define MODE_CELT_ONLY 1002 +#define OPUS_SET_VOICE_RATIO_REQUEST 11018 +#define OPUS_GET_VOICE_RATIO_REQUEST 11019 + +/** Configures the encoder's expected percentage of voice + * opposed to music or other signals. + * + * @note This interface is currently more aspiration than actuality. It's + * ultimately expected to bias an automatic signal classifier, but it currently + * just shifts the static bitrate to mode mapping around a little bit. + * + * @param[in] x <tt>int</tt>: Voice percentage in the range 0-100, inclusive. + * @hideinitializer */ +#define OPUS_SET_VOICE_RATIO(x) OPUS_SET_VOICE_RATIO_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured voice ratio value, @see OPUS_SET_VOICE_RATIO + * + * @param[out] x <tt>int*</tt>: Voice percentage in the range 0-100, inclusive. + * @hideinitializer */ +#define OPUS_GET_VOICE_RATIO(x) OPUS_GET_VOICE_RATIO_REQUEST, __opus_check_int_ptr(x) + + #define OPUS_SET_FORCE_MODE_REQUEST 11002 #define OPUS_SET_FORCE_MODE(x) OPUS_SET_FORCE_MODE_REQUEST, __opus_check_int(x) diff --git a/tests/test_opus_api.c b/tests/test_opus_api.c index 911ba2e0f..488aa32da 100644 --- a/tests/test_opus_api.c +++ b/tests/test_opus_api.c @@ -871,10 +871,11 @@ opus_int32 test_enc_api(void) " OPUS_SET_VBR ................................ OK.\n", " OPUS_GET_VBR ................................ OK.\n") - CHECK_SETGET(OPUS_SET_VOICE_RATIO(i),OPUS_GET_VOICE_RATIO(&i),-2,101, + /*CHECK_SETGET(OPUS_SET_VOICE_RATIO(i),OPUS_GET_VOICE_RATIO(&i),-2,101, 0,50, " OPUS_SET_VOICE_RATIO ........................ OK.\n", " OPUS_GET_VOICE_RATIO ........................ OK.\n") + */ CHECK_SETGET(OPUS_SET_VBR_CONSTRAINT(i),OPUS_GET_VBR_CONSTRAINT(&i),-1,2, 1,0, -- GitLab