From 811dc74204c9acb9bcb5f3c74537880701f310a3 Mon Sep 17 00:00:00 2001 From: Ralph Giles Date: Thu, 7 Jan 2016 11:43:47 -0800 Subject: [PATCH] Suggest OPUS_LSB_DEPTH(14) for G.711. r=td-linux,mark4o This is a reasonable choice for the (non-linear) dynamic range of mu-law. A-law is technically 13 bit, maybe 12; experimentation is needed. Per irc discussion with Jean-Marc, Ron, and Mark Harris. --- include/opus_defines.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/opus_defines.h b/include/opus_defines.h index 70bad4109..647ed5d6f 100644 --- a/include/opus_defines.h +++ b/include/opus_defines.h @@ -523,10 +523,19 @@ extern "C" { * @hideinitializer */ #define OPUS_GET_DTX(x) OPUS_GET_DTX_REQUEST, __opus_check_int_ptr(x) /** Configures the depth of signal being encoded. + * * This is a hint which helps the encoder identify silence and near-silence. + * It represents the number of significant bits of linear intensity below + * which the signal contains ignorable quantization or other noise. + * + * For example, OPUS_SET_LSB_DEPTH(14) would be an appropriate setting + * for G.711 u-law input. OPUS_SET_LSB_DEPTH(16) would be appropriate + * for 16-bit linear pcm input with opus_encode_float(). + * * When using opus_encode() instead of opus_encode_float(), or when libopus * is compiled for fixed-point, the encoder uses the minimum of the value * set here and the value 16. + * * @see OPUS_GET_LSB_DEPTH * @param[in] x opus_int32: Input precision in bits, between 8 and 24 * (default: 24).