diff options
Diffstat (limited to 'lib/rbcodec/codecs/libopus/opus_defines.h')
-rw-r--r-- | lib/rbcodec/codecs/libopus/opus_defines.h | 90 |
1 files changed, 76 insertions, 14 deletions
diff --git a/lib/rbcodec/codecs/libopus/opus_defines.h b/lib/rbcodec/codecs/libopus/opus_defines.h index 84df7c7a18..fbf5d0eb74 100644 --- a/lib/rbcodec/codecs/libopus/opus_defines.h +++ b/lib/rbcodec/codecs/libopus/opus_defines.h | |||
@@ -46,7 +46,7 @@ extern "C" { | |||
46 | #define OPUS_OK 0 | 46 | #define OPUS_OK 0 |
47 | /** One or more invalid/out of range arguments @hideinitializer*/ | 47 | /** One or more invalid/out of range arguments @hideinitializer*/ |
48 | #define OPUS_BAD_ARG -1 | 48 | #define OPUS_BAD_ARG -1 |
49 | /** The mode struct passed is invalid @hideinitializer*/ | 49 | /** Not enough bytes allocated in the buffer @hideinitializer*/ |
50 | #define OPUS_BUFFER_TOO_SMALL -2 | 50 | #define OPUS_BUFFER_TOO_SMALL -2 |
51 | /** An internal error was detected @hideinitializer*/ | 51 | /** An internal error was detected @hideinitializer*/ |
52 | #define OPUS_INTERNAL_ERROR -3 | 52 | #define OPUS_INTERNAL_ERROR -3 |
@@ -65,7 +65,7 @@ extern "C" { | |||
65 | 65 | ||
66 | #ifndef OPUS_EXPORT | 66 | #ifndef OPUS_EXPORT |
67 | # if defined(WIN32) | 67 | # if defined(WIN32) |
68 | # ifdef OPUS_BUILD | 68 | # if defined(OPUS_BUILD) && defined(DLL_EXPORT) |
69 | # define OPUS_EXPORT __declspec(dllexport) | 69 | # define OPUS_EXPORT __declspec(dllexport) |
70 | # else | 70 | # else |
71 | # define OPUS_EXPORT | 71 | # define OPUS_EXPORT |
@@ -165,8 +165,12 @@ extern "C" { | |||
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 | ||
171 | |||
172 | /** Defines for the presence of extended APIs. */ | ||
173 | #define OPUS_HAVE_OPUS_PROJECTION_H | ||
170 | 174 | ||
171 | /* Macros to trigger compilation errors when the wrong types are provided to a CTL */ | 175 | /* Macros to trigger compilation errors when the wrong types are provided to a CTL */ |
172 | #define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x)) | 176 | #define __opus_check_int(x) (((void)((x) == (opus_int32)0)), (opus_int32)(x)) |
@@ -208,6 +212,9 @@ extern "C" { | |||
208 | #define OPUS_FRAMESIZE_20_MS 5004 /**< Use 20 ms frames */ | 212 | #define OPUS_FRAMESIZE_20_MS 5004 /**< Use 20 ms frames */ |
209 | #define OPUS_FRAMESIZE_40_MS 5005 /**< Use 40 ms frames */ | 213 | #define OPUS_FRAMESIZE_40_MS 5005 /**< Use 40 ms frames */ |
210 | #define OPUS_FRAMESIZE_60_MS 5006 /**< Use 60 ms frames */ | 214 | #define OPUS_FRAMESIZE_60_MS 5006 /**< Use 60 ms frames */ |
215 | #define OPUS_FRAMESIZE_80_MS 5007 /**< Use 80 ms frames */ | ||
216 | #define OPUS_FRAMESIZE_100_MS 5008 /**< Use 100 ms frames */ | ||
217 | #define OPUS_FRAMESIZE_120_MS 5009 /**< Use 120 ms frames */ | ||
211 | 218 | ||
212 | /**@}*/ | 219 | /**@}*/ |
213 | 220 | ||
@@ -274,7 +281,6 @@ extern "C" { | |||
274 | /** Enables or disables variable bitrate (VBR) in the encoder. | 281 | /** Enables or disables variable bitrate (VBR) in the encoder. |
275 | * The configured bitrate may not be met exactly because frames must | 282 | * The configured bitrate may not be met exactly because frames must |
276 | * be an integer number of bytes in length. | 283 | * be an integer number of bytes in length. |
277 | * @warning Only the MDCT mode of Opus can provide hard CBR behavior. | ||
278 | * @see OPUS_GET_VBR | 284 | * @see OPUS_GET_VBR |
279 | * @see OPUS_SET_VBR_CONSTRAINT | 285 | * @see OPUS_SET_VBR_CONSTRAINT |
280 | * @param[in] x <tt>opus_int32</tt>: Allowed values: | 286 | * @param[in] x <tt>opus_int32</tt>: Allowed values: |
@@ -490,9 +496,9 @@ extern "C" { | |||
490 | #define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x) | 496 | #define OPUS_GET_INBAND_FEC(x) OPUS_GET_INBAND_FEC_REQUEST, __opus_check_int_ptr(x) |
491 | 497 | ||
492 | /** Configures the encoder's expected packet loss percentage. | 498 | /** Configures the encoder's expected packet loss percentage. |
493 | * Higher values with trigger progressively more loss resistant behavior in the encoder | 499 | * Higher values trigger progressively more loss resistant behavior in the encoder |
494 | * at the expense of quality at a given bitrate in the lossless case, but greater quality | 500 | * at the expense of quality at a given bitrate in the absence of packet loss, but |
495 | * under loss. | 501 | * greater quality under loss. |
496 | * @see OPUS_GET_PACKET_LOSS_PERC | 502 | * @see OPUS_GET_PACKET_LOSS_PERC |
497 | * @param[in] x <tt>opus_int32</tt>: Loss percentage in the range 0-100, inclusive (default: 0). | 503 | * @param[in] x <tt>opus_int32</tt>: Loss percentage in the range 0-100, inclusive (default: 0). |
498 | * @hideinitializer */ | 504 | * @hideinitializer */ |
@@ -524,7 +530,19 @@ extern "C" { | |||
524 | * @hideinitializer */ | 530 | * @hideinitializer */ |
525 | #define OPUS_GET_DTX(x) OPUS_GET_DTX_REQUEST, __opus_check_int_ptr(x) | 531 | #define OPUS_GET_DTX(x) OPUS_GET_DTX_REQUEST, __opus_check_int_ptr(x) |
526 | /** Configures the depth of signal being encoded. | 532 | /** Configures the depth of signal being encoded. |
533 | * | ||
527 | * This is a hint which helps the encoder identify silence and near-silence. | 534 | * This is a hint which helps the encoder identify silence and near-silence. |
535 | * It represents the number of significant bits of linear intensity below | ||
536 | * which the signal contains ignorable quantization or other noise. | ||
537 | * | ||
538 | * For example, OPUS_SET_LSB_DEPTH(14) would be an appropriate setting | ||
539 | * for G.711 u-law input. OPUS_SET_LSB_DEPTH(16) would be appropriate | ||
540 | * for 16-bit linear pcm input with opus_encode_float(). | ||
541 | * | ||
542 | * When using opus_encode() instead of opus_encode_float(), or when libopus | ||
543 | * is compiled for fixed-point, the encoder uses the minimum of the value | ||
544 | * set here and the value 16. | ||
545 | * | ||
528 | * @see OPUS_GET_LSB_DEPTH | 546 | * @see OPUS_GET_LSB_DEPTH |
529 | * @param[in] x <tt>opus_int32</tt>: Input precision in bits, between 8 and 24 | 547 | * @param[in] x <tt>opus_int32</tt>: Input precision in bits, between 8 and 24 |
530 | * (default: 24). | 548 | * (default: 24). |
@@ -545,41 +563,57 @@ extern "C" { | |||
545 | * packet. The part of the audio that was not encoded needs to be resent to the | 563 | * packet. The part of the audio that was not encoded needs to be resent to the |
546 | * encoder for the next call. Do not use this option unless you <b>really</b> | 564 | * encoder for the next call. Do not use this option unless you <b>really</b> |
547 | * know what you are doing. | 565 | * know what you are doing. |
548 | * @see OPUS_GET_EXPERT_VARIABLE_DURATION | 566 | * @see OPUS_GET_EXPERT_FRAME_DURATION |
549 | * @param[in] x <tt>opus_int32</tt>: Allowed values: | 567 | * @param[in] x <tt>opus_int32</tt>: Allowed values: |
550 | * <dl> | 568 | * <dl> |
551 | * <dt>OPUS_FRAMESIZE_ARG</dt><dd>Select frame size from the argument (default).</dd> | 569 | * <dt>OPUS_FRAMESIZE_ARG</dt><dd>Select frame size from the argument (default).</dd> |
552 | * <dt>OPUS_FRAMESIZE_2_5_MS</dt><dd>Use 2.5 ms frames.</dd> | 570 | * <dt>OPUS_FRAMESIZE_2_5_MS</dt><dd>Use 2.5 ms frames.</dd> |
553 | * <dt>OPUS_FRAMESIZE_5_MS</dt><dd>Use 2.5 ms frames.</dd> | 571 | * <dt>OPUS_FRAMESIZE_5_MS</dt><dd>Use 5 ms frames.</dd> |
554 | * <dt>OPUS_FRAMESIZE_10_MS</dt><dd>Use 10 ms frames.</dd> | 572 | * <dt>OPUS_FRAMESIZE_10_MS</dt><dd>Use 10 ms frames.</dd> |
555 | * <dt>OPUS_FRAMESIZE_20_MS</dt><dd>Use 20 ms frames.</dd> | 573 | * <dt>OPUS_FRAMESIZE_20_MS</dt><dd>Use 20 ms frames.</dd> |
556 | * <dt>OPUS_FRAMESIZE_40_MS</dt><dd>Use 40 ms frames.</dd> | 574 | * <dt>OPUS_FRAMESIZE_40_MS</dt><dd>Use 40 ms frames.</dd> |
557 | * <dt>OPUS_FRAMESIZE_60_MS</dt><dd>Use 60 ms frames.</dd> | 575 | * <dt>OPUS_FRAMESIZE_60_MS</dt><dd>Use 60 ms frames.</dd> |
558 | * <dt>OPUS_FRAMESIZE_VARIABLE</dt><dd>Optimize the frame size dynamically.</dd> | 576 | * <dt>OPUS_FRAMESIZE_80_MS</dt><dd>Use 80 ms frames.</dd> |
577 | * <dt>OPUS_FRAMESIZE_100_MS</dt><dd>Use 100 ms frames.</dd> | ||
578 | * <dt>OPUS_FRAMESIZE_120_MS</dt><dd>Use 120 ms frames.</dd> | ||
559 | * </dl> | 579 | * </dl> |
560 | * @hideinitializer */ | 580 | * @hideinitializer */ |
561 | #define OPUS_SET_EXPERT_FRAME_DURATION(x) OPUS_SET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int(x) | 581 | #define OPUS_SET_EXPERT_FRAME_DURATION(x) OPUS_SET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int(x) |
562 | /** Gets the encoder's configured use of variable duration frames. | 582 | /** Gets the encoder's configured use of variable duration frames. |
563 | * @see OPUS_SET_EXPERT_VARIABLE_DURATION | 583 | * @see OPUS_SET_EXPERT_FRAME_DURATION |
564 | * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: | 584 | * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: |
565 | * <dl> | 585 | * <dl> |
566 | * <dt>OPUS_FRAMESIZE_ARG</dt><dd>Select frame size from the argument (default).</dd> | 586 | * <dt>OPUS_FRAMESIZE_ARG</dt><dd>Select frame size from the argument (default).</dd> |
567 | * <dt>OPUS_FRAMESIZE_2_5_MS</dt><dd>Use 2.5 ms frames.</dd> | 587 | * <dt>OPUS_FRAMESIZE_2_5_MS</dt><dd>Use 2.5 ms frames.</dd> |
568 | * <dt>OPUS_FRAMESIZE_5_MS</dt><dd>Use 2.5 ms frames.</dd> | 588 | * <dt>OPUS_FRAMESIZE_5_MS</dt><dd>Use 5 ms frames.</dd> |
569 | * <dt>OPUS_FRAMESIZE_10_MS</dt><dd>Use 10 ms frames.</dd> | 589 | * <dt>OPUS_FRAMESIZE_10_MS</dt><dd>Use 10 ms frames.</dd> |
570 | * <dt>OPUS_FRAMESIZE_20_MS</dt><dd>Use 20 ms frames.</dd> | 590 | * <dt>OPUS_FRAMESIZE_20_MS</dt><dd>Use 20 ms frames.</dd> |
571 | * <dt>OPUS_FRAMESIZE_40_MS</dt><dd>Use 40 ms frames.</dd> | 591 | * <dt>OPUS_FRAMESIZE_40_MS</dt><dd>Use 40 ms frames.</dd> |
572 | * <dt>OPUS_FRAMESIZE_60_MS</dt><dd>Use 60 ms frames.</dd> | 592 | * <dt>OPUS_FRAMESIZE_60_MS</dt><dd>Use 60 ms frames.</dd> |
573 | * <dt>OPUS_FRAMESIZE_VARIABLE</dt><dd>Optimize the frame size dynamically.</dd> | 593 | * <dt>OPUS_FRAMESIZE_80_MS</dt><dd>Use 80 ms frames.</dd> |
594 | * <dt>OPUS_FRAMESIZE_100_MS</dt><dd>Use 100 ms frames.</dd> | ||
595 | * <dt>OPUS_FRAMESIZE_120_MS</dt><dd>Use 120 ms frames.</dd> | ||
574 | * </dl> | 596 | * </dl> |
575 | * @hideinitializer */ | 597 | * @hideinitializer */ |
576 | #define OPUS_GET_EXPERT_FRAME_DURATION(x) OPUS_GET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int_ptr(x) | 598 | #define OPUS_GET_EXPERT_FRAME_DURATION(x) OPUS_GET_EXPERT_FRAME_DURATION_REQUEST, __opus_check_int_ptr(x) |
577 | 599 | ||
578 | /** If set to 1, disables almost all use of prediction, making frames almost | 600 | /** If set to 1, disables almost all use of prediction, making frames almost |
579 | completely independent. This reduces quality. (default : 0) | 601 | * completely independent. This reduces quality. |
602 | * @see OPUS_GET_PREDICTION_DISABLED | ||
603 | * @param[in] x <tt>opus_int32</tt>: Allowed values: | ||
604 | * <dl> | ||
605 | * <dt>0</dt><dd>Enable prediction (default).</dd> | ||
606 | * <dt>1</dt><dd>Disable prediction.</dd> | ||
607 | * </dl> | ||
580 | * @hideinitializer */ | 608 | * @hideinitializer */ |
581 | #define OPUS_SET_PREDICTION_DISABLED(x) OPUS_SET_PREDICTION_DISABLED_REQUEST, __opus_check_int(x) | 609 | #define OPUS_SET_PREDICTION_DISABLED(x) OPUS_SET_PREDICTION_DISABLED_REQUEST, __opus_check_int(x) |
582 | /** Gets the encoder's configured prediction status. | 610 | /** Gets the encoder's configured prediction status. |
611 | * @see OPUS_SET_PREDICTION_DISABLED | ||
612 | * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: | ||
613 | * <dl> | ||
614 | * <dt>0</dt><dd>Prediction enabled (default).</dd> | ||
615 | * <dt>1</dt><dd>Prediction disabled.</dd> | ||
616 | * </dl> | ||
583 | * @hideinitializer */ | 617 | * @hideinitializer */ |
584 | #define OPUS_GET_PREDICTION_DISABLED(x) OPUS_GET_PREDICTION_DISABLED_REQUEST, __opus_check_int_ptr(x) | 618 | #define OPUS_GET_PREDICTION_DISABLED(x) OPUS_GET_PREDICTION_DISABLED_REQUEST, __opus_check_int_ptr(x) |
585 | 619 | ||
@@ -658,6 +692,30 @@ extern "C" { | |||
658 | */ | 692 | */ |
659 | #define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_ptr(x) | 693 | #define OPUS_GET_SAMPLE_RATE(x) OPUS_GET_SAMPLE_RATE_REQUEST, __opus_check_int_ptr(x) |
660 | 694 | ||
695 | /** If set to 1, disables the use of phase inversion for intensity stereo, | ||
696 | * improving the quality of mono downmixes, but slightly reducing normal | ||
697 | * stereo quality. Disabling phase inversion in the decoder does not comply | ||
698 | * with RFC 6716, although it does not cause any interoperability issue and | ||
699 | * is expected to become part of the Opus standard once RFC 6716 is updated | ||
700 | * by draft-ietf-codec-opus-update. | ||
701 | * @see OPUS_GET_PHASE_INVERSION_DISABLED | ||
702 | * @param[in] x <tt>opus_int32</tt>: Allowed values: | ||
703 | * <dl> | ||
704 | * <dt>0</dt><dd>Enable phase inversion (default).</dd> | ||
705 | * <dt>1</dt><dd>Disable phase inversion.</dd> | ||
706 | * </dl> | ||
707 | * @hideinitializer */ | ||
708 | #define OPUS_SET_PHASE_INVERSION_DISABLED(x) OPUS_SET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int(x) | ||
709 | /** Gets the encoder's configured phase inversion status. | ||
710 | * @see OPUS_SET_PHASE_INVERSION_DISABLED | ||
711 | * @param[out] x <tt>opus_int32 *</tt>: Returns one of the following values: | ||
712 | * <dl> | ||
713 | * <dt>0</dt><dd>Stereo phase inversion enabled (default).</dd> | ||
714 | * <dt>1</dt><dd>Stereo phase inversion disabled.</dd> | ||
715 | * </dl> | ||
716 | * @hideinitializer */ | ||
717 | #define OPUS_GET_PHASE_INVERSION_DISABLED(x) OPUS_GET_PHASE_INVERSION_DISABLED_REQUEST, __opus_check_int_ptr(x) | ||
718 | |||
661 | /**@}*/ | 719 | /**@}*/ |
662 | 720 | ||
663 | /** @defgroup opus_decoderctls Decoder related CTLs | 721 | /** @defgroup opus_decoderctls Decoder related CTLs |
@@ -714,6 +772,10 @@ OPUS_EXPORT const char *opus_strerror(int error); | |||
714 | 772 | ||
715 | /** Gets the libopus version string. | 773 | /** Gets the libopus version string. |
716 | * | 774 | * |
775 | * Applications may look for the substring "-fixed" in the version string to | ||
776 | * determine whether they have a fixed-point or floating-point build at | ||
777 | * runtime. | ||
778 | * | ||
717 | * @returns Version string | 779 | * @returns Version string |
718 | */ | 780 | */ |
719 | OPUS_EXPORT const char *opus_get_version_string(void); | 781 | OPUS_EXPORT const char *opus_get_version_string(void); |