@@ -44,8 +44,8 @@ extern "C" {
4444/** Macros to trigger compilation errors when the wrong types are provided to a
4545 * CTL. */
4646/**@{*/
47- #define __opus_check_encstate_ptr (ptr ) ((ptr) + ((ptr) - (OpusEncoder**)(ptr)))
48- #define __opus_check_decstate_ptr (ptr ) ((ptr) + ((ptr) - (OpusDecoder**)(ptr)))
47+ #define opus_check_encstate_ptr (ptr ) ((ptr) + ((ptr) - (OpusEncoder**)(ptr)))
48+ #define opus_check_decstate_ptr (ptr ) ((ptr) + ((ptr) - (OpusDecoder**)(ptr)))
4949/**@}*/
5050
5151/** These are the actual encoder and decoder CTL ID numbers.
@@ -83,7 +83,7 @@ extern "C" {
8383 * @retval OPUS_BAD_ARG The index of the requested stream was out of range.
8484 * @hideinitializer
8585 */
86- #define OPUS_MULTISTREAM_GET_ENCODER_STATE (x ,y ) OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST, __opus_check_int (x), __opus_check_encstate_ptr (y)
86+ #define OPUS_MULTISTREAM_GET_ENCODER_STATE (x ,y ) OPUS_MULTISTREAM_GET_ENCODER_STATE_REQUEST, opus_check_int (x), opus_check_encstate_ptr (y)
8787
8888/** Gets the decoder state for an individual stream of a multistream decoder.
8989 * @param[in] x <tt>opus_int32</tt>: The index of the stream whose decoder you
@@ -96,7 +96,7 @@ extern "C" {
9696 * @retval OPUS_BAD_ARG The index of the requested stream was out of range.
9797 * @hideinitializer
9898 */
99- #define OPUS_MULTISTREAM_GET_DECODER_STATE (x ,y ) OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST, __opus_check_int (x), __opus_check_decstate_ptr (y)
99+ #define OPUS_MULTISTREAM_GET_DECODER_STATE (x ,y ) OPUS_MULTISTREAM_GET_DECODER_STATE_REQUEST, opus_check_int (x), opus_check_decstate_ptr (y)
100100
101101/**@}*/
102102
@@ -143,7 +143,7 @@ extern "C" {
143143 * <a href="https://www.xiph.org/vorbis/doc/Vorbis_I_spec.html#x1-810004.3.9">Vorbis
144144 * channel ordering</a>. A decoder may wish to apply an additional permutation
145145 * to the mapping the encoder used to achieve a different output channel
146- * order (e.g. for outputing in WAV order).
146+ * order (e.g. for outputting in WAV order).
147147 *
148148 * Each multistream packet contains an Opus packet for each stream, and all of
149149 * the Opus packets in a single multistream packet must have the same
@@ -382,6 +382,44 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode(
382382 opus_int32 max_data_bytes
383383) OPUS_ARG_NONNULL (1 ) OPUS_ARG_NONNULL (2 ) OPUS_ARG_NONNULL (4 );
384384
385+ /** Encodes a multistream Opus frame.
386+ * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state.
387+ * @param[in] pcm <tt>const opus_int32*</tt>: The input signal as interleaved
388+ * samples representing (or slightly exceeding) 24-bit values.
389+ * This must contain
390+ * <code>frame_size*channels</code>
391+ * samples.
392+ * @param frame_size <tt>int</tt>: Number of samples per channel in the input
393+ * signal.
394+ * This must be an Opus frame size for the
395+ * encoder's sampling rate.
396+ * For example, at 48 kHz the permitted values
397+ * are 120, 240, 480, 960, 1920, and 2880.
398+ * Passing in a duration of less than 10 ms
399+ * (480 samples at 48 kHz) will prevent the
400+ * encoder from using the LPC or hybrid modes.
401+ * @param[out] data <tt>unsigned char*</tt>: Output payload.
402+ * This must contain storage for at
403+ * least \a max_data_bytes.
404+ * @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated
405+ * memory for the output
406+ * payload. This may be
407+ * used to impose an upper limit on
408+ * the instant bitrate, but should
409+ * not be used as the only bitrate
410+ * control. Use #OPUS_SET_BITRATE to
411+ * control the bitrate.
412+ * @returns The length of the encoded packet (in bytes) on success or a
413+ * negative error code (see @ref opus_errorcodes) on failure.
414+ */
415+ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_encode24 (
416+ OpusMSEncoder * st ,
417+ const opus_int32 * pcm ,
418+ int frame_size ,
419+ unsigned char * data ,
420+ opus_int32 max_data_bytes
421+ ) OPUS_ARG_NONNULL (1 ) OPUS_ARG_NONNULL (2 ) OPUS_ARG_NONNULL (4 );
422+
385423/** Encodes a multistream Opus frame from floating point input.
386424 * @param st <tt>OpusMSEncoder*</tt>: Multistream encoder state.
387425 * @param[in] pcm <tt>const float*</tt>: The input signal as interleaved
@@ -510,7 +548,7 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusMSDecoder *opus_multistream_decoder_crea
510548 int * error
511549) OPUS_ARG_NONNULL (5 );
512550
513- /** Intialize a previously allocated decoder state object.
551+ /** Initialize a previously allocated decoder state object.
514552 * The memory pointed to by \a st must be at least the size returned by
515553 * opus_multistream_encoder_get_size().
516554 * This is intended for applications which use their own allocator instead of
@@ -591,6 +629,44 @@ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode(
591629 int decode_fec
592630) OPUS_ARG_NONNULL (1 ) OPUS_ARG_NONNULL (4 );
593631
632+ /** Decode a multistream Opus packet.
633+ * @param st <tt>OpusMSDecoder*</tt>: Multistream decoder state.
634+ * @param[in] data <tt>const unsigned char*</tt>: Input payload.
635+ * Use a <code>NULL</code>
636+ * pointer to indicate packet
637+ * loss.
638+ * @param len <tt>opus_int32</tt>: Number of bytes in payload.
639+ * @param[out] pcm <tt>opus_int32*</tt>: Output signal, with interleaved
640+ * samples representing (or slightly exceeding) 24-bit values.
641+ * This must contain room for
642+ * <code>frame_size*channels</code>
643+ * samples.
644+ * @param frame_size <tt>int</tt>: The number of samples per channel of
645+ * available space in \a pcm.
646+ * If this is less than the maximum packet duration
647+ * (120 ms; 5760 for 48kHz), this function will not be capable
648+ * of decoding some packets. In the case of PLC (data==NULL)
649+ * or FEC (decode_fec=1), then frame_size needs to be exactly
650+ * the duration of audio that is missing, otherwise the
651+ * decoder will not be in the optimal state to decode the
652+ * next incoming packet. For the PLC and FEC cases, frame_size
653+ * <b>must</b> be a multiple of 2.5 ms.
654+ * @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band
655+ * forward error correction data be decoded.
656+ * If no such data is available, the frame is
657+ * decoded as if it were lost.
658+ * @returns Number of samples decoded on success or a negative error code
659+ * (see @ref opus_errorcodes) on failure.
660+ */
661+ OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_multistream_decode24 (
662+ OpusMSDecoder * st ,
663+ const unsigned char * data ,
664+ opus_int32 len ,
665+ opus_int32 * pcm ,
666+ int frame_size ,
667+ int decode_fec
668+ ) OPUS_ARG_NONNULL (1 ) OPUS_ARG_NONNULL (4 );
669+
594670/** Decode a multistream Opus packet with floating point output.
595671 * @param st <tt>OpusMSDecoder*</tt>: Multistream decoder state.
596672 * @param[in] data <tt>const unsigned char*</tt>: Input payload.
0 commit comments