aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGregory Maxwell <greg@xiph.org>2012-07-11 00:04:24 -0400
committerGregory Maxwell <greg@xiph.org>2012-07-11 00:04:24 -0400
commit28b41ae5ae1acf6eb222858567952564838d48f5 (patch)
tree4f9f1c48748f499c8730515ca5b9b1c0633324d3 /include
parentc329045758ccd614284f0b7cca859bc046ba1ae3 (diff)
downloadlibopus-28b41ae5ae1acf6eb222858567952564838d48f5.tar.gz
Add OPUS_{GET|SET}_GAIN CTLs for adjusting output gain.
This CTL was requested by Nicolas George for FFmpeg.
Diffstat (limited to 'include')
-rw-r--r--include/opus_defines.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/include/opus_defines.h b/include/opus_defines.h
index 54d198be..de04ec5c 100644
--- a/include/opus_defines.h
+++ b/include/opus_defines.h
@@ -128,6 +128,8 @@ extern "C" {
/* #define OPUS_RESET_STATE 4028 */
#define OPUS_GET_FINAL_RANGE_REQUEST 4031
#define OPUS_GET_PITCH_REQUEST 4033
+#define OPUS_SET_GAIN_REQUEST 4034
+#define OPUS_GET_GAIN_REQUEST 4045
/* Macros to trigger compilation errors when the wrong types are provided to a CTL */
#define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x))
@@ -400,7 +402,7 @@ extern "C" {
* }
* @endcode
*
- * @see opus_encoder, opus_decoder_ctl, opus_encoder_ctl
+ * @see opus_encoder, opus_decoder_ctl, opus_encoder_ctl, opus_decoderctls, opus_encoderctls
* @{
*/
@@ -440,6 +442,29 @@ extern "C" {
/**@}*/
+/** @defgroup opus_decoderctls Decoder related CTLs
+ * @see opus_genericctls, opus_encoderctls, opus_decoder
+ * @{
+ */
+
+/** Configures decoder gain adjustment.
+ * Scales the decoded output by a factor specified in Q8 dB units.
+ * This has a maximum range of -32768 to 32767 inclusive, and returns
+ * OPUS_BAD_ARG otherwise.
+ *
+ * gain = pow(10, x/(20.0*256))
+ *
+ * @param[in] x <tt>opus_int32</tt>: Amount to scale PCM signal by in Q8 dB units.
+ * @hideinitializer */
+#define OPUS_SET_GAIN(x) OPUS_SET_GAIN_REQUEST, __opus_check_int(x)
+/** Gets the decoder's configured gain adjustment. @see OPUS_SET_GAIN
+ *
+ * @param[out] x <tt>opus_int32*</tt>: Amount to scale PCM signal by in Q8 dB units.
+ * @hideinitializer */
+#define OPUS_GET_GAIN(x) OPUS_GET_GAIN_REQUEST, __opus_check_int_ptr(x)
+
+/**@}*/
+
/** @defgroup opus_libinfo Opus library information functions
* @{
*/