shithub: opus

Download patch

ref: e6a0be8ee6a0675dc7c959a0c3cf9d3f7219b682
parent: 6ef378725f274ce60c7b0b42f8ff5f55df95d25d
author: Jean-Marc Valin <[email protected]>
date: Thu Oct 27 09:43:43 EDT 2011

Makes OPUS_SET_VOICE_RATIO private

Let's put it back in if/when we have a clearer view of voice/music detection

--- a/include/opus_defines.h
+++ b/include/opus_defines.h
@@ -95,8 +95,6 @@
 #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 @@
   * @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.
--- 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)
 
--- a/tests/test_opus_api.c
+++ b/tests/test_opus_api.c
@@ -871,10 +871,11 @@
      "    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,