• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Copyright (c) 2017 Google Inc.
2    Written by Andrew Allen */
3 /*
4    Redistribution and use in source and binary forms, with or without
5    modification, are permitted provided that the following conditions
6    are met:
7 
8    - Redistributions of source code must retain the above copyright
9    notice, this list of conditions and the following disclaimer.
10 
11    - Redistributions in binary form must reproduce the above copyright
12    notice, this list of conditions and the following disclaimer in the
13    documentation and/or other materials provided with the distribution.
14 
15    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16    ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17    LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18    A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
19    OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 
28 /**
29  * @file opus_projection.h
30  * @brief Opus projection reference API
31  */
32 
33 #ifndef OPUS_PROJECTION_H
34 #define OPUS_PROJECTION_H
35 
36 #include "opus_multistream.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
42 /** @cond OPUS_INTERNAL_DOC */
43 
44 /** These are the actual encoder and decoder CTL ID numbers.
45   * They should not be used directly by applications.c
46   * In general, SETs should be even and GETs should be odd.*/
47 /**@{*/
48 #define OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST    6001
49 #define OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST    6003
50 #define OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST         6005
51 /**@}*/
52 
53 
54 /** @endcond */
55 
56 /** @defgroup opus_projection_ctls Projection specific encoder and decoder CTLs
57   *
58   * These are convenience macros that are specific to the
59   * opus_projection_encoder_ctl() and opus_projection_decoder_ctl()
60   * interface.
61   * The CTLs from @ref opus_genericctls, @ref opus_encoderctls,
62   * @ref opus_decoderctls, and @ref opus_multistream_ctls may be applied to a
63   * projection encoder or decoder as well.
64   */
65 /**@{*/
66 
67 /** Gets the gain (in dB. S7.8-format) of the demixing matrix from the encoder.
68   * @param[out] x <tt>opus_int32 *</tt>: Returns the gain (in dB. S7.8-format)
69   *                                      of the demixing matrix.
70   * @hideinitializer
71   */
72 #define OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN(x) OPUS_PROJECTION_GET_DEMIXING_MATRIX_GAIN_REQUEST, __opus_check_int_ptr(x)
73 
74 
75 /** Gets the size in bytes of the demixing matrix from the encoder.
76   * @param[out] x <tt>opus_int32 *</tt>: Returns the size in bytes of the
77   *                                      demixing matrix.
78   * @hideinitializer
79   */
80 #define OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE(x) OPUS_PROJECTION_GET_DEMIXING_MATRIX_SIZE_REQUEST, __opus_check_int_ptr(x)
81 
82 
83 /** Copies the demixing matrix to the supplied pointer location.
84   * @param[out] x <tt>unsigned char *</tt>: Returns the demixing matrix to the
85   *                                         supplied pointer location.
86   * @param y <tt>opus_int32</tt>: The size in bytes of the reserved memory at the
87   *                              pointer location.
88   * @hideinitializer
89   */
90 #define OPUS_PROJECTION_GET_DEMIXING_MATRIX(x,y) OPUS_PROJECTION_GET_DEMIXING_MATRIX_REQUEST, x, __opus_check_int(y)
91 
92 
93 /**@}*/
94 
95 /** Opus projection encoder state.
96  * This contains the complete state of a projection Opus encoder.
97  * It is position independent and can be freely copied.
98  * @see opus_projection_ambisonics_encoder_create
99  */
100 typedef struct OpusProjectionEncoder OpusProjectionEncoder;
101 
102 
103 /** Opus projection decoder state.
104   * This contains the complete state of a projection Opus decoder.
105   * It is position independent and can be freely copied.
106   * @see opus_projection_decoder_create
107   * @see opus_projection_decoder_init
108   */
109 typedef struct OpusProjectionDecoder OpusProjectionDecoder;
110 
111 
112 /**\name Projection encoder functions */
113 /**@{*/
114 
115 /** Gets the size of an OpusProjectionEncoder structure.
116   * @param channels <tt>int</tt>: The total number of input channels to encode.
117   *                               This must be no more than 255.
118   * @param mapping_family <tt>int</tt>: The mapping family to use for selecting
119   *                                     the appropriate projection.
120   * @returns The size in bytes on success, or a negative error code
121   *          (see @ref opus_errorcodes) on error.
122   */
123 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_projection_ambisonics_encoder_get_size(
124     int channels,
125     int mapping_family
126 );
127 
128 
129 /** Allocates and initializes a projection encoder state.
130   * Call opus_projection_encoder_destroy() to release
131   * this object when finished.
132   * @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz).
133   *                                This must be one of 8000, 12000, 16000,
134   *                                24000, or 48000.
135   * @param channels <tt>int</tt>: Number of channels in the input signal.
136   *                               This must be at most 255.
137   *                               It may be greater than the number of
138   *                               coded channels (<code>streams +
139   *                               coupled_streams</code>).
140   * @param mapping_family <tt>int</tt>: The mapping family to use for selecting
141   *                                     the appropriate projection.
142   * @param[out] streams <tt>int *</tt>: The total number of streams that will
143   *                                     be encoded from the input.
144   * @param[out] coupled_streams <tt>int *</tt>: Number of coupled (2 channel)
145   *                                 streams that will be encoded from the input.
146   * @param application <tt>int</tt>: The target encoder application.
147   *                                  This must be one of the following:
148   * <dl>
149   * <dt>#OPUS_APPLICATION_VOIP</dt>
150   * <dd>Process signal for improved speech intelligibility.</dd>
151   * <dt>#OPUS_APPLICATION_AUDIO</dt>
152   * <dd>Favor faithfulness to the original input.</dd>
153   * <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt>
154   * <dd>Configure the minimum possible coding delay by disabling certain modes
155   * of operation.</dd>
156   * </dl>
157   * @param[out] error <tt>int *</tt>: Returns #OPUS_OK on success, or an error
158   *                                   code (see @ref opus_errorcodes) on
159   *                                   failure.
160   */
161 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusProjectionEncoder *opus_projection_ambisonics_encoder_create(
162     opus_int32 Fs,
163     int channels,
164     int mapping_family,
165     int *streams,
166     int *coupled_streams,
167     int application,
168     int *error
169 ) OPUS_ARG_NONNULL(4) OPUS_ARG_NONNULL(5);
170 
171 
172 /** Initialize a previously allocated projection encoder state.
173   * The memory pointed to by \a st must be at least the size returned by
174   * opus_projection_ambisonics_encoder_get_size().
175   * This is intended for applications which use their own allocator instead of
176   * malloc.
177   * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL.
178   * @see opus_projection_ambisonics_encoder_create
179   * @see opus_projection_ambisonics_encoder_get_size
180   * @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state to initialize.
181   * @param Fs <tt>opus_int32</tt>: Sampling rate of the input signal (in Hz).
182   *                                This must be one of 8000, 12000, 16000,
183   *                                24000, or 48000.
184   * @param channels <tt>int</tt>: Number of channels in the input signal.
185   *                               This must be at most 255.
186   *                               It may be greater than the number of
187   *                               coded channels (<code>streams +
188   *                               coupled_streams</code>).
189   * @param streams <tt>int</tt>: The total number of streams to encode from the
190   *                              input.
191   *                              This must be no more than the number of channels.
192   * @param coupled_streams <tt>int</tt>: Number of coupled (2 channel) streams
193   *                                      to encode.
194   *                                      This must be no larger than the total
195   *                                      number of streams.
196   *                                      Additionally, The total number of
197   *                                      encoded channels (<code>streams +
198   *                                      coupled_streams</code>) must be no
199   *                                      more than the number of input channels.
200   * @param application <tt>int</tt>: The target encoder application.
201   *                                  This must be one of the following:
202   * <dl>
203   * <dt>#OPUS_APPLICATION_VOIP</dt>
204   * <dd>Process signal for improved speech intelligibility.</dd>
205   * <dt>#OPUS_APPLICATION_AUDIO</dt>
206   * <dd>Favor faithfulness to the original input.</dd>
207   * <dt>#OPUS_APPLICATION_RESTRICTED_LOWDELAY</dt>
208   * <dd>Configure the minimum possible coding delay by disabling certain modes
209   * of operation.</dd>
210   * </dl>
211   * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes)
212   *          on failure.
213   */
214 OPUS_EXPORT int opus_projection_ambisonics_encoder_init(
215     OpusProjectionEncoder *st,
216     opus_int32 Fs,
217     int channels,
218     int mapping_family,
219     int *streams,
220     int *coupled_streams,
221     int application
222 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(5) OPUS_ARG_NONNULL(6);
223 
224 
225 /** Encodes a projection Opus frame.
226   * @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state.
227   * @param[in] pcm <tt>const opus_int16*</tt>: The input signal as interleaved
228   *                                            samples.
229   *                                            This must contain
230   *                                            <code>frame_size*channels</code>
231   *                                            samples.
232   * @param frame_size <tt>int</tt>: Number of samples per channel in the input
233   *                                 signal.
234   *                                 This must be an Opus frame size for the
235   *                                 encoder's sampling rate.
236   *                                 For example, at 48 kHz the permitted values
237   *                                 are 120, 240, 480, 960, 1920, and 2880.
238   *                                 Passing in a duration of less than 10 ms
239   *                                 (480 samples at 48 kHz) will prevent the
240   *                                 encoder from using the LPC or hybrid modes.
241   * @param[out] data <tt>unsigned char*</tt>: Output payload.
242   *                                           This must contain storage for at
243   *                                           least \a max_data_bytes.
244   * @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated
245   *                                                 memory for the output
246   *                                                 payload. This may be
247   *                                                 used to impose an upper limit on
248   *                                                 the instant bitrate, but should
249   *                                                 not be used as the only bitrate
250   *                                                 control. Use #OPUS_SET_BITRATE to
251   *                                                 control the bitrate.
252   * @returns The length of the encoded packet (in bytes) on success or a
253   *          negative error code (see @ref opus_errorcodes) on failure.
254   */
255 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_encode(
256     OpusProjectionEncoder *st,
257     const opus_int16 *pcm,
258     int frame_size,
259     unsigned char *data,
260     opus_int32 max_data_bytes
261 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
262 
263 
264 /** Encodes a projection Opus frame from floating point input.
265   * @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state.
266   * @param[in] pcm <tt>const float*</tt>: The input signal as interleaved
267   *                                       samples with a normal range of
268   *                                       +/-1.0.
269   *                                       Samples with a range beyond +/-1.0
270   *                                       are supported but will be clipped by
271   *                                       decoders using the integer API and
272   *                                       should only be used if it is known
273   *                                       that the far end supports extended
274   *                                       dynamic range.
275   *                                       This must contain
276   *                                       <code>frame_size*channels</code>
277   *                                       samples.
278   * @param frame_size <tt>int</tt>: Number of samples per channel in the input
279   *                                 signal.
280   *                                 This must be an Opus frame size for the
281   *                                 encoder's sampling rate.
282   *                                 For example, at 48 kHz the permitted values
283   *                                 are 120, 240, 480, 960, 1920, and 2880.
284   *                                 Passing in a duration of less than 10 ms
285   *                                 (480 samples at 48 kHz) will prevent the
286   *                                 encoder from using the LPC or hybrid modes.
287   * @param[out] data <tt>unsigned char*</tt>: Output payload.
288   *                                           This must contain storage for at
289   *                                           least \a max_data_bytes.
290   * @param [in] max_data_bytes <tt>opus_int32</tt>: Size of the allocated
291   *                                                 memory for the output
292   *                                                 payload. This may be
293   *                                                 used to impose an upper limit on
294   *                                                 the instant bitrate, but should
295   *                                                 not be used as the only bitrate
296   *                                                 control. Use #OPUS_SET_BITRATE to
297   *                                                 control the bitrate.
298   * @returns The length of the encoded packet (in bytes) on success or a
299   *          negative error code (see @ref opus_errorcodes) on failure.
300   */
301 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_encode_float(
302     OpusProjectionEncoder *st,
303     const float *pcm,
304     int frame_size,
305     unsigned char *data,
306     opus_int32 max_data_bytes
307 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(2) OPUS_ARG_NONNULL(4);
308 
309 
310 /** Frees an <code>OpusProjectionEncoder</code> allocated by
311   * opus_projection_ambisonics_encoder_create().
312   * @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state to be freed.
313   */
314 OPUS_EXPORT void opus_projection_encoder_destroy(OpusProjectionEncoder *st);
315 
316 
317 /** Perform a CTL function on a projection Opus encoder.
318   *
319   * Generally the request and subsequent arguments are generated by a
320   * convenience macro.
321   * @param st <tt>OpusProjectionEncoder*</tt>: Projection encoder state.
322   * @param request This and all remaining parameters should be replaced by one
323   *                of the convenience macros in @ref opus_genericctls,
324   *                @ref opus_encoderctls, @ref opus_multistream_ctls, or
325   *                @ref opus_projection_ctls
326   * @see opus_genericctls
327   * @see opus_encoderctls
328   * @see opus_multistream_ctls
329   * @see opus_projection_ctls
330   */
331 OPUS_EXPORT int opus_projection_encoder_ctl(OpusProjectionEncoder *st, int request, ...) OPUS_ARG_NONNULL(1);
332 
333 
334 /**@}*/
335 
336 /**\name Projection decoder functions */
337 /**@{*/
338 
339 /** Gets the size of an <code>OpusProjectionDecoder</code> structure.
340   * @param channels <tt>int</tt>: The total number of output channels.
341   *                               This must be no more than 255.
342   * @param streams <tt>int</tt>: The total number of streams coded in the
343   *                              input.
344   *                              This must be no more than 255.
345   * @param coupled_streams <tt>int</tt>: Number streams to decode as coupled
346   *                                      (2 channel) streams.
347   *                                      This must be no larger than the total
348   *                                      number of streams.
349   *                                      Additionally, The total number of
350   *                                      coded channels (<code>streams +
351   *                                      coupled_streams</code>) must be no
352   *                                      more than 255.
353   * @returns The size in bytes on success, or a negative error code
354   *          (see @ref opus_errorcodes) on error.
355   */
356 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT opus_int32 opus_projection_decoder_get_size(
357     int channels,
358     int streams,
359     int coupled_streams
360 );
361 
362 
363 /** Allocates and initializes a projection decoder state.
364   * Call opus_projection_decoder_destroy() to release
365   * this object when finished.
366   * @param Fs <tt>opus_int32</tt>: Sampling rate to decode at (in Hz).
367   *                                This must be one of 8000, 12000, 16000,
368   *                                24000, or 48000.
369   * @param channels <tt>int</tt>: Number of channels to output.
370   *                               This must be at most 255.
371   *                               It may be different from the number of coded
372   *                               channels (<code>streams +
373   *                               coupled_streams</code>).
374   * @param streams <tt>int</tt>: The total number of streams coded in the
375   *                              input.
376   *                              This must be no more than 255.
377   * @param coupled_streams <tt>int</tt>: Number of streams to decode as coupled
378   *                                      (2 channel) streams.
379   *                                      This must be no larger than the total
380   *                                      number of streams.
381   *                                      Additionally, The total number of
382   *                                      coded channels (<code>streams +
383   *                                      coupled_streams</code>) must be no
384   *                                      more than 255.
385   * @param[in] demixing_matrix <tt>const unsigned char[demixing_matrix_size]</tt>: Demixing matrix
386   *                         that mapping from coded channels to output channels,
387   *                         as described in @ref opus_projection and
388   *                         @ref opus_projection_ctls.
389   * @param demixing_matrix_size <tt>opus_int32</tt>: The size in bytes of the
390   *                                                  demixing matrix, as
391   *                                                  described in @ref
392   *                                                  opus_projection_ctls.
393   * @param[out] error <tt>int *</tt>: Returns #OPUS_OK on success, or an error
394   *                                   code (see @ref opus_errorcodes) on
395   *                                   failure.
396   */
397 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT OpusProjectionDecoder *opus_projection_decoder_create(
398     opus_int32 Fs,
399     int channels,
400     int streams,
401     int coupled_streams,
402     unsigned char *demixing_matrix,
403     opus_int32 demixing_matrix_size,
404     int *error
405 ) OPUS_ARG_NONNULL(5);
406 
407 
408 /** Intialize a previously allocated projection decoder state object.
409   * The memory pointed to by \a st must be at least the size returned by
410   * opus_projection_decoder_get_size().
411   * This is intended for applications which use their own allocator instead of
412   * malloc.
413   * To reset a previously initialized state, use the #OPUS_RESET_STATE CTL.
414   * @see opus_projection_decoder_create
415   * @see opus_projection_deocder_get_size
416   * @param st <tt>OpusProjectionDecoder*</tt>: Projection encoder state to initialize.
417   * @param Fs <tt>opus_int32</tt>: Sampling rate to decode at (in Hz).
418   *                                This must be one of 8000, 12000, 16000,
419   *                                24000, or 48000.
420   * @param channels <tt>int</tt>: Number of channels to output.
421   *                               This must be at most 255.
422   *                               It may be different from the number of coded
423   *                               channels (<code>streams +
424   *                               coupled_streams</code>).
425   * @param streams <tt>int</tt>: The total number of streams coded in the
426   *                              input.
427   *                              This must be no more than 255.
428   * @param coupled_streams <tt>int</tt>: Number of streams to decode as coupled
429   *                                      (2 channel) streams.
430   *                                      This must be no larger than the total
431   *                                      number of streams.
432   *                                      Additionally, The total number of
433   *                                      coded channels (<code>streams +
434   *                                      coupled_streams</code>) must be no
435   *                                      more than 255.
436   * @param[in] demixing_matrix <tt>const unsigned char[demixing_matrix_size]</tt>: Demixing matrix
437   *                         that mapping from coded channels to output channels,
438   *                         as described in @ref opus_projection and
439   *                         @ref opus_projection_ctls.
440   * @param demixing_matrix_size <tt>opus_int32</tt>: The size in bytes of the
441   *                                                  demixing matrix, as
442   *                                                  described in @ref
443   *                                                  opus_projection_ctls.
444   * @returns #OPUS_OK on success, or an error code (see @ref opus_errorcodes)
445   *          on failure.
446   */
447 OPUS_EXPORT int opus_projection_decoder_init(
448     OpusProjectionDecoder *st,
449     opus_int32 Fs,
450     int channels,
451     int streams,
452     int coupled_streams,
453     unsigned char *demixing_matrix,
454     opus_int32 demixing_matrix_size
455 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(6);
456 
457 
458 /** Decode a projection Opus packet.
459   * @param st <tt>OpusProjectionDecoder*</tt>: Projection decoder state.
460   * @param[in] data <tt>const unsigned char*</tt>: Input payload.
461   *                                                Use a <code>NULL</code>
462   *                                                pointer to indicate packet
463   *                                                loss.
464   * @param len <tt>opus_int32</tt>: Number of bytes in payload.
465   * @param[out] pcm <tt>opus_int16*</tt>: Output signal, with interleaved
466   *                                       samples.
467   *                                       This must contain room for
468   *                                       <code>frame_size*channels</code>
469   *                                       samples.
470   * @param frame_size <tt>int</tt>: The number of samples per channel of
471   *                                 available space in \a pcm.
472   *                                 If this is less than the maximum packet duration
473   *                                 (120 ms; 5760 for 48kHz), this function will not be capable
474   *                                 of decoding some packets. In the case of PLC (data==NULL)
475   *                                 or FEC (decode_fec=1), then frame_size needs to be exactly
476   *                                 the duration of audio that is missing, otherwise the
477   *                                 decoder will not be in the optimal state to decode the
478   *                                 next incoming packet. For the PLC and FEC cases, frame_size
479   *                                 <b>must</b> be a multiple of 2.5 ms.
480   * @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band
481   *                                 forward error correction data be decoded.
482   *                                 If no such data is available, the frame is
483   *                                 decoded as if it were lost.
484   * @returns Number of samples decoded on success or a negative error code
485   *          (see @ref opus_errorcodes) on failure.
486   */
487 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_decode(
488     OpusProjectionDecoder *st,
489     const unsigned char *data,
490     opus_int32 len,
491     opus_int16 *pcm,
492     int frame_size,
493     int decode_fec
494 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
495 
496 
497 /** Decode a projection Opus packet with floating point output.
498   * @param st <tt>OpusProjectionDecoder*</tt>: Projection decoder state.
499   * @param[in] data <tt>const unsigned char*</tt>: Input payload.
500   *                                                Use a <code>NULL</code>
501   *                                                pointer to indicate packet
502   *                                                loss.
503   * @param len <tt>opus_int32</tt>: Number of bytes in payload.
504   * @param[out] pcm <tt>opus_int16*</tt>: Output signal, with interleaved
505   *                                       samples.
506   *                                       This must contain room for
507   *                                       <code>frame_size*channels</code>
508   *                                       samples.
509   * @param frame_size <tt>int</tt>: The number of samples per channel of
510   *                                 available space in \a pcm.
511   *                                 If this is less than the maximum packet duration
512   *                                 (120 ms; 5760 for 48kHz), this function will not be capable
513   *                                 of decoding some packets. In the case of PLC (data==NULL)
514   *                                 or FEC (decode_fec=1), then frame_size needs to be exactly
515   *                                 the duration of audio that is missing, otherwise the
516   *                                 decoder will not be in the optimal state to decode the
517   *                                 next incoming packet. For the PLC and FEC cases, frame_size
518   *                                 <b>must</b> be a multiple of 2.5 ms.
519   * @param decode_fec <tt>int</tt>: Flag (0 or 1) to request that any in-band
520   *                                 forward error correction data be decoded.
521   *                                 If no such data is available, the frame is
522   *                                 decoded as if it were lost.
523   * @returns Number of samples decoded on success or a negative error code
524   *          (see @ref opus_errorcodes) on failure.
525   */
526 OPUS_EXPORT OPUS_WARN_UNUSED_RESULT int opus_projection_decode_float(
527     OpusProjectionDecoder *st,
528     const unsigned char *data,
529     opus_int32 len,
530     float *pcm,
531     int frame_size,
532     int decode_fec
533 ) OPUS_ARG_NONNULL(1) OPUS_ARG_NONNULL(4);
534 
535 
536 /** Perform a CTL function on a projection Opus decoder.
537   *
538   * Generally the request and subsequent arguments are generated by a
539   * convenience macro.
540   * @param st <tt>OpusProjectionDecoder*</tt>: Projection decoder state.
541   * @param request This and all remaining parameters should be replaced by one
542   *                of the convenience macros in @ref opus_genericctls,
543   *                @ref opus_decoderctls, @ref opus_multistream_ctls, or
544   *                @ref opus_projection_ctls.
545   * @see opus_genericctls
546   * @see opus_decoderctls
547   * @see opus_multistream_ctls
548   * @see opus_projection_ctls
549   */
550 OPUS_EXPORT int opus_projection_decoder_ctl(OpusProjectionDecoder *st, int request, ...) OPUS_ARG_NONNULL(1);
551 
552 
553 /** Frees an <code>OpusProjectionDecoder</code> allocated by
554   * opus_projection_decoder_create().
555   * @param st <tt>OpusProjectionDecoder</tt>: Projection decoder state to be freed.
556   */
557 OPUS_EXPORT void opus_projection_decoder_destroy(OpusProjectionDecoder *st);
558 
559 
560 /**@}*/
561 
562 /**@}*/
563 
564 #ifdef __cplusplus
565 }
566 #endif
567 
568 #endif /* OPUS_PROJECTION_H */
569