OLD | NEW |
1 /* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited | 1 /* Copyright (c) 2010-2011 Xiph.Org Foundation, Skype Limited |
2 Written by Jean-Marc Valin and Koen Vos */ | 2 Written by Jean-Marc Valin and Koen Vos */ |
3 /* | 3 /* |
4 Redistribution and use in source and binary forms, with or without | 4 Redistribution and use in source and binary forms, with or without |
5 modification, are permitted provided that the following conditions | 5 modification, are permitted provided that the following conditions |
6 are met: | 6 are met: |
7 | 7 |
8 - Redistributions of source code must retain the above copyright | 8 - Redistributions of source code must retain the above copyright |
9 notice, this list of conditions and the following disclaimer. | 9 notice, this list of conditions and the following disclaimer. |
10 | 10 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 #define OPUS_GET_PITCH_REQUEST 4033 | 158 #define OPUS_GET_PITCH_REQUEST 4033 |
159 #define OPUS_SET_GAIN_REQUEST 4034 | 159 #define OPUS_SET_GAIN_REQUEST 4034 |
160 #define OPUS_GET_GAIN_REQUEST 4045 /* Should have been 4035 */ | 160 #define OPUS_GET_GAIN_REQUEST 4045 /* Should have been 4035 */ |
161 #define OPUS_SET_LSB_DEPTH_REQUEST 4036 | 161 #define OPUS_SET_LSB_DEPTH_REQUEST 4036 |
162 #define OPUS_GET_LSB_DEPTH_REQUEST 4037 | 162 #define OPUS_GET_LSB_DEPTH_REQUEST 4037 |
163 #define OPUS_GET_LAST_PACKET_DURATION_REQUEST 4039 | 163 #define OPUS_GET_LAST_PACKET_DURATION_REQUEST 4039 |
164 #define OPUS_SET_EXPERT_FRAME_DURATION_REQUEST 4040 | 164 #define OPUS_SET_EXPERT_FRAME_DURATION_REQUEST 4040 |
165 #define OPUS_GET_EXPERT_FRAME_DURATION_REQUEST 4041 | 165 #define OPUS_GET_EXPERT_FRAME_DURATION_REQUEST 4041 |
166 #define OPUS_SET_PREDICTION_DISABLED_REQUEST 4042 | 166 #define OPUS_SET_PREDICTION_DISABLED_REQUEST 4042 |
167 #define OPUS_GET_PREDICTION_DISABLED_REQUEST 4043 | 167 #define OPUS_GET_PREDICTION_DISABLED_REQUEST 4043 |
168 | |
169 /* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */ | 168 /* Don't use 4045, it's already taken by OPUS_GET_GAIN_REQUEST */ |
| 169 #define OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST 4046 |
| 170 #define OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST 4047 |
170 | 171 |
171 /* Macros to trigger compilation errors when the wrong types are provided to a C
TL */ | 172 /* Macros to trigger compilation errors when the wrong types are provided to a C
TL */ |
172 #define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x)) | 173 #define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x)) |
173 #define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr))) | 174 #define __opus_check_int_ptr(ptr) ((ptr) + ((ptr) - (opus_int32*)(ptr))) |
174 #define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr))) | 175 #define __opus_check_uint_ptr(ptr) ((ptr) + ((ptr) - (opus_uint32*)(ptr))) |
175 #define __opus_check_val16_ptr(ptr) ((ptr) + ((ptr) - (opus_val16*)(ptr))) | 176 #define __opus_check_val16_ptr(ptr) ((ptr) + ((ptr) - (opus_val16*)(ptr))) |
176 /** @endcond */ | 177 /** @endcond */ |
177 | 178 |
178 /** @defgroup opus_ctlvalues Pre-defined values for CTL interface | 179 /** @defgroup opus_ctlvalues Pre-defined values for CTL interface |
179 * @see opus_genericctls, opus_encoderctls | 180 * @see opus_genericctls, opus_encoderctls |
(...skipping 21 matching lines...) Expand all Loading... |
201 #define OPUS_BANDWIDTH_SUPERWIDEBAND 1104 /**<12 kHz bandpass @hideiniti
alizer*/ | 202 #define OPUS_BANDWIDTH_SUPERWIDEBAND 1104 /**<12 kHz bandpass @hideiniti
alizer*/ |
202 #define OPUS_BANDWIDTH_FULLBAND 1105 /**<20 kHz bandpass @hideiniti
alizer*/ | 203 #define OPUS_BANDWIDTH_FULLBAND 1105 /**<20 kHz bandpass @hideiniti
alizer*/ |
203 | 204 |
204 #define OPUS_FRAMESIZE_ARG 5000 /**< Select frame size from th
e argument (default) */ | 205 #define OPUS_FRAMESIZE_ARG 5000 /**< Select frame size from th
e argument (default) */ |
205 #define OPUS_FRAMESIZE_2_5_MS 5001 /**< Use 2.5 ms frames */ | 206 #define OPUS_FRAMESIZE_2_5_MS 5001 /**< Use 2.5 ms frames */ |
206 #define OPUS_FRAMESIZE_5_MS 5002 /**< Use 5 ms frames */ | 207 #define OPUS_FRAMESIZE_5_MS 5002 /**< Use 5 ms frames */ |
207 #define OPUS_FRAMESIZE_10_MS 5003 /**< Use 10 ms frames */ | 208 #define OPUS_FRAMESIZE_10_MS 5003 /**< Use 10 ms frames */ |
208 #define OPUS_FRAMESIZE_20_MS 5004 /**< Use 20 ms frames */ | 209 #define OPUS_FRAMESIZE_20_MS 5004 /**< Use 20 ms frames */ |
209 #define OPUS_FRAMESIZE_40_MS 5005 /**< Use 40 ms frames */ | 210 #define OPUS_FRAMESIZE_40_MS 5005 /**< Use 40 ms frames */ |
210 #define OPUS_FRAMESIZE_60_MS 5006 /**< Use 60 ms frames */ | 211 #define OPUS_FRAMESIZE_60_MS 5006 /**< Use 60 ms frames */ |
| 212 #define OPUS_FRAMESIZE_80_MS 5007 /**< Use 80 ms frames */ |
| 213 #define OPUS_FRAMESIZE_100_MS 5008 /**< Use 100 ms frames */ |
| 214 #define OPUS_FRAMESIZE_120_MS 5009 /**< Use 120 ms frames */ |
211 | 215 |
212 /**@}*/ | 216 /**@}*/ |
213 | 217 |
214 | 218 |
215 /** @defgroup opus_encoderctls Encoder related CTLs | 219 /** @defgroup opus_encoderctls Encoder related CTLs |
216 * | 220 * |
217 * These are convenience macros for use with the \c opus_encode_ctl | 221 * These are convenience macros for use with the \c opus_encode_ctl |
218 * interface. They are used to generate the appropriate series of | 222 * interface. They are used to generate the appropriate series of |
219 * arguments for that call, passing the correct type, size and so | 223 * arguments for that call, passing the correct type, size and so |
220 * on as expected for each particular request. | 224 * on as expected for each particular request. |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 * @see OPUS_GET_EXPERT_FRAME_DURATION | 563 * @see OPUS_GET_EXPERT_FRAME_DURATION |
560 * @param[in] x <tt>opus_int32</tt>: Allowed values: | 564 * @param[in] x <tt>opus_int32</tt>: Allowed values: |
561 * <dl> | 565 * <dl> |
562 * <dt>OPUS_FRAMESIZE_ARG</dt><dd>Select frame size from the argument (default)
.</dd> | 566 * <dt>OPUS_FRAMESIZE_ARG</dt><dd>Select frame size from the argument (default)
.</dd> |
563 * <dt>OPUS_FRAMESIZE_2_5_MS</dt><dd>Use 2.5 ms frames.</dd> | 567 * <dt>OPUS_FRAMESIZE_2_5_MS</dt><dd>Use 2.5 ms frames.</dd> |
564 * <dt>OPUS_FRAMESIZE_5_MS</dt><dd>Use 5 ms frames.</dd> | 568 * <dt>OPUS_FRAMESIZE_5_MS</dt><dd>Use 5 ms frames.</dd> |
565 * <dt>OPUS_FRAMESIZE_10_MS</dt><dd>Use 10 ms frames.</dd> | 569 * <dt>OPUS_FRAMESIZE_10_MS</dt><dd>Use 10 ms frames.</dd> |
566 * <dt>OPUS_FRAMESIZE_20_MS</dt><dd>Use 20 ms frames.</dd> | 570 * <dt>OPUS_FRAMESIZE_20_MS</dt><dd>Use 20 ms frames.</dd> |
567 * <dt>OPUS_FRAMESIZE_40_MS</dt><dd>Use 40 ms frames.</dd> | 571 * <dt>OPUS_FRAMESIZE_40_MS</dt><dd>Use 40 ms frames.</dd> |
568 * <dt>OPUS_FRAMESIZE_60_MS</dt><dd>Use 60 ms frames.</dd> | 572 * <dt>OPUS_FRAMESIZE_60_MS</dt><dd>Use 60 ms frames.</dd> |
569 * <dt>OPUS_FRAMESIZE_VARIABLE</dt><dd>Optimize the frame size dynamically.</dd
> | 573 * <dt>OPUS_FRAMESIZE_80_MS</dt><dd>Use 80 ms frames.</dd> |
| 574 * <dt>OPUS_FRAMESIZE_100_MS</dt><dd>Use 100 ms frames.</dd> |
| 575 * <dt>OPUS_FRAMESIZE_120_MS</dt><dd>Use 120 ms frames.</dd> |
570 * </dl> | 576 * </dl> |
571 * @hideinitializer */ | 577 * @hideinitializer */ |
572 #define OPUS_SET_EXPERT_FRAME_DURATION(x) OPUS_SET_EXPERT_FRAME_DURATION_REQUEST
, __opus_check_int(x) | 578 #define OPUS_SET_EXPERT_FRAME_DURATION(x) OPUS_SET_EXPERT_FRAME_DURATION_REQUEST
, __opus_check_int(x) |
573 /** Gets the encoder's configured use of variable duration frames. | 579 /** Gets the encoder's configured use of variable duration frames. |
574 * @see OPUS_SET_EXPERT_FRAME_DURATION | 580 * @see OPUS_SET_EXPERT_FRAME_DURATION |
575 * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: | 581 * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: |
576 * <dl> | 582 * <dl> |
577 * <dt>OPUS_FRAMESIZE_ARG</dt><dd>Select frame size from the argument (default)
.</dd> | 583 * <dt>OPUS_FRAMESIZE_ARG</dt><dd>Select frame size from the argument (default)
.</dd> |
578 * <dt>OPUS_FRAMESIZE_2_5_MS</dt><dd>Use 2.5 ms frames.</dd> | 584 * <dt>OPUS_FRAMESIZE_2_5_MS</dt><dd>Use 2.5 ms frames.</dd> |
579 * <dt>OPUS_FRAMESIZE_5_MS</dt><dd>Use 5 ms frames.</dd> | 585 * <dt>OPUS_FRAMESIZE_5_MS</dt><dd>Use 5 ms frames.</dd> |
580 * <dt>OPUS_FRAMESIZE_10_MS</dt><dd>Use 10 ms frames.</dd> | 586 * <dt>OPUS_FRAMESIZE_10_MS</dt><dd>Use 10 ms frames.</dd> |
581 * <dt>OPUS_FRAMESIZE_20_MS</dt><dd>Use 20 ms frames.</dd> | 587 * <dt>OPUS_FRAMESIZE_20_MS</dt><dd>Use 20 ms frames.</dd> |
582 * <dt>OPUS_FRAMESIZE_40_MS</dt><dd>Use 40 ms frames.</dd> | 588 * <dt>OPUS_FRAMESIZE_40_MS</dt><dd>Use 40 ms frames.</dd> |
583 * <dt>OPUS_FRAMESIZE_60_MS</dt><dd>Use 60 ms frames.</dd> | 589 * <dt>OPUS_FRAMESIZE_60_MS</dt><dd>Use 60 ms frames.</dd> |
584 * <dt>OPUS_FRAMESIZE_VARIABLE</dt><dd>Optimize the frame size dynamically.</dd
> | 590 * <dt>OPUS_FRAMESIZE_80_MS</dt><dd>Use 80 ms frames.</dd> |
| 591 * <dt>OPUS_FRAMESIZE_100_MS</dt><dd>Use 100 ms frames.</dd> |
| 592 * <dt>OPUS_FRAMESIZE_120_MS</dt><dd>Use 120 ms frames.</dd> |
585 * </dl> | 593 * </dl> |
586 * @hideinitializer */ | 594 * @hideinitializer */ |
587 #define OPUS_GET_EXPERT_FRAME_DURATION(x) OPUS_GET_EXPERT_FRAME_DURATION_REQUEST
, __opus_check_int_ptr(x) | 595 #define OPUS_GET_EXPERT_FRAME_DURATION(x) OPUS_GET_EXPERT_FRAME_DURATION_REQUEST
, __opus_check_int_ptr(x) |
588 | 596 |
589 /** If set to 1, disables almost all use of prediction, making frames almost | 597 /** If set to 1, disables almost all use of prediction, making frames almost |
590 * completely independent. This reduces quality. | 598 * completely independent. This reduces quality. |
591 * @see OPUS_GET_PREDICTION_DISABLED | 599 * @see OPUS_GET_PREDICTION_DISABLED |
592 * @param[in] x <tt>opus_int32</tt>: Allowed values: | 600 * @param[in] x <tt>opus_int32</tt>: Allowed values: |
593 * <dl> | 601 * <dl> |
594 * <dt>0</dt><dd>Enable prediction (default).</dd> | 602 * <dt>0</dt><dd>Enable prediction (default).</dd> |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 #define OPUS_GET_BANDWIDTH(x) OPUS_GET_BANDWIDTH_REQUEST, __opus_check_int_ptr(x
) | 682 #define OPUS_GET_BANDWIDTH(x) OPUS_GET_BANDWIDTH_REQUEST, __opus_check_int_ptr(x
) |
675 | 683 |
676 /** Gets the sampling rate the encoder or decoder was initialized with. | 684 /** Gets the sampling rate the encoder or decoder was initialized with. |
677 * This simply returns the <code>Fs</code> value passed to opus_encoder_init() | 685 * This simply returns the <code>Fs</code> value passed to opus_encoder_init() |
678 * or opus_decoder_init(). | 686 * or opus_decoder_init(). |
679 * @param[out] x <tt>opus_int32 *</tt>: Sampling rate of encoder or decoder. | 687 * @param[out] x <tt>opus_int32 *</tt>: Sampling rate of encoder or decoder. |
680 * @hideinitializer | 688 * @hideinitializer |
681 */ | 689 */ |
682 #define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_p
tr(x) | 690 #define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_p
tr(x) |
683 | 691 |
| 692 /** If set to 1, disables the use of phase inversion for intensity stereo, |
| 693 * improving the quality of mono downmixes, but slightly reducing normal |
| 694 * stereo quality. Disabling phase inversion in the decoder does not comply |
| 695 * with RFC 6716, although it does not cause any interoperability issue and |
| 696 * is expected to become part of the Opus standard once RFC 6716 is updated |
| 697 * by draft-ietf-codec-opus-update. |
| 698 * @see OPUS_GET_PHASE_INVERSION_DISABLED |
| 699 * @param[in] x <tt>opus_int32</tt>: Allowed values: |
| 700 * <dl> |
| 701 * <dt>0</dt><dd>Enable phase inversion (default).</dd> |
| 702 * <dt>1</dt><dd>Disable phase inversion.</dd> |
| 703 * </dl> |
| 704 * @hideinitializer */ |
| 705 #define OPUS_SET_PHASE_INVERSION_DISABLED(x) OPUS_SET_PHASE_INVERSION_DISABLED_R
EQUEST, __opus_check_int(x) |
| 706 /** Gets the encoder's configured phase inversion status. |
| 707 * @see OPUS_SET_PHASE_INVERSION_DISABLED |
| 708 * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: |
| 709 * <dl> |
| 710 * <dt>0</dt><dd>Stereo phase inversion enabled (default).</dd> |
| 711 * <dt>1</dt><dd>Stereo phase inversion disabled.</dd> |
| 712 * </dl> |
| 713 * @hideinitializer */ |
| 714 #define OPUS_GET_PHASE_INVERSION_DISABLED(x) OPUS_GET_PHASE_INVERSION_DISABLED_R
EQUEST, __opus_check_int_ptr(x) |
| 715 |
684 /**@}*/ | 716 /**@}*/ |
685 | 717 |
686 /** @defgroup opus_decoderctls Decoder related CTLs | 718 /** @defgroup opus_decoderctls Decoder related CTLs |
687 * @see opus_genericctls, opus_encoderctls, opus_decoder | 719 * @see opus_genericctls, opus_encoderctls, opus_decoder |
688 * @{ | 720 * @{ |
689 */ | 721 */ |
690 | 722 |
691 /** Configures decoder gain adjustment. | 723 /** Configures decoder gain adjustment. |
692 * Scales the decoded output by a factor specified in Q8 dB units. | 724 * Scales the decoded output by a factor specified in Q8 dB units. |
693 * This has a maximum range of -32768 to 32767 inclusive, and returns | 725 * This has a maximum range of -32768 to 32767 inclusive, and returns |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 * @returns Version string | 776 * @returns Version string |
745 */ | 777 */ |
746 OPUS_EXPORT const char *opus_get_version_string(void); | 778 OPUS_EXPORT const char *opus_get_version_string(void); |
747 /**@}*/ | 779 /**@}*/ |
748 | 780 |
749 #ifdef __cplusplus | 781 #ifdef __cplusplus |
750 } | 782 } |
751 #endif | 783 #endif |
752 | 784 |
753 #endif /* OPUS_DEFINES_H */ | 785 #endif /* OPUS_DEFINES_H */ |
OLD | NEW |