shithub: opus

Download patch

ref: 9fec9bb39103a2e945b7099ad906c7fe9a9a8c3d
parent: ba28403a04c8911bd728bf09e57567cc6080f682
author: Gregory Maxwell <[email protected]>
date: Thu Sep 27 14:36:51 EDT 2012

Belabor OPUS_SET_BITRATE instead of max_packet, as this is a common trap.

--- a/include/opus.h
+++ b/include/opus.h
@@ -136,7 +136,8 @@
   * <li>audio_frame is the audio data in opus_int16 (or float for opus_encode_float())</li>
   * <li>frame_size is the duration of the frame in samples (per channel)</li>
   * <li>packet is the byte array to which the compressed data is written</li>
-  * <li>max_packet is the maximum number of bytes that can be written in the packet (4000 bytes is recommended)</li>
+  * <li>max_packet is the maximum number of bytes that can be written in the packet (4000 bytes is recommended).
+  *     Do not use max_packet to control VBR target bitrate, instead use the #OPUS_SET_BITRATE CTL.</li>
   * </ul>
   *
   * opus_encode() and opus_encode_float() return the number of bytes actually written to the packet.
@@ -252,9 +253,10 @@
   *                                                 memory for the output
   *                                                 payload. This may be
   *                                                 used to impose an upper limit on
-  *                                                 the variable bitrate, but should
+  *                                                 the instant bitrate, but should
   *                                                 not be used as the only bitrate
-  *                                                 control.
+  *                                                 control. Use #OPUS_SET_BITRATE to
+  *                                                 control the bitrate.
   * @returns The length of the encoded packet (in bytes) on success or a
   *          negative error code (see @ref opus_errorcodes) on failure.
   */
@@ -292,9 +294,10 @@
   *                                                 memory for the output
   *                                                 payload. This may be
   *                                                 used to impose an upper limit on
-  *                                                 the variable bitrate, but should
+  *                                                 the instant bitrate, but should
   *                                                 not be used as the only bitrate
-  *                                                 control.
+  *                                                 control. Use #OPUS_SET_BITRATE to
+  *                                                 control the bitrate.
   * @returns The length of the encoded packet (in bytes) on success or a
   *          negative error code (see @ref opus_errorcodes) on failure.
   */
--- a/include/opus_multistream.h
+++ b/include/opus_multistream.h
@@ -335,12 +335,14 @@
   * @param[out] data <tt>unsigned char*</tt>: Output payload.
   *                                           This must contain storage for at
   *                                           least \a max_data_bytes.
-  * @param max_data_bytes <tt>opus_int32</tt>: Size of the allocated memory for
-  *                                            the output payload. This may be
-  *                                            used to impose an upper limit on
-  *                                            the variable bitrate, but should
-  *                                            not be used as the only bitrate
-  *                                            control.
+  * @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated
+  *                                                 memory for the output
+  *                                                 payload. This may be
+  *                                                 used to impose an upper limit on
+  *                                                 the instant bitrate, but should
+  *                                                 not be used as the only bitrate
+  *                                                 control. Use #OPUS_SET_BITRATE to
+  *                                                 control the bitrate.
   * @returns The length of the encoded packet (in bytes) on success or a
   *          negative error code (see @ref opus_errorcodes) on failure.
   */
@@ -378,12 +380,14 @@
   * @param[out] data <tt>unsigned char*</tt>: Output payload.
   *                                           This must contain storage for at
   *                                           least \a max_data_bytes.
-  * @param max_data_bytes <tt>opus_int32</tt>: Size of the allocated memory for
-  *                                            the output payload. This may be
-  *                                            used to impose an upper limit on
-  *                                            the variable bitrate, but should
-  *                                            not be used as the only bitrate
-  *                                            control.
+  * @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated
+  *                                                 memory for the output
+  *                                                 payload. This may be
+  *                                                 used to impose an upper limit on
+  *                                                 the instant bitrate, but should
+  *                                                 not be used as the only bitrate
+  *                                                 control. Use #OPUS_SET_BITRATE to
+  *                                                 control the bitrate.
   * @returns The length of the encoded packet (in bytes) on success or a
   *          negative error code (see @ref opus_errorcodes) on failure.
   */