diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2012-11-22 22:11:43 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-02-10 09:18:08 +0400 |
commit | 49583ed672f5a685a5f4f88eb98648eb5d5e7ae6 (patch) | |
tree | c5c95a6b6bef695dddd2b9f8bdd3de3fa2c88ca5 /include | |
parent | e85a6f5cbee9edd7ceb10e05db6652872cf8d8d2 (diff) |
First attempt at varying the frame size depending on the audio (float only)
The search is based on minimizing the bitrate increase due to transients
by considering we can reduce the "transient boost" by reducing the frame
size, at the cost of increasing the normal overhead.
Diffstat (limited to 'include')
-rw-r--r-- | include/opus_defines.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/include/opus_defines.h b/include/opus_defines.h index cdde061a..e9434aab 100644 --- a/include/opus_defines.h +++ b/include/opus_defines.h @@ -148,8 +148,9 @@ extern "C" { #define OPUS_GET_GAIN_REQUEST 4045 /* Should have been 4035 */ #define OPUS_SET_LSB_DEPTH_REQUEST 4036 #define OPUS_GET_LSB_DEPTH_REQUEST 4037 - #define OPUS_GET_LAST_PACKET_DURATION_REQUEST 4039 +#define OPUS_SET_EXPERT_VARIABLE_DURATION_REQUEST 4040 +#define OPUS_GET_EXPERT_VARIABLE_DURATION_REQUEST 4041 /* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */ @@ -525,6 +526,32 @@ extern "C" { * @param[out] x <tt>opus_int32 *</tt>: Number of samples (at current sampling rate). * @hideinitializer */ #define OPUS_GET_LAST_PACKET_DURATION(x) OPUS_GET_LAST_PACKET_DURATION_REQUEST, __opus_check_int_ptr(x) + +/** Configures the encoder's use of variable duration frames. + * When enabled, the encoder is free to use a shorter frame size than the one + * requested in the opus_encode*() call. It is then the user's responsibility + * to verify how much audio was encoded by checking the ToC byte of the encoded + * packet. The part of the audio that was not encoded needs to be resent to the + * encoder for the next call. Do not use this option unless you <b>really</b> + * know what you are doing. + * @see OPUS_GET_EXPERT_VARIABLE_DURATION + * @param[in] x <tt>opus_int32</tt>: Allowed values: + * <dl> + * <dt>0</dt><dd>Disable variable duration (default).</dd> + * <dt>1</dt><dd>Enable variable duration.</dd> + * </dl> + * @hideinitializer */ +#define OPUS_SET_EXPERT_VARIABLE_DURATION(x) OPUS_SET_EXPERT_VARIABLE_DURATION_REQUEST, __opus_check_int(x) +/** Gets the encoder's configured use of variable duration frames. + * @see OPUS_SET_EXPERT_VARIABLE_DURATION + * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: + * <dl> + * <dt>0</dt><dd>variable duration disabled (default).</dd> + * <dt>1</dt><dd>variable duration enabled.</dd> + * </dl> + * @hideinitializer */ +#define OPUS_GET_EXPERT_VARIABLE_DURATION(x) OPUS_GET_EXPERT_VARIABLE_DURATION_REQUEST, __opus_check_int_ptr(x) + /**@}*/ /** @defgroup opus_genericctls Generic CTLs |