| 1 | /* Copyright (c) 2012 Xiph.Org Foundation |
| 2 | Written by Jean-Marc Valin */ |
| 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 | #ifndef OPUS_PRIVATE_H |
| 30 | #define OPUS_PRIVATE_Hcxx . . $ `external/opusfile/opus/opus_private.h:30:9`! |
| 31 | |
| 32 | #include "arch.h"cxx . . $ `<file>/external/opusfile/opus/celt/arch.h`/ |
| 33 | #include "opus.h"cxx . . $ `<file>/external/opusfile/opus/opus.h`/ |
| 34 | #include "celt.h"cxx . . $ `<file>/external/opusfile/opus/celt/celt.h`/ |
| 35 | |
| 36 | #include <stdarg.h> /* va_list */ |
| 37 | #include <stddef.h> /* offsetof */ |
| 38 | |
| 39 | struct OpusRepacketizercxx . . $ OpusRepacketizer# { |
| 40 | unsigned char toccxx . . $ OpusRepacketizer#toc.; |
| 41 | int nb_framescxx . . $ OpusRepacketizer#nb_frames.; |
| 42 | const unsigned char *framescxx . . $ OpusRepacketizer#frames.[48]; |
| 43 | opus_int16cxx . . $ opus_int16# lencxx . . $ OpusRepacketizer#len.[48]; |
| 44 | int framesizecxx . . $ OpusRepacketizer#framesize.; |
| 45 | }; |
| 46 | |
| 47 | typedef struct ChannelLayoutcxx . . $ ChannelLayout# { |
| 48 | int nb_channelscxx . . $ ChannelLayout#nb_channels.; |
| 49 | int nb_streamscxx . . $ ChannelLayout#nb_streams.; |
| 50 | int nb_coupled_streamscxx . . $ ChannelLayout#nb_coupled_streams.; |
| 51 | unsigned char mappingcxx . . $ ChannelLayout#mapping.[256]; |
| 52 | } ChannelLayoutcxx . . $ ChannelLayout#; |
| 53 | |
| 54 | typedef enumcxx . . $ $anonymous_type_fdbc8521326b0335_0# { |
| 55 | MAPPING_TYPE_NONEcxx . . $ MAPPING_TYPE_NONE., |
| 56 | MAPPING_TYPE_SURROUNDcxx . . $ MAPPING_TYPE_SURROUND., |
| 57 | MAPPING_TYPE_AMBISONICScxx . . $ MAPPING_TYPE_AMBISONICS. |
| 58 | } MappingTypecxx . . $ MappingType#; |
| 59 | |
| 60 | struct OpusMSEncodercxx . . $ OpusMSEncoder# { |
| 61 | ChannelLayoutcxx . . $ ChannelLayout# layoutcxx . . $ OpusMSEncoder#layout.; |
| 62 | int archcxx . . $ OpusMSEncoder#arch.; |
| 63 | int lfe_streamcxx . . $ OpusMSEncoder#lfe_stream.; |
| 64 | int applicationcxx . . $ OpusMSEncoder#application.; |
| 65 | int variable_durationcxx . . $ OpusMSEncoder#variable_duration.; |
| 66 | MappingTypecxx . . $ MappingType# mapping_typecxx . . $ OpusMSEncoder#mapping_type.; |
| 67 | opus_int32cxx . . $ opus_int32# bitrate_bpscxx . . $ OpusMSEncoder#bitrate_bps.; |
| 68 | /* Encoder states go here */ |
| 69 | /* then opus_val32 window_mem[channels*120]; */ |
| 70 | /* then opus_val32 preemph_mem[channels]; */ |
| 71 | }; |
| 72 | |
| 73 | struct OpusMSDecodercxx . . $ OpusMSDecoder# { |
| 74 | ChannelLayoutcxx . . $ ChannelLayout# layoutcxx . . $ OpusMSDecoder#layout.; |
| 75 | /* Decoder states go here */ |
| 76 | }; |
| 77 | |
| 78 | int opus_multistream_encoder_ctl_va_listcxx . . $ opus_multistream_encoder_ctl_va_list(e0055f3d115702b).(struct OpusMSEncodercxx . . $ OpusMSEncoder# *st, int request, |
| 79 | va_listcxx . . $ va_list# ap); |
| 80 | int opus_multistream_decoder_ctl_va_listcxx . . $ opus_multistream_decoder_ctl_va_list(d032d9922d7f399f).(struct OpusMSDecodercxx . . $ OpusMSDecoder# *st, int request, |
| 81 | va_listcxx . . $ va_list# ap); |
| 82 | |
| 83 | int validate_layoutcxx . . $ validate_layout(a0a3f1359841bb08).(const ChannelLayoutcxx . . $ ChannelLayout# *layout); |
| 84 | int get_left_channelcxx . . $ get_left_channel(f091a8981cec74a0).(const ChannelLayoutcxx . . $ ChannelLayout# *layout, int stream_id, int prev); |
| 85 | int get_right_channelcxx . . $ get_right_channel(f091a8981cec74a0).(const ChannelLayoutcxx . . $ ChannelLayout# *layout, int stream_id, int prev); |
| 86 | int get_mono_channelcxx . . $ get_mono_channel(f091a8981cec74a0).(const ChannelLayoutcxx . . $ ChannelLayout# *layout, int stream_id, int prev); |
| 87 | |
| 88 | typedef void (*opus_copy_channel_in_funccxx . . $ opus_copy_channel_in_func#)( |
| 89 | opus_val16cxx . . $ opus_val16# *dst, |
| 90 | int dst_stride, |
| 91 | const void *src, |
| 92 | int src_stride, |
| 93 | int src_channel, |
| 94 | int frame_size, |
| 95 | void *user_data |
| 96 | ); |
| 97 | |
| 98 | typedef void (*opus_copy_channel_out_funccxx . . $ opus_copy_channel_out_func#)( |
| 99 | void *dst, |
| 100 | int dst_stride, |
| 101 | int dst_channel, |
| 102 | const opus_val16cxx . . $ opus_val16# *src, |
| 103 | int src_stride, |
| 104 | int frame_size, |
| 105 | void *user_data |
| 106 | ); |
| 107 | |
| 108 | #define MODE_SILK_ONLYcxx . . $ `external/opusfile/opus/opus_private.h:108:9`! 1000 |
| 109 | #define MODE_HYBRIDcxx . . $ `external/opusfile/opus/opus_private.h:109:9`! 1001 |
| 110 | #define MODE_CELT_ONLYcxx . . $ `external/opusfile/opus/opus_private.h:110:9`! 1002 |
| 111 | |
| 112 | #define OPUS_SET_VOICE_RATIO_REQUESTcxx . . $ `external/opusfile/opus/opus_private.h:112:9`! 11018 |
| 113 | #define OPUS_GET_VOICE_RATIO_REQUESTcxx . . $ `external/opusfile/opus/opus_private.h:113:9`! 11019 |
| 114 | |
| 115 | /** Configures the encoder's expected percentage of voice |
| 116 | * opposed to music or other signals. |
| 117 | * |
| 118 | * @note This interface is currently more aspiration than actuality. It's |
| 119 | * ultimately expected to bias an automatic signal classifier, but it currently |
| 120 | * just shifts the static bitrate to mode mapping around a little bit. |
| 121 | * |
| 122 | * @param[in] x <tt>int</tt>: Voice percentage in the range 0-100, inclusive. |
| 123 | * @hideinitializer */ |
| 124 | #define OPUS_SET_VOICE_RATIOcxx . . $ `external/opusfile/opus/opus_private.h:124:9`!(x) OPUS_SET_VOICE_RATIO_REQUEST, __opus_check_int(x) |
| 125 | /** Gets the encoder's configured voice ratio value, @see OPUS_SET_VOICE_RATIO |
| 126 | * |
| 127 | * @param[out] x <tt>int*</tt>: Voice percentage in the range 0-100, inclusive. |
| 128 | * @hideinitializer */ |
| 129 | #define OPUS_GET_VOICE_RATIOcxx . . $ `external/opusfile/opus/opus_private.h:129:9`!(x) OPUS_GET_VOICE_RATIO_REQUEST, __opus_check_int_ptr(x) |
| 130 | |
| 131 | |
| 132 | #define OPUS_SET_FORCE_MODE_REQUESTcxx . . $ `external/opusfile/opus/opus_private.h:132:9`! 11002 |
| 133 | #define OPUS_SET_FORCE_MODEcxx . . $ `external/opusfile/opus/opus_private.h:133:9`!(x) OPUS_SET_FORCE_MODE_REQUEST, __opus_check_int(x) |
| 134 | |
| 135 | typedef void (*downmix_funccxx . . $ downmix_func#)(const void *, opus_val32cxx . . $ opus_val32# *, int, int, int, int, int); |
| 136 | void downmix_floatcxx . . $ downmix_float(c77ecc0b40126b33).(const void *_x, opus_val32cxx . . $ opus_val32# *sub, int subframe, int offset, int c1, int c2, int C); |
| 137 | void downmix_intcxx . . $ downmix_int(c77ecc0b40126b33).(const void *_x, opus_val32cxx . . $ opus_val32# *sub, int subframe, int offset, int c1, int c2, int C); |
| 138 | int is_digital_silencecxx . . $ is_digital_silence(36975256c12ef0ca).(const opus_val16cxx . . $ opus_val16#* pcm, int frame_size, int channels, int lsb_depth); |
| 139 | |
| 140 | int encode_sizecxx . . $ encode_size(b2cc8657ba51080d).(int size, unsigned char *data); |
| 141 | |
| 142 | opus_int32cxx . . $ opus_int32# frame_size_selectcxx . . $ frame_size_select(2326284602b0bb2d).(opus_int32cxx . . $ opus_int32# frame_size, int variable_duration, opus_int32cxx . . $ opus_int32# Fs); |
| 143 | |
| 144 | opus_int32cxx . . $ opus_int32# opus_encode_nativecxx . . $ opus_encode_native(bef6c4c2dba72fda).(OpusEncodercxx . . $ OpusEncoder# *st, const opus_val16cxx . . $ opus_val16# *pcm, int frame_size, |
| 145 | unsigned char *data, opus_int32cxx . . $ opus_int32# out_data_bytes, int lsb_depth, |
| 146 | const void *analysis_pcm, opus_int32cxx . . $ opus_int32# analysis_size, int c1, int c2, |
| 147 | int analysis_channels, downmix_funccxx . . $ downmix_func# downmix, int float_api); |
| 148 | |
| 149 | int opus_decode_nativecxx . . $ opus_decode_native(6e6dc8054156a6af).(OpusDecodercxx . . $ OpusDecoder# *st, const unsigned char *data, opus_int32cxx . . $ opus_int32# len, |
| 150 | opus_val16cxx . . $ opus_val16# *pcm, int frame_size, int decode_fec, int self_delimited, |
| 151 | opus_int32cxx . . $ opus_int32# *packet_offset, int soft_clip); |
| 152 | |
| 153 | /* Make sure everything is properly aligned. */ |
| 154 | static OPUS_INLINEcxx . . $ `external/opusfile/opus/opus_defines.h:110:10`! int aligncxx . . $ align(7864480464b09eea).(int i) |
| 155 | { |
| 156 | struct foocxx . . $ align(7864480464b09eea).foo# {char ccxx . . $ align(7864480464b09eea).foo#c.; unioncxx . . $ align(7864480464b09eea).foo#$anonymous_type_1# { void* pcxx . . $ align(7864480464b09eea).foo#$anonymous_type_1#p.; opus_int32cxx . . $ opus_int32# icxx . . $ align(7864480464b09eea).foo#$anonymous_type_1#i.; opus_val32cxx . . $ opus_val32# vcxx . . $ align(7864480464b09eea).foo#$anonymous_type_1#v.; } ucxx . . $ align(7864480464b09eea).foo#u.;}; |
| 157 | |
| 158 | unsigned int alignment = offsetofcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:431:9`!(struct foo, u); |
| 159 | |
| 160 | /* Optimizing compilers should optimize div and multiply into and |
| 161 | for all sensible alignment values. */ |
| 162 | return ((i + alignment - 1) / alignment) * alignment; |
| 163 | } |
| 164 | |
| 165 | int opus_packet_parse_implcxx . . $ opus_packet_parse_impl(58cc79780d799092).(const unsigned char *data, opus_int32cxx . . $ opus_int32# len, |
| 166 | int self_delimited, unsigned char *out_toc, |
| 167 | const unsigned char *frames[48], opus_int16cxx . . $ opus_int16# size[48], |
| 168 | int *payload_offset, opus_int32cxx . . $ opus_int32# *packet_offset); |
| 169 | |
| 170 | opus_int32cxx . . $ opus_int32# opus_repacketizer_out_range_implcxx . . $ opus_repacketizer_out_range_impl(8f16a85a9c7eca7).(OpusRepacketizercxx . . $ OpusRepacketizer# *rp, int begin, int end, |
| 171 | unsigned char *data, opus_int32cxx . . $ opus_int32# maxlen, int self_delimited, int pad); |
| 172 | |
| 173 | int pad_framecxx . . $ pad_frame(c2394cdaf83c3d9).(unsigned char *data, opus_int32cxx . . $ opus_int32# len, opus_int32cxx . . $ opus_int32# new_len); |
| 174 | |
| 175 | int opus_multistream_encode_nativecxx . . $ opus_multistream_encode_native(e2c3d87e3dd872da). |
| 176 | ( |
| 177 | struct OpusMSEncodercxx . . $ OpusMSEncoder# *st, |
| 178 | opus_copy_channel_in_funccxx . . $ opus_copy_channel_in_func# copy_channel_in, |
| 179 | const void *pcm, |
| 180 | int analysis_frame_size, |
| 181 | unsigned char *data, |
| 182 | opus_int32cxx . . $ opus_int32# max_data_bytes, |
| 183 | int lsb_depth, |
| 184 | downmix_funccxx . . $ downmix_func# downmix, |
| 185 | int float_api, |
| 186 | void *user_data |
| 187 | ); |
| 188 | |
| 189 | int opus_multistream_decode_nativecxx . . $ opus_multistream_decode_native(cb7d28c34cf5aff9).( |
| 190 | struct OpusMSDecodercxx . . $ OpusMSDecoder# *st, |
| 191 | const unsigned char *data, |
| 192 | opus_int32cxx . . $ opus_int32# len, |
| 193 | void *pcm, |
| 194 | opus_copy_channel_out_funccxx . . $ opus_copy_channel_out_func# copy_channel_out, |
| 195 | int frame_size, |
| 196 | int decode_fec, |
| 197 | int soft_clip, |
| 198 | void *user_data |
| 199 | ); |
| 200 | |
| 201 | #endif /* OPUS_PRIVATE_H */ |