From f6fd120b97ee361821883e57f8ef2f644554728e Mon Sep 17 00:00:00 2001 From: "Jared K. Smith" Date: Fri, 28 Feb 2014 11:50:33 -0500 Subject: [PATCH] Remove most of the third_party directory (all except ilbc) --- third_party/build/os-linux.mak | 12 +- third_party/g7221/common/basic_op.c | 1835 -- third_party/g7221/common/basic_op.h | 117 - third_party/g7221/common/basic_op_i.h | 730 - third_party/g7221/common/common.c | 461 - third_party/g7221/common/config.h | 27 - third_party/g7221/common/count.h | 28 - third_party/g7221/common/defs.h | 205 - third_party/g7221/common/huff_def.h | 53 - third_party/g7221/common/huff_tab.c | 528 - third_party/g7221/common/huff_tab.h | 42 - third_party/g7221/common/tables.c | 298 - third_party/g7221/common/tables.h | 47 - third_party/g7221/common/typedef.h | 32 - third_party/g7221/decode/coef2sam.c | 180 - third_party/g7221/decode/dct4_s.c | 504 - third_party/g7221/decode/dct4_s.h | 856 - third_party/g7221/decode/decoder.c | 1113 - third_party/g7221/encode/dct4_a.c | 367 - third_party/g7221/encode/dct4_a.h | 728 - third_party/g7221/encode/encoder.c | 1125 - third_party/g7221/encode/sam2coef.c | 271 - third_party/gsm/COPYRIGHT | 16 - third_party/gsm/ChangeLog | 92 - third_party/gsm/INSTALL | 99 - third_party/gsm/MACHINES | 11 - third_party/gsm/MANIFEST | 59 - third_party/gsm/Makefile | 494 - third_party/gsm/README | 37 - third_party/gsm/add-test/add_test.c | 353 - third_party/gsm/add-test/add_test.dta | 683 - third_party/gsm/bin/.keep | 0 third_party/gsm/inc/config.h | 37 - third_party/gsm/inc/gsm.h | 71 - third_party/gsm/inc/private.h | 269 - third_party/gsm/inc/proto.h | 65 - third_party/gsm/inc/toast.h | 109 - third_party/gsm/inc/unproto.h | 23 - third_party/gsm/lib/.keep | 0 third_party/gsm/man/bitter.1 | 70 - third_party/gsm/man/gsm.3 | 105 - third_party/gsm/man/gsm_explode.3 | 47 - third_party/gsm/man/gsm_option.3 | 183 - third_party/gsm/man/gsm_print.3 | 52 - third_party/gsm/man/toast.1 | 156 - third_party/gsm/src/add.c | 236 - third_party/gsm/src/code.c | 97 - third_party/gsm/src/debug.c | 76 - third_party/gsm/src/decode.c | 64 - third_party/gsm/src/gsm_create.c | 45 - third_party/gsm/src/gsm_decode.c | 361 - third_party/gsm/src/gsm_destroy.c | 26 - third_party/gsm/src/gsm_encode.c | 451 - third_party/gsm/src/gsm_explode.c | 417 - third_party/gsm/src/gsm_implode.c | 521 - third_party/gsm/src/gsm_option.c | 69 - third_party/gsm/src/gsm_print.c | 167 - third_party/gsm/src/long_term.c | 950 - third_party/gsm/src/lpc.c | 342 - third_party/gsm/src/preprocess.c | 114 - third_party/gsm/src/rpe.c | 489 - third_party/gsm/src/short_term.c | 430 - third_party/gsm/src/table.c | 63 - third_party/gsm/src/toast.c | 800 - third_party/gsm/src/toast_alaw.c | 334 - third_party/gsm/src/toast_audio.c | 113 - third_party/gsm/src/toast_lin.c | 24 - third_party/gsm/src/toast_ulaw.c | 621 - third_party/gsm/tls/bitter.c | 66 - third_party/gsm/tls/bitter.dta | 90 - third_party/gsm/tls/ginger.c | 54 - third_party/gsm/tls/sour.c | 91 - third_party/gsm/tls/sour1.dta | 88 - third_party/gsm/tls/sour2.dta | 90 - third_party/gsm/tls/sweet.c | 66 - third_party/gsm/tls/taste.c | 139 - third_party/gsm/tls/taste.h | 20 - third_party/gsm/tst/cod2lin.c | 104 - third_party/gsm/tst/cod2txt.c | 94 - third_party/gsm/tst/gsm2cod.c | 93 - third_party/gsm/tst/lin2cod.c | 105 - third_party/gsm/tst/lin2txt.c | 94 - third_party/gsm/tst/run | 34 - third_party/ilbc/FrameClassify.c | 114 - third_party/ilbc/FrameClassify.h | 27 - third_party/ilbc/LPCdecode.c | 158 - third_party/ilbc/LPCdecode.h | 52 - third_party/ilbc/LPCencode.c | 241 - third_party/ilbc/LPCencode.h | 28 - third_party/ilbc/StateConstructW.c | 86 - third_party/ilbc/StateConstructW.h | 31 - third_party/ilbc/StateSearchW.c | 211 - third_party/ilbc/StateSearchW.h | 52 - third_party/ilbc/anaFilter.c | 72 - third_party/ilbc/anaFilter.h | 30 - third_party/ilbc/constants.c | 770 - third_party/ilbc/constants.h | 80 - third_party/ilbc/createCB.c | 231 - third_party/ilbc/createCB.h | 58 - third_party/ilbc/doCPLC.c | 270 - third_party/ilbc/doCPLC.h | 29 - third_party/ilbc/enhancer.c | 701 - third_party/ilbc/enhancer.h | 36 - third_party/ilbc/filter.c | 175 - third_party/ilbc/filter.h | 80 - third_party/ilbc/gainquant.c | 116 - third_party/ilbc/gainquant.h | 30 - third_party/ilbc/getCBvec.c | 193 - third_party/ilbc/getCBvec.h | 25 - third_party/ilbc/helpfun.c | 326 - third_party/ilbc/helpfun.h | 106 - third_party/ilbc/hpInput.c | 65 - third_party/ilbc/hpInput.h | 24 - third_party/ilbc/hpOutput.c | 61 - third_party/ilbc/hpOutput.h | 24 - third_party/ilbc/iCBConstruct.c | 112 - third_party/ilbc/iCBConstruct.h | 40 - third_party/ilbc/iCBSearch.c | 515 - third_party/ilbc/iCBSearch.h | 37 - third_party/ilbc/iLBC_decode.c | 652 - third_party/ilbc/iLBC_decode.h | 42 - third_party/ilbc/iLBC_define.h | 217 - third_party/ilbc/iLBC_encode.c | 543 - third_party/ilbc/iLBC_encode.h | 39 - third_party/ilbc/iLBC_test.c | 310 - third_party/ilbc/lsf.c | 283 - third_party/ilbc/lsf.h | 27 - third_party/ilbc/packing.c | 182 - third_party/ilbc/packing.h | 68 - third_party/ilbc/syntFilter.c | 80 - third_party/ilbc/syntFilter.h | 24 - third_party/milenage/milenage.c | 284 - third_party/milenage/milenage.h | 35 - third_party/milenage/rijndael.c | 444 - third_party/milenage/rijndael.h | 26 - third_party/mp3/BladeMP3EncDLL.h | 283 - third_party/mp3/mp3_port.h | 147 - third_party/mp3/mp3_writer.c | 563 - third_party/portaudio/Doxyfile | 239 - third_party/portaudio/LICENSE.txt | 81 - third_party/portaudio/Makefile.in | 223 - third_party/portaudio/README.txt | 98 - third_party/portaudio/SConstruct | 197 - third_party/portaudio/aclocal.m4 | 6627 ------ third_party/portaudio/bindings/cpp/.keep | 0 third_party/portaudio/build/dev-cpp/Makefile-dll | 78 - .../portaudio/build/dev-cpp/Makefile-static | 75 - .../portaudio/build/dev-cpp/portaudio-dll.dev | 209 - .../portaudio/build/dev-cpp/portaudio-static.dev | 209 - third_party/portaudio/build/dev-cpp/readme.txt | 23 - third_party/portaudio/build/msvc/portaudio.def | 43 - third_party/portaudio/build/msvc/portaudio.dsp | 269 - third_party/portaudio/build/msvc/portaudio.dsw | 29 - third_party/portaudio/build/msvc/portaudio.sln | 26 - third_party/portaudio/build/msvc/portaudio.vcproj | 1512 -- third_party/portaudio/build/msvc/readme.txt | 109 - .../portaudio/build/scons/SConscript_common | 30 - third_party/portaudio/build/scons/SConscript_opts | 91 - third_party/portaudio/config.guess | 1388 -- third_party/portaudio/config.sub | 1489 -- third_party/portaudio/configure | 23096 ------------------- third_party/portaudio/configure.in | 417 - third_party/portaudio/depcomp | 530 - third_party/portaudio/doc/.keep | 0 third_party/portaudio/fixdir.bat | 19 - third_party/portaudio/fixfile.bat | 7 - third_party/portaudio/include/pa_asio.h | 143 - third_party/portaudio/include/pa_jack.h | 76 - third_party/portaudio/include/pa_linux_alsa.h | 99 - third_party/portaudio/include/pa_mac_core.h | 176 - third_party/portaudio/include/pa_win_ds.h | 101 - third_party/portaudio/include/pa_win_waveformat.h | 199 - third_party/portaudio/include/pa_win_wmme.h | 186 - third_party/portaudio/include/portaudio.h | 1134 - third_party/portaudio/index.html | 105 - third_party/portaudio/install-sh | 251 - third_party/portaudio/ltmain.sh | 6971 ------ third_party/portaudio/missing | 360 - third_party/portaudio/pablio/README.txt | 45 - third_party/portaudio/pablio/pablio.c | 314 - third_party/portaudio/pablio/pablio.def | 35 - third_party/portaudio/pablio/pablio.h | 116 - third_party/portaudio/pablio/test_rw.c | 105 - third_party/portaudio/pablio/test_rw_echo.c | 129 - third_party/portaudio/pablio/test_w_saw.c | 114 - third_party/portaudio/pablio/test_w_saw8.c | 112 - third_party/portaudio/portaudio-2.0.pc.in | 12 - third_party/portaudio/src/SConscript | 219 - third_party/portaudio/src/common/pa_allocation.c | 243 - third_party/portaudio/src/common/pa_allocation.h | 104 - third_party/portaudio/src/common/pa_converters.c | 1935 -- third_party/portaudio/src/common/pa_converters.h | 263 - third_party/portaudio/src/common/pa_cpuload.c | 105 - third_party/portaudio/src/common/pa_cpuload.h | 72 - third_party/portaudio/src/common/pa_debugprint.c | 110 - third_party/portaudio/src/common/pa_debugprint.h | 149 - third_party/portaudio/src/common/pa_dither.c | 218 - third_party/portaudio/src/common/pa_dither.h | 106 - third_party/portaudio/src/common/pa_endianness.h | 145 - third_party/portaudio/src/common/pa_front.c | 1765 -- third_party/portaudio/src/common/pa_hostapi.h | 259 - .../portaudio/src/common/pa_memorybarrier.h | 127 - third_party/portaudio/src/common/pa_process.c | 1772 -- third_party/portaudio/src/common/pa_process.h | 750 - third_party/portaudio/src/common/pa_ringbuffer.c | 227 - third_party/portaudio/src/common/pa_ringbuffer.h | 233 - third_party/portaudio/src/common/pa_skeleton.c | 818 - third_party/portaudio/src/common/pa_stream.c | 150 - third_party/portaudio/src/common/pa_stream.h | 205 - third_party/portaudio/src/common/pa_trace.c | 97 - third_party/portaudio/src/common/pa_trace.h | 101 - third_party/portaudio/src/common/pa_types.h | 107 - third_party/portaudio/src/common/pa_util.h | 162 - .../portaudio/src/hostapi/alsa/pa_linux_alsa.c | 3679 --- .../portaudio/src/hostapi/asihpi/pa_linux_asihpi.c | 2942 --- .../portaudio/src/hostapi/asio/ASIO-README.txt | 140 - .../src/hostapi/asio/Callback_adaptation_.pdf | Bin 50527 -> 0 bytes third_party/portaudio/src/hostapi/asio/Pa_ASIO.pdf | Bin 50778 -> 0 bytes .../src/hostapi/asio/iasiothiscallresolver.cpp | 563 - .../src/hostapi/asio/iasiothiscallresolver.h | 197 - third_party/portaudio/src/hostapi/asio/pa_asio.cpp | 4065 ---- .../portaudio/src/hostapi/coreaudio/notes.txt | 196 - .../portaudio/src/hostapi/coreaudio/pa_mac_core.c | 2343 -- .../src/hostapi/coreaudio/pa_mac_core_blocking.c | 592 - .../src/hostapi/coreaudio/pa_mac_core_blocking.h | 136 - .../src/hostapi/coreaudio/pa_mac_core_internal.h | 165 - .../src/hostapi/coreaudio/pa_mac_core_old.c | 913 - .../src/hostapi/coreaudio/pa_mac_core_utilities.c | 733 - .../src/hostapi/coreaudio/pa_mac_core_utilities.h | 218 - .../portaudio/src/hostapi/dsound/pa_win_ds.c | 2533 -- .../src/hostapi/dsound/pa_win_ds_dynlink.c | 180 - .../src/hostapi/dsound/pa_win_ds_dynlink.h | 95 - third_party/portaudio/src/hostapi/jack/pa_jack.c | 1761 -- .../portaudio/src/hostapi/oss/low_latency_tip.txt | Bin 3111 -> 0 bytes .../portaudio/src/hostapi/oss/pa_unix_oss.c | 1991 -- third_party/portaudio/src/hostapi/oss/recplay.c | 114 - .../portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp | 1912 -- .../portaudio/src/hostapi/wdmks/pa_win_wdmks.c | 3304 --- third_party/portaudio/src/hostapi/wdmks/readme.txt | 82 - .../portaudio/src/hostapi/wmme/pa_win_wmme.c | 4007 ---- third_party/portaudio/src/os/mac_osx/.keep | 0 .../portaudio/src/os/unix/pa_unix_hostapis.c | 105 - third_party/portaudio/src/os/unix/pa_unix_util.c | 693 - third_party/portaudio/src/os/unix/pa_unix_util.h | 224 - third_party/portaudio/src/os/win/pa_win_hostapis.c | 100 - third_party/portaudio/src/os/win/pa_win_util.c | 151 - .../portaudio/src/os/win/pa_win_waveformat.c | 154 - .../portaudio/src/os/win/pa_win_wdmks_utils.c | 260 - .../portaudio/src/os/win/pa_win_wdmks_utils.h | 65 - .../portaudio/src/os/win/pa_x86_plain_converters.c | 1219 - .../portaudio/src/os/win/pa_x86_plain_converters.h | 60 - third_party/portaudio/test/.keep | 0 third_party/portaudio/testcvs/changeme.txt | 10 - third_party/resample/COPYING | 463 - third_party/resample/README.resample | 154 - third_party/resample/include/resamplesubs.h | 32 - third_party/resample/src/largefilter.h | 16391 ------------- third_party/resample/src/libresample_dll.c | 12 - third_party/resample/src/resample.h | 67 - third_party/resample/src/resamplesubs.c | 377 - third_party/resample/src/smallfilter.h | 4617 ---- third_party/resample/src/stddefs.h | 29 - third_party/speex/AUTHORS | 18 - third_party/speex/COPYING | 35 - third_party/speex/include/speex/speex.h | 424 - third_party/speex/include/speex/speex_bits.h | 174 - third_party/speex/include/speex/speex_buffer.h | 68 - third_party/speex/include/speex/speex_callbacks.h | 134 - .../speex/include/speex/speex_config_types.h.in | 11 - third_party/speex/include/speex/speex_echo.h | 170 - third_party/speex/include/speex/speex_header.h | 94 - third_party/speex/include/speex/speex_jitter.h | 197 - third_party/speex/include/speex/speex_preprocess.h | 219 - third_party/speex/include/speex/speex_resampler.h | 340 - third_party/speex/include/speex/speex_stereo.h | 91 - third_party/speex/include/speex/speex_types.h | 126 - third_party/speex/libspeex/_kiss_fft_guts.h | 160 - third_party/speex/libspeex/arch.h | 239 - third_party/speex/libspeex/bits.c | 372 - third_party/speex/libspeex/buffer.c | 176 - third_party/speex/libspeex/cb_search.c | 612 - third_party/speex/libspeex/cb_search.h | 103 - third_party/speex/libspeex/cb_search_arm4.h | 137 - third_party/speex/libspeex/cb_search_bfin.h | 112 - third_party/speex/libspeex/cb_search_sse.h | 84 - third_party/speex/libspeex/echo_diagnostic.m | 72 - third_party/speex/libspeex/exc_10_16_table.c | 50 - third_party/speex/libspeex/exc_10_32_table.c | 66 - third_party/speex/libspeex/exc_20_32_table.c | 66 - third_party/speex/libspeex/exc_5_256_table.c | 290 - third_party/speex/libspeex/exc_5_64_table.c | 98 - third_party/speex/libspeex/exc_8_128_table.c | 162 - third_party/speex/libspeex/fftwrap.c | 397 - third_party/speex/libspeex/fftwrap.h | 58 - third_party/speex/libspeex/filterbank.c | 227 - third_party/speex/libspeex/filterbank.h | 66 - third_party/speex/libspeex/filters.c | 821 - third_party/speex/libspeex/filters.h | 90 - third_party/speex/libspeex/filters_arm4.h | 96 - third_party/speex/libspeex/filters_bfin.h | 515 - third_party/speex/libspeex/filters_sse.h | 336 - third_party/speex/libspeex/fixed_arm4.h | 148 - third_party/speex/libspeex/fixed_arm5e.h | 178 - third_party/speex/libspeex/fixed_bfin.h | 173 - third_party/speex/libspeex/fixed_debug.h | 487 - third_party/speex/libspeex/fixed_generic.h | 106 - third_party/speex/libspeex/gain_table.c | 160 - third_party/speex/libspeex/gain_table_lbr.c | 64 - third_party/speex/libspeex/hexc_10_32_table.c | 66 - third_party/speex/libspeex/hexc_table.c | 162 - third_party/speex/libspeex/high_lsp_tables.c | 163 - third_party/speex/libspeex/jitter.c | 843 - third_party/speex/libspeex/kiss_fft.c | 523 - third_party/speex/libspeex/kiss_fft.h | 108 - third_party/speex/libspeex/kiss_fftr.c | 297 - third_party/speex/libspeex/kiss_fftr.h | 51 - third_party/speex/libspeex/lpc.c | 201 - third_party/speex/libspeex/lpc.h | 53 - third_party/speex/libspeex/lpc_bfin.h | 131 - third_party/speex/libspeex/lsp.c | 656 - third_party/speex/libspeex/lsp.h | 64 - third_party/speex/libspeex/lsp_bfin.h | 89 - third_party/speex/libspeex/lsp_tables_nb.c | 360 - third_party/speex/libspeex/ltp.c | 839 - third_party/speex/libspeex/ltp.h | 141 - third_party/speex/libspeex/ltp_arm4.h | 187 - third_party/speex/libspeex/ltp_bfin.h | 419 - third_party/speex/libspeex/ltp_sse.h | 92 - third_party/speex/libspeex/math_approx.h | 332 - third_party/speex/libspeex/mdf.c | 1177 - third_party/speex/libspeex/misc_bfin.h | 54 - third_party/speex/libspeex/modes.c | 366 - third_party/speex/libspeex/modes.h | 161 - third_party/speex/libspeex/modes_wb.c | 300 - third_party/speex/libspeex/nb_celp.c | 1903 -- third_party/speex/libspeex/nb_celp.h | 203 - third_party/speex/libspeex/os_support.h | 169 - third_party/speex/libspeex/preprocess.c | 1219 - third_party/speex/libspeex/pseudofloat.h | 379 - third_party/speex/libspeex/quant_lsp.c | 385 - third_party/speex/libspeex/quant_lsp.h | 74 - third_party/speex/libspeex/quant_lsp_bfin.h | 165 - third_party/speex/libspeex/resample.c | 1131 - third_party/speex/libspeex/resample_sse.h | 128 - third_party/speex/libspeex/sb_celp.c | 1488 -- third_party/speex/libspeex/sb_celp.h | 155 - third_party/speex/libspeex/scal.c | 289 - third_party/speex/libspeex/smallft.c | 1261 - third_party/speex/libspeex/smallft.h | 46 - third_party/speex/libspeex/speex.c | 250 - third_party/speex/libspeex/speex_callbacks.c | 144 - third_party/speex/libspeex/speex_header.c | 200 - third_party/speex/libspeex/stack_alloc.h | 115 - third_party/speex/libspeex/stereo.c | 296 - third_party/speex/libspeex/testdenoise.c | 44 - third_party/speex/libspeex/testecho.c | 53 - third_party/speex/libspeex/testenc.c | 146 - third_party/speex/libspeex/testenc_uwb.c | 137 - third_party/speex/libspeex/testenc_wb.c | 140 - third_party/speex/libspeex/testjitter.c | 75 - third_party/speex/libspeex/testresample.c | 86 - third_party/speex/libspeex/vbr.c | 275 - third_party/speex/libspeex/vbr.h | 70 - third_party/speex/libspeex/vorbis_psy.c | 508 - third_party/speex/libspeex/vorbis_psy.h | 97 - third_party/speex/libspeex/vq.c | 147 - third_party/speex/libspeex/vq.h | 54 - third_party/speex/libspeex/vq_arm4.h | 115 - third_party/speex/libspeex/vq_bfin.h | 107 - third_party/speex/libspeex/vq_sse.h | 120 - third_party/speex/libspeex/window.c | 102 - third_party/speex/symbian/config.h | 59 - third_party/speex/win32/config.h | 19 - third_party/srtp/CHANGES | 223 - third_party/srtp/LICENSE | 35 - third_party/srtp/Makefile.in | 232 - third_party/srtp/README | 174 - third_party/srtp/TODO | 66 - third_party/srtp/VERSION | 1 - third_party/srtp/config.guess | 1447 -- third_party/srtp/config.h_win32vc7 | 170 - third_party/srtp/config.hw | 192 - third_party/srtp/config.sub | 1555 -- third_party/srtp/config_in.h | 170 - third_party/srtp/configure | 8603 ------- third_party/srtp/configure.in | 206 - third_party/srtp/crypto/Makefile | 130 - third_party/srtp/crypto/Makefile.in | 130 - third_party/srtp/crypto/VERSION | 1 - third_party/srtp/crypto/ae_xfm/xfm.c | 573 - third_party/srtp/crypto/cipher/aes.c | 1951 -- third_party/srtp/crypto/cipher/aes_cbc.c | 444 - third_party/srtp/crypto/cipher/aes_icm.c | 511 - third_party/srtp/crypto/cipher/cipher.c | 409 - third_party/srtp/crypto/cipher/null_cipher.c | 152 - third_party/srtp/crypto/hash/auth.c | 173 - third_party/srtp/crypto/hash/hmac.c | 267 - third_party/srtp/crypto/hash/null_auth.c | 160 - third_party/srtp/crypto/hash/sha1.c | 404 - third_party/srtp/crypto/include/aes.h | 84 - third_party/srtp/crypto/include/aes_cbc.h | 50 - third_party/srtp/crypto/include/aes_icm.h | 56 - third_party/srtp/crypto/include/alloc.h | 57 - third_party/srtp/crypto/include/auth.h | 159 - third_party/srtp/crypto/include/cipher.h | 218 - third_party/srtp/crypto/include/crypto.h | 43 - third_party/srtp/crypto/include/crypto_kernel.h | 258 - third_party/srtp/crypto/include/crypto_math.h | 273 - third_party/srtp/crypto/include/crypto_types.h | 206 - third_party/srtp/crypto/include/cryptoalg.h | 133 - third_party/srtp/crypto/include/datatypes.h | 427 - third_party/srtp/crypto/include/err.h | 174 - third_party/srtp/crypto/include/gf2_8.h | 79 - third_party/srtp/crypto/include/hmac.h | 78 - third_party/srtp/crypto/include/integers.h | 147 - third_party/srtp/crypto/include/kernel_compat.h | 84 - third_party/srtp/crypto/include/key.h | 82 - third_party/srtp/crypto/include/null_auth.h | 68 - third_party/srtp/crypto/include/null_cipher.h | 80 - third_party/srtp/crypto/include/prng.h | 54 - third_party/srtp/crypto/include/rand_source.h | 91 - third_party/srtp/crypto/include/rdb.h | 94 - third_party/srtp/crypto/include/rdbx.h | 146 - third_party/srtp/crypto/include/sha1.h | 108 - third_party/srtp/crypto/include/stat.h | 69 - third_party/srtp/crypto/include/xfm.h | 139 - third_party/srtp/crypto/kernel/alloc.c | 119 - third_party/srtp/crypto/kernel/crypto_kernel.c | 523 - third_party/srtp/crypto/kernel/err.c | 148 - third_party/srtp/crypto/kernel/key.c | 115 - third_party/srtp/crypto/math/datatypes.c | 599 - third_party/srtp/crypto/math/gf2_8.c | 83 - third_party/srtp/crypto/math/math.c | 962 - third_party/srtp/crypto/math/stat.c | 367 - third_party/srtp/crypto/replay/rdb.c | 137 - third_party/srtp/crypto/replay/rdbx.c | 289 - third_party/srtp/crypto/replay/ut_sim.c | 105 - third_party/srtp/crypto/rng/ctr_prng.c | 108 - third_party/srtp/crypto/rng/prng.c | 180 - third_party/srtp/crypto/rng/rand_linux_kernel.c | 65 - third_party/srtp/crypto/rng/rand_source.c | 175 - third_party/srtp/crypto/test/aes_calc.c | 111 - third_party/srtp/crypto/test/auth_driver.c | 200 - third_party/srtp/crypto/test/cipher_driver.c | 491 - third_party/srtp/crypto/test/datatypes_driver.c | 237 - third_party/srtp/crypto/test/env.c | 99 - third_party/srtp/crypto/test/kernel_driver.c | 126 - third_party/srtp/crypto/test/rand_gen.c | 140 - third_party/srtp/crypto/test/sha1_driver.c | 533 - third_party/srtp/crypto/test/stat_driver.c | 101 - third_party/srtp/doc/.keep | 0 third_party/srtp/include/getopt_s.h | 60 - third_party/srtp/include/rtp.h | 127 - third_party/srtp/include/rtp_priv.h | 74 - third_party/srtp/include/srtp.h | 929 - third_party/srtp/include/srtp_priv.h | 255 - third_party/srtp/include/ut_sim.h | 80 - third_party/srtp/install-sh | 251 - third_party/srtp/pjlib/srtp_err.c | 49 - third_party/srtp/srtp.def | 92 - third_party/srtp/srtp.vcproj | 588 - third_party/srtp/srtp/srtp.c | 1913 -- third_party/srtp/srtp7.sln | 21 - third_party/srtp/srtp7.vcproj | 298 - third_party/srtp/tables/aes_tables.c | 346 - third_party/srtp/test/dtls_srtp_driver.c | 245 - third_party/srtp/test/getopt_s.c | 112 - third_party/srtp/test/lfsr.c | 310 - third_party/srtp/test/rdbx_driver.c | 306 - third_party/srtp/test/replay_driver.c | 209 - third_party/srtp/test/roc_driver.c | 165 - third_party/srtp/test/rtp.c | 167 - third_party/srtp/test/rtpw.c | 519 - third_party/srtp/test/rtpw_test.sh | 77 - third_party/srtp/test/srtp_driver.c | 1491 -- third_party/srtp/timing | 1 - third_party/srtp/undos.sh | 10 - third_party/srtp/update.sh | 15 - 478 files changed, 6 insertions(+), 212030 deletions(-) delete mode 100644 third_party/g7221/common/basic_op.c delete mode 100644 third_party/g7221/common/basic_op.h delete mode 100644 third_party/g7221/common/basic_op_i.h delete mode 100644 third_party/g7221/common/common.c delete mode 100644 third_party/g7221/common/config.h delete mode 100644 third_party/g7221/common/count.h delete mode 100644 third_party/g7221/common/defs.h delete mode 100644 third_party/g7221/common/huff_def.h delete mode 100644 third_party/g7221/common/huff_tab.c delete mode 100644 third_party/g7221/common/huff_tab.h delete mode 100644 third_party/g7221/common/tables.c delete mode 100644 third_party/g7221/common/tables.h delete mode 100644 third_party/g7221/common/typedef.h delete mode 100644 third_party/g7221/decode/coef2sam.c delete mode 100644 third_party/g7221/decode/dct4_s.c delete mode 100644 third_party/g7221/decode/dct4_s.h delete mode 100644 third_party/g7221/decode/decoder.c delete mode 100644 third_party/g7221/encode/dct4_a.c delete mode 100644 third_party/g7221/encode/dct4_a.h delete mode 100644 third_party/g7221/encode/encoder.c delete mode 100644 third_party/g7221/encode/sam2coef.c delete mode 100644 third_party/gsm/COPYRIGHT delete mode 100644 third_party/gsm/ChangeLog delete mode 100644 third_party/gsm/INSTALL delete mode 100644 third_party/gsm/MACHINES delete mode 100644 third_party/gsm/MANIFEST delete mode 100644 third_party/gsm/Makefile delete mode 100644 third_party/gsm/README delete mode 100644 third_party/gsm/add-test/add_test.c delete mode 100644 third_party/gsm/add-test/add_test.dta delete mode 100644 third_party/gsm/bin/.keep delete mode 100644 third_party/gsm/inc/config.h delete mode 100644 third_party/gsm/inc/gsm.h delete mode 100644 third_party/gsm/inc/private.h delete mode 100644 third_party/gsm/inc/proto.h delete mode 100644 third_party/gsm/inc/toast.h delete mode 100644 third_party/gsm/inc/unproto.h delete mode 100644 third_party/gsm/lib/.keep delete mode 100644 third_party/gsm/man/bitter.1 delete mode 100644 third_party/gsm/man/gsm.3 delete mode 100644 third_party/gsm/man/gsm_explode.3 delete mode 100644 third_party/gsm/man/gsm_option.3 delete mode 100644 third_party/gsm/man/gsm_print.3 delete mode 100644 third_party/gsm/man/toast.1 delete mode 100644 third_party/gsm/src/add.c delete mode 100644 third_party/gsm/src/code.c delete mode 100644 third_party/gsm/src/debug.c delete mode 100644 third_party/gsm/src/decode.c delete mode 100644 third_party/gsm/src/gsm_create.c delete mode 100644 third_party/gsm/src/gsm_decode.c delete mode 100644 third_party/gsm/src/gsm_destroy.c delete mode 100644 third_party/gsm/src/gsm_encode.c delete mode 100644 third_party/gsm/src/gsm_explode.c delete mode 100644 third_party/gsm/src/gsm_implode.c delete mode 100644 third_party/gsm/src/gsm_option.c delete mode 100644 third_party/gsm/src/gsm_print.c delete mode 100644 third_party/gsm/src/long_term.c delete mode 100644 third_party/gsm/src/lpc.c delete mode 100644 third_party/gsm/src/preprocess.c delete mode 100644 third_party/gsm/src/rpe.c delete mode 100644 third_party/gsm/src/short_term.c delete mode 100644 third_party/gsm/src/table.c delete mode 100644 third_party/gsm/src/toast.c delete mode 100644 third_party/gsm/src/toast_alaw.c delete mode 100644 third_party/gsm/src/toast_audio.c delete mode 100644 third_party/gsm/src/toast_lin.c delete mode 100644 third_party/gsm/src/toast_ulaw.c delete mode 100644 third_party/gsm/tls/bitter.c delete mode 100644 third_party/gsm/tls/bitter.dta delete mode 100644 third_party/gsm/tls/ginger.c delete mode 100644 third_party/gsm/tls/sour.c delete mode 100644 third_party/gsm/tls/sour1.dta delete mode 100644 third_party/gsm/tls/sour2.dta delete mode 100644 third_party/gsm/tls/sweet.c delete mode 100644 third_party/gsm/tls/taste.c delete mode 100644 third_party/gsm/tls/taste.h delete mode 100644 third_party/gsm/tst/cod2lin.c delete mode 100644 third_party/gsm/tst/cod2txt.c delete mode 100644 third_party/gsm/tst/gsm2cod.c delete mode 100644 third_party/gsm/tst/lin2cod.c delete mode 100644 third_party/gsm/tst/lin2txt.c delete mode 100644 third_party/gsm/tst/run delete mode 100644 third_party/ilbc/FrameClassify.c delete mode 100644 third_party/ilbc/FrameClassify.h delete mode 100644 third_party/ilbc/LPCdecode.c delete mode 100644 third_party/ilbc/LPCdecode.h delete mode 100644 third_party/ilbc/LPCencode.c delete mode 100644 third_party/ilbc/LPCencode.h delete mode 100644 third_party/ilbc/StateConstructW.c delete mode 100644 third_party/ilbc/StateConstructW.h delete mode 100644 third_party/ilbc/StateSearchW.c delete mode 100644 third_party/ilbc/StateSearchW.h delete mode 100644 third_party/ilbc/anaFilter.c delete mode 100644 third_party/ilbc/anaFilter.h delete mode 100644 third_party/ilbc/constants.c delete mode 100644 third_party/ilbc/constants.h delete mode 100644 third_party/ilbc/createCB.c delete mode 100644 third_party/ilbc/createCB.h delete mode 100644 third_party/ilbc/doCPLC.c delete mode 100644 third_party/ilbc/doCPLC.h delete mode 100644 third_party/ilbc/enhancer.c delete mode 100644 third_party/ilbc/enhancer.h delete mode 100644 third_party/ilbc/filter.c delete mode 100644 third_party/ilbc/filter.h delete mode 100644 third_party/ilbc/gainquant.c delete mode 100644 third_party/ilbc/gainquant.h delete mode 100644 third_party/ilbc/getCBvec.c delete mode 100644 third_party/ilbc/getCBvec.h delete mode 100644 third_party/ilbc/helpfun.c delete mode 100644 third_party/ilbc/helpfun.h delete mode 100644 third_party/ilbc/hpInput.c delete mode 100644 third_party/ilbc/hpInput.h delete mode 100644 third_party/ilbc/hpOutput.c delete mode 100644 third_party/ilbc/hpOutput.h delete mode 100644 third_party/ilbc/iCBConstruct.c delete mode 100644 third_party/ilbc/iCBConstruct.h delete mode 100644 third_party/ilbc/iCBSearch.c delete mode 100644 third_party/ilbc/iCBSearch.h delete mode 100644 third_party/ilbc/iLBC_decode.c delete mode 100644 third_party/ilbc/iLBC_decode.h delete mode 100644 third_party/ilbc/iLBC_define.h delete mode 100644 third_party/ilbc/iLBC_encode.c delete mode 100644 third_party/ilbc/iLBC_encode.h delete mode 100644 third_party/ilbc/iLBC_test.c delete mode 100644 third_party/ilbc/lsf.c delete mode 100644 third_party/ilbc/lsf.h delete mode 100644 third_party/ilbc/packing.c delete mode 100644 third_party/ilbc/packing.h delete mode 100644 third_party/ilbc/syntFilter.c delete mode 100644 third_party/ilbc/syntFilter.h delete mode 100644 third_party/milenage/milenage.c delete mode 100644 third_party/milenage/milenage.h delete mode 100644 third_party/milenage/rijndael.c delete mode 100644 third_party/milenage/rijndael.h delete mode 100644 third_party/mp3/BladeMP3EncDLL.h delete mode 100644 third_party/mp3/mp3_port.h delete mode 100644 third_party/mp3/mp3_writer.c delete mode 100644 third_party/portaudio/Doxyfile delete mode 100644 third_party/portaudio/LICENSE.txt delete mode 100644 third_party/portaudio/Makefile.in delete mode 100644 third_party/portaudio/README.txt delete mode 100644 third_party/portaudio/SConstruct delete mode 100644 third_party/portaudio/aclocal.m4 delete mode 100644 third_party/portaudio/bindings/cpp/.keep delete mode 100644 third_party/portaudio/build/dev-cpp/Makefile-dll delete mode 100644 third_party/portaudio/build/dev-cpp/Makefile-static delete mode 100644 third_party/portaudio/build/dev-cpp/portaudio-dll.dev delete mode 100644 third_party/portaudio/build/dev-cpp/portaudio-static.dev delete mode 100644 third_party/portaudio/build/dev-cpp/readme.txt delete mode 100644 third_party/portaudio/build/msvc/portaudio.def delete mode 100644 third_party/portaudio/build/msvc/portaudio.dsp delete mode 100644 third_party/portaudio/build/msvc/portaudio.dsw delete mode 100644 third_party/portaudio/build/msvc/portaudio.sln delete mode 100644 third_party/portaudio/build/msvc/portaudio.vcproj delete mode 100644 third_party/portaudio/build/msvc/readme.txt delete mode 100644 third_party/portaudio/build/scons/SConscript_common delete mode 100644 third_party/portaudio/build/scons/SConscript_opts delete mode 100755 third_party/portaudio/config.guess delete mode 100755 third_party/portaudio/config.sub delete mode 100755 third_party/portaudio/configure delete mode 100644 third_party/portaudio/configure.in delete mode 100755 third_party/portaudio/depcomp delete mode 100644 third_party/portaudio/doc/.keep delete mode 100755 third_party/portaudio/fixdir.bat delete mode 100755 third_party/portaudio/fixfile.bat delete mode 100644 third_party/portaudio/include/pa_asio.h delete mode 100644 third_party/portaudio/include/pa_jack.h delete mode 100644 third_party/portaudio/include/pa_linux_alsa.h delete mode 100644 third_party/portaudio/include/pa_mac_core.h delete mode 100644 third_party/portaudio/include/pa_win_ds.h delete mode 100644 third_party/portaudio/include/pa_win_waveformat.h delete mode 100644 third_party/portaudio/include/pa_win_wmme.h delete mode 100644 third_party/portaudio/include/portaudio.h delete mode 100644 third_party/portaudio/index.html delete mode 100755 third_party/portaudio/install-sh delete mode 100644 third_party/portaudio/ltmain.sh delete mode 100755 third_party/portaudio/missing delete mode 100644 third_party/portaudio/pablio/README.txt delete mode 100644 third_party/portaudio/pablio/pablio.c delete mode 100644 third_party/portaudio/pablio/pablio.def delete mode 100644 third_party/portaudio/pablio/pablio.h delete mode 100644 third_party/portaudio/pablio/test_rw.c delete mode 100644 third_party/portaudio/pablio/test_rw_echo.c delete mode 100644 third_party/portaudio/pablio/test_w_saw.c delete mode 100644 third_party/portaudio/pablio/test_w_saw8.c delete mode 100644 third_party/portaudio/portaudio-2.0.pc.in delete mode 100644 third_party/portaudio/src/SConscript delete mode 100644 third_party/portaudio/src/common/pa_allocation.c delete mode 100644 third_party/portaudio/src/common/pa_allocation.h delete mode 100644 third_party/portaudio/src/common/pa_converters.c delete mode 100644 third_party/portaudio/src/common/pa_converters.h delete mode 100644 third_party/portaudio/src/common/pa_cpuload.c delete mode 100644 third_party/portaudio/src/common/pa_cpuload.h delete mode 100644 third_party/portaudio/src/common/pa_debugprint.c delete mode 100644 third_party/portaudio/src/common/pa_debugprint.h delete mode 100644 third_party/portaudio/src/common/pa_dither.c delete mode 100644 third_party/portaudio/src/common/pa_dither.h delete mode 100644 third_party/portaudio/src/common/pa_endianness.h delete mode 100644 third_party/portaudio/src/common/pa_front.c delete mode 100644 third_party/portaudio/src/common/pa_hostapi.h delete mode 100644 third_party/portaudio/src/common/pa_memorybarrier.h delete mode 100644 third_party/portaudio/src/common/pa_process.c delete mode 100644 third_party/portaudio/src/common/pa_process.h delete mode 100644 third_party/portaudio/src/common/pa_ringbuffer.c delete mode 100644 third_party/portaudio/src/common/pa_ringbuffer.h delete mode 100644 third_party/portaudio/src/common/pa_skeleton.c delete mode 100644 third_party/portaudio/src/common/pa_stream.c delete mode 100644 third_party/portaudio/src/common/pa_stream.h delete mode 100644 third_party/portaudio/src/common/pa_trace.c delete mode 100644 third_party/portaudio/src/common/pa_trace.h delete mode 100644 third_party/portaudio/src/common/pa_types.h delete mode 100644 third_party/portaudio/src/common/pa_util.h delete mode 100644 third_party/portaudio/src/hostapi/alsa/pa_linux_alsa.c delete mode 100644 third_party/portaudio/src/hostapi/asihpi/pa_linux_asihpi.c delete mode 100644 third_party/portaudio/src/hostapi/asio/ASIO-README.txt delete mode 100644 third_party/portaudio/src/hostapi/asio/Callback_adaptation_.pdf delete mode 100644 third_party/portaudio/src/hostapi/asio/Pa_ASIO.pdf delete mode 100644 third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.cpp delete mode 100644 third_party/portaudio/src/hostapi/asio/iasiothiscallresolver.h delete mode 100644 third_party/portaudio/src/hostapi/asio/pa_asio.cpp delete mode 100644 third_party/portaudio/src/hostapi/coreaudio/notes.txt delete mode 100644 third_party/portaudio/src/hostapi/coreaudio/pa_mac_core.c delete mode 100644 third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.c delete mode 100644 third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_blocking.h delete mode 100644 third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_internal.h delete mode 100644 third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_old.c delete mode 100644 third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.c delete mode 100644 third_party/portaudio/src/hostapi/coreaudio/pa_mac_core_utilities.h delete mode 100644 third_party/portaudio/src/hostapi/dsound/pa_win_ds.c delete mode 100644 third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.c delete mode 100644 third_party/portaudio/src/hostapi/dsound/pa_win_ds_dynlink.h delete mode 100644 third_party/portaudio/src/hostapi/jack/pa_jack.c delete mode 100644 third_party/portaudio/src/hostapi/oss/low_latency_tip.txt delete mode 100644 third_party/portaudio/src/hostapi/oss/pa_unix_oss.c delete mode 100644 third_party/portaudio/src/hostapi/oss/recplay.c delete mode 100644 third_party/portaudio/src/hostapi/wasapi/pa_win_wasapi.cpp delete mode 100644 third_party/portaudio/src/hostapi/wdmks/pa_win_wdmks.c delete mode 100644 third_party/portaudio/src/hostapi/wdmks/readme.txt delete mode 100644 third_party/portaudio/src/hostapi/wmme/pa_win_wmme.c delete mode 100644 third_party/portaudio/src/os/mac_osx/.keep delete mode 100644 third_party/portaudio/src/os/unix/pa_unix_hostapis.c delete mode 100644 third_party/portaudio/src/os/unix/pa_unix_util.c delete mode 100644 third_party/portaudio/src/os/unix/pa_unix_util.h delete mode 100644 third_party/portaudio/src/os/win/pa_win_hostapis.c delete mode 100644 third_party/portaudio/src/os/win/pa_win_util.c delete mode 100644 third_party/portaudio/src/os/win/pa_win_waveformat.c delete mode 100644 third_party/portaudio/src/os/win/pa_win_wdmks_utils.c delete mode 100644 third_party/portaudio/src/os/win/pa_win_wdmks_utils.h delete mode 100644 third_party/portaudio/src/os/win/pa_x86_plain_converters.c delete mode 100644 third_party/portaudio/src/os/win/pa_x86_plain_converters.h delete mode 100644 third_party/portaudio/test/.keep delete mode 100644 third_party/portaudio/testcvs/changeme.txt delete mode 100644 third_party/resample/COPYING delete mode 100644 third_party/resample/README.resample delete mode 100644 third_party/resample/include/resamplesubs.h delete mode 100644 third_party/resample/src/largefilter.h delete mode 100644 third_party/resample/src/libresample_dll.c delete mode 100644 third_party/resample/src/resample.h delete mode 100644 third_party/resample/src/resamplesubs.c delete mode 100644 third_party/resample/src/smallfilter.h delete mode 100644 third_party/resample/src/stddefs.h delete mode 100644 third_party/speex/AUTHORS delete mode 100644 third_party/speex/COPYING delete mode 100644 third_party/speex/include/speex/speex.h delete mode 100644 third_party/speex/include/speex/speex_bits.h delete mode 100644 third_party/speex/include/speex/speex_buffer.h delete mode 100644 third_party/speex/include/speex/speex_callbacks.h delete mode 100644 third_party/speex/include/speex/speex_config_types.h.in delete mode 100644 third_party/speex/include/speex/speex_echo.h delete mode 100644 third_party/speex/include/speex/speex_header.h delete mode 100644 third_party/speex/include/speex/speex_jitter.h delete mode 100644 third_party/speex/include/speex/speex_preprocess.h delete mode 100644 third_party/speex/include/speex/speex_resampler.h delete mode 100644 third_party/speex/include/speex/speex_stereo.h delete mode 100644 third_party/speex/include/speex/speex_types.h delete mode 100644 third_party/speex/libspeex/_kiss_fft_guts.h delete mode 100644 third_party/speex/libspeex/arch.h delete mode 100644 third_party/speex/libspeex/bits.c delete mode 100644 third_party/speex/libspeex/buffer.c delete mode 100644 third_party/speex/libspeex/cb_search.c delete mode 100644 third_party/speex/libspeex/cb_search.h delete mode 100644 third_party/speex/libspeex/cb_search_arm4.h delete mode 100644 third_party/speex/libspeex/cb_search_bfin.h delete mode 100644 third_party/speex/libspeex/cb_search_sse.h delete mode 100644 third_party/speex/libspeex/echo_diagnostic.m delete mode 100644 third_party/speex/libspeex/exc_10_16_table.c delete mode 100644 third_party/speex/libspeex/exc_10_32_table.c delete mode 100644 third_party/speex/libspeex/exc_20_32_table.c delete mode 100644 third_party/speex/libspeex/exc_5_256_table.c delete mode 100644 third_party/speex/libspeex/exc_5_64_table.c delete mode 100644 third_party/speex/libspeex/exc_8_128_table.c delete mode 100644 third_party/speex/libspeex/fftwrap.c delete mode 100644 third_party/speex/libspeex/fftwrap.h delete mode 100644 third_party/speex/libspeex/filterbank.c delete mode 100644 third_party/speex/libspeex/filterbank.h delete mode 100644 third_party/speex/libspeex/filters.c delete mode 100644 third_party/speex/libspeex/filters.h delete mode 100644 third_party/speex/libspeex/filters_arm4.h delete mode 100644 third_party/speex/libspeex/filters_bfin.h delete mode 100644 third_party/speex/libspeex/filters_sse.h delete mode 100644 third_party/speex/libspeex/fixed_arm4.h delete mode 100644 third_party/speex/libspeex/fixed_arm5e.h delete mode 100644 third_party/speex/libspeex/fixed_bfin.h delete mode 100644 third_party/speex/libspeex/fixed_debug.h delete mode 100644 third_party/speex/libspeex/fixed_generic.h delete mode 100644 third_party/speex/libspeex/gain_table.c delete mode 100644 third_party/speex/libspeex/gain_table_lbr.c delete mode 100644 third_party/speex/libspeex/hexc_10_32_table.c delete mode 100644 third_party/speex/libspeex/hexc_table.c delete mode 100644 third_party/speex/libspeex/high_lsp_tables.c delete mode 100644 third_party/speex/libspeex/jitter.c delete mode 100644 third_party/speex/libspeex/kiss_fft.c delete mode 100644 third_party/speex/libspeex/kiss_fft.h delete mode 100644 third_party/speex/libspeex/kiss_fftr.c delete mode 100644 third_party/speex/libspeex/kiss_fftr.h delete mode 100644 third_party/speex/libspeex/lpc.c delete mode 100644 third_party/speex/libspeex/lpc.h delete mode 100644 third_party/speex/libspeex/lpc_bfin.h delete mode 100644 third_party/speex/libspeex/lsp.c delete mode 100644 third_party/speex/libspeex/lsp.h delete mode 100644 third_party/speex/libspeex/lsp_bfin.h delete mode 100644 third_party/speex/libspeex/lsp_tables_nb.c delete mode 100644 third_party/speex/libspeex/ltp.c delete mode 100644 third_party/speex/libspeex/ltp.h delete mode 100644 third_party/speex/libspeex/ltp_arm4.h delete mode 100644 third_party/speex/libspeex/ltp_bfin.h delete mode 100644 third_party/speex/libspeex/ltp_sse.h delete mode 100644 third_party/speex/libspeex/math_approx.h delete mode 100644 third_party/speex/libspeex/mdf.c delete mode 100644 third_party/speex/libspeex/misc_bfin.h delete mode 100644 third_party/speex/libspeex/modes.c delete mode 100644 third_party/speex/libspeex/modes.h delete mode 100644 third_party/speex/libspeex/modes_wb.c delete mode 100644 third_party/speex/libspeex/nb_celp.c delete mode 100644 third_party/speex/libspeex/nb_celp.h delete mode 100644 third_party/speex/libspeex/os_support.h delete mode 100644 third_party/speex/libspeex/preprocess.c delete mode 100644 third_party/speex/libspeex/pseudofloat.h delete mode 100644 third_party/speex/libspeex/quant_lsp.c delete mode 100644 third_party/speex/libspeex/quant_lsp.h delete mode 100644 third_party/speex/libspeex/quant_lsp_bfin.h delete mode 100644 third_party/speex/libspeex/resample.c delete mode 100644 third_party/speex/libspeex/resample_sse.h delete mode 100644 third_party/speex/libspeex/sb_celp.c delete mode 100644 third_party/speex/libspeex/sb_celp.h delete mode 100644 third_party/speex/libspeex/scal.c delete mode 100644 third_party/speex/libspeex/smallft.c delete mode 100644 third_party/speex/libspeex/smallft.h delete mode 100644 third_party/speex/libspeex/speex.c delete mode 100644 third_party/speex/libspeex/speex_callbacks.c delete mode 100644 third_party/speex/libspeex/speex_header.c delete mode 100644 third_party/speex/libspeex/stack_alloc.h delete mode 100644 third_party/speex/libspeex/stereo.c delete mode 100644 third_party/speex/libspeex/testdenoise.c delete mode 100644 third_party/speex/libspeex/testecho.c delete mode 100644 third_party/speex/libspeex/testenc.c delete mode 100644 third_party/speex/libspeex/testenc_uwb.c delete mode 100644 third_party/speex/libspeex/testenc_wb.c delete mode 100644 third_party/speex/libspeex/testjitter.c delete mode 100644 third_party/speex/libspeex/testresample.c delete mode 100644 third_party/speex/libspeex/vbr.c delete mode 100644 third_party/speex/libspeex/vbr.h delete mode 100644 third_party/speex/libspeex/vorbis_psy.c delete mode 100644 third_party/speex/libspeex/vorbis_psy.h delete mode 100644 third_party/speex/libspeex/vq.c delete mode 100644 third_party/speex/libspeex/vq.h delete mode 100644 third_party/speex/libspeex/vq_arm4.h delete mode 100644 third_party/speex/libspeex/vq_bfin.h delete mode 100644 third_party/speex/libspeex/vq_sse.h delete mode 100644 third_party/speex/libspeex/window.c delete mode 100644 third_party/speex/symbian/config.h delete mode 100644 third_party/speex/win32/config.h delete mode 100644 third_party/srtp/CHANGES delete mode 100644 third_party/srtp/LICENSE delete mode 100644 third_party/srtp/Makefile.in delete mode 100644 third_party/srtp/README delete mode 100644 third_party/srtp/TODO delete mode 100644 third_party/srtp/VERSION delete mode 100644 third_party/srtp/config.guess delete mode 100644 third_party/srtp/config.h_win32vc7 delete mode 100644 third_party/srtp/config.hw delete mode 100644 third_party/srtp/config.sub delete mode 100644 third_party/srtp/config_in.h delete mode 100644 third_party/srtp/configure delete mode 100644 third_party/srtp/configure.in delete mode 100644 third_party/srtp/crypto/Makefile delete mode 100644 third_party/srtp/crypto/Makefile.in delete mode 100644 third_party/srtp/crypto/VERSION delete mode 100644 third_party/srtp/crypto/ae_xfm/xfm.c delete mode 100644 third_party/srtp/crypto/cipher/aes.c delete mode 100644 third_party/srtp/crypto/cipher/aes_cbc.c delete mode 100644 third_party/srtp/crypto/cipher/aes_icm.c delete mode 100644 third_party/srtp/crypto/cipher/cipher.c delete mode 100644 third_party/srtp/crypto/cipher/null_cipher.c delete mode 100644 third_party/srtp/crypto/hash/auth.c delete mode 100644 third_party/srtp/crypto/hash/hmac.c delete mode 100644 third_party/srtp/crypto/hash/null_auth.c delete mode 100644 third_party/srtp/crypto/hash/sha1.c delete mode 100644 third_party/srtp/crypto/include/aes.h delete mode 100644 third_party/srtp/crypto/include/aes_cbc.h delete mode 100644 third_party/srtp/crypto/include/aes_icm.h delete mode 100644 third_party/srtp/crypto/include/alloc.h delete mode 100644 third_party/srtp/crypto/include/auth.h delete mode 100644 third_party/srtp/crypto/include/cipher.h delete mode 100644 third_party/srtp/crypto/include/crypto.h delete mode 100644 third_party/srtp/crypto/include/crypto_kernel.h delete mode 100644 third_party/srtp/crypto/include/crypto_math.h delete mode 100644 third_party/srtp/crypto/include/crypto_types.h delete mode 100644 third_party/srtp/crypto/include/cryptoalg.h delete mode 100644 third_party/srtp/crypto/include/datatypes.h delete mode 100644 third_party/srtp/crypto/include/err.h delete mode 100644 third_party/srtp/crypto/include/gf2_8.h delete mode 100644 third_party/srtp/crypto/include/hmac.h delete mode 100644 third_party/srtp/crypto/include/integers.h delete mode 100644 third_party/srtp/crypto/include/kernel_compat.h delete mode 100644 third_party/srtp/crypto/include/key.h delete mode 100644 third_party/srtp/crypto/include/null_auth.h delete mode 100644 third_party/srtp/crypto/include/null_cipher.h delete mode 100644 third_party/srtp/crypto/include/prng.h delete mode 100644 third_party/srtp/crypto/include/rand_source.h delete mode 100644 third_party/srtp/crypto/include/rdb.h delete mode 100644 third_party/srtp/crypto/include/rdbx.h delete mode 100644 third_party/srtp/crypto/include/sha1.h delete mode 100644 third_party/srtp/crypto/include/stat.h delete mode 100644 third_party/srtp/crypto/include/xfm.h delete mode 100644 third_party/srtp/crypto/kernel/alloc.c delete mode 100644 third_party/srtp/crypto/kernel/crypto_kernel.c delete mode 100644 third_party/srtp/crypto/kernel/err.c delete mode 100644 third_party/srtp/crypto/kernel/key.c delete mode 100644 third_party/srtp/crypto/math/datatypes.c delete mode 100644 third_party/srtp/crypto/math/gf2_8.c delete mode 100644 third_party/srtp/crypto/math/math.c delete mode 100644 third_party/srtp/crypto/math/stat.c delete mode 100644 third_party/srtp/crypto/replay/rdb.c delete mode 100644 third_party/srtp/crypto/replay/rdbx.c delete mode 100644 third_party/srtp/crypto/replay/ut_sim.c delete mode 100644 third_party/srtp/crypto/rng/ctr_prng.c delete mode 100644 third_party/srtp/crypto/rng/prng.c delete mode 100644 third_party/srtp/crypto/rng/rand_linux_kernel.c delete mode 100644 third_party/srtp/crypto/rng/rand_source.c delete mode 100644 third_party/srtp/crypto/test/aes_calc.c delete mode 100644 third_party/srtp/crypto/test/auth_driver.c delete mode 100644 third_party/srtp/crypto/test/cipher_driver.c delete mode 100644 third_party/srtp/crypto/test/datatypes_driver.c delete mode 100644 third_party/srtp/crypto/test/env.c delete mode 100644 third_party/srtp/crypto/test/kernel_driver.c delete mode 100644 third_party/srtp/crypto/test/rand_gen.c delete mode 100644 third_party/srtp/crypto/test/sha1_driver.c delete mode 100644 third_party/srtp/crypto/test/stat_driver.c delete mode 100644 third_party/srtp/doc/.keep delete mode 100644 third_party/srtp/include/getopt_s.h delete mode 100644 third_party/srtp/include/rtp.h delete mode 100644 third_party/srtp/include/rtp_priv.h delete mode 100644 third_party/srtp/include/srtp.h delete mode 100644 third_party/srtp/include/srtp_priv.h delete mode 100644 third_party/srtp/include/ut_sim.h delete mode 100644 third_party/srtp/install-sh delete mode 100644 third_party/srtp/pjlib/srtp_err.c delete mode 100644 third_party/srtp/srtp.def delete mode 100644 third_party/srtp/srtp.vcproj delete mode 100644 third_party/srtp/srtp/srtp.c delete mode 100644 third_party/srtp/srtp7.sln delete mode 100644 third_party/srtp/srtp7.vcproj delete mode 100644 third_party/srtp/tables/aes_tables.c delete mode 100644 third_party/srtp/test/dtls_srtp_driver.c delete mode 100644 third_party/srtp/test/getopt_s.c delete mode 100644 third_party/srtp/test/lfsr.c delete mode 100644 third_party/srtp/test/rdbx_driver.c delete mode 100644 third_party/srtp/test/replay_driver.c delete mode 100644 third_party/srtp/test/roc_driver.c delete mode 100644 third_party/srtp/test/rtp.c delete mode 100644 third_party/srtp/test/rtpw.c delete mode 100644 third_party/srtp/test/rtpw_test.sh delete mode 100644 third_party/srtp/test/srtp_driver.c delete mode 100644 third_party/srtp/timing delete mode 100644 third_party/srtp/undos.sh delete mode 100644 third_party/srtp/update.sh diff --git a/third_party/build/os-linux.mak b/third_party/build/os-linux.mak index 6a53b71..56abce4 100644 --- a/third_party/build/os-linux.mak +++ b/third_party/build/os-linux.mak @@ -1,9 +1,9 @@ -DIRS += gsm +#DIRS += gsm DIRS += ilbc -DIRS += speex -DIRS += portaudio -DIRS += g7221 -DIRS += srtp -DIRS += resample +#DIRS += speex +#DIRS += portaudio +#DIRS += g7221 +#DIRS += srtp +#DIRS += resample diff --git a/third_party/g7221/common/basic_op.c b/third_party/g7221/common/basic_op.c deleted file mode 100644 index 028d06f..0000000 --- a/third_party/g7221/common/basic_op.c +++ /dev/null @@ -1,1835 +0,0 @@ -#include "config.h" - -#if !PJMEDIA_LIBG7221_FUNCS_INLINED || \ - (PJMEDIA_LIBG7221_FUNCS_INLINED && defined(__BASIC_OP_H__)) - -/*___________________________________________________________________________ - | | - | Basic arithmetic operators. | - |___________________________________________________________________________| -*/ - -/*___________________________________________________________________________ - | | - | Include-Files | - |___________________________________________________________________________| -*/ - -//#include -//#include -#include "typedef.h" -#include "basic_op.h" -#include - -#if (WMOPS) -#include "count.h" -extern BASIC_OP multiCounter[MAXCOUNTERS]; -extern int currCounter; - -#endif - -/*___________________________________________________________________________ - | | - | Constants and Globals | - |___________________________________________________________________________| -*/ -#if INCLUDE_UNSAFE -Flag g7221_Overflow = 0; -Flag g7221_Carry = 0; -#endif - -/*___________________________________________________________________________ - | | - | Functions | - |___________________________________________________________________________| -*/ -/*___________________________________________________________________________ - | | - | Function Name : shr | - | | - | Purpose : | - | | - | Arithmetically shift the 16 bit input var1 right var2 positions with | - | sign extension. If var2 is negative, arithmetically shift var1 left by | - | -var2 with sign extension. Saturate the result in case of underflows or | - | overflows. | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word16) shr (Word16 var1, Word16 var2) -{ - if (var2 < 0) - { - if (var2 < -16) - var2 = -16; - return shl_nocheck(var1, (Word16) -var2); - } - else - { - return shr_nocheck(var1, var2); - } -} -/* ------------------------- End of shr() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : shl | - | | - | Purpose : | - | | - | Arithmetically shift the 16 bit input var1 left var2 positions.Zero fill| - | the var2 LSB of the result. If var2 is negative, arithmetically shift | - | var1 right by -var2 with sign extension. Saturate the result in case of | - | underflows or overflows. | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word16) shl (Word16 var1, Word16 var2) -{ - if (var2 < 0) - { - return shr_nocheck(var1, (Word16) -var2); - } - else - { - return shl_nocheck(var1, var2); - } -} -/* ------------------------- End of shl() ------------------------- */ - - - -/*___________________________________________________________________________ - | | - | Function Name : mult | - | | - | Purpose : | - | | - | Performs the multiplication of var1 by var2 and gives a 16 bit result | - | which is scaled i.e.: | - | mult(var1,var2) = extract_l(L_shr((var1 times var2),15)) and | - | mult(-32768,-32768) = 32767. | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word16) mult (Word16 var1, Word16 var2) -{ - Word16 var_out; - Word32 L_product; - - L_product = (Word32) var1 *(Word32) var2; - - L_product = (L_product & (Word32) 0xffff8000L) >> 15; - - if (L_product & (Word32) 0x00010000L) - L_product = L_product | (Word32) 0xffff0000L; - - var_out = saturate (L_product); -#if (WMOPS) - multiCounter[currCounter].mult++; -#endif - return (var_out); -} -/* ------------------------- End of mult() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : L_msu | - | | - | Purpose : | - | | - | Multiply var1 by var2 and shift the result left by 1. Subtract the 32 | - | bit result to L_var3 with saturation, return a 32 bit result: | - | L_msu(L_var3,var1,var2) = L_sub(L_var3,L_mult(var1,var2)). | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | L_var3 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word32) L_msu (Word32 L_var3, Word16 var1, Word16 var2) -{ - Word32 L_var_out; - Word32 L_product; - - L_product = L_mult (var1, var2); -#if (WMOPS) - multiCounter[currCounter].L_mult--; -#endif - L_var_out = L_sub (L_var3, L_product); -#if (WMOPS) - multiCounter[currCounter].L_sub--; - multiCounter[currCounter].L_msu++; -#endif - return (L_var_out); -} -/* ------------------------- End of L_msu() ------------------------- */ - -#if INCLUDE_UNSAFE -/*___________________________________________________________________________ - | | - | Function Name : L_macNs | - | | - | Purpose : | - | | - | Multiply var1 by var2 and shift the result left by 1. Add the 32 bit | - | result to L_var3 without saturation, return a 32 bit result. Generate | - | carry and overflow values : | - | L_macNs(L_var3,var1,var2) = L_add_c(L_var3,L_mult(var1,var2)). | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | L_var3 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - | | - | Caution : | - | | - | In some cases the Carry flag has to be cleared or set before using | - | operators which take into account its value. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word32) L_macNs (Word32 L_var3, Word16 var1, Word16 var2) -{ - Word32 L_var_out; - - L_var_out = L_mult (var1, var2); -#if (WMOPS) - multiCounter[currCounter].L_mult--; -#endif - L_var_out = L_add_c (L_var3, L_var_out); -#if (WMOPS) - multiCounter[currCounter].L_add_c--; - multiCounter[currCounter].L_macNs++; -#endif - return (L_var_out); -} -#endif -/* ------------------------- End of L_macNs() ------------------------- */ - -#if INCLUDE_UNSAFE -/*___________________________________________________________________________ - | | - | Function Name : L_msuNs | - | | - | Purpose : | - | | - | Multiply var1 by var2 and shift the result left by 1. Subtract the 32 | - | bit result from L_var3 without saturation, return a 32 bit result. Ge- | - | nerate carry and overflow values : | - | L_msuNs(L_var3,var1,var2) = L_sub_c(L_var3,L_mult(var1,var2)). | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | L_var3 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - | | - | Caution : | - | | - | In some cases the Carry flag has to be cleared or set before using | - | operators which take into account its value. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word32) L_msuNs (Word32 L_var3, Word16 var1, Word16 var2) -{ - Word32 L_var_out; - - L_var_out = L_mult (var1, var2); -#if (WMOPS) - multiCounter[currCounter].L_mult--; -#endif - L_var_out = L_sub_c (L_var3, L_var_out); -#if (WMOPS) - multiCounter[currCounter].L_sub_c--; - multiCounter[currCounter].L_msuNs++; -#endif - return (L_var_out); -} -#endif - -/* ------------------------- End of L_msuNs() ------------------------- */ - - -#if INCLUDE_UNSAFE -/*___________________________________________________________________________ - | | - | Function Name : L_add_c | - | | - | Purpose : | - | | - | Performs 32 bits addition of the two 32 bits variables (L_var1+L_var2+C)| - | with carry. No saturation. Generate carry and Overflow values. The car- | - | ry and overflow values are binary variables which can be tested and as- | - | signed values. | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | L_var1 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | L_var2 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - | | - | Caution : | - | | - | In some cases the Carry flag has to be cleared or set before using | - | operators which take into account its value. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word32) L_add_c (Word32 L_var1, Word32 L_var2) -{ - Word32 L_var_out; - Word32 L_test; - Flag carry_int = 0; - - L_var_out = L_var1 + L_var2 + GET_CARRY(); - - L_test = L_var1 + L_var2; - - if ((L_var1 > 0) && (L_var2 > 0) && (L_test < 0)) - { - SET_OVERFLOW(1); - carry_int = 0; - } - else - { - if ((L_var1 < 0) && (L_var2 < 0)) - { - if (L_test >= 0) - { - SET_OVERFLOW(1); - carry_int = 1; - } - else - { - SET_OVERFLOW(0); - carry_int = 1; - } - } - else - { - if (((L_var1 ^ L_var2) < 0) && (L_test >= 0)) - { - SET_OVERFLOW(0); - carry_int = 1; - } - else - { - SET_OVERFLOW(0); - carry_int = 0; - } - } - } - - if (GET_CARRY()) - { - if (L_test == MAX_32) - { - SET_OVERFLOW(1); - SET_CARRY(carry_int); - } - else - { - if (L_test == (Word32) 0xFFFFFFFFL) - { - SET_CARRY(1); - } - else - { - SET_CARRY(carry_int); - } - } - } - else - { - SET_CARRY(carry_int); - } - -#if (WMOPS) - multiCounter[currCounter].L_add_c++; -#endif - return (L_var_out); -} -#endif - -/* ------------------------- End of L_add_c() ------------------------- */ - -#if INCLUDE_UNSAFE -/*___________________________________________________________________________ - | | - | Function Name : L_sub_c | - | | - | Purpose : | - | | - | Performs 32 bits subtraction of the two 32 bits variables with carry | - | (borrow) : L_var1-L_var2-C. No saturation. Generate carry and Overflow | - | values. The carry and overflow values are binary variables which can | - | be tested and assigned values. | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | L_var1 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | L_var2 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - | | - | Caution : | - | | - | In some cases the Carry flag has to be cleared or set before using | - | operators which take into account its value. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word32) L_sub_c (Word32 L_var1, Word32 L_var2) -{ - Word32 L_var_out; - Word32 L_test; - Flag carry_int = 0; - - if (GET_CARRY()) - { - SET_CARRY(0); - if (L_var2 != MIN_32) - { - L_var_out = L_add_c (L_var1, -L_var2); -#if (WMOPS) - multiCounter[currCounter].L_add_c--; -#endif - } - else - { - L_var_out = L_var1 - L_var2; - if (L_var1 > 0L) - { - SET_OVERFLOW(1); - SET_CARRY(0); - } - } - } - else - { - L_var_out = L_var1 - L_var2 - (Word32) 0X00000001L; - L_test = L_var1 - L_var2; - - if ((L_test < 0) && (L_var1 > 0) && (L_var2 < 0)) - { - SET_OVERFLOW(1); - carry_int = 0; - } - else if ((L_test > 0) && (L_var1 < 0) && (L_var2 > 0)) - { - SET_OVERFLOW(1); - carry_int = 1; - } - else if ((L_test > 0) && ((L_var1 ^ L_var2) > 0)) - { - SET_OVERFLOW(0); - carry_int = 1; - } - if (L_test == MIN_32) - { - SET_OVERFLOW(1); - SET_CARRY(carry_int); - } - else - { - SET_CARRY(carry_int); - } - } - -#if (WMOPS) - multiCounter[currCounter].L_sub_c++; -#endif - return (L_var_out); -} -#endif -/* ------------------------- End of L_sub_c() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : L_negate | - | | - | Purpose : | - | | - | Negate the 32 bit variable L_var1 with saturation; saturate in the case | - | where input is -2147483648 (0x8000 0000). | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | L_var1 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word32) L_negate (Word32 L_var1) -{ - Word32 L_var_out; - - L_var_out = (L_var1 == MIN_32) ? MAX_32 : -L_var1; -#if (WMOPS) - multiCounter[currCounter].L_negate++; -#endif - return (L_var_out); -} -/* ------------------------- End of L_negate() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : mult_r | - | | - | Purpose : | - | | - | Same as mult with rounding, i.e.: | - | mult_r(var1,var2) = extract_l(L_shr(((var1 * var2) + 16384),15)) and | - | mult_r(-32768,-32768) = 32767. | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word16) mult_r (Word16 var1, Word16 var2) -{ - Word16 var_out; - Word32 L_product_arr; - - L_product_arr = (Word32) var1 *(Word32) var2; /* product */ - L_product_arr += (Word32) 0x00004000L; /* round */ - L_product_arr &= (Word32) 0xffff8000L; - L_product_arr >>= 15; /* shift */ - - if (L_product_arr & (Word32) 0x00010000L) /* sign extend when necessary */ - { - L_product_arr |= (Word32) 0xffff0000L; - } - var_out = saturate (L_product_arr); -#if (WMOPS) - multiCounter[currCounter].mult_r++; -#endif - return (var_out); -} -/* ------------------------- End of mult_r() ------------------------- */ - - - -/*___________________________________________________________________________ - | | - | Function Name : shr_r | - | | - | Purpose : | - | | - | Same as shr(var1,var2) but with rounding. Saturate the result in case of| - | underflows or overflows : | - | - If var2 is greater than zero : | - | if (sub(shl(shr(var1,var2),1),shr(var1,sub(var2,1)))) | - | is equal to zero | - | then | - | shr_r(var1,var2) = shr(var1,var2) | - | else | - | shr_r(var1,var2) = add(shr(var1,var2),1) | - | - If var2 is less than or equal to zero : | - | shr_r(var1,var2) = shr(var1,var2). | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word16) shr_r (Word16 var1, Word16 var2) -{ - Word16 var_out; - - if (var2 > 15) - { - var_out = 0; - } - else - { - var_out = shr (var1, var2); -#if (WMOPS) - multiCounter[currCounter].shr--; -#endif - - if (var2 > 0) - { - if ((var1 & ((Word16) 1 << (var2 - 1))) != 0) - { - var_out++; - } - } - } -#if (WMOPS) - multiCounter[currCounter].shr_r++; -#endif - return (var_out); -} -/* ------------------------- End of shr_r() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : mac_r | - | | - | Purpose : | - | | - | Multiply var1 by var2 and shift the result left by 1. Add the 32 bit | - | result to L_var3 with saturation. Round the LS 16 bits of the result | - | into the MS 16 bits with saturation and shift the result right by 16. | - | Return a 16 bit result. | - | mac_r(L_var3,var1,var2) = round(L_mac(L_var3,var1,var2)) | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | L_var3 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0x0000 8000 <= L_var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word16) mac_r (Word32 L_var3, Word16 var1, Word16 var2) -{ - Word16 var_out; - - L_var3 = L_mac (L_var3, var1, var2); -#if (WMOPS) - multiCounter[currCounter].L_mac--; -#endif - L_var3 = L_add (L_var3, (Word32) 0x00008000L); -#if (WMOPS) - multiCounter[currCounter].L_add--; -#endif - var_out = extract_h (L_var3); -#if (WMOPS) - multiCounter[currCounter].extract_h--; - multiCounter[currCounter].mac_r++; -#endif - return (var_out); -} -/* ------------------------- End of mac_r() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : msu_r | - | | - | Purpose : | - | | - | Multiply var1 by var2 and shift the result left by 1. Subtract the 32 | - | bit result to L_var3 with saturation. Round the LS 16 bits of the res- | - | ult into the MS 16 bits with saturation and shift the result right by | - | 16. Return a 16 bit result. | - | msu_r(L_var3,var1,var2) = round(L_msu(L_var3,var1,var2)) | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | L_var3 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0x0000 8000 <= L_var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word16) msu_r (Word32 L_var3, Word16 var1, Word16 var2) -{ - Word16 var_out; - - L_var3 = L_msu (L_var3, var1, var2); -#if (WMOPS) - multiCounter[currCounter].L_msu--; -#endif - L_var3 = L_add (L_var3, (Word32) 0x00008000L); -#if (WMOPS) - multiCounter[currCounter].L_add--; -#endif - var_out = extract_h (L_var3); -#if (WMOPS) - multiCounter[currCounter].extract_h--; - multiCounter[currCounter].msu_r++; -#endif - return (var_out); -} -/* ------------------------- End of msu_r() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : L_deposit_h | - | | - | Purpose : | - | | - | Deposit the 16 bit var1 into the 16 MS bits of the 32 bit output. The | - | 16 LS bits of the output are zeroed. | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= var_out <= 0x7fff 0000. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word32) L_deposit_h (Word16 var1) -{ - Word32 L_var_out; - - L_var_out = (Word32) var1 << 16; -#if (WMOPS) - multiCounter[currCounter].L_deposit_h++; -#endif - return (L_var_out); -} -/* ------------------------- End of L_deposit_h() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : L_deposit_l | - | | - | Purpose : | - | | - | Deposit the 16 bit var1 into the 16 LS bits of the 32 bit output. The | - | 16 MS bits of the output are sign extended. | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0xFFFF 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word32) L_deposit_l (Word16 var1) -{ - Word32 L_var_out; - - L_var_out = (Word32) var1; -#if (WMOPS) - multiCounter[currCounter].L_deposit_l++; -#endif - return (L_var_out); -} -/* ------------------------- End of L_deposit_l() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : L_shr_r | - | | - | Purpose : | - | | - | Same as L_shr(L_var1,var2) but with rounding. Saturate the result in | - | case of underflows or overflows : | - | - If var2 is greater than zero : | - | if (L_sub(L_shl(L_shr(L_var1,var2),1),L_shr(L_var1,sub(var2,1))))| - | is equal to zero | - | then | - | L_shr_r(L_var1,var2) = L_shr(L_var1,var2) | - | else | - | L_shr_r(L_var1,var2) = L_add(L_shr(L_var1,var2),1) | - | - If var2 is less than or equal to zero : | - | L_shr_r(L_var1,var2) = L_shr(L_var1,var2). | - | | - | Complexity weight : 3 | - | | - | Inputs : | - | | - | L_var1 | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= var1 <= 0x7fff ffff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= var_out <= 0x7fff ffff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word32) L_shr_r (Word32 L_var1, Word16 var2) -{ - Word32 L_var_out; - - if (var2 > 31) - { - L_var_out = 0; - } - else - { - L_var_out = L_shr (L_var1, var2); -#if (WMOPS) - multiCounter[currCounter].L_shr--; -#endif - if (var2 > 0) - { - if ((L_var1 & ((Word32) 1 << (var2 - 1))) != 0) - { - L_var_out++; - } - } - } -#if (WMOPS) - multiCounter[currCounter].L_shr_r++; -#endif - return (L_var_out); -} -/* ------------------------- End of L_shr_r() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : L_abs | - | | - | Purpose : | - | | - | Absolute value of L_var1; Saturate in case where the input is | - | -214783648 | - | | - | Complexity weight : 3 | - | | - | Inputs : | - | | - | L_var1 | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= var1 <= 0x7fff ffff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x0000 0000 <= var_out <= 0x7fff ffff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word32) L_abs (Word32 L_var1) -{ - Word32 L_var_out; - - if (L_var1 == MIN_32) - { - L_var_out = MAX_32; - } - else - { - if (L_var1 < 0) - { - L_var_out = -L_var1; - } - else - { - L_var_out = L_var1; - } - } - -#if (WMOPS) - multiCounter[currCounter].L_abs++; -#endif - return (L_var_out); -} -/* ------------------------- End of L_abs() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : norm_s | - | | - | Purpose : | - | | - | Produces the number of left shift needed to normalize the 16 bit varia- | - | ble var1 for positive values on the interval with minimum of 16384 and | - | maximum of 32767, and for negative values on the interval with minimum | - | of -32768 and maximum of -16384; in order to normalize the result, the | - | following operation must be done : | - | norm_var1 = shl(var1,norm_s(var1)). | - | | - | Complexity weight : 15 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0x0000 0000 <= var_out <= 0x0000 000f. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word16) norm_s (Word16 var1) -{ - Word16 var_out; - - if (var1 == 0) - { - var_out = 0; - } - else - { - if ((UWord16)var1 == (UWord16)0xffff) - { - var_out = 15; - } - else - { - if (var1 < 0) - { - var1 = (Word16)(~var1); - } - for (var_out = 0; var1 < 0x4000; var_out++) - { - var1 <<= 1; - } - } - } - -#if (WMOPS) - multiCounter[currCounter].norm_s++; -#endif - return (var_out); -} -/* ------------------------- End of norm_s() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : div_s | - | | - | Purpose : | - | | - | Produces a result which is the fractional integer division of var1 by | - | var2; var1 and var2 must be positive and var2 must be greater or equal | - | to var1; the result is positive (leading bit equal to 0) and truncated | - | to 16 bits. | - | If var1 = var2 then div(var1,var2) = 32767. | - | | - | Complexity weight : 18 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0x0000 0000 <= var1 <= var2 and var2 != 0. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : var1 <= var2 <= 0x0000 7fff and var2 != 0. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0x0000 0000 <= var_out <= 0x0000 7fff. | - | It's a Q15 value (point between b15 and b14). | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word16) div_s (Word16 var1, Word16 var2) -{ - Word16 var_out = 0; - Word16 iteration; - Word32 L_num; - Word32 L_denom; - - if ((var1 > var2) || (var1 < 0) || (var2 < 0)) - { - //printf ("Division Error var1=%d var2=%d\n", var1, var2); - //abort(); /* exit (0); */ - pj_assert(!"Division Error"); - } - if (var2 == 0) - { - //printf ("Division by 0, Fatal error \n"); - //abort(); /* exit (0); */ - assert(!"Division by 0"); - } - if (var1 == 0) - { - var_out = 0; - } - else - { - if (var1 == var2) - { - var_out = MAX_16; - } - else - { - L_num = L_deposit_l (var1); -#if (WMOPS) - multiCounter[currCounter].L_deposit_l--; -#endif - L_denom = L_deposit_l (var2); -#if (WMOPS) - multiCounter[currCounter].L_deposit_l--; -#endif - - for (iteration = 0; iteration < 15; iteration++) - { - var_out <<= 1; - L_num <<= 1; - - if (L_num >= L_denom) - { - L_num = L_sub (L_num, L_denom); -#if (WMOPS) - multiCounter[currCounter].L_sub--; -#endif - var_out = add (var_out, 1); -#if (WMOPS) - multiCounter[currCounter].add--; -#endif - } - } - } - } - -#if (WMOPS) - multiCounter[currCounter].div_s++; -#endif - return (var_out); -} -/* ------------------------- End of div_s() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : norm_l | - | | - | Purpose : | - | | - | Produces the number of left shifts needed to normalize the 32 bit varia-| - | ble L_var1 for positive values on the interval with minimum of | - | 1073741824 and maximum of 2147483647, and for negative values on the in-| - | terval with minimum of -2147483648 and maximum of -1073741824; in order | - | to normalize the result, the following operation must be done : | - | norm_L_var1 = L_shl(L_var1,norm_l(L_var1)). | - | | - | Complexity weight : 30 | - | | - | Inputs : | - | | - | L_var1 | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= var1 <= 0x7fff ffff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0x0000 0000 <= var_out <= 0x0000 001f. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word16) norm_l (Word32 L_var1) -{ - Word16 var_out; - - if (L_var1 == 0) - { - var_out = 0; - } - else - { - if (L_var1 == (Word32) 0xffffffffL) - { - var_out = 31; - } - else - { - if (L_var1 < 0) - { - L_var1 = ~L_var1; - } - for (var_out = 0; L_var1 < (Word32) 0x40000000L; var_out++) - { - L_var1 <<= 1; - } - } - } - -#if (WMOPS) - multiCounter[currCounter].norm_l++; -#endif - return (var_out); -} -/* ------------------------- End of norm_l() ------------------------- */ - - -/* - ***************************************************************** - Additional operators extracted from the G.723.1 Library - Adapted for WMOPS calculations - ***************************************************************** -*/ - -/*___________________________________________________________________________ - | | - | Function Name : L_mls | - | | - | Purpose : | - | | - | Multiplies a 16 bit word v by a 32 bit word Lv and returns a 32 bit | - | word (multiplying 16 by 32 bit words gives 48 bit word; the function | - | extracts the 32 MSB and shift the result to the left by 1). | - | | - | A 32 bit word can be written as | - | Lv = a + b * 2^16 | - | where a= unsigned 16 LSBs and b= signed 16 MSBs. | - | The function returns v * Lv / 2^15 which is equivalent to | - | a*v / 2^15 + b*v*2 | - | | - | Complexity weight : 6 [to be confirmed] | - | | - | Inputs : | - | | - | Lv | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= var1 <= 0x7fff ffff. | - | v | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0x8000 <= var1 <= 0x7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= var_out <= 0x7fff ffff. | - | | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(Word32) L_mls (Word32 Lv, Word16 v) -{ - Word32 Temp ; - - Temp = Lv & (Word32) 0x0000ffff ; - Temp = Temp * (Word32) v ; - Temp = L_shr_nocheck( Temp, (Word16) 15 ) ; - Temp = L_mac( Temp, v, extract_h(Lv) ) ; - -#if (WMOPS) - multiCounter[currCounter].L_shr--; - multiCounter[currCounter].L_mac--; - multiCounter[currCounter].extract_h--; - multiCounter[currCounter].L_mls++; -#endif - - return Temp ; -} -/* ------------------------- End of L_mls() ------------------------- */ - - -/*__________________________________________________________________________ -| | -| Function Name : div_l | -| | -| Purpose : | -| | -| Produces a result which is the fractional integer division of L_var1 by| -| var2; L_var1 and var2 must be positive and var2 << 16 must be greater or| -| equal to L_var1; the result is positive (leading bit equal to 0) and | -| truncated to 16 bits. | -| If L_var1 == var2 << 16 then div_l(L_var1,var2) = 32767. | -| | -| Complexity weight : 20 | -| | -| Inputs : | -| | -| L_var1 | -| 32 bit long signed integer (Word32) whose value falls in the | -| range : 0x0000 0000 <= var1 <= (var2 << 16) and var2 != 0. | -| L_var1 must be considered as a Q.31 value | -| | -| var2 | -| 16 bit short signed integer (Word16) whose value falls in the | -| range : var1 <= (var2<< 16) <= 0x7fff0000 and var2 != 0. | -| var2 must be considered as a Q.15 value | -| | -| Outputs : | -| | -| none | -| | -| Return Value : | -| | -| var_out | -| 16 bit short signed integer (Word16) whose value falls in the | -| range : 0x0000 0000 <= var_out <= 0x0000 7fff. | -| It's a Q15 value (point between b15 and b14). | -|___________________________________________________________________________| -*/ -LIBG7221_DEF(Word16) div_l (Word32 L_num, Word16 den) -{ - Word16 var_out = (Word16)0; - Word32 L_den; - Word16 iteration; - -#if (WMOPS) - multiCounter[currCounter].div_l++; -#endif - - if ( den == (Word16) 0 ) { - //printf("Division by 0 in div_l, Fatal error \n"); - //exit(0); - assert(!"Division by 0"); - } - - if ( (L_num < (Word32) 0) || (den < (Word16) 0) ) { - //printf("Division Error in div_l, Fatal error \n"); - //exit(0); - assert(!"Division Error"); - } - - L_den = L_deposit_h( den ) ; -#if (WMOPS) - multiCounter[currCounter].L_deposit_h--; -#endif - - if ( L_num >= L_den ){ - return MAX_16 ; - } - else { - L_num = L_shr_nocheck(L_num, (Word16)1) ; - L_den = L_shr_nocheck(L_den, (Word16)1); -#if (WMOPS) - multiCounter[currCounter].L_shr-=2; -#endif - for(iteration=(Word16)0; iteration< (Word16)15;iteration++) { - var_out = shl_nocheck( var_out, (Word16)1); - L_num = L_shl_nocheck( L_num, (Word16)1); -#if (WMOPS) - multiCounter[currCounter].shl--; - multiCounter[currCounter].L_shl--; -#endif - if (L_num >= L_den) { - L_num = L_sub(L_num,L_den); - var_out = add(var_out, (Word16)1); -#if (WMOPS) - multiCounter[currCounter].L_sub--; - multiCounter[currCounter].add--; -#endif - } - } - - return var_out; - } -} -/* ------------------------- End of div_l() ------------------------- */ - - -/*__________________________________________________________________________ -| | -| Function Name : i_mult | -| | -| Purpose : | -| | -| Integer 16-bit multiplication. No overflow protection is performed if | -| ORIGINAL_G7231 is defined. | -| | -| Complexity weight : TBD | -| | -| Inputs : | -| | -| a | -| 16 bit short signed integer (Word16). | -| | -| b | -| 16 bit short signed integer (Word16). | -| | -| Outputs : | -| | -| none | -| | -| Return Value : | -| | -| 16 bit short signed integer (Word16). No overflow checks | -| are performed if ORIGINAL_G7231 is defined. | -|___________________________________________________________________________| -*/ -LIBG7221_DEF(Word16) i_mult (Word16 a, Word16 b) -{ -#ifdef ORIGINAL_G7231 - return a*b ; -#else - Word32 register c=a*b; -#if (WMOPS) - multiCounter[currCounter].i_mult++; -#endif - return saturate(c) ; -#endif -} -/* ------------------------- End of i_mult() ------------------------- */ - - -/* - ********************************************************************** - The following three operators are not part of the original - G.729/G.723.1 set of basic operators and implement shiftless - accumulation operation. - ********************************************************************** -*/ - -/*___________________________________________________________________________ - | - | Function Name : L_mult0 - | - | Purpose : - | - | L_mult0 is the 32 bit result of the multiplication of var1 times var2 - | without one left shift. - | - | Complexity weight : 1 - | - | Inputs : - | - | var1 16 bit short signed integer (Word16) whose value falls in the - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. - | - | var2 16 bit short signed integer (Word16) whose value falls in the - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. - | - | Return Value : - | - | L_var_out - | 32 bit long signed integer (Word32) whose value falls in the - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. - |___________________________________________________________________________ -*/ -LIBG7221_DEF(Word32) L_mult0 (Word16 var1,Word16 var2) -{ - Word32 L_var_out; - - L_var_out = (Word32)var1 * (Word32)var2; - -#if (WMOPS) - multiCounter[currCounter].L_mult0++; -#endif - return(L_var_out); -} -/* ------------------------- End of L_mult0() ------------------------- */ - - -/*___________________________________________________________________________ - | - | Function Name : L_mac0 - | - | Purpose : - | - | Multiply var1 by var2 (without left shift) and add the 32 bit result to - | L_var3 with saturation, return a 32 bit result: - | L_mac0(L_var3,var1,var2) = L_add(L_var3,(L_mult0(var1,var2)). - | - | Complexity weight : 1 - | - | Inputs : - | - | L_var3 32 bit long signed integer (Word32) whose value falls in the - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. - | - | var1 16 bit short signed integer (Word16) whose value falls in the - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. - | - | var2 16 bit short signed integer (Word16) whose value falls in the - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. - | - | Return Value : - | - | L_var_out - | 32 bit long signed integer (Word32) whose value falls in the - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. - |___________________________________________________________________________ -*/ -LIBG7221_DEF(Word32) L_mac0 (Word32 L_var3, Word16 var1, Word16 var2) -{ - Word32 L_var_out; - Word32 L_product; - - L_product = L_mult0(var1,var2); - L_var_out = L_add(L_var3,L_product); - -#if (WMOPS) - multiCounter[currCounter].L_mac0++; - multiCounter[currCounter].L_mult0--; - multiCounter[currCounter].L_add--; -#endif - return(L_var_out); -} -/* ------------------------- End of L_mac0() ------------------------- */ - - -/*___________________________________________________________________________ - | - | Function Name : L_msu0 - | - | Purpose : - | - | Multiply var1 by var2 (without left shift) and subtract the 32 bit - | result to L_var3 with saturation, return a 32 bit result: - | L_msu0(L_var3,var1,var2) = L_sub(L_var3,(L_mult0(var1,var2)). - | - | Complexity weight : 1 - | - | Inputs : - | - | L_var3 32 bit long signed integer (Word32) whose value falls in the - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. - | - | var1 16 bit short signed integer (Word16) whose value falls in the - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. - | - | var2 16 bit short signed integer (Word16) whose value falls in the - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. - | - | Return Value : - | - | L_var_out - | 32 bit long signed integer (Word32) whose value falls in the - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. - |___________________________________________________________________________ -*/ -LIBG7221_DEF(Word32) L_msu0 (Word32 L_var3, Word16 var1, Word16 var2) -{ - Word32 L_var_out; - Word32 L_product; - - L_product = L_mult0(var1,var2); - L_var_out = L_sub(L_var3,L_product); - -#if (WMOPS) - multiCounter[currCounter].L_msu0++; - multiCounter[currCounter].L_mult0--; - multiCounter[currCounter].L_sub--; -#endif - return(L_var_out); -} -/* ------------------------- End of L_msu0() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : LU_shl | - | | - | Purpose : | - | | - | Arithmetically shift the 32 bit input L_var1 left var2 positions. Zero | - | fill the var2 LSB of the result. If var2 is negative, arithmetically | - | shift L_var1 right by -var2 with sign extension. Saturate the result in | - | case of underflows or overflows. | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | L_var1 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(UWord32) LU_shl (UWord32 L_var1, Word16 var2) -{ - Word16 neg_var2; - UWord32 L_var_out = 0; - - if (var2 <= 0) - { - if (var2 < -32) - var2 = -32; - neg_var2 = negate(var2); - L_var_out = LU_shr (L_var1, neg_var2); -#if (WMOPS) - multiCounter[currCounter].negate--; - multiCounter[currCounter].LU_shr--; -#endif - } - else - { - for (; var2 > 0; var2--) - { - if (L_var1 > (UWord32) 0X7fffffffL) - { - SET_OVERFLOW(1); - L_var_out = UMAX_32; - break; - } - else - { - if (L_var1 < (UWord32) 0x00000001L) - { - SET_OVERFLOW(1); - L_var_out = (UWord32)MIN_32; - break; - } - } - L_var1 *= 2; - L_var_out = L_var1; - } - } -#if (WMOPS) - multiCounter[currCounter].LU_shl++; -#endif - return (L_var_out); -} -/* ------------------------- End of LU_shl() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : LU_shr | - | | - | Purpose : | - | | - | Arithmetically shift the 32 bit input L_var1 right var2 positions with | - | sign extension. If var2 is negative, arithmetically shift L_var1 left | - | by -var2 and zero fill the -var2 LSB of the result. Saturate the result | - | in case of underflows or overflows. | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | L_var1 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - |___________________________________________________________________________| -*/ -LIBG7221_DEF(UWord32) LU_shr (UWord32 L_var1, Word16 var2) -{ - Word16 neg_var2; - UWord32 L_var_out; - - if (var2 < 0) - { - if (var2 < -32) - var2 = -32; - neg_var2 = negate(var2); - L_var_out = LU_shl (L_var1, neg_var2); -#if (WMOPS) - multiCounter[currCounter].negate--; - multiCounter[currCounter].LU_shl--; -#endif - } - else - { - if (var2 >= 32) - { - L_var_out = 0L; - } - else - { - L_var_out = L_var1 >> var2; - } - } -#if (WMOPS) - multiCounter[currCounter].LU_shr++; -#endif - return (L_var_out); -} -/* ------------------------- End of LU_shr() ------------------------- */ - -#endif /* PJMEDIA_LIBG7221_FUNCS_INLINED */ - -/* ************************** END OF BASOP32.C ************************** */ diff --git a/third_party/g7221/common/basic_op.h b/third_party/g7221/common/basic_op.h deleted file mode 100644 index 45104d1..0000000 --- a/third_party/g7221/common/basic_op.h +++ /dev/null @@ -1,117 +0,0 @@ -#ifndef __BASIC_OP_H__ -#define __BASIC_OP_H__ - -#include "config.h" - -/*___________________________________________________________________________ - | | - | Constants and Globals | - |___________________________________________________________________________| -*/ - -#define MAX_32 (Word32)0x7fffffffL -#define MIN_32 (Word32)0x80000000L - -#define MAX_16 (Word16)0x7fff -#define MIN_16 (Word16)(pj_uint16_t)0x8000 - -#define UMAX_32 (UWord32)0xffffffffL -#define UMIN_32 (UWord32)0x00000000L - -/*___________________________________________________________________________ - | | - | Prototypes for basic arithmetic operators | - |___________________________________________________________________________| -*/ - -PJ_INLINE(Word16) add (Word16 var1, Word16 var2); /* Short add, 1 */ -PJ_INLINE(Word16) sub (Word16 var1, Word16 var2); /* Short sub, 1 */ -PJ_INLINE(Word16) abs_s (Word16 var1); /* Short abs, 1 */ -LIBG7221_DECL(Word16) shl (Word16 var1, Word16 var2); /* Short shift left, 1 */ -PJ_INLINE(Word16) shl_nocheck(Word16 var1, Word16 var2); -LIBG7221_DECL(Word16) shr (Word16 var1, Word16 var2); /* Short shift right, 1 */ -PJ_INLINE(Word16) shr_nocheck(Word16 var1, Word16 var2); -LIBG7221_DECL(Word16) mult (Word16 var1, Word16 var2); /* Short mult, 1 */ -PJ_INLINE(Word32) L_mult (Word16 var1, Word16 var2); /* Long mult, 1 */ -PJ_INLINE(Word16) negate (Word16 var1); /* Short negate, 1 */ -PJ_INLINE(Word16) extract_h (Word32 L_var1); /* Extract high, 1 */ -PJ_INLINE(Word16) extract_l (Word32 L_var1); /* Extract low, 1 */ -PJ_INLINE(Word16) itu_round (Word32 L_var1); /* Round, 1 */ -PJ_INLINE(Word32) L_mac (Word32 L_var3, Word16 var1, Word16 var2); /* Mac, 1 */ -LIBG7221_DECL(Word32) L_msu (Word32 L_var3, Word16 var1, Word16 var2); /* Msu, 1 */ -LIBG7221_DECL(Word32) L_macNs (Word32 L_var3, Word16 var1, Word16 var2); /* Mac without - sat, 1 */ -LIBG7221_DECL(Word32) L_msuNs (Word32 L_var3, Word16 var1, Word16 var2); /* Msu without - sat, 1 */ -//PJ_INLINE(Word32) L_add (Word32 L_var1, Word32 L_var2); /* Long add, 2 */ -PJ_INLINE(Word32) L_sub (Word32 L_var1, Word32 L_var2); /* Long sub, 2 */ -LIBG7221_DECL(Word32) L_add_c (Word32 L_var1, Word32 L_var2); /* Long add with c, 2 */ -LIBG7221_DECL(Word32) L_sub_c (Word32 L_var1, Word32 L_var2); /* Long sub with c, 2 */ -LIBG7221_DECL(Word32) L_negate (Word32 L_var1); /* Long negate, 2 */ -LIBG7221_DECL(Word16) mult_r (Word16 var1, Word16 var2); /* Mult with round, 2 */ -PJ_INLINE(Word32) L_shl (Word32 L_var1, Word16 var2); /* Long shift left, 2 */ -PJ_INLINE(Word32) L_shr (Word32 L_var1, Word16 var2); /* Long shift right, 2*/ -LIBG7221_DECL(Word16) shr_r (Word16 var1, Word16 var2); /* Shift right with - round, 2 */ -LIBG7221_DECL(Word16) mac_r (Word32 L_var3, Word16 var1, Word16 var2); /* Mac with - rounding,2 */ -LIBG7221_DECL(Word16) msu_r (Word32 L_var3, Word16 var1, Word16 var2); /* Msu with - rounding,2 */ -LIBG7221_DECL(Word32) L_deposit_h (Word16 var1); /* 16 bit var1 -> MSB, 2 */ -LIBG7221_DECL(Word32) L_deposit_l (Word16 var1); /* 16 bit var1 -> LSB, 2 */ - -LIBG7221_DECL(Word32) L_shr_r (Word32 L_var1, Word16 var2); /* Long shift right with - round, 3 */ -LIBG7221_DECL(Word32) L_abs (Word32 L_var1); /* Long abs, 3 */ -LIBG7221_DECL(Word32) L_sat (Word32 L_var1); /* Long saturation, 4 */ -LIBG7221_DECL(Word16) norm_s (Word16 var1); /* Short norm, 15 */ -LIBG7221_DECL(Word16) div_s (Word16 var1, Word16 var2); /* Short division, 18 */ -LIBG7221_DECL(Word16) norm_l (Word32 L_var1); /* Long norm, 30 */ - -/* - Additional G.723.1 operators -*/ -LIBG7221_DECL(Word32) L_mls( Word32, Word16 ) ; /* Weight FFS; currently assigned 1 */ -LIBG7221_DECL(Word16) div_l( Word32, Word16 ) ; /* Weight FFS; currently assigned 1 */ -LIBG7221_DECL(Word16) i_mult(Word16 a, Word16 b); /* Weight FFS; currently assigned 1 */ - -/* - New shiftless operators, not used in G.729/G.723.1 -*/ -LIBG7221_DECL(Word32) L_mult0(Word16 v1, Word16 v2); /* 32-bit Multiply w/o shift 1 */ -LIBG7221_DECL(Word32) L_mac0(Word32 L_v3, Word16 v1, Word16 v2); /* 32-bit Mac w/o shift 1 */ -LIBG7221_DECL(Word32) L_msu0(Word32 L_v3, Word16 v1, Word16 v2); /* 32-bit Msu w/o shift 1 */ - -/* - Additional G.722.1 operators -*/ -LIBG7221_DECL(UWord32) LU_shl (UWord32 L_var1, Word16 var2); -LIBG7221_DECL(UWord32) LU_shr (UWord32 L_var1, Word16 var2); - -#define INCLUDE_UNSAFE 0 - -/* Local */ -PJ_INLINE(Word16) saturate (Word32 L_var1); - -#if INCLUDE_UNSAFE - extern Flag g7221_Overflow; - extern Flag g7221_Carry; -# define SET_OVERFLOW(n) g7221_Overflow = n -# define SET_CARRY(n) g7221_Carry = n - -#else -# define SET_OVERFLOW(n) -# define SET_CARRY(n) -# define GET_OVERFLOW() 0 -# define GET_CARRY() 0 -#endif - -#include "basic_op_i.h" - -#if PJMEDIA_LIBG7221_FUNCS_INLINED -# include "basic_op.c" -#endif - -#endif /* __BASIC_OP_H__ */ - - diff --git a/third_party/g7221/common/basic_op_i.h b/third_party/g7221/common/basic_op_i.h deleted file mode 100644 index d690623..0000000 --- a/third_party/g7221/common/basic_op_i.h +++ /dev/null @@ -1,730 +0,0 @@ -/*___________________________________________________________________________ - | | - | Function Name : extract_h | - | | - | Purpose : | - | | - | Return the 16 MSB of L_var1. | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | L_var1 | - | 32 bit long signed integer (Word32 ) whose value falls in the | - | range : 0x8000 0000 <= L_var1 <= 0x7fff ffff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word16) extract_h (Word32 L_var1) -{ - return (Word16) (L_var1 >> 16); -} -/* ------------------------- End of extract_h() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : extract_l | - | | - | Purpose : | - | | - | Return the 16 LSB of L_var1. | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | L_var1 | - | 32 bit long signed integer (Word32 ) whose value falls in the | - | range : 0x8000 0000 <= L_var1 <= 0x7fff ffff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word16) extract_l (Word32 L_var1) -{ - return (Word16) L_var1; -} - -/* ------------------------- End of extract_l() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : saturate | - | | - | Purpose : | - | | - | Limit the 32 bit input to the range of a 16 bit word. | - | | - | Inputs : | - | | - | L_var1 | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var1 <= 0x7fff ffff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word16) saturate (Word32 L_var1) -{ - Word16 val16 = (Word16) L_var1; - - if (val16 == L_var1) - return val16; - - if (L_var1 > MAX_16) - return MAX_16; - return MIN_16; -} -/* ------------------------- End of saturate() ------------------------- */ - - -#if PJ_HAS_INT64 -PJ_INLINE(Word32) L_saturate (pj_int64_t LL_var1) -{ - pj_int32_t L_var1 = (pj_int32_t)LL_var1; - if (LL_var1 == L_var1) - return L_var1; - else if (LL_var1 > MAX_32) - return MAX_32; - else - return MIN_32; -} -#endif - - -/*___________________________________________________________________________ - | | - | Function Name : add | - | | - | Purpose : | - | | - | Performs the addition (var1+var2) with overflow control and saturation;| - | the 16 bit result is set at +32767 when overflow occurs or at -32768 | - | when underflow occurs. | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word16) add (Word16 var1, Word16 var2) -{ - return saturate (var1 + var2); -} -/* ------------------------- End of add() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : sub | - | | - | Purpose : | - | | - | Performs the subtraction (var1+var2) with overflow control and satu- | - | ration; the 16 bit result is set at +32767 when overflow occurs or at | - | -32768 when underflow occurs. | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word16) sub (Word16 var1, Word16 var2) -{ - return saturate ((Word32) var1 - var2); -} -/* ------------------------- End of sub() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : negate | - | | - | Purpose : | - | | - | Negate var1 with saturation, saturate in the case where input is -32768:| - | negate(var1) = sub(0,var1). | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word16) negate (Word16 var1) -{ - return (Word16)((var1 == MIN_16) ? MAX_16 : -var1); -} -/* ------------------------- End of negate() ------------------------- */ - - - - -/*___________________________________________________________________________ - | | - | Function Name : L_add | - | | - | Purpose : | - | | - | 32 bits addition of the two 32 bits variables (L_var1+L_var2) with | - | overflow control and saturation; the result is set at +2147483647 when | - | overflow occurs or at -2147483648 when underflow occurs. | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | L_var1 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | L_var2 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word32) L_add (Word32 L_var1, Word32 L_var2) -{ -#if PJ_HAS_INT64 - return L_saturate(((pj_int64_t)L_var1) + L_var2); -#else - Word32 L_var_out; - - L_var_out = L_var1 + L_var2; - - if (((L_var1 ^ L_var2) & MIN_32) == 0) - { - if ((L_var_out ^ L_var1) & MIN_32) - { - SET_OVERFLOW(1); - L_var_out = (L_var1 < 0) ? MIN_32 : MAX_32; - } - } - return (L_var_out); -#endif -} - -/* ------------------------- End of L_add() ------------------------- */ - - - - -/*___________________________________________________________________________ - | | - | Function Name : L_sub | - | | - | Purpose : | - | | - | 32 bits subtraction of the two 32 bits variables (L_var1-L_var2) with | - | overflow control and saturation; the result is set at +2147483647 when | - | overflow occurs or at -2147483648 when underflow occurs. | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | L_var1 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | L_var2 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word32) L_sub (Word32 L_var1, Word32 L_var2) -{ -#if PJ_HAS_INT64 - return L_saturate((pj_int64_t)L_var1 - L_var2); -#else - Word32 L_var_out; - - L_var_out = L_var1 - L_var2; - - if (((L_var1 ^ L_var2) & MIN_32) != 0) - { - if ((L_var_out ^ L_var1) & MIN_32) - { - L_var_out = (L_var1 < 0L) ? MIN_32 : MAX_32; - SET_OVERFLOW(1); - } - } - return (L_var_out); -#endif -} -/* ------------------------- End of L_sub() ------------------------- */ - -/*___________________________________________________________________________ - | | - | Function Name : L_mult | - | | - | Purpose : | - | | - | L_mult is the 32 bit result of the multiplication of var1 times var2 | - | with one shift left i.e.: | - | L_mult(var1,var2) = L_shl((var1 times var2),1) and | - | L_mult(-32768,-32768) = 2147483647. | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word32) L_mult (Word16 var1, Word16 var2) -{ - Word32 L_var_out; - - L_var_out = (Word32) var1 *(Word32) var2; - - if (L_var_out != (Word32) 0x40000000L) - { - return L_var_out << 1; - } - else - { - SET_OVERFLOW(1); - return MAX_32; - } -} -/* ------------------------- End of L_mult() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : L_mac | - | | - | Purpose : | - | | - | Multiply var1 by var2 and shift the result left by 1. Add the 32 bit | - | result to L_var3 with saturation, return a 32 bit result: | - | L_mac(L_var3,var1,var2) = L_add(L_var3,L_mult(var1,var2)). | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | L_var3 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word32) L_mac (Word32 L_var3, Word16 var1, Word16 var2) -{ - return L_add (L_var3, L_mult (var1, var2)); -} -/* ------------------------- End of L_mac() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : round | - | | - | Purpose : | - | | - | Round the lower 16 bits of the 32 bit input number into the MS 16 bits | - | with saturation. Shift the resulting bits right by 16 and return the 16 | - | bit number: | - | round(L_var1) = extract_h(L_add(L_var1,32768)) | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | L_var1 | - | 32 bit long signed integer (Word32 ) whose value falls in the | - | range : 0x8000 0000 <= L_var1 <= 0x7fff ffff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word16) itu_round (Word32 L_var1) -{ - return extract_h (L_add (L_var1, (Word32) 0x00008000L)); -} -/* ------------------------- End of round() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : L_shr | - | | - | Purpose : | - | | - | Arithmetically shift the 32 bit input L_var1 right var2 positions with | - | sign extension. If var2 is negative, arithmetically shift L_var1 left | - | by -var2 and zero fill the -var2 LSB of the result. Saturate the result | - | in case of underflows or overflows. | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | L_var1 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word32) L_shr_nocheck(Word32 L_var1, Word16 var2) -{ -#if 1 - return L_var1 >> var2; -#else - if (var2 >= 31) - { - return (L_var1 < 0L) ? -1 : 0; - } - else - { - if (L_var1 < 0) - { - return ~((~L_var1) >> var2); - } - else - { - return L_var1 >> var2; - } - } -#endif -} - -PJ_INLINE(Word32) L_shl_nocheck (Word32 L_var1, Word16 var2) -{ -#if PJ_HAS_INT64 - return L_saturate( ((pj_int64_t)L_var1) << var2 ); -#else - for (; var2 > 0; var2--) - { - if (L_var1 > (Word32) 0X3fffffffL) - { - SET_OVERFLOW(1); - return MAX_32; - } - else - { - if (L_var1 < (Word32) 0xc0000000L) - { - SET_OVERFLOW(1); - return MIN_32; - } - } - L_var1 <<= 1; - } - return (L_var1); -#endif -} - -PJ_INLINE(Word32) L_shr (Word32 L_var1, Word16 var2) -{ - if (var2 < 0) - { - if (var2 < -32) - var2 = -32; - return L_shl_nocheck (L_var1, (Word16) -var2); - } - else - { - return L_shr_nocheck(L_var1, var2); - } -} -/* ------------------------- End of L_shr() ------------------------- */ - -/*___________________________________________________________________________ - | | - | Function Name : L_shl | - | | - | Purpose : | - | | - | Arithmetically shift the 32 bit input L_var1 left var2 positions. Zero | - | fill the var2 LSB of the result. If var2 is negative, arithmetically | - | shift L_var1 right by -var2 with sign extension. Saturate the result in | - | case of underflows or overflows. | - | | - | Complexity weight : 2 | - | | - | Inputs : | - | | - | L_var1 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var3 <= 0x7fff ffff. | - | | - | var2 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | L_var_out | - | 32 bit long signed integer (Word32) whose value falls in the | - | range : 0x8000 0000 <= L_var_out <= 0x7fff ffff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word32) L_shl (Word32 L_var1, Word16 var2) -{ - if (var2 <= 0) - { - if (var2 < -32) - var2 = -32; - return L_shr_nocheck(L_var1, (Word16) -var2); - } - else - { - return L_shl_nocheck(L_var1, var2); - } -} -/* ------------------------- End of L_shl() ------------------------- */ - - -/*___________________________________________________________________________ - | | - | Function Name : abs_s | - | | - | Purpose : | - | | - | Absolute value of var1; abs_s(-32768) = 32767. | - | | - | Complexity weight : 1 | - | | - | Inputs : | - | | - | var1 | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0xffff 8000 <= var1 <= 0x0000 7fff. | - | | - | Outputs : | - | | - | none | - | | - | Return Value : | - | | - | var_out | - | 16 bit short signed integer (Word16) whose value falls in the | - | range : 0x0000 0000 <= var_out <= 0x0000 7fff. | - |___________________________________________________________________________| -*/ -PJ_INLINE(Word16) abs_s (Word16 var1) -{ -#if 1 - if (var1 >= 0) - return var1; - else if (var1 == MIN_16) - return MAX_16; - else - return (Word16)-var1; -#else - if (var1 == MIN_16) - { - return MAX_16; - } - else - { - if (var1 < 0) - { - return (Word16)-var1; - } - else - { - return var1; - } - } -#endif -} -/* ------------------------- End of abs_s() ------------------------- */ - - -PJ_INLINE(Word16) shl_nocheck(Word16 var1, Word16 var2) -{ -#if 1 - /* blp: this should be more optimized */ - return saturate (((Word32)var1) << var2); -#else - /* Original algorithm */ - Word32 result = (Word32) var1 *((Word32) 1 << var2); - - if ((var2 > 15 && var1 != 0) || (result != (Word32) ((Word16) result))) - { - SET_OVERFLOW(1); - return (Word16) ((var1 > 0) ? MAX_16 : MIN_16); - } - else - { - return extract_l (result); - } -#endif -} - -PJ_INLINE(Word16) shr_nocheck(Word16 var1, Word16 var2) -{ -#if 1 - /* blp: this should yield the same value */ - return (Word16) (var1 >> var2); -#else - /* Original algorithm */ - if (var2 >= 15) - { - return (Word16)((var1 < 0) ? -1 : 0); - } - else - { - if (var1 < 0) - { - return (Word16) (~((~var1) >> var2)); - } - else - { - return (Word16)(var1 >> var2); - } - } -#endif -} diff --git a/third_party/g7221/common/common.c b/third_party/g7221/common/common.c deleted file mode 100644 index d5eed81..0000000 --- a/third_party/g7221/common/common.c +++ /dev/null @@ -1,461 +0,0 @@ -/**************************************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -****************************************************************************************/ - -/**************************************************************************************** - Filename: common.c - - Purpose: Contains the functions used for both G.722.1 Annex C encoder and decoder - - Design Notes: - -****************************************************************************************/ -/**************************************************************************************** - Include files -****************************************************************************************/ -#include "defs.h" -#include "huff_def.h" -#include "huff_tab.h" -#include "tables.h" -#include "count.h" - -/**************************************************************************************** - Function: categorize - - Syntax: void categorize(Word16 number_of_available_bits, - Word16 number_of_regions, - Word16 num_categorization_control_possibilities, - Word16 rms_index, - Word16 power_categories, - Word16 category_balances) - - inputs: number_of_regions - num_categorization_control_possibilities - number_of_available_bits - rms_index[MAX_NUMBER_OF_REGIONS] - - outputs: power_categories[MAX_NUMBER_OF_REGIONS] - category_balances[MAX_NUM_CATEGORIZATION_CONTROL_POSSIBILITIES-1] - - Description: Computes a series of categorizations - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.14 | 0.14 - -------|--------------|---------------- - MAX | 0.15 | 0.15 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 0.42 | 0.45 | 0.48 - -------|--------------|----------------|---------------- - MAX | 0.47 | 0.52 | 0.52 - -------|--------------|----------------|---------------- - -****************************************************************************************/ -void categorize(Word16 number_of_available_bits, - Word16 number_of_regions, - Word16 num_categorization_control_possibilities, - Word16 *rms_index, - Word16 *power_categories, - Word16 *category_balances) -{ - - Word16 offset; - Word16 temp; - Word16 frame_size; - - /* At higher bit rates, there is an increase for most categories in average bit - consumption per region. We compensate for this by pretending we have fewer - available bits. */ - test(); - if (number_of_regions == NUMBER_OF_REGIONS) - { - frame_size = DCT_LENGTH; - } - else - { - frame_size = MAX_DCT_LENGTH; - } - - temp = sub(number_of_available_bits,frame_size); - - test(); - if (temp > 0) - { - number_of_available_bits = sub(number_of_available_bits,frame_size); - number_of_available_bits = extract_l(L_mult0(number_of_available_bits,5)); - number_of_available_bits = shr_nocheck(number_of_available_bits,3); - number_of_available_bits = add(number_of_available_bits,frame_size); - } - - /* calculate the offset using the original category assignments */ - offset = calc_offset(rms_index,number_of_regions,number_of_available_bits); - - - - /* compute the power categories based on the uniform offset */ - compute_raw_pow_categories(power_categories,rms_index,number_of_regions,offset); - - - /* adjust the category assignments */ - /* compute the new power categories and category balances */ - comp_powercat_and_catbalance(power_categories,category_balances,rms_index,number_of_available_bits,number_of_regions,num_categorization_control_possibilities,offset); - -} - -/*************************************************************************** - Function: comp_powercat_and_catbalance - - Syntax: void comp_powercat_and_catbalance(Word16 *power_categories, - Word16 *category_balances, - Word16 *rms_index, - Word16 number_of_available_bits, - Word16 number_of_regions, - Word16 num_categorization_control_possibilities, - Word16 offset) - - - inputs: *rms_index - number_of_available_bits - number_of_regions - num_categorization_control_possibilities - offset - - outputs: *power_categories - *category_balances - - - Description: Computes the power_categories and the category balances - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.10 | 0.10 - -------|--------------|---------------- - MAX | 0.11 | 0.11 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 0.32 | 0.35 | 0.38 - -------|--------------|----------------|---------------- - MAX | 0.38 | 0.42 | 0.43 - -------|--------------|----------------|---------------- - -***************************************************************************/ -void comp_powercat_and_catbalance(Word16 *power_categories, - Word16 *category_balances, - Word16 *rms_index, - Word16 number_of_available_bits, - Word16 number_of_regions, - Word16 num_categorization_control_possibilities, - Word16 offset) -{ - - Word16 expected_number_of_code_bits; - Word16 region; - Word16 max_region; - Word16 j; - Word16 max_rate_categories[MAX_NUMBER_OF_REGIONS]; - Word16 min_rate_categories[MAX_NUMBER_OF_REGIONS]; - Word16 temp_category_balances[2*MAX_NUM_CATEGORIZATION_CONTROL_POSSIBILITIES]; - Word16 raw_max, raw_min; - Word16 raw_max_index=0, raw_min_index=0; - Word16 max_rate_pointer, min_rate_pointer; - Word16 max, min; - Word16 itemp0; - Word16 itemp1; - Word16 min_plus_max; - Word16 two_x_number_of_available_bits; - - Word16 temp; - - expected_number_of_code_bits = 0; - move16(); - - for (region=0; region 0) - { - itemp0 = shl_nocheck(max_rate_categories[region],1); - itemp1 = sub(offset,rms_index[region]); - itemp0 = sub(itemp1,itemp0); - - temp = sub(itemp0,raw_min); - test(); - if (temp < 0) - { - raw_min = itemp0; - raw_min_index = region; - } - } - } - max_rate_pointer = sub(max_rate_pointer,1); - temp_category_balances[max_rate_pointer] = raw_min_index; - move16(); - - max = sub(max,expected_bits_table[max_rate_categories[raw_min_index]]); - max_rate_categories[raw_min_index] = sub(max_rate_categories[raw_min_index],1); - move16(); - - max = add(max,expected_bits_table[max_rate_categories[raw_min_index]]); - } - else - { - raw_max = -99; - move16(); - /* Search from highest freq regions to lowest for best region to reassign to - a lower bit rate category. */ - max_region = sub(number_of_regions,1); - for (region= max_region; region >= 0; region--) - { - temp = sub(min_rate_categories[region],(NUM_CATEGORIES-1)); - test(); - if (temp < 0) - { - itemp0 = shl_nocheck(min_rate_categories[region],1); - itemp1 = sub(offset,rms_index[region]); - itemp0 = sub(itemp1,itemp0); - - temp = sub(itemp0,raw_max); - test(); - if (temp > 0) - { - raw_max = itemp0; - move16(); - raw_max_index = region; - move16(); - } - } - } - temp_category_balances[min_rate_pointer] = raw_max_index; - move16(); - - min_rate_pointer = add(min_rate_pointer,1); - min = sub(min,expected_bits_table[min_rate_categories[raw_max_index]]); - - min_rate_categories[raw_max_index] = add(min_rate_categories[raw_max_index],1); - move16(); - - min = add(min,expected_bits_table[min_rate_categories[raw_max_index]]); - } - } - - for (region=0; region 0) - { - j = sub(NUM_CATEGORIES,1); - move16(); - } - power_cats[region] = j; - move16(); - } - bits = 0; - move16(); - - /* compute the number of bits that will be used given the cat assignments */ - for (region=0; region available_bits - 32) then divide the offset region for the bin search */ - offset = sub(available_bits,32); - temp = sub(bits,offset); - test(); - if (temp >= 0) - { - answer = test_offset; - move16(); - } - delta = shr_nocheck(delta,1); - test(); /* for the while loop */ - } while (delta > 0); - - return(answer); -} -/*************************************************************************** - Function: compute_raw_pow_categories - - Syntax: void compute_raw_pow_categories(Word16 *power_categories, - Word16 *rms_index, - Word16 number_of_regions, - Word16 offset) - inputs: *rms_index - number_of_regions - offset - - outputs: *power_categories - - - - Description: This function computes the power categories given the offset - This is kind of redundant since they were already computed - in calc_offset to determine the offset. - - WMOPS: | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.01 | 0.01 - -------|--------------|---------------- - MAX | 0.01 | 0.01 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 0.01 | 0.01 | 0.01 - -------|--------------|----------------|---------------- - MAX | 0.01 | 0.01 | 0.01 - -------|--------------|----------------|---------------- - -***************************************************************************/ -void compute_raw_pow_categories(Word16 *power_categories,Word16 *rms_index,Word16 number_of_regions,Word16 offset) -{ - Word16 region; - Word16 j; - Word16 temp; - - for (region=0; region 0) - j = sub(NUM_CATEGORIES,1); - - power_categories[region] = j; - move16(); - } -} - diff --git a/third_party/g7221/common/config.h b/third_party/g7221/common/config.h deleted file mode 100644 index 4faec78..0000000 --- a/third_party/g7221/common/config.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef __LIBG7221_CONFIG_H__ -#define __LIBG7221_CONFIG_H__ - -#include - -/** - * Expand all basic operation functions as inline. Even if this is set to - * zero, some critical functions would still be expanded as inline. Note - * also that enabling this may generate some warning messages about functions - * not being referenced (with gcc). - * - * Default: 0 (no) - */ -#ifndef PJMEDIA_LIBG7221_FUNCS_INLINED -# define PJMEDIA_LIBG7221_FUNCS_INLINED 0 -#endif - -/* Declare/define a function that may be expanded as inline. */ -#if PJMEDIA_LIBG7221_FUNCS_INLINED -# define LIBG7221_DECL(type) PJ_INLINE(type) -# define LIBG7221_DEF(type) PJ_INLINE(type) -#else -# define LIBG7221_DECL(type) PJ_DECL(type) -# define LIBG7221_DEF(type) PJ_DEF(type) -#endif - -#endif /* __LIBG7221_CONFIG_H__ */ diff --git a/third_party/g7221/common/count.h b/third_party/g7221/common/count.h deleted file mode 100644 index 0ead727..0000000 --- a/third_party/g7221/common/count.h +++ /dev/null @@ -1,28 +0,0 @@ -/* $Id: count.h 2623 2009-04-20 18:38:15Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef COUNT_H -#define COUNT_H - -#define move16() -#define move32() -#define logic16() -#define logic32() -#define test() - -#endif diff --git a/third_party/g7221/common/defs.h b/third_party/g7221/common/defs.h deleted file mode 100644 index d4c7aa2..0000000 --- a/third_party/g7221/common/defs.h +++ /dev/null @@ -1,205 +0,0 @@ -/*********************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -***********************************************************************/ - -#include -#include -#include -#include "g7221/common/typedef.h" -#include "g7221/common/basic_op.h" - -#define PI 3.141592653589793238462 - -#define MAX_DCT_LENGTH 640 -#define DCT_LENGTH 320 -#define DCT_LENGTH_DIV_2 160 -#define DCT_LENGTH_DIV_4 80 -#define DCT_LENGTH_DIV_8 40 -#define DCT_LENGTH_DIV_16 20 -#define DCT_LENGTH_DIV_32 10 -#define DCT_LENGTH_DIV_64 5 - - -#define MAX(a,b) (a > b ? a : b) -#define MIN(a,b) (a < b ? a : b) - -#define NUM_CATEGORIES 8 -#define NUM_CATEGORIZATION_CONTROL_BITS 4 -#define NUM_CATEGORIZATION_CONTROL_POSSIBILITIES 16 -#define CORE_SIZE 10 -#define DCT_LENGTH_LOG 6 -#define MAX_DCT_LENGTH_LOG 7 - -/* region_size = (BLOCK_SIZE * 0.875)/NUM_REGIONS; */ -#define NUMBER_OF_REGIONS 14 -#define MAX_NUMBER_OF_REGIONS 28 -#define REGION_SIZE 20 -#define NUMBER_OF_VALID_COEFS (NUMBER_OF_REGIONS * REGION_SIZE) -#define MAX_NUMBER_OF_VALID_COEFS (MAX_NUMBER_OF_REGIONS * REGION_SIZE) - -#define REGION_POWER_TABLE_SIZE 64 -#define REGION_POWER_TABLE_NUM_NEGATIVES 24 - -#define MAX_NUM_CATEGORIZATION_CONTROL_BITS 5 -#define MAX_NUM_CATEGORIZATION_CONTROL_POSSIBILITIES 32 - -#define ENCODER_SCALE_FACTOR 18318.0 - -/* The MLT output is incorrectly scaled by the factor - product of ENCODER_SCALE_FACTOR and sqrt(160.) - This is now (9/30/96) 1.0/2^(4.5) or 1/22.627. - In the current implementation this - must be an integer power of sqrt(2). The - integer power is ESF_ADJUSTMENT_TO_RMS_INDEX. - The -2 is to conform with the range defined in the spec. */ - - -#define ESF_ADJUSTMENT_TO_RMS_INDEX (9-2) - - -#define INTERMEDIATE_FILES_FLAG 0 - -/* Max bit rate is 48000 bits/sec. */ -#define MAX_BITS_PER_FRAME 960 - - -/***************************************************************************/ -/* Type definitions */ -/***************************************************************************/ -typedef struct -{ - Word16 code_bit_count; /* bit count of the current word */ - Word16 current_word; /* current word in the bitstream being processed */ - Word16 *code_word_ptr; /* pointer to the bitstream */ - Word16 number_of_bits_left; /* number of bits left in the current word */ - Word16 next_bit; /* next bit in the current word */ -}Bit_Obj; - -typedef struct -{ - Word16 seed0; - Word16 seed1; - Word16 seed2; - Word16 seed3; -}Rand_Obj; - -/***************************************************************************/ -/* Function definitions */ -/***************************************************************************/ -extern Word16 compute_region_powers(Word16 *mlt_coefs, - Word16 mag_shift, - Word16 *drp_num_bits, - UWord16 *drp_code_bits, - Word16 *absolute_region_power_index, - Word16 number_of_regions); - -void vector_quantize_mlts(Word16 number_of_available_bits, - Word16 number_of_regions, - Word16 num_categorization_control_possibilities, - Word16 *mlt_coefs, - Word16 *absolute_region_power_index, - Word16 *power_categories, - Word16 *category_balances, - Word16 *p_categorization_control, - Word16 *region_mlt_bit_counts, - UWord32 *region_mlt_bits); - -Word16 vector_huffman(Word16 category, - Word16 power_index, - Word16 *raw_mlt_ptr, - UWord32 *word_ptr); - - -void adjust_abs_region_power_index(Word16 *absolute_region_power_index,Word16 *mlt_coefs,Word16 number_of_regions); - -void bits_to_words(UWord32 *region_mlt_bits,Word16 *region_mlt_bit_counts, - Word16 *drp_num_bits,UWord16 *drp_code_bits,Word16 *out_words, - Word16 categorization_control, Word16 number_of_regions, - Word16 num_categorization_control_bits, Word16 number_of_bits_per_frame); - -void encoder(Word16 number_of_available_bits, - Word16 number_of_regions, - Word16 *mlt_coefs, - Word16 mag_shift, - Word16 *out_words); - -void decoder(Bit_Obj *bitobj, - Rand_Obj *randobj, - Word16 number_of_regions, - Word16 *decoder_mlt_coefs, - Word16 *p_mag_shift, - Word16 *p_old_mag_shift, - Word16 *old_decoder_mlt_coefs, - Word16 frame_error_flag); - -Word16 samples_to_rmlt_coefs(const Word16 *new_samples,Word16 *history,Word16 *coefs,Word16 dct_length); -void rmlt_coefs_to_samples(Word16 *coefs, - Word16 *old_samples, - Word16 *out_samples, - Word16 dct_length, - Word16 mag_shift); - -Word16 index_to_array(Word16 index,Word16 *array,Word16 category); -void categorize(Word16 number_of_available_bits, - Word16 number_of_regions, - Word16 num_categorization_control_possibilities, - Word16 *rms_index, - Word16 *power_categories, - Word16 *category_balances); - -Word16 calc_offset(Word16 *rms_index,Word16 number_of_regions,Word16 available_bits); -void compute_raw_pow_categories(Word16 *power_categories,Word16 *rms_index,Word16 number_of_regions,Word16 offset); -void comp_powercat_and_catbalance(Word16 *power_categories, - Word16 *category_balances, - Word16 *rms_index, - Word16 number_of_available_bits, - Word16 number_of_regions, - Word16 num_categorization_control_possibilities, - Word16 offset); - -void dct_type_iv_a (Word16 *input,Word16 *output,Word16 dct_length); -void dct_type_iv_s(Word16 *input,Word16 *output,Word16 dct_length); -void decode_envelope(Bit_Obj *bitobj, - Word16 number_of_regions, - Word16 *decoder_region_standard_deviation, - Word16 *absolute_region_power_index, - Word16 *p_mag_shift); - -void decode_vector_quantized_mlt_indices(Bit_Obj *bitobj, - Rand_Obj *randobj, - Word16 number_of_regions, - Word16 *decoder_region_standard_deviation, - Word16 *dedecoder_power_categories, - Word16 *dedecoder_mlt_coefs); - -void rate_adjust_categories(Word16 categorization_control, - Word16 *decoder_power_categories, - Word16 *decoder_category_balances); - -void get_next_bit(Bit_Obj *bitobj); -Word16 get_rand(Rand_Obj *randobj); - -void test_4_frame_errors(Bit_Obj *bitobj, - Word16 number_of_regions, - Word16 num_categorization_control_possibilities, - Word16 *frame_error_flag, - Word16 categorization_control, - Word16 *absolute_region_power_index); - -void error_handling(Word16 number_of_coefs, - Word16 number_of_valid_coefs, - Word16 *frame_error_flag, - Word16 *decoder_mlt_coefs, - Word16 *old_decoder_mlt_coefs, - Word16 *p_mag_shift, - Word16 *p_old_mag_shift); - - diff --git a/third_party/g7221/common/huff_def.h b/third_party/g7221/common/huff_def.h deleted file mode 100644 index dd10d9a..0000000 --- a/third_party/g7221/common/huff_def.h +++ /dev/null @@ -1,53 +0,0 @@ -/*********************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -***********************************************************************/ - -#define REGION_POWER_STEPSIZE_DB 3.010299957 -#define ABS_REGION_POWER_LEVELS 32 -#define DIFF_REGION_POWER_LEVELS 24 - -#define DRP_DIFF_MIN -12 -#define DRP_DIFF_MAX 11 - -#define MAX_NUM_BINS 16 -#define MAX_VECTOR_INDICES 625 -#define MAX_VECTOR_DIMENSION 5 - -extern Word16 differential_region_power_bits[MAX_NUMBER_OF_REGIONS][DIFF_REGION_POWER_LEVELS]; -extern UWord16 differential_region_power_codes[MAX_NUMBER_OF_REGIONS][DIFF_REGION_POWER_LEVELS]; -extern Word16 differential_region_power_decoder_tree[MAX_NUMBER_OF_REGIONS][DIFF_REGION_POWER_LEVELS-1][2]; -extern Word16 mlt_quant_centroid[NUM_CATEGORIES][MAX_NUM_BINS]; -extern Word16 expected_bits_table[NUM_CATEGORIES]; -extern Word16 mlt_sqvh_bitcount_category_0[196]; -extern UWord16 mlt_sqvh_code_category_0[196]; -extern Word16 mlt_sqvh_bitcount_category_1[100]; -extern UWord16 mlt_sqvh_code_category_1[100]; -extern Word16 mlt_sqvh_bitcount_category_2[49]; -extern UWord16 mlt_sqvh_code_category_2[49]; -extern Word16 mlt_sqvh_bitcount_category_3[625]; -extern UWord16 mlt_sqvh_code_category_3[625]; -extern Word16 mlt_sqvh_bitcount_category_4[256]; -extern UWord16 mlt_sqvh_code_category_4[256]; -extern Word16 mlt_sqvh_bitcount_category_5[243]; -extern UWord16 mlt_sqvh_code_category_5[243]; -extern Word16 mlt_sqvh_bitcount_category_6[32]; -extern UWord16 mlt_sqvh_code_category_6[32]; -extern Word16 *table_of_bitcount_tables[NUM_CATEGORIES-1]; -extern UWord16 *table_of_code_tables[NUM_CATEGORIES-1]; -extern Word16 mlt_decoder_tree_category_0[180][2]; -extern Word16 mlt_decoder_tree_category_1[93][2]; -extern Word16 mlt_decoder_tree_category_2[47][2]; -extern Word16 mlt_decoder_tree_category_3[519][2]; -extern Word16 mlt_decoder_tree_category_4[208][2]; -extern Word16 mlt_decoder_tree_category_5[191][2]; -extern Word16 mlt_decoder_tree_category_6[31][2]; -extern Word16 *table_of_decoder_tables[NUM_CATEGORIES-1]; - diff --git a/third_party/g7221/common/huff_tab.c b/third_party/g7221/common/huff_tab.c deleted file mode 100644 index 12ff661..0000000 --- a/third_party/g7221/common/huff_tab.c +++ /dev/null @@ -1,528 +0,0 @@ -/*********************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -***********************************************************************/ -#include "defs.h" -#include "huff_def.h" - -Word16 differential_region_power_bits[MAX_NUMBER_OF_REGIONS][DIFF_REGION_POWER_LEVELS] = { -{99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99}, -{ 4, 6, 5, 5, 4, 4, 4, 4, 4, 4, 3, 3, 3, 4, 5, 7, 8, 9,11,11,12,12,12,12}, -{10, 8, 6, 5, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5, 7, 9,11,12,13,15,15,15,16,16}, -{12,10, 8, 6, 5, 4, 4, 4, 4, 4, 4, 3, 3, 3, 4, 4, 5, 5, 7, 9,11,13,14,14}, -{13,10, 9, 9, 7, 7, 5, 5, 4, 3, 3, 3, 3, 3, 4, 4, 4, 5, 7, 9,11,13,13,13}, -{12,13,10, 8, 6, 6, 5, 5, 4, 4, 3, 3, 3, 3, 3, 4, 5, 5, 6, 7, 9,11,14,14}, -{12,11, 9, 8, 8, 7, 5, 4, 4, 3, 3, 3, 3, 3, 4, 4, 5, 5, 7, 8,10,13,14,14}, -{15,16,15,12,10, 8, 6, 5, 4, 3, 3, 3, 2, 3, 4, 5, 5, 7, 9,11,13,16,16,16}, -{14,14,11,10, 9, 7, 7, 5, 5, 4, 3, 3, 2, 3, 3, 4, 5, 7, 9, 9,12,14,15,15}, -{ 9, 9, 9, 8, 7, 6, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5, 6, 7, 8,10,11,12,13,13}, -{14,12,10, 8, 6, 6, 5, 4, 3, 3, 3, 3, 3, 3, 4, 5, 6, 8, 8, 9,11,14,14,14}, -{13,10, 9, 8, 6, 6, 5, 4, 4, 4, 3, 3, 2, 3, 4, 5, 6, 8, 9, 9,11,12,14,14}, -{16,13,12,11, 9, 6, 5, 5, 4, 4, 4, 3, 2, 3, 3, 4, 5, 7, 8,10,14,16,16,16}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}, -{13,14,14,14,10, 8, 7, 7, 5, 4, 3, 3, 2, 3, 3, 4, 5, 5, 7, 9,11,14,14,14}}; - -UWord16 differential_region_power_codes[MAX_NUMBER_OF_REGIONS][DIFF_REGION_POWER_LEVELS] = { -{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 8,38,18,10, 7, 6, 3, 2, 0, 1, 7, 6, 5, 4,11,78,158,318,1278,1279,2552,2553,2554,2555}, -{36, 8, 3, 5, 0, 1, 7, 6, 4, 3, 2, 5, 3, 4, 5,19,74,150,302,1213,1214,1215,2424,2425}, -{2582,644,160,41, 5,11, 7, 5, 4, 1, 0, 6, 4, 7, 3, 6, 4,21,81,323,1290,5167,10332,10333}, -{2940,366,181,180,47,46,27,10, 8, 5, 1, 0, 3, 7, 4, 9,12,26,44,182,734,2941,2942,2943}, -{3982,7967,994,249,63,26,19,18,14, 8, 6, 1, 0, 2, 5, 7,12,30,27,125,496,1990,15932,15933}, -{3254,1626,407,206,202,100,30,14, 3, 5, 3, 0, 2, 4, 2,13,24,31,102,207,812,6511,13020,13021}, -{1110,2216,1111,139,35, 9, 3,20,11, 4, 2, 1, 3, 3, 1, 0,21, 5,16,68,276,2217,2218,2219}, -{1013,1014,127,62,29, 6, 4,16, 0, 1, 3, 2, 3, 1, 5, 9,17, 5,28,30,252,1015,2024,2025}, -{381,380,372,191,94,44,16,10, 7, 3, 1, 0, 2, 6, 9,17,45,92,187,746,1494,2991,5980,5981}, -{3036,758,188,45,43,10, 4, 3, 6, 4, 2, 0, 3, 7,11,20,42,44,46,95,378,3037,3038,3039}, -{751,92,45,20,26, 4,12, 7, 4, 0, 4, 1, 3, 5, 5, 3,27,21,44,47,186,374,1500,1501}, -{45572U,5697,2849,1425,357,45,23, 6,10, 7, 2, 2, 3, 0, 4, 6, 7,88,179,713,11392,45573U,45574U,45575U}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}, -{2511,5016,5018,5017,312,79,38,36,30,14, 6, 0, 2, 1, 3, 5, 8,31,37,157,626,5019,5020,5021}}; - -Word16 differential_region_power_decoder_tree[MAX_NUMBER_OF_REGIONS][DIFF_REGION_POWER_LEVELS-1][2] = { -{{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0},{ 0, 0}}, -{{ 1, 2},{ 3, 4},{ 5, 6},{ 7, 8},{ 9, 10},{ 11,-12},{-11,-10},{ -8, -9},{ -7, -6},{-13, 12},{ -5, -4},{ 0, 13},{ -3,-14},{ -2, 14},{ -1, 15},{-15, 16},{-16, 17},{-17, 18},{ 19, 20},{ 21, 22},{-18,-19},{-20,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{ 5, 6},{ 7, 8},{-10, -9},{ -8,-11},{ -7, -6},{ 9, -5},{ 10,-12},{ -4, 11},{-13, -3},{ 12, -2},{ 13,-14},{ -1, 14},{ 15,-15},{ 0, 16},{-16, 17},{-17, 18},{-18, 19},{ 20, 21},{ 22,-19},{-20,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{ 5, 6},{ 7, 8},{ 9, 10},{-12, 11},{-11,-13},{-10, -9},{ 12,-14},{ -8, -7},{-15, -6},{ 13, -5},{-16, -4},{ 14,-17},{ 15, -3},{ 16,-18},{ -2, 17},{ 18,-19},{ -1, 19},{-20, 20},{ 0, 21},{ 22,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{ 5, 6},{-11,-10},{ 7,-12},{ 8, -9},{ 9,-13},{-14, 10},{ -8,-15},{-16, 11},{ -7, 12},{-17, -6},{ 13, 14},{-18, 15},{ -5, -4},{ 16, 17},{ -3, -2},{-19, 18},{ -1, 19},{-20, 20},{ 21, 22},{ 0,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{ 5, 6},{-12,-11},{-13, 7},{ 8,-14},{-10, 9},{ 10,-15},{ -9, 11},{ -8, 12},{-16, 13},{ -7, -6},{-17, 14},{ -5,-18},{ 15, -4},{ 16,-19},{ 17, -3},{-20, 18},{ -2, 19},{-21, 20},{ 0, 21},{ 22, -1},{-22,-23}}, -{{ 1, 2},{ 3, 4},{ 5, 6},{-11, 7},{-12,-10},{-13, -9},{ 8, 9},{-14, -8},{ 10,-15},{ -7, 11},{-16, 12},{ -6,-17},{ 13, 14},{ -5, 15},{-18, 16},{ -4, 17},{ -3,-19},{ 18, -2},{-20, 19},{ -1, 20},{ 0, 21},{ 22,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{ 5,-12},{ 6,-11},{-10,-13},{ -9, 7},{ 8,-14},{ 9, -8},{-15, 10},{ -7,-16},{ 11, -6},{ 12,-17},{ 13, -5},{-18, 14},{ 15, -4},{-19, 16},{ 17, -3},{-20, 18},{ 19, 20},{ 21, 22},{ 0, -2},{ -1,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{ 5,-12},{ 6,-13},{-11,-10},{ 7,-14},{ 8, -9},{ 9,-15},{ -8, 10},{ -7,-16},{ 11, 12},{ -6,-17},{ -5, 13},{ 14, 15},{-18, -4},{-19, 16},{ -3, 17},{ 18, -2},{-20, 19},{ 20, 21},{ 22, 0},{ -1,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{ 5, 6},{-11,-10},{-12, -9},{ 7, 8},{-13, -8},{ 9,-14},{ -7, 10},{ -6,-15},{ 11, 12},{ -5,-16},{ 13, 14},{-17, 15},{ -4, 16},{ 17,-18},{ 18, -3},{ -2, 19},{ -1, 0},{-19, 20},{-20, 21},{ 22,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{ 5, 6},{-11, 7},{-10,-12},{ -9, 8},{ -8,-13},{ 9, -7},{ 10,-14},{ -6, 11},{-15, 12},{ -5, 13},{-16, -4},{ 14, 15},{-17, -3},{-18, 16},{ 17,-19},{ -2, 18},{-20, 19},{ -1, 20},{ 21, 22},{ 0,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{ 5,-12},{ 6,-11},{ 7, 8},{-10,-13},{ -9, 9},{ -8,-14},{ 10, -7},{ 11,-15},{ -6, 12},{ -5, 13},{ -4,-16},{ 14, 15},{ -3,-17},{ 16, 17},{-18, -2},{ 18,-19},{ -1, 19},{-20, 20},{-21, 21},{ 22, 0},{-22,-23}}, -{{ 1, 2},{ 3, 4},{ 5,-12},{-13, 6},{-11, 7},{-14, 8},{-10, 9},{-15, -9},{ -8, 10},{ -7,-16},{ 11, -6},{ 12, -5},{-17, 13},{ 14,-18},{ 15, -4},{ 16,-19},{ 17, -3},{ 18, -2},{ 19, -1},{-20, 20},{ 21, 22},{ 0,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}, -{{ 1, 2},{ 3, 4},{-12, 5},{-11,-13},{ 6,-14},{-10, 7},{ 8,-15},{ -9, 9},{-16, 10},{ -8,-17},{ 11, 12},{ -7,-18},{ -6, 13},{ 14, -5},{ 15,-19},{ -4, 16},{-20, 17},{ 18, 19},{ 20, 21},{ 22, 0},{ -1, -3},{ -2,-21},{-22,-23}}}; - -Word16 mlt_quant_centroid[NUM_CATEGORIES][MAX_NUM_BINS] = { -{ 0, 1606, 3119, 4586, 6049, 7502, 8941,10406,11851,13292,14736,16146,17566,19351, 0, 0}, -{ 0, 2229, 4341, 6401, 8471,10531,12583,14588,16673,18924, 0, 0, 0, 0, 0, 0}, -{ 0, 3055, 5998, 8929,11806,14680,17680, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 4121, 8192,12259,16322, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 5413,11071,16315, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 6785,14300, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 8044, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, -{ 0, 8019, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}}; - -Word16 expected_bits_table[NUM_CATEGORIES] = {52, 47, 43, 37, 29, 22, 16, 0}; - - -Word16 mlt_sqvh_bitcount_category_0[196] = { - 1, 4, 6, 6, 7, 7, 8, 8, 8, 9, 9,10,11,11, 4, 5, - 6, 7, 7, 8, 8, 9, 9, 9, 9,10,11,11, 5, 6, 7, 8, - 8, 9, 9, 9, 9,10,10,10,11,12, 6, 7, 8, 9, 9, 9, - 9,10,10,10,10,11,12,13, 7, 7, 8, 9, 9, 9,10,10, -10,10,11,11,12,13, 8, 8, 9, 9, 9,10,10,10,10,11, -11,12,13,14, 8, 8, 9, 9,10,10,11,11,11,12,12,13, -13,15, 8, 8, 9, 9,10,10,11,11,11,12,12,13,14,15, - 9, 9, 9,10,10,10,11,11,12,13,12,14,15,16, 9, 9, -10,10,10,10,11,12,12,14,14,16,16,16, 9, 9,10,10, -11,11,12,13,13,14,14,15,15,16,10,10,10,11,11,12, -12,13,15,15,16,14,15,15,11,11,11,12,13,13,13,15, -16,16,16,16,14,15,11,11,12,13,13,14,15,16,16,16, -16,16,16,14}; -UWord16 mlt_sqvh_code_category_0[196] = { - 1, 2, 1, 24, 14, 51, 9, 68, 110, 26, 218, 54, 154, 761, 3, 10, - 22, 8, 58, 22, 71, 16, 30, 50, 213, 75, 94, 632, 15, 18, 52, 23, - 107, 5, 54, 63, 239, 46, 276, 271, 851, 252, 28, 10, 12, 1, 22, 133, - 191, 55, 105, 278, 317, 554, 310, 276, 32, 50, 94, 20, 187, 219, 13, 268, - 473, 445, 145, 849, 1277, 623, 1, 14, 0, 55, 238, 121, 120, 269, 318, 530, - 639, 1117, 509, 556, 24, 78, 51, 153, 62, 308, 16, 25, 68, 1058, 428, 277, - 2233, 1114, 92, 108, 141, 223, 270, 381, 24, 212, 760, 35, 1063, 279, 1717, 3439, - 7, 21, 152, 73, 309, 310, 95, 944, 1890, 2232, 1891, 5107,10213, 4981, 61, 62, - 9, 79, 474, 475, 848, 1059, 1056, 1716, 139, 4978, 4983, 4983, 140, 186, 76, 444, - 144, 633, 1057, 838, 2237, 4472, 4473,10212,10212, 4983, 74, 78, 311, 213, 850, 1062, - 1119, 508, 276, 277, 4982, 4473,10212,10212, 208, 70, 555, 418, 68, 510, 2552, 1115, - 4980, 4979, 4982, 4982, 4473,10212, 215, 71, 253, 511, 839, 1718, 2488, 6876, 6877, 4979, - 4979, 4982, 4982, 4473}; -Word16 mlt_sqvh_bitcount_category_1[100] = { - 1, 4, 5, 6, 7, 8, 8, 9,10,10, 4, 5, 6, 7, 7, 8, - 8, 9, 9,11, 5, 5, 6, 7, 8, 8, 9, 9,10,11, 6, 6, - 7, 8, 8, 9, 9,10,11,12, 7, 7, 8, 8, 9, 9,10,11, -11,13, 8, 8, 8, 9, 9,10,10,11,12,14, 8, 8, 8, 9, -10,11,11,12,13,15, 9, 9, 9,10,11,12,12,14,14,14, - 9, 9, 9,10,11,12,14,16,14,14,10,10,11,12,13,14, -16,16,16,14}; -UWord16 mlt_sqvh_code_category_1[100] = { - 1, 2, 11, 27, 31, 9, 120, 31, 275, 310, 1, 0, 12, 5, 33, 54, - 102, 111, 246, 448, 10, 14, 31, 39, 59, 100, 114, 202, 485, 969, 24, 26, - 36, 52, 103, 30, 120, 242, 69, 1244, 35, 32, 14, 61, 113, 117, 233, 486, - 487, 2491, 13, 12, 69, 110, 149, 35, 495, 449, 1978, 7751, 76, 75, 122, 136, - 213, 68, 623, 930, 3959, 9961, 115, 16, 107, 225, 424, 850, 1936, 7916, 4981, 4981, - 148, 154, 243, 407, 988, 851, 7750,19920, 7916, 4981, 406, 274, 464, 931, 3874, 7917, -19921,19920,19920, 7916}; -Word16 mlt_sqvh_bitcount_category_2[49] = { - 1, 4, 5, 7, 8, 9,10, 3, 4, 5, 7, 8, 9,10, 5, 5, - 6, 7, 8,10,10, 7, 6, 7, 8, 9,10,12, 8, 8, 8, 9, -10,12,14, 8, 9, 9,10,11,15,16, 9,10,11,12,13,16, -15}; -UWord16 mlt_sqvh_code_category_2[49] = { - 1, 0, 10, 11, 28, 62, 363, 3, 2, 9, 8, 24, 53, 352, 7, 8, - 13, 25, 89, 74, 355, 10, 23, 24, 29, 55, 354, 1449, 25, 19, 30, 52, - 108, 438, 5793, 91, 36, 63, 353, 725,11584,23170, 180, 75, 218, 439, 2897,23171, -11584}; -Word16 mlt_sqvh_bitcount_category_3[625] = { - 2, 4, 6, 8,10, 5, 5, 6, 8,10, 7, 8, 8,10,12, 9, - 9,10,12,15,10,11,13,16,16, 5, 6, 8,10,11, 5, 6, - 8,10,12, 7, 7, 8,10,13, 9, 9,10,12,15,12,11,13, -16,16, 7, 9,10,12,15, 7, 8,10,12,13, 9, 9,11,13, -16,11,11,12,14,16,12,12,14,16,14, 9,11,12,16,16, - 9,10,13,15,16,10,11,12,16,16,13,13,16,16,16,16, -16,15,16,16,11,13,16,16,15,11,13,15,16,16,13,13, -16,16,16,14,16,16,16,16,16,16,16,16,16, 4, 6, 8, -10,13, 6, 6, 8,10,13, 9, 8,10,12,16,10,10,11,15, -16,13,12,14,16,16, 5, 6, 8,11,13, 6, 6, 8,10,13, - 8, 8, 9,11,14,10,10,12,12,16,13,12,13,15,16, 7, - 8, 9,12,16, 7, 8,10,12,14, 9, 9,10,13,16,11,10, -12,15,16,13,13,16,16,15, 9,11,13,16,16, 9,10,12, -15,16,10,11,13,16,16,13,12,16,16,16,16,16,16,16, -16,11,13,16,16,16,11,13,16,16,16,12,13,15,16,16, -16,16,16,16,16,16,16,16,16,16, 6, 8,11,13,16, 8, - 8,10,12,16,11,10,11,13,16,12,13,13,15,16,16,16, -14,16,15, 6, 8,10,13,16, 8, 8,10,12,16,10,10,11, -13,16,13,12,13,16,16,14,14,14,16,16, 8, 9,11,13, -16, 8, 9,11,16,14,10,10,12,15,16,12,12,13,16,16, -15,16,16,16,16,10,12,15,16,16,10,12,12,14,16,12, -12,13,16,16,14,15,16,16,16,16,16,16,16,16,12,15, -15,16,16,13,13,16,16,14,14,16,16,16,16,16,16,16, -16,16,14,15,16,16,16, 8,10,13,15,16,10,11,13,16, -16,13,13,14,16,16,16,16,16,16,16,16,16,16,16,16, - 8,10,11,15,16, 9,10,12,16,16,12,12,15,16,16,16, -14,16,16,16,16,16,16,16,16, 9,11,14,16,16,10,11, -13,16,16,14,13,14,16,16,16,15,15,16,16,16,16,16, -16,16,11,13,16,16,16,11,13,15,16,16,13,16,16,16, -16,16,16,16,16,16,16,16,16,16,16,15,16,16,16,16, -14,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16, 9,13,16,16,16,11,13,16,16,16,14,15, -16,16,16,15,16,16,16,16,16,16,16,16,16, 9,13,15, -15,16,12,13,14,16,16,16,15,16,16,16,16,16,16,16, -16,16,16,16,16,16,11,13,15,16,16,12,14,16,16,16, -16,16,16,16,16,16,16,16,16,16,16,15,15,16,16,16, -16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16, -16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,15, -16,16,13,16,16,16,16,16,16,16,16,16,16,16,16,16, -16}; -UWord16 mlt_sqvh_code_category_3[625] = { - 3, 8, 46, 145, 228, 4, 8, 47, 28, 455, 89, 2, 180, 5, 1335, 250, - 12, 644, 1311, 139, 729, 251, 870, 2172, 2211, 5, 23, 112, 334, 1469, 21, 3, - 5, 111, 2014, 88, 79, 152, 124, 2685, 297, 48, 110, 1310, 149, 501, 1231, 153, - 2267, 2569, 57, 13, 653, 2587, 143, 75, 124, 118, 2611, 5242, 61, 50, 253, 3633, - 2216, 476, 39, 57, 1926, 2236, 2586, 1329, 1920, 2566, 1926, 296, 233, 2590, 2240, 2217, - 253, 613, 867, 144, 318, 614, 252, 2589, 2242, 2218, 872, 866, 2187, 2296, 2155, 2568, - 2227, 150, 2567, 2296, 199, 2686, 2160, 2290,19145, 232, 2680, 128, 2192, 2212, 2684, 793, - 2281, 2223, 2242, 1934, 2165, 2146, 2291, 2296, 2222, 2189, 2187, 2296, 2296, 6, 4, 82, - 725, 3632, 15, 21, 56, 599, 148, 3, 162, 42, 411, 2301, 735, 654, 930, 137, - 2586, 869, 1334, 1931, 2300, 2213, 9, 22, 146, 1290, 5240, 5, 12, 53, 630, 875, - 80, 9, 8, 86, 2002, 210, 117, 56, 2019, 2162, 146, 397, 868, 131, 2151, 77, - 160, 365, 2610, 2252, 59, 54, 41, 2591, 1928, 226, 14, 121, 5792, 2295, 1197, 728, - 408, 130, 2157, 3635, 155, 2573, 2587, 130, 314, 64, 144, 2173, 2176, 115, 30, 409, - 153, 2590, 631, 26, 4787, 2221, 2174, 2683, 1863, 2572, 319, 2150, 2177, 2194, 2571, 2257, - 319, 65, 145, 2251, 2156, 2161, 909, 864, 2193, 2197, 2246, 2588, 5797, 156, 2258, 2221, - 2158, 2199, 2214, 2152, 319, 2188, 2264, 2572, 319, 319, 30, 117, 219, 865, 2263, 147, - 127, 239, 410, 2247, 27, 324, 1468, 2681, 2180, 1328, 5241, 147, 142, 2237, 2241, 2245, - 1921, 2262, 142, 41, 11, 505, 2682, 2591, 0, 26, 229, 2015, 2577, 464, 98, 87, - 5243, 2166, 149, 2016, 5244, 2190, 2198, 9573,11598,11599, 2235, 2190, 144, 298, 1004, 5245, - 2277, 156, 104, 254, 2560, 1922, 612, 325, 2017, 129, 2588, 2608, 1330, 871, 2144, 2145, - 132, 2147, 2148, 2149, 2144, 119, 1331, 133, 2153, 2154, 211, 58, 2609, 1923, 2159, 510, - 163, 5246, 2163, 2164, 1924, 134, 2167, 2168, 2168, 2169, 2170, 2171, 2168, 2168, 1332, 135, - 136, 2175, 2153, 150, 873, 2178, 2179, 1923, 1925, 2181, 2182, 2183, 2163, 2184, 2185, 2186, - 2168, 2168, 1924, 134, 2167, 2168, 2168, 58, 326, 2687, 138, 2191, 31, 66, 874, 2195, - 2196, 151, 152, 1927, 2200, 2201, 2202, 2203, 2204, 2205, 2206, 2207, 2208, 2209, 2210, 2205, - 55, 103, 1230, 140, 2215, 118, 15, 1333, 2219, 2220, 2018, 511, 141, 2224, 2225, 2226, - 1929, 2228, 2229, 2230, 2231, 2232, 2233, 2234, 2229, 366, 1005, 1930, 2238, 2239, 12, 1006, - 5247, 2243, 2244, 1932, 3634, 1933, 2248, 2249, 2250, 145, 146, 2253, 2253, 2254, 2255, 2256, - 2253, 2253, 1291, 5793, 2259, 2260, 2261, 477, 5794, 147, 2265, 2266, 5795, 2268, 2269, 2270, - 2270, 2271, 2272, 2273, 2274, 2274, 2275, 2276, 2273, 2274, 2274, 148, 2278, 2279, 2280, 2260, - 1935, 2282, 2283, 2284, 2265, 2285, 2286, 2287, 2270, 2270, 2288, 2289, 2273, 2274, 2274, 2271, - 2272, 2273, 2274, 2274, 233, 5796, 2292, 2293, 2294, 1292, 3724, 2297, 2298, 2299, 2000, 151, - 2302, 2303, 2200, 152, 2561, 2562, 2563, 2205, 2564, 2565, 2204, 2205, 2205, 363, 154, 154, - 155, 2570, 59, 3725, 2001, 2574, 2575, 2576, 157, 2578, 2579, 2224, 2580, 2581, 2582, 2583, - 2229, 2584, 2585, 2228, 2229, 2229, 654, 5798, 158, 2589, 2238, 2392, 2003, 2592, 2593, 2243, - 2594, 2595, 2596, 2597, 2248, 2598, 2599, 2600, 2253, 2253, 2250, 145, 146, 2253, 2253, 2601, - 2602, 2603, 2604, 2260, 2605, 2606, 2607, 6336, 2265, 6337, 6338, 6339, 2270, 2270, 6340, 6341, - 2273, 2274, 2274, 2271, 2272, 2273, 2274, 2274, 6342, 6343, 2259, 2260, 2260,38288U,38289U, 147, - 2265, 2265, 5795, 2268, 2269, 2270, 2270, 2271, 2272, 2273, 2274, 2274, 2271, 2272, 2273, 2274, - 2274}; -Word16 mlt_sqvh_bitcount_category_4[256] = { - 2, 4, 7,10, 4, 5, 7,10, 7, 8,10,14,11,11,15,15, - 4, 5, 9,12, 5, 5, 8,12, 8, 7,10,15,11,11,15,15, - 7, 9,12,15, 8, 8,12,15,10,10,13,15,14,14,15,13, -11,13,15,15,11,13,15,15,14,15,15,13,15,15,13,13, - 4, 5, 9,13, 5, 6, 9,13, 9, 9,11,15,14,13,15,15, - 4, 6, 9,12, 5, 6, 9,13, 9, 8,11,15,13,12,15,15, - 7, 9,12,15, 7, 8,11,15,10,10,14,15,14,15,15,14, -10,12,15,15,11,13,15,15,15,15,15,14,15,15,14,14, - 6, 9,13,14, 8, 9,12,15,12,12,15,15,15,15,15,15, - 7, 9,13,15, 8, 9,12,15,11,12,15,15,15,15,15,15, - 9,11,15,15, 9,11,15,15,14,14,15,15,15,15,15,15, -14,15,15,15,14,15,15,15,15,15,15,15,14,14,15,15, - 9,12,15,15,12,13,15,15,15,15,15,15,15,15,15,15, -10,12,15,15,12,14,15,15,15,15,15,15,15,15,15,15, -14,15,15,15,15,15,15,15,15,15,15,15,14,14,15,15, -15,15,15,15,15,15,15,15,14,14,15,15,14,14,15,15}; -UWord16 mlt_sqvh_code_category_4[256] = { - 1, 2, 4, 572, 10, 0, 69, 712, 91, 10, 46, 9182, 1426, 1430,30172,30194, - 9, 28, 22, 2258, 16, 25, 142, 2179, 15, 111, 719, 1521, 1131, 1437, 1520,30196, - 88, 283, 3803,30193, 13, 236, 2856,30166, 545, 951, 5709, 1522, 3241, 9180,30179, 5709, - 1088, 4356,30410,30175, 1146, 377,30162,30163, 8715,30176,30165, 5709,30197,30184, 5709, 5709, - 1, 23, 28, 5710, 26, 14, 29, 7538, 102, 103, 1429, 1524, 3237, 7060,30401,30201, - 15, 13, 470, 3768, 24, 15, 281, 5747, 24, 181, 1128,30206, 5711, 3531,30156,30158, - 116, 100, 2260,30187, 119, 234, 1764,30171, 716, 883, 9183,30164, 3236, 1528,30180, 9183, - 885, 2870, 1532,30160, 1431, 5708,30192,30205,30402,30168,30173, 9183,30157,30161, 9183, 9183, - 54, 25, 1621,15211, 180, 287, 2261,30198, 808, 811,30411,30413,30414,22986,22987,30411, - 24, 273, 376,30159, 137, 280, 2871, 1523, 1768, 2259, 1525,30167, 1526,30169,30170, 1525, - 443, 1434, 1527,30174, 474, 1769,30177,30178, 3238, 3239,30181,30181,30182,30183,30181,30181, - 3240,30185,30186, 1527, 9181,30188,30189,30177,30190,30191,30181,30181, 3238, 3239,30181,30181, - 440, 2857, 1529,30195, 2294, 7061, 1530,30199,30200, 1531,30202,30411,30203,30204,30411,30411, - 203, 2872,30207,30400, 189,11492,30403,30404,30405,30406,30407, 1525,30408,30409, 1525, 1525, - 8714, 1533,30412, 1527, 1534, 1535,30415,30177,30416,30417,30181,30181, 3238, 3239,30181,30181, -30418,30419, 1527, 1527,30420,30421,30177,30177, 3238, 3239,30181,30181, 3238, 3239,30181,30181}; -Word16 mlt_sqvh_bitcount_category_5[243] = { - 2, 4, 8, 4, 5, 9, 9,10,14, 4, 6,11, 5, 6,12,10, -11,15, 9,11,15,10,13,15,14,15, 6, 4, 6,12, 6, 7, -12,12,12,15, 5, 7,13, 6, 7,13,12,13,15,10,12,15, -11,13,15,15,15, 7, 8,13,15,11,12,15,15,15, 7,10, -13,15,12,15,15,15,15, 7,15,15, 7,15,15, 7, 6, 7, - 7, 4, 5,11, 5, 7,12,11,12,15, 6, 7,13, 7, 8,14, -12,14,15,11,13,15,12,13,15,15,15, 8, 5, 6,13, 7, - 8,15,12,14,15, 6, 8,14, 7, 8,15,14,15,15,12,12, -15,12,13,15,15,15, 8, 9,13,15,12,13,15,15,15, 8, -11,13,15,13,13,15,15,15, 8,14,15, 8,15,15, 8, 7, - 8, 8, 8,10,15,11,12,15,15,15, 7,10,12,15,12,13, -15,15,15, 8,14,15, 7,15,15, 8, 7, 8, 8, 8,12,15, -12,13,15,15,15, 8,11,13,15,13,15,15,15,15, 8,15, -15, 8,15,15, 8, 7, 8, 8,14,15, 6,15,15, 8, 7, 8, - 8,15,15, 8,15,15, 8, 7, 8, 8, 6, 8, 8, 7, 8, 8, - 7, 8, 8}; -UWord16 mlt_sqvh_code_category_5[243] = { - 0, 5, 220, 10, 16, 443, 390, 391,14333, 11, 26, 1566, 26, 54, 3135, 508, - 1558,28581, 255, 1782,28599, 885, 6208,28578,14335,28579, 54, 9, 35, 3129, 27, 68, - 3537, 1562, 3568,28610, 25, 62, 4078, 58, 118, 7763, 3107, 7758,28563, 778, 3131,28598, - 780, 7123,28630,28593,28586, 118, 243, 6210,28614, 1018, 3567,28601,28611,28570, 68, 388, - 6256,28619, 1559,28562,28606,28565,28591, 118,28594,28571, 62,28618,28590, 118, 58, 118, - 118, 4, 28, 1781, 31, 60, 3134, 1938, 3882,28574, 25, 96, 7757, 49, 126,14244, - 3883,14334,28613, 1769, 4077,28602, 3106, 7756,28582,28621,28566, 126, 14, 61, 4079, 61, - 138,28491, 3536, 8153,28573, 49, 96,12442, 119, 240,28490,12443,28560,28561, 3111, 3580, -28564, 3130, 7759,28567,28568,28569, 240, 444, 6209,28572, 3569, 6211,28575,28576,28577, 138, - 778, 7760,28580, 7761, 7762,28583,28584,28585, 240,14319,28587, 96,28588,28589, 240, 119, - 240, 240, 139, 968,28592, 1554, 3581,28595,28596,28597, 60, 971, 3560,28600, 3582, 7132, -28603,28604,28605, 126,14332,28607, 96,28608,28609, 126, 49, 126, 126, 241, 1558,28612, - 1563, 6257,28615,28616,28617, 138, 1559, 7133,28620, 6220,28622,28623,28624,28625, 240,28626, -28627, 96,28628,28629, 240, 119, 240, 240, 8152,28631, 61,28632,28633, 138, 61, 138, - 138,28634,28635, 96,28636,28637, 240, 119, 240, 240, 49, 96, 96, 119, 240, 240, - 119, 240, 240}; -Word16 mlt_sqvh_bitcount_category_6[32] = { - 1, 4, 4, 6, 4, 6, 6, 8, 4, 6, 6, 8, 6, 9, 8,10, - 4, 6, 7, 8, 6, 9, 8,11, 6, 9, 8,10, 8,10, 9,11}; -UWord16 mlt_sqvh_code_category_6[32] = { - 1, 2, 4, 2, 5, 29, 24, 101, 3, 31, 28, 105, 3, 5, 102, 424, - 1, 30, 0, 107, 27, 200, 103, 806, 1, 4, 104, 402, 3, 425, 213, 807}; - -Word16 *table_of_bitcount_tables[NUM_CATEGORIES-1] = { -mlt_sqvh_bitcount_category_0, -mlt_sqvh_bitcount_category_1, -mlt_sqvh_bitcount_category_2, -mlt_sqvh_bitcount_category_3, -mlt_sqvh_bitcount_category_4, -mlt_sqvh_bitcount_category_5, -mlt_sqvh_bitcount_category_6 -}; - - -UWord16 *table_of_code_tables[NUM_CATEGORIES-1] = { -(UWord16 *)mlt_sqvh_code_category_0, -(UWord16 *)mlt_sqvh_code_category_1, -(UWord16 *)mlt_sqvh_code_category_2, -(UWord16 *)mlt_sqvh_code_category_3, -(UWord16 *)mlt_sqvh_code_category_4, -(UWord16 *)mlt_sqvh_code_category_5, -(UWord16 *)mlt_sqvh_code_category_6 -}; - -Word16 mlt_decoder_tree_category_0[180][2] = { -{ 1, 0},{ 2, 3},{ 4, 5},{ 6, 7},{ 8, 9},{ -1, -14},{ 10, 11},{ 12, 13}, -{ 14, 15},{ 16, 17},{ 18, 19},{ -15, 20},{ 21, 22},{ 23, -28},{ 24, -2},{ 25, 26}, -{ 27, 28},{ 29, 30},{ 31, 32},{ -29, 33},{ -16, 34},{ -3, 35},{ 36, 37},{ -42, 38}, -{ 39, 40},{ 41, 42},{ 43, 44},{ -17, 45},{ -43, 46},{ 47, 48},{ -4, 49},{ -56, 50}, -{ 51, 52},{ 53, 54},{ 55, 56},{ -57, -5},{ -30, 57},{ 58, 59},{ -18, 60},{ 61, -70}, -{ 62, 63},{ 64, -6},{ 65, 66},{ -44, 67},{ -71, 68},{ 69, 70},{ -19, -31},{ -84, 71}, -{ 72, 73},{ 74, 75},{ 76, 77},{ -7, 78},{ 79, -20},{ 80, 81},{ -85, 82},{ -98, 83}, -{ -58, 84},{ 85, -32},{ -99, 86},{ -8, 87},{ 88, 89},{ -72, -45},{ 90, -33},{ 91,-112}, -{ -21, 92},{ -59,-113},{ -46, 93},{ -9, 94},{ -22, 95},{ 96, 97},{ 98, 99},{ -23, -86}, -{ 100, 101},{ -34, -73},{ 102,-126},{-127, -35},{ 103, -47},{ 104, 105},{ 106, 107},{-140,-100}, -{-114, -87},{ 108, 109},{ 110, 111},{-141, -60},{ 112, -48},{ 113, -24},{ -10, -61},{ 114,-101}, -{ 115, 116},{ -74, -36},{ 117,-128},{ 118, -62},{ 119, 120},{ -37, 121},{ -11, -49},{ -88, 122}, -{ 123,-115},{-154, -25},{-142, 124},{-155,-129},{ 125, -50},{ 126, 127},{ -76, -75},{ 128, 129}, -{ -63, -77},{-102, -39},{ -38, 130},{ -51, 131},{ -89,-116},{-117,-156},{ 132, -52},{ -78, 133}, -{ 134,-103},{ 135, 136},{-143, -65},{ 137, -64},{-130,-131},{ -90, 138},{-104, -91},{ -92, 139}, -{-169,-183},{ -26,-118},{ 140, 141},{-144, -66},{ -12, 142},{-168, 143},{-105,-157},{ 144,-182}, -{ 145, 146},{ -79, 147},{ -53,-170},{ 148, 149},{ -27,-145},{ 150, -80},{-106, -13},{-132, -67}, -{-158, -40},{-119, 151},{ 152,-107},{ 153, 154},{ -41,-184},{ 155, 156},{ -54, 157},{-171, 158}, -{ -94, 159},{-134,-146},{ -93,-133},{-159,-108},{ 160, -81},{ 161,-160},{ 162, -68},{-120,-122}, -{-172, 163},{ -55, -95},{ 164,-109},{-161, -82},{-173,-185},{ 165, -69},{-147,-186},{ 166, 167}, -{-121, -96},{ 168,-148},{-174, 169},{ 170,-136},{ -83, 171},{ 172, 173},{-135,-110},{-187, 174}, -{-149,-150},{ 175,-123},{-162,-163},{ -97,-175},{-188, 176},{ 177, 178},{ 179,-111},{-151,-124}, -{-137,-177},{-176,-125},{-164,-138},{-189,-190},}; -Word16 mlt_decoder_tree_category_1[93][2] = { -{ 1, 0},{ 2, 3},{ 4, 5},{ 6, 7},{ 8, -10},{ -1, 9},{ 10, 11},{ 12, 13}, -{ -11, 14},{ 15, 16},{ 17, 18},{ -20, -2},{ 19, 20},{ -21, 21},{ 22, 23},{ -12, 24}, -{ 25, 26},{ 27, 28},{ 29, 30},{ -30, 31},{ -31, -3},{ 32, -22},{ 33, -13},{ 34, 35}, -{ 36, 37},{ 38, 39},{ 40, -4},{ -41, -14},{ 41, -40},{ -32, 42},{ 43, -23},{ 44, 45}, -{ 46, 47},{ 48, -5},{ -51, -50},{ -42, 49},{ -33, 50},{ -15, 51},{ 52, 53},{ 54, -24}, -{ 55, -43},{ 56, -52},{ 57, -61},{ -60, 58},{ -25, 59},{ -16, -34},{ -6, 60},{ -62, 61}, -{ -71, 62},{ -35, -7},{ 63, -72},{ -53, -17},{ 64, -44},{ -26, -70},{ 65, -45},{ -36, 66}, -{ -63, 67},{ -80, -54},{ -81, 68},{ -27, 69},{ 70, -82},{ -18, 71},{ 72, -55},{ 73, -64}, -{ 74, -73},{ 75, -46},{ -37, 76},{ -91, -8},{ -9, 77},{ -90, -83},{ 78, -28},{ 79, -56}, -{ -65, -38},{ -74, 80},{ -19, -57},{ -92, 81},{ -47, -48},{ 82, -66},{ 83, -29},{ -84, 84}, -{ -75, -85},{ -67, -93},{ -39, 85},{ -76, 86},{ -58, 87},{ 88, -49},{ -94, 89},{ 90, -68}, -{ 91, -78},{ -86, -59},{ -77, -95},{ 92, -69},{ -87, -96},}; -Word16 mlt_decoder_tree_category_2[47][2] = { -{ 1, 0},{ 2, 3},{ 4, 5},{ 6, -7},{ -1, 7},{ -8, 8},{ 9, 10},{ 11, 12}, -{ 13, -14},{ -15, -9},{ -2, 14},{ 15, 16},{ 17, 18},{ 19, -16},{ 20, -22},{ -10, 21}, -{ -21, -3},{ 22, 23},{ 24, 25},{ -23, -17},{ 26, 27},{ 28, -29},{ -11, -28},{ 29, 30}, -{ -4, -24},{ -30, 31},{ 32, -18},{ 33, -35},{ -36, 34},{ -31, -12},{ 35, -25},{ -5, -37}, -{ 36, 37},{ -42, 38},{ -19, -43},{ -32, 39},{ -13, -38},{ -26, -20},{ 40, -6},{ -44, 41}, -{ 42, -39},{ -33, -45},{ 43, -27},{ 44, -46},{ 45, -34},{ -40, 46},{ -41, -47},}; -Word16 mlt_decoder_tree_category_3[519][2] = { -{ 1, 2},{ 3, 4},{ 5, 0},{ 6, 7},{ 8, 9},{ 10, 11},{ 12, 13},{ 14, 15}, -{ 16, 17},{-125, 18},{ -1, 19},{ 20, 21},{ 22, 23},{ 24, 25},{ -5, -25},{ 26, 27}, -{ -6,-150},{ 28, 29},{ 30, 31},{ 32, 33},{ 34, -30},{ 35, 36},{ 37, 38},{ 39, -31}, -{-126,-155},{ 40, 41},{-156, 42},{ 43,-130},{ 44,-131},{-151, -26},{ 45, 46},{-250, 47}, -{ 48, 49},{ 50, 51},{ 52,-275},{ 53, 54},{ -2, -7},{ 55, 56},{ 57, 58},{ 59, 60}, -{ 61, 62},{ 63, 64},{ 65, 66},{ 67, 68},{ 69, 70},{ 71, -50},{ 72,-180},{ 73, 74}, -{ 75, 76},{ 77, -55},{ 78,-175},{ 79, -36},{ 80, 81},{ -35, -10},{ 82, 83},{-280, 84}, -{ -11, 85},{ 86, -32},{ 87, 88},{ 89,-161},{ 90,-276},{ 91, 92},{-281, 93},{ -8, 94}, -{ 95, 96},{ 97,-157},{-181,-400},{-132, 98},{-375, 99},{-160, 100},{-127, 101},{ -27, 102}, -{ 103,-251},{ -56, 104},{ 105,-256},{-300, -3},{-152,-255},{ 106, 107},{ -37, 108},{-305, 109}, -{-176, 110},{-136, 111},{ -12, 112},{ 113, 114},{ 115,-135},{ 116, 117},{-162, 118},{ -16, -51}, -{-186, 119},{ 120, 121},{ 122, 123},{ -41, 124},{ -61, 125},{ 126, 127},{ 128, 129},{ 130, -60}, -{ 131, 132},{-306, 133},{ 134,-205},{-405, 135},{ 136, 137},{ 138, 139},{-185, 140},{ 141,-500}, -{ -15, 142},{ 143, -80},{ -75, -40},{-301, 144},{ 145, 146},{-200, 147},{ 148, 149},{ 150, 151}, -{ 152,-525},{ 153,-177},{-425, 154},{ 155, -13},{-430, 156},{ 157,-406},{ 158, 159},{-206,-380}, -{ 160, 161},{ 162, 163},{ 164,-182},{-137, 165},{-286, 166},{ 167,-401},{ 168, 169},{ -42, -33}, -{ 170,-166},{ -57,-325},{ 171,-187},{ -38, 172},{ 173, 174},{-165,-330},{ -4,-282},{ 175,-257}, -{-261,-311},{-376, 176},{ 177, 178},{ -28, 179},{ 180, -9},{-285, 181},{ 182, 183},{ 184,-277}, -{ 185,-133},{-310, -81},{ -85, 186},{-158,-210},{ -17, 187},{ 188, 189},{ 190, -52},{-141, 191}, -{ 192,-128},{-191, -20},{ 193,-140},{ 194, 195},{-211,-260},{ 196, 197},{ 198, 199},{ 200, -66}, -{-201,-225},{-381, 201},{ 202, 203},{ 204, 205},{ 206, 207},{-163,-287},{ 208,-100},{ 209, 210}, -{ 211, 212},{ 213,-252},{-105, -76},{ 214, 215},{ 216, -21},{ -86, -62},{-307, 217},{ -65,-455}, -{-550, 218},{ 219, 220},{ 221, 222},{ 223, 224},{ 225,-230},{-142, 226},{-302,-426},{-431, 227}, -{ 228, 229},{ 230,-190},{-402, -46},{-153,-450},{-505, 231},{ 232, 233},{ 234, 235},{ 236, 237}, -{ 238, 239},{-262, -29},{ 240, 241},{ 242, 243},{-167, -67},{-331,-530},{ 244, 245},{ 246, 247}, -{ 248, 249},{ 250, 251},{ 252, 253},{ 254, 255},{ 256, 257},{ 258, 259},{ 260, 261},{ 262,-336}, -{ 263,-171},{-192,-207},{-258,-138},{ 264, 265},{ 266, 267},{ 268, 269},{ 270, 271},{ 272, 273}, -{ 274, -45},{-335,-411},{ -43, -18},{-265, -71},{-316,-326},{-350,-407},{-146, -14},{ 275, 276}, -{ 277, 278},{ 279, 280},{ 281,-216},{ -34,-283},{-291,-312},{-410,-168},{-555, 282},{ -70, -53}, -{-235, -87},{ -77,-183},{-315,-332},{-178, -58},{ 283, 284},{ 285, 286},{ 287, 288},{ 289, 290}, -{ 291, 292},{ 293, 294},{ 295, 296},{ 297, 298},{-202,-226},{-170,-267},{-134,-290},{-355,-385}, -{-386, -47},{-526,-196},{ 299, 300},{ 301, 302},{ 303, 304},{ 305, 306},{ 307, 308},{ 309, 310}, -{ 311, 312},{ 313, 314},{ 315, 316},{ 317, 318},{ 319, 320},{ 321, 322},{ 323, 324},{ 325,-111}, -{-231,-253},{ -91, -82},{-172,-145},{ -22,-317},{ -90,-356},{-382,-159},{ 326, 327},{ 328, 329}, -{ 330, 331},{ 332, 333},{ 334, 335},{-106,-263},{-278,-215},{-110, -39},{-101,-377},{-129, -63}, -{-436,-195},{-506,-531},{ 336,-212},{-154,-266},{ -59,-288},{-292,-303},{-337,-432},{-188,-451}, -{-456,-460},{-501,-236},{-551, 337},{ 338, 339},{ 340, 341},{ 342, 343},{ 344, 345},{ 346, 347}, -{ 348, 349},{ 350, 351},{ 352, 353},{ 354, 355},{ 356, 357},{ 358, 359},{ 360, 361},{ 362, 363}, -{ 364, 365},{ 366, 367},{ 368, 369},{ 370, 371},{ 372, 373},{ 374, 375},{ 376, 377},{ 378, 379}, -{ 380, 381},{ 382, 383},{ 384, 385},{ 386, 387},{ 388, 389},{ 390, 391},{ 392, 393},{ 394, 395}, -{ 396, 397},{ 398, 399},{ 400, 401},{ 402, 403},{ 404, 405},{ 406, 407},{ -72,-272},{-309,-333}, -{-340,-360},{ -68,-387},{-184,-416},{-427,-147},{-435,-437},{-115,-480},{-510,-532},{-164,-556}, -{ 408,-295},{-296,-297},{-107,-313},{-193,-173},{-320,-327},{-341,-351},{-352,-143},{-378, -19}, -{-403,-412},{-268, -54},{ -83,-441},{-442,-457},{-475, -44},{ -97,-511},{-515,-208},{-527,-528}, -{-237,-536},{-552, 409},{ 410, 411},{ 412, 413},{ 414, 415},{ 416, 417},{ 418, 419},{ 420, 421}, -{ 422, 423},{ 424, 425},{ 426, 427},{ 428, 429},{ 430, 431},{ 432, 433},{ 434, 435},{ 436, 437}, -{ 438, 439},{ 440, 441},{ 442, 443},{ 444, 445},{ 446, 447},{ 448, 449},{ 450, 451},{ 452, 453}, -{ 454, 455},{ 456, 457},{ 458, 459},{ 460, 461},{ 462, 463},{ 464, 465},{ 466, 467},{ 468, 469}, -{ 470, 471},{ 472, 473},{ 474, 475},{ 476, 477},{ 478, 479},{ 480, 481},{ 482, 483},{ 484, 485}, -{ 486, 487},{ 488, 489},{ 490, 491},{ 492, 493},{ 494, 495},{ 496, 497},{ 498, 499},{ 500, 501}, -{ 502, 503},{ 504, 505},{ 506, 507},{ 508, 509},{ 510, 511},{ 512, 513},{ 514, 515},{ 516, 517}, -{ 518,-104},{ -84,-218},{-318,-319},{-117,-321},{-322,-323},{-219,-174},{-243,-328},{-329, -94}, -{-228,-194},{-240,-334},{-102,-229},{-169,-338},{-339,-116},{-289,-342},{-343,-345},{-346,-347}, -{ -23,-203},{-214,-353},{-204,-220},{-357,-358},{-264,-361},{-362,-363},{-365,-366},{-367, -92}, -{-245,-121},{-293,-379},{-108,-232},{-221,-383},{-384,-233},{-294,-241},{-388,-389},{-390,-391}, -{-392,-393},{-394,-395},{-396,-397},{-398, -24},{-109,-149},{-242,-404},{ -64, -79},{ -89,-408}, -{-409,-213},{-120,-113},{-413,-414},{-415, -96},{-417,-418},{-419,-420},{-421,-422},{-423,-298}, -{ -69,-269},{-428,-429},{ -78,-270},{ -88,-433},{-434,-271},{-234,-259},{-438,-439},{-440,-227}, -{-179,-443},{-445,-446},{-447,-223},{-238,-452},{-453,-454},{-273,-254},{-246,-458},{-459, -48}, -{-461,-462},{-463,-465},{-466,-467},{-468,-470},{-471,-304},{-476,-477},{-478,-112},{-481,-482}, -{-483,-485},{-486,-487},{-490,-491},{-103,-118},{-502,-503},{-504,-189},{ -93,-507},{-508,-509}, -{-148,-139},{-512,-513},{-308,-516},{-517,-518},{-520,-521},{ -73, -98},{ -95, -49},{-529,-222}, -{-217,-197},{-533,-534},{-535,-284},{-537,-538},{-540,-541},{-542,-543},{-545,-546},{-144,-198}, -{-314,-553},{-209,-279},{-557,-558},{-560,-561},{-562,-563},{-565,-566},{-567,-575},{-576,-577}, -{-578,-580},{-581,-582},{-583,-585},{-586,-587},{-590,-591},{-600,-601},{-605,-606},}; -Word16 mlt_decoder_tree_category_4[208][2] = { -{ 1, 2},{ 3, 0},{ 4, 5},{ 6, 7},{ 8, 9},{ 10, 11},{ 12, -64},{ -1, 13}, -{ 14, -16},{ -4, 15},{ 16, 17},{ 18, -80},{ -5, 19},{ 20, 21},{ -20, 22},{ 23, -65}, -{ -84, -21},{ -68, 24},{ -17, 25},{ 26, 27},{ 28, -81},{ -69, -85},{ 29, 30},{ 31, 32}, -{-128, 33},{ 34, 35},{ -2, 36},{ 37, 38},{-144, 39},{ 40, -6},{ 41, 42},{ -32, 43}, -{ 44, -8},{ 45, -25},{ -96, 46},{ 47,-100},{ -9, 48},{ 49, -36},{ 50, -24},{ 51, 52}, -{ 53,-148},{ 54, 55},{ -22, 56},{ 57, 58},{-132, -89},{ 59, 60},{-101, 61},{ -37, 62}, -{ -18, 63},{ -88,-129},{ -66, -70},{ -97, 64},{ -72, -73},{ 65,-145},{-149, -86},{ 66, -33}, -{ 67,-133},{ 68, 69},{ 70, 71},{-192, 72},{ 73,-160},{ -82, 74},{-164, 75},{ -10, 76}, -{ 77,-208},{ 78, -40},{ 79, 80},{ -3, 81},{ -7, 82},{ 83, 84},{-104, 85},{ 86, -26}, -{ 87,-105},{ 88,-112},{ 89, 90},{ 91, -41},{ 92, 93},{ 94, 95},{ -48, 96},{ -90, 97}, -{ 98, -28},{ -52, 99},{ -12, 100},{ 101, -74},{ -13,-116},{-161, 102},{ 103, -29},{-102, 104}, -{-152,-165},{ 105, 106},{ 107, 108},{ 109, 110},{ 111,-212},{ 112, 113},{-136, 114},{ 115,-137}, -{ 116, -23},{ -19,-153},{ -98,-134},{-196, 117},{ 118, 119},{ -38,-193},{-113,-150},{-209, 120}, -{ 121, -93},{ -83, 122},{ 123, 124},{ 125, 126},{ 127, 128},{ 129, 130},{ 131, -34},{-146, -53}, -{ 132, 133},{ 134, 135},{ 136, 137},{ 138,-130},{ -49, 139},{ 140, 141},{-117, -42},{ -67, -92}, -{ 142, -87},{ -77,-197},{ -71, 143},{ 144, 145},{ 146, 147},{ 148, 149},{ 150, 151},{ 152, 153}, -{ 154, 155},{ 156, 157},{ 158, 159},{ 160, 161},{ 162, 163},{ 164, 165},{ 166, 167},{ 168, 169}, -{-108, -76},{-168,-169},{-176, -44},{-224, -56},{ -45,-180},{ -11,-106},{-213, 170},{ 171, 172}, -{ 173, 174},{ 175, 176},{ 177, 178},{ 179, 180},{ 181, 182},{ 183, 184},{ 185, 186},{ 187, 188}, -{ 189, 190},{ 191, 192},{ 193, 194},{ 195, 196},{ 197, 198},{ 199, 200},{ 201, 202},{ 203, 204}, -{ 205, 206},{ 207,-131},{ -30, -27},{ -43,-151},{ -75,-154},{-156,-162},{-109,-194},{-198,-201}, -{-114,-225},{-228,-229},{-141,-142},{ -94,-124},{ -95,-147},{-115,-125},{ -54, -55},{-107, -58}, -{ -39,-155},{-121,-157},{-158,-103},{ -14,-122},{-163, -51},{ -57,-166},{-167, -46},{-110,-170}, -{-172,-173},{ -61,-177},{-178, -99},{-181,-182},{-184,-185},{-118, -35},{ -15,-195},{ -31, -60}, -{-135,-199},{-200, -79},{-202,-204},{-205,-119},{ -91,-210},{-211, -78},{-120,-214},{-215,-216}, -{-217,-218},{-220,-221},{ -50,-138},{-226,-139},{-140,-230},{-232,-233},{-240,-241},{-244,-245}, -}; -Word16 mlt_decoder_tree_category_5[191][2] = { -{ 1, 2},{ 0, 3},{ 4, 5},{ 6, 7},{ 8, 9},{ 10, 11},{ -81, -1},{ 12, 13}, -{ 14, -27},{ -3, -9},{ 15, 16},{ 17, 18},{ 19, 20},{-108, 21},{ -4, 22},{ 23, -36}, -{ -12, 24},{ -82, 25},{ 26, -84},{ 27, -90},{ -10, -30},{ 28, 29},{ 30, -28},{ 31,-117}, -{ -13, 32},{ -39, 33},{ 34,-109},{ 35, -93},{ -85,-111},{ -37, 36},{ -31, 37},{ -91, 38}, -{ 39, 40},{ -40,-120},{ 41, 42},{-118, 43},{ -94, 44},{-112,-162},{ 45, 46},{ -2, 47}, -{ 48, 49},{-121,-189},{ 50, -54},{ 51, 52},{ 53, -18},{ 54, 55},{ -6, 56},{ 57, -5}, -{-135, 58},{ 59, 60},{ 61, 62},{ -63, 63},{ 64, -7},{ -15, 65},{ 66, 67},{ -45, 68}, -{ 69, 70},{ 71, -21},{ 72, 73},{ 74, 75},{ 76, 77},{-163, 78},{ 79,-171},{-144, 80}, -{ -48, 81},{ -57, 82},{ 83, 84},{-165, 85},{ -16,-198},{ 86, 87},{ -11, 88},{ 89, -99}, -{ 90, -83},{ -19, 91},{ 92, 93},{ 94, 95},{ 96, 97},{ 98, 99},{ -87, 100},{ 101, 102}, -{-190, -66},{ -33,-192},{ 103, 104},{ 105, 106},{-102, -42},{ 107,-126},{ 108, -29},{-129, -46}, -{ -86, -14},{-114, -32},{-172, 109},{ 110, -58},{ -34,-138},{ 111, 112},{ 113, 114},{ 115, 116}, -{ 117, 118},{ 119, 120},{-127,-166},{-174, 121},{ 122, 123},{ 124, 125},{ -88, -96},{ 126,-100}, -{ -38,-110},{ -22,-136},{ -55,-139},{-201, 127},{ -64,-193},{ 128, -49},{-175,-199},{ 129, 130}, -{ 131, 132},{ 133, 134},{ 135, 136},{ 137, 138},{ 139, 140},{ 141, 142},{ 143, 144},{ 145, 146}, -{ 147, 148},{ 149, 150},{-103, -92},{ -43,-130},{-145,-147},{-148, -41},{-216,-115},{-119,-123}, -{ -95, 151},{ 152, 153},{ 154, 155},{ 156, 157},{ 158, 159},{ 160, 161},{ 162, 163},{ 164, 165}, -{ 166, 167},{ 168, 169},{ 170, 171},{ 172, 173},{ 174, 175},{ 176, 177},{ 178, 179},{ 180, 181}, -{ 182, 183},{ 184, 185},{ 186, 187},{ 188, 189},{ 190,-153},{-180, -8},{ -97, -24},{-122,-113}, -{-124,-125},{ -67, -44},{-128, -69},{-106,-131},{-132,-133},{ -61, -73},{-137,-116},{ -89,-140}, -{-141,-142},{ -23, -25},{-146, -17},{-104,-149},{-150,-151},{ -52,-154},{-156,-157},{ -76, -70}, -{-164, -51},{ -72,-167},{-168,-169},{ -47, -20},{-173, -59},{-101,-176},{-177,-178},{ -68,-181}, -{-183,-184},{ -35, -60},{-191, -98},{ -56,-194},{-195,-196},{ -75, -65},{-200,-105},{-202,-203}, -{-204,-205},{-207,-208},{-210,-211},{ -50,-217},{-219,-220},{-225,-226},{-228,-229},}; -Word16 mlt_decoder_tree_category_6[31][2] = { -{ 1, 0},{ 2, 3},{ 4, 5},{ 6, 7},{ 8, -16},{ -1, -8},{ -2, -4},{ 9, 10}, -{ 11, 12},{ 13, 14},{ 15, 16},{ 17, -24},{ -3, -12},{ -6, 18},{ 19, -20},{ -10, -5}, -{ -17, -9},{ -18, 20},{ 21, 22},{ 23, 24},{ 25, -28},{ 26, -7},{ -14, -22},{ -26, -11}, -{ 27, -19},{ -25, -13},{ -21, 28},{ 29, -30},{ -27, 30},{ -15, -29},{ -23, -31},}; - -Word16 *table_of_decoder_tables[NUM_CATEGORIES-1] = { -(Word16 *)mlt_decoder_tree_category_0, -(Word16 *)mlt_decoder_tree_category_1, -(Word16 *)mlt_decoder_tree_category_2, -(Word16 *)mlt_decoder_tree_category_3, -(Word16 *)mlt_decoder_tree_category_4, -(Word16 *)mlt_decoder_tree_category_5, -(Word16 *)mlt_decoder_tree_category_6, -}; - diff --git a/third_party/g7221/common/huff_tab.h b/third_party/g7221/common/huff_tab.h deleted file mode 100644 index 5ccd650..0000000 --- a/third_party/g7221/common/huff_tab.h +++ /dev/null @@ -1,42 +0,0 @@ -/*********************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -***********************************************************************/ - -extern Word16 differential_region_power_bits[MAX_NUMBER_OF_REGIONS][DIFF_REGION_POWER_LEVELS]; -extern UWord16 differential_region_power_codes[MAX_NUMBER_OF_REGIONS][DIFF_REGION_POWER_LEVELS]; -extern Word16 differential_region_power_decoder_tree[MAX_NUMBER_OF_REGIONS][DIFF_REGION_POWER_LEVELS-1][2]; -extern Word16 mlt_quant_centroid[NUM_CATEGORIES][MAX_NUM_BINS]; -extern Word16 expected_bits_table[NUM_CATEGORIES]; -extern Word16 mlt_sqvh_bitcount_category_0[196]; -extern UWord16 mlt_sqvh_code_category_0[196]; -extern Word16 mlt_sqvh_bitcount_category_1[100]; -extern UWord16 mlt_sqvh_code_category_1[100]; -extern Word16 mlt_sqvh_bitcount_category_2[49]; -extern UWord16 mlt_sqvh_code_category_2[49]; -extern Word16 mlt_sqvh_bitcount_category_3[625]; -extern UWord16 mlt_sqvh_code_category_3[625]; -extern Word16 mlt_sqvh_bitcount_category_4[256]; -extern UWord16 mlt_sqvh_code_category_4[256]; -extern Word16 mlt_sqvh_bitcount_category_5[243]; -extern UWord16 mlt_sqvh_code_category_5[243]; -extern Word16 mlt_sqvh_bitcount_category_6[32]; -extern UWord16 mlt_sqvh_code_category_6[32]; -extern Word16 *table_of_bitcount_tables[NUM_CATEGORIES-1]; -extern UWord16 *table_of_code_tables[NUM_CATEGORIES-1]; -extern Word16 mlt_decoder_tree_category_0[180][2]; -extern Word16 mlt_decoder_tree_category_1[93][2]; -extern Word16 mlt_decoder_tree_category_2[47][2]; -extern Word16 mlt_decoder_tree_category_3[519][2]; -extern Word16 mlt_decoder_tree_category_4[208][2]; -extern Word16 mlt_decoder_tree_category_5[191][2]; -extern Word16 mlt_decoder_tree_category_6[31][2]; -extern Word16 *table_of_decoder_tables[NUM_CATEGORIES-1]; - diff --git a/third_party/g7221/common/tables.c b/third_party/g7221/common/tables.c deleted file mode 100644 index 1018e64..0000000 --- a/third_party/g7221/common/tables.c +++ /dev/null @@ -1,298 +0,0 @@ -/**************************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -****************************************************************************/ - -/**************************************************************************** - Filename: tables.c - - Purpose: Contains tables used by G.722.1 Annex C - - Design Notes: - -****************************************************************************/ - -/*************************************************************************** - Include files -***************************************************************************/ -#include "defs.h" - -Word16 int_region_standard_deviation_table[REGION_POWER_TABLE_SIZE] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 2, 3, 4, 6, - 8, 11, 16, 23, 32, 45, 64, 91, 128, 181, - 256, 362, 512, 724, 1024, 1448, 2048, 2896, 4096, 5793, - 8192, 11585, 16384, 23170, 0,0,0,0,0,0, - 0,0,0,0}; - -Word16 standard_deviation_inverse_table[REGION_POWER_TABLE_SIZE] = { - 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, - 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, 32767, - 32767, 32767, 32767, 32767, 32767, 23170, 16384, 11585, 8192, 5793, - 4096, 2896, 2048, 1448, 1024, 724, 512, 362, 256, 181, - 128, 91, 64, 45, 32, 23, 16, 11, 8, 6, - 4, 3, 2, 1, 1, 1, 1, 0, 0, 0, - 0, 0, 0, 0}; - - -Word16 step_size_inverse_table[NUM_CATEGORIES]={ - 23167,16384,11585,8192,5793,4096,2896,2896 -}; - - -Word16 vector_dimension[NUM_CATEGORIES] = { 2, 2, 2, 4, 4, 5, 5, 1}; -Word16 number_of_vectors[NUM_CATEGORIES] = {10,10,10, 5, 5, 4, 4,20}; -/* The last category isn't really coded with scalar quantization. */ - -Word16 max_bin[NUM_CATEGORIES] = {13, 9, 6, 4, 3, 2, 1, 1}; - -Word16 max_bin_plus_one_inverse[NUM_CATEGORIES] = -{ - 2341,3277,4682,6554,8193,10923,16385,16385 -}; - -/* - * Release 1.2. - * Add new version of int_dead_zone[] to go with - * changes to vector_huffman() in encoder.c. - * - */ - -/************** See new version of table below -Word16 int_dead_zone[NUM_CATEGORIES]= -{ - 9830,10813,11796,12780,13763,14746,16384,16384 -}; -***************/ - -/******** New version of table added in Release 1.2 ********/ -Word16 int_dead_zone[NUM_CATEGORIES]= -{ -2457, 2703, 2949, 3195, 3440, 3686, 4096, 4096 -}; - - -/* - * Release 1.2. - * Added this new table to go with - * changes to vector_huffman() in encoder.c, - * accompanies the new table for int_dead_zone[]. - */ - -Word16 int_dead_zone_low_bits[NUM_CATEGORIES]= -{ -2, 1, 0, 0, 3, 2, 0, 0 -}; - - -Word16 samples_to_rmlt_window[DCT_LENGTH]= -{ 44, 134, 224, 314, 404, 494, 584, 674, 764, 853, - 943, 1033, 1123, 1213, 1302, 1392, 1482, 1571, 1661, 1750, - 1840, 1929, 2019, 2108, 2197, 2286, 2376, 2465, 2554, 2643, - 2732, 2821, 2909, 2998, 3087, 3175, 3264, 3352, 3441, 3529, - 3617, 3705, 3793, 3881, 3969, 4057, 4144, 4232, 4319, 4407, - 4494, 4581, 4668, 4755, 4842, 4928, 5015, 5101, 5188, 5274, - 5360, 5446, 5532, 5617, 5703, 5788, 5873, 5959, 6043, 6128, - 6213, 6297, 6382, 6466, 6550, 6634, 6718, 6801, 6885, 6968, - 7051, 7134, 7217, 7299, 7382, 7464, 7546, 7628, 7709, 7791, - 7872, 7953, 8034, 8115, 8195, 8276, 8356, 8436, 8515, 8595, - 8674, 8753, 8832, 8911, 8989, 9068, 9146, 9223, 9301, 9378, - 9455, 9532, 9609, 9685, 9762, 9838, 9913, 9989, 10064, 10139, - 10214, 10288, 10363, 10437, 10510, 10584, 10657, 10730, 10803, 10875, - 10948, 11020, 11091, 11163, 11234, 11305, 11375, 11446, 11516, 11586, - 11655, 11724, 11793, 11862, 11930, 11998, 12066, 12134, 12201, 12268, - 12334, 12401, 12467, 12532, 12598, 12663, 12728, 12792, 12857, 12920, - 12984, 13047, 13110, 13173, 13235, 13297, 13359, 13420, 13481, 13542, - 13602, 13662, 13722, 13782, 13841, 13899, 13958, 14016, 14074, 14131, - 14188, 14245, 14301, 14357, 14413, 14468, 14523, 14578, 14632, 14686, - 14739, 14793, 14845, 14898, 14950, 15002, 15053, 15104, 15155, 15205, - 15255, 15305, 15354, 15403, 15451, 15500, 15547, 15595, 15642, 15688, - 15734, 15780, 15826, 15871, 15916, 15960, 16004, 16047, 16091, 16133, - 16176, 16218, 16259, 16300, 16341, 16382, 16422, 16461, 16501, 16540, - 16578, 16616, 16654, 16691, 16728, 16764, 16800, 16836, 16871, 16906, - 16940, 16974, 17008, 17041, 17074, 17106, 17138, 17170, 17201, 17232, - 17262, 17292, 17321, 17350, 17379, 17407, 17435, 17462, 17489, 17516, - 17542, 17567, 17593, 17617, 17642, 17666, 17689, 17713, 17735, 17758, - 17779, 17801, 17822, 17842, 17863, 17882, 17901, 17920, 17939, 17957, - 17974, 17991, 18008, 18024, 18040, 18055, 18070, 18085, 18099, 18113, - 18126, 18139, 18151, 18163, 18174, 18185, 18196, 18206, 18216, 18225, - 18234, 18242, 18250, 18257, 18265, 18271, 18277, 18283, 18288, 18293, - 18298, 18302, 18305, 18308, 18311, 18313, 18315, 18316, 18317, 18317, -}; - -Word16 rmlt_to_samples_window[DCT_LENGTH]= -{ 44, 133, 222, 310, 399, 488, 577, 666, 754, 843, - 932, 1020, 1109, 1198, 1286, 1375, 1464, 1552, 1641, 1729, - 1817, 1906, 1994, 2082, 2171, 2259, 2347, 2435, 2523, 2611, - 2699, 2786, 2874, 2962, 3049, 3137, 3224, 3312, 3399, 3486, - 3573, 3660, 3747, 3834, 3921, 4008, 4094, 4181, 4267, 4353, - 4439, 4526, 4611, 4697, 4783, 4869, 4954, 5040, 5125, 5210, - 5295, 5380, 5465, 5549, 5634, 5718, 5802, 5886, 5970, 6054, - 6138, 6221, 6304, 6388, 6471, 6553, 6636, 6719, 6801, 6883, - 6965, 7047, 7129, 7211, 7292, 7373, 7454, 7535, 7616, 7696, - 7777, 7857, 7937, 8016, 8096, 8175, 8254, 8333, 8412, 8491, - 8569, 8647, 8725, 8803, 8880, 8957, 9035, 9111, 9188, 9264, - 9341, 9417, 9492, 9568, 9643, 9718, 9793, 9868, 9942, 10016, - 10090, 10163, 10237, 10310, 10383, 10455, 10528, 10600, 10672, 10743, - 10815, 10886, 10957, 11027, 11098, 11168, 11237, 11307, 11376, 11445, - 11514, 11582, 11650, 11718, 11785, 11853, 11920, 11986, 12053, 12119, - 12185, 12250, 12315, 12380, 12445, 12509, 12573, 12637, 12701, 12764, - 12826, 12889, 12951, 13013, 13075, 13136, 13197, 13257, 13318, 13378, - 13437, 13497, 13556, 13614, 13673, 13731, 13788, 13846, 13903, 13959, - 14016, 14072, 14128, 14183, 14238, 14292, 14347, 14401, 14454, 14508, - 14561, 14613, 14665, 14717, 14769, 14820, 14871, 14921, 14971, 15021, - 15070, 15119, 15168, 15216, 15264, 15311, 15359, 15405, 15452, 15498, - 15544, 15589, 15634, 15678, 15722, 15766, 15810, 15853, 15895, 15938, - 15979, 16021, 16062, 16103, 16143, 16183, 16223, 16262, 16300, 16339, - 16377, 16414, 16452, 16488, 16525, 16561, 16596, 16632, 16666, 16701, - 16735, 16768, 16801, 16834, 16867, 16899, 16930, 16961, 16992, 17022, - 17052, 17082, 17111, 17140, 17168, 17196, 17223, 17250, 17277, 17303, - 17329, 17354, 17379, 17404, 17428, 17452, 17475, 17498, 17520, 17542, - 17564, 17585, 17606, 17626, 17646, 17665, 17684, 17703, 17721, 17739, - 17756, 17773, 17790, 17806, 17821, 17836, 17851, 17865, 17879, 17893, - 17906, 17918, 17931, 17942, 17954, 17965, 17975, 17985, 17995, 18004, - 18012, 18021, 18028, 18036, 18043, 18049, 18055, 18061, 18066, 18071, - 18076, 18079, 18083, 18086, 18089, 18091, 18093, 18094, 18095, 18095, -}; - -Word16 max_samples_to_rmlt_window[MAX_DCT_LENGTH]={ -0, 43, 89, 133, 178, 222, 268, 314, 357, 403, -447, 493, 538, 582, 628, 671, 717, 763, 807, 853, -896, 942, 987, 1031, 1077, 1121, 1166, 1212, 1256, 1301, -1345, 1390, 1436, 1480, 1526, 1569, 1615, 1660, 1704, 1749, -1793, 1838, 1884, 1928, 1973, 2016, 2062, 2107, 2151, 2196, -2239, 2285, 2331, 2374, 2419, 2463, 2508, 2553, 2597, 2642, -2685, 2730, 2776, 2819, 2864, 2908, 2952, 2998, 3041, 3086, -3129, 3174, 3219, 3263, 3307, 3350, 3396, 3440, 3483, 3528, -3571, 3616, 3661, 3704, 3748, 3791, 3836, 3881, 3923, 3968, -4011, 4055, 4100, 4143, 4187, 4230, 4274, 4318, 4362, 4406, -4448, 4493, 4537, 4580, 4624, 4666, 4710, 4755, 4797, 4841, -4883, 4927, 4971, 5013, 5057, 5099, 5144, 5187, 5229, 5273, -5315, 5359, 5402, 5444, 5488, 5530, 5573, 5617, 5658, 5702, -5743, 5787, 5830, 5871, 5915, 5956, 6000, 6043, 6084, 6127, -6169, 6211, 6254, 6296, 6339, 6380, 6423, 6465, 6507, 6549, -6590, 6633, 6675, 6716, 6759, 6799, 6842, 6884, 6925, 6967, -7007, 7050, 7092, 7132, 7175, 7215, 7257, 7299, 7339, 7381, -7421, 7462, 7504, 7544, 7586, 7626, 7667, 7709, 7749, 7790, -7830, 7871, 7912, 7952, 7993, 8032, 8073, 8114, 8153, 8194, -8234, 8275, 8315, 8355, 8395, 8434, 8474, 8515, 8554, 8594, -8632, 8673, 8713, 8752, 8792, 8830, 8871, 8910, 8949, 8989, -9027, 9066, 9106, 9144, 9184, 9221, 9261, 9300, 9338, 9378, -9415, 9454, 9493, 9531, 9570, 9607, 9646, 9685, 9722, 9761, -9798, 9836, 9875, 9912, 9950, 9987, 10025, 10064, 10100, 10138, -10175, 10213, 10250, 10287, 10325, 10361, 10398, 10436, 10472, 10510, -10545, 10583, 10620, 10656, 10692, 10728, 10766, 10803, 10838, 10874, -10910, 10947, 10983, 11018, 11055, 11089, 11126, 11162, 11197, 11233, -11268, 11303, 11340, 11374, 11410, 11444, 11480, 11515, 11549, 11585, -11619, 11654, 11689, 11723, 11758, 11791, 11826, 11861, 11895, 11930, -11963, 11997, 12032, 12065, 12099, 12132, 12166, 12201, 12233, 12267, -12300, 12333, 12367, 12400, 12433, 12465, 12499, 12532, 12563, 12597, -12629, 12662, 12695, 12727, 12759, 12790, 12823, 12856, 12887, 12920, -12951, 12983, 13016, 13046, 13078, 13109, 13141, 13173, 13203, 13235, -13266, 13296, 13328, 13358, 13389, 13419, 13450, 13481, 13510, 13541, -13571, 13602, 13632, 13661, 13692, 13721, 13751, 13781, 13810, 13840, -13869, 13898, 13929, 13957, 13986, 14015, 14044, 14073, 14101, 14130, -14158, 14187, 14216, 14244, 14272, 14300, 14328, 14357, 14384, 14412, -14439, 14468, 14495, 14522, 14550, 14577, 14604, 14632, 14658, 14686, -14711, 14739, 14765, 14792, 14819, 14844, 14871, 14897, 14923, 14949, -14975, 15001, 15027, 15053, 15079, 15103, 15129, 15155, 15180, 15205, -15229, 15255, 15280, 15304, 15329, 15353, 15378, 15403, 15426, 15451, -15475, 15499, 15523, 15546, 15570, 15594, 15618, 15641, 15664, 15688, -15711, 15734, 15757, 15780, 15802, 15825, 15848, 15871, 15892, 15915, -15937, 15960, 15982, 16003, 16026, 16047, 16069, 16090, 16112, 16133, -16154, 16175, 16197, 16217, 16239, 16259, 16279, 16301, 16320, 16341, -16361, 16382, 16402, 16421, 16441, 16461, 16481, 16501, 16520, 16539, -16558, 16578, 16597, 16615, 16635, 16653, 16672, 16691, 16709, 16728, -16746, 16764, 16782, 16800, 16818, 16835, 16853, 16871, 16888, 16905, -16923, 16940, 16957, 16974, 16991, 17008, 17024, 17041, 17057, 17074, -17090, 17106, 17122, 17138, 17154, 17169, 17185, 17201, 17216, 17231, -17246, 17262, 17277, 17291, 17306, 17321, 17336, 17350, 17364, 17379, -17393, 17407, 17421, 17435, 17449, 17462, 17476, 17490, 17502, 17515, -17528, 17542, 17554, 17567, 17580, 17592, 17605, 17618, 17629, 17642, -17653, 17666, 17678, 17689, 17701, 17712, 17724, 17736, 17746, 17757, -17768, 17779, 17790, 17800, 17811, 17822, 17832, 17842, 17852, 17862, -17872, 17882, 17892, 17902, 17911, 17920, 17930, 17938, 17947, 17956, -17965, 17974, 17983, 17991, 17999, 18008, 18016, 18025, 18032, 18040, -18047, 18055, 18063, 18070, 18078, 18085, 18092, 18099, 18106, 18112, -18119, 18126, 18132, 18138, 18144, 18151, 18157, 18163, 18168, 18174, -18179, 18185, 18191, 18196, 18201, 18206, 18211, 18216, 18220, 18225, -18229, 18234, 18238, 18242, 18246, 18250, 18254, 18257, 18260, 18264, -18268, 18271, 18274, 18277, 18280, 18283, 18286, 18288, 18291, 18293, -18295, 18297, 18300, 18301, 18303, 18305, 18306, 18308, 18309, 18311, -18312, 18312, 18314, 18315, 18315, 18316, 18316, 18317, 18317, 18317 -}; - -Word16 max_rmlt_to_samples_window[MAX_DCT_LENGTH]={ -0, 43, 88, 131, 176, 219, 265, 310, 353, 398, -442, 487, 532, 575, 620, 663, 709, 754, 797, 842, -885, 931, 975, 1019, 1064, 1107, 1152, 1197, 1240, 1286, -1329, 1373, 1419, 1462, 1507, 1550, 1595, 1640, 1683, 1728, -1771, 1816, 1861, 1904, 1949, 1992, 2037, 2081, 2125, 2170, -2212, 2258, 2302, 2345, 2390, 2433, 2477, 2522, 2565, 2610, -2652, 2697, 2742, 2784, 2829, 2872, 2916, 2961, 3004, 3048, -3091, 3136, 3180, 3223, 3267, 3310, 3354, 3399, 3441, 3485, -3528, 3572, 3616, 3659, 3703, 3745, 3790, 3834, 3876, 3920, -3962, 4006, 4050, 4093, 4136, 4179, 4222, 4266, 4309, 4352, -4394, 4438, 4482, 4524, 4568, 4610, 4653, 4697, 4739, 4782, -4824, 4867, 4911, 4953, 4996, 5038, 5081, 5124, 5166, 5209, -5251, 5294, 5337, 5378, 5421, 5463, 5506, 5548, 5590, 5633, -5674, 5717, 5759, 5800, 5843, 5884, 5927, 5970, 6011, 6053, -6094, 6136, 6178, 6219, 6262, 6302, 6345, 6387, 6428, 6470, -6510, 6552, 6594, 6635, 6677, 6717, 6759, 6801, 6841, 6883, -6922, 6964, 7006, 7046, 7087, 7127, 7169, 7210, 7250, 7291, -7331, 7372, 7413, 7453, 7494, 7533, 7574, 7615, 7655, 7695, -7735, 7776, 7816, 7855, 7896, 7935, 7975, 8016, 8054, 8095, -8134, 8174, 8214, 8253, 8293, 8332, 8371, 8412, 8450, 8490, -8528, 8568, 8607, 8646, 8685, 8723, 8763, 8802, 8840, 8879, -8917, 8956, 8995, 9033, 9072, 9109, 9148, 9187, 9225, 9264, -9301, 9340, 9378, 9415, 9454, 9491, 9529, 9567, 9604, 9642, -9679, 9717, 9755, 9791, 9829, 9866, 9903, 9941, 9977, 10015, -10051, 10089, 10126, 10162, 10199, 10235, 10272, 10309, 10345, 10382, -10417, 10454, 10491, 10526, 10563, 10598, 10635, 10672, 10706, 10742, -10778, 10814, 10850, 10885, 10921, 10955, 10991, 11027, 11061, 11097, -11131, 11166, 11202, 11236, 11271, 11305, 11340, 11376, 11409, 11444, -11478, 11513, 11547, 11580, 11615, 11648, 11683, 11717, 11751, 11785, -11817, 11852, 11886, 11918, 11952, 11985, 12018, 12053, 12085, 12118, -12150, 12184, 12217, 12249, 12282, 12314, 12347, 12380, 12411, 12444, -12476, 12508, 12541, 12572, 12604, 12635, 12668, 12700, 12731, 12763, -12794, 12826, 12858, 12888, 12920, 12950, 12982, 13013, 13043, 13074, -13105, 13135, 13166, 13196, 13227, 13257, 13287, 13317, 13347, 13377, -13407, 13437, 13467, 13496, 13525, 13555, 13585, 13614, 13643, 13672, -13701, 13730, 13760, 13787, 13817, 13845, 13873, 13903, 13930, 13959, -13987, 14015, 14043, 14071, 14099, 14126, 14154, 14183, 14209, 14237, -14264, 14292, 14319, 14346, 14373, 14400, 14427, 14454, 14480, 14507, -14533, 14560, 14586, 14612, 14639, 14664, 14691, 14717, 14742, 14768, -14793, 14819, 14845, 14870, 14896, 14920, 14945, 14971, 14996, 15020, -15044, 15070, 15094, 15118, 15143, 15167, 15192, 15216, 15239, 15263, -15287, 15311, 15335, 15358, 15382, 15405, 15428, 15452, 15474, 15498, -15520, 15543, 15566, 15588, 15611, 15633, 15656, 15678, 15700, 15722, -15744, 15766, 15788, 15809, 15831, 15852, 15874, 15895, 15916, 15937, -15958, 15979, 16000, 16020, 16041, 16061, 16082, 16103, 16122, 16143, -16162, 16183, 16203, 16222, 16242, 16261, 16281, 16300, 16319, 16339, -16357, 16377, 16396, 16414, 16433, 16451, 16470, 16488, 16506, 16525, -16542, 16561, 16579, 16596, 16614, 16631, 16649, 16667, 16683, 16700, -16717, 16735, 16752, 16768, 16785, 16801, 16818, 16834, 16850, 16867, -16883, 16899, 16915, 16930, 16945, 16961, 16977, 16992, 17007, 17022, -17037, 17052, 17067, 17081, 17096, 17111, 17126, 17140, 17154, 17168, -17182, 17196, 17209, 17223, 17237, 17250, 17264, 17277, 17290, 17303, -17315, 17329, 17341, 17354, 17367, 17379, 17391, 17404, 17415, 17428, -17439, 17451, 17463, 17475, 17486, 17497, 17509, 17520, 17531, 17542, -17552, 17563, 17574, 17584, 17595, 17605, 17616, 17626, 17636, 17646, -17655, 17665, 17675, 17684, 17694, 17703, 17712, 17721, 17730, 17739, -17747, 17756, 17764, 17773, 17781, 17789, 17798, 17806, 17813, 17821, -17829, 17836, 17843, 17851, 17858, 17866, 17872, 17879, 17886, 17893, -17899, 17906, 17912, 17918, 17924, 17931, 17937, 17942, 17948, 17953, -17959, 17964, 17970, 17975, 17980, 17985, 17990, 17995, 17999, 18004, -18008, 18012, 18016, 18021, 18025, 18028, 18032, 18036, 18039, 18043, -18046, 18049, 18052, 18055, 18058, 18061, 18064, 18067, 18069, 18071, -18073, 18075, 18078, 18079, 18081, 18083, 18084, 18086, 18087, 18089, -18090, 18090, 18091, 18092, 18093, 18094, 18094, 18095, 18095, 18095 -}; diff --git a/third_party/g7221/common/tables.h b/third_party/g7221/common/tables.h deleted file mode 100644 index ddf29eb..0000000 --- a/third_party/g7221/common/tables.h +++ /dev/null @@ -1,47 +0,0 @@ -/*********************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 1999 PictureTel Coporation -** Andover, MA, USA -** -** All rights reserved. -** -***********************************************************************/ - -/*********************************************************************** - Filename: tables.h - - Purpose: Contains table definitions used by G.722.1 Annex C - - Design Notes: - -***********************************************************************/ - -/*********************************************************************** - Include files -***********************************************************************/ -#define REGION_POWER_TABLE_SIZE 64 -#define NUM_CATEGORIES 8 -#define DCT_LENGTH 320 -#define MAX_DCT_LENGTH 640 - -extern Word16 int_region_standard_deviation_table[REGION_POWER_TABLE_SIZE]; -extern Word16 standard_deviation_inverse_table[REGION_POWER_TABLE_SIZE]; -extern Word16 step_size_inverse_table[NUM_CATEGORIES]; -extern Word16 vector_dimension[NUM_CATEGORIES]; -extern Word16 number_of_vectors[NUM_CATEGORIES]; -/* The last category isn't really coded with scalar quantization. */ -extern Word16 max_bin[NUM_CATEGORIES]; -extern Word16 max_bin_plus_one_inverse[NUM_CATEGORIES]; -extern Word16 int_dead_zone[NUM_CATEGORIES]; -extern Word16 samples_to_rmlt_window[DCT_LENGTH]; -extern Word16 rmlt_to_samples_window[DCT_LENGTH]; - -/* Add next line in Release 1.2 */ -extern Word16 int_dead_zone_low_bits[NUM_CATEGORIES]; - -extern Word16 max_samples_to_rmlt_window[MAX_DCT_LENGTH]; -extern Word16 max_rmlt_to_samples_window[MAX_DCT_LENGTH]; diff --git a/third_party/g7221/common/typedef.h b/third_party/g7221/common/typedef.h deleted file mode 100644 index 6daa807..0000000 --- a/third_party/g7221/common/typedef.h +++ /dev/null @@ -1,32 +0,0 @@ -/* $Id: typedef.h 2623 2009-04-20 18:38:15Z bennylp $ */ -/* - * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef TYPEDEF_H -#define TYPEDEF_H - -#include - -typedef pj_int8_t Word8; -typedef pj_int16_t Word16; -typedef pj_int32_t Word32; -typedef pj_uint16_t UWord16; -typedef pj_uint32_t UWord32; -typedef int Flag; - -#endif /* TYPEDEF_H */ - diff --git a/third_party/g7221/decode/coef2sam.c b/third_party/g7221/decode/coef2sam.c deleted file mode 100644 index 87deab0..0000000 --- a/third_party/g7221/decode/coef2sam.c +++ /dev/null @@ -1,180 +0,0 @@ -/***************************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -*****************************************************************************/ - -/***************************************************************************** -* Filename: rmlt_coefs_to_samples.c -* -* Purpose: Convert Reversed MLT (Modulated Lapped Transform) -* Coefficients to Samples -* -* The "Reversed MLT" is an overlapped block transform which uses -* even symmetry * on the left, odd symmetry on the right and a -* Type IV DCT as the block transform. * It is thus similar to a -* MLT which uses odd symmetry on the left, even symmetry * on the -* right and a Type IV DST as the block transform. In fact, it is -* equivalent * to reversing the order of the samples, performing -* an MLT and then negating all * the even-numbered coefficients. -* -*****************************************************************************/ - -/*************************************************************************** - Include files -***************************************************************************/ -#include "defs.h" -#include "tables.h" -#include "count.h" - -/*************************************************************************** - Function: rmlt_coefs_to_samples - - Syntax: void rmlt_coefs_to_samples(Word16 *coefs, - Word16 *old_samples, - Word16 *out_samples, - Word16 dct_length, - Word16 mag_shift) - - inputs: Word16 *coefs - Word16 *old_samples - Word16 dct_length - Word16 mag_shift - - - outputs: Word16 *out_samples - - Description: Converts the mlt_coefs to samples - - Design Notes: - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 1.91 | 1.91 - -------|--------------|---------------- - MAX | 1.91 | 1.91 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 3.97 | 3.97 | 3.97 - -------|--------------|----------------|---------------- - MAX | 3.97 | 3.97 | 3.97 - -------|--------------|----------------|---------------- - -***************************************************************************/ - -void rmlt_coefs_to_samples(Word16 *coefs, - Word16 *old_samples, - Word16 *out_samples, - Word16 dct_length, - Word16 mag_shift) -{ - - - Word16 index, vals_left; - Word16 new_samples[MAX_DCT_LENGTH]; - Word16 *new_ptr, *old_ptr; - Word16 *win_new, *win_old; - Word16 *out_ptr; - Word16 half_dct_size; - Word32 sum; - - - - half_dct_size = shr_nocheck(dct_length,1); - - /* Perform a Type IV (inverse) DCT on the coefficients */ - dct_type_iv_s(coefs, new_samples, dct_length); - - test(); - if (mag_shift > 0) - { - for(index=0;index 0; vals_left--) - { - sum = 0L; - move32(); - sum = L_mac(sum,*win_new++, *--new_ptr); - sum = L_mac(sum,*--win_old, *old_ptr++); - *out_ptr++ = itu_round(L_shl_nocheck(sum,2)); - move16(); - - } - - /* Get the second half of the windowed samples */ - - for (vals_left = half_dct_size; vals_left > 0; vals_left--) - { - sum = 0L; - move32(); - sum = L_mac(sum,*win_new++, *new_ptr++); - sum = L_mac(sum,negate(*--win_old), *--old_ptr); - *out_ptr++ = itu_round(L_shl_nocheck(sum,2)); - move16(); - } - - /* Save the second half of the new samples for */ - /* next time, when they will be the old samples. */ - - /* pointer arithmetic */ - new_ptr = new_samples + half_dct_size; - move16(); - old_ptr = old_samples; - move16(); - for (vals_left = half_dct_size; vals_left > 0; vals_left--) - { - *old_ptr++ = *new_ptr++; - move16(); - } -} diff --git a/third_party/g7221/decode/dct4_s.c b/third_party/g7221/decode/dct4_s.c deleted file mode 100644 index 0123a13..0000000 --- a/third_party/g7221/decode/dct4_s.c +++ /dev/null @@ -1,504 +0,0 @@ -/******************************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -********************************************************************************/ - -/******************************************************************************** -* Filename: dct_type_iv_s.c -* -* Purpose: Discrete Cosine Transform, Type IV used for inverse MLT -* -* The basis functions are -* -* cos(PI*(t+0.5)*(k+0.5)/block_length) -* -* for time t and basis function number k. Due to the symmetry of the expression -* in t and k, it is clear that the forward and inverse transforms are the same. -* -*********************************************************************************/ - -/*************************************************************************** - Include files -***************************************************************************/ -#include "defs.h" -#include "count.h" -#include "dct4_s.h" - -/*************************************************************************** - External variable declarations -***************************************************************************/ -extern Word16 syn_bias_7khz[DCT_LENGTH]; -extern Word16 dither[DCT_LENGTH]; -extern Word16 max_dither[MAX_DCT_LENGTH]; - -extern Word16 dct_core_s[DCT_LENGTH_DIV_32][DCT_LENGTH_DIV_32]; -extern cos_msin_t s_cos_msin_2[DCT_LENGTH_DIV_32]; -extern cos_msin_t s_cos_msin_4[DCT_LENGTH_DIV_16]; -extern cos_msin_t s_cos_msin_8[DCT_LENGTH_DIV_8]; -extern cos_msin_t s_cos_msin_16[DCT_LENGTH_DIV_4]; -extern cos_msin_t s_cos_msin_32[DCT_LENGTH_DIV_2]; -extern cos_msin_t s_cos_msin_64[DCT_LENGTH]; -extern cos_msin_t *s_cos_msin_table[]; - -/******************************************************************************** - Function: dct_type_iv_s - - Syntax: void dct_type_iv_s (Word16 *input,Word16 *output,Word16 dct_length) - - - Description: Discrete Cosine Transform, Type IV used for inverse MLT - - Design Notes: - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 1.74 | 1.74 - -------|--------------|---------------- - MAX | 1.74 | 1.74 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 3.62 | 3.62 | 3.62 - -------|--------------|----------------|---------------- - MAX | 3.62 | 3.62 | 3.62 - -------|--------------|----------------|---------------- - -********************************************************************************/ - -void dct_type_iv_s (Word16 *input,Word16 *output,Word16 dct_length) -{ - Word16 buffer_a[MAX_DCT_LENGTH], buffer_b[MAX_DCT_LENGTH], buffer_c[MAX_DCT_LENGTH]; - Word16 *in_ptr, *in_ptr_low, *in_ptr_high, *next_in_base; - Word16 *out_ptr_low, *out_ptr_high, *next_out_base; - Word16 *out_buffer, *in_buffer, *buffer_swap; - Word16 in_val_low, in_val_high; - Word16 out_val_low, out_val_high; - Word16 in_low_even, in_low_odd; - Word16 in_high_even, in_high_odd; - Word16 out_low_even, out_low_odd; - Word16 out_high_even, out_high_odd; - Word16 *pair_ptr; - Word16 cos_even, cos_odd, msin_even, msin_odd; - Word16 set_span, set_count, set_count_log, pairs_left, sets_left; - Word16 i,k; - Word16 index; - Word16 dummy; - Word32 sum; - cos_msin_t **table_ptr_ptr, *cos_msin_ptr; - - Word32 acca; - Word16 temp; - - Word16 dct_length_log; - Word16 *dither_ptr; - - /*++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - /* Do the sum/difference butterflies, the first part of */ - /* converting one N-point transform into 32 - 10 point transforms */ - /* transforms, where N = 1 << DCT_LENGTH_LOG. */ - /*++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - test(); - if (dct_length==DCT_LENGTH) - { - dct_length_log = DCT_LENGTH_LOG; - move16(); - dither_ptr = dither; - move16(); - } - else - { - dct_length_log = MAX_DCT_LENGTH_LOG; - move16(); - dither_ptr = max_dither; - move16(); - } - - in_buffer = input; - move16(); - out_buffer = buffer_a; - move16(); - - index=0; - move16(); - - i=0; - move16(); - - for (set_count_log = 0; set_count_log <= dct_length_log - 2; set_count_log++) - { - - /*===========================================================*/ - /* Initialization for the loop over sets at the current size */ - /*===========================================================*/ - - /* set_span = 1 << (DCT_LENGTH_LOG - set_count_log); */ - set_span = shr_nocheck(dct_length,set_count_log); - - set_count = shl_nocheck(1,set_count_log); - in_ptr = in_buffer; - move16(); - next_out_base = out_buffer; - move16(); - - /*=====================================*/ - /* Loop over all the sets of this size */ - /*=====================================*/ - temp = sub(index,1); - test(); - if(temp < 0) - { - for (sets_left = set_count;sets_left > 0;sets_left--) - { - - /*||||||||||||||||||||||||||||||||||||||||||||*/ - /* Set up output pointers for the current set */ - /*||||||||||||||||||||||||||||||||||||||||||||*/ - /* pointer arithmetic */ - out_ptr_low = next_out_base; - move16(); - next_out_base += set_span; - move16(); - out_ptr_high = next_out_base; - move16(); - - /*||||||||||||||||||||||||||||||||||||||||||||||||||*/ - /* Loop over all the butterflies in the current set */ - /*||||||||||||||||||||||||||||||||||||||||||||||||||*/ - - do - { - in_val_low = *in_ptr++; - move16(); - in_val_high = *in_ptr++; - move16(); - - /* BEST METHOD OF GETTING RID OF BIAS, BUT COMPUTATIONALLY UNPLEASANT */ - /* ALTERNATIVE METHOD, SMEARS BIAS OVER THE ENTIRE FRAME, COMPUTATIONALLY SIMPLEST. */ - /* IF THIS WORKS, IT'S PREFERABLE */ - - dummy = add(in_val_low,dither_ptr[i++]); - // blp: addition of two 16bits vars, there's no way - // they'll overflow a 32bit var - //acca = L_add(dummy,in_val_high); - acca = dummy + in_val_high; - out_val_low = extract_l(L_shr_nocheck(acca,1)); - - dummy = add(in_val_low,dither_ptr[i++]); - // blp: addition of two 16bits vars, there's no way - // they'll overflow a 32bit var - //acca = L_add(dummy,-in_val_high); - acca = dummy - in_val_high; - out_val_high = extract_l(L_shr_nocheck(acca,1)); - - *out_ptr_low++ = out_val_low; - move16(); - *--out_ptr_high = out_val_high; - move16(); - - test(); - - /* this involves comparison of pointers */ - /* pointer arithmetic */ - - } while (out_ptr_low < out_ptr_high); - - } /* End of loop over sets of the current size */ - } - else - { - for (sets_left = set_count; sets_left > 0; sets_left--) - { - /*||||||||||||||||||||||||||||||||||||||||||||*/ - /* Set up output pointers for the current set */ - /*||||||||||||||||||||||||||||||||||||||||||||*/ - - out_ptr_low = next_out_base; - move16(); - next_out_base += set_span; - move16(); - out_ptr_high = next_out_base; - move16(); - - /*||||||||||||||||||||||||||||||||||||||||||||||||||*/ - /* Loop over all the butterflies in the current set */ - /*||||||||||||||||||||||||||||||||||||||||||||||||||*/ - - do - { - in_val_low = *in_ptr++; - move16(); - in_val_high = *in_ptr++; - move16(); - - out_val_low = add(in_val_low,in_val_high); - out_val_high = add(in_val_low,negate(in_val_high)); - - *out_ptr_low++ = out_val_low; - move16(); - *--out_ptr_high = out_val_high; - move16(); - - test(); - } while (out_ptr_low < out_ptr_high); - - } /* End of loop over sets of the current size */ - } - - /*============================================================*/ - /* Decide which buffers to use as input and output next time. */ - /* Except for the first time (when the input buffer is the */ - /* subroutine input) we just alternate the local buffers. */ - /*============================================================*/ - - in_buffer = out_buffer; - move16(); - - test(); - if (out_buffer == buffer_a) - { - out_buffer = buffer_b; - move16(); - } - else - { - out_buffer = buffer_a; - move16(); - } - - index = add(index,1); - } /* End of loop over set sizes */ - - - /*++++++++++++++++++++++++++++++++*/ - /* Do 32 - 10 point transforms */ - /*++++++++++++++++++++++++++++++++*/ - - pair_ptr = in_buffer; - move16(); - buffer_swap = buffer_c; - move16(); - - for (pairs_left = 1 << (dct_length_log - 1); pairs_left > 0; pairs_left--) - { - for ( k=0; k= 0; set_count_log--) - { - - /*===========================================================*/ - /* Initialization for the loop over sets at the current size */ - /*===========================================================*/ - - /* set_span = 1 << (DCT_LENGTH_LOG - set_count_log); */ - set_span = shr_nocheck(dct_length,set_count_log); - - set_count = shl_nocheck(1,set_count_log); - next_in_base = in_buffer; - move16(); - test(); - if (set_count_log == 0) - { - next_out_base = output; - move16(); - } - else - { - next_out_base = out_buffer; - move16(); - } - - /*=====================================*/ - /* Loop over all the sets of this size */ - /*=====================================*/ - - for (sets_left = set_count; sets_left > 0; sets_left--) - { - - /*|||||||||||||||||||||||||||||||||||||||||*/ - /* Set up the pointers for the current set */ - /*|||||||||||||||||||||||||||||||||||||||||*/ - - in_ptr_low = next_in_base; - move16(); - - temp = shr_nocheck(set_span,1); - in_ptr_high = in_ptr_low + temp; - move16(); - - next_in_base += set_span; - move16(); - - out_ptr_low = next_out_base; - move16(); - - next_out_base += set_span; - move16(); - out_ptr_high = next_out_base; - move16(); - - cos_msin_ptr = *table_ptr_ptr; - move16(); - - /*||||||||||||||||||||||||||||||||||||||||||||||||||||||*/ - /* Loop over all the butterfly pairs in the current set */ - /*||||||||||||||||||||||||||||||||||||||||||||||||||||||*/ - - do - { - in_low_even = *in_ptr_low++; - move16(); - in_low_odd = *in_ptr_low++; - move16(); - in_high_even = *in_ptr_high++; - move16(); - in_high_odd = *in_ptr_high++; - move16(); - cos_even = cos_msin_ptr[0].cosine; - move16(); - msin_even = cos_msin_ptr[0].minus_sine; - move16(); - cos_odd = cos_msin_ptr[1].cosine; - move16(); - msin_odd = cos_msin_ptr[1].minus_sine; - move16(); - cos_msin_ptr += 2; - - sum = 0L; - move32(); - - sum = L_mac(sum,cos_even,in_low_even); - sum = L_mac(sum,negate(msin_even),in_high_even); - out_low_even = itu_round(L_shl_nocheck(sum,1)); - - sum = 0L; - move32(); - sum = L_mac(sum,msin_even,in_low_even); - sum = L_mac(sum,cos_even,in_high_even); - out_high_even = itu_round(L_shl_nocheck(sum,1)); - - sum = 0L; - move32(); - sum = L_mac(sum,cos_odd,in_low_odd); - sum = L_mac(sum,msin_odd,in_high_odd); - out_low_odd = itu_round(L_shl_nocheck(sum,1)); - - sum = 0L; - move32(); - sum = L_mac(sum,msin_odd,in_low_odd); - sum = L_mac(sum,negate(cos_odd),in_high_odd); - out_high_odd = itu_round(L_shl_nocheck(sum,1)); - - *out_ptr_low++ = out_low_even; - move16(); - *--out_ptr_high = out_high_even; - move16(); - *out_ptr_low++ = out_low_odd; - move16(); - *--out_ptr_high = out_high_odd; - move16(); - - test(); - } while (out_ptr_low < out_ptr_high); - - } /* End of loop over sets of the current size */ - - /*=============================================*/ - /* Swap input and output buffers for next time */ - /*=============================================*/ - - buffer_swap = in_buffer; - move16(); - in_buffer = out_buffer; - move16(); - out_buffer = buffer_swap; - move16(); - - index = add(index,1); - table_ptr_ptr++; - } - /*------------------------------------ - - ADD IN BIAS FOR OUTPUT - - -----------------------------------*/ - if (dct_length==DCT_LENGTH) - { - for(i=0;i<320;i++) - { - // blp: addition of two 16bits vars, there's no way - // they'll overflow a 32bit var - //sum = L_add(output[i],syn_bias_7khz[i]); - sum = output[i] + syn_bias_7khz[i]; - acca = L_sub(sum,32767); - test(); - if (acca > 0) - { - sum = 32767L; - move32(); - } - // blp: addition of two 16bits vars, there's no way - // they'll overflow 32bit var - //acca = L_add(sum,32768L); - acca = sum + 32768; - test(); - if (acca < 0) - { - sum = -32768L; - move32(); - } - output[i] = extract_l(sum); - } - } -} - diff --git a/third_party/g7221/decode/dct4_s.h b/third_party/g7221/decode/dct4_s.h deleted file mode 100644 index 010e52d..0000000 --- a/third_party/g7221/decode/dct4_s.h +++ /dev/null @@ -1,856 +0,0 @@ -/*********************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -***********************************************************************/ - -/*********************************************************************** - Filename: dct4_s.h - - Purpose: Contains tables used by dct4_s.c - - Design Notes: - -***********************************************************************/ - -/*************************************************************************** - Include files -***************************************************************************/ - -typedef struct -{ - Word16 cosine; - Word16 minus_sine; -} cos_msin_t; - -/*************************************************************************** - The dct_core_s table was generated by the following code - - for(i=0;i<10;++i) - { - for(k=0;k<10;++k) - { - dct_core_s[i][k]=(short) (FTOI(((.9*32768.)*cos(3.1415926*(k+0.5)*(i+0.5)/10.)))); - } - } -***************************************************************************/ -Word16 dct_core_s[10][10] = { -{ 29400, 28676, 27246, 25145, 22425, 19153, 15409, 11286, 6885, 2314 }, -{ 28676, 22425, 11286, -2314, -15409, -25145, -29400, -27246, -19153, -6885 }, -{ 27246, 11286, -11286, -27246, -27246, -11286, 11286, 27246, 27246, 11286 }, -{ 25145, -2314, -27246, -22425, 6885, 28676, 19153, -11286, -29400, -15409 }, -{ 22425, -15409, -27246, 6885, 29400, 2314, -28676, -11286, 25145, 19153 }, -{ 19153, -25145, -11286, 28676, 2314, -29400, 6885, 27246, -15409, -22425 }, -{ 15409, -29400, 11286, 19153, -28676, 6885, 22425, -27246, 2314, 25145 }, -{ 11286, -27246, 27246, -11286, -11286, 27246, -27246, 11286, 11286, -27246 }, -{ 6885, -19153, 27246, -29400, 25145, -15409, 2314, 11286, -22425, 28676 }, -{ 2314, -6885, 11286, -15409, 19153, -22425, 25145, -27246, 28676, -29400 } -}; - -Word16 syn_bias_7khz[DCT_LENGTH] = { - -4, 4, -5, -2, 0, -4, 6, 2, -2, -4, - -3, 3, 0, 0, -2, 4, 0, 0, 3, -6, - 8, 5, 4, 5, -8, 0, -2, 0, 0, -3, - 3, 0, 0, 0, 1, -1, -2, 0, 0, 2, - -2, -5, -2, 3, 2, -1, -1, -6, 3, 1, - -7, 4, 4, 0, 1, 4, 1, 0, 1, -5, - -1, 1, -6, 0, -1, -1, 3, 0, -2, 1, - 2, -4, 0, 9, 0, -3, 1, 1, 1, 0, - -3, -2, -1, -4, -2, 0, 5, 2, -3, 5, - 0, -2, 4, 4, 0, -6, -4, 2, 0, 0, - 0, -1, -1, -2, 0, 6, 1, 0, 0, -1, - 0, -4, -1, 0, -4, 1, -1, -5, 0, 1, - 2, 4, 0, -8, -4, 0, -2, -2, 2, 5, - -3, -1, 1, -4, 0, 0, 0, -1, -3, 0, - -5, -4, 0, -2, 0, 7, 1, 0, 5, -2, - -1, 2, 2, -2, 3, 7, -3, 4, 1, -4, - 0, 0, 3, -7, -5, 0, 0, 4, 0, -2, - -1, 0, -5, 0, 2, 0, 11, 5, -1, 0, - 2, 2, -2, -2, 5, 4, -3, 1, 0, -2, - 1, 3, 2, 0, 1, 0, 0, 0, 5, 6, - -2, -1, 0, 2, 3, 2, 0, -3, 4, 5, - 0, -1, 0, 3, 1, -2, -3, -2, -1, 2, - -1, -1, -2, -7, 4, 6, -5, -6, -3, -4, - 0, 2, -5, -2, 3, 0, 0, 0, 2, -2, - -4, 3, 3, 1, 0, 0, 4, -1, 8, 13, - 1, 2, 0, 2, 0, -1, 4, -3, 1, 0, - -1, 3, 0, 0, -5, 0, 6, 2, 4, 5, - 2, -1, -1, 3, 6, 1, 1, 2, -4, 0, - -1, -6, -2, -2, 2, 1, 2, 6, 2, 0, - -2, -2, 0, -1, 2, 0, 0, 3, -2, 1, - 3, 1, 2, -1, -2, 2, 2, -4, 0, 0, - -3, 0, -4, -3, 6, 7, 2, 2, 0, -3}; - -Word16 dither[DCT_LENGTH]= { - 1, 0, 0, 0, 1, 0, 0, 1, 1, 1, - 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 1, 0, 1, 1, 0, 0, 0, - 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, - 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, - 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, - 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, - 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, - 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, - 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, - 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, - 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, - 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, - 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, - 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, - 1, 0, 0, 1, 1, 0, 1, 1, 0, 0, - 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, - 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, - 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, - 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, - 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, - 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, - 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, - 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, - 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, - 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, - 1, 1, 1, 0, 1, 0, 0, 0, 1, 0}; - -Word16 max_dither[MAX_DCT_LENGTH]= { - 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, - 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, - 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, - 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, - 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, - 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, - 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, - 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, - 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, - 1, 0, 1, 0, 1, 0, 0, 0, 1, 1, - 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, - 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, - 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, - 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, - 1, 0, 0, 0, 1, 1, 0, 1, 0, 1, - 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, - 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, - 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, - 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, - 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, - 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, - 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, - 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, - 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, - 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, - 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, - 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, - 0, 1, 1, 1, 0, 1, 0, 1, 0, 0, - 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, - 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, - 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, - 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, - 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, - 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, - 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, - 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, - 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, - 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, - 0, 1, 1, 0, 0, 0, 1, 1, 1, 0, - 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, - 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, - 1, 1, 1, 1, 0, 0, 1, 0, 1, 0, - 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, - 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, - 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, - 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, - 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, - 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, - 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, - 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, - 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, - 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, - 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, - 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, - 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, - 0, 1, 0, 1, 0, 1, 0, 0, 0, 0 -}; - - -/******************************************************************************** - The s_cos_min tables were generated by the following code: - double angle, scale; - int index; - - for (index = 0;index < length;index++) - { - angle = scale * ((double)index + 0.5); - table[index].cosine = (short) (FTOI((18427)* cos(angle))); - table[index].minus_sine = (short) (FTOI((18427)*(-sin(angle)))); - } - - -********************************************************************************/ - -cos_msin_t s_cos_msin_2[DCT_LENGTH_DIV_32] = { - { 18413 , -723 } , - { 18299 , -2166 } , - { 18073 , -3595 } , - { 17735 , -5002 } , - { 17288 , -6378 } , - { 16734 , -7715 } , - { 16077 , -9004 } , - { 15321 , -10237 } , - { 14471 , -11408 } , - { 13531 , -12508 } - }; -cos_msin_t s_cos_msin_4[DCT_LENGTH_DIV_16] = { - { 18423 , -362 } , - { 18395 , -1085 } , - { 18338 , -1806 } , - { 18253 , -2525 } , - { 18140 , -3239 } , - { 17999 , -3949 } , - { 17830 , -4653 } , - { 17634 , -5349 } , - { 17410 , -6037 } , - { 17159 , -6716 } , - { 16883 , -7385 } , - { 16580 , -8042 } , - { 16251 , -8686 } , - { 15898 , -9318 } , - { 15520 , -9935 } , - { 15118 , -10536 } , - { 14692 , -11122 } , - { 14244 , -11690 } , - { 13774 , -12240 } , - { 13283 , -12772 } - }; -cos_msin_t s_cos_msin_8[DCT_LENGTH_DIV_8] = { - { 18426 , -181 } , - { 18419 , -543 } , - { 18405 , -904 } , - { 18384 , -1265 } , - { 18355 , -1626 } , - { 18320 , -1986 } , - { 18277 , -2345 } , - { 18228 , -2704 } , - { 18171 , -3061 } , - { 18107 , -3417 } , - { 18037 , -3772 } , - { 17959 , -4126 } , - { 17875 , -4477 } , - { 17783 , -4827 } , - { 17685 , -5176 } , - { 17580 , -5522 } , - { 17468 , -5866 } , - { 17350 , -6208 } , - { 17225 , -6547 } , - { 17093 , -6884 } , - { 16954 , -7219 } , - { 16809 , -7550 } , - { 16658 , -7879 } , - { 16500 , -8204 } , - { 16336 , -8526 } , - { 16165 , -8846 } , - { 15988 , -9161 } , - { 15805 , -9473 } , - { 15616 , -9782 } , - { 15421 , -10087 } , - { 15220 , -10387 } , - { 15013 , -10684 } , - { 14801 , -10977 } , - { 14582 , -11265 } , - { 14358 , -11550 } , - { 14129 , -11829 } , - { 13894 , -12104 } , - { 13654 , -12375 } , - { 13408 , -12641 } , - { 13157 , -12901 } - }; -cos_msin_t s_cos_msin_16[DCT_LENGTH_DIV_4] = { - { 18427 , -90 } , - { 18425 , -271 } , - { 18421 , -452 } , - { 18416 , -633 } , - { 18409 , -814 } , - { 18400 , -995 } , - { 18389 , -1175 } , - { 18377 , -1356 } , - { 18363 , -1536 } , - { 18347 , -1716 } , - { 18329 , -1896 } , - { 18310 , -2076 } , - { 18288 , -2256 } , - { 18265 , -2435 } , - { 18241 , -2614 } , - { 18214 , -2793 } , - { 18186 , -2972 } , - { 18156 , -3150 } , - { 18124 , -3328 } , - { 18090 , -3506 } , - { 18055 , -3684 } , - { 18018 , -3861 } , - { 17979 , -4037 } , - { 17939 , -4214 } , - { 17897 , -4390 } , - { 17853 , -4565 } , - { 17807 , -4740 } , - { 17760 , -4915 } , - { 17710 , -5089 } , - { 17660 , -5262 } , - { 17607 , -5436 } , - { 17553 , -5608 } , - { 17497 , -5780 } , - { 17439 , -5952 } , - { 17380 , -6123 } , - { 17319 , -6293 } , - { 17257 , -6463 } , - { 17192 , -6632 } , - { 17126 , -6800 } , - { 17059 , -6968 } , - { 16990 , -7135 } , - { 16919 , -7302 } , - { 16846 , -7467 } , - { 16772 , -7632 } , - { 16696 , -7797 } , - { 16619 , -7960 } , - { 16540 , -8123 } , - { 16459 , -8285 } , - { 16377 , -8446 } , - { 16294 , -8607 } , - { 16208 , -8766 } , - { 16121 , -8925 } , - { 16033 , -9083 } , - { 15943 , -9240 } , - { 15852 , -9396 } , - { 15759 , -9551 } , - { 15664 , -9705 } , - { 15568 , -9858 } , - { 15471 , -10011 } , - { 15372 , -10162 } , - { 15271 , -10313 } , - { 15169 , -10462 } , - { 15066 , -10610 } , - { 14961 , -10758 } , - { 14854 , -10904 } , - { 14747 , -11049 } , - { 14637 , -11194 } , - { 14527 , -11337 } , - { 14415 , -11479 } , - { 14301 , -11620 } , - { 14187 , -11760 } , - { 14071 , -11898 } , - { 13953 , -12036 } , - { 13834 , -12172 } , - { 13714 , -12308 } , - { 13593 , -12442 } , - { 13470 , -12575 } , - { 13346 , -12706 } , - { 13220 , -12837 } , - { 13094 , -12966 } - }; -cos_msin_t s_cos_msin_32[DCT_LENGTH_DIV_2] = { - { 18427 , -45 } , - { 18427 , -136 } , - { 18426 , -226 } , - { 18424 , -317 } , - { 18423 , -407 } , - { 18420 , -497 } , - { 18418 , -588 } , - { 18415 , -678 } , - { 18411 , -769 } , - { 18407 , -859 } , - { 18403 , -949 } , - { 18398 , -1040 } , - { 18392 , -1130 } , - { 18387 , -1220 } , - { 18380 , -1310 } , - { 18374 , -1401 } , - { 18367 , -1491 } , - { 18359 , -1581 } , - { 18351 , -1671 } , - { 18343 , -1761 } , - { 18334 , -1851 } , - { 18324 , -1941 } , - { 18315 , -2031 } , - { 18305 , -2121 } , - { 18294 , -2211 } , - { 18283 , -2301 } , - { 18271 , -2390 } , - { 18259 , -2480 } , - { 18247 , -2570 } , - { 18234 , -2659 } , - { 18221 , -2749 } , - { 18207 , -2838 } , - { 18193 , -2927 } , - { 18178 , -3017 } , - { 18163 , -3106 } , - { 18148 , -3195 } , - { 18132 , -3284 } , - { 18116 , -3373 } , - { 18099 , -3462 } , - { 18082 , -3551 } , - { 18064 , -3639 } , - { 18046 , -3728 } , - { 18027 , -3816 } , - { 18009 , -3905 } , - { 17989 , -3993 } , - { 17969 , -4081 } , - { 17949 , -4170 } , - { 17928 , -4258 } , - { 17907 , -4346 } , - { 17886 , -4434 } , - { 17864 , -4521 } , - { 17841 , -4609 } , - { 17818 , -4696 } , - { 17795 , -4784 } , - { 17772 , -4871 } , - { 17747 , -4958 } , - { 17723 , -5045 } , - { 17698 , -5132 } , - { 17672 , -5219 } , - { 17647 , -5306 } , - { 17620 , -5392 } , - { 17594 , -5479 } , - { 17567 , -5565 } , - { 17539 , -5651 } , - { 17511 , -5737 } , - { 17483 , -5823 } , - { 17454 , -5909 } , - { 17425 , -5994 } , - { 17395 , -6080 } , - { 17365 , -6165 } , - { 17335 , -6250 } , - { 17304 , -6335 } , - { 17272 , -6420 } , - { 17241 , -6505 } , - { 17208 , -6590 } , - { 17176 , -6674 } , - { 17143 , -6758 } , - { 17110 , -6842 } , - { 17076 , -6926 } , - { 17042 , -7010 } , - { 17007 , -7093 } , - { 16972 , -7177 } , - { 16937 , -7260 } , - { 16901 , -7343 } , - { 16864 , -7426 } , - { 16828 , -7509 } , - { 16791 , -7591 } , - { 16753 , -7674 } , - { 16715 , -7756 } , - { 16677 , -7838 } , - { 16638 , -7919 } , - { 16599 , -8001 } , - { 16560 , -8082 } , - { 16520 , -8164 } , - { 16480 , -8245 } , - { 16439 , -8325 } , - { 16398 , -8406 } , - { 16357 , -8486 } , - { 16315 , -8567 } , - { 16272 , -8647 } , - { 16230 , -8726 } , - { 16187 , -8806 } , - { 16143 , -8885 } , - { 16100 , -8964 } , - { 16055 , -9043 } , - { 16011 , -9122 } , - { 15966 , -9200 } , - { 15920 , -9279 } , - { 15875 , -9357 } , - { 15829 , -9435 } , - { 15782 , -9512 } , - { 15735 , -9589 } , - { 15688 , -9667 } , - { 15640 , -9744 } , - { 15592 , -9820 } , - { 15544 , -9897 } , - { 15495 , -9973 } , - { 15446 , -10049 } , - { 15396 , -10124 } , - { 15347 , -10200 } , - { 15296 , -10275 } , - { 15246 , -10350 } , - { 15195 , -10425 } , - { 15143 , -10499 } , - { 15092 , -10573 } , - { 15040 , -10647 } , - { 14987 , -10721 } , - { 14934 , -10794 } , - { 14881 , -10868 } , - { 14828 , -10941 } , - { 14774 , -11013 } , - { 14719 , -11086 } , - { 14665 , -11158 } , - { 14610 , -11230 } , - { 14555 , -11301 } , - { 14499 , -11372 } , - { 14443 , -11444 } , - { 14387 , -11514 } , - { 14330 , -11585 } , - { 14273 , -11655 } , - { 14216 , -11725 } , - { 14158 , -11795 } , - { 14100 , -11864 } , - { 14041 , -11933 } , - { 13983 , -12002 } , - { 13924 , -12070 } , - { 13864 , -12138 } , - { 13804 , -12206 } , - { 13744 , -12274 } , - { 13684 , -12341 } , - { 13623 , -12408 } , - { 13562 , -12475 } , - { 13501 , -12541 } , - { 13439 , -12608 } , - { 13377 , -12673 } , - { 13314 , -12739 } , - { 13252 , -12804 } , - { 13189 , -12869 } , - { 13125 , -12934 } , - { 13062 , -12998 } - }; -cos_msin_t s_cos_msin_64[DCT_LENGTH] = { -{18426, -21}, -{18426, -66}, -{18426, -110}, -{18426, -154}, -{18425, -198}, -{18425, -242}, -{18424, -286}, -{18424, -331}, -{18423, -374}, -{18421, -419}, -{18421, -463}, -{18419, -507}, -{18418, -552}, -{18417, -595}, -{18415, -639}, -{18414, -684}, -{18412, -728}, -{18410, -772}, -{18408, -816}, -{18406, -860}, -{18404, -904}, -{18402, -949}, -{18400, -992}, -{18397, -1037}, -{18394, -1081}, -{18392, -1125}, -{18389, -1169}, -{18387, -1213}, -{18384, -1257}, -{18380, -1301}, -{18378, -1345}, -{18374, -1389}, -{18371, -1433}, -{18367, -1477}, -{18364, -1521}, -{18360, -1566}, -{18356, -1609}, -{18352, -1653}, -{18348, -1697}, -{18344, -1742}, -{18339, -1785}, -{18335, -1829}, -{18331, -1873}, -{18326, -1917}, -{18322, -1961}, -{18317, -2005}, -{18312, -2049}, -{18307, -2092}, -{18302, -2137}, -{18297, -2180}, -{18292, -2224}, -{18286, -2268}, -{18281, -2312}, -{18275, -2356}, -{18270, -2399}, -{18264, -2443}, -{18258, -2487}, -{18252, -2531}, -{18246, -2574}, -{18240, -2618}, -{18233, -2662}, -{18227, -2706}, -{18220, -2749}, -{18214, -2793}, -{18207, -2836}, -{18200, -2880}, -{18193, -2924}, -{18186, -2967}, -{18179, -3011}, -{18172, -3055}, -{18164, -3098}, -{18157, -3142}, -{18149, -3185}, -{18141, -3229}, -{18134, -3272}, -{18126, -3316}, -{18118, -3359}, -{18109, -3403}, -{18101, -3446}, -{18094, -3489}, -{18085, -3533}, -{18076, -3576}, -{18068, -3619}, -{18059, -3663}, -{18050, -3706}, -{18041, -3749}, -{18032, -3792}, -{18023, -3836}, -{18014, -3879}, -{18005, -3922}, -{17995, -3965}, -{17986, -4008}, -{17975, -4051}, -{17966, -4094}, -{17956, -4138}, -{17946, -4180}, -{17936, -4224}, -{17926, -4266}, -{17916, -4309}, -{17905, -4353}, -{17895, -4395}, -{17884, -4438}, -{17874, -4481}, -{17863, -4524}, -{17852, -4567}, -{17841, -4609}, -{17830, -4652}, -{17819, -4695}, -{17807, -4738}, -{17796, -4780}, -{17784, -4823}, -{17772, -4865}, -{17761, -4908}, -{17749, -4951}, -{17738, -4993}, -{17725, -5036}, -{17713, -5078}, -{17701, -5121}, -{17689, -5163}, -{17676, -5205}, -{17664, -5248}, -{17651, -5290}, -{17638, -5333}, -{17626, -5375}, -{17613, -5417}, -{17599, -5459}, -{17586, -5501}, -{17573, -5544}, -{17560, -5586}, -{17546, -5627}, -{17533, -5670}, -{17519, -5712}, -{17505, -5753}, -{17492, -5795}, -{17478, -5837}, -{17464, -5879}, -{17450, -5921}, -{17435, -5963}, -{17421, -6005}, -{17406, -6046}, -{17392, -6088}, -{17377, -6130}, -{17363, -6172}, -{17348, -6213}, -{17333, -6254}, -{17318, -6296}, -{17303, -6338}, -{17288, -6379}, -{17272, -6420}, -{17257, -6462}, -{17241, -6503}, -{17225, -6545}, -{17210, -6586}, -{17194, -6627}, -{17178, -6668}, -{17162, -6709}, -{17145, -6750}, -{17130, -6791}, -{17113, -6832}, -{17097, -6874}, -{17080, -6915}, -{17064, -6956}, -{17047, -6996}, -{17030, -7037}, -{17013, -7078}, -{16996, -7119}, -{16979, -7159}, -{16962, -7200}, -{16945, -7241}, -{16927, -7281}, -{16910, -7322}, -{16892, -7362}, -{16874, -7403}, -{16856, -7444}, -{16838, -7484}, -{16821, -7524}, -{16802, -7564}, -{16784, -7605}, -{16766, -7645}, -{16748, -7685}, -{16729, -7725}, -{16711, -7765}, -{16692, -7805}, -{16674, -7845}, -{16654, -7885}, -{16635, -7925}, -{16616, -7964}, -{16597, -8004}, -{16578, -8044}, -{16559, -8084}, -{16539, -8124}, -{16520, -8164}, -{16500, -8203}, -{16480, -8242}, -{16461, -8282}, -{16441, -8322}, -{16421, -8361}, -{16401, -8400}, -{16380, -8440}, -{16360, -8479}, -{16340, -8518}, -{16319, -8557}, -{16299, -8597}, -{16278, -8635}, -{16257, -8674}, -{16237, -8713}, -{16215, -8752}, -{16195, -8791}, -{16173, -8829}, -{16152, -8868}, -{16131, -8907}, -{16110, -8946}, -{16088, -8985}, -{16067, -9023}, -{16045, -9061}, -{16023, -9100}, -{16001, -9138}, -{15979, -9176}, -{15957, -9215}, -{15935, -9253}, -{15913, -9291}, -{15891, -9329}, -{15868, -9367}, -{15846, -9405}, -{15823, -9443}, -{15800, -9481}, -{15778, -9519}, -{15755, -9557}, -{15732, -9595}, -{15709, -9632}, -{15686, -9670}, -{15662, -9708}, -{15639, -9745}, -{15615, -9782}, -{15592, -9820}, -{15569, -9857}, -{15544, -9894}, -{15521, -9932}, -{15497, -9969}, -{15473, -10006}, -{15449, -10043}, -{15425, -10080}, -{15401, -10117}, -{15377, -10154}, -{15352, -10191}, -{15327, -10227}, -{15303, -10264}, -{15278, -10301}, -{15254, -10337}, -{15229, -10374}, -{15204, -10411}, -{15180, -10447}, -{15154, -10483}, -{15129, -10519}, -{15104, -10556}, -{15078, -10592}, -{15053, -10628}, -{15027, -10664}, -{15002, -10700}, -{14976, -10736}, -{14950, -10772}, -{14924, -10808}, -{14898, -10844}, -{14872, -10879}, -{14846, -10915}, -{14820, -10950}, -{14794, -10985}, -{14767, -11021}, -{14741, -11056}, -{14714, -11092}, -{14687, -11127}, -{14661, -11162}, -{14635, -11197}, -{14607, -11232}, -{14581, -11267}, -{14554, -11302}, -{14526, -11337}, -{14499, -11372}, -{14472, -11407}, -{14444, -11441}, -{14417, -11476}, -{14389, -11511}, -{14362, -11545}, -{14334, -11579}, -{14306, -11614}, -{14278, -11648}, -{14251, -11682}, -{14222, -11716}, -{14194, -11750}, -{14166, -11784}, -{14137, -11818}, -{14109, -11852}, -{14081, -11886}, -{14053, -11919}, -{14023, -11953}, -{13995, -11987}, -{13966, -12020}, -{13937, -12054}, -{13909, -12087}, -{13879, -12120}, -{13851, -12153}, -{13821, -12187}, -{13792, -12220}, -{13763, -12253}, -{13733, -12286}, -{13704, -12319}, -{13674, -12351}, -{13645, -12385}, -{13615, -12417}, -{13585, -12450}, -{13555, -12482}, -{13525, -12514}, -{13495, -12546}, -{13465, -12579}, -{13435, -12611}, -{13405, -12644}, -{13374, -12676}, -{13345, -12708}, -{13314, -12739}, -{13283, -12772} -}; - - - -cos_msin_t *s_cos_msin_table[] = {s_cos_msin_2, s_cos_msin_4, - s_cos_msin_8, s_cos_msin_16, - s_cos_msin_32, s_cos_msin_64 - }; - diff --git a/third_party/g7221/decode/decoder.c b/third_party/g7221/decode/decoder.c deleted file mode 100644 index ab81a30..0000000 --- a/third_party/g7221/decode/decoder.c +++ /dev/null @@ -1,1113 +0,0 @@ -/*************************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -***************************************************************************/ - -/*************************************************************************** - Filename: decoder.c - - Purpose: Contains files used to implement the G.722.1 Annex C decoder - - Design Notes: - -***************************************************************************/ - -/*************************************************************************** - Include files -***************************************************************************/ -#include "defs.h" -#include "tables.h" -#include "huff_def.h" -#include "count.h" - - -/*************************************************************************** - Function: decoder - - Syntax: void decoder(Bit_Obj *bitobj, - Rand_Obj *randobj, - Word16 number_of_regions, - Word16 *decoder_mlt_coefs, - Word16 *p_mag_shift, - Word16 *p_old_mag_shift, - Word16 *old_decoder_mlt_coefs, - Word16 frame_error_flag) - - inputs: Bit_Obj *bitobj - Rand_Obj *randobj - Word16 number_of_regions - Word16 *p_old_mag_shift - Word16 *old_decoder_mlt_coefs - Word16 frame_error_flag - - outputs: Word16 *decoder_mlt_coefs, - Word16 *p_mag_shift, - - - - Description: Decodes the out_words into mlt coefs using G.722.1 Annex C - - Design Notes: - - WMOPS: 7kHz | 24kbit | 32kbit - -------|-------------|---------------- - AVG | 0.84 | 0.94 - -------|-------------|---------------- - MAX | 0.90 | 1.00 - -------|-------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|-------------|----------------|---------------- - AVG | 1.31 | 1.56 | 1.88 - -------|-------------|----------------|---------------- - MAX | 1.59 | 1.80 | 1.98 - -------|-------------|----------------|---------------- - -***************************************************************************/ -void decoder(Bit_Obj *bitobj, - Rand_Obj *randobj, - Word16 number_of_regions, - Word16 *decoder_mlt_coefs, - Word16 *p_mag_shift, - Word16 *p_old_mag_shift, - Word16 *old_decoder_mlt_coefs, - Word16 frame_error_flag) -{ - - - Word16 absolute_region_power_index[MAX_NUMBER_OF_REGIONS]; - Word16 decoder_power_categories[MAX_NUMBER_OF_REGIONS]; - Word16 decoder_category_balances[MAX_NUM_CATEGORIZATION_CONTROL_POSSIBILITIES-1]; - UWord16 categorization_control; - Word16 decoder_region_standard_deviation[MAX_NUMBER_OF_REGIONS]; - Word16 i; - - Word16 num_categorization_control_bits; - Word16 num_categorization_control_possibilities; - Word16 number_of_coefs; - Word16 number_of_valid_coefs; - - - test(); - if (number_of_regions==NUMBER_OF_REGIONS) - { - num_categorization_control_bits = NUM_CATEGORIZATION_CONTROL_BITS; - move16(); - num_categorization_control_possibilities = NUM_CATEGORIZATION_CONTROL_POSSIBILITIES; - move16(); - number_of_coefs = DCT_LENGTH; - move16(); - number_of_valid_coefs = NUMBER_OF_VALID_COEFS; - move16(); - } - else - { - num_categorization_control_bits = MAX_NUM_CATEGORIZATION_CONTROL_BITS; - move16(); - num_categorization_control_possibilities = MAX_NUM_CATEGORIZATION_CONTROL_POSSIBILITIES; - move16(); - number_of_coefs = MAX_DCT_LENGTH; - move16(); - number_of_valid_coefs = MAX_NUMBER_OF_VALID_COEFS; - move16(); - } - - test(); - if (frame_error_flag == 0) - { - - /* convert the bits to absolute region power index and decoder_region_standard_deviation */ - - decode_envelope(bitobj, - number_of_regions, - decoder_region_standard_deviation, - absolute_region_power_index, - p_mag_shift); - - /* fill the categorization_control with NUM_CATEGORIZATION_CONTROL_BITS */ - categorization_control = 0; - for (i=0; inext_bit); - } - - bitobj->number_of_bits_left = sub(bitobj->number_of_bits_left,num_categorization_control_bits); - - /* obtain decoder power categories and category balances */ - /* based on the absolute region power index */ - categorize(bitobj->number_of_bits_left, - number_of_regions, - num_categorization_control_possibilities, - absolute_region_power_index, - decoder_power_categories, - decoder_category_balances); - - /* perform adjustmaents to the power categories and category balances based on the cat control */ - rate_adjust_categories(categorization_control, - decoder_power_categories, - decoder_category_balances); - - /* decode the quantized bits into mlt coefs */ - decode_vector_quantized_mlt_indices(bitobj, - randobj, - number_of_regions, - decoder_region_standard_deviation, - decoder_power_categories, - decoder_mlt_coefs); - - /* test for frame errors */ - test_4_frame_errors(bitobj, - number_of_regions, - num_categorization_control_possibilities, - &frame_error_flag, - categorization_control, - absolute_region_power_index); - } - - /* perform error handling operations */ - error_handling(number_of_coefs, - number_of_valid_coefs, - &frame_error_flag, - decoder_mlt_coefs, - old_decoder_mlt_coefs, - p_mag_shift, - p_old_mag_shift); - -} - -/*************************************************************************** - Function: decode_envelope - - Syntax: void decode_envelope(Bit_Obj *bitobj, - Word16 number_of_regions, - Word16 *decoder_region_standard_deviation, - Word16 *absolute_region_power_index, - Word16 *p_mag_shift) - - inputs: Bit_Obj *bitobj - Word16 number_of_regions - - - outputs: Word16 *decoder_region_standard_deviation - Word16 *absolute_region_power_index - Word16 *p_mag_shift - - - Description: Recover differential_region_power_index from code bits - - Design Notes: - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.04 | 0.04 - -------|--------------|---------------- - MAX | 0.05 | 0.05 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 0.08 | 0.08 | 0.08 - -------|--------------|----------------|---------------- - MAX | 0.10 | 0.10 | 0.10 - -------|--------------|----------------|---------------- - -***************************************************************************/ -void decode_envelope(Bit_Obj *bitobj, - Word16 number_of_regions, - Word16 *decoder_region_standard_deviation, - Word16 *absolute_region_power_index, - Word16 *p_mag_shift) - -{ - Word16 region; - Word16 i; - Word16 index; - Word16 differential_region_power_index[MAX_NUMBER_OF_REGIONS]; - Word16 max_index; - - Word16 temp; - Word16 temp1; - Word16 temp2; - Word32 acca; - - index = 0; - move16(); - - /* get 5 bits from the current code word */ - for (i=0; i<5; i++) - { - get_next_bit(bitobj); - index = shl_nocheck(index,1); - index = add(index,bitobj->next_bit); - } - bitobj->number_of_bits_left = sub(bitobj->number_of_bits_left,5); - - /* ESF_ADJUSTMENT_TO_RMS_INDEX compensates for the current (9/30/96) - IMLT being scaled to high by the ninth power of sqrt(2). */ - differential_region_power_index[0] = sub(index,ESF_ADJUSTMENT_TO_RMS_INDEX); - move16(); - - /* obtain differential_region_power_index */ - for (region=1; regionnext_bit == 0) - { - index = differential_region_power_decoder_tree[region][index][0]; - move16(); - } - else - { - index = differential_region_power_decoder_tree[region][index][1]; - move16(); - } - bitobj->number_of_bits_left = sub(bitobj->number_of_bits_left,1); - test(); - } while (index > 0); - - differential_region_power_index[region] = negate(index); - move16(); - } - - /* Reconstruct absolute_region_power_index[] from differential_region_power_index[]. */ - absolute_region_power_index[0] = differential_region_power_index[0]; - move16(); - for (region=1; region 0) - { - max_index = i; - move16(); - } - temp = add(temp,int_region_standard_deviation_table[i]); - } - i = 9; - move16(); - - temp1 = sub(temp,8); - temp2 = sub(max_index,28); - test(); - test(); - logic16(); - test(); - logic16(); - while ((i >= 0) && ((temp1 >= 0) || (temp2 > 0))) - { - i = sub(i,1); - temp = shr_nocheck(temp,1); - max_index = sub(max_index,2); - temp1 = sub(temp,8); - temp2 = sub(max_index,28); - test(); - test(); - logic16(); - test(); - logic16(); - } - - *p_mag_shift = i; - move16(); - - /* pointer arithmetic */ - temp = (Word16 )(REGION_POWER_TABLE_NUM_NEGATIVES + (*p_mag_shift * 2)); - - for (region=0; region 0) - { - region = decoder_category_balances[i++]; - move16(); - decoder_power_categories[region] = add(decoder_power_categories[region],1); - move16(); - categorization_control = sub(categorization_control,1); - } - -} - -/*************************************************************************** - Function: decode_vector_quantized_mlt_indices - - Syntax: void decode_vector_quantized_mlt_indices(Bit_Obj *bitobj, - Rand_Obj *randobj, - Word16 number_of_regions, - Word16 *decoder_region_standard_deviation, - Word16 *decoder_power_categories, - Word16 *decoder_mlt_coefs) - inputs: Bit_Obj *bitobj - Rand_Obj *randobj - Word16 number_of_regions - Word16 *decoder_region_standard_deviation - Word16 *decoder_power_categories - - - outputs: Word16 *decoder_mlt_coefs - - - Description: Decode MLT coefficients - - Design Notes: - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.60 | 0.72 - -------|--------------|---------------- - MAX | 0.67 | 0.76 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 0.77 | 0.98 | 1.28 - -------|--------------|----------------|---------------- - MAX | 1.05 | 1.18 | 1.36 - -------|--------------|----------------|---------------- - -***************************************************************************/ -void decode_vector_quantized_mlt_indices(Bit_Obj *bitobj, - Rand_Obj *randobj, - Word16 number_of_regions, - Word16 *decoder_region_standard_deviation, - Word16 *decoder_power_categories, - Word16 *decoder_mlt_coefs) -{ - Word16 standard_deviation; - Word16 *decoder_mlt_ptr; - Word16 decoder_mlt_value; - Word16 noifillpos; - Word16 noifillneg; - Word16 noise_fill_factor[3] = {5793,8192,23170}; - Word16 region; - Word16 category; - Word16 j,n; - Word16 k[MAX_VECTOR_DIMENSION]; - Word16 vec_dim; - Word16 num_vecs; - Word16 index; - Word16 bit=0; - Word16 signs_index=0; - Word16 num_sign_bits; - Word16 ran_out_of_bits_flag; - Word16 *decoder_table_ptr; - Word16 random_word; - - Word16 temp1; - Word16 temp; - Word32 acca; - - ran_out_of_bits_flag = 0; - move16(); - - for (region=0; regionnumber_of_bits_left <= 0) - { - ran_out_of_bits_flag = 1; - move16(); - break; - } - - get_next_bit(bitobj); - - test(); - if (bitobj->next_bit == 0) - { - temp = shl_nocheck(index,1); - index = (Word16)*(decoder_table_ptr + temp); - move16(); - } - else - { - temp = shl_nocheck(index,1); - index = (Word16)*(decoder_table_ptr + temp + 1); - move16(); - } - bitobj->number_of_bits_left = sub(bitobj->number_of_bits_left,1); - test(); - - } while (index > 0); - - test(); - if (ran_out_of_bits_flag != 0) - break; - - index = negate(index); - - /* convert index into array used to access the centroid table */ - /* get the number of sign bits in the index */ - num_sign_bits = index_to_array(index,k,category); - - temp = sub(bitobj->number_of_bits_left,num_sign_bits); - test(); - if (temp >= 0) - { - - test(); - if (num_sign_bits != 0) - { - signs_index = 0; - move16(); - for (j=0; jnext_bit); - bitobj->number_of_bits_left = sub(bitobj->number_of_bits_left,1); - } - temp = sub(num_sign_bits,1); - bit = shl_nocheck(1,(temp)); - } - - for (j=0; jnumber_of_bits_left = sub(bitobj->number_of_bits_left,1); -} -/**************************************************************************************** - Function: index_to_array - - Syntax: number_of_non_zero = index_to_array(Word16 index, - Word16 array[MAX_VECTOR_DIMENSION], - Word16 category) - - inputs: Word16 index - Word16 category - - outputs: Word16 array[MAX_VECTOR_DIMENSION] - used in decoder to access - mlt_quant_centroid table - - Word16 number_of_non_zero - number of non zero elements - in the array - - Description: Computes an array of sign bits with the length of the category vector - Returns the number of sign bits and the array - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.00 | 0.00 - -------|--------------|---------------- - MAX | 0.00 | 0.00 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 0.00 | 0.00 | 0.00 - -------|--------------|----------------|---------------- - MAX | 0.00 | 0.00 | 0.00 - -------|--------------|----------------|---------------- - -****************************************************************************************/ -Word16 index_to_array(Word16 index,Word16 *array,Word16 category) -{ - Word16 j,q,p; - Word16 number_of_non_zero; - Word16 max_bin_plus_one; - Word16 inverse_of_max_bin_plus_one; - Word16 temp; - - number_of_non_zero = 0; - move16(); - - p = index; - move16(); - - max_bin_plus_one = add(max_bin[category],1); - inverse_of_max_bin_plus_one = max_bin_plus_one_inverse[category]; - move16(); - - temp = sub(vector_dimension[category],1); - for (j=temp; j>=0; j--) - { - q = mult(p,inverse_of_max_bin_plus_one); - temp = extract_l(L_mult0(q,max_bin_plus_one)); - array[j] = sub(p,temp); - move16(); - - p = q; - move16(); - - temp = array[j]; - move16(); - test(); - if (temp != 0) - number_of_non_zero = add(number_of_non_zero,1); - } - return(number_of_non_zero); -} -/*************************************************************************** - Function: test_4_frame_errors - - Syntax: void test_4_frame_errors(Bit_Obj *bitobj, - Word16 number_of_regions, - Word16 num_categorization_control_possibilities, - Word16 *frame_error_flag, - Word16 categorization_control, - Word16 *absolute_region_power_index) - - inputs: bit_obj - number_of_regions - num_categorization_control_possibilities - frame_error_flag - categorization_control - absolute_region_power_index - - - outputs: frame_error_flag - - - - - Description: Tests for error conditions and sets the frame_error_flag accordingly - - Design Notes: - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.01 | 0.01 - -------|--------------|---------------- - MAX | 0.04 | 0.08 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 0.01 | 0.01 | 0.01 - -------|--------------|----------------|---------------- - MAX | 0.02 | 0.06 | 0.08 - -------|--------------|----------------|---------------- - -***************************************************************************/ -void test_4_frame_errors(Bit_Obj *bitobj, - Word16 number_of_regions, - Word16 num_categorization_control_possibilities, - Word16 *frame_error_flag, - Word16 categorization_control, - Word16 *absolute_region_power_index) -{ - Word16 region; - Word16 i; - Word16 temp; - Word32 acca; - Word32 accb; - - /* Test for bit stream errors. */ - - test(); - if (bitobj->number_of_bits_left > 0) - { - for (i=0; inumber_of_bits_left; i++) - { - get_next_bit(bitobj); - test(); - if (bitobj->next_bit == 0) - { - *frame_error_flag = 1; - move16(); - } - } - } - else - { - temp = sub(categorization_control,sub(num_categorization_control_possibilities,1)); - test(); - if (temp < 0) - { - test(); - if (bitobj->number_of_bits_left < 0) - { - *frame_error_flag |= 2; - logic16(); - } - } - } - - /* checks to ensure that abs_region_power_index is within range */ - /* the error flag is set if it is out of range */ - for (region=0; region 31) || - (absolute_region_power_index[region] < -8) */ - - acca = L_add(absolute_region_power_index[region],ESF_ADJUSTMENT_TO_RMS_INDEX); - accb = L_sub(acca,31); - acca = L_add(acca,8); - test(); - - /* the next line was modifed in release 1.2 to - * correct miss typed code and error checking. - */ - if ((accb > 0) || (acca < 0)) - { - *frame_error_flag |= 4; - logic16(); - } - } - -} -/*************************************************************************** - Function: error_handling - - Syntax: void error_handling(Word16 number_of_coefs, - Word16 number_of_valid_coefs, - Word16 *frame_error_flag, - Word16 *decoder_mlt_coefs, - Word16 *old_decoder_mlt_coefs, - Word16 *p_mag_shift, - Word16 *p_old_mag_shift) - - inputs: number_of_coefs - number_of_valid_coefs - frame_error_flag - old_decoder_mlt_coefs - p_old_mag_shift - - - outputs: decoder_mlt_coefs - old_decoder_mlt_coefs - p_mag_shift - p_old_mag_shift - - - - Description: If both the current and previous frames are errored, - set the mlt coefficients to 0. If only the current frame - is errored, then repeat the previous frame's mlt coefficients. - - Design Notes: - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.02 | 0.02 - -------|--------------|---------------- - MAX | 0.03 | 0.03 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 0.03 | 0.03 | 0.03 - -------|--------------|----------------|---------------- - MAX | 0.03 | 0.03 | 0.06 - -------|--------------|----------------|---------------- - -***************************************************************************/ -void error_handling(Word16 number_of_coefs, - Word16 number_of_valid_coefs, - Word16 *frame_error_flag, - Word16 *decoder_mlt_coefs, - Word16 *old_decoder_mlt_coefs, - Word16 *p_mag_shift, - Word16 *p_old_mag_shift) -{ - Word16 i; - - test(); - if (*frame_error_flag != 0) - { - - for (i = 0; i < number_of_valid_coefs; i++) - { - decoder_mlt_coefs[i] = old_decoder_mlt_coefs[i]; - move16(); - } - - for (i = 0; i < number_of_valid_coefs; i++) - { - old_decoder_mlt_coefs[i] = 0; - move16(); - } - - *p_mag_shift = *p_old_mag_shift; - move16(); - - *p_old_mag_shift = 0; - move16(); - } - else - { - /* Store in case next frame is errored. */ - for (i = 0; i < number_of_valid_coefs; i++) - { - old_decoder_mlt_coefs[i] = decoder_mlt_coefs[i]; - move16(); - } - - *p_old_mag_shift = *p_mag_shift; - move16(); - } - - - /* Zero out the upper 1/8 of the spectrum. */ - for (i = number_of_valid_coefs; i < number_of_coefs; i++) - { - decoder_mlt_coefs[i] = 0; - move16(); - } - -} -/**************************************************************************************** - Function: get_next_bit - - Syntax: void get_next_bit(Bit_Obj *bitobj) - - Description: Returns the next bit in the current word inside the bit object - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.00 | 0.00 - -------|--------------|---------------- - MAX | 0.00 | 0.00 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 0.00 | 0.00 | 0.00 - -------|--------------|----------------|---------------- - MAX | 0.00 | 0.00 | 0.00 - -------|--------------|----------------|---------------- - -****************************************************************************************/ -void get_next_bit(Bit_Obj *bitobj) -{ - Word16 temp; - - test(); - if (bitobj->code_bit_count == 0) - { - bitobj->current_word = *bitobj->code_word_ptr++; - move16(); - bitobj->code_bit_count = 16; - move16(); - } - bitobj->code_bit_count = sub(bitobj->code_bit_count,1); - temp = shr_nocheck(bitobj->current_word,bitobj->code_bit_count); - logic16(); - bitobj->next_bit = (Word16 )(temp & 1); - -} -/**************************************************************************************** - Function: get_rand - - Syntax: Word16 get_rand(Rand_Obj *randobj) - - Description: Returns a random Word16 based on the seeds inside the rand object - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.00 | 0.00 - -------|--------------|---------------- - MAX | 0.00 | 0.00 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 0.00 | 0.00 | 0.00 - -------|--------------|----------------|---------------- - MAX | 0.00 | 0.00 | 0.00 - -------|--------------|----------------|---------------- - -****************************************************************************************/ -Word16 get_rand(Rand_Obj *randobj) -{ - Word16 random_word; - Word32 acca; - - acca = L_add(randobj->seed0,randobj->seed3); - random_word = extract_l(acca); - - logic16(); - test(); - if ((random_word & 32768L) != 0) - random_word = add(random_word,1); - - randobj->seed3 = randobj->seed2; - move16(); - randobj->seed2 = randobj->seed1; - move16(); - randobj->seed1 = randobj->seed0; - move16(); - randobj->seed0 = random_word; - move16(); - - return(random_word); -} diff --git a/third_party/g7221/encode/dct4_a.c b/third_party/g7221/encode/dct4_a.c deleted file mode 100644 index 94ddf9f..0000000 --- a/third_party/g7221/encode/dct4_a.c +++ /dev/null @@ -1,367 +0,0 @@ -/********************************************************************************* -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -*********************************************************************************/ - -/********************************************************************************* -* Filename: dct_type_iv_a.c -* -* Purpose: Discrete Cosine Transform, Type IV used for MLT -* -* The basis functions are -* -* cos(PI*(t+0.5)*(k+0.5)/block_length) -* -* for time t and basis function number k. Due to the symmetry of the expression -* in t and k, it is clear that the forward and inverse transforms are the same. -* -*********************************************************************************/ - -/********************************************************************************* - Include files -*********************************************************************************/ -#include "defs.h" -#include "count.h" -#include "dct4_a.h" - -/********************************************************************************* - External variable declarations -*********************************************************************************/ -extern Word16 anal_bias[DCT_LENGTH]; -extern Word16 dct_core_a[DCT_LENGTH_DIV_32][DCT_LENGTH_DIV_32]; -extern cos_msin_t a_cos_msin_2 [DCT_LENGTH_DIV_32]; -extern cos_msin_t a_cos_msin_4 [DCT_LENGTH_DIV_16]; -extern cos_msin_t a_cos_msin_8 [DCT_LENGTH_DIV_8]; -extern cos_msin_t a_cos_msin_16[DCT_LENGTH_DIV_4]; -extern cos_msin_t a_cos_msin_32[DCT_LENGTH_DIV_2]; -extern cos_msin_t a_cos_msin_64[DCT_LENGTH]; -extern cos_msin_t *a_cos_msin_table[]; - -/********************************************************************************* - Function: dct_type_iv_a - - Syntax: void dct_type_iv_a (input, output, dct_length) - Word16 input[], output[], dct_length; - - Description: Discrete Cosine Transform, Type IV used for MLT - - Design Notes: - - WMOPS: | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 1.14 | 1.14 - -------|--------------|---------------- - MAX | 1.14 | 1.14 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 2.57 | 2.57 | 2.57 - -------|--------------|----------------|---------------- - MAX | 2.57 | 2.57 | 2.57 - -------|--------------|----------------|---------------- - -*********************************************************************************/ - -void dct_type_iv_a (Word16 *input,Word16 *output,Word16 dct_length) -{ - Word16 buffer_a[MAX_DCT_LENGTH], buffer_b[MAX_DCT_LENGTH], buffer_c[MAX_DCT_LENGTH]; - Word16 *in_ptr, *in_ptr_low, *in_ptr_high, *next_in_base; - Word16 *out_ptr_low, *out_ptr_high, *next_out_base; - Word16 *out_buffer, *in_buffer, *buffer_swap; - Word16 in_val_low, in_val_high; - Word16 out_val_low, out_val_high; - Word16 in_low_even, in_low_odd; - Word16 in_high_even, in_high_odd; - Word16 out_low_even, out_low_odd; - Word16 out_high_even, out_high_odd; - Word16 *pair_ptr; - Word16 cos_even, cos_odd, msin_even, msin_odd; - Word16 neg_cos_odd; - Word16 neg_msin_even; - Word32 sum; - Word16 set_span, set_count, set_count_log, pairs_left, sets_left; - Word16 i,k; - Word16 index; - cos_msin_t **table_ptr_ptr, *cos_msin_ptr; - - Word16 temp; - Word32 acca; - - Word16 dct_length_log; - - - /*++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - /* Do the sum/difference butterflies, the first part of */ - /* converting one N-point transform into N/2 two-point */ - /* transforms, where N = 1 << DCT_LENGTH_LOG. = 64/128 */ - /*++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - test(); - if (dct_length==DCT_LENGTH) - { - dct_length_log = DCT_LENGTH_LOG; - - /* Add bias offsets */ - for (i=0;i0;sets_left--) - { - - /*||||||||||||||||||||||||||||||||||||||||||||*/ - /* Set up output pointers for the current set */ - /*||||||||||||||||||||||||||||||||||||||||||||*/ - - out_ptr_low = next_out_base; - next_out_base = next_out_base + set_span; - out_ptr_high = next_out_base; - - /*||||||||||||||||||||||||||||||||||||||||||||||||||*/ - /* Loop over all the butterflies in the current set */ - /*||||||||||||||||||||||||||||||||||||||||||||||||||*/ - - do - { - in_val_low = *in_ptr++; - in_val_high = *in_ptr++; - // blp: addition of two 16bits vars, there's no way - // they'll overflow a 32bit var - //acca = L_add(in_val_low,in_val_high); - acca = (in_val_low + in_val_high); - acca = L_shr_nocheck(acca,1); - out_val_low = extract_l(acca); - - acca = L_sub(in_val_low,in_val_high); - acca = L_shr_nocheck(acca,1); - out_val_high = extract_l(acca); - - *out_ptr_low++ = out_val_low; - *--out_ptr_high = out_val_high; - - test(); - } while (out_ptr_low < out_ptr_high); - - } /* End of loop over sets of the current size */ - - /*============================================================*/ - /* Decide which buffers to use as input and output next time. */ - /* Except for the first time (when the input buffer is the */ - /* subroutine input) we just alternate the local buffers. */ - /*============================================================*/ - - in_buffer = out_buffer; - move16(); - if (out_buffer == buffer_a) - out_buffer = buffer_b; - else - out_buffer = buffer_a; - index = add(index,1); - - } /* End of loop over set sizes */ - - - /*++++++++++++++++++++++++++++++++*/ - /* Do N/2 two-point transforms, */ - /* where N = 1 << DCT_LENGTH_LOG */ - /*++++++++++++++++++++++++++++++++*/ - - pair_ptr = in_buffer; - move16(); - - buffer_swap = buffer_c; - move16(); - - temp = sub(dct_length_log,1); - temp = shl_nocheck(1,temp); - - for (pairs_left=temp; pairs_left > 0; pairs_left--) - { - for ( k=0; k= 0; set_count_log--) - { - /*===========================================================*/ - /* Initialization for the loop over sets at the current size */ - /*===========================================================*/ - /* set_span = 1 << (DCT_LENGTH_LOG - set_count_log); */ - set_span = shr_nocheck(dct_length,set_count_log); - - set_count = shl_nocheck(1,set_count_log); - next_in_base = in_buffer; - move16(); - - test(); - if (set_count_log == 0) - { - next_out_base = output; - } - else - { - next_out_base = out_buffer; - } - - - /*=====================================*/ - /* Loop over all the sets of this size */ - /*=====================================*/ - for (sets_left = set_count; sets_left > 0;sets_left--) - { - /*|||||||||||||||||||||||||||||||||||||||||*/ - /* Set up the pointers for the current set */ - /*|||||||||||||||||||||||||||||||||||||||||*/ - in_ptr_low = next_in_base; - move16(); - temp = shr_nocheck(set_span,1); - - /* address arithmetic */ - in_ptr_high = in_ptr_low + temp; - next_in_base += set_span; - out_ptr_low = next_out_base; - next_out_base += set_span; - out_ptr_high = next_out_base; - cos_msin_ptr = *table_ptr_ptr; - - /*||||||||||||||||||||||||||||||||||||||||||||||||||||||*/ - /* Loop over all the butterfly pairs in the current set */ - /*||||||||||||||||||||||||||||||||||||||||||||||||||||||*/ - - do - { - /* address arithmetic */ - in_low_even = *in_ptr_low++; - in_low_odd = *in_ptr_low++; - in_high_even = *in_ptr_high++; - in_high_odd = *in_ptr_high++; - cos_even = cos_msin_ptr[0].cosine; - move16(); - msin_even = cos_msin_ptr[0].minus_sine; - move16(); - cos_odd = cos_msin_ptr[1].cosine; - move16(); - msin_odd = cos_msin_ptr[1].minus_sine; - move16(); - cos_msin_ptr += 2; - - sum = 0L; - sum=L_mac(sum,cos_even,in_low_even); - neg_msin_even = negate(msin_even); - sum=L_mac(sum,neg_msin_even,in_high_even); - out_low_even = itu_round(sum); - - sum = 0L; - sum=L_mac(sum,msin_even,in_low_even); - sum=L_mac(sum,cos_even,in_high_even); - out_high_even= itu_round(sum); - - sum = 0L; - sum=L_mac(sum,cos_odd,in_low_odd); - sum=L_mac(sum,msin_odd,in_high_odd); - out_low_odd= itu_round(sum); - - sum = 0L; - sum=L_mac(sum,msin_odd,in_low_odd); - neg_cos_odd = negate(cos_odd); - sum=L_mac(sum,neg_cos_odd,in_high_odd); - out_high_odd= itu_round(sum); - - *out_ptr_low++ = out_low_even; - *--out_ptr_high = out_high_even; - *out_ptr_low++ = out_low_odd; - *--out_ptr_high = out_high_odd; - test(); - } while (out_ptr_low < out_ptr_high); - - } /* End of loop over sets of the current size */ - - /*=============================================*/ - /* Swap input and output buffers for next time */ - /*=============================================*/ - - buffer_swap = in_buffer; - in_buffer = out_buffer; - out_buffer = buffer_swap; - table_ptr_ptr++; - } -} - diff --git a/third_party/g7221/encode/dct4_a.h b/third_party/g7221/encode/dct4_a.h deleted file mode 100644 index 74f3d93..0000000 --- a/third_party/g7221/encode/dct4_a.h +++ /dev/null @@ -1,728 +0,0 @@ -/**************************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -****************************************************************************/ - -/**************************************************************************** - Filename: dct4_a.h - - Purpose: Contains tables used by dct4_a.c - - Design Notes: - -****************************************************************************/ - -/*************************************************************************** - Include files -***************************************************************************/ -#include -#include - -typedef struct -{ - Word16 cosine; - Word16 minus_sine; -} cos_msin_t; - -cos_msin_t a_cos_msin_2[10] = { - { 29805 , -1171 } , - { 29621 , -3506 } , - { 29255 , -5819 } , - { 28708 , -8097 } , - { 27984 , -10324 } , - { 27088 , -12488 } , - { 26025 , -14575 } , - { 24801 , -16572 } , - { 23425 , -18466 } , - { 21903 , -20247 } - }; -cos_msin_t a_cos_msin_4[20] = { - { 29822 , -586 } , - { 29776 , -1756 } , - { 29684 , -2924 } , - { 29547 , -4087 } , - { 29364 , -5244 } , - { 29135 , -6392 } , - { 28862 , -7531 } , - { 28544 , -8659 } , - { 28182 , -9773 } , - { 27776 , -10871 } , - { 27328 , -11954 } , - { 26838 , -13017 } , - { 26306 , -14061 } , - { 25734 , -15083 } , - { 25122 , -16081 } , - { 24471 , -17055 } , - { 23783 , -18003 } , - { 23057 , -18923 } , - { 22297 , -19813 } , - { 21502 , -20673 } - }; -cos_msin_t a_cos_msin_8[40] = { - { 29827 , -293 } , - { 29815 , -878 } , - { 29792 , -1464 } , - { 29758 , -2048 } , - { 29712 , -2632 } , - { 29654 , -3215 } , - { 29586 , -3797 } , - { 29505 , -4377 } , - { 29414 , -4955 } , - { 29311 , -5532 } , - { 29196 , -6106 } , - { 29071 , -6678 } , - { 28934 , -7248 } , - { 28786 , -7814 } , - { 28627 , -8378 } , - { 28457 , -8938 } , - { 28276 , -9495 } , - { 28084 , -10049 } , - { 27882 , -10598 } , - { 27668 , -11144 } , - { 27444 , -11685 } , - { 27209 , -12221 } , - { 26964 , -12753 } , - { 26709 , -13280 } , - { 26443 , -13802 } , - { 26167 , -14318 } , - { 25881 , -14829 } , - { 25584 , -15335 } , - { 25278 , -15834 } , - { 24963 , -16327 } , - { 24637 , -16814 } , - { 24302 , -17295 } , - { 23958 , -17769 } , - { 23605 , -18236 } , - { 23242 , -18695 } , - { 22871 , -19148 } , - { 22490 , -19594 } , - { 22101 , -20031 } , - { 21704 , -20461 } , - { 21298 , -20884 } - }; -cos_msin_t a_cos_msin_16[80] = { - { 29828 , -146 } , - { 29825 , -439 } , - { 29819 , -732 } , - { 29811 , -1025 } , - { 29799 , -1317 } , - { 29785 , -1610 } , - { 29767 , -1902 } , - { 29747 , -2194 } , - { 29724 , -2486 } , - { 29698 , -2778 } , - { 29670 , -3069 } , - { 29638 , -3360 } , - { 29604 , -3651 } , - { 29567 , -3942 } , - { 29526 , -4232 } , - { 29483 , -4521 } , - { 29438 , -4811 } , - { 29389 , -5099 } , - { 29338 , -5388 } , - { 29283 , -5676 } , - { 29226 , -5963 } , - { 29166 , -6249 } , - { 29103 , -6535 } , - { 29038 , -6821 } , - { 28969 , -7106 } , - { 28898 , -7390 } , - { 28824 , -7673 } , - { 28748 , -7956 } , - { 28668 , -8237 } , - { 28586 , -8518 } , - { 28501 , -8799 } , - { 28413 , -9078 } , - { 28323 , -9357 } , - { 28229 , -9634 } , - { 28133 , -9911 } , - { 28035 , -10187 } , - { 27933 , -10461 } , - { 27829 , -10735 } , - { 27723 , -11008 } , - { 27613 , -11279 } , - { 27501 , -11550 } , - { 27387 , -11819 } , - { 27269 , -12088 } , - { 27149 , -12355 } , - { 27027 , -12621 } , - { 26901 , -12885 } , - { 26774 , -13149 } , - { 26643 , -13411 } , - { 26510 , -13672 } , - { 26375 , -13932 } , - { 26237 , -14190 } , - { 26096 , -14447 } , - { 25953 , -14702 } , - { 25807 , -14956 } , - { 25659 , -15209 } , - { 25509 , -15460 } , - { 25356 , -15710 } , - { 25200 , -15958 } , - { 25043 , -16205 } , - { 24882 , -16450 } , - { 24720 , -16693 } , - { 24554 , -16935 } , - { 24387 , -17175 } , - { 24217 , -17414 } , - { 24045 , -17651 } , - { 23871 , -17886 } , - { 23694 , -18119 } , - { 23515 , -18351 } , - { 23334 , -18581 } , - { 23150 , -18809 } , - { 22964 , -19036 } , - { 22776 , -19260 } , - { 22586 , -19483 } , - { 22394 , -19704 } , - { 22199 , -19923 } , - { 22003 , -20140 } , - { 21804 , -20355 } , - { 21603 , -20568 } , - { 21400 , -20779 } , - { 21195 , -20988 } - }; -cos_msin_t a_cos_msin_32[160]= { - { 29828 , -73 } , - { 29827 , -220 } , - { 29826 , -366 } , - { 29824 , -512 } , - { 29821 , -659 } , - { 29817 , -805 } , - { 29813 , -952 } , - { 29808 , -1098 } , - { 29802 , -1244 } , - { 29796 , -1390 } , - { 29789 , -1537 } , - { 29781 , -1683 } , - { 29772 , -1829 } , - { 29763 , -1975 } , - { 29753 , -2121 } , - { 29742 , -2267 } , - { 29730 , -2413 } , - { 29718 , -2559 } , - { 29705 , -2705 } , - { 29692 , -2851 } , - { 29677 , -2997 } , - { 29662 , -3142 } , - { 29646 , -3288 } , - { 29630 , -3433 } , - { 29613 , -3579 } , - { 29595 , -3724 } , - { 29576 , -3869 } , - { 29557 , -4014 } , - { 29537 , -4159 } , - { 29516 , -4304 } , - { 29494 , -4449 } , - { 29472 , -4594 } , - { 29449 , -4738 } , - { 29426 , -4883 } , - { 29401 , -5027 } , - { 29376 , -5172 } , - { 29351 , -5316 } , - { 29324 , -5460 } , - { 29297 , -5604 } , - { 29269 , -5747 } , - { 29241 , -5891 } , - { 29211 , -6034 } , - { 29181 , -6178 } , - { 29151 , -6321 } , - { 29119 , -6464 } , - { 29087 , -6607 } , - { 29054 , -6749 } , - { 29021 , -6892 } , - { 28987 , -7034 } , - { 28952 , -7177 } , - { 28916 , -7319 } , - { 28880 , -7460 } , - { 28843 , -7602 } , - { 28805 , -7744 } , - { 28767 , -7885 } , - { 28728 , -8026 } , - { 28688 , -8167 } , - { 28648 , -8308 } , - { 28607 , -8448 } , - { 28565 , -8589 } , - { 28522 , -8729 } , - { 28479 , -8869 } , - { 28435 , -9008 } , - { 28391 , -9148 } , - { 28346 , -9287 } , - { 28300 , -9426 } , - { 28253 , -9565 } , - { 28206 , -9703 } , - { 28158 , -9842 } , - { 28109 , -9980 } , - { 28060 , -10118 } , - { 28010 , -10255 } , - { 27959 , -10393 } , - { 27908 , -10530 } , - { 27856 , -10667 } , - { 27803 , -10803 } , - { 27750 , -10940 } , - { 27696 , -11076 } , - { 27641 , -11212 } , - { 27586 , -11347 } , - { 27529 , -11482 } , - { 27473 , -11617 } , - { 27415 , -11752 } , - { 27357 , -11886 } , - { 27299 , -12021 } , - { 27239 , -12154 } , - { 27179 , -12288 } , - { 27119 , -12421 } , - { 27057 , -12554 } , - { 26996 , -12687 } , - { 26933 , -12819 } , - { 26870 , -12951 } , - { 26806 , -13083 } , - { 26741 , -13215 } , - { 26676 , -13346 } , - { 26610 , -13476 } , - { 26544 , -13607 } , - { 26477 , -13737 } , - { 26409 , -13867 } , - { 26340 , -13996 } , - { 26271 , -14125 } , - { 26202 , -14254 } , - { 26132 , -14383 } , - { 26061 , -14511 } , - { 25989 , -14638 } , - { 25917 , -14766 } , - { 25844 , -14893 } , - { 25771 , -15020 } , - { 25697 , -15146 } , - { 25622 , -15272 } , - { 25547 , -15397 } , - { 25471 , -15523 } , - { 25394 , -15648 } , - { 25317 , -15772 } , - { 25239 , -15896 } , - { 25161 , -16020 } , - { 25082 , -16143 } , - { 25003 , -16266 } , - { 24923 , -16389 } , - { 24842 , -16511 } , - { 24760 , -16632 } , - { 24678 , -16754 } , - { 24596 , -16875 } , - { 24513 , -16995 } , - { 24429 , -17115 } , - { 24345 , -17235 } , - { 24260 , -17354 } , - { 24174 , -17473 } , - { 24088 , -17592 } , - { 24002 , -17710 } , - { 23914 , -17827 } , - { 23827 , -17945 } , - { 23738 , -18061 } , - { 23649 , -18178 } , - { 23560 , -18293 } , - { 23470 , -18409 } , - { 23379 , -18524 } , - { 23288 , -18638 } , - { 23196 , -18752 } , - { 23104 , -18866 } , - { 23011 , -18979 } , - { 22917 , -19092 } , - { 22824 , -19204 } , - { 22729 , -19316 } , - { 22634 , -19427 } , - { 22538 , -19538 } , - { 22442 , -19649 } , - { 22345 , -19759 } , - { 22248 , -19868 } , - { 22150 , -19977 } , - { 22052 , -20086 } , - { 21953 , -20194 } , - { 21854 , -20301 } , - { 21754 , -20408 } , - { 21653 , -20515 } , - { 21552 , -20621 } , - { 21451 , -20726 } , - { 21349 , -20831 } , - { 21246 , -20936 } , - { 21143 , -21040 } - }; -cos_msin_t a_cos_msin_64[320] = { -{29827, -34}, -{29827, -106}, -{29827, -177}, -{29827, -249}, -{29826, -320}, -{29825, -392}, -{29824, -463}, -{29823, -535}, -{29821, -606}, -{29819, -678}, -{29818, -750}, -{29816, -821}, -{29814, -893}, -{29812, -964}, -{29809, -1035}, -{29807, -1106}, -{29804, -1177}, -{29801, -1249}, -{29797, -1320}, -{29795, -1392}, -{29791, -1463}, -{29787, -1535}, -{29784, -1606}, -{29780, -1678}, -{29776, -1749}, -{29771, -1820}, -{29767, -1892}, -{29763, -1963}, -{29758, -2035}, -{29753, -2106}, -{29748, -2177}, -{29742, -2249}, -{29737, -2320}, -{29731, -2391}, -{29726, -2462}, -{29719, -2534}, -{29713, -2605}, -{29707, -2676}, -{29701, -2747}, -{29694, -2819}, -{29686, -2890}, -{29680, -2961}, -{29673, -3032}, -{29665, -3103}, -{29658, -3174}, -{29650, -3245}, -{29643, -3316}, -{29635, -3387}, -{29626, -3459}, -{29618, -3529}, -{29610, -3600}, -{29601, -3671}, -{29592, -3742}, -{29583, -3813}, -{29574, -3884}, -{29564, -3955}, -{29554, -4026}, -{29544, -4097}, -{29535, -4167}, -{29525, -4238}, -{29514, -4309}, -{29504, -4380}, -{29493, -4450}, -{29483, -4521}, -{29472, -4591}, -{29461, -4662}, -{29450, -4733}, -{29439, -4803}, -{29427, -4874}, -{29415, -4944}, -{29403, -5015}, -{29391, -5085}, -{29379, -5155}, -{29366, -5226}, -{29353, -5296}, -{29341, -5367}, -{29328, -5438}, -{29314, -5508}, -{29301, -5578}, -{29289, -5648}, -{29274, -5718}, -{29260, -5788}, -{29247, -5858}, -{29232, -5928}, -{29218, -5998}, -{29204, -6068}, -{29188, -6139}, -{29175, -6209}, -{29159, -6279}, -{29145, -6348}, -{29128, -6418}, -{29114, -6488}, -{29097, -6557}, -{29082, -6627}, -{29066, -6697}, -{29050, -6767}, -{29034, -6837}, -{29017, -6906}, -{29001, -6975}, -{28984, -7045}, -{28966, -7114}, -{28950, -7184}, -{28933, -7254}, -{28915, -7323}, -{28897, -7392}, -{28880, -7461}, -{28862, -7530}, -{28843, -7600}, -{28825, -7669}, -{28807, -7738}, -{28788, -7806}, -{28769, -7875}, -{28751, -7944}, -{28732, -8014}, -{28712, -8082}, -{28692, -8151}, -{28672, -8219}, -{28653, -8289}, -{28633, -8357}, -{28613, -8425}, -{28593, -8494}, -{28572, -8563}, -{28551, -8632}, -{28531, -8700}, -{28510, -8768}, -{28488, -8837}, -{28468, -8905}, -{28447, -8973}, -{28425, -9041}, -{28403, -9109}, -{28381, -9177}, -{28359, -9245}, -{28336, -9313}, -{28315, -9381}, -{28292, -9448}, -{28269, -9517}, -{28246, -9584}, -{28223, -9652}, -{28200, -9720}, -{28176, -9787}, -{28153, -9854}, -{28129, -9922}, -{28105, -9990}, -{28082, -10056}, -{28057, -10124}, -{28032, -10191}, -{28009, -10258}, -{27984, -10326}, -{27959, -10392}, -{27934, -10460}, -{27909, -10526}, -{27883, -10593}, -{27858, -10661}, -{27832, -10727}, -{27807, -10794}, -{27780, -10860}, -{27754, -10927}, -{27728, -10993}, -{27701, -11059}, -{27676, -11126}, -{27648, -11192}, -{27622, -11259}, -{27595, -11324}, -{27567, -11391}, -{27540, -11456}, -{27512, -11523}, -{27484, -11588}, -{27456, -11655}, -{27429, -11720}, -{27401, -11786}, -{27372, -11852}, -{27344, -11917}, -{27315, -11982}, -{27286, -12049}, -{27257, -12114}, -{27229, -12179}, -{27199, -12244}, -{27169, -12309}, -{27140, -12375}, -{27110, -12439}, -{27080, -12505}, -{27050, -12570}, -{27019, -12634}, -{26990, -12699}, -{26958, -12764}, -{26928, -12828}, -{26897, -12892}, -{26866, -12956}, -{26835, -13021}, -{26804, -13086}, -{26773, -13149}, -{26741, -13214}, -{26709, -13278}, -{26677, -13342}, -{26645, -13406}, -{26613, -13470}, -{26581, -13534}, -{26549, -13597}, -{26515, -13661}, -{26483, -13725}, -{26450, -13788}, -{26417, -13851}, -{26384, -13915}, -{26350, -13978}, -{26316, -14041}, -{26283, -14103}, -{26248, -14166}, -{26215, -14229}, -{26180, -14292}, -{26146, -14355}, -{26112, -14417}, -{26077, -14480}, -{26042, -14543}, -{26008, -14605}, -{25972, -14667}, -{25937, -14730}, -{25901, -14792}, -{25866, -14854}, -{25830, -14916}, -{25794, -14977}, -{25759, -15039}, -{25723, -15101}, -{25687, -15162}, -{25650, -15224}, -{25613, -15286}, -{25577, -15347}, -{25540, -15408}, -{25503, -15470}, -{25465, -15531}, -{25428, -15592}, -{25391, -15653}, -{25353, -15714}, -{25315, -15774}, -{25277, -15834}, -{25240, -15895}, -{25201, -15956}, -{25162, -16016}, -{25124, -16076}, -{25086, -16136}, -{25047, -16196}, -{25008, -16256}, -{24969, -16316}, -{24930, -16375}, -{24891, -16436}, -{24851, -16496}, -{24811, -16555}, -{24772, -16615}, -{24732, -16674}, -{24692, -16732}, -{24652, -16791}, -{24612, -16852}, -{24572, -16911}, -{24531, -16969}, -{24490, -17027}, -{24449, -17086}, -{24408, -17145}, -{24367, -17203}, -{24325, -17261}, -{24284, -17320}, -{24242, -17379}, -{24200, -17436}, -{24158, -17494}, -{24116, -17552}, -{24075, -17610}, -{24032, -17668}, -{23990, -17725}, -{23947, -17782}, -{23904, -17840}, -{23862, -17897}, -{23819, -17954}, -{23775, -18011}, -{23732, -18068}, -{23689, -18125}, -{23645, -18181}, -{23602, -18238}, -{23558, -18294}, -{23514, -18351}, -{23470, -18407}, -{23426, -18464}, -{23381, -18520}, -{23337, -18576}, -{23293, -18632}, -{23248, -18688}, -{23202, -18743}, -{23158, -18799}, -{23112, -18854}, -{23068, -18910}, -{23022, -18964}, -{22977, -19020}, -{22931, -19074}, -{22885, -19129}, -{22839, -19185}, -{22793, -19239}, -{22747, -19294}, -{22700, -19348}, -{22655, -19403}, -{22607, -19457}, -{22561, -19511}, -{22514, -19565}, -{22467, -19619}, -{22421, -19673}, -{22373, -19726}, -{22326, -19780}, -{22279, -19834}, -{22230, -19887}, -{22183, -19940}, -{22135, -19993}, -{22087, -20047}, -{22039, -20099}, -{21991, -20152}, -{21942, -20205}, -{21894, -20257}, -{21845, -20309}, -{21797, -20362}, -{21748, -20413}, -{21699, -20466}, -{21650, -20518}, -{21601, -20570}, -{21551, -20621}, -{21502, -20674} -}; - -cos_msin_t *a_cos_msin_table[] = {a_cos_msin_2, a_cos_msin_4, - a_cos_msin_8, a_cos_msin_16, - a_cos_msin_32,a_cos_msin_64 - }; - -Word16 dct_core_a[10][10] = { - -{ 10453, 10196, 9688, 8941, 7973, 6810, 5479, 4013, 2448, 823 }, -{ 10196, 7973, 4013, -823, -5479, -8941, -10453, -9688, -6810, -2448 }, -{ 9688 , 4013, -4013, -9688, -9688, -4013, 4013, 9688, 9688, 4013 }, -{ 8941 , -823, -9688, -7973, 2448, 10196, 6810, -4013, -10453, -5479 }, -{ 7973 , -5479, -9688, 2448, 10453, 823, -10196, -4013, 8941, 6810 }, -{ 6810 , -8941, -4013, 10196, 823, -10453, 2448, 9688, -5479, -7973 }, -{ 5479 , -10453, 4013, 6810, -10196, 2448, 7973, -9688, 823, 8941 }, -{ 4013 , -9688, 9688, -4013, -4013, 9688, -9688, 4013, 4013, -9688 }, -{ 2448 , -6810, 9688, -10453, 8941, -5479, 823, 4013, -7973, 10196 }, -{ 823 , -2448, 4013, -5479, 6810, -7973, 8941, -9688, 10196, -10453 }}; - -Word16 anal_bias[320] = { - 1, 1, 3, 1, 4, 1, 3, -2, 4, 3, - 4, 1, 3, 0, 2, -3, 0, 0, 2, 2, - 4, 1, 1, -5, 4, 1, 2, -1, 0, -1, - 1, -2, 0, 2, 2, 2, 4, 1, 3, 0, - 5, 3, 2, 0, 3, 0, 1, -4, 1, 1, - 2, 0, 4, 0, 1, -4, 6, 1, 3, -1, - 1, 0, 0, -4, 1, 1, 3, 1, 3, 2, - 4, -2, 4, 3, 5, 1, 3, 0, 1, -3, - 1, 1, 2, 0, 4, 1, 2, -4, 4, 2, - 2, -1, 1, -1, 1, -4, 0, 0, 3, 0, - 5, 2, 3, -1, 6, 2, 5, 0, 4, 0, - 1, -3, 1, 0, 3, 0, 4, 0, 1, -3, - 4, 1, 3, -1, 1, -2, 1, -4, 0, 1, - 2, 1, 3, 2, 2, -2, 4, 3, 3, 0, - 3, 0, 0, -2, 1, 0, 2, 0, 5, -1, - 1, -3, 4, 2, 2, 0, 2, -3, 1, -4, - -1, 1, 2, 2, 4, 1, 3, -1, 5, 2, - 2, 0, 3, -1, 2, -3, 0, 1, 2, 2, - 4, 0, 1, -5, 5, 1, 3, 0, 2, -1, - 0, -2, 1, 2, 2, 2, 4, 1, 0, 0, - 4, 2, 4, 1, 4, -1, 1, -4, 0, 1, - 3, 1, 5, 1, 1, -2, 4, 0, 2, 0, - 2, -1, 0, -2, 0, 1, 1, 1, 4, 2, - 3, -2, 5, 4, 4, 0, 3, 0, 3, -4, - 1, 2, 2, 0, 4, 1, 0, -3, 4, 2, - 3, -1, 1, -1, 1, -4, 0, 2, 3, 1, - 4, 1, 3, 0, 3, 3, 4, 1, 2, 0, - 1, -3, 2, 2, 2, 1, 5, 0, 1, -4, - 4, 1, 3, -2, 3, -1, 0, -2, 0, 2, - 2, 0, 5, 1, 4, -1, 4, 3, 4, 1, - 3, 0, 1, -4, 2, 0, 3, 1, 5, 0, - 1, -5, 5, 2, 2, 0, 0, 0, 0, -4}; - diff --git a/third_party/g7221/encode/encoder.c b/third_party/g7221/encode/encoder.c deleted file mode 100644 index 2d878cc..0000000 --- a/third_party/g7221/encode/encoder.c +++ /dev/null @@ -1,1125 +0,0 @@ -/*************************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -***************************************************************************/ - -/*************************************************************************** - Filename: encoder.c - - Purpose: Contains files used to implement the G.722.1 Annex C encoder - - Design Notes: - -***************************************************************************/ - -/*************************************************************************** - Include files -***************************************************************************/ - -#include -#include -#include "defs.h" -#include "huff_def.h" -#include "tables.h" -#include "count.h" - -/*************************************************************************** - Function: encoder - - Syntax: void encoder(Word16 number_of_available_bits, - Word16 number_of_regions, - Word16 mlt_coefs, - Word16 mag_shift, - Word16 out_words) - - inputs: number_of_available_bits - number_of_regions - mag_shift - mlt_coefs[DCT_LENGTH] - - outputs: out_words[MAX_BITS_PER_FRAME/16] - - - Description: Encodes the mlt coefs into out_words using G.722.1 Annex C - - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.93 | 1.04 - -------|--------------|---------------- - MAX | 1.20 | 1.28 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 1.39 | 1.71 | 2.01 - -------|--------------|----------------|---------------- - MAX | 2.00 | 2.30 | 2.52 - -------|--------------|----------------|---------------- - -***************************************************************************/ - -void encoder(Word16 number_of_available_bits, - Word16 number_of_regions, - Word16 *mlt_coefs, - Word16 mag_shift, - Word16 *out_words) -{ - - Word16 num_categorization_control_bits; - Word16 num_categorization_control_possibilities; - Word16 number_of_bits_per_frame; - Word16 number_of_envelope_bits; - Word16 categorization_control; - Word16 region; - Word16 absolute_region_power_index[MAX_NUMBER_OF_REGIONS]; - Word16 power_categories[MAX_NUMBER_OF_REGIONS]; - Word16 category_balances[MAX_NUM_CATEGORIZATION_CONTROL_POSSIBILITIES-1]; - Word16 drp_num_bits[MAX_NUMBER_OF_REGIONS+1]; - UWord16 drp_code_bits[MAX_NUMBER_OF_REGIONS+1]; - Word16 region_mlt_bit_counts[MAX_NUMBER_OF_REGIONS]; - UWord32 region_mlt_bits[4*MAX_NUMBER_OF_REGIONS]; - Word16 mag_shift_offset; - - Word16 temp; - - /* initialize variables */ - test(); - if (number_of_regions == NUMBER_OF_REGIONS) - { - num_categorization_control_bits = NUM_CATEGORIZATION_CONTROL_BITS; - move16(); - num_categorization_control_possibilities = NUM_CATEGORIZATION_CONTROL_POSSIBILITIES; - move16(); - } - else - { - num_categorization_control_bits = MAX_NUM_CATEGORIZATION_CONTROL_BITS; - move16(); - num_categorization_control_possibilities = MAX_NUM_CATEGORIZATION_CONTROL_POSSIBILITIES; - move16(); - } - - number_of_bits_per_frame = number_of_available_bits; - move16(); - - for (region=0; region= 0) - { - temp = extract_l(L_shr_nocheck(current_word,j)); - out_word = add(out_word,temp); - - out_words[out_word_index++] = out_word; - move16(); - - out_word_bits_free = 16; - move16(); - - out_word_bits_free = sub(out_word_bits_free,j); - - acca = (current_word << out_word_bits_free); - out_word = extract_l(acca); - } - else - { - j = negate(j); - - acca = (current_word << j); - accb = L_deposit_l(out_word); - acca = L_add(accb,acca); - out_word = extract_l(acca); - - out_word_bits_free = sub(out_word_bits_free,current_word_bits_left); - } - } - - /* These code bits are left justified. */ - - for (region=0;region 0) - current_word_bits_left = region_bit_count; - else - current_word_bits_left = 32; - - current_word = *in_word_ptr++; - - acca = L_deposit_l(out_word_index); - acca = L_shl_nocheck(acca,4); - acca = L_sub(acca,number_of_bits_per_frame); - - /* from while loop */ - test(); - test(); - logic16(); - while ((region_bit_count > 0) && (acca < 0)) - { - /* from while loop */ - test(); - test(); - logic16(); - - temp = sub(current_word_bits_left,out_word_bits_free); - test(); - if (temp >= 0) - { - temp = sub(32,out_word_bits_free); - accb = LU_shr(current_word,temp); - slice = (UWord16)extract_l(accb); - - out_word = add(out_word,slice); - - test(); - current_word <<= out_word_bits_free; - - current_word_bits_left = sub(current_word_bits_left,out_word_bits_free); - out_words[out_word_index++] = extract_l(out_word); - move16(); - - out_word = 0; - move16(); - - out_word_bits_free = 16; - move16(); - } - else - { - temp = sub(32,current_word_bits_left); - accb = LU_shr(current_word,temp); - slice = (UWord16)extract_l(accb); - - temp = sub(out_word_bits_free,current_word_bits_left); - test(); - accb = slice << temp; - acca = L_deposit_l(out_word); - acca = L_add(acca,accb); - out_word = extract_l(acca); - out_word_bits_free = sub(out_word_bits_free,current_word_bits_left); - - current_word_bits_left = 0; - move16(); - } - - test(); - if (current_word_bits_left == 0) - { - current_word = *in_word_ptr++; - region_bit_count = sub(region_bit_count,32); - - /* current_word_bits_left = MIN(32,region_bit_count); */ - temp = sub(32,region_bit_count); - test(); - if(temp > 0) - current_word_bits_left = region_bit_count; - else - current_word_bits_left = 32; - - } - acca = L_deposit_l(out_word_index); - acca = L_shl_nocheck(acca,4); - acca = L_sub(acca,number_of_bits_per_frame); - } - accb = L_deposit_l(out_word_index); - accb = L_shl_nocheck(accb,4); - accb = L_sub(accb,number_of_bits_per_frame); - } - } - - /* Fill out with 1's. */ - - test(); - while (acca < 0) - { - test(); - current_word = 0x0000ffff; - move32(); - - temp = sub(16,out_word_bits_free); - acca = LU_shr(current_word,temp); - slice = (UWord16)extract_l(acca); - - out_word = add(out_word,slice); - out_words[out_word_index++] = out_word; - move16(); - - out_word = 0; - move16(); - - out_word_bits_free = 16; - move16(); - - acca = L_deposit_l(out_word_index); - acca = L_shl_nocheck(acca,4); - acca = L_sub(acca,number_of_bits_per_frame); - } -} -/*************************************************************************** - Function: adjust_abs_region_power_index - - Syntax: adjust_abs_region_power_index(Word16 *absolute_region_power_index, - Word16 *mlt_coefs, - Word16 number_of_regions) - - inputs: *mlt_coefs - *absolute_region_power_index - number_of_regions - - outputs: *absolute_region_power_index - - Description: Adjusts the absolute power index - - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.03 | 0.03 - -------|--------------|---------------- - MAX | 0.12 | 0.12 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 0.03 | 0.03 | 0.03 - -------|--------------|----------------|---------------- - MAX | 0.14 | 0.14 | 0.14 - -------|--------------|----------------|---------------- - -***************************************************************************/ -void adjust_abs_region_power_index(Word16 *absolute_region_power_index,Word16 *mlt_coefs,Word16 number_of_regions) -{ - Word16 n,i; - Word16 region; - Word16 *raw_mlt_ptr; - - Word32 acca; - Word16 temp; - - for (region=0; region 0) - { - temp = extract_l(L_mult0(region,REGION_SIZE)); - - raw_mlt_ptr = &mlt_coefs[temp]; - - for (i=0; i 0) - { - test(); - long_accumulator = L_shr_nocheck(long_accumulator,1); - - acca = (long_accumulator & 0x7fff0000L); - logic32(); - - power_shift = add(power_shift,1); - } - - acca = L_sub(long_accumulator,32767); - - temp = add(power_shift,15); - test(); - test(); - logic16(); - while ((acca <= 0) && (temp >= 0)) - { - test(); - test(); - logic16(); - - long_accumulator = L_shl_nocheck(long_accumulator,1); - acca = L_sub(long_accumulator,32767); - power_shift--; - temp = add(power_shift,15); - } - long_accumulator = L_shr_nocheck(long_accumulator,1); - /* 28963 corresponds to square root of 2 times REGION_SIZE(20). */ - acca = L_sub(long_accumulator,28963); - - test(); - if (acca >= 0) - power_shift = add(power_shift,1); - - acca = L_deposit_l(mag_shift); - acca = L_shl_nocheck(acca,1); - acca = L_sub(power_shift,acca); - acca = L_add(35,acca); - acca = L_sub(acca,REGION_POWER_TABLE_NUM_NEGATIVES); - absolute_region_power_index[region] = extract_l(acca); - } - - - /* Before we differentially encode the quantized region powers, adjust upward the - valleys to make sure all the peaks can be accurately represented. */ - temp = sub(number_of_regions,2); - - for (region = temp; region >= 0; region--) - { - temp1 = sub(absolute_region_power_index[region+1],DRP_DIFF_MAX); - temp2 = sub(absolute_region_power_index[region],temp1); - test(); - if (temp2 < 0) - { - absolute_region_power_index[region] = temp1; - move16(); - } - } - - /* The MLT is currently scaled too low by the factor - ENCODER_SCALE_FACTOR(=18318)/32768 * (1./sqrt(160). - This is the ninth power of 1 over the square root of 2. - So later we will add ESF_ADJUSTMENT_TO_RMS_INDEX (now 9) - to drp_code_bits[0]. */ - - /* drp_code_bits[0] can range from 1 to 31. 0 will be used only as an escape sequence. */ - temp1 = sub(1,ESF_ADJUSTMENT_TO_RMS_INDEX); - temp2 = sub(absolute_region_power_index[0],temp1); - test(); - if (temp2 < 0) - { - absolute_region_power_index[0] = temp1; - move16(); - } - - temp1 = sub(31,ESF_ADJUSTMENT_TO_RMS_INDEX); - - /* - * The next line was corrected in Release 1.2 - */ - - temp2 = sub(absolute_region_power_index[0], temp1); - test(); - if (temp2 > 0) - { - absolute_region_power_index[0] = temp1; - move16(); - } - - differential_region_power_index[0] = absolute_region_power_index[0]; - move16(); - - number_of_bits = 5; - move16(); - - drp_num_bits[0] = 5; - move16(); - - drp_code_bits[0] = (UWord16)add(absolute_region_power_index[0],ESF_ADJUSTMENT_TO_RMS_INDEX); - move16(); - - /* Lower limit the absolute region power indices to -8 and upper limit them to 31. Such extremes - may be mathematically impossible anyway.*/ - for (region=1; region 0) - { - absolute_region_power_index[region] = temp1; - move16(); - } - } - - for (region=1; region 0)) - { - test(); - test(); - logic16(); - (*p_categorization_control)--; - region = category_balances[*p_categorization_control]; - move16(); - - power_categories[region] = sub(power_categories[region],1); - move16(); - - total_mlt_bits = sub(total_mlt_bits,region_mlt_bit_counts[region]); - category = power_categories[region]; - move16(); - - raw_mlt_ptr = &mlt_coefs[region*REGION_SIZE]; - move16(); - - temp = sub(category,(NUM_CATEGORIES-1)); - test(); - if (temp < 0) - { - region_mlt_bit_counts[region] = - vector_huffman(category, absolute_region_power_index[region],raw_mlt_ptr, - ®ion_mlt_bits[shl_nocheck(region,2)]); - } - else - { - region_mlt_bit_counts[region] = 0; - move16(); - } - total_mlt_bits = add(total_mlt_bits,region_mlt_bit_counts[region]); - temp = sub(total_mlt_bits,number_of_available_bits); - } - - /* If too many bits... */ - /* Set up for while loop test */ - temp1 = sub(total_mlt_bits,number_of_available_bits); - temp2 = sub(*p_categorization_control,sub(num_categorization_control_possibilities,1)); - test(); - test(); - logic16(); - - while ((temp1 > 0) && (temp2 < 0)) - { - /* operations for while contitions */ - test(); - test(); - logic16(); - - region = category_balances[*p_categorization_control]; - move16(); - - power_categories[region] = add(power_categories[region],1); - move16(); - - total_mlt_bits = sub(total_mlt_bits,region_mlt_bit_counts[region]); - category = power_categories[region]; - move16(); - - temp = extract_l(L_mult0(region,REGION_SIZE)); - raw_mlt_ptr = &mlt_coefs[temp]; - move16(); - - temp = sub(category,(NUM_CATEGORIES-1)); - test(); - if (temp < 0) - { - region_mlt_bit_counts[region] = - vector_huffman(category, absolute_region_power_index[region],raw_mlt_ptr, - ®ion_mlt_bits[shl_nocheck(region,2)]); - } - else - { - region_mlt_bit_counts[region] = 0; - move16(); - } - total_mlt_bits = add(total_mlt_bits,region_mlt_bit_counts[region]); - (*p_categorization_control)++; - - temp1 = sub(total_mlt_bits,number_of_available_bits); - temp2 = sub(*p_categorization_control,sub(num_categorization_control_possibilities,1)); - } -} - -/*************************************************************************** - Function: vector_huffman - - Syntax: Word16 vector_huffman(Word16 category, - Word16 power_index, - Word16 *raw_mlt_ptr, - UWord32 *word_ptr) - - inputs: Word16 category - Word16 power_index - Word16 *raw_mlt_ptr - - outputs: number_of_region_bits - *word_ptr - - - Description: Huffman encoding for each region based on category and power_index - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 0.03 | 0.03 - -------|--------------|---------------- - MAX | 0.04 | 0.04 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 0.03 | 0.03 | 0.03 - -------|--------------|----------------|---------------- - MAX | 0.04 | 0.04 | 0.04 - -------|--------------|----------------|---------------- - -***************************************************************************/ -Word16 vector_huffman(Word16 category, - Word16 power_index, - Word16 *raw_mlt_ptr, - UWord32 *word_ptr) -{ - - - Word16 inv_of_step_size_times_std_dev; - Word16 j,n; - Word16 k; - Word16 number_of_region_bits; - Word16 number_of_non_zero; - Word16 vec_dim; - Word16 num_vecs; - Word16 kmax, kmax_plus_one; - Word16 index,signs_index; - Word16 *bitcount_table_ptr; - UWord16 *code_table_ptr; - Word32 code_bits; - Word16 number_of_code_bits; - UWord32 current_word; - Word16 current_word_bits_free; - - Word32 acca; - Word32 accb; - Word16 temp; - - Word16 mytemp; /* new variable in Release 1.2 */ - Word16 myacca; /* new variable in Release 1.2 */ - - - /* initialize variables */ - vec_dim = vector_dimension[category]; - move16(); - - num_vecs = number_of_vectors[category]; - move16(); - - kmax = max_bin[category]; - move16(); - - kmax_plus_one = add(kmax,1); - move16(); - - current_word = 0L; - move16(); - - current_word_bits_free = 32; - move16(); - - number_of_region_bits = 0; - move16(); - - /* set up table pointers */ - bitcount_table_ptr = (Word16 *)table_of_bitcount_tables[category]; - code_table_ptr = (UWord16 *) table_of_code_tables[category]; - - /* compute inverse of step size * standard deviation */ - acca = L_mult(step_size_inverse_table[category],standard_deviation_inverse_table[power_index]); - acca = L_shr_nocheck(acca,1); - acca = L_add(acca,4096); - acca = L_shr_nocheck(acca,13); - - /* - * The next two lines are new to Release 1.2 - */ - - mytemp = (Word16)(acca & 0x3); - acca = L_shr_nocheck(acca,2); - - inv_of_step_size_times_std_dev = extract_l(acca); - - - for (n=0; n 0) - { - signs_index = add(signs_index,1); - } - - temp = sub(k,kmax); - test(); - if (temp > 0) - { - k = kmax; - move16(); - } - } - acca = L_shr_nocheck(L_mult(index,(kmax_plus_one)),1); - index = extract_l(acca); - index = add(index,k); - raw_mlt_ptr++; - } - - code_bits = *(code_table_ptr+index); - number_of_code_bits = add((*(bitcount_table_ptr+index)),number_of_non_zero); - number_of_region_bits = add(number_of_region_bits,number_of_code_bits); - - acca = code_bits << number_of_non_zero; - accb = L_deposit_l(signs_index); - acca = L_add(acca,accb); - code_bits = acca; - move32(); - - /* msb of codebits is transmitted first. */ - j = sub(current_word_bits_free,number_of_code_bits); - test(); - if (j >= 0) - { - test(); - acca = code_bits << j; - current_word = L_add(current_word,acca); - current_word_bits_free = j; - move16(); - } - else - { - j = negate(j); - acca = L_shr_nocheck(code_bits,j); - current_word = L_add(current_word,acca); - - *word_ptr++ = current_word; - move16(); - - current_word_bits_free = sub(32,j); - test(); - current_word = code_bits << current_word_bits_free; - } - } - - *word_ptr++ = current_word; - move16(); - - return (number_of_region_bits); -} - - diff --git a/third_party/g7221/encode/sam2coef.c b/third_party/g7221/encode/sam2coef.c deleted file mode 100644 index 3dd5b76..0000000 --- a/third_party/g7221/encode/sam2coef.c +++ /dev/null @@ -1,271 +0,0 @@ -/****************************************************************************** -** -** ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C -** > Software Release 2.1 (2008-06) -** (Simple repackaging; no change from 2005-05 Release 2.0 code) -** -** © 2004 Polycom, Inc. -** -** All rights reserved. -** -******************************************************************************/ - -/****************************************************************************** -* Filename: samples_to_rmlt_coefs.c -* -* Purpose: Convert Samples to Reversed MLT (Modulated Lapped Transform) -* Coefficients -* -* The "Reversed MLT" is an overlapped block transform which uses -* even symmetry * on the left, odd symmetry on the right and a -* Type IV DCT as the block transform. * It is thus similar to a -* MLT which uses odd symmetry on the left, even symmetry * on the -* right and a Type IV DST as the block transform. In fact, it is -* equivalent * to reversing the order of the samples, performing -* an MLT and then negating all * the even-numbered coefficients. -* -******************************************************************************/ - -/*************************************************************************** - Include files -***************************************************************************/ -#include "defs.h" -#include "tables.h" -#include "count.h" - -/*************************************************************************** - Function: samples_to_rmlt_coefs - - Syntax: Word16 samples_to_rmlt_coefs(new_samples, - old_samples, - coefs, - dct_length) - Word16 *new_samples; - Word16 *old_samples; - Word16 *coefs; - Word16 dct_length; - - Description: Convert samples to MLT coefficients - - Design Notes: - - WMOPS: 7kHz | 24kbit | 32kbit - -------|--------------|---------------- - AVG | 1.40 | 1.40 - -------|--------------|---------------- - MAX | 1.40 | 1.40 - -------|--------------|---------------- - - 14kHz | 24kbit | 32kbit | 48kbit - -------|--------------|----------------|---------------- - AVG | 3.07 | 3.07 | 3.07 - -------|--------------|----------------|---------------- - MAX | 3.10 | 3.10 | 3.10 - -------|--------------|----------------|---------------- - -***************************************************************************/ - -Word16 samples_to_rmlt_coefs(const Word16 *new_samples,Word16 *old_samples,Word16 *coefs,Word16 dct_length) -{ - - Word16 index, vals_left,mag_shift,n; - Word16 windowed_data[MAX_DCT_LENGTH]; - Word16 *old_ptr; - const Word16 *new_ptr, *sam_low, *sam_high; - Word16 *win_low, *win_high; - Word16 *dst_ptr; - Word16 neg_win_low; - Word16 samp_high; - Word16 half_dct_size; - - Word32 acca; - Word32 accb; - Word16 temp; - Word16 temp1; - Word16 temp2; - Word16 temp5; - - half_dct_size = shr_nocheck(dct_length,1); - - /*++++++++++++++++++++++++++++++++++++++++++++*/ - /* Get the first half of the windowed samples */ - /*++++++++++++++++++++++++++++++++++++++++++++*/ - - dst_ptr = windowed_data; - move16(); - - /* address arithmetic */ - test(); - if (dct_length==DCT_LENGTH) - { - win_high = samples_to_rmlt_window + half_dct_size; - } - else - { - win_high = max_samples_to_rmlt_window + half_dct_size; - } - - win_low = win_high; - move16(); - - /* address arithmetic */ - sam_high = old_samples + half_dct_size; - - sam_low = sam_high; - move16(); - - for (vals_left = half_dct_size;vals_left > 0;vals_left--) - { - acca = 0L; - move32(); - - acca = L_mac(acca,*--win_low, *--sam_low); - acca = L_mac(acca,*win_high++, *sam_high++); - temp = itu_round(acca); - - *dst_ptr++ = temp; - move16(); - } - - /*+++++++++++++++++++++++++++++++++++++++++++++*/ - /* Get the second half of the windowed samples */ - /*+++++++++++++++++++++++++++++++++++++++++++++*/ - - sam_low = new_samples; - move16(); - - /* address arithmetic */ - sam_high = new_samples + dct_length; - - for (vals_left = half_dct_size; vals_left > 0; vals_left--) - { - acca = 0L; - move32(); - - acca = L_mac(acca,*--win_high, *sam_low++); - neg_win_low = negate(*win_low++); - samp_high = *--sam_high; - acca = L_mac(acca, neg_win_low, samp_high); - temp = itu_round(acca); - - *dst_ptr++=temp; - move16(); - } - - /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - /* Save the new samples for next time, when they will be the old samples */ - /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - new_ptr = new_samples; - move16(); - - old_ptr = old_samples; - move16(); - - for (vals_left = dct_length;vals_left > 0;vals_left--) - { - *old_ptr++ = *new_ptr++; - move16(); - } - - /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - /* Calculate how many bits to shift up the input to the DCT. */ - /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ - - temp1=0; - move16(); - - for(index=0;index 0) - { - move16(); - temp1 = temp2; - } - } - - mag_shift=0; - move16(); - - temp = sub(temp1,14000); - test(); - if (temp >= 0) - { - mag_shift = 0; - move16(); - } - else - { - temp = sub(temp1,438); - test(); - if(temp < 0) - temp = add(temp1,1); - else - { - temp = temp1; - move16(); - } - accb = L_mult(temp,9587); - acca = L_shr_nocheck(accb,20); - temp5 = extract_l(acca); - temp = norm_s(temp5); - test(); - if (temp == 0) - { - mag_shift = 9; - move16(); - } - else - mag_shift = sub(temp,6); - - } - - acca = 0L; - move32(); - for(index=0; index 0) - { - for(index=0;index> is a signed arithmetic shift (-1 >> 1 == -1) - -# MULHACK = -DUSE_FLOAT_MUL -######### Define this if your host multiplies floats faster than integers, -######### e.g. on a SPARCstation. - -# FAST = -DFAST -######### Define together with USE_FLOAT_MUL to enable the GSM library's -######### approximation option for incorrect, but good-enough results. - -# LTP_CUT = -DLTP_CUT -LTP_CUT = -######### Define to enable the GSM library's long-term correlation -######### approximation option---faster, but worse; works for -######### both integer and floating point multiplications. -######### This flag is still in the experimental stage. - -WAV49 = -DWAV49 -# WAV49 = -######### Define to enable the GSM library's option to pack GSM frames -######### in the style used by the WAV #49 format. If you want to write -######### a tool that produces .WAV files which contain GSM-encoded data, -######### define this, and read about the GSM_OPT_WAV49 option in the -######### manual page on gsm_option(3). - -# Choose a compiler. The code works both with ANSI and K&R-C. -# Use -DNeedFunctionPrototypes to compile with, -UNeedFunctionPrototypes to -# compile without, function prototypes in the header files. -# -# You can use the -DSTUPID_COMPILER to circumvent some compilers' -# static limits regarding the number of subexpressions in a statement. - -# CC = cc -# CCFLAGS = -c -DSTUPID_COMPILER - -# CC = /usr/lang/acc -# CCFLAGS = -c -O - -CC = gcc -ansi -pedantic -CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1 - -LD = $(CC) - -# LD = gcc -# LDFLAGS = - - -# If your compiler needs additional flags/libraries, regardless of -# the source compiled, configure them here. - -# CCINC = -I/usr/gnu/lib/gcc-2.1/gcc-lib/sparc-sun-sunos4.1.2/2.1/include -######### Includes needed by $(CC) - -# LDINC = -L/usr/gnu/lib/gcc-2.1/gcc-lib/sparc-sun-sunos4.1.2/2.1 -######### Library paths needed by $(LD) - -# LDLIB = -lgcc -######### Additional libraries needed by $(LD) - - -# Where do you want to install libraries, binaries, a header file -# and the manual pages? -# -# Leave INSTALL_ROOT empty (or just don't execute "make install") to -# not install gsm and toast outside of this directory. - -INSTALL_ROOT = - -# Where do you want to install the gsm library, header file, and manpages? -# -# Leave GSM_INSTALL_ROOT empty to not install the GSM library outside of -# this directory. - -GSM_INSTALL_ROOT = $(INSTALL_ROOT) -GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib -GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc -GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3 - - -# Where do you want to install the toast binaries and their manpage? -# -# Leave TOAST_INSTALL_ROOT empty to not install the toast binaries outside -# of this directory. - -TOAST_INSTALL_ROOT = $(INSTALL_ROOT) -TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin -TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1 - -# Other tools - -SHELL = /bin/sh -LN = ln -BASENAME = basename -AR = ar -ARFLAGS = cr -RMFLAGS = -FIND = find -COMPRESS = compress -COMPRESSFLAGS = -# RANLIB = true -RANLIB = ranlib - -# -# You shouldn't have to configure below this line if you're porting. -# - - -# Local Directories - -ROOT = . -ADDTST = $(ROOT)/add-test -TST = $(ROOT)/tst -MAN = $(ROOT)/man -BIN = $(ROOT)/bin -SRC = $(ROOT)/src -LIB = $(ROOT)/lib -TLS = $(ROOT)/tls -INC = $(ROOT)/inc - -# Flags - -# DEBUG = -DNDEBUG -######### Remove -DNDEBUG to enable assertions. - -CFLAGS = $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \ - $(WAV49) $(CCINC) -I$(INC) -######### It's $(CC) $(CFLAGS) - -LFLAGS = $(LDFLAGS) $(LDINC) -######### It's $(LD) $(LFLAGS) - - -# Targets - -LIBGSM = $(LIB)/libgsm.a - -TOAST = $(BIN)/toast -UNTOAST = $(BIN)/untoast -TCAT = $(BIN)/tcat - -# Headers - -GSM_HEADERS = $(INC)/gsm.h - -HEADERS = $(INC)/proto.h \ - $(INC)/unproto.h \ - $(INC)/config.h \ - $(INC)/private.h \ - $(INC)/gsm.h \ - $(INC)/toast.h \ - $(TLS)/taste.h - -# Sources - -GSM_SOURCES = $(SRC)/add.c \ - $(SRC)/code.c \ - $(SRC)/debug.c \ - $(SRC)/decode.c \ - $(SRC)/long_term.c \ - $(SRC)/lpc.c \ - $(SRC)/preprocess.c \ - $(SRC)/rpe.c \ - $(SRC)/gsm_destroy.c \ - $(SRC)/gsm_decode.c \ - $(SRC)/gsm_encode.c \ - $(SRC)/gsm_explode.c \ - $(SRC)/gsm_implode.c \ - $(SRC)/gsm_create.c \ - $(SRC)/gsm_print.c \ - $(SRC)/gsm_option.c \ - $(SRC)/short_term.c \ - $(SRC)/table.c - -TOAST_SOURCES = $(SRC)/toast.c \ - $(SRC)/toast_lin.c \ - $(SRC)/toast_ulaw.c \ - $(SRC)/toast_alaw.c \ - $(SRC)/toast_audio.c - -SOURCES = $(GSM_SOURCES) \ - $(TOAST_SOURCES) \ - $(ADDTST)/add_test.c \ - $(TLS)/sour.c \ - $(TLS)/ginger.c \ - $(TLS)/sour1.dta \ - $(TLS)/sour2.dta \ - $(TLS)/bitter.c \ - $(TLS)/bitter.dta \ - $(TLS)/taste.c \ - $(TLS)/sweet.c \ - $(TST)/cod2lin.c \ - $(TST)/cod2txt.c \ - $(TST)/gsm2cod.c \ - $(TST)/lin2cod.c \ - $(TST)/lin2txt.c - -# Object files - -GSM_OBJECTS = $(SRC)/add.o \ - $(SRC)/code.o \ - $(SRC)/debug.o \ - $(SRC)/decode.o \ - $(SRC)/long_term.o \ - $(SRC)/lpc.o \ - $(SRC)/preprocess.o \ - $(SRC)/rpe.o \ - $(SRC)/gsm_destroy.o \ - $(SRC)/gsm_decode.o \ - $(SRC)/gsm_encode.o \ - $(SRC)/gsm_explode.o \ - $(SRC)/gsm_implode.o \ - $(SRC)/gsm_create.o \ - $(SRC)/gsm_print.o \ - $(SRC)/gsm_option.o \ - $(SRC)/short_term.o \ - $(SRC)/table.o - -TOAST_OBJECTS = $(SRC)/toast.o \ - $(SRC)/toast_lin.o \ - $(SRC)/toast_ulaw.o \ - $(SRC)/toast_alaw.o \ - $(SRC)/toast_audio.o - -OBJECTS = $(GSM_OBJECTS) $(TOAST_OBJECTS) - -# Manuals - -GSM_MANUALS = $(MAN)/gsm.3 \ - $(MAN)/gsm_explode.3 \ - $(MAN)/gsm_option.3 \ - $(MAN)/gsm_print.3 - -TOAST_MANUALS = $(MAN)/toast.1 - -MANUALS = $(GSM_MANUALS) $(TOAST_MANUALS) $(MAN)/bitter.1 - -# Other stuff in the distribution - -STUFF = ChangeLog \ - INSTALL \ - MACHINES \ - MANIFEST \ - Makefile \ - README \ - $(ADDTST)/add_test.dta \ - $(TLS)/bitter.dta \ - $(TST)/run - - -# Install targets - -GSM_INSTALL_TARGETS = \ - $(GSM_INSTALL_LIB)/libgsm.a \ - $(GSM_INSTALL_INC)/gsm.h \ - $(GSM_INSTALL_MAN)/gsm.3 \ - $(GSM_INSTALL_MAN)/gsm_explode.3 \ - $(GSM_INSTALL_MAN)/gsm_option.3 \ - $(GSM_INSTALL_MAN)/gsm_print.3 - -TOAST_INSTALL_TARGETS = \ - $(TOAST_INSTALL_BIN)/toast \ - $(TOAST_INSTALL_BIN)/tcat \ - $(TOAST_INSTALL_BIN)/untoast \ - $(TOAST_INSTALL_MAN)/toast.1 - - -# Default rules - -.c.o: - $(CC) $(CFLAGS) $? - @-mv `$(BASENAME) $@` $@ > /dev/null 2>&1 - -# Target rules - -all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST) - @-echo $(ROOT): Done. - -tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result - @-echo tst: Done. - -addtst: $(ADDTST)/add $(ADDTST)/add_test.dta - $(ADDTST)/add < $(ADDTST)/add_test.dta > /dev/null - @-echo addtst: Done. - -misc: $(TLS)/sweet $(TLS)/bitter $(TLS)/sour $(TLS)/ginger \ - $(TST)/lin2txt $(TST)/cod2txt $(TST)/gsm2cod - @-echo misc: Done. - -install: toastinstall gsminstall - @-echo install: Done. - - -# The basic API: libgsm - -$(LIBGSM): $(LIB) $(GSM_OBJECTS) - -rm $(RMFLAGS) $(LIBGSM) - $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS) - $(RANLIB) $(LIBGSM) - - -# Toast, Untoast and Tcat -- the compress-like frontends to gsm. - -$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM) - $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB) - -$(UNTOAST): $(BIN) $(TOAST) - -rm $(RMFLAGS) $(UNTOAST) - $(LN) $(TOAST) $(UNTOAST) - -$(TCAT): $(BIN) $(TOAST) - -rm $(RMFLAGS) $(TCAT) - $(LN) $(TOAST) $(TCAT) - - -# The local bin and lib directories - -$(BIN): - if [ ! -d $(BIN) ] ; then mkdir $(BIN) ; fi - -$(LIB): - if [ ! -d $(LIB) ] ; then mkdir $(LIB) ; fi - - -# Installation - -gsminstall: - -if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \ - make $(GSM_INSTALL_TARGETS) ; \ - fi - -toastinstall: - -if [ x"$(TOAST_INSTALL_ROOT)" != x ]; then \ - make $(TOAST_INSTALL_TARGETS); \ - fi - -gsmuninstall: - -if [ x"$(GSM_INSTALL_ROOT)" != x ] ; then \ - rm $(RMFLAGS) $(GSM_INSTALL_TARGETS) ; \ - fi - -toastuninstall: - -if [ x"$(TOAST_INSTALL_ROOT)" != x ] ; then \ - rm $(RMFLAGS) $(TOAST_INSTALL_TARGETS); \ - fi - -$(TOAST_INSTALL_BIN)/toast: $(TOAST) - -rm $@ - cp $(TOAST) $@ - chmod 755 $@ - -$(TOAST_INSTALL_BIN)/untoast: $(TOAST_INSTALL_BIN)/toast - -rm $@ - ln $? $@ - -$(TOAST_INSTALL_BIN)/tcat: $(TOAST_INSTALL_BIN)/toast - -rm $@ - ln $? $@ - -$(TOAST_INSTALL_MAN)/toast.1: $(MAN)/toast.1 - -rm $@ - cp $? $@ - chmod 444 $@ - -$(GSM_INSTALL_MAN)/gsm.3: $(MAN)/gsm.3 - -rm $@ - cp $? $@ - chmod 444 $@ - -$(GSM_INSTALL_MAN)/gsm_option.3: $(MAN)/gsm_option.3 - -rm $@ - cp $? $@ - chmod 444 $@ - -$(GSM_INSTALL_MAN)/gsm_explode.3: $(MAN)/gsm_explode.3 - -rm $@ - cp $? $@ - chmod 444 $@ - -$(GSM_INSTALL_MAN)/gsm_print.3: $(MAN)/gsm_print.3 - -rm $@ - cp $? $@ - chmod 444 $@ - -$(GSM_INSTALL_INC)/gsm.h: $(INC)/gsm.h - -rm $@ - cp $? $@ - chmod 444 $@ - -$(GSM_INSTALL_LIB)/libgsm.a: $(LIBGSM) - -rm $@ - cp $? $@ - chmod 444 $@ - - -# Distribution - -dist: gsm-1.0.tar.Z - @echo dist: Done. - -gsm-1.0.tar.Z: $(STUFF) $(SOURCES) $(HEADERS) $(MANUALS) - ( cd $(ROOT)/..; \ - tar cvf - `cat $(ROOT)/gsm-1.0/MANIFEST \ - | sed '/^#/d'` \ - ) | $(COMPRESS) $(COMPRESSFLAGS) > $(ROOT)/gsm-1.0.tar.Z - -# Clean - -uninstall: toastuninstall gsmuninstall - @-echo uninstall: Done. - -semi-clean: - -rm $(RMFLAGS) */*.o \ - $(TST)/lin2cod $(TST)/lin2txt \ - $(TST)/cod2lin $(TST)/cod2txt \ - $(TST)/gsm2cod \ - $(TST)/*.*.* - -$(FIND) . \( -name core -o -name foo \) \ - -print | xargs rm $(RMFLAGS) - -clean: semi-clean - -rm $(RMFLAGS) $(LIBGSM) $(ADDTST)/add \ - $(TOAST) $(TCAT) $(UNTOAST) \ - $(ROOT)/gsm-1.0.tar.Z - - -# Two tools that helped me generate gsm_encode.c and gsm_decode.c, -# but aren't generally needed to port this. - -$(TLS)/sweet: $(TLS)/sweet.o $(TLS)/taste.o - $(LD) $(LFLAGS) -o $(TLS)/sweet \ - $(TLS)/sweet.o $(TLS)/taste.o $(LDLIB) - -$(TLS)/bitter: $(TLS)/bitter.o $(TLS)/taste.o - $(LD) $(LFLAGS) -o $(TLS)/bitter \ - $(TLS)/bitter.o $(TLS)/taste.o $(LDLIB) - -# A version of the same family that Jeff Chilton used to implement -# the WAV #49 GSM format. - -$(TLS)/ginger: $(TLS)/ginger.o $(TLS)/taste.o - $(LD) $(LFLAGS) -o $(TLS)/ginger \ - $(TLS)/ginger.o $(TLS)/taste.o $(LDLIB) - -$(TLS)/sour: $(TLS)/sour.o $(TLS)/taste.o - $(LD) $(LFLAGS) -o $(TLS)/sour \ - $(TLS)/sour.o $(TLS)/taste.o $(LDLIB) - -# Run $(ADDTST)/add < $(ADDTST)/add_test.dta to make sure the -# basic arithmetic functions work as intended. - -$(ADDTST)/add: $(ADDTST)/add_test.o - $(LD) $(LFLAGS) -o $(ADDTST)/add $(ADDTST)/add_test.o $(LDLIB) - - -# Various conversion programs between linear, text, .gsm and the code -# format used by the tests we ran (.cod). We paid for the test data, -# so I guess we can't just provide them with this package. Still, -# if you happen to have them lying around, here's the code. -# -# You can use gsm2cod | cod2txt independently to look at what's -# coded inside the compressed frames, although this shouldn't be -# hard to roll on your own using the gsm_print() function from -# the API. - - -$(TST)/test-result: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/run - ( cd $(TST); ./run ) - -$(TST)/lin2txt: $(TST)/lin2txt.o $(LIBGSM) - $(LD) $(LFLAGS) -o $(TST)/lin2txt \ - $(TST)/lin2txt.o $(LIBGSM) $(LDLIB) - -$(TST)/lin2cod: $(TST)/lin2cod.o $(LIBGSM) - $(LD) $(LFLAGS) -o $(TST)/lin2cod \ - $(TST)/lin2cod.o $(LIBGSM) $(LDLIB) - -$(TST)/gsm2cod: $(TST)/gsm2cod.o $(LIBGSM) - $(LD) $(LFLAGS) -o $(TST)/gsm2cod \ - $(TST)/gsm2cod.o $(LIBGSM) $(LDLIB) - -$(TST)/cod2txt: $(TST)/cod2txt.o $(LIBGSM) - $(LD) $(LFLAGS) -o $(TST)/cod2txt \ - $(TST)/cod2txt.o $(LIBGSM) $(LDLIB) - -$(TST)/cod2lin: $(TST)/cod2lin.o $(LIBGSM) - $(LD) $(LFLAGS) -o $(TST)/cod2lin \ - $(TST)/cod2lin.o $(LIBGSM) $(LDLIB) diff --git a/third_party/gsm/README b/third_party/gsm/README deleted file mode 100644 index cb6af85..0000000 --- a/third_party/gsm/README +++ /dev/null @@ -1,37 +0,0 @@ - -GSM 06.10 13 kbit/s RPE/LTP speech compression available --------------------------------------------------------- - -The Communications and Operating Systems Research Group (KBS) at the -Technische Universitaet Berlin is currently working on a set of -UNIX-based tools for computer-mediated telecooperation that will be -made freely available. - -As part of this effort we are publishing an implementation of the -European GSM 06.10 provisional standard for full-rate speech -transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse -excitation/long term prediction) coding at 13 kbit/s. - -GSM 06.10 compresses frames of 160 13-bit samples (8 kHz sampling -rate, i.e. a frame rate of 50 Hz) into 260 bits; for compatibility -with typical UNIX applications, our implementation turns frames of 160 -16-bit linear samples into 33-byte frames (1650 Bytes/s). -The quality of the algorithm is good enough for reliable speaker -recognition; even music often survives transcoding in recognizable -form (given the bandwidth limitations of 8 kHz sampling rate). - -The interfaces offered are a front end modelled after compress(1), and -a library API. Compression and decompression run faster than realtime -on most SPARCstations. The implementation has been verified against the -ETSI standard test patterns. - -Jutta Degener (jutta@cs.tu-berlin.de) -Carsten Bormann (cabo@cs.tu-berlin.de) - -Communications and Operating Systems Research Group, TU Berlin -Fax: +49.30.31425156, Phone: +49.30.31424315 - --- -Copyright 1992 by Jutta Degener and Carsten Bormann, Technische -Universitaet Berlin. See the accompanying file "COPYRIGHT" for -details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. diff --git a/third_party/gsm/add-test/add_test.c b/third_party/gsm/add-test/add_test.c deleted file mode 100644 index 8e832df..0000000 --- a/third_party/gsm/add-test/add_test.c +++ /dev/null @@ -1,353 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/add_test.c,v 1.2 1994/05/10 20:18:17 jutta Exp $ */ - -#include -#include -#include - -#include "gsm.h" - -#include "../src/add.c" - -int interactive = 1; - -char * opname; -longword L_op1, L_op2, L_expect; -word op1, op2, expect; -int do_expect; - -word M_gsm_add P((word op1, word op2)); -word M_gsm_sub P((word op1, word op2)); -word M_gsm_mult P((word op1, word op2)); -word M_gsm_mult_r P((word op1, word op2)); -word M_gsm_abs P((word op1)); -longword M_gsm_L_mult P((word op1, word op2)); -longword M_gsm_L_add P((longword op1, longword op2)); - -help() -{ -puts( " add a b sub a b mult a b div a b" ); -puts( "L_add A B L_sub A B L_mult A B mult_r a b" ); -puts( "" ); -puts( "abs a norm a >> a b << a b" ); -puts( " L_>> A B L_<< A B" ); - -} - -char * strtek P2((str, sep), char * str, char * sep) { - - static char * S = (char *)0; - char * c, * base; - - if (str) S = str; - - if (!S || !*S) return (char *)0; - - /* Skip delimiters. - */ - while (*S) { - for (c = sep; *c && *c != *S; c++) ; - if (*c) *S++ = 0; - else break; - } - - base = S; - - /* Skip non-delimiters. - */ - for (base = S; *S; S++) { - - for (c = sep; *c; c++) - if (*c == *S) { - *S++ = 0; - return base; - } - } - - return base == S ? (char *)0 : base; -} - -long value P1((s), char * s) -{ - switch (*s) { - case '-': switch (s[1]) { - case '\0': return MIN_WORD; - case '-': return MIN_LONGWORD; - default: break; - } - break; - - case '+': switch (s[1]) { - case '\0': return MAX_WORD; - case '+': return MAX_LONGWORD; - default: break; - } - default: break; - } - - return strtol(s, (char **)0, 0); -} - -char * parse P1((buf), char * buf) -{ - char * s, * a; - long l; - - if (a = strchr(buf, '=')) *a++ = 0; - - opname = s = strtek(buf, " \t("); - if (!s) return (char *)0; - - op1 = op2 = L_op1 = L_op2 = 0; - - if (s = strtek( (char *)0, "( \t,")) { - op1 = L_op1 = value(s); - if (s = strtek( (char *)0, ", \t)")) op2 = L_op2 = value(s); - } - - if (a) { - do_expect = 1; - while (*a == ' ' || *a == '\t') a++; - expect = L_expect = value(a); - } - - return opname; -} - -void fprint_word P2((f, w), FILE * f, word w) -{ - if (!w) putc('0', f); - else fprintf(f, "0x%4.4x (%d%s)", - (unsigned int)w, - (int)w, - w == MIN_WORD? "/-" : (w == MAX_WORD ? "/+" : "")); -} - -void print_word P1((w), word w) -{ - fprint_word( stdout, w ); -} - -void fprint_longword P2((f, w), FILE * f, longword w) -{ - if (!w) putc('0', f); - else fprintf(f, "0x%8.8x (%ld%s)", - w, w, w == MIN_WORD ? "/-" - : (w == MAX_WORD ? "/+" - : (w == MIN_LONGWORD ? "/--" - : (w == MAX_LONGWORD ? "/++" : "")))); -} - -void print_longword P1((w),longword w) -{ - fprint_longword(stdout, w); -} - -void do_longword P1((w), longword w) -{ - if (interactive) print_longword(w); - if (do_expect) { - if (w != L_expect) { - if (!interactive) fprint_longword(stderr, w); - fprintf(stderr, " != %s (%ld, %ld) -- expected ", - opname, L_op1, L_op2 ); - fprint_longword(stderr, L_expect); - putc( '\n', stderr ); - } - } else if (interactive) putchar('\n'); -} - -void do_word P1((w), word w ) -{ - if (interactive) print_word(w); - if (do_expect) { - if (w != expect) { - if (!interactive) fprint_word(stderr, w); - fprintf(stderr, " != %s (%ld, %ld) -- expected ", - opname, L_op1, L_op2 ); - fprint_word(stderr, expect); - putc('\n', stderr); - } - } else if (interactive) putchar('\n'); -} - -int main(ac, av) char ** av; -{ - char buf[299]; - char * c; - FILE * in; - - if (ac > 2) { - fprintf(stderr, "Usage: %s [filename]\n", av[0]); -fail: -#ifdef EXIT_FAILURE - exit(EXIT_FAILURE); -#else - exit(1); -#endif - } - if (ac < 2) in = stdin; - else if (!(in = fopen(av[1], "r"))) { - perror(av[1]); - fprintf(stderr, "%s: cannot open file \"%s\" for reading\n", - av[0], av[1]); - goto fail; - } - - interactive = isatty(fileno(in)); - - for (;;) { - if (interactive) fprintf(stderr, "? "); - - if (!fgets(buf, sizeof(buf), in)) exit(0); - if (c = strchr(buf, '\n')) *c = 0; - - if (*buf == ';' || *buf == '#') continue; - if (*buf == '\'') { - puts(buf + 1); - continue; - } - if (*buf == '\"') { - fprintf(stderr, "%s\n", buf + 1); - continue; - } - - c = parse(buf); - - if (!c) continue; - if (!strcmp(c, "add")) { - do_word( gsm_add( op1, op2 )); - continue; - } - if (!strcmp(c, "M_add")) { - do_word( M_gsm_add( op1, op2 )); - continue; - } - if (!strcmp(c, "sub")) { - do_word( gsm_sub( op1, op2 )); - continue; - } - if (!strcmp(c, "M_sub")) { - do_word( M_gsm_sub( op1, op2 )); - continue; - } - if (!strcmp(c, "mult")) { - do_word( gsm_mult( op1, op2 )); - continue; - } - if (!strcmp(c, "M_mult")) { - do_word( M_gsm_mult( op1, op2 )); - continue; - } - if (!strcmp(c, "mult_r")) { - do_word( gsm_mult_r(op1, op2)); - continue; - } - if (!strcmp(c, "M_mult_r")) { - do_word( M_gsm_mult_r(op1, op2)); - continue; - } - if (!strcmp(c, "abs" )) { - do_word( gsm_abs(op1) ); - continue; - } - if (!strcmp(c, "M_abs" )) { - do_word( M_gsm_abs(op1) ); - continue; - } - if (!strcmp(c, "div" )) { - do_word( gsm_div( op1, op2 )); - continue; - } - if (!strcmp(c, "norm" )) { - do_word( gsm_norm(L_op1)); - continue; - } - if (!strcmp(c, "<<" )) { - do_word( gsm_asl( op1, op2)); - continue; - } - if (!strcmp(c, ">>" )) { - do_word( gsm_asr( op1, op2 )); - continue; - } - if (!strcmp(c, "L_mult")) { - do_longword( gsm_L_mult( op1, op2 )); - continue; - } - if (!strcmp(c, "M_L_mult")) { - do_longword( M_gsm_L_mult( op1, op2 )); - continue; - } - if (!strcmp(c, "L_add" )) { - do_longword( gsm_L_add( L_op1, L_op2 )); - continue; - } - if (!strcmp(c, "M_L_add" )) { - do_longword( M_gsm_L_add( L_op1, L_op2 )); - continue; - } - if (!strcmp(c, "L_sub" )) { - do_longword( gsm_L_sub( L_op1, L_op2 )); - continue; - } - if (!strcmp(c, "L_<<" )) { - do_longword( gsm_L_asl( L_op1, L_op2 )); - continue; - } - if (!strcmp(c, "L_>>")) { - do_longword( gsm_L_asr( L_op1, L_op2 )); - continue; - } - help(); - } -} - -#include "private.h" - -/* - * Function stubs for macro implementations of commonly used - * math functions - */ -word M_gsm_add P2((op1, op2),word op1, word op2) -{ - longword ltmp; - return GSM_ADD(op1, op2); -} - -word M_gsm_sub P2((op1, op2), word op1, word op2) -{ - longword ltmp; - return GSM_SUB(op1, op2); -} - -word M_gsm_mult P2((op1, op2), word op1, word op2) -{ - return GSM_MULT(op1, op2); -} - -word M_gsm_mult_r P2((op1, op2), word op1, word op2) -{ - return GSM_MULT_R(op1, op2); -} - -word M_gsm_abs P1((op1), word op1) -{ - return GSM_ABS(op1); -} - -longword M_gsm_L_mult P2((op1, op2), word op1, word op2) -{ - return GSM_L_MULT(op1, op2); -} - -longword M_gsm_L_add P2((op1, op2), longword op1, longword op2) -{ - ulongword utmp; - return GSM_L_ADD(op1, op2); -} diff --git a/third_party/gsm/add-test/add_test.dta b/third_party/gsm/add-test/add_test.dta deleted file mode 100644 index fe7402d..0000000 --- a/third_party/gsm/add-test/add_test.dta +++ /dev/null @@ -1,683 +0,0 @@ -; -; Copyright 1992 by Jutta Degener and Carsten Bormann, Technische -; Universitaet Berlin. See the accompanying file "COPYRIGHT" for -; details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. -; -; -; Lines starting with ' (in the first col) are echoed. -; Lines starting with " (in the first col) are echoed to stderr. -; Lines starting with ; or empty lines are ignored. -; -; The part after (including) a trailing '=' is what you expect; -; there will be output if the result is different. -; -; - and + by itself mean MIN_WORD and MAX_WORD, respectively; -; -- and ++ mean MIN_LONGWORD and MAX_LONGWORD. -; - -'test the basic arithmetic operations used for the rpe-ltd filtering. -' -'add ================ -' basic - - add 0 0 = 0 - add 7 4 = 11 - add 4 6 = 10 - add 1 1 = 2 - -' negative operands - - add -7 4 = -3 - add 4 -6 = -2 - add -1 -3 = -4 - add 7 -4 = 3 - add -4 6 = 2 - -' positive overflow -; (max-word = 32767) - add + 1 = + - add + + = + - add -1 + = 32766 - add 32766 2 = + - add 1 32766 = + - -' underflow -; (min-word = 32768) - - add - -1 = - - add - - = - - add 1 - = -32767 - add -32767 -2 = - - add -1 -32766 = -32767 - add -32767 -1 = - - add - + = -1 - add + - = -1 - add 0 - = - - add 0 + = + -' - -'L_add ================ -' basic - - L_add 0 0 = 0 - L_add 7 4 = 11 - L_add 4 6 = 10 - L_add 1 1 = 2 - -' negative operands - - L_add -7 4 = -3 - L_add 4 -6 = -2 - L_add -1 -3 = -4 - L_add 7 -4 = 3 - L_add -4 6 = 2 - L_add 0 -1 = -1 - -' positive overflow -; (max-longword = 2147483647) - L_add ++ 1 = ++ - L_add ++ ++ = ++ - L_add -1 ++ = 2147483646 - L_add 2147483646 2 = ++ - L_add 1 2147483645 = 2147483646 - -' underflow -; (min-longword = -2147483648) - - L_add -- -1 = -- - L_add -- -- = -- - L_add 1 -- = -2147483647 - L_add -2147483647 -2 = -- - L_add -1 -2147483646 = -2147483647 - L_add -2147483647 -1 = -- - L_add -- ++ = -1 - L_add ++ -- = -1 - L_add 0 -- = -- - L_add 0 ++ = ++ -' - -'sub ================ -' basic - - sub 0 0 = 0 - sub 7 4 = 3 - sub 4 6 = -2 - sub 1 0 = 1 - -' negative operands - - sub -7 4 = -11 - sub 4 -6 = 10 - sub -1 -3 = 2 - sub 7 -4 = 11 - sub -4 6 = -10 - -' positive overflow -; (max-word = 32767) - sub 1 - = + - sub + + = 0 - sub + 0 = + - sub + -1 = + - sub + 1 = 32766 - sub 1 + = -32766 - sub 0 + = -32767 - -' underflow -; (min-word = 32768) - - sub - -1 = -32767 - sub - 1 = - - sub - - = 0 - sub - + = - - sub + - = + - sub 1 - = + - sub -1 - = + - sub -32767 2 = - - sub 0 - = + -' - -'L_sub ================ -' basic - - L_sub 0 0 = 0 - L_sub 7 4 = 3 - L_sub 4 6 = -2 - L_sub 1 0 = 1 - -' negative operands - - L_sub -7 4 = -11 - L_sub 4 -6 = 10 - L_sub -1 -3 = 2 - L_sub 7 -4 = 11 - L_sub -4 6 = -10 - -' positive overflow - L_sub 1 -- = ++ - L_sub ++ ++ = 0 - L_sub ++ 0 = ++ - L_sub ++ -1 = ++ - L_sub ++ 1 = 2147483646 - L_sub 1 ++ = -2147483646 - L_sub 0 ++ = -2147483647 - -' underflow - - L_sub -- -1 = -2147483647 - L_sub -- 1 = -- - L_sub -- -- = 0 - L_sub -- ++ = -- - L_sub + -- = ++ - L_sub 1 -- = ++ - L_sub -1 -- = ++ - L_sub -2147483647 2 = -- - L_sub 0 -- = ++ - -' -'abs ================ -' basic - - abs 0 = 0 - abs 2 = 2 - abs -459 = 459 - -' overflow - - abs + = + - abs - = + - abs -32767 = + - abs 32766 = 32766 - abs -32766 = 32766 - -' -'mult ================ -; actually, a * b >> 15 - -' basic - mult 0 0 = 0 - mult 0x100 0x100 = 2 - mult 4711 0x4000 = 2355 - -' negative operands - mult -1 0 = 0 - - mult -0x100 0x100 = -2 - mult 0x100 -0x100 = -2 - mult -0x100 -0x100 = 2 - - mult -4711 0x4000 = -2356 - mult 4711 -0x4000 = -2356 - mult -4711 -0x4000 = 2355 - -' overflow - mult + + = 32766 - mult + 0x4000 = 0x3fff - mult 0x4000 + = 0x3fff - mult + 1 = 0 - mult + 2 = 1 - mult + 3 = 2 - -' underflow - mult - - = + - mult - + = -32767 - mult + - = -32767 - mult - 1 = -1 - mult - 2 = -2 - mult - 3 = -3 - -' -'mult_r ================ -; actually, (a * b + 16384) >> 15 - -' basic - mult_r 0 0 = 0 - mult_r 0x100 0x100 = 2 - mult_r 4711 0x4000 = 2356 - -' negative operands - mult_r -1 0 = 0 - - mult_r -0x100 0x100 = -2 - mult_r 0x100 -0x100 = -2 - mult_r -0x100 -0x100 = 2 - - mult_r -4711 0x4000 = -2355 - mult_r 4711 -0x4000 = -2355 - mult_r -4711 -0x4000 = 2356 - -' overflow - mult_r + + = 32766 - mult_r + 32766 = 32765 - mult_r 32766 + = 32765 - mult_r + 0x4000 = 0x4000 - mult_r 0x4000 + = 0x4000 - mult_r + 0x4001 = 0x4000 - mult_r 0x4001 + = 0x4000 - mult_r + 2 = 2 - mult_r + 1 = 1 - mult_r 1 + = 1 - mult_r + 0 = 0 - mult_r 0 + = 0 - -' underflow - mult_r - - = + - mult_r - + = -32767 - mult_r + - = -32767 - mult_r - 1 = -1 - mult_r - 2 = -2 - mult_r - 3 = -3 - -' -'L_mult ================ -; actually, (a * b) << 1 -; assert (a != MIN_WORD && b != MIN_WORD) - -' basic - L_mult 0 0 = 0 - L_mult 2 3 = 12 - L_mult 4711 5 = 47110 - -' negative operands - - L_mult -2 3 = -12 - L_mult 2 -3 = -12 - L_mult -2 -3 = 12 - L_mult -4711 5 = -47110 - L_mult 4711 -5 = -47110 - L_mult -4711 -5 = 47110 - -' overflow - L_mult + + = 2147352578 - L_mult + -32767 = -2147352578 - L_mult -32767 + = -2147352578 - L_mult + 2 = 131068 - L_mult + 1 = 65534 - L_mult 1 + = 65534 - L_mult + 0 = 0 - L_mult 0 + = 0 - -' -'div ================ -; actually, (32767 * a) / b -; assert (a > 0 && b >= a) - -' basic - div 1 1 = + - div 4711 4711 = + - div 5 10 = 0x4000 - div 5 20 = 0x2000 - div 5 40 = 0x1000 - -' overflow - div + + = + - div 0x4000 + = 0x4000 - div 1 + = 1 - div 1 2 = 0x4000 -' -'norm ================ - -' positive - norm 1 = 30 - norm 2 = 29 - norm 3 = 29 - norm 4 = 28 - norm 5 = 28 -; etc, etc... - norm 0x08000000 = 3 - norm 0x10000000 = 2 - norm 0x20000000 = 1 - norm 0x20000001 = 1 - norm 0x3fffffff = 1 - norm 0x40000000 = 0 - norm 0x40000001 = 0 - norm 0x4ffffffe = 0 - norm ++ = 0 - -' negative - norm -1 = 31 - norm -2 = 30 - norm -3 = 29 - norm -4 = 29 - norm -5 = 28 -; etc, etc... - norm 0x4fffffff = 0 - norm -- = 0 -' -'>> ================ - -' basic - >> 1 1 = 0 - >> 4 2 = 1 - >> 0x1100 5 = 0x88 - -' negative operand - - >> 1 -1 = 2 - >> 1 -2 = 4 - >> 0x88 -5 = 0x1100 - -' overflow - >> -1 4711 = -1 - >> 1 4711 = 0 - >> -4711 4711 = -1 - >> 4711 4711 = 0 - >> + 1 = 16383 - >> - 1 = -16384 -' -'L_>> ================ - -' basic - L_>> 1 1 = 0 - L_>> 4 2 = 1 - L_>> 0x1100 5 = 0x88 - -' negative operand - - L_>> 1 -1 = 2 - L_>> 1 -2 = 4 - L_>> 0x88 -5 = 0x1100 - -' overflow - L_>> -1 4711 = -1 - L_>> 1 4711 = 0 - L_>> -4711 4711 = -1 - L_>> 4711 4711 = 0 - L_>> ++ 1 = 1073741823 - L_>> -- 1 = -1073741824 - -' -'<< ================ - -' basic - << 1 1 = 2 - << 4 2 = 16 - << 0x0088 5 = 0x1100 - -' negative operand - - << 1 -1 = 0 - << 4 -2 = 1 - << 0x1100 -5 = 0x0088 - -' overflow - << -1 4711 = 0 - << 1 4711 = 0 - << -4711 4711 = 0 - << 4711 4711 = 0 - << 4711 -4711 = 0 - << -4711 -4711 = -1 - << + 1 = 0xfffe - << -1 1 = 0xfffe - << - 1 = 0 -' -'L_<< ================ - -' basic - L_<< 1 1 = 2 - L_<< 4 2 = 16 - L_<< 0x0088 5 = 0x1100 - -' negative operand - - L_<< 1 -1 = 0 - L_<< 4 -2 = 1 - L_<< 0x1100 -5 = 0x0088 - -' overflow - L_<< -1 4711 = 0 - L_<< 1 4711 = 0 - L_<< -4711 4711 = 0 - L_<< 4711 4711 = 0 - L_<< 4711 -4711 = 0 - L_<< -4711 -4711 = -1 - L_<< ++ 1 = -2 - L_<< -1 1 = -2 - L_<< -- 1 = 0 - -'macros -' -'add ================ -' basic - - M_add 0 0 = 0 - M_add 7 4 = 11 - M_add 4 6 = 10 - M_add 1 1 = 2 - -' negative operands - - M_add -7 4 = -3 - M_add 4 -6 = -2 - M_add -1 -3 = -4 - M_add 7 -4 = 3 - M_add -4 6 = 2 - -' positive overflow -; (max-word = 32767) - M_add + 1 = + - M_add + + = + - M_add -1 + = 32766 - M_add 32766 2 = + - M_add 1 32766 = + - -' underflow -; (min-word = 32768) - - M_add - -1 = - - M_add - - = - - M_add 1 - = -32767 - M_add -32767 -2 = - - M_add -1 -32766 = -32767 - M_add -32767 -1 = - - M_add - + = -1 - M_add + - = -1 - M_add 0 - = - - M_add 0 + = + -' - -'L_add ================ -' basic - - M_L_add 0 0 = 0 - M_L_add 7 4 = 11 - M_L_add 4 6 = 10 - M_L_add 1 1 = 2 - -' negative operands - - M_L_add -7 4 = -3 - M_L_add 4 -6 = -2 - M_L_add -1 -3 = -4 - M_L_add 7 -4 = 3 - M_L_add -4 6 = 2 - M_L_add 0 -1 = -1 - -' positive overflow -; (max-longword = 2147483647) - M_L_add ++ 1 = ++ - M_L_add ++ ++ = ++ - M_L_add -1 ++ = 2147483646 - M_L_add 2147483646 2 = ++ - M_L_add 1 2147483645 = 2147483646 - -' underflow -; (min-longword = -2147483648) - - M_L_add -- -1 = -- - M_L_add -- -- = -- - M_L_add 1 -- = -2147483647 - M_L_add -2147483647 -2 = -- - M_L_add -1 -2147483646 = -2147483647 - M_L_add -2147483647 -1 = -- - M_L_add -- ++ = -1 - M_L_add ++ -- = -1 - M_L_add 0 -- = -- - M_L_add 0 ++ = ++ -' - -'sub ================ -' basic - - M_sub 0 0 = 0 - M_sub 7 4 = 3 - M_sub 4 6 = -2 - M_sub 1 0 = 1 - -' negative operands - - M_sub -7 4 = -11 - M_sub 4 -6 = 10 - M_sub -1 -3 = 2 - M_sub 7 -4 = 11 - M_sub -4 6 = -10 - -' positive overflow -; (max-word = 32767) - M_sub 1 - = + - M_sub + + = 0 - M_sub + 0 = + - M_sub + -1 = + - M_sub + 1 = 32766 - M_sub 1 + = -32766 - M_sub 0 + = -32767 - -' underflow -; (min-word = 32768) - - M_sub - -1 = -32767 - M_sub - 1 = - - M_sub - - = 0 - M_sub - + = - - M_sub + - = + - M_sub 1 - = + - M_sub -1 - = + - M_sub -32767 2 = - - M_sub 0 - = + -' -' -'abs ================ -' basic - - M_abs 0 = 0 - M_abs 2 = 2 - M_abs -459 = 459 - -' overflow - - M_abs + = + - M_abs - = + - M_abs -32767 = + - M_abs 32766 = 32766 - M_abs -32766 = 32766 - -' -'mult ================ -; actually, a * b >> 15 - -' basic - M_mult 0 0 = 0 - M_mult 0x100 0x100 = 2 - M_mult 4711 0x4000 = 2355 - -' negative operands - M_mult -1 0 = 0 - - M_mult -0x100 0x100 = -2 - M_mult 0x100 -0x100 = -2 - M_mult -0x100 -0x100 = 2 - - M_mult -4711 0x4000 = -2356 - M_mult 4711 -0x4000 = -2356 - M_mult -4711 -0x4000 = 2355 - -' overflow - M_mult + + = 32766 - M_mult + 0x4000 = 0x3fff - M_mult 0x4000 + = 0x3fff - M_mult + 1 = 0 - M_mult + 2 = 1 - M_mult + 3 = 2 - -' underflow -; M_mult - - = + assert !(a == b && b == MIN_WORD) - M_mult - -32767 = + - M_mult -32767 - = + - M_mult - + = -32767 - M_mult + - = -32767 - M_mult - 1 = -1 - M_mult - 2 = -2 - M_mult - 3 = -3 - -' -'mult_r ================ -; actually, (a * b + 16384) >> 15 - -' basic - M_mult_r 0 0 = 0 - M_mult_r 0x100 0x100 = 2 - M_mult_r 4711 0x4000 = 2356 - -' negative operands - M_mult_r -1 0 = 0 - - M_mult_r -0x100 0x100 = -2 - M_mult_r 0x100 -0x100 = -2 - M_mult_r -0x100 -0x100 = 2 - - M_mult_r -4711 0x4000 = -2355 - M_mult_r 4711 -0x4000 = -2355 - M_mult_r -4711 -0x4000 = 2356 - -' overflow - M_mult_r + + = 32766 - M_mult_r + 32766 = 32765 - M_mult_r 32766 + = 32765 - M_mult_r + 0x4000 = 0x4000 - M_mult_r 0x4000 + = 0x4000 - M_mult_r + 0x4001 = 0x4000 - M_mult_r 0x4001 + = 0x4000 - M_mult_r + 2 = 2 - M_mult_r + 1 = 1 - M_mult_r 1 + = 1 - M_mult_r + 0 = 0 - M_mult_r 0 + = 0 - -' underflow -; M_mult_r - - = + assert !(a == b && b == MIN_WORD) - M_mult_r - -32767 = + - M_mult_r -32767 - = + - M_mult_r - + = -32767 - M_mult_r + - = -32767 - M_mult_r - 1 = -1 - M_mult_r - 2 = -2 - M_mult_r - 3 = -3 - -' -'L_mult ================ -; actually, (a * b) << 1 -; assert (a != MIN_WORD && b != MIN_WORD) - -' basic - M_L_mult 0 0 = 0 - M_L_mult 2 3 = 12 - M_L_mult 4711 5 = 47110 - -' negative operands - - M_L_mult -2 3 = -12 - M_L_mult 2 -3 = -12 - M_L_mult -2 -3 = 12 - M_L_mult -4711 5 = -47110 - M_L_mult 4711 -5 = -47110 - M_L_mult -4711 -5 = 47110 - -' overflow - M_L_mult + + = 2147352578 - M_L_mult + -32767 = -2147352578 - M_L_mult -32767 + = -2147352578 - M_L_mult + 2 = 131068 - M_L_mult + 1 = 65534 - M_L_mult 1 + = 65534 - M_L_mult + 0 = 0 - M_L_mult 0 + = 0 - diff --git a/third_party/gsm/bin/.keep b/third_party/gsm/bin/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/third_party/gsm/inc/config.h b/third_party/gsm/inc/config.h deleted file mode 100644 index ab36012..0000000 --- a/third_party/gsm/inc/config.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/config.h,v 1.5 1996/07/02 11:26:20 jutta Exp $*/ - -#ifndef CONFIG_H -#define CONFIG_H - -/*efine SIGHANDLER_T int * signal handlers are void */ -/*efine HAS_SYSV_SIGNAL 1 * sigs not blocked/reset? */ - -#define HAS_STDLIB_H 1 /* /usr/include/stdlib.h */ -#define HAS_LIMITS_H 1 /* /usr/include/limits.h */ -#define HAS_FCNTL_H 1 /* /usr/include/fcntl.h */ -#define HAS_ERRNO_DECL 1 /* errno.h declares errno */ - -#define HAS_FSTAT 1 /* fstat syscall */ -#define HAS_FCHMOD 1 /* fchmod syscall */ -#define HAS_CHMOD 1 /* chmod syscall */ -#define HAS_FCHOWN 1 /* fchown syscall */ -#define HAS_CHOWN 1 /* chown syscall */ -/*efine HAS__FSETMODE 1 * _fsetmode -- set file mode */ - -#define HAS_STRING_H 1 /* /usr/include/string.h */ -/*efine HAS_STRINGS_H 1 * /usr/include/strings.h */ - -#define HAS_UNISTD_H 1 /* /usr/include/unistd.h */ -#define HAS_UTIME 1 /* POSIX utime(path, times) */ -/*efine HAS_UTIMES 1 * use utimes() syscall instead */ -#define HAS_UTIME_H 1 /* UTIME header file */ -#define HAS_UTIMBUF 1 /* struct utimbuf */ -/*efine HAS_UTIMEUSEC 1 * microseconds in utimbuf? */ - -#endif /* CONFIG_H */ diff --git a/third_party/gsm/inc/gsm.h b/third_party/gsm/inc/gsm.h deleted file mode 100644 index 4714ab6..0000000 --- a/third_party/gsm/inc/gsm.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /home/kbs/jutta/src/gsm/gsm-1.0/inc/RCS/gsm.h,v 1.11 1996/07/05 18:02:56 jutta Exp $*/ - -#ifndef GSM_H -#define GSM_H - -#ifdef __cplusplus -# define NeedFunctionPrototypes 1 -#endif - -#if __STDC__ -# define NeedFunctionPrototypes 1 -#endif - -#ifdef _NO_PROTO -# undef NeedFunctionPrototypes -#endif - -#ifdef NeedFunctionPrototypes -# include /* for FILE * */ -#endif - -#undef GSM_P -#if NeedFunctionPrototypes -# define GSM_P( protos ) protos -#else -# define GSM_P( protos ) ( /* protos */ ) -#endif - -/* - * Interface - */ - -typedef struct gsm_state * gsm; -typedef short gsm_signal; /* signed 16 bit */ -typedef unsigned char gsm_byte; -typedef gsm_byte gsm_frame[33]; /* 33 * 8 bits */ - -#define GSM_MAGIC 0xD /* 13 kbit/s RPE-LTP */ - -#define GSM_PATCHLEVEL 10 -#define GSM_MINOR 0 -#define GSM_MAJOR 1 - -#define GSM_OPT_VERBOSE 1 -#define GSM_OPT_FAST 2 -#define GSM_OPT_LTP_CUT 3 -#define GSM_OPT_WAV49 4 -#define GSM_OPT_FRAME_INDEX 5 -#define GSM_OPT_FRAME_CHAIN 6 - -extern gsm gsm_create GSM_P((void)); -extern void gsm_destroy GSM_P((gsm)); - -extern int gsm_print GSM_P((FILE *, gsm, gsm_byte *)); -extern int gsm_option GSM_P((gsm, int, int *)); - -extern void gsm_encode GSM_P((gsm, gsm_signal *, gsm_byte *)); -extern int gsm_decode GSM_P((gsm, gsm_byte *, gsm_signal *)); - -extern int gsm_explode GSM_P((gsm, gsm_byte *, gsm_signal *)); -extern void gsm_implode GSM_P((gsm, gsm_signal *, gsm_byte *)); - -#undef GSM_P - -#endif /* GSM_H */ diff --git a/third_party/gsm/inc/private.h b/third_party/gsm/inc/private.h deleted file mode 100644 index 0c94255..0000000 --- a/third_party/gsm/inc/private.h +++ /dev/null @@ -1,269 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/private.h,v 1.6 1996/07/02 10:15:26 jutta Exp $*/ - -#ifndef PRIVATE_H -#define PRIVATE_H - -typedef short word; /* 16 bit signed int */ -typedef long longword; /* 32 bit signed int */ - -typedef unsigned short uword; /* unsigned word */ -typedef unsigned long ulongword; /* unsigned longword */ - -struct gsm_state { - - word dp0[ 280 ]; - word e[ 50 ]; /* code.c */ - - word z1; /* preprocessing.c, Offset_com. */ - longword L_z2; /* Offset_com. */ - int mp; /* Preemphasis */ - - word u[8]; /* short_term_aly_filter.c */ - word LARpp[2][8]; /* */ - word j; /* */ - - word ltp_cut; /* long_term.c, LTP crosscorr. */ - word nrp; /* 40 */ /* long_term.c, synthesis */ - word v[9]; /* short_term.c, synthesis */ - word msr; /* decoder.c, Postprocessing */ - - char verbose; /* only used if !NDEBUG */ - char fast; /* only used if FAST */ - - char wav_fmt; /* only used if WAV49 defined */ - unsigned char frame_index; /* odd/even chaining */ - unsigned char frame_chain; /* half-byte to carry forward */ -}; - - -#define MIN_WORD (-32767 - 1) -#define MAX_WORD 32767 - -#define MIN_LONGWORD (-2147483647 - 1) -#define MAX_LONGWORD 2147483647 - -#ifdef SASR /* flag: >> is a signed arithmetic shift right */ -#undef SASR -#define SASR(x, by) ((x) >> (by)) -#else -#define SASR(x, by) ((x) >= 0 ? (x) >> (by) : (~(-((x) + 1) >> (by)))) -#endif /* SASR */ - -#include "proto.h" - -/* - * Prototypes from add.c - */ -extern word gsm_mult P((word a, word b)); -extern longword gsm_L_mult P((word a, word b)); -extern word gsm_mult_r P((word a, word b)); - -extern word gsm_div P((word num, word denum)); - -extern word gsm_add P(( word a, word b )); -extern longword gsm_L_add P(( longword a, longword b )); - -extern word gsm_sub P((word a, word b)); -extern longword gsm_L_sub P((longword a, longword b)); - -extern word gsm_abs P((word a)); - -extern word gsm_norm P(( longword a )); - -extern longword gsm_L_asl P((longword a, int n)); -extern word gsm_asl P((word a, int n)); - -extern longword gsm_L_asr P((longword a, int n)); -extern word gsm_asr P((word a, int n)); - -/* - * Inlined functions from add.h - */ - -/* - * #define GSM_MULT_R(a, b) (* word a, word b, !(a == b == MIN_WORD) *) \ - * (0x0FFFF & SASR(((longword)(a) * (longword)(b) + 16384), 15)) - */ -#define GSM_MULT_R(a, b) /* word a, word b, !(a == b == MIN_WORD) */ \ - (SASR( ((longword)(a) * (longword)(b) + 16384), 15 )) - -# define GSM_MULT(a,b) /* word a, word b, !(a == b == MIN_WORD) */ \ - (SASR( ((longword)(a) * (longword)(b)), 15 )) - -# define GSM_L_MULT(a, b) /* word a, word b */ \ - (((longword)(a) * (longword)(b)) << 1) - -# define GSM_L_ADD(a, b) \ - ( (a) < 0 ? ( (b) >= 0 ? (a) + (b) \ - : (utmp = (ulongword)-((a) + 1) + (ulongword)-((b) + 1)) \ - >= MAX_LONGWORD ? MIN_LONGWORD : -(longword)utmp-2 ) \ - : ((b) <= 0 ? (a) + (b) \ - : (utmp = (ulongword)(a) + (ulongword)(b)) >= MAX_LONGWORD \ - ? MAX_LONGWORD : utmp)) - -/* - * # define GSM_ADD(a, b) \ - * ((ltmp = (longword)(a) + (longword)(b)) >= MAX_WORD \ - * ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp) - */ -/* Nonportable, but faster: */ - -#define GSM_ADD(a, b) \ - ((ulongword)((ltmp = (longword)(a) + (longword)(b)) - MIN_WORD) > \ - MAX_WORD - MIN_WORD ? (ltmp > 0 ? MAX_WORD : MIN_WORD) : ltmp) - -# define GSM_SUB(a, b) \ - ((ltmp = (longword)(a) - (longword)(b)) >= MAX_WORD \ - ? MAX_WORD : ltmp <= MIN_WORD ? MIN_WORD : ltmp) - -# define GSM_ABS(a) ((a) < 0 ? ((a) == MIN_WORD ? MAX_WORD : -(a)) : (a)) - -/* Use these if necessary: - -# define GSM_MULT_R(a, b) gsm_mult_r(a, b) -# define GSM_MULT(a, b) gsm_mult(a, b) -# define GSM_L_MULT(a, b) gsm_L_mult(a, b) - -# define GSM_L_ADD(a, b) gsm_L_add(a, b) -# define GSM_ADD(a, b) gsm_add(a, b) -# define GSM_SUB(a, b) gsm_sub(a, b) - -# define GSM_ABS(a) gsm_abs(a) - -*/ - -/* - * More prototypes from implementations.. - */ -extern void Gsm_Coder P(( - struct gsm_state * S, - word * s, /* [0..159] samples IN */ - word * LARc, /* [0..7] LAR coefficients OUT */ - word * Nc, /* [0..3] LTP lag OUT */ - word * bc, /* [0..3] coded LTP gain OUT */ - word * Mc, /* [0..3] RPE grid selection OUT */ - word * xmaxc,/* [0..3] Coded maximum amplitude OUT */ - word * xMc /* [13*4] normalized RPE samples OUT */)); - -extern void Gsm_Long_Term_Predictor P(( /* 4x for 160 samples */ - struct gsm_state * S, - word * d, /* [0..39] residual signal IN */ - word * dp, /* [-120..-1] d' IN */ - word * e, /* [0..40] OUT */ - word * dpp, /* [0..40] OUT */ - word * Nc, /* correlation lag OUT */ - word * bc /* gain factor OUT */)); - -extern void Gsm_LPC_Analysis P(( - struct gsm_state * S, - word * s, /* 0..159 signals IN/OUT */ - word * LARc)); /* 0..7 LARc's OUT */ - -extern void Gsm_Preprocess P(( - struct gsm_state * S, - word * s, word * so)); - -extern void Gsm_Encoding P(( - struct gsm_state * S, - word * e, - word * ep, - word * xmaxc, - word * Mc, - word * xMc)); - -extern void Gsm_Short_Term_Analysis_Filter P(( - struct gsm_state * S, - word * LARc, /* coded log area ratio [0..7] IN */ - word * d /* st res. signal [0..159] IN/OUT */)); - -extern void Gsm_Decoder P(( - struct gsm_state * S, - word * LARcr, /* [0..7] IN */ - word * Ncr, /* [0..3] IN */ - word * bcr, /* [0..3] IN */ - word * Mcr, /* [0..3] IN */ - word * xmaxcr, /* [0..3] IN */ - word * xMcr, /* [0..13*4] IN */ - word * s)); /* [0..159] OUT */ - -extern void Gsm_Decoding P(( - struct gsm_state * S, - word xmaxcr, - word Mcr, - word * xMcr, /* [0..12] IN */ - word * erp)); /* [0..39] OUT */ - -extern void Gsm_Long_Term_Synthesis_Filtering P(( - struct gsm_state* S, - word Ncr, - word bcr, - word * erp, /* [0..39] IN */ - word * drp)); /* [-120..-1] IN, [0..40] OUT */ - -void Gsm_RPE_Decoding P(( - struct gsm_state *S, - word xmaxcr, - word Mcr, - word * xMcr, /* [0..12], 3 bits IN */ - word * erp)); /* [0..39] OUT */ - -void Gsm_RPE_Encoding P(( - struct gsm_state * S, - word * e, /* -5..-1][0..39][40..44 IN/OUT */ - word * xmaxc, /* OUT */ - word * Mc, /* OUT */ - word * xMc)); /* [0..12] OUT */ - -extern void Gsm_Short_Term_Synthesis_Filter P(( - struct gsm_state * S, - word * LARcr, /* log area ratios [0..7] IN */ - word * drp, /* received d [0...39] IN */ - word * s)); /* signal s [0..159] OUT */ - -extern void Gsm_Update_of_reconstructed_short_time_residual_signal P(( - word * dpp, /* [0...39] IN */ - word * ep, /* [0...39] IN */ - word * dp)); /* [-120...-1] IN/OUT */ - -/* - * Tables from table.c - */ -#ifndef GSM_TABLE_C - -extern word gsm_A[8], gsm_B[8], gsm_MIC[8], gsm_MAC[8]; -extern word gsm_INVA[8]; -extern word gsm_DLB[4], gsm_QLB[4]; -extern word gsm_H[11]; -extern word gsm_NRFAC[8]; -extern word gsm_FAC[8]; - -#endif /* GSM_TABLE_C */ - -/* - * Debugging - */ -#ifdef NDEBUG - -# define gsm_debug_words(a, b, c, d) /* nil */ -# define gsm_debug_longwords(a, b, c, d) /* nil */ -# define gsm_debug_word(a, b) /* nil */ -# define gsm_debug_longword(a, b) /* nil */ - -#else /* !NDEBUG => DEBUG */ - - extern void gsm_debug_words P((char * name, int, int, word *)); - extern void gsm_debug_longwords P((char * name, int, int, longword *)); - extern void gsm_debug_longword P((char * name, longword)); - extern void gsm_debug_word P((char * name, word)); - -#endif /* !NDEBUG */ - -#include "unproto.h" - -#endif /* PRIVATE_H */ diff --git a/third_party/gsm/inc/proto.h b/third_party/gsm/inc/proto.h deleted file mode 100644 index 2851c08..0000000 --- a/third_party/gsm/inc/proto.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/proto.h,v 1.1 1992/10/28 00:11:08 jutta Exp $*/ - -#ifndef PROTO_H -#define PROTO_H - -#if __cplusplus -# define NeedFunctionPrototypes 1 -#endif - -#if __STDC__ -# define NeedFunctionPrototypes 1 -#endif - -#ifdef _NO_PROTO -# undef NeedFunctionPrototypes -#endif - -#undef P /* gnu stdio.h actually defines this... */ -#undef P0 -#undef P1 -#undef P2 -#undef P3 -#undef P4 -#undef P5 -#undef P6 -#undef P7 -#undef P8 - -#if NeedFunctionPrototypes - -# define P( protos ) protos - -# define P0() (void) -# define P1(x, a) (a) -# define P2(x, a, b) (a, b) -# define P3(x, a, b, c) (a, b, c) -# define P4(x, a, b, c, d) (a, b, c, d) -# define P5(x, a, b, c, d, e) (a, b, c, d, e) -# define P6(x, a, b, c, d, e, f) (a, b, c, d, e, f) -# define P7(x, a, b, c, d, e, f, g) (a, b, c, d, e, f, g) -# define P8(x, a, b, c, d, e, f, g, h) (a, b, c, d, e, f, g, h) - -#else /* !NeedFunctionPrototypes */ - -# define P( protos ) ( /* protos */ ) - -# define P0() () -# define P1(x, a) x a; -# define P2(x, a, b) x a; b; -# define P3(x, a, b, c) x a; b; c; -# define P4(x, a, b, c, d) x a; b; c; d; -# define P5(x, a, b, c, d, e) x a; b; c; d; e; -# define P6(x, a, b, c, d, e, f) x a; b; c; d; e; f; -# define P7(x, a, b, c, d, e, f, g) x a; b; c; d; e; f; g; -# define P8(x, a, b, c, d, e, f, g, h) x a; b; c; d; e; f; g; h; - -#endif /* !NeedFunctionPrototypes */ - -#endif /* PROTO_H */ diff --git a/third_party/gsm/inc/toast.h b/third_party/gsm/inc/toast.h deleted file mode 100644 index b42d9ae..0000000 --- a/third_party/gsm/inc/toast.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/toast.h,v 1.4 1995/03/07 21:26:16 jutta Exp $ */ - -#ifndef TOAST_H -#define TOAST_H /* Guard against multiple includes */ - -#include "config.h" - -#include -#include - -#include -#include -#include - -#include -#ifndef HAS_ERRNO_DECL - extern int errno; -#endif - -#ifdef HAS_LIMITS_H -#include -#endif - -#ifdef HAS_FCNTL_H -# include -#endif - -#ifdef HAS_UTIME -# ifdef HAS_UTIME_H -# include -# endif -#endif - -#include "gsm.h" - -#ifndef S_ISREG -#define S_ISREG(x) ((x) & S_IFREG) -#endif /* S_ISREG */ - - -# define READ "rb" -# define WRITE "wb" -#ifdef O_BINARY -# define O_WRITE_EXCL O_WRONLY|O_CREAT|O_EXCL|O_BINARY -#else -# define O_WRITE_EXCL O_WRONLY|O_CREAT|O_EXCL -#endif - -#ifndef SIGHANDLER_T -#define SIGHANDLER_T void /* what does a signal handler return? */ -#endif - - -#ifdef HAS_STRING_H -#include -#else -# ifdef HAS_STRINGS_H -# include -# else -# include "proto.h" - - extern int strlen P((char *)); - extern char * strcpy P((char *, char *)); - extern char * strcat P((char *, char *)); - extern char * strrchr P((char *, int)); - -# include "unproto.h" -# endif -#endif - - -#ifdef HAS_STDLIB_H -#include -#else -# include "proto.h" -# ifdef HAS_MALLOC_H -# include -# else - extern char * malloc P((unsigned)); -# endif - extern int exit P((int)); -# include "unproto.h" -#endif - - -#ifdef HAS_UNISTD_H -# include -#endif - -/* - * This suffix is tacked onto/removed from filenames - * similar to the way freeze and compress do it. - */ -#define SUFFIX_TOASTED ".gsm" - -#include "proto.h" - -extern int audio_init_input P((void)), audio_init_output P((void)); -extern int ulaw_input P((gsm_signal*)), ulaw_output P((gsm_signal *)); -extern int alaw_input P((gsm_signal*)), alaw_output P((gsm_signal *)); -extern int linear_input P((gsm_signal*)), linear_output P((gsm_signal *)); - -#endif /* TOAST_H */ diff --git a/third_party/gsm/inc/unproto.h b/third_party/gsm/inc/unproto.h deleted file mode 100644 index eaf866f..0000000 --- a/third_party/gsm/inc/unproto.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/unproto.h,v 1.1 1992/10/28 00:11:08 jutta Exp $*/ - -#ifdef PROTO_H /* sic */ -#undef PROTO_H - -#undef P -#undef P0 -#undef P1 -#undef P2 -#undef P3 -#undef P4 -#undef P5 -#undef P6 -#undef P7 -#undef P8 - -#endif /* PROTO_H */ diff --git a/third_party/gsm/lib/.keep b/third_party/gsm/lib/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/third_party/gsm/man/bitter.1 b/third_party/gsm/man/bitter.1 deleted file mode 100644 index 2dad78b..0000000 --- a/third_party/gsm/man/bitter.1 +++ /dev/null @@ -1,70 +0,0 @@ -.\" -.\" Copyright 1992 by Jutta Degener and Carsten Bormann, Technische -.\" Universitaet Berlin. See the accompanying file "COPYRIGHT" for -.\" details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. -.\" -.PU -.TH BITTER 1 -.SH NAME -bitter, sweet \(em code-generators for packing bits -.SH SYNOPSIS -bitter < input > output -.br -sweet < input > output -.SH "DESCRIPTION" -Bitter and sweet are two filters which turn a description of the -form -.nf - name number-of-bits - name number-of-bits - ... -.nf -into code. -.PP -Bitter generates code that packs the specified bits from their -variables into an array of unsigned char referenced by an -advancing pointer c. -.PP -Sweet generates code that unpacks the specified bits from an array -of unsigned char referenced by a mutable pointer c into the -named variables. -.\" .SH OPTIONS -.\" .SH "RETURN VALUE" -.\" .SH ERRORS -.SH EXAMPLES -.nf -% cat in -amaretto 1 -banana 2 -cherry 3 -strawberry 4 -vanilla 15 -walnut 15 - -% bitter < in - *c++ = ((amaretto & 0x1) << 7) - | ((banana & 0x3) << 5) - | ((cherry & 0x7) << 2) - | ((strawberry >> 2) & 0x3); - *c++ = ((strawberry & 0x3) << 6) - | ((vanilla >> 9) & 0x3F); - *c++ = ((vanilla >> 1) & 0xFF); - *c++ = ((vanilla & 0x1) << 7) - | ((walnut >> 8) & 0x7F); - *c++ = walnut & 0xFF; - -% sweet < in - amaretto = (*c >> 7) & 0x1; - banana = (*c >> 5) & 0x3; - cherry = (*c >> 2) & 0x7; - strawberry = (*c++ & 0x3) << 2; - strawberry |= (*c >> 6) & 0x3; - vanilla = (*c++ & 0x3F) << 9; - vanilla |= (*c++ & 0xFF) << 1; - vanilla |= (*c >> 7) & 0x1; - walnut = (*c++ & 0x7F) << 8; - walnut |= *c++; -.SH NOTES -This is a quick hack for the gsm_encode() and gsm_decode() routines. -.SH BUGS -Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. diff --git a/third_party/gsm/man/gsm.3 b/third_party/gsm/man/gsm.3 deleted file mode 100644 index e465762..0000000 --- a/third_party/gsm/man/gsm.3 +++ /dev/null @@ -1,105 +0,0 @@ -.\" -.\" Copyright 1992 by Jutta Degener and Carsten Bormann, Technische -.\" Universitaet Berlin. See the accompanying file "COPYRIGHT" for -.\" details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. -.\" -.PU -.TH GSM 3 -.SH NAME -gsm_create, gsm_destroy, gsm_encode, gsm_decode \(em GSM\ 06.10 lossy sound compression -.SH SYNOPSIS -.PP -#include "gsm.h" -.PP -gsm gsm_create(); -.PP -void gsm_encode(handle, src, dst) -.br -gsm handle; -.br -gsm_signal src[160]; -.br -gsm_frame dst; -.PP -int gsm_decode(handle, src, dst) -.br -gsm handle; -.br -gsm_frame src; -.br -gsm_signal dst[160]; -.PP -void gsm_destroy(handle) -.br -gsm handle; -.br -.SH "DESCRIPTION" -Gsm is an implementation of the final draft GSM 06.10 -standard for full-rate speech transcoding. -.PP -gsm_create() initializes a gsm pass and returns a 'gsm' object -which can be used as a handle in subsequent calls to gsm_decode(), -gsm_encode() or gsm_destroy(). -.PP -gsm_encode() encodes an array of 160 13-bit samples (given as -gsm_signal's, signed integral values of at least 16 bits) into -a gsm_frame of 33 bytes. -(gsm_frame is a type defined as an array of 33 gsm_bytes in gsm.h.) -.PP -gsm_decode() decodes a gsm_frame into an array of 160 13-bit samples -(given as gsm_signals), which sound rather like what you handed to -gsm_encode() on the other side of the wire. -.PP -gsm_destroy() finishes a gsm pass and frees all storage associated -with it. -.SS "Sample format" -The following scaling is assumed for input to the algorithm: -.br -.nf - 0 1 11 12 - S..v..v..v..v..v..v..v..v..v..v..v..v..*..*..* -.nf -.br -Only the top 13 bits are used as a signed input value. -The output of gsm_decode() has the three lower bits set to zero. -.\" .SH OPTIONS -.SH "RETURN VALUE" -gsm_create() returns an opaque handle object of type gsm, or 0 on error. -gsm_decode() returns -1 if the passed frame is invalid, else 0. -.SH EXAMPLE -.nf -#include "gsm.h" - -gsm handle; -gsm_frame buf; -gsm_signal sample[160]; -int cc, soundfd; - -play() { /* read compressed data from standard input, write to soundfd */ - - if (!(handle = gsm_create())) error... - while (cc = read(0, (char *)buf, sizeof buf)) { - if (cc != sizeof buf) error... - if (gsm_decode(handle, buf, sample) < 0) error... - if (write(soundfd, sample, sizeof sample) != sizeof sample) - error... - } - gsm_destroy(handle); -} - -record() { /* read from soundfd, write compressed to standard output */ - - if (!(handle = gsm_create())) error... - while (cc = read(soundfd, sample, sizeof sample)) { - if (cc != sizeof sample) error... - gsm_encode(handle, sample, buf); - if (write(1, (char *)buf, sizeof buf) != sizeof sample) - error... - } - gsm_destroy(handle); -} -.nf -.SH BUGS -Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. -.SH "SEE ALSO" -toast(1), gsm_print(3), gsm_explode(3), gsm_option(3) diff --git a/third_party/gsm/man/gsm_explode.3 b/third_party/gsm/man/gsm_explode.3 deleted file mode 100644 index ef89984..0000000 --- a/third_party/gsm/man/gsm_explode.3 +++ /dev/null @@ -1,47 +0,0 @@ -.\" -.\" Copyright 1992 by Jutta Degener and Carsten Bormann, Technische -.\" Universitaet Berlin. See the accompanying file "COPYRIGHT" for -.\" details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. -.\" -.PU -.TH GSM_EXPLODE 3 -.SH NAME -gsm_explode, gsm_implode \(em GSM\ 06.10 supplementary -functions for testing -.SH SYNOPSIS -#include "gsm.h" -.PP -void gsm_explode(g, frame, xframe) -.br -gsm g; -.br -gsm_frame frame; -.br -gsm_signal xframe[ 76 ]; -.PP -void gsm_implode(g, xframe, frame) -.br -gsm g; -.br -gsm_signal xframe[ 76 ]; -.br -gsm_frame frame; -.SH "DESCRIPTION" -Gsm is an implementation of the final draft GSM 06.10 -standard for full-rate speech transcoding. -Test data for implementations of this particular document -can be bought and used to verify an implementation. -.PP -The encoded test data uses a format different from what -one would use to transmit frames with the least number -of bits. -Gsm_explode() and gsm_implode() convert between the -internal, small, 33-byte format and the 76-word format -used by the test data. -.PP -.SH "RETURN VALUE" -gsm_explode() returns -1 if the passed frame is invalid, else 0. -.SH BUGS -Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. -.SH "SEE ALSO" -gsm(3) diff --git a/third_party/gsm/man/gsm_option.3 b/third_party/gsm/man/gsm_option.3 deleted file mode 100644 index 8df7da0..0000000 --- a/third_party/gsm/man/gsm_option.3 +++ /dev/null @@ -1,183 +0,0 @@ -.\" -.\" Copyright 1992-1995 by Jutta Degener and Carsten Bormann, Technische -.\" Universitaet Berlin. See the accompanying file "COPYRIGHT" for -.\" details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. -.\" -.PU -.TH GSM_OPTION 3 -.SH NAME -gsm_option \(em customizing the GSM 06.10 implementation -.SH SYNOPSIS -#include "gsm.h" -.PP -int gsm_option(handle, option, valueP); -.br -gsm handle; -.br -int option; -.br -int * valueP; -.SH "DESCRIPTION" -The gsm library is an implementation of the final draft GSM 06.10 -standard for full-rate speech transcoding, a lossy -speech compression algorithm. -.PP -The gsm_option() function can be used to set and query various -options or flags that are not needed for regular GSM 06.10 encoding -or decoding, but might be of interest in special cases. -.PP -The second argument to gsm_option specifies what parameter -should be changed or queried. -The third argument is either a null pointer, in which case -the current value of that parameter is returned; -or it is a pointer to an integer containing the value -you want to set, in which case the previous value will -be returned. -.PP -The following options are defined: -.PP -.I GSM_OPT_VERBOSE -Verbosity level. -.br -.in+5 -This option is only supported if the library was compiled -with debugging turned on, and may be used by developers of -compression algorithms to aid debugging. -.br -The verbosity level can be changed at any time during encoding or decoding. -.in-5 -.sp -.PP -.I GSM_OPT_FAST -Faster compression algorithm. -.br -.in+5 -This implementation offers a not strictly standard-compliant, but -faster compression algorithm that is compatible with the regular -method and does not noticably degrade audio quality. -.br -The value passed to -.br -.nf - gsm_option(handle, GSM_OPT_FAST, & value) -.fi -.br -functions as a boolean flag; if it is zero, the regular algorithm -will be used, if not, the faster version will be used. -.br -The availability of this option depends on the hardware used; -if it is not available, gsm_option will return -1 on an attempt -to set or query it. -.br -This option can be set any time during encoding or decoding. -.in-5 -.ne 5 -.sp -.PP -.I GSM_OPT_LTP_CUT -Enable, disable, or query the LTP cut-off optimization. -.br -.in+5 -During encoding, the search for the long-term correlation -lag forms the bottleneck of the algorithm. -The ltp-cut option enables an approximation that disregards most -of the samples for purposes of finding that correlation, -and hence speeds up the encoding at a noticable loss in quality. -.br -The value passed to -.br -.nf - gsm_option(handle, GSM_OPT_LTP_CUT, & value) -.fi -.br -turns the optimization on if nonzero, and off if zero. -.br -This option can be set any time during encoding -or decoding; it will only affect the encoding pass, not -the decoding. -.sp -.PP -.I GSM_OPT_WAV49 -WAV-style byte ordering. -.br -.in+5 -A WAV file of type #49 contains GSM 06.10-encoded frames. -Unfortunately, the framing and code ordering of the WAV version -are incompatible with the native ones of this GSM 06.10 library. -The GSM_OPT_WAV49 option turns on a different packing -algorithm that produces alternating frames of 32 and 33 bytes -(or makes it consume alternating frames of 33 and 32 bytes, note -the opposite order of the two numbers) which, when concatenated, -can be used in the body of a WAV #49 frame. -It is up to the user program to write a WAV header, if any; -neither the library itself nor the toast program produce -complete WAV files. -.br -The value passed to -.br -.nf - gsm_option(handle, GSM_OPT_WAV49, & value) -.fi -.br -functions as a boolean flag; if it is zero, the library's native -framing algorithm will be used, if nonzero, WAV-type packing is in effect. -.br -This option should be used before any frames are encoded. -Whether or not it is supported at all depends on a -compile-time switch, WAV49. -Both option and compile time switch are new to the library -as of patchlevel 9, and are considerably less tested than the -well-worn rest of the it. -.br -Thanks to Jeff Chilton for the detective work and first free -implementation of this version of the GSM 06.10 encoding. -.sp -.PP -.I GSM_OPT_FRAME_CHAIN -Query or set the chaining byte. -.br -.in+5 -Between the two frames of a WAV-style encoding, the GSM 06.10 library -must keep track of one half-byte that is technically part of the first -frame, but will be written as the first four bits of the second. -This half-byte are the lowest four bits of the value returned by, -and optionally set by, -.br -.nf - gsm_option(handle, GSM_OPT_FRAME_CHAIN, & value) -.fi -.br -This option can be queried and set at any time. -.sp -.PP -.I GSM_OPT_FRAME_INDEX -Query or set the current frame's index in a format's -alternating list of frames. -.br -.in+5 -The WAV #49 framing uses two alternating types of frames. -Which type the next GSM-coded frame belongs to can be queried, or, -when decoding, announced, using -.br -.nf - gsm_option(handle, GSM_OPT_FRAME_INDEX, & value) -.fi -.br -For WAV-style framing, the value should be 0 or 1; the first frame -of an encoding has an index of 0. -At library initialization, the index is set to zero. -.br -The frame index can be queried and set at any time. -Used in combination with the -.IR GSM_OPT_FRAME_CHAIN , -option, it can be used to position on arbitrary GSM frames -within a format like WAV #49 (not accounting for the lost -internal GSM state). -.in-5 -.SH "RETURN VALUE" -gsm_option() returns -1 if an option is not supported, the -previous value of the option otherwise. -.SH BUGS -Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. -.SH "SEE ALSO" -toast(1), gsm(3), gsm_explode(3), gsm_print(3) diff --git a/third_party/gsm/man/gsm_print.3 b/third_party/gsm/man/gsm_print.3 deleted file mode 100644 index 48d6883..0000000 --- a/third_party/gsm/man/gsm_print.3 +++ /dev/null @@ -1,52 +0,0 @@ -.\" -.\" Copyright 1992 by Jutta Degener and Carsten Bormann, Technische -.\" Universitaet Berlin. See the accompanying file "COPYRIGHT" for -.\" details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. -.\" -.PU -.TH GSM_PRINT 3 -.SH NAME -gsm_print \(em GSM\ 06.10 supplementary function for debugging -.SH SYNOPSIS -#include "gsm.h" -#include - -int gsm_print(f, g, frame); -.br -FILE * f; -.br -gsm g; -.br -gsm_frame frame; -.SH "DESCRIPTION" -Gsm is an implementation of the final draft GSM 06.10 -standard for full-rate speech transcoding, a lossy -speech compression algorithm. -The compressed form involves 76 variables with different numbers -of significant bits packed into 33 bytes. -.PP -If you are interested in investigating the details of this -coding scheme, gsm_print() can be used to dump the contents -of individual gsm_frames to a file pointer provided by -the application. -.PP -.SH "RETURN VALUE" -gsm_print() returns -1 if the frame is invalid, else 0. -.SH EXAMPLE -A single frame looks like this: -.br -.nf -LARc: 29 32 20 11 08 05 06 07 -#1: Nc 0040 bc 0 Mc 1 xmaxc 60 - 06 04 00 03 03 06 04 02 02 04 05 04 01 -#2: Nc 0045 bc 1 Mc 1 xmaxc 48 - 03 07 01 03 04 04 07 01 03 02 04 05 03 -#3: Nc 0091 bc 1 Mc 1 xmaxc 46 - 00 03 03 07 01 06 02 04 05 03 03 02 04 -#4: Nc 0120 bc 0 Mc 1 xmaxc 47 - 07 03 06 00 03 03 06 05 00 03 02 07 04 -.nf -.SH BUGS -Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de. -.SH "SEE ALSO" -gsm(3), gsm_explode(3) diff --git a/third_party/gsm/man/toast.1 b/third_party/gsm/man/toast.1 deleted file mode 100644 index e54647b..0000000 --- a/third_party/gsm/man/toast.1 +++ /dev/null @@ -1,156 +0,0 @@ -.\" -.\" Copyright 1992 by Jutta Degener and Carsten Bormann, Technische -.\" Universitaet Berlin. See the accompanying file "COPYRIGHT" for -.\" details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. -.\" -.if n .ds mU u -.if t .ds mU \(*m -.\" -.TH TOAST 1 local -.SH NAME -toast \(em GSM\ 06.10 lossy sound compression -.SH SYNOPSIS -.ll +8 -.B toast -[ -.B \-cdfpvhualsFC -] [ -.I "filename...\&" -] -.LP -.B untoast -[ -.B \-cfpvhuaslF -] [ -.I "filename...\&" -] -.LP -.B tcat -[ -.B \-vhuaslF -] [ -.I "filename...\&" -] -.ll -8 -.SH DESCRIPTION -Toast compresses the sound files given on its command line. -Each file is replaced by a file with the extension -.I \&.gsm . -If no files are specified, the compression is applied to the -standard input, and its result is written to standard output. -.PP -Toasted files can be restored to something not quite unlike -their original form by running toast -.I "\-d" -, or -.I untoast -, on the \&.gsm-files or standard input. -.PP -The program -.I tcat -(the same as running -.I "untoast \-c" -) uncompresses its input on standard output, -but leaves the compressed .gsm\-files alone. -.PP -When files are compressed or uncompressed into other files, -the ownership (if run by root), modes, accessed and modified times -are maintained between both versions. -.SH OPTIONS -.TP -.B \-c -(cat) -Write to the standard output; no files are changed. -.TP -.B \-d -(decode) -Decode, rather than encode, the files. -.TP -.B \-f -(force) -Force replacement of output files if they exist. -If \-f is omitted and toast (or untoast) is run interactively from -a terminal, the user is prompted as to whether the file should be replaced. -.TP -.B \-p -(precious) -Do not delete the source files. -Source files are implicitly left alone whenever \-c is -specified or tcat is run. -.TP -.B \-C -(LTP cut-off) -Ignore most sample values when calculating the GSM long-term -correlation lag during encoding. -(The multiplications that do this are a bottleneck -of the algorithm.) -The resulting encoding process will not produce -exactly the same results as GSM 06.10 would, -but remains close enough to be compatible. -.br -The -.B \-C -option applies only to the encoder and is silently -ignored by the decoder. -.TP -.B \-F -(fast) -On systems with a floating point processor, but without -a multiplication instruction, \-F sacrifices standard conformance to -performance and nearly doubles the speed of the algorithm. -.br -The resulting encoding and decoding process will not produce -exactly the same results as GSM 06.10 would, but remains close -enough to be compatible. -.br -The default is standard-conforming operation. -.TP -.B \-v -(version)\ -outputs the version of toast (or untoast or tcat) to stdout and exits. -.TP -.B \-h -(help)\ -prints a short overview of the options. -.PP -Toast, untoast and tcat try to guess the appropriate audio data -format from the file suffix. -Command line options can also specify a format to be used for -all files. -.br -The following formats are supported: -.TP -.B "\-u" -(\(*mU-law) -8 kHz, 8 bit \(*mU-law encoding (file suffix .u) -.TP -.B "\-a" -(A-law) -8 kHz, 8 bit A-law encoding (file suffix .A) -.TP -.B "\-s" -(Sun audio) -8 kHz, 8 bit \(*mU-law encoding with audio header (file suffix .au) -.TP -.B "-l" -(linear) -8 kHz, 16 bit signed linear encoding in host byte order -with 13 significant bits (file suffix .l) -.PP -In absence of options or suffixes to specify a format, -\(*mU-law encoding as forced by \-u is assumed. -.PP -.SH PECULIARITIES -A four bit magic number is prefixed to each 32 1/2-byte GSM frame, -mainly because 32 1/2-bytes are rather clumsy to handle. -.SH WARNING -The compression algorithm used is a lossy compression algorithm -devised especially for speech; on no account should it be used -for text, pictures or any other non-speech-data you consider -valuable. -.SH BUGS -Please direct bug reports to jutta@cs.tu-berlin.de. -.SH "SEE ALSO" -gsm(3) -.\" -.\" Toast is dedicated to Bill Sienkiewicz, author of "Stray Toasters". diff --git a/third_party/gsm/src/add.c b/third_party/gsm/src/add.c deleted file mode 100644 index 381f4e5..0000000 --- a/third_party/gsm/src/add.c +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/add.c,v 1.6 1996/07/02 09:57:33 jutta Exp $ */ - -/* - * See private.h for the more commonly used macro versions. - */ - -#include "config.h" -#include -#include - -#include "private.h" -#include "gsm.h" -#include "proto.h" - -#define saturate(x) \ - ((x) < MIN_WORD ? MIN_WORD : (x) > MAX_WORD ? MAX_WORD: (x)) - -word gsm_add P2((a,b), word a, word b) -{ - longword sum = (longword)a + (longword)b; - return saturate(sum); -} - -word gsm_sub P2((a,b), word a, word b) -{ - longword diff = (longword)a - (longword)b; - return saturate(diff); -} - -word gsm_mult P2((a,b), word a, word b) -{ - if (a == MIN_WORD && b == MIN_WORD) return MAX_WORD; - else return SASR( (longword)a * (longword)b, 15 ); -} - -word gsm_mult_r P2((a,b), word a, word b) -{ - if (b == MIN_WORD && a == MIN_WORD) return MAX_WORD; - else { - longword prod = (longword)a * (longword)b + 16384; - prod >>= 15; - return prod & 0xFFFF; - } -} - -word gsm_abs P1((a), word a) -{ - return a < 0 ? (a == MIN_WORD ? MAX_WORD : -a) : a; -} - -longword gsm_L_mult P2((a,b),word a, word b) -{ - assert( a != MIN_WORD || b != MIN_WORD ); - return ((longword)a * (longword)b) << 1; -} - -longword gsm_L_add P2((a,b), longword a, longword b) -{ - if (a < 0) { - if (b >= 0) return a + b; - else { - ulongword A = (ulongword)-(a + 1) + (ulongword)-(b + 1); - return A >= MAX_LONGWORD ? MIN_LONGWORD :-(longword)A-2; - } - } - else if (b <= 0) return a + b; - else { - ulongword A = (ulongword)a + (ulongword)b; - return A > MAX_LONGWORD ? MAX_LONGWORD : A; - } -} - -longword gsm_L_sub P2((a,b), longword a, longword b) -{ - if (a >= 0) { - if (b >= 0) return a - b; - else { - /* a>=0, b<0 */ - - ulongword A = (ulongword)a + -(b + 1); - return A >= MAX_LONGWORD ? MAX_LONGWORD : (A + 1); - } - } - else if (b <= 0) return a - b; - else { - /* a<0, b>0 */ - - ulongword A = (ulongword)-(a + 1) + b; - return A >= MAX_LONGWORD ? MIN_LONGWORD : -(longword)A - 1; - } -} - -static unsigned char const bitoff[ 256 ] = { - 8, 7, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -}; - -word gsm_norm P1((a), longword a ) -/* - * the number of left shifts needed to normalize the 32 bit - * variable L_var1 for positive values on the interval - * - * with minimum of - * minimum of 1073741824 (01000000000000000000000000000000) and - * maximum of 2147483647 (01111111111111111111111111111111) - * - * - * and for negative values on the interval with - * minimum of -2147483648 (-10000000000000000000000000000000) and - * maximum of -1073741824 ( -1000000000000000000000000000000). - * - * in order to normalize the result, the following - * operation must be done: L_norm_var1 = L_var1 << norm( L_var1 ); - * - * (That's 'ffs', only from the left, not the right..) - */ -{ - assert(a != 0); - - if (a < 0) { - if (a <= -1073741824) return 0; - a = ~a; - } - - return a & 0xffff0000 - ? ( a & 0xff000000 - ? -1 + bitoff[ 0xFF & (a >> 24) ] - : 7 + bitoff[ 0xFF & (a >> 16) ] ) - : ( a & 0xff00 - ? 15 + bitoff[ 0xFF & (a >> 8) ] - : 23 + bitoff[ 0xFF & a ] ); -} - -longword gsm_L_asl P2((a,n), longword a, int n) -{ - if (n >= 32) return 0; - if (n <= -32) return -(a < 0); - if (n < 0) return gsm_L_asr(a, -n); - return a << n; -} - -word gsm_asl P2((a,n), word a, int n) -{ - if (n >= 16) return 0; - if (n <= -16) return -(a < 0); - if (n < 0) return gsm_asr(a, -n); - return a << n; -} - -longword gsm_L_asr P2((a,n), longword a, int n) -{ - if (n >= 32) return -(a < 0); - if (n <= -32) return 0; - if (n < 0) return a << -n; - -# ifdef SASR - return a >> n; -# else - if (a >= 0) return a >> n; - else return -(longword)( -(ulongword)a >> n ); -# endif -} - -word gsm_asr P2((a,n), word a, int n) -{ - if (n >= 16) return -(a < 0); - if (n <= -16) return 0; - if (n < 0) return a << -n; - -# ifdef SASR - return a >> n; -# else - if (a >= 0) return a >> n; - else return -(word)( -(uword)a >> n ); -# endif -} - -/* - * (From p. 46, end of section 4.2.5) - * - * NOTE: The following lines gives [sic] one correct implementation - * of the div(num, denum) arithmetic operation. Compute div - * which is the integer division of num by denum: with denum - * >= num > 0 - */ - -word gsm_div P2((num,denum), word num, word denum) -{ - longword L_num = num; - longword L_denum = denum; - word div = 0; - int k = 15; - - /* The parameter num sometimes becomes zero. - * Although this is explicitly guarded against in 4.2.5, - * we assume that the result should then be zero as well. - */ - - /* assert(num != 0); */ - - assert(num >= 0 && denum >= num); - if (num == 0) - return 0; - - while (k--) { - div <<= 1; - L_num <<= 1; - - if (L_num >= L_denum) { - L_num -= L_denum; - div++; - } - } - - return div; -} diff --git a/third_party/gsm/src/code.c b/third_party/gsm/src/code.c deleted file mode 100644 index 65dd0a3..0000000 --- a/third_party/gsm/src/code.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/code.c,v 1.3 1996/07/02 09:59:05 jutta Exp $ */ - -#include "config.h" - - -#ifdef HAS_STDLIB_H -#include -#else -# include "proto.h" - extern char * memcpy P((char *, char *, int)); -#endif - -#include "private.h" -#include "gsm.h" -#include "proto.h" - -/* - * 4.2 FIXED POINT IMPLEMENTATION OF THE RPE-LTP CODER - */ - -void Gsm_Coder P8((S,s,LARc,Nc,bc,Mc,xmaxc,xMc), - - struct gsm_state * S, - - word * s, /* [0..159] samples IN */ - -/* - * The RPE-LTD coder works on a frame by frame basis. The length of - * the frame is equal to 160 samples. Some computations are done - * once per frame to produce at the output of the coder the - * LARc[1..8] parameters which are the coded LAR coefficients and - * also to realize the inverse filtering operation for the entire - * frame (160 samples of signal d[0..159]). These parts produce at - * the output of the coder: - */ - - word * LARc, /* [0..7] LAR coefficients OUT */ - -/* - * Procedure 4.2.11 to 4.2.18 are to be executed four times per - * frame. That means once for each sub-segment RPE-LTP analysis of - * 40 samples. These parts produce at the output of the coder: - */ - - word * Nc, /* [0..3] LTP lag OUT */ - word * bc, /* [0..3] coded LTP gain OUT */ - word * Mc, /* [0..3] RPE grid selection OUT */ - word * xmaxc,/* [0..3] Coded maximum amplitude OUT */ - word * xMc /* [13*4] normalized RPE samples OUT */ -) -{ - int k; - word * dp = S->dp0 + 120; /* [ -120...-1 ] */ - word * dpp = dp; /* [ 0...39 ] */ - - word so[160]; - - Gsm_Preprocess (S, s, so); - Gsm_LPC_Analysis (S, so, LARc); - Gsm_Short_Term_Analysis_Filter (S, LARc, so); - - for (k = 0; k <= 3; k++, xMc += 13) { - - Gsm_Long_Term_Predictor ( S, - so+k*40, /* d [0..39] IN */ - dp, /* dp [-120..-1] IN */ - S->e + 5, /* e [0..39] OUT */ - dpp, /* dpp [0..39] OUT */ - Nc++, - bc++); - - Gsm_RPE_Encoding ( S, - S->e + 5,/* e ][0..39][ IN/OUT */ - xmaxc++, Mc++, xMc ); - /* - * Gsm_Update_of_reconstructed_short_time_residual_signal - * ( dpp, S->e + 5, dp ); - */ - - { register int i; - register longword ltmp; - for (i = 0; i <= 39; i++) - dp[ i ] = GSM_ADD( S->e[5 + i], dpp[i] ); - } - dp += 40; - dpp += 40; - - } - (void)memcpy( (char *)S->dp0, (char *)(S->dp0 + 160), - 120 * sizeof(*S->dp0) ); -} diff --git a/third_party/gsm/src/debug.c b/third_party/gsm/src/debug.c deleted file mode 100644 index 04c3907..0000000 --- a/third_party/gsm/src/debug.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/debug.c,v 1.2 1993/01/29 18:22:20 jutta Exp $ */ - -#include "private.h" - -#ifndef NDEBUG - -/* If NDEBUG _is_ defined and no debugging should be performed, - * calls to functions in this module are #defined to nothing - * in private.h. - */ - -#include -#include "proto.h" - -void gsm_debug_words P4( (name, from, to, ptr), - char * name, - int from, - int to, - word * ptr) -{ - int nprinted = 0; - - fprintf( stderr, "%s [%d .. %d]: ", name, from, to ); - while (from <= to) { - fprintf(stderr, "%d ", ptr[ from ] ); - from++; - if (nprinted++ >= 7) { - nprinted = 0; - if (from < to) putc('\n', stderr); - } - } - putc('\n', stderr); -} - -void gsm_debug_longwords P4( (name, from, to, ptr), - char * name, - int from, - int to, - longword * ptr) -{ - int nprinted = 0; - - fprintf( stderr, "%s [%d .. %d]: ", name, from, to ); - while (from <= to) { - - fprintf(stderr, "%d ", ptr[ from ] ); - from++; - if (nprinted++ >= 7) { - nprinted = 0; - if (from < to) putc('\n', stderr); - } - } - putc('\n', stderr); -} - -void gsm_debug_longword P2( (name, value), - char * name, - longword value ) -{ - fprintf(stderr, "%s: %d\n", name, (long)value ); -} - -void gsm_debug_word P2( (name, value), - char * name, - word value ) -{ - fprintf(stderr, "%s: %d\n", name, (long)value); -} - -#endif diff --git a/third_party/gsm/src/decode.c b/third_party/gsm/src/decode.c deleted file mode 100644 index 91e61af..0000000 --- a/third_party/gsm/src/decode.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/decode.c,v 1.1 1992/10/28 00:15:50 jutta Exp $ */ - -#include "config.h" -#include - -#include "private.h" -#include "gsm.h" -#include "proto.h" - -/* - * 4.3 FIXED POINT IMPLEMENTATION OF THE RPE-LTP DECODER - */ - -static void Postprocessing P2((S,s), - struct gsm_state * S, - register word * s) -{ - register int k; - register word msr = S->msr; - register longword ltmp; /* for GSM_ADD */ - register word tmp; - - for (k = 160; k--; s++) { - tmp = GSM_MULT_R( msr, 28180 ); - msr = GSM_ADD(*s, tmp); /* Deemphasis */ - *s = GSM_ADD(msr, msr) & 0xFFF8; /* Truncation & Upscaling */ - } - S->msr = msr; -} - -void Gsm_Decoder P8((S,LARcr, Ncr,bcr,Mcr,xmaxcr,xMcr,s), - struct gsm_state * S, - - word * LARcr, /* [0..7] IN */ - - word * Ncr, /* [0..3] IN */ - word * bcr, /* [0..3] IN */ - word * Mcr, /* [0..3] IN */ - word * xmaxcr, /* [0..3] IN */ - word * xMcr, /* [0..13*4] IN */ - - word * s) /* [0..159] OUT */ -{ - int j, k; - word erp[40], wt[160]; - word * drp = S->dp0 + 120; - - for (j=0; j <= 3; j++, xmaxcr++, bcr++, Ncr++, Mcr++, xMcr += 13) { - - Gsm_RPE_Decoding( S, *xmaxcr, *Mcr, xMcr, erp ); - Gsm_Long_Term_Synthesis_Filtering( S, *Ncr, *bcr, erp, drp ); - - for (k = 0; k <= 39; k++) wt[ j * 40 + k ] = drp[ k ]; - } - - Gsm_Short_Term_Synthesis_Filter( S, LARcr, wt, s ); - Postprocessing(S, s); -} diff --git a/third_party/gsm/src/gsm_create.c b/third_party/gsm/src/gsm_create.c deleted file mode 100644 index a0bf634..0000000 --- a/third_party/gsm/src/gsm_create.c +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -static char const ident[] = "$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/gsm_create.c,v 1.4 1996/07/02 09:59:05 jutta Exp $"; - -#include "config.h" - -#ifdef HAS_STRING_H -#include -#else -# include "proto.h" - extern char * memset P((char *, int, int)); -#endif - -#ifdef HAS_STDLIB_H -# include -#else -# ifdef HAS_MALLOC_H -# include -# else - extern char * malloc(); -# endif -#endif - -#include - -#include "gsm.h" -#include "private.h" -#include "proto.h" - -gsm gsm_create P0() -{ - gsm r; - - r = (gsm)malloc(sizeof(struct gsm_state)); - if (!r) return r; - - memset((char *)r, 0, sizeof(*r)); - r->nrp = 40; - - return r; -} diff --git a/third_party/gsm/src/gsm_decode.c b/third_party/gsm/src/gsm_decode.c deleted file mode 100644 index 973c08b..0000000 --- a/third_party/gsm/src/gsm_decode.c +++ /dev/null @@ -1,361 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/gsm_decode.c,v 1.2 1996/07/02 09:59:05 jutta Exp $ */ - -#include "private.h" - -#include "gsm.h" -#include "proto.h" - -int gsm_decode P3((s, c, target), gsm s, gsm_byte * c, gsm_signal * target) -{ - word LARc[8], Nc[4], Mc[4], bc[4], xmaxc[4], xmc[13*4]; - -#ifdef WAV49 - if (s->wav_fmt) { - - uword sr = 0; - - s->frame_index = !s->frame_index; - if (s->frame_index) { - - sr = *c++; - LARc[0] = sr & 0x3f; sr >>= 6; - sr |= (uword)*c++ << 2; - LARc[1] = sr & 0x3f; sr >>= 6; - sr |= (uword)*c++ << 4; - LARc[2] = sr & 0x1f; sr >>= 5; - LARc[3] = sr & 0x1f; sr >>= 5; - sr |= (uword)*c++ << 2; - LARc[4] = sr & 0xf; sr >>= 4; - LARc[5] = sr & 0xf; sr >>= 4; - sr |= (uword)*c++ << 2; /* 5 */ - LARc[6] = sr & 0x7; sr >>= 3; - LARc[7] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; - Nc[0] = sr & 0x7f; sr >>= 7; - bc[0] = sr & 0x3; sr >>= 2; - Mc[0] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[0] = sr & 0x3f; sr >>= 6; - xmc[0] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[1] = sr & 0x7; sr >>= 3; - xmc[2] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[3] = sr & 0x7; sr >>= 3; - xmc[4] = sr & 0x7; sr >>= 3; - xmc[5] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; /* 10 */ - xmc[6] = sr & 0x7; sr >>= 3; - xmc[7] = sr & 0x7; sr >>= 3; - xmc[8] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[9] = sr & 0x7; sr >>= 3; - xmc[10] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[11] = sr & 0x7; sr >>= 3; - xmc[12] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; - Nc[1] = sr & 0x7f; sr >>= 7; - bc[1] = sr & 0x3; sr >>= 2; - Mc[1] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[1] = sr & 0x3f; sr >>= 6; - xmc[13] = sr & 0x7; sr >>= 3; - sr = *c++; /* 15 */ - xmc[14] = sr & 0x7; sr >>= 3; - xmc[15] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[16] = sr & 0x7; sr >>= 3; - xmc[17] = sr & 0x7; sr >>= 3; - xmc[18] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[19] = sr & 0x7; sr >>= 3; - xmc[20] = sr & 0x7; sr >>= 3; - xmc[21] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[22] = sr & 0x7; sr >>= 3; - xmc[23] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[24] = sr & 0x7; sr >>= 3; - xmc[25] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; /* 20 */ - Nc[2] = sr & 0x7f; sr >>= 7; - bc[2] = sr & 0x3; sr >>= 2; - Mc[2] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[2] = sr & 0x3f; sr >>= 6; - xmc[26] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[27] = sr & 0x7; sr >>= 3; - xmc[28] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[29] = sr & 0x7; sr >>= 3; - xmc[30] = sr & 0x7; sr >>= 3; - xmc[31] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[32] = sr & 0x7; sr >>= 3; - xmc[33] = sr & 0x7; sr >>= 3; - xmc[34] = sr & 0x7; sr >>= 3; - sr = *c++; /* 25 */ - xmc[35] = sr & 0x7; sr >>= 3; - xmc[36] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[37] = sr & 0x7; sr >>= 3; - xmc[38] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; - Nc[3] = sr & 0x7f; sr >>= 7; - bc[3] = sr & 0x3; sr >>= 2; - Mc[3] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[3] = sr & 0x3f; sr >>= 6; - xmc[39] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[40] = sr & 0x7; sr >>= 3; - xmc[41] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; /* 30 */ - xmc[42] = sr & 0x7; sr >>= 3; - xmc[43] = sr & 0x7; sr >>= 3; - xmc[44] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[45] = sr & 0x7; sr >>= 3; - xmc[46] = sr & 0x7; sr >>= 3; - xmc[47] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[48] = sr & 0x7; sr >>= 3; - xmc[49] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[50] = sr & 0x7; sr >>= 3; - xmc[51] = sr & 0x7; sr >>= 3; - - s->frame_chain = sr & 0xf; - } - else { - sr = s->frame_chain; - sr |= (uword)*c++ << 4; /* 1 */ - LARc[0] = sr & 0x3f; sr >>= 6; - LARc[1] = sr & 0x3f; sr >>= 6; - sr = *c++; - LARc[2] = sr & 0x1f; sr >>= 5; - sr |= (uword)*c++ << 3; - LARc[3] = sr & 0x1f; sr >>= 5; - LARc[4] = sr & 0xf; sr >>= 4; - sr |= (uword)*c++ << 2; - LARc[5] = sr & 0xf; sr >>= 4; - LARc[6] = sr & 0x7; sr >>= 3; - LARc[7] = sr & 0x7; sr >>= 3; - sr = *c++; /* 5 */ - Nc[0] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; - bc[0] = sr & 0x3; sr >>= 2; - Mc[0] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[0] = sr & 0x3f; sr >>= 6; - xmc[0] = sr & 0x7; sr >>= 3; - xmc[1] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[2] = sr & 0x7; sr >>= 3; - xmc[3] = sr & 0x7; sr >>= 3; - xmc[4] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[5] = sr & 0x7; sr >>= 3; - xmc[6] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; /* 10 */ - xmc[7] = sr & 0x7; sr >>= 3; - xmc[8] = sr & 0x7; sr >>= 3; - xmc[9] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[10] = sr & 0x7; sr >>= 3; - xmc[11] = sr & 0x7; sr >>= 3; - xmc[12] = sr & 0x7; sr >>= 3; - sr = *c++; - Nc[1] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; - bc[1] = sr & 0x3; sr >>= 2; - Mc[1] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[1] = sr & 0x3f; sr >>= 6; - xmc[13] = sr & 0x7; sr >>= 3; - xmc[14] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; /* 15 */ - xmc[15] = sr & 0x7; sr >>= 3; - xmc[16] = sr & 0x7; sr >>= 3; - xmc[17] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[18] = sr & 0x7; sr >>= 3; - xmc[19] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[20] = sr & 0x7; sr >>= 3; - xmc[21] = sr & 0x7; sr >>= 3; - xmc[22] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[23] = sr & 0x7; sr >>= 3; - xmc[24] = sr & 0x7; sr >>= 3; - xmc[25] = sr & 0x7; sr >>= 3; - sr = *c++; - Nc[2] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; /* 20 */ - bc[2] = sr & 0x3; sr >>= 2; - Mc[2] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[2] = sr & 0x3f; sr >>= 6; - xmc[26] = sr & 0x7; sr >>= 3; - xmc[27] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[28] = sr & 0x7; sr >>= 3; - xmc[29] = sr & 0x7; sr >>= 3; - xmc[30] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[31] = sr & 0x7; sr >>= 3; - xmc[32] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[33] = sr & 0x7; sr >>= 3; - xmc[34] = sr & 0x7; sr >>= 3; - xmc[35] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; /* 25 */ - xmc[36] = sr & 0x7; sr >>= 3; - xmc[37] = sr & 0x7; sr >>= 3; - xmc[38] = sr & 0x7; sr >>= 3; - sr = *c++; - Nc[3] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; - bc[3] = sr & 0x3; sr >>= 2; - Mc[3] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[3] = sr & 0x3f; sr >>= 6; - xmc[39] = sr & 0x7; sr >>= 3; - xmc[40] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[41] = sr & 0x7; sr >>= 3; - xmc[42] = sr & 0x7; sr >>= 3; - xmc[43] = sr & 0x7; sr >>= 3; - sr = *c++; /* 30 */ - xmc[44] = sr & 0x7; sr >>= 3; - xmc[45] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[46] = sr & 0x7; sr >>= 3; - xmc[47] = sr & 0x7; sr >>= 3; - xmc[48] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[49] = sr & 0x7; sr >>= 3; - xmc[50] = sr & 0x7; sr >>= 3; - xmc[51] = sr & 0x7; sr >>= 3; - } - } - else -#endif - { - /* GSM_MAGIC = (*c >> 4) & 0xF; */ - - if (((*c >> 4) & 0x0F) != GSM_MAGIC) return -1; - - LARc[0] = (*c++ & 0xF) << 2; /* 1 */ - LARc[0] |= (*c >> 6) & 0x3; - LARc[1] = *c++ & 0x3F; - LARc[2] = (*c >> 3) & 0x1F; - LARc[3] = (*c++ & 0x7) << 2; - LARc[3] |= (*c >> 6) & 0x3; - LARc[4] = (*c >> 2) & 0xF; - LARc[5] = (*c++ & 0x3) << 2; - LARc[5] |= (*c >> 6) & 0x3; - LARc[6] = (*c >> 3) & 0x7; - LARc[7] = *c++ & 0x7; - Nc[0] = (*c >> 1) & 0x7F; - bc[0] = (*c++ & 0x1) << 1; - bc[0] |= (*c >> 7) & 0x1; - Mc[0] = (*c >> 5) & 0x3; - xmaxc[0] = (*c++ & 0x1F) << 1; - xmaxc[0] |= (*c >> 7) & 0x1; - xmc[0] = (*c >> 4) & 0x7; - xmc[1] = (*c >> 1) & 0x7; - xmc[2] = (*c++ & 0x1) << 2; - xmc[2] |= (*c >> 6) & 0x3; - xmc[3] = (*c >> 3) & 0x7; - xmc[4] = *c++ & 0x7; - xmc[5] = (*c >> 5) & 0x7; - xmc[6] = (*c >> 2) & 0x7; - xmc[7] = (*c++ & 0x3) << 1; /* 10 */ - xmc[7] |= (*c >> 7) & 0x1; - xmc[8] = (*c >> 4) & 0x7; - xmc[9] = (*c >> 1) & 0x7; - xmc[10] = (*c++ & 0x1) << 2; - xmc[10] |= (*c >> 6) & 0x3; - xmc[11] = (*c >> 3) & 0x7; - xmc[12] = *c++ & 0x7; - Nc[1] = (*c >> 1) & 0x7F; - bc[1] = (*c++ & 0x1) << 1; - bc[1] |= (*c >> 7) & 0x1; - Mc[1] = (*c >> 5) & 0x3; - xmaxc[1] = (*c++ & 0x1F) << 1; - xmaxc[1] |= (*c >> 7) & 0x1; - xmc[13] = (*c >> 4) & 0x7; - xmc[14] = (*c >> 1) & 0x7; - xmc[15] = (*c++ & 0x1) << 2; - xmc[15] |= (*c >> 6) & 0x3; - xmc[16] = (*c >> 3) & 0x7; - xmc[17] = *c++ & 0x7; - xmc[18] = (*c >> 5) & 0x7; - xmc[19] = (*c >> 2) & 0x7; - xmc[20] = (*c++ & 0x3) << 1; - xmc[20] |= (*c >> 7) & 0x1; - xmc[21] = (*c >> 4) & 0x7; - xmc[22] = (*c >> 1) & 0x7; - xmc[23] = (*c++ & 0x1) << 2; - xmc[23] |= (*c >> 6) & 0x3; - xmc[24] = (*c >> 3) & 0x7; - xmc[25] = *c++ & 0x7; - Nc[2] = (*c >> 1) & 0x7F; - bc[2] = (*c++ & 0x1) << 1; /* 20 */ - bc[2] |= (*c >> 7) & 0x1; - Mc[2] = (*c >> 5) & 0x3; - xmaxc[2] = (*c++ & 0x1F) << 1; - xmaxc[2] |= (*c >> 7) & 0x1; - xmc[26] = (*c >> 4) & 0x7; - xmc[27] = (*c >> 1) & 0x7; - xmc[28] = (*c++ & 0x1) << 2; - xmc[28] |= (*c >> 6) & 0x3; - xmc[29] = (*c >> 3) & 0x7; - xmc[30] = *c++ & 0x7; - xmc[31] = (*c >> 5) & 0x7; - xmc[32] = (*c >> 2) & 0x7; - xmc[33] = (*c++ & 0x3) << 1; - xmc[33] |= (*c >> 7) & 0x1; - xmc[34] = (*c >> 4) & 0x7; - xmc[35] = (*c >> 1) & 0x7; - xmc[36] = (*c++ & 0x1) << 2; - xmc[36] |= (*c >> 6) & 0x3; - xmc[37] = (*c >> 3) & 0x7; - xmc[38] = *c++ & 0x7; - Nc[3] = (*c >> 1) & 0x7F; - bc[3] = (*c++ & 0x1) << 1; - bc[3] |= (*c >> 7) & 0x1; - Mc[3] = (*c >> 5) & 0x3; - xmaxc[3] = (*c++ & 0x1F) << 1; - xmaxc[3] |= (*c >> 7) & 0x1; - xmc[39] = (*c >> 4) & 0x7; - xmc[40] = (*c >> 1) & 0x7; - xmc[41] = (*c++ & 0x1) << 2; - xmc[41] |= (*c >> 6) & 0x3; - xmc[42] = (*c >> 3) & 0x7; - xmc[43] = *c++ & 0x7; /* 30 */ - xmc[44] = (*c >> 5) & 0x7; - xmc[45] = (*c >> 2) & 0x7; - xmc[46] = (*c++ & 0x3) << 1; - xmc[46] |= (*c >> 7) & 0x1; - xmc[47] = (*c >> 4) & 0x7; - xmc[48] = (*c >> 1) & 0x7; - xmc[49] = (*c++ & 0x1) << 2; - xmc[49] |= (*c >> 6) & 0x3; - xmc[50] = (*c >> 3) & 0x7; - xmc[51] = *c & 0x7; /* 33 */ - } - - Gsm_Decoder(s, LARc, Nc, bc, Mc, xmaxc, xmc, target); - - return 0; -} diff --git a/third_party/gsm/src/gsm_destroy.c b/third_party/gsm/src/gsm_destroy.c deleted file mode 100644 index 03c8659..0000000 --- a/third_party/gsm/src/gsm_destroy.c +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/gsm_destroy.c,v 1.3 1994/11/28 19:52:25 jutta Exp $ */ - -#include "gsm.h" -#include "config.h" -#include "proto.h" - -#ifdef HAS_STDLIB_H -# include -#else -# ifdef HAS_MALLOC_H -# include -# else - extern void free(); -# endif -#endif - -void gsm_destroy P1((S), gsm S) -{ - if (S) free((char *)S); -} diff --git a/third_party/gsm/src/gsm_encode.c b/third_party/gsm/src/gsm_encode.c deleted file mode 100644 index 51bc556..0000000 --- a/third_party/gsm/src/gsm_encode.c +++ /dev/null @@ -1,451 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/gsm_encode.c,v 1.2 1996/07/02 09:59:05 jutta Exp $ */ - -#include "private.h" -#include "gsm.h" -#include "proto.h" - -void gsm_encode P3((s, source, c), gsm s, gsm_signal * source, gsm_byte * c) -{ - word LARc[8], Nc[4], Mc[4], bc[4], xmaxc[4], xmc[13*4]; - - Gsm_Coder(s, source, LARc, Nc, bc, Mc, xmaxc, xmc); - - - /* variable size - - GSM_MAGIC 4 - - LARc[0] 6 - LARc[1] 6 - LARc[2] 5 - LARc[3] 5 - LARc[4] 4 - LARc[5] 4 - LARc[6] 3 - LARc[7] 3 - - Nc[0] 7 - bc[0] 2 - Mc[0] 2 - xmaxc[0] 6 - xmc[0] 3 - xmc[1] 3 - xmc[2] 3 - xmc[3] 3 - xmc[4] 3 - xmc[5] 3 - xmc[6] 3 - xmc[7] 3 - xmc[8] 3 - xmc[9] 3 - xmc[10] 3 - xmc[11] 3 - xmc[12] 3 - - Nc[1] 7 - bc[1] 2 - Mc[1] 2 - xmaxc[1] 6 - xmc[13] 3 - xmc[14] 3 - xmc[15] 3 - xmc[16] 3 - xmc[17] 3 - xmc[18] 3 - xmc[19] 3 - xmc[20] 3 - xmc[21] 3 - xmc[22] 3 - xmc[23] 3 - xmc[24] 3 - xmc[25] 3 - - Nc[2] 7 - bc[2] 2 - Mc[2] 2 - xmaxc[2] 6 - xmc[26] 3 - xmc[27] 3 - xmc[28] 3 - xmc[29] 3 - xmc[30] 3 - xmc[31] 3 - xmc[32] 3 - xmc[33] 3 - xmc[34] 3 - xmc[35] 3 - xmc[36] 3 - xmc[37] 3 - xmc[38] 3 - - Nc[3] 7 - bc[3] 2 - Mc[3] 2 - xmaxc[3] 6 - xmc[39] 3 - xmc[40] 3 - xmc[41] 3 - xmc[42] 3 - xmc[43] 3 - xmc[44] 3 - xmc[45] 3 - xmc[46] 3 - xmc[47] 3 - xmc[48] 3 - xmc[49] 3 - xmc[50] 3 - xmc[51] 3 - */ - -#ifdef WAV49 - - if (s->wav_fmt) { - s->frame_index = !s->frame_index; - if (s->frame_index) { - - uword sr; - - sr = 0; - sr = sr >> 6 | LARc[0] << 10; - sr = sr >> 6 | LARc[1] << 10; - *c++ = sr >> 4; - sr = sr >> 5 | LARc[2] << 11; - *c++ = sr >> 7; - sr = sr >> 5 | LARc[3] << 11; - sr = sr >> 4 | LARc[4] << 12; - *c++ = sr >> 6; - sr = sr >> 4 | LARc[5] << 12; - sr = sr >> 3 | LARc[6] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | LARc[7] << 13; - sr = sr >> 7 | Nc[0] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[0] << 14; - sr = sr >> 2 | Mc[0] << 14; - sr = sr >> 6 | xmaxc[0] << 10; - *c++ = sr >> 3; - sr = sr >> 3 | xmc[0] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[1] << 13; - sr = sr >> 3 | xmc[2] << 13; - sr = sr >> 3 | xmc[3] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[4] << 13; - sr = sr >> 3 | xmc[5] << 13; - sr = sr >> 3 | xmc[6] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[7] << 13; - sr = sr >> 3 | xmc[8] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[9] << 13; - sr = sr >> 3 | xmc[10] << 13; - sr = sr >> 3 | xmc[11] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[12] << 13; - sr = sr >> 7 | Nc[1] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[1] << 14; - sr = sr >> 2 | Mc[1] << 14; - sr = sr >> 6 | xmaxc[1] << 10; - *c++ = sr >> 3; - sr = sr >> 3 | xmc[13] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[14] << 13; - sr = sr >> 3 | xmc[15] << 13; - sr = sr >> 3 | xmc[16] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[17] << 13; - sr = sr >> 3 | xmc[18] << 13; - sr = sr >> 3 | xmc[19] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[20] << 13; - sr = sr >> 3 | xmc[21] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[22] << 13; - sr = sr >> 3 | xmc[23] << 13; - sr = sr >> 3 | xmc[24] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[25] << 13; - sr = sr >> 7 | Nc[2] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[2] << 14; - sr = sr >> 2 | Mc[2] << 14; - sr = sr >> 6 | xmaxc[2] << 10; - *c++ = sr >> 3; - sr = sr >> 3 | xmc[26] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[27] << 13; - sr = sr >> 3 | xmc[28] << 13; - sr = sr >> 3 | xmc[29] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[30] << 13; - sr = sr >> 3 | xmc[31] << 13; - sr = sr >> 3 | xmc[32] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[33] << 13; - sr = sr >> 3 | xmc[34] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[35] << 13; - sr = sr >> 3 | xmc[36] << 13; - sr = sr >> 3 | xmc[37] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[38] << 13; - sr = sr >> 7 | Nc[3] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[3] << 14; - sr = sr >> 2 | Mc[3] << 14; - sr = sr >> 6 | xmaxc[3] << 10; - *c++ = sr >> 3; - sr = sr >> 3 | xmc[39] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[40] << 13; - sr = sr >> 3 | xmc[41] << 13; - sr = sr >> 3 | xmc[42] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[43] << 13; - sr = sr >> 3 | xmc[44] << 13; - sr = sr >> 3 | xmc[45] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[46] << 13; - sr = sr >> 3 | xmc[47] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[48] << 13; - sr = sr >> 3 | xmc[49] << 13; - sr = sr >> 3 | xmc[50] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[51] << 13; - sr = sr >> 4; - *c = sr >> 8; - s->frame_chain = *c; - } - else { - uword sr; - - sr = 0; - sr = sr >> 4 | s->frame_chain << 12; - sr = sr >> 6 | LARc[0] << 10; - *c++ = sr >> 6; - sr = sr >> 6 | LARc[1] << 10; - *c++ = sr >> 8; - sr = sr >> 5 | LARc[2] << 11; - sr = sr >> 5 | LARc[3] << 11; - *c++ = sr >> 6; - sr = sr >> 4 | LARc[4] << 12; - sr = sr >> 4 | LARc[5] << 12; - *c++ = sr >> 6; - sr = sr >> 3 | LARc[6] << 13; - sr = sr >> 3 | LARc[7] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[0] << 9; - sr = sr >> 2 | bc[0] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[0] << 14; - sr = sr >> 6 | xmaxc[0] << 10; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[0] << 13; - sr = sr >> 3 | xmc[1] << 13; - sr = sr >> 3 | xmc[2] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[3] << 13; - sr = sr >> 3 | xmc[4] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[5] << 13; - sr = sr >> 3 | xmc[6] << 13; - sr = sr >> 3 | xmc[7] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[8] << 13; - sr = sr >> 3 | xmc[9] << 13; - sr = sr >> 3 | xmc[10] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[11] << 13; - sr = sr >> 3 | xmc[12] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[1] << 9; - sr = sr >> 2 | bc[1] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[1] << 14; - sr = sr >> 6 | xmaxc[1] << 10; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[13] << 13; - sr = sr >> 3 | xmc[14] << 13; - sr = sr >> 3 | xmc[15] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[16] << 13; - sr = sr >> 3 | xmc[17] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[18] << 13; - sr = sr >> 3 | xmc[19] << 13; - sr = sr >> 3 | xmc[20] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[21] << 13; - sr = sr >> 3 | xmc[22] << 13; - sr = sr >> 3 | xmc[23] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[24] << 13; - sr = sr >> 3 | xmc[25] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[2] << 9; - sr = sr >> 2 | bc[2] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[2] << 14; - sr = sr >> 6 | xmaxc[2] << 10; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[26] << 13; - sr = sr >> 3 | xmc[27] << 13; - sr = sr >> 3 | xmc[28] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[29] << 13; - sr = sr >> 3 | xmc[30] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[31] << 13; - sr = sr >> 3 | xmc[32] << 13; - sr = sr >> 3 | xmc[33] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[34] << 13; - sr = sr >> 3 | xmc[35] << 13; - sr = sr >> 3 | xmc[36] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[37] << 13; - sr = sr >> 3 | xmc[38] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[3] << 9; - sr = sr >> 2 | bc[3] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[3] << 14; - sr = sr >> 6 | xmaxc[3] << 10; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[39] << 13; - sr = sr >> 3 | xmc[40] << 13; - sr = sr >> 3 | xmc[41] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[42] << 13; - sr = sr >> 3 | xmc[43] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[44] << 13; - sr = sr >> 3 | xmc[45] << 13; - sr = sr >> 3 | xmc[46] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[47] << 13; - sr = sr >> 3 | xmc[48] << 13; - sr = sr >> 3 | xmc[49] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[50] << 13; - sr = sr >> 3 | xmc[51] << 13; - *c++ = sr >> 8; - } - } - - else - -#endif /* WAV49 */ - { - - *c++ = ((GSM_MAGIC & 0xF) << 4) /* 1 */ - | ((LARc[0] >> 2) & 0xF); - *c++ = ((LARc[0] & 0x3) << 6) - | (LARc[1] & 0x3F); - *c++ = ((LARc[2] & 0x1F) << 3) - | ((LARc[3] >> 2) & 0x7); - *c++ = ((LARc[3] & 0x3) << 6) - | ((LARc[4] & 0xF) << 2) - | ((LARc[5] >> 2) & 0x3); - *c++ = ((LARc[5] & 0x3) << 6) - | ((LARc[6] & 0x7) << 3) - | (LARc[7] & 0x7); - *c++ = ((Nc[0] & 0x7F) << 1) - | ((bc[0] >> 1) & 0x1); - *c++ = ((bc[0] & 0x1) << 7) - | ((Mc[0] & 0x3) << 5) - | ((xmaxc[0] >> 1) & 0x1F); - *c++ = ((xmaxc[0] & 0x1) << 7) - | ((xmc[0] & 0x7) << 4) - | ((xmc[1] & 0x7) << 1) - | ((xmc[2] >> 2) & 0x1); - *c++ = ((xmc[2] & 0x3) << 6) - | ((xmc[3] & 0x7) << 3) - | (xmc[4] & 0x7); - *c++ = ((xmc[5] & 0x7) << 5) /* 10 */ - | ((xmc[6] & 0x7) << 2) - | ((xmc[7] >> 1) & 0x3); - *c++ = ((xmc[7] & 0x1) << 7) - | ((xmc[8] & 0x7) << 4) - | ((xmc[9] & 0x7) << 1) - | ((xmc[10] >> 2) & 0x1); - *c++ = ((xmc[10] & 0x3) << 6) - | ((xmc[11] & 0x7) << 3) - | (xmc[12] & 0x7); - *c++ = ((Nc[1] & 0x7F) << 1) - | ((bc[1] >> 1) & 0x1); - *c++ = ((bc[1] & 0x1) << 7) - | ((Mc[1] & 0x3) << 5) - | ((xmaxc[1] >> 1) & 0x1F); - *c++ = ((xmaxc[1] & 0x1) << 7) - | ((xmc[13] & 0x7) << 4) - | ((xmc[14] & 0x7) << 1) - | ((xmc[15] >> 2) & 0x1); - *c++ = ((xmc[15] & 0x3) << 6) - | ((xmc[16] & 0x7) << 3) - | (xmc[17] & 0x7); - *c++ = ((xmc[18] & 0x7) << 5) - | ((xmc[19] & 0x7) << 2) - | ((xmc[20] >> 1) & 0x3); - *c++ = ((xmc[20] & 0x1) << 7) - | ((xmc[21] & 0x7) << 4) - | ((xmc[22] & 0x7) << 1) - | ((xmc[23] >> 2) & 0x1); - *c++ = ((xmc[23] & 0x3) << 6) - | ((xmc[24] & 0x7) << 3) - | (xmc[25] & 0x7); - *c++ = ((Nc[2] & 0x7F) << 1) /* 20 */ - | ((bc[2] >> 1) & 0x1); - *c++ = ((bc[2] & 0x1) << 7) - | ((Mc[2] & 0x3) << 5) - | ((xmaxc[2] >> 1) & 0x1F); - *c++ = ((xmaxc[2] & 0x1) << 7) - | ((xmc[26] & 0x7) << 4) - | ((xmc[27] & 0x7) << 1) - | ((xmc[28] >> 2) & 0x1); - *c++ = ((xmc[28] & 0x3) << 6) - | ((xmc[29] & 0x7) << 3) - | (xmc[30] & 0x7); - *c++ = ((xmc[31] & 0x7) << 5) - | ((xmc[32] & 0x7) << 2) - | ((xmc[33] >> 1) & 0x3); - *c++ = ((xmc[33] & 0x1) << 7) - | ((xmc[34] & 0x7) << 4) - | ((xmc[35] & 0x7) << 1) - | ((xmc[36] >> 2) & 0x1); - *c++ = ((xmc[36] & 0x3) << 6) - | ((xmc[37] & 0x7) << 3) - | (xmc[38] & 0x7); - *c++ = ((Nc[3] & 0x7F) << 1) - | ((bc[3] >> 1) & 0x1); - *c++ = ((bc[3] & 0x1) << 7) - | ((Mc[3] & 0x3) << 5) - | ((xmaxc[3] >> 1) & 0x1F); - *c++ = ((xmaxc[3] & 0x1) << 7) - | ((xmc[39] & 0x7) << 4) - | ((xmc[40] & 0x7) << 1) - | ((xmc[41] >> 2) & 0x1); - *c++ = ((xmc[41] & 0x3) << 6) /* 30 */ - | ((xmc[42] & 0x7) << 3) - | (xmc[43] & 0x7); - *c++ = ((xmc[44] & 0x7) << 5) - | ((xmc[45] & 0x7) << 2) - | ((xmc[46] >> 1) & 0x3); - *c++ = ((xmc[46] & 0x1) << 7) - | ((xmc[47] & 0x7) << 4) - | ((xmc[48] & 0x7) << 1) - | ((xmc[49] >> 2) & 0x1); - *c++ = ((xmc[49] & 0x3) << 6) - | ((xmc[50] & 0x7) << 3) - | (xmc[51] & 0x7); - - } -} diff --git a/third_party/gsm/src/gsm_explode.c b/third_party/gsm/src/gsm_explode.c deleted file mode 100644 index ca48f9b..0000000 --- a/third_party/gsm/src/gsm_explode.c +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/gsm_explode.c,v 1.2 1996/07/02 14:32:42 jutta Exp jutta $ */ - -#include "private.h" -#include "gsm.h" -#include "proto.h" - -int gsm_explode P3((s, c, target), gsm s, gsm_byte * c, gsm_signal * target) -{ -# define LARc target -# define Nc *((gsm_signal (*) [17])(target + 8)) -# define bc *((gsm_signal (*) [17])(target + 9)) -# define Mc *((gsm_signal (*) [17])(target + 10)) -# define xmaxc *((gsm_signal (*) [17])(target + 11)) - - -#ifdef WAV49 - if (s->wav_fmt) { - - uword sr = 0; - - if (s->frame_index == 1) { - - sr = *c++; - LARc[0] = sr & 0x3f; sr >>= 6; - sr |= (uword)*c++ << 2; - LARc[1] = sr & 0x3f; sr >>= 6; - sr |= (uword)*c++ << 4; - LARc[2] = sr & 0x1f; sr >>= 5; - LARc[3] = sr & 0x1f; sr >>= 5; - sr |= (uword)*c++ << 2; - LARc[4] = sr & 0xf; sr >>= 4; - LARc[5] = sr & 0xf; sr >>= 4; - sr |= (uword)*c++ << 2; /* 5 */ - LARc[6] = sr & 0x7; sr >>= 3; - LARc[7] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; - Nc[0] = sr & 0x7f; sr >>= 7; - bc[0] = sr & 0x3; sr >>= 2; - Mc[0] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[0] = sr & 0x3f; sr >>= 6; -#undef xmc -#define xmc (target + 12) - xmc[0] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[1] = sr & 0x7; sr >>= 3; - xmc[2] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[3] = sr & 0x7; sr >>= 3; - xmc[4] = sr & 0x7; sr >>= 3; - xmc[5] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; /* 10 */ - xmc[6] = sr & 0x7; sr >>= 3; - xmc[7] = sr & 0x7; sr >>= 3; - xmc[8] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[9] = sr & 0x7; sr >>= 3; - xmc[10] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[11] = sr & 0x7; sr >>= 3; - xmc[12] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; - Nc[1] = sr & 0x7f; sr >>= 7; - bc[1] = sr & 0x3; sr >>= 2; - Mc[1] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[1] = sr & 0x3f; sr >>= 6; -#undef xmc -#define xmc (target + 29 - 13) - - xmc[13] = sr & 0x7; sr >>= 3; - sr = *c++; /* 15 */ - xmc[14] = sr & 0x7; sr >>= 3; - xmc[15] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[16] = sr & 0x7; sr >>= 3; - xmc[17] = sr & 0x7; sr >>= 3; - xmc[18] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[19] = sr & 0x7; sr >>= 3; - xmc[20] = sr & 0x7; sr >>= 3; - xmc[21] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[22] = sr & 0x7; sr >>= 3; - xmc[23] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[24] = sr & 0x7; sr >>= 3; - xmc[25] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; /* 20 */ - Nc[2] = sr & 0x7f; sr >>= 7; - bc[2] = sr & 0x3; sr >>= 2; - Mc[2] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[2] = sr & 0x3f; sr >>= 6; - -#undef xmc -#define xmc (target + 46 - 26) - - xmc[26] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[27] = sr & 0x7; sr >>= 3; - xmc[28] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[29] = sr & 0x7; sr >>= 3; - xmc[30] = sr & 0x7; sr >>= 3; - xmc[31] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[32] = sr & 0x7; sr >>= 3; - xmc[33] = sr & 0x7; sr >>= 3; - xmc[34] = sr & 0x7; sr >>= 3; - sr = *c++; /* 25 */ - xmc[35] = sr & 0x7; sr >>= 3; - xmc[36] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[37] = sr & 0x7; sr >>= 3; - xmc[38] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 4; - Nc[3] = sr & 0x7f; sr >>= 7; - bc[3] = sr & 0x3; sr >>= 2; - Mc[3] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 1; - xmaxc[3] = sr & 0x3f; sr >>= 6; -#undef xmc -#define xmc (target + 63 - 39) - - xmc[39] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[40] = sr & 0x7; sr >>= 3; - xmc[41] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; /* 30 */ - xmc[42] = sr & 0x7; sr >>= 3; - xmc[43] = sr & 0x7; sr >>= 3; - xmc[44] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[45] = sr & 0x7; sr >>= 3; - xmc[46] = sr & 0x7; sr >>= 3; - xmc[47] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[48] = sr & 0x7; sr >>= 3; - xmc[49] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[50] = sr & 0x7; sr >>= 3; - xmc[51] = sr & 0x7; sr >>= 3; - - s->frame_chain = sr & 0xf; - } - else { - sr = s->frame_chain; - sr |= (uword)*c++ << 4; /* 1 */ - LARc[0] = sr & 0x3f; sr >>= 6; - LARc[1] = sr & 0x3f; sr >>= 6; - sr = *c++; - LARc[2] = sr & 0x1f; sr >>= 5; - sr |= (uword)*c++ << 3; - LARc[3] = sr & 0x1f; sr >>= 5; - LARc[4] = sr & 0xf; sr >>= 4; - sr |= (uword)*c++ << 2; - LARc[5] = sr & 0xf; sr >>= 4; - LARc[6] = sr & 0x7; sr >>= 3; - LARc[7] = sr & 0x7; sr >>= 3; - sr = *c++; /* 5 */ - Nc[0] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; - bc[0] = sr & 0x3; sr >>= 2; - Mc[0] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[0] = sr & 0x3f; sr >>= 6; -#undef xmc -#define xmc (target + 12) - xmc[0] = sr & 0x7; sr >>= 3; - xmc[1] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[2] = sr & 0x7; sr >>= 3; - xmc[3] = sr & 0x7; sr >>= 3; - xmc[4] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[5] = sr & 0x7; sr >>= 3; - xmc[6] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; /* 10 */ - xmc[7] = sr & 0x7; sr >>= 3; - xmc[8] = sr & 0x7; sr >>= 3; - xmc[9] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[10] = sr & 0x7; sr >>= 3; - xmc[11] = sr & 0x7; sr >>= 3; - xmc[12] = sr & 0x7; sr >>= 3; - sr = *c++; - Nc[1] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; - bc[1] = sr & 0x3; sr >>= 2; - Mc[1] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[1] = sr & 0x3f; sr >>= 6; -#undef xmc -#define xmc (target + 29 - 13) - - xmc[13] = sr & 0x7; sr >>= 3; - xmc[14] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; /* 15 */ - xmc[15] = sr & 0x7; sr >>= 3; - xmc[16] = sr & 0x7; sr >>= 3; - xmc[17] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[18] = sr & 0x7; sr >>= 3; - xmc[19] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[20] = sr & 0x7; sr >>= 3; - xmc[21] = sr & 0x7; sr >>= 3; - xmc[22] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[23] = sr & 0x7; sr >>= 3; - xmc[24] = sr & 0x7; sr >>= 3; - xmc[25] = sr & 0x7; sr >>= 3; - sr = *c++; - Nc[2] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; /* 20 */ - bc[2] = sr & 0x3; sr >>= 2; - Mc[2] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[2] = sr & 0x3f; sr >>= 6; -#undef xmc -#define xmc (target + 46 - 26) - xmc[26] = sr & 0x7; sr >>= 3; - xmc[27] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[28] = sr & 0x7; sr >>= 3; - xmc[29] = sr & 0x7; sr >>= 3; - xmc[30] = sr & 0x7; sr >>= 3; - sr = *c++; - xmc[31] = sr & 0x7; sr >>= 3; - xmc[32] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[33] = sr & 0x7; sr >>= 3; - xmc[34] = sr & 0x7; sr >>= 3; - xmc[35] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; /* 25 */ - xmc[36] = sr & 0x7; sr >>= 3; - xmc[37] = sr & 0x7; sr >>= 3; - xmc[38] = sr & 0x7; sr >>= 3; - sr = *c++; - Nc[3] = sr & 0x7f; sr >>= 7; - sr |= (uword)*c++ << 1; - bc[3] = sr & 0x3; sr >>= 2; - Mc[3] = sr & 0x3; sr >>= 2; - sr |= (uword)*c++ << 5; - xmaxc[3] = sr & 0x3f; sr >>= 6; - -#undef xmc -#define xmc (target + 63 - 39) - - xmc[39] = sr & 0x7; sr >>= 3; - xmc[40] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[41] = sr & 0x7; sr >>= 3; - xmc[42] = sr & 0x7; sr >>= 3; - xmc[43] = sr & 0x7; sr >>= 3; - sr = *c++; /* 30 */ - xmc[44] = sr & 0x7; sr >>= 3; - xmc[45] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 2; - xmc[46] = sr & 0x7; sr >>= 3; - xmc[47] = sr & 0x7; sr >>= 3; - xmc[48] = sr & 0x7; sr >>= 3; - sr |= (uword)*c++ << 1; - xmc[49] = sr & 0x7; sr >>= 3; - xmc[50] = sr & 0x7; sr >>= 3; - xmc[51] = sr & 0x7; sr >>= 3; - } - } - else -#endif - { - /* GSM_MAGIC = (*c >> 4) & 0xF; */ - - if (((*c >> 4) & 0x0F) != GSM_MAGIC) return -1; - - LARc[0] = (*c++ & 0xF) << 2; /* 1 */ - LARc[0] |= (*c >> 6) & 0x3; - LARc[1] = *c++ & 0x3F; - LARc[2] = (*c >> 3) & 0x1F; - LARc[3] = (*c++ & 0x7) << 2; - LARc[3] |= (*c >> 6) & 0x3; - LARc[4] = (*c >> 2) & 0xF; - LARc[5] = (*c++ & 0x3) << 2; - LARc[5] |= (*c >> 6) & 0x3; - LARc[6] = (*c >> 3) & 0x7; - LARc[7] = *c++ & 0x7; - - Nc[0] = (*c >> 1) & 0x7F; - - bc[0] = (*c++ & 0x1) << 1; - bc[0] |= (*c >> 7) & 0x1; - - Mc[0] = (*c >> 5) & 0x3; - - xmaxc[0] = (*c++ & 0x1F) << 1; - xmaxc[0] |= (*c >> 7) & 0x1; - -#undef xmc -#define xmc (target + 12) - - xmc[0] = (*c >> 4) & 0x7; - xmc[1] = (*c >> 1) & 0x7; - xmc[2] = (*c++ & 0x1) << 2; - xmc[2] |= (*c >> 6) & 0x3; - xmc[3] = (*c >> 3) & 0x7; - xmc[4] = *c++ & 0x7; - xmc[5] = (*c >> 5) & 0x7; - xmc[6] = (*c >> 2) & 0x7; - xmc[7] = (*c++ & 0x3) << 1; /* 10 */ - xmc[7] |= (*c >> 7) & 0x1; - xmc[8] = (*c >> 4) & 0x7; - xmc[9] = (*c >> 1) & 0x7; - xmc[10] = (*c++ & 0x1) << 2; - xmc[10] |= (*c >> 6) & 0x3; - xmc[11] = (*c >> 3) & 0x7; - xmc[12] = *c++ & 0x7; - - Nc[1] = (*c >> 1) & 0x7F; - - bc[1] = (*c++ & 0x1) << 1; - bc[1] |= (*c >> 7) & 0x1; - - Mc[1] = (*c >> 5) & 0x3; - - xmaxc[1] = (*c++ & 0x1F) << 1; - xmaxc[1] |= (*c >> 7) & 0x1; - -#undef xmc -#define xmc (target + 29 - 13) - - xmc[13] = (*c >> 4) & 0x7; - xmc[14] = (*c >> 1) & 0x7; - xmc[15] = (*c++ & 0x1) << 2; - xmc[15] |= (*c >> 6) & 0x3; - xmc[16] = (*c >> 3) & 0x7; - xmc[17] = *c++ & 0x7; - xmc[18] = (*c >> 5) & 0x7; - xmc[19] = (*c >> 2) & 0x7; - xmc[20] = (*c++ & 0x3) << 1; - xmc[20] |= (*c >> 7) & 0x1; - xmc[21] = (*c >> 4) & 0x7; - xmc[22] = (*c >> 1) & 0x7; - xmc[23] = (*c++ & 0x1) << 2; - xmc[23] |= (*c >> 6) & 0x3; - xmc[24] = (*c >> 3) & 0x7; - xmc[25] = *c++ & 0x7; - - Nc[2] = (*c >> 1) & 0x7F; - - bc[2] = (*c++ & 0x1) << 1; /* 20 */ - bc[2] |= (*c >> 7) & 0x1; - - Mc[2] = (*c >> 5) & 0x3; - - xmaxc[2] = (*c++ & 0x1F) << 1; - xmaxc[2] |= (*c >> 7) & 0x1; - -#undef xmc -#define xmc (target + 46 - 26) - - xmc[26] = (*c >> 4) & 0x7; - xmc[27] = (*c >> 1) & 0x7; - xmc[28] = (*c++ & 0x1) << 2; - xmc[28] |= (*c >> 6) & 0x3; - xmc[29] = (*c >> 3) & 0x7; - xmc[30] = *c++ & 0x7; - xmc[31] = (*c >> 5) & 0x7; - xmc[32] = (*c >> 2) & 0x7; - xmc[33] = (*c++ & 0x3) << 1; - xmc[33] |= (*c >> 7) & 0x1; - xmc[34] = (*c >> 4) & 0x7; - xmc[35] = (*c >> 1) & 0x7; - xmc[36] = (*c++ & 0x1) << 2; - xmc[36] |= (*c >> 6) & 0x3; - xmc[37] = (*c >> 3) & 0x7; - xmc[38] = *c++ & 0x7; - - Nc[3] = (*c >> 1) & 0x7F; - - bc[3] = (*c++ & 0x1) << 1; - bc[3] |= (*c >> 7) & 0x1; - - Mc[3] = (*c >> 5) & 0x3; - - xmaxc[3] = (*c++ & 0x1F) << 1; - xmaxc[3] |= (*c >> 7) & 0x1; - -#undef xmc -#define xmc (target + 63 - 39) - - xmc[39] = (*c >> 4) & 0x7; - xmc[40] = (*c >> 1) & 0x7; - xmc[41] = (*c++ & 0x1) << 2; - xmc[41] |= (*c >> 6) & 0x3; - xmc[42] = (*c >> 3) & 0x7; - xmc[43] = *c++ & 0x7; /* 30 */ - xmc[44] = (*c >> 5) & 0x7; - xmc[45] = (*c >> 2) & 0x7; - xmc[46] = (*c++ & 0x3) << 1; - xmc[46] |= (*c >> 7) & 0x1; - xmc[47] = (*c >> 4) & 0x7; - xmc[48] = (*c >> 1) & 0x7; - xmc[49] = (*c++ & 0x1) << 2; - xmc[49] |= (*c >> 6) & 0x3; - xmc[50] = (*c >> 3) & 0x7; - xmc[51] = *c & 0x7; /* 33 */ - } - - return 0; -} diff --git a/third_party/gsm/src/gsm_implode.c b/third_party/gsm/src/gsm_implode.c deleted file mode 100644 index 6c5672b..0000000 --- a/third_party/gsm/src/gsm_implode.c +++ /dev/null @@ -1,521 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/gsm_implode.c,v 1.2 1996/07/02 14:32:43 jutta Exp jutta $ */ - -#include "private.h" - -#include "gsm.h" -#include "proto.h" - -void gsm_implode P3((s, source, c), gsm s, gsm_signal * source, gsm_byte * c) -{ - /* variable size index - - GSM_MAGIC 4 - - - LARc[0] 6 0 - LARc[1] 6 1 - LARc[2] 5 2 - LARc[3] 5 3 - LARc[4] 4 4 - LARc[5] 4 5 - LARc[6] 3 6 - LARc[7] 3 7 - - Nc[0] 7 8 - bc[0] 2 9 - Mc[0] 2 10 - xmaxc[0] 6 11 - xmc[0] 3 12 - xmc[1] 3 13 - xmc[2] 3 14 - xmc[3] 3 15 - xmc[4] 3 16 - xmc[5] 3 17 - xmc[6] 3 18 - xmc[7] 3 19 - xmc[8] 3 20 - xmc[9] 3 21 - xmc[10] 3 22 - xmc[11] 3 23 - xmc[12] 3 24 - - Nc[1] 7 25 - bc[1] 2 26 - Mc[1] 2 27 - xmaxc[1] 6 28 - xmc[13] 3 29 - xmc[14] 3 30 - xmc[15] 3 31 - xmc[16] 3 32 - xmc[17] 3 33 - xmc[18] 3 34 - xmc[19] 3 35 - xmc[20] 3 36 - xmc[21] 3 37 - xmc[22] 3 38 - xmc[23] 3 39 - xmc[24] 3 40 - xmc[25] 3 41 - - Nc[2] 7 42 - bc[2] 2 43 - Mc[2] 2 44 - xmaxc[2] 6 45 - xmc[26] 3 46 - xmc[27] 3 47 - xmc[28] 3 48 - xmc[29] 3 49 - xmc[30] 3 50 - xmc[31] 3 51 - xmc[32] 3 52 - xmc[33] 3 53 - xmc[34] 3 54 - xmc[35] 3 55 - xmc[36] 3 56 - xmc[37] 3 57 - xmc[38] 3 58 - - Nc[3] 7 59 - bc[3] 2 60 - Mc[3] 2 61 - xmaxc[3] 6 62 - xmc[39] 3 63 - xmc[40] 3 64 - xmc[41] 3 65 - xmc[42] 3 66 - xmc[43] 3 67 - xmc[44] 3 68 - xmc[45] 3 69 - xmc[46] 3 70 - xmc[47] 3 71 - xmc[48] 3 72 - xmc[49] 3 73 - xmc[50] 3 74 - xmc[51] 3 75 - */ - - /* There are 76 parameters per frame. The first eight are - * unique. The remaining 68 are four identical subframes of - * 17 parameters each. gsm_implode converts from a representation - * of these parameters as values in one array of signed words - * to the "packed" version of a GSM frame. - */ - -# define LARc source -# define Nc *((gsm_signal (*) [17])(source + 8)) -# define bc *((gsm_signal (*) [17])(source + 9)) -# define Mc *((gsm_signal (*) [17])(source + 10)) -# define xmaxc *((gsm_signal (*) [17])(source + 11)) - -#ifdef WAV49 - if (s->wav_fmt) { - - uword sr = 0; - if (s->frame_index) { - sr = sr >> 6 | LARc[0] << 10; - sr = sr >> 6 | LARc[1] << 10; - *c++ = sr >> 4; - sr = sr >> 5 | LARc[2] << 11; - *c++ = sr >> 7; - sr = sr >> 5 | LARc[3] << 11; - sr = sr >> 4 | LARc[4] << 12; - *c++ = sr >> 6; - sr = sr >> 4 | LARc[5] << 12; - sr = sr >> 3 | LARc[6] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | LARc[7] << 13; - sr = sr >> 7 | Nc[0] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[0] << 14; - sr = sr >> 2 | Mc[0] << 14; - sr = sr >> 6 | xmaxc[0] << 10; - *c++ = sr >> 3; -#undef xmc -#define xmc (source + 12) - - sr = sr >> 3 | xmc[0] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[1] << 13; - sr = sr >> 3 | xmc[2] << 13; - sr = sr >> 3 | xmc[3] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[4] << 13; - sr = sr >> 3 | xmc[5] << 13; - sr = sr >> 3 | xmc[6] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[7] << 13; - sr = sr >> 3 | xmc[8] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[9] << 13; - sr = sr >> 3 | xmc[10] << 13; - sr = sr >> 3 | xmc[11] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[12] << 13; - sr = sr >> 7 | Nc[1] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[1] << 14; - sr = sr >> 2 | Mc[1] << 14; - sr = sr >> 6 | xmaxc[1] << 10; - *c++ = sr >> 3; -#undef xmc -#define xmc (source + 29 - 13) - - sr = sr >> 3 | xmc[13] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[14] << 13; - sr = sr >> 3 | xmc[15] << 13; - sr = sr >> 3 | xmc[16] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[17] << 13; - sr = sr >> 3 | xmc[18] << 13; - sr = sr >> 3 | xmc[19] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[20] << 13; - sr = sr >> 3 | xmc[21] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[22] << 13; - sr = sr >> 3 | xmc[23] << 13; - sr = sr >> 3 | xmc[24] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[25] << 13; - sr = sr >> 7 | Nc[2] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[2] << 14; - sr = sr >> 2 | Mc[2] << 14; - sr = sr >> 6 | xmaxc[2] << 10; - *c++ = sr >> 3; -#undef xmc -#define xmc (source + 46 - 26) - - sr = sr >> 3 | xmc[26] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[27] << 13; - sr = sr >> 3 | xmc[28] << 13; - sr = sr >> 3 | xmc[29] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[30] << 13; - sr = sr >> 3 | xmc[31] << 13; - sr = sr >> 3 | xmc[32] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[33] << 13; - sr = sr >> 3 | xmc[34] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[35] << 13; - sr = sr >> 3 | xmc[36] << 13; - sr = sr >> 3 | xmc[37] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[38] << 13; - sr = sr >> 7 | Nc[3] << 9; - *c++ = sr >> 5; - sr = sr >> 2 | bc[3] << 14; - sr = sr >> 2 | Mc[3] << 14; - sr = sr >> 6 | xmaxc[3] << 10; - *c++ = sr >> 3; -#undef xmc -#define xmc (source + 63 - 39) - - sr = sr >> 3 | xmc[39] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[40] << 13; - sr = sr >> 3 | xmc[41] << 13; - sr = sr >> 3 | xmc[42] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[43] << 13; - sr = sr >> 3 | xmc[44] << 13; - sr = sr >> 3 | xmc[45] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[46] << 13; - sr = sr >> 3 | xmc[47] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[48] << 13; - sr = sr >> 3 | xmc[49] << 13; - sr = sr >> 3 | xmc[50] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[51] << 13; - sr = sr >> 4; - *c = sr >> 8; - s->frame_chain = *c; - } - else { - sr = sr >> 4 | s->frame_chain << 12; - sr = sr >> 6 | LARc[0] << 10; - *c++ = sr >> 6; - sr = sr >> 6 | LARc[1] << 10; - *c++ = sr >> 8; - sr = sr >> 5 | LARc[2] << 11; - sr = sr >> 5 | LARc[3] << 11; - *c++ = sr >> 6; - sr = sr >> 4 | LARc[4] << 12; - sr = sr >> 4 | LARc[5] << 12; - *c++ = sr >> 6; - sr = sr >> 3 | LARc[6] << 13; - sr = sr >> 3 | LARc[7] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[0] << 9; - sr = sr >> 2 | bc[0] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[0] << 14; - sr = sr >> 6 | xmaxc[0] << 10; - *c++ = sr >> 7; -#undef xmc -#define xmc (source + 12) - - sr = sr >> 3 | xmc[0] << 13; - sr = sr >> 3 | xmc[1] << 13; - sr = sr >> 3 | xmc[2] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[3] << 13; - sr = sr >> 3 | xmc[4] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[5] << 13; - sr = sr >> 3 | xmc[6] << 13; - sr = sr >> 3 | xmc[7] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[8] << 13; - sr = sr >> 3 | xmc[9] << 13; - sr = sr >> 3 | xmc[10] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[11] << 13; - sr = sr >> 3 | xmc[12] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[1] << 9; - sr = sr >> 2 | bc[1] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[1] << 14; - sr = sr >> 6 | xmaxc[1] << 10; - *c++ = sr >> 7; -#undef xmc -#define xmc (source + 29 - 13) - - sr = sr >> 3 | xmc[13] << 13; - sr = sr >> 3 | xmc[14] << 13; - sr = sr >> 3 | xmc[15] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[16] << 13; - sr = sr >> 3 | xmc[17] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[18] << 13; - sr = sr >> 3 | xmc[19] << 13; - sr = sr >> 3 | xmc[20] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[21] << 13; - sr = sr >> 3 | xmc[22] << 13; - sr = sr >> 3 | xmc[23] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[24] << 13; - sr = sr >> 3 | xmc[25] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[2] << 9; - sr = sr >> 2 | bc[2] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[2] << 14; - sr = sr >> 6 | xmaxc[2] << 10; - *c++ = sr >> 7; -#undef xmc -#define xmc (source + 46 - 26) - - sr = sr >> 3 | xmc[26] << 13; - sr = sr >> 3 | xmc[27] << 13; - sr = sr >> 3 | xmc[28] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[29] << 13; - sr = sr >> 3 | xmc[30] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[31] << 13; - sr = sr >> 3 | xmc[32] << 13; - sr = sr >> 3 | xmc[33] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[34] << 13; - sr = sr >> 3 | xmc[35] << 13; - sr = sr >> 3 | xmc[36] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[37] << 13; - sr = sr >> 3 | xmc[38] << 13; - *c++ = sr >> 8; - sr = sr >> 7 | Nc[3] << 9; - sr = sr >> 2 | bc[3] << 14; - *c++ = sr >> 7; - sr = sr >> 2 | Mc[3] << 14; - sr = sr >> 6 | xmaxc[3] << 10; - *c++ = sr >> 7; -#undef xmc -#define xmc (source + 63 - 39) - - sr = sr >> 3 | xmc[39] << 13; - sr = sr >> 3 | xmc[40] << 13; - sr = sr >> 3 | xmc[41] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[42] << 13; - sr = sr >> 3 | xmc[43] << 13; - *c++ = sr >> 8; - sr = sr >> 3 | xmc[44] << 13; - sr = sr >> 3 | xmc[45] << 13; - sr = sr >> 3 | xmc[46] << 13; - *c++ = sr >> 7; - sr = sr >> 3 | xmc[47] << 13; - sr = sr >> 3 | xmc[48] << 13; - sr = sr >> 3 | xmc[49] << 13; - *c++ = sr >> 6; - sr = sr >> 3 | xmc[50] << 13; - sr = sr >> 3 | xmc[51] << 13; - *c++ = sr >> 8; - } - } - else -#endif - { - - *c++ = ((GSM_MAGIC & 0xF) << 4) /* 1 */ - | ((LARc[0] >> 2) & 0xF); - *c++ = ((LARc[0] & 0x3) << 6) - | (LARc[1] & 0x3F); - *c++ = ((LARc[2] & 0x1F) << 3) - | ((LARc[3] >> 2) & 0x7); - *c++ = ((LARc[3] & 0x3) << 6) - | ((LARc[4] & 0xF) << 2) - | ((LARc[5] >> 2) & 0x3); - *c++ = ((LARc[5] & 0x3) << 6) - | ((LARc[6] & 0x7) << 3) - | (LARc[7] & 0x7); - - - *c++ = ((Nc[0] & 0x7F) << 1) - - - | ((bc[0] >> 1) & 0x1); - *c++ = ((bc[0] & 0x1) << 7) - - - | ((Mc[0] & 0x3) << 5) - - | ((xmaxc[0] >> 1) & 0x1F); - *c++ = ((xmaxc[0] & 0x1) << 7) - -#undef xmc -#define xmc (source + 12) - - | ((xmc[0] & 0x7) << 4) - | ((xmc[1] & 0x7) << 1) - | ((xmc[2] >> 2) & 0x1); - *c++ = ((xmc[2] & 0x3) << 6) - | ((xmc[3] & 0x7) << 3) - | (xmc[4] & 0x7); - *c++ = ((xmc[5] & 0x7) << 5) /* 10 */ - | ((xmc[6] & 0x7) << 2) - | ((xmc[7] >> 1) & 0x3); - *c++ = ((xmc[7] & 0x1) << 7) - | ((xmc[8] & 0x7) << 4) - | ((xmc[9] & 0x7) << 1) - | ((xmc[10] >> 2) & 0x1); - *c++ = ((xmc[10] & 0x3) << 6) - | ((xmc[11] & 0x7) << 3) - | (xmc[12] & 0x7); - - - *c++ = ((Nc[1] & 0x7F) << 1) - - - | ((bc[1] >> 1) & 0x1); - *c++ = ((bc[1] & 0x1) << 7) - - - | ((Mc[1] & 0x3) << 5) - - - | ((xmaxc[1] >> 1) & 0x1F); - *c++ = ((xmaxc[1] & 0x1) << 7) - -#undef xmc -#define xmc (source + 29 - 13) - - | ((xmc[13] & 0x7) << 4) - | ((xmc[14] & 0x7) << 1) - | ((xmc[15] >> 2) & 0x1); - *c++ = ((xmc[15] & 0x3) << 6) - | ((xmc[16] & 0x7) << 3) - | (xmc[17] & 0x7); - *c++ = ((xmc[18] & 0x7) << 5) - | ((xmc[19] & 0x7) << 2) - | ((xmc[20] >> 1) & 0x3); - *c++ = ((xmc[20] & 0x1) << 7) - | ((xmc[21] & 0x7) << 4) - | ((xmc[22] & 0x7) << 1) - | ((xmc[23] >> 2) & 0x1); - *c++ = ((xmc[23] & 0x3) << 6) - | ((xmc[24] & 0x7) << 3) - | (xmc[25] & 0x7); - - - *c++ = ((Nc[2] & 0x7F) << 1) /* 20 */ - - - | ((bc[2] >> 1) & 0x1); - *c++ = ((bc[2] & 0x1) << 7) - - - | ((Mc[2] & 0x3) << 5) - - - | ((xmaxc[2] >> 1) & 0x1F); - *c++ = ((xmaxc[2] & 0x1) << 7) - -#undef xmc -#define xmc (source + 46 - 26) - - | ((xmc[26] & 0x7) << 4) - | ((xmc[27] & 0x7) << 1) - | ((xmc[28] >> 2) & 0x1); - *c++ = ((xmc[28] & 0x3) << 6) - | ((xmc[29] & 0x7) << 3) - | (xmc[30] & 0x7); - *c++ = ((xmc[31] & 0x7) << 5) - | ((xmc[32] & 0x7) << 2) - | ((xmc[33] >> 1) & 0x3); - *c++ = ((xmc[33] & 0x1) << 7) - | ((xmc[34] & 0x7) << 4) - | ((xmc[35] & 0x7) << 1) - | ((xmc[36] >> 2) & 0x1); - *c++ = ((xmc[36] & 0x3) << 6) - | ((xmc[37] & 0x7) << 3) - | (xmc[38] & 0x7); - - - *c++ = ((Nc[3] & 0x7F) << 1) - - - | ((bc[3] >> 1) & 0x1); - *c++ = ((bc[3] & 0x1) << 7) - - - | ((Mc[3] & 0x3) << 5) - - - | ((xmaxc[3] >> 1) & 0x1F); - *c++ = ((xmaxc[3] & 0x1) << 7) - -#undef xmc -#define xmc (source + 63 - 39) - - | ((xmc[39] & 0x7) << 4) - | ((xmc[40] & 0x7) << 1) - | ((xmc[41] >> 2) & 0x1); - *c++ = ((xmc[41] & 0x3) << 6) /* 30 */ - | ((xmc[42] & 0x7) << 3) - | (xmc[43] & 0x7); - *c++ = ((xmc[44] & 0x7) << 5) - | ((xmc[45] & 0x7) << 2) - | ((xmc[46] >> 1) & 0x3); - *c++ = ((xmc[46] & 0x1) << 7) - | ((xmc[47] & 0x7) << 4) - | ((xmc[48] & 0x7) << 1) - | ((xmc[49] >> 2) & 0x1); - *c++ = ((xmc[49] & 0x3) << 6) - | ((xmc[50] & 0x7) << 3) - | (xmc[51] & 0x7); - } -} diff --git a/third_party/gsm/src/gsm_option.c b/third_party/gsm/src/gsm_option.c deleted file mode 100644 index 274b7b1..0000000 --- a/third_party/gsm/src/gsm_option.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/gsm_option.c,v 1.3 1996/07/02 09:59:05 jutta Exp $ */ - -#include "private.h" - -#include "gsm.h" -#include "proto.h" - -int gsm_option P3((r, opt, val), gsm r, int opt, int * val) -{ - int result = -1; - - switch (opt) { - case GSM_OPT_LTP_CUT: -#ifdef LTP_CUT - result = r->ltp_cut; - if (val) r->ltp_cut = *val; -#endif - break; - - case GSM_OPT_VERBOSE: -#ifndef NDEBUG - result = r->verbose; - if (val) r->verbose = *val; -#endif - break; - - case GSM_OPT_FAST: - -#if defined(FAST) && defined(USE_FLOAT_MUL) - result = r->fast; - if (val) r->fast = !!*val; -#endif - break; - - case GSM_OPT_FRAME_CHAIN: - -#ifdef WAV49 - result = r->frame_chain; - if (val) r->frame_chain = *val; -#endif - break; - - case GSM_OPT_FRAME_INDEX: - -#ifdef WAV49 - result = r->frame_index; - if (val) r->frame_index = *val; -#endif - break; - - case GSM_OPT_WAV49: - -#ifdef WAV49 - result = r->wav_fmt; - if (val) r->wav_fmt = !!*val; -#endif - break; - - default: - break; - } - return result; -} diff --git a/third_party/gsm/src/gsm_print.c b/third_party/gsm/src/gsm_print.c deleted file mode 100644 index 47f753b..0000000 --- a/third_party/gsm/src/gsm_print.c +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/gsm_print.c,v 1.1 1992/10/28 00:15:50 jutta Exp $ */ - -#include - -#include "private.h" - -#include "gsm.h" -#include "proto.h" - -int gsm_print P3((f, s, c), FILE * f, gsm s, gsm_byte * c) -{ - word LARc[8], Nc[4], Mc[4], bc[4], xmaxc[4], xmc[13*4]; - - /* GSM_MAGIC = (*c >> 4) & 0xF; */ - - if (((*c >> 4) & 0x0F) != GSM_MAGIC) return -1; - - LARc[0] = (*c++ & 0xF) << 2; /* 1 */ - LARc[0] |= (*c >> 6) & 0x3; - LARc[1] = *c++ & 0x3F; - LARc[2] = (*c >> 3) & 0x1F; - LARc[3] = (*c++ & 0x7) << 2; - LARc[3] |= (*c >> 6) & 0x3; - LARc[4] = (*c >> 2) & 0xF; - LARc[5] = (*c++ & 0x3) << 2; - LARc[5] |= (*c >> 6) & 0x3; - LARc[6] = (*c >> 3) & 0x7; - LARc[7] = *c++ & 0x7; - - - Nc[0] = (*c >> 1) & 0x7F; - bc[0] = (*c++ & 0x1) << 1; - bc[0] |= (*c >> 7) & 0x1; - Mc[0] = (*c >> 5) & 0x3; - xmaxc[0] = (*c++ & 0x1F) << 1; - xmaxc[0] |= (*c >> 7) & 0x1; - xmc[0] = (*c >> 4) & 0x7; - xmc[1] = (*c >> 1) & 0x7; - xmc[2] = (*c++ & 0x1) << 2; - xmc[2] |= (*c >> 6) & 0x3; - xmc[3] = (*c >> 3) & 0x7; - xmc[4] = *c++ & 0x7; - xmc[5] = (*c >> 5) & 0x7; - xmc[6] = (*c >> 2) & 0x7; - xmc[7] = (*c++ & 0x3) << 1; /* 10 */ - xmc[7] |= (*c >> 7) & 0x1; - xmc[8] = (*c >> 4) & 0x7; - xmc[9] = (*c >> 1) & 0x7; - xmc[10] = (*c++ & 0x1) << 2; - xmc[10] |= (*c >> 6) & 0x3; - xmc[11] = (*c >> 3) & 0x7; - xmc[12] = *c++ & 0x7; - - Nc[1] = (*c >> 1) & 0x7F; - bc[1] = (*c++ & 0x1) << 1; - bc[1] |= (*c >> 7) & 0x1; - Mc[1] = (*c >> 5) & 0x3; - xmaxc[1] = (*c++ & 0x1F) << 1; - xmaxc[1] |= (*c >> 7) & 0x1; - xmc[13] = (*c >> 4) & 0x7; - xmc[14] = (*c >> 1) & 0x7; - xmc[15] = (*c++ & 0x1) << 2; - xmc[15] |= (*c >> 6) & 0x3; - xmc[16] = (*c >> 3) & 0x7; - xmc[17] = *c++ & 0x7; - xmc[18] = (*c >> 5) & 0x7; - xmc[19] = (*c >> 2) & 0x7; - xmc[20] = (*c++ & 0x3) << 1; - xmc[20] |= (*c >> 7) & 0x1; - xmc[21] = (*c >> 4) & 0x7; - xmc[22] = (*c >> 1) & 0x7; - xmc[23] = (*c++ & 0x1) << 2; - xmc[23] |= (*c >> 6) & 0x3; - xmc[24] = (*c >> 3) & 0x7; - xmc[25] = *c++ & 0x7; - - - Nc[2] = (*c >> 1) & 0x7F; - bc[2] = (*c++ & 0x1) << 1; /* 20 */ - bc[2] |= (*c >> 7) & 0x1; - Mc[2] = (*c >> 5) & 0x3; - xmaxc[2] = (*c++ & 0x1F) << 1; - xmaxc[2] |= (*c >> 7) & 0x1; - xmc[26] = (*c >> 4) & 0x7; - xmc[27] = (*c >> 1) & 0x7; - xmc[28] = (*c++ & 0x1) << 2; - xmc[28] |= (*c >> 6) & 0x3; - xmc[29] = (*c >> 3) & 0x7; - xmc[30] = *c++ & 0x7; - xmc[31] = (*c >> 5) & 0x7; - xmc[32] = (*c >> 2) & 0x7; - xmc[33] = (*c++ & 0x3) << 1; - xmc[33] |= (*c >> 7) & 0x1; - xmc[34] = (*c >> 4) & 0x7; - xmc[35] = (*c >> 1) & 0x7; - xmc[36] = (*c++ & 0x1) << 2; - xmc[36] |= (*c >> 6) & 0x3; - xmc[37] = (*c >> 3) & 0x7; - xmc[38] = *c++ & 0x7; - - Nc[3] = (*c >> 1) & 0x7F; - bc[3] = (*c++ & 0x1) << 1; - bc[3] |= (*c >> 7) & 0x1; - Mc[3] = (*c >> 5) & 0x3; - xmaxc[3] = (*c++ & 0x1F) << 1; - xmaxc[3] |= (*c >> 7) & 0x1; - - xmc[39] = (*c >> 4) & 0x7; - xmc[40] = (*c >> 1) & 0x7; - xmc[41] = (*c++ & 0x1) << 2; - xmc[41] |= (*c >> 6) & 0x3; - xmc[42] = (*c >> 3) & 0x7; - xmc[43] = *c++ & 0x7; /* 30 */ - xmc[44] = (*c >> 5) & 0x7; - xmc[45] = (*c >> 2) & 0x7; - xmc[46] = (*c++ & 0x3) << 1; - xmc[46] |= (*c >> 7) & 0x1; - xmc[47] = (*c >> 4) & 0x7; - xmc[48] = (*c >> 1) & 0x7; - xmc[49] = (*c++ & 0x1) << 2; - xmc[49] |= (*c >> 6) & 0x3; - xmc[50] = (*c >> 3) & 0x7; - xmc[51] = *c & 0x7; /* 33 */ - - fprintf(f, - "LARc:\t%2.2d %2.2d %2.2d %2.2d %2.2d %2.2d %2.2d %2.2d\n", - LARc[0],LARc[1],LARc[2],LARc[3],LARc[4],LARc[5],LARc[6],LARc[7]); - - fprintf(f, "#1: Nc %4.4d bc %d Mc %d xmaxc %d\n", - Nc[0], bc[0], Mc[0], xmaxc[0]); - fprintf(f, -"\t%.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d\n", - xmc[0],xmc[1],xmc[2],xmc[3],xmc[4],xmc[5],xmc[6], - xmc[7],xmc[8],xmc[9],xmc[10],xmc[11],xmc[12] ); - - fprintf(f, "#2: Nc %4.4d bc %d Mc %d xmaxc %d\n", - Nc[1], bc[1], Mc[1], xmaxc[1]); - fprintf(f, -"\t%.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d\n", - xmc[13+0],xmc[13+1],xmc[13+2],xmc[13+3],xmc[13+4],xmc[13+5], - xmc[13+6], xmc[13+7],xmc[13+8],xmc[13+9],xmc[13+10],xmc[13+11], - xmc[13+12] ); - - fprintf(f, "#3: Nc %4.4d bc %d Mc %d xmaxc %d\n", - Nc[2], bc[2], Mc[2], xmaxc[2]); - fprintf(f, -"\t%.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d\n", - xmc[26+0],xmc[26+1],xmc[26+2],xmc[26+3],xmc[26+4],xmc[26+5], - xmc[26+6], xmc[26+7],xmc[26+8],xmc[26+9],xmc[26+10],xmc[26+11], - xmc[26+12] ); - - fprintf(f, "#4: Nc %4.4d bc %d Mc %d xmaxc %d\n", - Nc[3], bc[3], Mc[3], xmaxc[3]); - fprintf(f, -"\t%.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d %.2d\n", - xmc[39+0],xmc[39+1],xmc[39+2],xmc[39+3],xmc[39+4],xmc[39+5], - xmc[39+6], xmc[39+7],xmc[39+8],xmc[39+9],xmc[39+10],xmc[39+11], - xmc[39+12] ); - - return 0; -} diff --git a/third_party/gsm/src/long_term.c b/third_party/gsm/src/long_term.c deleted file mode 100644 index 91bf8a9..0000000 --- a/third_party/gsm/src/long_term.c +++ /dev/null @@ -1,950 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/long_term.c,v 1.6 1996/07/02 12:33:19 jutta Exp $ */ - -#include "config.h" -#include -#include - -#include "private.h" - -#include "gsm.h" -#include "proto.h" - -/* - * 4.2.11 .. 4.2.12 LONG TERM PREDICTOR (LTP) SECTION - */ - - -/* - * This module computes the LTP gain (bc) and the LTP lag (Nc) - * for the long term analysis filter. This is done by calculating a - * maximum of the cross-correlation function between the current - * sub-segment short term residual signal d[0..39] (output of - * the short term analysis filter; for simplification the index - * of this array begins at 0 and ends at 39 for each sub-segment of the - * RPE-LTP analysis) and the previous reconstructed short term - * residual signal dp[ -120 .. -1 ]. A dynamic scaling must be - * performed to avoid overflow. - */ - - /* The next procedure exists in six versions. First two integer - * version (if USE_FLOAT_MUL is not defined); then four floating - * point versions, twice with proper scaling (USE_FLOAT_MUL defined), - * once without (USE_FLOAT_MUL and FAST defined, and fast run-time - * option used). Every pair has first a Cut version (see the -C - * option to toast or the LTP_CUT option to gsm_option()), then the - * uncut one. (For a detailed explanation of why this is altogether - * a bad idea, see Henry Spencer and Geoff Collyer, ``#ifdef Considered - * Harmful''.) - */ - -#ifndef USE_FLOAT_MUL - -#ifdef LTP_CUT - -static void Cut_Calculation_of_the_LTP_parameters P5((st, d,dp,bc_out,Nc_out), - - struct gsm_state * st, - - register word * d, /* [0..39] IN */ - register word * dp, /* [-120..-1] IN */ - word * bc_out, /* OUT */ - word * Nc_out /* OUT */ -) -{ - register int k, lambda; - word Nc, bc; - word wt[40]; - - longword L_result; - longword L_max, L_power; - word R, S, dmax, scal, best_k; - word ltp_cut; - - register word temp, wt_k; - - /* Search of the optimum scaling of d[0..39]. - */ - dmax = 0; - for (k = 0; k <= 39; k++) { - temp = d[k]; - temp = GSM_ABS( temp ); - if (temp > dmax) { - dmax = temp; - best_k = k; - } - } - temp = 0; - if (dmax == 0) scal = 0; - else { - assert(dmax > 0); - temp = gsm_norm( (longword)dmax << 16 ); - } - if (temp > 6) scal = 0; - else scal = 6 - temp; - assert(scal >= 0); - - /* Search for the maximum cross-correlation and coding of the LTP lag - */ - L_max = 0; - Nc = 40; /* index for the maximum cross-correlation */ - wt_k = SASR(d[best_k], scal); - - for (lambda = 40; lambda <= 120; lambda++) { - L_result = (longword)wt_k * dp[best_k - lambda]; - if (L_result > L_max) { - Nc = lambda; - L_max = L_result; - } - } - *Nc_out = Nc; - L_max <<= 1; - - /* Rescaling of L_max - */ - assert(scal <= 100 && scal >= -100); - L_max = L_max >> (6 - scal); /* sub(6, scal) */ - - assert( Nc <= 120 && Nc >= 40); - - /* Compute the power of the reconstructed short term residual - * signal dp[..] - */ - L_power = 0; - for (k = 0; k <= 39; k++) { - - register longword L_temp; - - L_temp = SASR( dp[k - Nc], 3 ); - L_power += L_temp * L_temp; - } - L_power <<= 1; /* from L_MULT */ - - /* Normalization of L_max and L_power - */ - - if (L_max <= 0) { - *bc_out = 0; - return; - } - if (L_max >= L_power) { - *bc_out = 3; - return; - } - - temp = gsm_norm( L_power ); - - R = SASR( L_max << temp, 16 ); - S = SASR( L_power << temp, 16 ); - - /* Coding of the LTP gain - */ - - /* Table 4.3a must be used to obtain the level DLB[i] for the - * quantization of the LTP gain b to get the coded version bc. - */ - for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break; - *bc_out = bc; -} - -#endif /* LTP_CUT */ - -static void Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out), - register word * d, /* [0..39] IN */ - register word * dp, /* [-120..-1] IN */ - word * bc_out, /* OUT */ - word * Nc_out /* OUT */ -) -{ - register int k, lambda; - word Nc, bc; - word wt[40]; - - longword L_max, L_power; - word R, S, dmax, scal; - register word temp; - - /* Search of the optimum scaling of d[0..39]. - */ - dmax = 0; - - for (k = 0; k <= 39; k++) { - temp = d[k]; - temp = GSM_ABS( temp ); - if (temp > dmax) dmax = temp; - } - - temp = 0; - if (dmax == 0) scal = 0; - else { - assert(dmax > 0); - temp = gsm_norm( (longword)dmax << 16 ); - } - - if (temp > 6) scal = 0; - else scal = 6 - temp; - - assert(scal >= 0); - - /* Initialization of a working array wt - */ - - for (k = 0; k <= 39; k++) wt[k] = SASR( d[k], scal ); - - /* Search for the maximum cross-correlation and coding of the LTP lag - */ - L_max = 0; - Nc = 40; /* index for the maximum cross-correlation */ - - for (lambda = 40; lambda <= 120; lambda++) { - -# undef STEP -# define STEP(k) (longword)wt[k] * dp[k - lambda] - - register longword L_result; - - L_result = STEP(0) ; L_result += STEP(1) ; - L_result += STEP(2) ; L_result += STEP(3) ; - L_result += STEP(4) ; L_result += STEP(5) ; - L_result += STEP(6) ; L_result += STEP(7) ; - L_result += STEP(8) ; L_result += STEP(9) ; - L_result += STEP(10) ; L_result += STEP(11) ; - L_result += STEP(12) ; L_result += STEP(13) ; - L_result += STEP(14) ; L_result += STEP(15) ; - L_result += STEP(16) ; L_result += STEP(17) ; - L_result += STEP(18) ; L_result += STEP(19) ; - L_result += STEP(20) ; L_result += STEP(21) ; - L_result += STEP(22) ; L_result += STEP(23) ; - L_result += STEP(24) ; L_result += STEP(25) ; - L_result += STEP(26) ; L_result += STEP(27) ; - L_result += STEP(28) ; L_result += STEP(29) ; - L_result += STEP(30) ; L_result += STEP(31) ; - L_result += STEP(32) ; L_result += STEP(33) ; - L_result += STEP(34) ; L_result += STEP(35) ; - L_result += STEP(36) ; L_result += STEP(37) ; - L_result += STEP(38) ; L_result += STEP(39) ; - - if (L_result > L_max) { - - Nc = lambda; - L_max = L_result; - } - } - - *Nc_out = Nc; - - L_max <<= 1; - - /* Rescaling of L_max - */ - assert(scal <= 100 && scal >= -100); - L_max = L_max >> (6 - scal); /* sub(6, scal) */ - - assert( Nc <= 120 && Nc >= 40); - - /* Compute the power of the reconstructed short term residual - * signal dp[..] - */ - L_power = 0; - for (k = 0; k <= 39; k++) { - - register longword L_temp; - - L_temp = SASR( dp[k - Nc], 3 ); - L_power += L_temp * L_temp; - } - L_power <<= 1; /* from L_MULT */ - - /* Normalization of L_max and L_power - */ - - if (L_max <= 0) { - *bc_out = 0; - return; - } - if (L_max >= L_power) { - *bc_out = 3; - return; - } - - temp = gsm_norm( L_power ); - - R = SASR( L_max << temp, 16 ); - S = SASR( L_power << temp, 16 ); - - /* Coding of the LTP gain - */ - - /* Table 4.3a must be used to obtain the level DLB[i] for the - * quantization of the LTP gain b to get the coded version bc. - */ - for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break; - *bc_out = bc; -} - -#else /* USE_FLOAT_MUL */ - -#ifdef LTP_CUT - -static void Cut_Calculation_of_the_LTP_parameters P5((st, d,dp,bc_out,Nc_out), - struct gsm_state * st, /* IN */ - register word * d, /* [0..39] IN */ - register word * dp, /* [-120..-1] IN */ - word * bc_out, /* OUT */ - word * Nc_out /* OUT */ -) -{ - register int k, lambda; - word Nc, bc; - word ltp_cut; - - float wt_float[40]; - float dp_float_base[120], * dp_float = dp_float_base + 120; - - longword L_max, L_power; - word R, S, dmax, scal; - register word temp; - - /* Search of the optimum scaling of d[0..39]. - */ - dmax = 0; - - for (k = 0; k <= 39; k++) { - temp = d[k]; - temp = GSM_ABS( temp ); - if (temp > dmax) dmax = temp; - } - - temp = 0; - if (dmax == 0) scal = 0; - else { - assert(dmax > 0); - temp = gsm_norm( (longword)dmax << 16 ); - } - - if (temp > 6) scal = 0; - else scal = 6 - temp; - - assert(scal >= 0); - ltp_cut = (longword)SASR(dmax, scal) * st->ltp_cut / 100; - - - /* Initialization of a working array wt - */ - - for (k = 0; k < 40; k++) { - register word w = SASR( d[k], scal ); - if (w < 0 ? w > -ltp_cut : w < ltp_cut) { - wt_float[k] = 0.0; - } - else { - wt_float[k] = w; - } - } - for (k = -120; k < 0; k++) dp_float[k] = dp[k]; - - /* Search for the maximum cross-correlation and coding of the LTP lag - */ - L_max = 0; - Nc = 40; /* index for the maximum cross-correlation */ - - for (lambda = 40; lambda <= 120; lambda += 9) { - - /* Calculate L_result for l = lambda .. lambda + 9. - */ - register float *lp = dp_float - lambda; - - register float W; - register float a = lp[-8], b = lp[-7], c = lp[-6], - d = lp[-5], e = lp[-4], f = lp[-3], - g = lp[-2], h = lp[-1]; - register float E; - register float S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0, - S5 = 0, S6 = 0, S7 = 0, S8 = 0; - -# undef STEP -# define STEP(K, a, b, c, d, e, f, g, h) \ - if ((W = wt_float[K]) != 0.0) { \ - E = W * a; S8 += E; \ - E = W * b; S7 += E; \ - E = W * c; S6 += E; \ - E = W * d; S5 += E; \ - E = W * e; S4 += E; \ - E = W * f; S3 += E; \ - E = W * g; S2 += E; \ - E = W * h; S1 += E; \ - a = lp[K]; \ - E = W * a; S0 += E; } else (a = lp[K]) - -# define STEP_A(K) STEP(K, a, b, c, d, e, f, g, h) -# define STEP_B(K) STEP(K, b, c, d, e, f, g, h, a) -# define STEP_C(K) STEP(K, c, d, e, f, g, h, a, b) -# define STEP_D(K) STEP(K, d, e, f, g, h, a, b, c) -# define STEP_E(K) STEP(K, e, f, g, h, a, b, c, d) -# define STEP_F(K) STEP(K, f, g, h, a, b, c, d, e) -# define STEP_G(K) STEP(K, g, h, a, b, c, d, e, f) -# define STEP_H(K) STEP(K, h, a, b, c, d, e, f, g) - - STEP_A( 0); STEP_B( 1); STEP_C( 2); STEP_D( 3); - STEP_E( 4); STEP_F( 5); STEP_G( 6); STEP_H( 7); - - STEP_A( 8); STEP_B( 9); STEP_C(10); STEP_D(11); - STEP_E(12); STEP_F(13); STEP_G(14); STEP_H(15); - - STEP_A(16); STEP_B(17); STEP_C(18); STEP_D(19); - STEP_E(20); STEP_F(21); STEP_G(22); STEP_H(23); - - STEP_A(24); STEP_B(25); STEP_C(26); STEP_D(27); - STEP_E(28); STEP_F(29); STEP_G(30); STEP_H(31); - - STEP_A(32); STEP_B(33); STEP_C(34); STEP_D(35); - STEP_E(36); STEP_F(37); STEP_G(38); STEP_H(39); - - if (S0 > L_max) { L_max = S0; Nc = lambda; } - if (S1 > L_max) { L_max = S1; Nc = lambda + 1; } - if (S2 > L_max) { L_max = S2; Nc = lambda + 2; } - if (S3 > L_max) { L_max = S3; Nc = lambda + 3; } - if (S4 > L_max) { L_max = S4; Nc = lambda + 4; } - if (S5 > L_max) { L_max = S5; Nc = lambda + 5; } - if (S6 > L_max) { L_max = S6; Nc = lambda + 6; } - if (S7 > L_max) { L_max = S7; Nc = lambda + 7; } - if (S8 > L_max) { L_max = S8; Nc = lambda + 8; } - - } - *Nc_out = Nc; - - L_max <<= 1; - - /* Rescaling of L_max - */ - assert(scal <= 100 && scal >= -100); - L_max = L_max >> (6 - scal); /* sub(6, scal) */ - - assert( Nc <= 120 && Nc >= 40); - - /* Compute the power of the reconstructed short term residual - * signal dp[..] - */ - L_power = 0; - for (k = 0; k <= 39; k++) { - - register longword L_temp; - - L_temp = SASR( dp[k - Nc], 3 ); - L_power += L_temp * L_temp; - } - L_power <<= 1; /* from L_MULT */ - - /* Normalization of L_max and L_power - */ - - if (L_max <= 0) { - *bc_out = 0; - return; - } - if (L_max >= L_power) { - *bc_out = 3; - return; - } - - temp = gsm_norm( L_power ); - - R = SASR( L_max << temp, 16 ); - S = SASR( L_power << temp, 16 ); - - /* Coding of the LTP gain - */ - - /* Table 4.3a must be used to obtain the level DLB[i] for the - * quantization of the LTP gain b to get the coded version bc. - */ - for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break; - *bc_out = bc; -} - -#endif /* LTP_CUT */ - -static void Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out), - register word * d, /* [0..39] IN */ - register word * dp, /* [-120..-1] IN */ - word * bc_out, /* OUT */ - word * Nc_out /* OUT */ -) -{ - register int k, lambda; - word Nc, bc; - - float wt_float[40]; - float dp_float_base[120], * dp_float = dp_float_base + 120; - - longword L_max, L_power; - word R, S, dmax, scal; - register word temp; - - /* Search of the optimum scaling of d[0..39]. - */ - dmax = 0; - - for (k = 0; k <= 39; k++) { - temp = d[k]; - temp = GSM_ABS( temp ); - if (temp > dmax) dmax = temp; - } - - temp = 0; - if (dmax == 0) scal = 0; - else { - assert(dmax > 0); - temp = gsm_norm( (longword)dmax << 16 ); - } - - if (temp > 6) scal = 0; - else scal = 6 - temp; - - assert(scal >= 0); - - /* Initialization of a working array wt - */ - - for (k = 0; k < 40; k++) wt_float[k] = SASR( d[k], scal ); - for (k = -120; k < 0; k++) dp_float[k] = dp[k]; - - /* Search for the maximum cross-correlation and coding of the LTP lag - */ - L_max = 0; - Nc = 40; /* index for the maximum cross-correlation */ - - for (lambda = 40; lambda <= 120; lambda += 9) { - - /* Calculate L_result for l = lambda .. lambda + 9. - */ - register float *lp = dp_float - lambda; - - register float W; - register float a = lp[-8], b = lp[-7], c = lp[-6], - d = lp[-5], e = lp[-4], f = lp[-3], - g = lp[-2], h = lp[-1]; - register float E; - register float S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0, - S5 = 0, S6 = 0, S7 = 0, S8 = 0; - -# undef STEP -# define STEP(K, a, b, c, d, e, f, g, h) \ - W = wt_float[K]; \ - E = W * a; S8 += E; \ - E = W * b; S7 += E; \ - E = W * c; S6 += E; \ - E = W * d; S5 += E; \ - E = W * e; S4 += E; \ - E = W * f; S3 += E; \ - E = W * g; S2 += E; \ - E = W * h; S1 += E; \ - a = lp[K]; \ - E = W * a; S0 += E - -# define STEP_A(K) STEP(K, a, b, c, d, e, f, g, h) -# define STEP_B(K) STEP(K, b, c, d, e, f, g, h, a) -# define STEP_C(K) STEP(K, c, d, e, f, g, h, a, b) -# define STEP_D(K) STEP(K, d, e, f, g, h, a, b, c) -# define STEP_E(K) STEP(K, e, f, g, h, a, b, c, d) -# define STEP_F(K) STEP(K, f, g, h, a, b, c, d, e) -# define STEP_G(K) STEP(K, g, h, a, b, c, d, e, f) -# define STEP_H(K) STEP(K, h, a, b, c, d, e, f, g) - - STEP_A( 0); STEP_B( 1); STEP_C( 2); STEP_D( 3); - STEP_E( 4); STEP_F( 5); STEP_G( 6); STEP_H( 7); - - STEP_A( 8); STEP_B( 9); STEP_C(10); STEP_D(11); - STEP_E(12); STEP_F(13); STEP_G(14); STEP_H(15); - - STEP_A(16); STEP_B(17); STEP_C(18); STEP_D(19); - STEP_E(20); STEP_F(21); STEP_G(22); STEP_H(23); - - STEP_A(24); STEP_B(25); STEP_C(26); STEP_D(27); - STEP_E(28); STEP_F(29); STEP_G(30); STEP_H(31); - - STEP_A(32); STEP_B(33); STEP_C(34); STEP_D(35); - STEP_E(36); STEP_F(37); STEP_G(38); STEP_H(39); - - if (S0 > L_max) { L_max = S0; Nc = lambda; } - if (S1 > L_max) { L_max = S1; Nc = lambda + 1; } - if (S2 > L_max) { L_max = S2; Nc = lambda + 2; } - if (S3 > L_max) { L_max = S3; Nc = lambda + 3; } - if (S4 > L_max) { L_max = S4; Nc = lambda + 4; } - if (S5 > L_max) { L_max = S5; Nc = lambda + 5; } - if (S6 > L_max) { L_max = S6; Nc = lambda + 6; } - if (S7 > L_max) { L_max = S7; Nc = lambda + 7; } - if (S8 > L_max) { L_max = S8; Nc = lambda + 8; } - } - *Nc_out = Nc; - - L_max <<= 1; - - /* Rescaling of L_max - */ - assert(scal <= 100 && scal >= -100); - L_max = L_max >> (6 - scal); /* sub(6, scal) */ - - assert( Nc <= 120 && Nc >= 40); - - /* Compute the power of the reconstructed short term residual - * signal dp[..] - */ - L_power = 0; - for (k = 0; k <= 39; k++) { - - register longword L_temp; - - L_temp = SASR( dp[k - Nc], 3 ); - L_power += L_temp * L_temp; - } - L_power <<= 1; /* from L_MULT */ - - /* Normalization of L_max and L_power - */ - - if (L_max <= 0) { - *bc_out = 0; - return; - } - if (L_max >= L_power) { - *bc_out = 3; - return; - } - - temp = gsm_norm( L_power ); - - R = SASR( L_max << temp, 16 ); - S = SASR( L_power << temp, 16 ); - - /* Coding of the LTP gain - */ - - /* Table 4.3a must be used to obtain the level DLB[i] for the - * quantization of the LTP gain b to get the coded version bc. - */ - for (bc = 0; bc <= 2; bc++) if (R <= gsm_mult(S, gsm_DLB[bc])) break; - *bc_out = bc; -} - -#ifdef FAST -#ifdef LTP_CUT - -static void Cut_Fast_Calculation_of_the_LTP_parameters P5((st, - d,dp,bc_out,Nc_out), - struct gsm_state * st, /* IN */ - register word * d, /* [0..39] IN */ - register word * dp, /* [-120..-1] IN */ - word * bc_out, /* OUT */ - word * Nc_out /* OUT */ -) -{ - register int k, lambda; - register float wt_float; - word Nc, bc; - word wt_max, best_k, ltp_cut; - - float dp_float_base[120], * dp_float = dp_float_base + 120; - - register float L_result, L_max, L_power; - - wt_max = 0; - - for (k = 0; k < 40; ++k) { - if ( d[k] > wt_max) wt_max = d[best_k = k]; - else if (-d[k] > wt_max) wt_max = -d[best_k = k]; - } - - assert(wt_max >= 0); - wt_float = (float)wt_max; - - for (k = -120; k < 0; ++k) dp_float[k] = (float)dp[k]; - - /* Search for the maximum cross-correlation and coding of the LTP lag - */ - L_max = 0; - Nc = 40; /* index for the maximum cross-correlation */ - - for (lambda = 40; lambda <= 120; lambda++) { - L_result = wt_float * dp_float[best_k - lambda]; - if (L_result > L_max) { - Nc = lambda; - L_max = L_result; - } - } - - *Nc_out = Nc; - if (L_max <= 0.) { - *bc_out = 0; - return; - } - - /* Compute the power of the reconstructed short term residual - * signal dp[..] - */ - dp_float -= Nc; - L_power = 0; - for (k = 0; k < 40; ++k) { - register float f = dp_float[k]; - L_power += f * f; - } - - if (L_max >= L_power) { - *bc_out = 3; - return; - } - - /* Coding of the LTP gain - * Table 4.3a must be used to obtain the level DLB[i] for the - * quantization of the LTP gain b to get the coded version bc. - */ - lambda = L_max / L_power * 32768.; - for (bc = 0; bc <= 2; ++bc) if (lambda <= gsm_DLB[bc]) break; - *bc_out = bc; -} - -#endif /* LTP_CUT */ - -static void Fast_Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out), - register word * d, /* [0..39] IN */ - register word * dp, /* [-120..-1] IN */ - word * bc_out, /* OUT */ - word * Nc_out /* OUT */ -) -{ - register int k, lambda; - word Nc, bc; - - float wt_float[40]; - float dp_float_base[120], * dp_float = dp_float_base + 120; - - register float L_max, L_power; - - for (k = 0; k < 40; ++k) wt_float[k] = (float)d[k]; - for (k = -120; k < 0; ++k) dp_float[k] = (float)dp[k]; - - /* Search for the maximum cross-correlation and coding of the LTP lag - */ - L_max = 0; - Nc = 40; /* index for the maximum cross-correlation */ - - for (lambda = 40; lambda <= 120; lambda += 9) { - - /* Calculate L_result for l = lambda .. lambda + 9. - */ - register float *lp = dp_float - lambda; - - register float W; - register float a = lp[-8], b = lp[-7], c = lp[-6], - d = lp[-5], e = lp[-4], f = lp[-3], - g = lp[-2], h = lp[-1]; - register float E; - register float S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0, - S5 = 0, S6 = 0, S7 = 0, S8 = 0; - -# undef STEP -# define STEP(K, a, b, c, d, e, f, g, h) \ - W = wt_float[K]; \ - E = W * a; S8 += E; \ - E = W * b; S7 += E; \ - E = W * c; S6 += E; \ - E = W * d; S5 += E; \ - E = W * e; S4 += E; \ - E = W * f; S3 += E; \ - E = W * g; S2 += E; \ - E = W * h; S1 += E; \ - a = lp[K]; \ - E = W * a; S0 += E - -# define STEP_A(K) STEP(K, a, b, c, d, e, f, g, h) -# define STEP_B(K) STEP(K, b, c, d, e, f, g, h, a) -# define STEP_C(K) STEP(K, c, d, e, f, g, h, a, b) -# define STEP_D(K) STEP(K, d, e, f, g, h, a, b, c) -# define STEP_E(K) STEP(K, e, f, g, h, a, b, c, d) -# define STEP_F(K) STEP(K, f, g, h, a, b, c, d, e) -# define STEP_G(K) STEP(K, g, h, a, b, c, d, e, f) -# define STEP_H(K) STEP(K, h, a, b, c, d, e, f, g) - - STEP_A( 0); STEP_B( 1); STEP_C( 2); STEP_D( 3); - STEP_E( 4); STEP_F( 5); STEP_G( 6); STEP_H( 7); - - STEP_A( 8); STEP_B( 9); STEP_C(10); STEP_D(11); - STEP_E(12); STEP_F(13); STEP_G(14); STEP_H(15); - - STEP_A(16); STEP_B(17); STEP_C(18); STEP_D(19); - STEP_E(20); STEP_F(21); STEP_G(22); STEP_H(23); - - STEP_A(24); STEP_B(25); STEP_C(26); STEP_D(27); - STEP_E(28); STEP_F(29); STEP_G(30); STEP_H(31); - - STEP_A(32); STEP_B(33); STEP_C(34); STEP_D(35); - STEP_E(36); STEP_F(37); STEP_G(38); STEP_H(39); - - if (S0 > L_max) { L_max = S0; Nc = lambda; } - if (S1 > L_max) { L_max = S1; Nc = lambda + 1; } - if (S2 > L_max) { L_max = S2; Nc = lambda + 2; } - if (S3 > L_max) { L_max = S3; Nc = lambda + 3; } - if (S4 > L_max) { L_max = S4; Nc = lambda + 4; } - if (S5 > L_max) { L_max = S5; Nc = lambda + 5; } - if (S6 > L_max) { L_max = S6; Nc = lambda + 6; } - if (S7 > L_max) { L_max = S7; Nc = lambda + 7; } - if (S8 > L_max) { L_max = S8; Nc = lambda + 8; } - } - *Nc_out = Nc; - - if (L_max <= 0.) { - *bc_out = 0; - return; - } - - /* Compute the power of the reconstructed short term residual - * signal dp[..] - */ - dp_float -= Nc; - L_power = 0; - for (k = 0; k < 40; ++k) { - register float f = dp_float[k]; - L_power += f * f; - } - - if (L_max >= L_power) { - *bc_out = 3; - return; - } - - /* Coding of the LTP gain - * Table 4.3a must be used to obtain the level DLB[i] for the - * quantization of the LTP gain b to get the coded version bc. - */ - lambda = L_max / L_power * 32768.; - for (bc = 0; bc <= 2; ++bc) if (lambda <= gsm_DLB[bc]) break; - *bc_out = bc; -} - -#endif /* FAST */ -#endif /* USE_FLOAT_MUL */ - - -/* 4.2.12 */ - -static void Long_term_analysis_filtering P6((bc,Nc,dp,d,dpp,e), - word bc, /* IN */ - word Nc, /* IN */ - register word * dp, /* previous d [-120..-1] IN */ - register word * d, /* d [0..39] IN */ - register word * dpp, /* estimate [0..39] OUT */ - register word * e /* long term res. signal [0..39] OUT */ -) -/* - * In this part, we have to decode the bc parameter to compute - * the samples of the estimate dpp[0..39]. The decoding of bc needs the - * use of table 4.3b. The long term residual signal e[0..39] - * is then calculated to be fed to the RPE encoding section. - */ -{ - register int k; - register longword ltmp; - -# undef STEP -# define STEP(BP) \ - for (k = 0; k <= 39; k++) { \ - dpp[k] = GSM_MULT_R( BP, dp[k - Nc]); \ - e[k] = GSM_SUB( d[k], dpp[k] ); \ - } - - switch (bc) { - case 0: STEP( 3277 ); break; - case 1: STEP( 11469 ); break; - case 2: STEP( 21299 ); break; - case 3: STEP( 32767 ); break; - } -} - -void Gsm_Long_Term_Predictor P7((S,d,dp,e,dpp,Nc,bc), /* 4x for 160 samples */ - - struct gsm_state * S, - - word * d, /* [0..39] residual signal IN */ - word * dp, /* [-120..-1] d' IN */ - - word * e, /* [0..39] OUT */ - word * dpp, /* [0..39] OUT */ - word * Nc, /* correlation lag OUT */ - word * bc /* gain factor OUT */ -) -{ - assert( d ); assert( dp ); assert( e ); - assert( dpp); assert( Nc ); assert( bc ); - -#if defined(FAST) && defined(USE_FLOAT_MUL) - if (S->fast) -#if defined (LTP_CUT) - if (S->ltp_cut) - Cut_Fast_Calculation_of_the_LTP_parameters(S, - d, dp, bc, Nc); - else -#endif /* LTP_CUT */ - Fast_Calculation_of_the_LTP_parameters(d, dp, bc, Nc ); - else -#endif /* FAST & USE_FLOAT_MUL */ -#ifdef LTP_CUT - if (S->ltp_cut) - Cut_Calculation_of_the_LTP_parameters(S, d, dp, bc, Nc); - else -#endif - Calculation_of_the_LTP_parameters(d, dp, bc, Nc); - - Long_term_analysis_filtering( *bc, *Nc, dp, d, dpp, e ); -} - -/* 4.3.2 */ -void Gsm_Long_Term_Synthesis_Filtering P5((S,Ncr,bcr,erp,drp), - struct gsm_state * S, - - word Ncr, - word bcr, - register word * erp, /* [0..39] IN */ - register word * drp /* [-120..-1] IN, [-120..40] OUT */ -) -/* - * This procedure uses the bcr and Ncr parameter to realize the - * long term synthesis filtering. The decoding of bcr needs - * table 4.3b. - */ -{ - register longword ltmp; /* for ADD */ - register int k; - word brp, drpp, Nr; - - /* Check the limits of Nr. - */ - Nr = Ncr < 40 || Ncr > 120 ? S->nrp : Ncr; - S->nrp = Nr; - assert(Nr >= 40 && Nr <= 120); - - /* Decoding of the LTP gain bcr - */ - brp = gsm_QLB[ bcr ]; - - /* Computation of the reconstructed short term residual - * signal drp[0..39] - */ - assert(brp != MIN_WORD); - - for (k = 0; k <= 39; k++) { - drpp = GSM_MULT_R( brp, drp[ k - Nr ] ); - drp[k] = GSM_ADD( erp[k], drpp ); - } - - /* - * Update of the reconstructed short term residual signal - * drp[ -1..-120 ] - */ - - for (k = 0; k <= 119; k++) drp[ -120 + k ] = drp[ -80 + k ]; -} diff --git a/third_party/gsm/src/lpc.c b/third_party/gsm/src/lpc.c deleted file mode 100644 index e30211d..0000000 --- a/third_party/gsm/src/lpc.c +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/lpc.c,v 1.5 1994/12/30 23:14:54 jutta Exp $ */ - -#include "config.h" -#include -#include - -#include "private.h" - -#include "gsm.h" -#include "proto.h" - -#undef P - -/* - * 4.2.4 .. 4.2.7 LPC ANALYSIS SECTION - */ - -/* 4.2.4 */ - - -static void Autocorrelation P2((s, L_ACF), - word * s, /* [0..159] IN/OUT */ - longword * L_ACF) /* [0..8] OUT */ -/* - * The goal is to compute the array L_ACF[k]. The signal s[i] must - * be scaled in order to avoid an overflow situation. - */ -{ - register int k, i; - - word temp, smax, scalauto; - -#ifdef USE_FLOAT_MUL - float float_s[160]; -#endif - - /* Dynamic scaling of the array s[0..159] - */ - - /* Search for the maximum. - */ - smax = 0; - for (k = 0; k <= 159; k++) { - temp = GSM_ABS( s[k] ); - if (temp > smax) smax = temp; - } - - /* Computation of the scaling factor. - */ - if (smax == 0) scalauto = 0; - else { - assert(smax > 0); - scalauto = 4 - gsm_norm( (longword)smax << 16 );/* sub(4,..) */ - } - - /* Scaling of the array s[0...159] - */ - - if (scalauto > 0) { - -# ifdef USE_FLOAT_MUL -# define SCALE(n) \ - case n: for (k = 0; k <= 159; k++) \ - float_s[k] = (float) \ - (s[k] = GSM_MULT_R(s[k], 16384 >> (n-1)));\ - break; -# else -# define SCALE(n) \ - case n: for (k = 0; k <= 159; k++) \ - s[k] = GSM_MULT_R( s[k], 16384 >> (n-1) );\ - break; -# endif /* USE_FLOAT_MUL */ - - switch (scalauto) { - SCALE(1) - SCALE(2) - SCALE(3) - SCALE(4) - } -# undef SCALE - } -# ifdef USE_FLOAT_MUL - else for (k = 0; k <= 159; k++) float_s[k] = (float) s[k]; -# endif - - /* Compute the L_ACF[..]. - */ - { -# ifdef USE_FLOAT_MUL - register float * sp = float_s; - register float sl = *sp; - -# define STEP(k) L_ACF[k] += (longword)(sl * sp[ -(k) ]); -# else - word * sp = s; - word sl = *sp; - -# define STEP(k) L_ACF[k] += ((longword)sl * sp[ -(k) ]); -# endif - -# define NEXTI sl = *++sp - - - for (k = 9; k--; L_ACF[k] = 0) ; - - STEP (0); - NEXTI; - STEP(0); STEP(1); - NEXTI; - STEP(0); STEP(1); STEP(2); - NEXTI; - STEP(0); STEP(1); STEP(2); STEP(3); - NEXTI; - STEP(0); STEP(1); STEP(2); STEP(3); STEP(4); - NEXTI; - STEP(0); STEP(1); STEP(2); STEP(3); STEP(4); STEP(5); - NEXTI; - STEP(0); STEP(1); STEP(2); STEP(3); STEP(4); STEP(5); STEP(6); - NEXTI; - STEP(0); STEP(1); STEP(2); STEP(3); STEP(4); STEP(5); STEP(6); STEP(7); - - for (i = 8; i <= 159; i++) { - - NEXTI; - - STEP(0); - STEP(1); STEP(2); STEP(3); STEP(4); - STEP(5); STEP(6); STEP(7); STEP(8); - } - - for (k = 9; k--; L_ACF[k] <<= 1) ; - - } - /* Rescaling of the array s[0..159] - */ - if (scalauto > 0) { - assert(scalauto <= 4); - for (k = 160; k--; *s++ <<= scalauto) ; - } -} - -#if defined(USE_FLOAT_MUL) && defined(FAST) - -static void Fast_Autocorrelation P2((s, L_ACF), - word * s, /* [0..159] IN/OUT */ - longword * L_ACF) /* [0..8] OUT */ -{ - register int k, i; - float f_L_ACF[9]; - float scale; - - float s_f[160]; - register float *sf = s_f; - - for (i = 0; i < 160; ++i) sf[i] = s[i]; - for (k = 0; k <= 8; k++) { - register float L_temp2 = 0; - register float *sfl = sf - k; - for (i = k; i < 160; ++i) L_temp2 += sf[i] * sfl[i]; - f_L_ACF[k] = L_temp2; - } - scale = MAX_LONGWORD / f_L_ACF[0]; - - for (k = 0; k <= 8; k++) { - L_ACF[k] = f_L_ACF[k] * scale; - } -} -#endif /* defined (USE_FLOAT_MUL) && defined (FAST) */ - -/* 4.2.5 */ - -static void Reflection_coefficients P2( (L_ACF, r), - longword * L_ACF, /* 0...8 IN */ - register word * r /* 0...7 OUT */ -) -{ - register int i, m, n; - register word temp; - register longword ltmp; - word ACF[9]; /* 0..8 */ - word P[ 9]; /* 0..8 */ - word K[ 9]; /* 2..8 */ - - /* Schur recursion with 16 bits arithmetic. - */ - - if (L_ACF[0] == 0) { - for (i = 8; i--; *r++ = 0) ; - return; - } - - assert( L_ACF[0] != 0 ); - temp = gsm_norm( L_ACF[0] ); - - assert(temp >= 0 && temp < 32); - - /* ? overflow ? */ - for (i = 0; i <= 8; i++) ACF[i] = SASR( L_ACF[i] << temp, 16 ); - - /* Initialize array P[..] and K[..] for the recursion. - */ - - for (i = 1; i <= 7; i++) K[ i ] = ACF[ i ]; - for (i = 0; i <= 8; i++) P[ i ] = ACF[ i ]; - - /* Compute reflection coefficients - */ - for (n = 1; n <= 8; n++, r++) { - - temp = P[1]; - temp = GSM_ABS(temp); - if (P[0] < temp) { - for (i = n; i <= 8; i++) *r++ = 0; - return; - } - - *r = gsm_div( temp, P[0] ); - - assert(*r >= 0); - if (P[1] > 0) *r = -*r; /* r[n] = sub(0, r[n]) */ - assert (*r != MIN_WORD); - if (n == 8) return; - - /* Schur recursion - */ - temp = GSM_MULT_R( P[1], *r ); - P[0] = GSM_ADD( P[0], temp ); - - for (m = 1; m <= 8 - n; m++) { - temp = GSM_MULT_R( K[ m ], *r ); - P[m] = GSM_ADD( P[ m+1 ], temp ); - - temp = GSM_MULT_R( P[ m+1 ], *r ); - K[m] = GSM_ADD( K[ m ], temp ); - } - } -} - -/* 4.2.6 */ - -static void Transformation_to_Log_Area_Ratios P1((r), - register word * r /* 0..7 IN/OUT */ -) -/* - * The following scaling for r[..] and LAR[..] has been used: - * - * r[..] = integer( real_r[..]*32768. ); -1 <= real_r < 1. - * LAR[..] = integer( real_LAR[..] * 16384 ); - * with -1.625 <= real_LAR <= 1.625 - */ -{ - register word temp; - register int i; - - - /* Computation of the LAR[0..7] from the r[0..7] - */ - for (i = 1; i <= 8; i++, r++) { - - temp = *r; - temp = GSM_ABS(temp); - assert(temp >= 0); - - if (temp < 22118) { - temp >>= 1; - } else if (temp < 31130) { - assert( temp >= 11059 ); - temp -= 11059; - } else { - assert( temp >= 26112 ); - temp -= 26112; - temp <<= 2; - } - - *r = *r < 0 ? -temp : temp; - assert( *r != MIN_WORD ); - } -} - -/* 4.2.7 */ - -static void Quantization_and_coding P1((LAR), - register word * LAR /* [0..7] IN/OUT */ -) -{ - register word temp; - longword ltmp; - - - /* This procedure needs four tables; the following equations - * give the optimum scaling for the constants: - * - * A[0..7] = integer( real_A[0..7] * 1024 ) - * B[0..7] = integer( real_B[0..7] * 512 ) - * MAC[0..7] = maximum of the LARc[0..7] - * MIC[0..7] = minimum of the LARc[0..7] - */ - -# undef STEP -# define STEP( A, B, MAC, MIC ) \ - temp = GSM_MULT( A, *LAR ); \ - temp = GSM_ADD( temp, B ); \ - temp = GSM_ADD( temp, 256 ); \ - temp = SASR( temp, 9 ); \ - *LAR = temp>MAC ? MAC - MIC : (tempfast) Fast_Autocorrelation (s, L_ACF ); - else -#endif - Autocorrelation (s, L_ACF ); - Reflection_coefficients (L_ACF, LARc ); - Transformation_to_Log_Area_Ratios (LARc); - Quantization_and_coding (LARc); -} diff --git a/third_party/gsm/src/preprocess.c b/third_party/gsm/src/preprocess.c deleted file mode 100644 index 7808592..0000000 --- a/third_party/gsm/src/preprocess.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/preprocess.c,v 1.2 1994/05/10 20:18:45 jutta Exp $ */ - -#include "config.h" -#include -#include - -#include "private.h" - -#include "gsm.h" -#include "proto.h" - -/* 4.2.0 .. 4.2.3 PREPROCESSING SECTION - * - * After A-law to linear conversion (or directly from the - * Ato D converter) the following scaling is assumed for - * input to the RPE-LTP algorithm: - * - * in: 0.1.....................12 - * S.v.v.v.v.v.v.v.v.v.v.v.v.*.*.* - * - * Where S is the sign bit, v a valid bit, and * a "don't care" bit. - * The original signal is called sop[..] - * - * out: 0.1................... 12 - * S.S.v.v.v.v.v.v.v.v.v.v.v.v.0.0 - */ - - -void Gsm_Preprocess P3((S, s, so), - struct gsm_state * S, - word * s, - word * so ) /* [0..159] IN/OUT */ -{ - - word z1 = S->z1; - longword L_z2 = S->L_z2; - word mp = S->mp; - - word s1; - longword L_s2; - - longword L_temp; - - word msp, lsp; - word SO; - - longword ltmp; /* for ADD */ - ulongword utmp; /* for L_ADD */ - - register int k = 160; - - while (k--) { - - /* 4.2.1 Downscaling of the input signal - */ - SO = SASR( *s, 3 ) << 2; - s++; - - assert (SO >= -0x4000); /* downscaled by */ - assert (SO <= 0x3FFC); /* previous routine. */ - - - /* 4.2.2 Offset compensation - * - * This part implements a high-pass filter and requires extended - * arithmetic precision for the recursive part of this filter. - * The input of this procedure is the array so[0...159] and the - * output the array sof[ 0...159 ]. - */ - /* Compute the non-recursive part - */ - - s1 = SO - z1; /* s1 = gsm_sub( *so, z1 ); */ - z1 = SO; - - assert(s1 != MIN_WORD); - - /* Compute the recursive part - */ - L_s2 = s1; - L_s2 <<= 15; - - /* Execution of a 31 bv 16 bits multiplication - */ - - msp = SASR( L_z2, 15 ); - lsp = L_z2-((longword)msp<<15); /* gsm_L_sub(L_z2,(msp<<15)); */ - - L_s2 += GSM_MULT_R( lsp, 32735 ); - L_temp = (longword)msp * 32735; /* GSM_L_MULT(msp,32735) >> 1;*/ - L_z2 = GSM_L_ADD( L_temp, L_s2 ); - - /* Compute sof[k] with rounding - */ - L_temp = GSM_L_ADD( L_z2, 16384 ); - - /* 4.2.3 Preemphasis - */ - - msp = GSM_MULT_R( mp, -28180 ); - mp = SASR( L_temp, 15 ); - *so++ = GSM_ADD( mp, msp ); - } - - S->z1 = z1; - S->L_z2 = L_z2; - S->mp = mp; -} diff --git a/third_party/gsm/src/rpe.c b/third_party/gsm/src/rpe.c deleted file mode 100644 index dd61179..0000000 --- a/third_party/gsm/src/rpe.c +++ /dev/null @@ -1,489 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/rpe.c,v 1.3 1994/05/10 20:18:46 jutta Exp $ */ - -#include "config.h" -#include -#include - -#include "private.h" - -#include "gsm.h" -#include "proto.h" - -/* 4.2.13 .. 4.2.17 RPE ENCODING SECTION - */ - -/* 4.2.13 */ - -static void Weighting_filter P2((e, x), - register word * e, /* signal [-5..0.39.44] IN */ - word * x /* signal [0..39] OUT */ -) -/* - * The coefficients of the weighting filter are stored in a table - * (see table 4.4). The following scaling is used: - * - * H[0..10] = integer( real_H[ 0..10] * 8192 ); - */ -{ - /* word wt[ 50 ]; */ - - register longword L_result; - register int k /* , i */ ; - - /* Initialization of a temporary working array wt[0...49] - */ - - /* for (k = 0; k <= 4; k++) wt[k] = 0; - * for (k = 5; k <= 44; k++) wt[k] = *e++; - * for (k = 45; k <= 49; k++) wt[k] = 0; - * - * (e[-5..-1] and e[40..44] are allocated by the caller, - * are initially zero and are not written anywhere.) - */ - e -= 5; - - /* Compute the signal x[0..39] - */ - for (k = 0; k <= 39; k++) { - - L_result = 8192 >> 1; - - /* for (i = 0; i <= 10; i++) { - * L_temp = GSM_L_MULT( wt[k+i], gsm_H[i] ); - * L_result = GSM_L_ADD( L_result, L_temp ); - * } - */ - -#undef STEP -#define STEP( i, H ) (e[ k + i ] * (longword)H) - - /* Every one of these multiplications is done twice -- - * but I don't see an elegant way to optimize this. - * Do you? - */ - -#ifdef STUPID_COMPILER - L_result += STEP( 0, -134 ) ; - L_result += STEP( 1, -374 ) ; - /* + STEP( 2, 0 ) */ - L_result += STEP( 3, 2054 ) ; - L_result += STEP( 4, 5741 ) ; - L_result += STEP( 5, 8192 ) ; - L_result += STEP( 6, 5741 ) ; - L_result += STEP( 7, 2054 ) ; - /* + STEP( 8, 0 ) */ - L_result += STEP( 9, -374 ) ; - L_result += STEP( 10, -134 ) ; -#else - L_result += - STEP( 0, -134 ) - + STEP( 1, -374 ) - /* + STEP( 2, 0 ) */ - + STEP( 3, 2054 ) - + STEP( 4, 5741 ) - + STEP( 5, 8192 ) - + STEP( 6, 5741 ) - + STEP( 7, 2054 ) - /* + STEP( 8, 0 ) */ - + STEP( 9, -374 ) - + STEP(10, -134 ) - ; -#endif - - /* L_result = GSM_L_ADD( L_result, L_result ); (* scaling(x2) *) - * L_result = GSM_L_ADD( L_result, L_result ); (* scaling(x4) *) - * - * x[k] = SASR( L_result, 16 ); - */ - - /* 2 adds vs. >>16 => 14, minus one shift to compensate for - * those we lost when replacing L_MULT by '*'. - */ - - L_result = SASR( L_result, 13 ); - x[k] = ( L_result < MIN_WORD ? MIN_WORD - : (L_result > MAX_WORD ? MAX_WORD : L_result )); - } -} - -/* 4.2.14 */ - -static void RPE_grid_selection P3((x,xM,Mc_out), - word * x, /* [0..39] IN */ - word * xM, /* [0..12] OUT */ - word * Mc_out /* OUT */ -) -/* - * The signal x[0..39] is used to select the RPE grid which is - * represented by Mc. - */ -{ - /* register word temp1; */ - register int /* m, */ i; - register longword L_result, L_temp; - longword EM; /* xxx should be L_EM? */ - word Mc; - - longword L_common_0_3; - - EM = 0; - Mc = 0; - - /* for (m = 0; m <= 3; m++) { - * L_result = 0; - * - * - * for (i = 0; i <= 12; i++) { - * - * temp1 = SASR( x[m + 3*i], 2 ); - * - * assert(temp1 != MIN_WORD); - * - * L_temp = GSM_L_MULT( temp1, temp1 ); - * L_result = GSM_L_ADD( L_temp, L_result ); - * } - * - * if (L_result > EM) { - * Mc = m; - * EM = L_result; - * } - * } - */ - -#undef STEP -#define STEP( m, i ) L_temp = SASR( x[m + 3 * i], 2 ); \ - L_result += L_temp * L_temp; - - /* common part of 0 and 3 */ - - L_result = 0; - STEP( 0, 1 ); STEP( 0, 2 ); STEP( 0, 3 ); STEP( 0, 4 ); - STEP( 0, 5 ); STEP( 0, 6 ); STEP( 0, 7 ); STEP( 0, 8 ); - STEP( 0, 9 ); STEP( 0, 10); STEP( 0, 11); STEP( 0, 12); - L_common_0_3 = L_result; - - /* i = 0 */ - - STEP( 0, 0 ); - L_result <<= 1; /* implicit in L_MULT */ - EM = L_result; - - /* i = 1 */ - - L_result = 0; - STEP( 1, 0 ); - STEP( 1, 1 ); STEP( 1, 2 ); STEP( 1, 3 ); STEP( 1, 4 ); - STEP( 1, 5 ); STEP( 1, 6 ); STEP( 1, 7 ); STEP( 1, 8 ); - STEP( 1, 9 ); STEP( 1, 10); STEP( 1, 11); STEP( 1, 12); - L_result <<= 1; - if (L_result > EM) { - Mc = 1; - EM = L_result; - } - - /* i = 2 */ - - L_result = 0; - STEP( 2, 0 ); - STEP( 2, 1 ); STEP( 2, 2 ); STEP( 2, 3 ); STEP( 2, 4 ); - STEP( 2, 5 ); STEP( 2, 6 ); STEP( 2, 7 ); STEP( 2, 8 ); - STEP( 2, 9 ); STEP( 2, 10); STEP( 2, 11); STEP( 2, 12); - L_result <<= 1; - if (L_result > EM) { - Mc = 2; - EM = L_result; - } - - /* i = 3 */ - - L_result = L_common_0_3; - STEP( 3, 12 ); - L_result <<= 1; - if (L_result > EM) { - Mc = 3; - EM = L_result; - } - - /**/ - - /* Down-sampling by a factor 3 to get the selected xM[0..12] - * RPE sequence. - */ - for (i = 0; i <= 12; i ++) xM[i] = x[Mc + 3*i]; - *Mc_out = Mc; -} - -/* 4.12.15 */ - -static void APCM_quantization_xmaxc_to_exp_mant P3((xmaxc,exp_out,mant_out), - word xmaxc, /* IN */ - word * exp_out, /* OUT */ - word * mant_out ) /* OUT */ -{ - word exp, mant; - - /* Compute exponent and mantissa of the decoded version of xmaxc - */ - - exp = 0; - if (xmaxc > 15) exp = SASR(xmaxc, 3) - 1; - mant = xmaxc - (exp << 3); - - if (mant == 0) { - exp = -4; - mant = 7; - } - else { - while (mant <= 7) { - mant = mant << 1 | 1; - exp--; - } - mant -= 8; - } - - assert( exp >= -4 && exp <= 6 ); - assert( mant >= 0 && mant <= 7 ); - - *exp_out = exp; - *mant_out = mant; -} - -static void APCM_quantization P5((xM,xMc,mant_out,exp_out,xmaxc_out), - word * xM, /* [0..12] IN */ - - word * xMc, /* [0..12] OUT */ - word * mant_out, /* OUT */ - word * exp_out, /* OUT */ - word * xmaxc_out /* OUT */ -) -{ - int i, itest; - - word xmax, xmaxc, temp, temp1, temp2; - word exp, mant; - - - /* Find the maximum absolute value xmax of xM[0..12]. - */ - - xmax = 0; - for (i = 0; i <= 12; i++) { - temp = xM[i]; - temp = GSM_ABS(temp); - if (temp > xmax) xmax = temp; - } - - /* Qantizing and coding of xmax to get xmaxc. - */ - - exp = 0; - temp = SASR( xmax, 9 ); - itest = 0; - - for (i = 0; i <= 5; i++) { - - itest |= (temp <= 0); - temp = SASR( temp, 1 ); - - assert(exp <= 5); - if (itest == 0) exp++; /* exp = add (exp, 1) */ - } - - assert(exp <= 6 && exp >= 0); - temp = exp + 5; - - assert(temp <= 11 && temp >= 0); - xmaxc = gsm_add( SASR(xmax, temp), exp << 3 ); - - /* Quantizing and coding of the xM[0..12] RPE sequence - * to get the xMc[0..12] - */ - - APCM_quantization_xmaxc_to_exp_mant( xmaxc, &exp, &mant ); - - /* This computation uses the fact that the decoded version of xmaxc - * can be calculated by using the exponent and the mantissa part of - * xmaxc (logarithmic table). - * So, this method avoids any division and uses only a scaling - * of the RPE samples by a function of the exponent. A direct - * multiplication by the inverse of the mantissa (NRFAC[0..7] - * found in table 4.5) gives the 3 bit coded version xMc[0..12] - * of the RPE samples. - */ - - - /* Direct computation of xMc[0..12] using table 4.5 - */ - - assert( exp <= 4096 && exp >= -4096); - assert( mant >= 0 && mant <= 7 ); - - temp1 = 6 - exp; /* normalization by the exponent */ - temp2 = gsm_NRFAC[ mant ]; /* inverse mantissa */ - - for (i = 0; i <= 12; i++) { - - assert(temp1 >= 0 && temp1 < 16); - - temp = xM[i] << temp1; - temp = GSM_MULT( temp, temp2 ); - temp = SASR(temp, 12); - xMc[i] = temp + 4; /* see note below */ - } - - /* NOTE: This equation is used to make all the xMc[i] positive. - */ - - *mant_out = mant; - *exp_out = exp; - *xmaxc_out = xmaxc; -} - -/* 4.2.16 */ - -static void APCM_inverse_quantization P4((xMc,mant,exp,xMp), - register word * xMc, /* [0..12] IN */ - word mant, - word exp, - register word * xMp) /* [0..12] OUT */ -/* - * This part is for decoding the RPE sequence of coded xMc[0..12] - * samples to obtain the xMp[0..12] array. Table 4.6 is used to get - * the mantissa of xmaxc (FAC[0..7]). - */ -{ - int i; - word temp, temp1, temp2, temp3; - longword ltmp; - - assert( mant >= 0 && mant <= 7 ); - - temp1 = gsm_FAC[ mant ]; /* see 4.2-15 for mant */ - temp2 = gsm_sub( 6, exp ); /* see 4.2-15 for exp */ - temp3 = gsm_asl( 1, gsm_sub( temp2, 1 )); - - for (i = 13; i--;) { - - assert( *xMc <= 7 && *xMc >= 0 ); /* 3 bit unsigned */ - - /* temp = gsm_sub( *xMc++ << 1, 7 ); */ - temp = (*xMc++ << 1) - 7; /* restore sign */ - assert( temp <= 7 && temp >= -7 ); /* 4 bit signed */ - - temp <<= 12; /* 16 bit signed */ - temp = GSM_MULT_R( temp1, temp ); - temp = GSM_ADD( temp, temp3 ); - *xMp++ = gsm_asr( temp, temp2 ); - } -} - -/* 4.2.17 */ - -static void RPE_grid_positioning P3((Mc,xMp,ep), - word Mc, /* grid position IN */ - register word * xMp, /* [0..12] IN */ - register word * ep /* [0..39] OUT */ -) -/* - * This procedure computes the reconstructed long term residual signal - * ep[0..39] for the LTP analysis filter. The inputs are the Mc - * which is the grid position selection and the xMp[0..12] decoded - * RPE samples which are upsampled by a factor of 3 by inserting zero - * values. - */ -{ - int i = 13; - - assert(0 <= Mc && Mc <= 3); - - switch (Mc) { - case 3: *ep++ = 0; - case 2: do { - *ep++ = 0; - case 1: *ep++ = 0; - case 0: *ep++ = *xMp++; - } while (--i); - } - while (++Mc < 4) *ep++ = 0; - - /* - - int i, k; - for (k = 0; k <= 39; k++) ep[k] = 0; - for (i = 0; i <= 12; i++) { - ep[ Mc + (3*i) ] = xMp[i]; - } - */ -} - -/* 4.2.18 */ - -/* This procedure adds the reconstructed long term residual signal - * ep[0..39] to the estimated signal dpp[0..39] from the long term - * analysis filter to compute the reconstructed short term residual - * signal dp[-40..-1]; also the reconstructed short term residual - * array dp[-120..-41] is updated. - */ - -#if 0 /* Has been inlined in code.c */ -void Gsm_Update_of_reconstructed_short_time_residual_signal P3((dpp, ep, dp), - word * dpp, /* [0...39] IN */ - word * ep, /* [0...39] IN */ - word * dp) /* [-120...-1] IN/OUT */ -{ - int k; - - for (k = 0; k <= 79; k++) - dp[ -120 + k ] = dp[ -80 + k ]; - - for (k = 0; k <= 39; k++) - dp[ -40 + k ] = gsm_add( ep[k], dpp[k] ); -} -#endif /* Has been inlined in code.c */ - -void Gsm_RPE_Encoding P5((S,e,xmaxc,Mc,xMc), - - struct gsm_state * S, - - word * e, /* -5..-1][0..39][40..44 IN/OUT */ - word * xmaxc, /* OUT */ - word * Mc, /* OUT */ - word * xMc) /* [0..12] OUT */ -{ - word x[40]; - word xM[13], xMp[13]; - word mant, exp; - - Weighting_filter(e, x); - RPE_grid_selection(x, xM, Mc); - - APCM_quantization( xM, xMc, &mant, &exp, xmaxc); - APCM_inverse_quantization( xMc, mant, exp, xMp); - - RPE_grid_positioning( *Mc, xMp, e ); - -} - -void Gsm_RPE_Decoding P5((S, xmaxcr, Mcr, xMcr, erp), - struct gsm_state * S, - - word xmaxcr, - word Mcr, - word * xMcr, /* [0..12], 3 bits IN */ - word * erp /* [0..39] OUT */ -) -{ - word exp, mant; - word xMp[ 13 ]; - - APCM_quantization_xmaxc_to_exp_mant( xmaxcr, &exp, &mant ); - APCM_inverse_quantization( xMcr, mant, exp, xMp ); - RPE_grid_positioning( Mcr, xMp, erp ); - -} diff --git a/third_party/gsm/src/short_term.c b/third_party/gsm/src/short_term.c deleted file mode 100644 index 058aa4c..0000000 --- a/third_party/gsm/src/short_term.c +++ /dev/null @@ -1,430 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/short_term.c,v 1.2 1994/05/10 20:18:47 jutta Exp $ */ - -#include "config.h" -#include -#include - -#include "private.h" - -#include "gsm.h" -#include "proto.h" - -/* - * SHORT TERM ANALYSIS FILTERING SECTION - */ - -/* 4.2.8 */ - -static void Decoding_of_the_coded_Log_Area_Ratios P2((LARc,LARpp), - word * LARc, /* coded log area ratio [0..7] IN */ - word * LARpp) /* out: decoded .. */ -{ - register word temp1 /* , temp2 */; - register long ltmp; /* for GSM_ADD */ - - /* This procedure requires for efficient implementation - * two tables. - * - * INVA[1..8] = integer( (32768 * 8) / real_A[1..8]) - * MIC[1..8] = minimum value of the LARc[1..8] - */ - - /* Compute the LARpp[1..8] - */ - - /* for (i = 1; i <= 8; i++, B++, MIC++, INVA++, LARc++, LARpp++) { - * - * temp1 = GSM_ADD( *LARc, *MIC ) << 10; - * temp2 = *B << 1; - * temp1 = GSM_SUB( temp1, temp2 ); - * - * assert(*INVA != MIN_WORD); - * - * temp1 = GSM_MULT_R( *INVA, temp1 ); - * *LARpp = GSM_ADD( temp1, temp1 ); - * } - */ - -#undef STEP -#define STEP( B, MIC, INVA ) \ - temp1 = GSM_ADD( *LARc++, MIC ) << 10; \ - temp1 = GSM_SUB( temp1, B << 1 ); \ - temp1 = GSM_MULT_R( INVA, temp1 ); \ - *LARpp++ = GSM_ADD( temp1, temp1 ); - - STEP( 0, -32, 13107 ); - STEP( 0, -32, 13107 ); - STEP( 2048, -16, 13107 ); - STEP( -2560, -16, 13107 ); - - STEP( 94, -8, 19223 ); - STEP( -1792, -8, 17476 ); - STEP( -341, -4, 31454 ); - STEP( -1144, -4, 29708 ); - - /* NOTE: the addition of *MIC is used to restore - * the sign of *LARc. - */ -} - -/* 4.2.9 */ -/* Computation of the quantized reflection coefficients - */ - -/* 4.2.9.1 Interpolation of the LARpp[1..8] to get the LARp[1..8] - */ - -/* - * Within each frame of 160 analyzed speech samples the short term - * analysis and synthesis filters operate with four different sets of - * coefficients, derived from the previous set of decoded LARs(LARpp(j-1)) - * and the actual set of decoded LARs (LARpp(j)) - * - * (Initial value: LARpp(j-1)[1..8] = 0.) - */ - -static void Coefficients_0_12 P3((LARpp_j_1, LARpp_j, LARp), - register word * LARpp_j_1, - register word * LARpp_j, - register word * LARp) -{ - register int i; - register longword ltmp; - - for (i = 1; i <= 8; i++, LARp++, LARpp_j_1++, LARpp_j++) { - *LARp = GSM_ADD( SASR( *LARpp_j_1, 2 ), SASR( *LARpp_j, 2 )); - *LARp = GSM_ADD( *LARp, SASR( *LARpp_j_1, 1)); - } -} - -static void Coefficients_13_26 P3((LARpp_j_1, LARpp_j, LARp), - register word * LARpp_j_1, - register word * LARpp_j, - register word * LARp) -{ - register int i; - register longword ltmp; - for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) { - *LARp = GSM_ADD( SASR( *LARpp_j_1, 1), SASR( *LARpp_j, 1 )); - } -} - -static void Coefficients_27_39 P3((LARpp_j_1, LARpp_j, LARp), - register word * LARpp_j_1, - register word * LARpp_j, - register word * LARp) -{ - register int i; - register longword ltmp; - - for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) { - *LARp = GSM_ADD( SASR( *LARpp_j_1, 2 ), SASR( *LARpp_j, 2 )); - *LARp = GSM_ADD( *LARp, SASR( *LARpp_j, 1 )); - } -} - - -static void Coefficients_40_159 P2((LARpp_j, LARp), - register word * LARpp_j, - register word * LARp) -{ - register int i; - - for (i = 1; i <= 8; i++, LARp++, LARpp_j++) - *LARp = *LARpp_j; -} - -/* 4.2.9.2 */ - -static void LARp_to_rp P1((LARp), - register word * LARp) /* [0..7] IN/OUT */ -/* - * The input of this procedure is the interpolated LARp[0..7] array. - * The reflection coefficients, rp[i], are used in the analysis - * filter and in the synthesis filter. - */ -{ - register int i; - register word temp; - register longword ltmp; - - for (i = 1; i <= 8; i++, LARp++) { - - /* temp = GSM_ABS( *LARp ); - * - * if (temp < 11059) temp <<= 1; - * else if (temp < 20070) temp += 11059; - * else temp = GSM_ADD( temp >> 2, 26112 ); - * - * *LARp = *LARp < 0 ? -temp : temp; - */ - - if (*LARp < 0) { - temp = *LARp == MIN_WORD ? MAX_WORD : -(*LARp); - *LARp = - ((temp < 11059) ? temp << 1 - : ((temp < 20070) ? temp + 11059 - : GSM_ADD( temp >> 2, 26112 ))); - } else { - temp = *LARp; - *LARp = (temp < 11059) ? temp << 1 - : ((temp < 20070) ? temp + 11059 - : GSM_ADD( temp >> 2, 26112 )); - } - } -} - - -/* 4.2.10 */ -static void Short_term_analysis_filtering P4((S,rp,k_n,s), - struct gsm_state * S, - register word * rp, /* [0..7] IN */ - register int k_n, /* k_end - k_start */ - register word * s /* [0..n-1] IN/OUT */ -) -/* - * This procedure computes the short term residual signal d[..] to be fed - * to the RPE-LTP loop from the s[..] signal and from the local rp[..] - * array (quantized reflection coefficients). As the call of this - * procedure can be done in many ways (see the interpolation of the LAR - * coefficient), it is assumed that the computation begins with index - * k_start (for arrays d[..] and s[..]) and stops with index k_end - * (k_start and k_end are defined in 4.2.9.1). This procedure also - * needs to keep the array u[0..7] in memory for each call. - */ -{ - register word * u = S->u; - register int i; - register word di, zzz, ui, sav, rpi; - register longword ltmp; - - for (; k_n--; s++) { - - di = sav = *s; - - for (i = 0; i < 8; i++) { /* YYY */ - - ui = u[i]; - rpi = rp[i]; - u[i] = sav; - - zzz = GSM_MULT_R(rpi, di); - sav = GSM_ADD( ui, zzz); - - zzz = GSM_MULT_R(rpi, ui); - di = GSM_ADD( di, zzz ); - } - - *s = di; - } -} - -#if defined(USE_FLOAT_MUL) && defined(FAST) - -static void Fast_Short_term_analysis_filtering P4((S,rp,k_n,s), - struct gsm_state * S, - register word * rp, /* [0..7] IN */ - register int k_n, /* k_end - k_start */ - register word * s /* [0..n-1] IN/OUT */ -) -{ - register word * u = S->u; - register int i; - - float uf[8], - rpf[8]; - - register float scalef = 3.0517578125e-5; - register float sav, di, temp; - - for (i = 0; i < 8; ++i) { - uf[i] = u[i]; - rpf[i] = rp[i] * scalef; - } - for (; k_n--; s++) { - sav = di = *s; - for (i = 0; i < 8; ++i) { - register float rpfi = rpf[i]; - register float ufi = uf[i]; - - uf[i] = sav; - temp = rpfi * di + ufi; - di += rpfi * ufi; - sav = temp; - } - *s = di; - } - for (i = 0; i < 8; ++i) u[i] = uf[i]; -} -#endif /* ! (defined (USE_FLOAT_MUL) && defined (FAST)) */ - -static void Short_term_synthesis_filtering P5((S,rrp,k,wt,sr), - struct gsm_state * S, - register word * rrp, /* [0..7] IN */ - register int k, /* k_end - k_start */ - register word * wt, /* [0..k-1] IN */ - register word * sr /* [0..k-1] OUT */ -) -{ - register word * v = S->v; - register int i; - register word sri, tmp1, tmp2; - register longword ltmp; /* for GSM_ADD & GSM_SUB */ - - while (k--) { - sri = *wt++; - for (i = 8; i--;) { - - /* sri = GSM_SUB( sri, gsm_mult_r( rrp[i], v[i] ) ); - */ - tmp1 = rrp[i]; - tmp2 = v[i]; - tmp2 = ( tmp1 == MIN_WORD && tmp2 == MIN_WORD - ? MAX_WORD - : 0x0FFFF & (( (longword)tmp1 * (longword)tmp2 - + 16384) >> 15)) ; - - sri = GSM_SUB( sri, tmp2 ); - - /* v[i+1] = GSM_ADD( v[i], gsm_mult_r( rrp[i], sri ) ); - */ - tmp1 = ( tmp1 == MIN_WORD && sri == MIN_WORD - ? MAX_WORD - : 0x0FFFF & (( (longword)tmp1 * (longword)sri - + 16384) >> 15)) ; - - v[i+1] = GSM_ADD( v[i], tmp1); - } - *sr++ = v[0] = sri; - } -} - - -#if defined(FAST) && defined(USE_FLOAT_MUL) - -static void Fast_Short_term_synthesis_filtering P5((S,rrp,k,wt,sr), - struct gsm_state * S, - register word * rrp, /* [0..7] IN */ - register int k, /* k_end - k_start */ - register word * wt, /* [0..k-1] IN */ - register word * sr /* [0..k-1] OUT */ -) -{ - register word * v = S->v; - register int i; - - float va[9], rrpa[8]; - register float scalef = 3.0517578125e-5, temp; - - for (i = 0; i < 8; ++i) { - va[i] = v[i]; - rrpa[i] = (float)rrp[i] * scalef; - } - while (k--) { - register float sri = *wt++; - for (i = 8; i--;) { - sri -= rrpa[i] * va[i]; - if (sri < -32768.) sri = -32768.; - else if (sri > 32767.) sri = 32767.; - - temp = va[i] + rrpa[i] * sri; - if (temp < -32768.) temp = -32768.; - else if (temp > 32767.) temp = 32767.; - va[i+1] = temp; - } - *sr++ = va[0] = sri; - } - for (i = 0; i < 9; ++i) v[i] = va[i]; -} - -#endif /* defined(FAST) && defined(USE_FLOAT_MUL) */ - -void Gsm_Short_Term_Analysis_Filter P3((S,LARc,s), - - struct gsm_state * S, - - word * LARc, /* coded log area ratio [0..7] IN */ - word * s /* signal [0..159] IN/OUT */ -) -{ - word * LARpp_j = S->LARpp[ S->j ]; - word * LARpp_j_1 = S->LARpp[ S->j ^= 1 ]; - - word LARp[8]; - -#undef FILTER -#if defined(FAST) && defined(USE_FLOAT_MUL) -# define FILTER (* (S->fast \ - ? Fast_Short_term_analysis_filtering \ - : Short_term_analysis_filtering )) - -#else -# define FILTER Short_term_analysis_filtering -#endif - - Decoding_of_the_coded_Log_Area_Ratios( LARc, LARpp_j ); - - Coefficients_0_12( LARpp_j_1, LARpp_j, LARp ); - LARp_to_rp( LARp ); - FILTER( S, LARp, 13, s); - - Coefficients_13_26( LARpp_j_1, LARpp_j, LARp); - LARp_to_rp( LARp ); - FILTER( S, LARp, 14, s + 13); - - Coefficients_27_39( LARpp_j_1, LARpp_j, LARp); - LARp_to_rp( LARp ); - FILTER( S, LARp, 13, s + 27); - - Coefficients_40_159( LARpp_j, LARp); - LARp_to_rp( LARp ); - FILTER( S, LARp, 120, s + 40); -} - -void Gsm_Short_Term_Synthesis_Filter P4((S, LARcr, wt, s), - struct gsm_state * S, - - word * LARcr, /* received log area ratios [0..7] IN */ - word * wt, /* received d [0..159] IN */ - - word * s /* signal s [0..159] OUT */ -) -{ - word * LARpp_j = S->LARpp[ S->j ]; - word * LARpp_j_1 = S->LARpp[ S->j ^=1 ]; - - word LARp[8]; - -#undef FILTER -#if defined(FAST) && defined(USE_FLOAT_MUL) - -# define FILTER (* (S->fast \ - ? Fast_Short_term_synthesis_filtering \ - : Short_term_synthesis_filtering )) -#else -# define FILTER Short_term_synthesis_filtering -#endif - - Decoding_of_the_coded_Log_Area_Ratios( LARcr, LARpp_j ); - - Coefficients_0_12( LARpp_j_1, LARpp_j, LARp ); - LARp_to_rp( LARp ); - FILTER( S, LARp, 13, wt, s ); - - Coefficients_13_26( LARpp_j_1, LARpp_j, LARp); - LARp_to_rp( LARp ); - FILTER( S, LARp, 14, wt + 13, s + 13 ); - - Coefficients_27_39( LARpp_j_1, LARpp_j, LARp); - LARp_to_rp( LARp ); - FILTER( S, LARp, 13, wt + 27, s + 27 ); - - Coefficients_40_159( LARpp_j, LARp ); - LARp_to_rp( LARp ); - FILTER(S, LARp, 120, wt + 40, s + 40); -} diff --git a/third_party/gsm/src/table.c b/third_party/gsm/src/table.c deleted file mode 100644 index 0ed6f70..0000000 --- a/third_party/gsm/src/table.c +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/table.c,v 1.1 1992/10/28 00:15:50 jutta Exp $ */ - -/* Most of these tables are inlined at their point of use. - */ - -/* 4.4 TABLES USED IN THE FIXED POINT IMPLEMENTATION OF THE RPE-LTP - * CODER AND DECODER - * - * (Most of them inlined, so watch out.) - */ - -#define GSM_TABLE_C -#include "private.h" -#include "gsm.h" - -/* Table 4.1 Quantization of the Log.-Area Ratios - */ -/* i 1 2 3 4 5 6 7 8 */ -word gsm_A[8] = {20480, 20480, 20480, 20480, 13964, 15360, 8534, 9036}; -word gsm_B[8] = { 0, 0, 2048, -2560, 94, -1792, -341, -1144}; -word gsm_MIC[8] = { -32, -32, -16, -16, -8, -8, -4, -4 }; -word gsm_MAC[8] = { 31, 31, 15, 15, 7, 7, 3, 3 }; - - -/* Table 4.2 Tabulation of 1/A[1..8] - */ -word gsm_INVA[8]={ 13107, 13107, 13107, 13107, 19223, 17476, 31454, 29708 }; - - -/* Table 4.3a Decision level of the LTP gain quantizer - */ -/* bc 0 1 2 3 */ -word gsm_DLB[4] = { 6554, 16384, 26214, 32767 }; - - -/* Table 4.3b Quantization levels of the LTP gain quantizer - */ -/* bc 0 1 2 3 */ -word gsm_QLB[4] = { 3277, 11469, 21299, 32767 }; - - -/* Table 4.4 Coefficients of the weighting filter - */ -/* i 0 1 2 3 4 5 6 7 8 9 10 */ -word gsm_H[11] = {-134, -374, 0, 2054, 5741, 8192, 5741, 2054, 0, -374, -134 }; - - -/* Table 4.5 Normalized inverse mantissa used to compute xM/xmax - */ -/* i 0 1 2 3 4 5 6 7 */ -word gsm_NRFAC[8] = { 29128, 26215, 23832, 21846, 20165, 18725, 17476, 16384 }; - - -/* Table 4.6 Normalized direct mantissa used to compute xM/xmax - */ -/* i 0 1 2 3 4 5 6 7 */ -word gsm_FAC[8] = { 18431, 20479, 22527, 24575, 26623, 28671, 30719, 32767 }; diff --git a/third_party/gsm/src/toast.c b/third_party/gsm/src/toast.c deleted file mode 100644 index 9823642..0000000 --- a/third_party/gsm/src/toast.c +++ /dev/null @@ -1,800 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/toast.c,v 1.8 1996/07/02 10:41:04 jutta Exp $ */ - -#include "toast.h" - -/* toast -- lossy sound compression using the gsm library. - */ - -char * progname; - -int f_decode = 0; /* decode rather than encode (-d) */ -int f_cat = 0; /* write to stdout; implies -p (-c) */ -int f_force = 0; /* don't ask about replacements (-f) */ -int f_precious = 0; /* avoid deletion of original (-p) */ -int f_fast = 0; /* use faster fpt algorithm (-F) */ -int f_verbose = 0; /* debugging (-V) */ -int f_ltp_cut = 0; /* LTP cut-off margin (-C) */ - -struct stat instat; /* stat (inname) */ - -FILE *in, *out; -char *inname, *outname; - -/* - * The function (*output)() writes a frame of 160 samples given as - * 160 signed 16 bit values (gsm_signals) to . - * The function (*input)() reads one such frame from . - * The function (*init_output)() begins output (e.g. writes a header)., - * The function (*init_input)() begins input (e.g. skips a header). - * - * There are different versions of input, output, init_input and init_output - * for different formats understood by toast; which ones are used - * depends on the command line arguments and, in their absence, the - * filename; the fallback is #defined in toast.h - * - * The specific implementations of input, output, init_input and init_output - * for a format `foo' live in toast_foo.c. - */ - -int (*output ) P((gsm_signal *)), - (*input ) P((gsm_signal *)); -int (*init_input) P((void)), - (*init_output) P((void)); - -static int generic_init P0() { return 0; } /* NOP */ - -struct fmtdesc { - - char * name, * longname, * suffix; - - int (* init_input ) P((void)), - (* init_output) P((void)); - - int (* input ) P((gsm_signal * )), - (* output) P((gsm_signal * )); - -} f_audio = { - "audio", - "8 kHz, 8 bit u-law encoding with Sun audio header", ".au", - audio_init_input, - audio_init_output, - ulaw_input, - ulaw_output -}, f_ulaw = { - "u-law", "plain 8 kHz, 8 bit u-law encoding", ".u", - generic_init, - generic_init, - ulaw_input, - ulaw_output - -}, f_alaw = { - "A-law", "8 kHz, 8 bit A-law encoding", ".A", - generic_init, - generic_init, - alaw_input, - alaw_output - -}, f_linear = { - "linear", - "16 bit (13 significant) signed 8 kHz signal", ".l", - generic_init, - generic_init, - linear_input, - linear_output -}; - -struct fmtdesc * alldescs[] = { - &f_audio, - &f_alaw, - &f_ulaw, - &f_linear, - (struct fmtdesc *)NULL -}; - -#define DEFAULT_FORMAT f_ulaw /* default audio format, others */ - /* are: f_alaw,f_audio,f_linear */ -struct fmtdesc * f_format = 0; - -/* - * basename + suffix of a pathname - */ -static char * endname P1((name), char * name) -{ - if (name) { - char * s = strrchr(name, '/'); - if (s && s[1]) name = s + 1; - } - return name; - -} - -/* - * Try to figure out what we're supposed to do from the argv[0], if - * any, and set the parameters accordingly. - */ -static void parse_argv0 P1((av0), char * av0 ) -{ - int l; - - progname = av0 = endname(av0 ? av0 : "toast"); - - /* If the name starts with `un', we want to decode, not code. - * If the name ends in `cat', we want to write to stdout, - * and decode as well. - */ - - if (!strncmp(av0, "un", 2)) f_decode = 1; - if ( (l = strlen(av0)) >= 3 /* strlen("cat") */ - && !strcmp( av0 + l - 3, "cat" )) f_cat = f_decode = 1; -} - - -/* - * Check whether the name (possibly generated by appending - * .gsm to something else) is short enough for this system. - */ -static int length_okay P1((name), char * name) -{ - long max_filename_length = 0; - char * end; - - /* If our _pathname_ is too long, we'll usually not be - * able to open the file at all -- don't worry about that. - * - * But if the _filename_ is too long, there is danger of - * silent truncation on some systems, which results - * in the target replacing the source! - */ - - if (!name) return 0; - end = endname(name); - -#ifdef NAME_MAX - max_filename_length = NAME_MAX; -#else -#ifdef _PC_NAME_MAX -#ifdef USE_PATHCONF - { char * s, tmp; - - /* s = dirname(name) - */ - if ((s = end) > name) { - if (s > name + 1) s--; - tmp = s; - *s = 0; - } - - errno = 0; - max_filename_length = pathconf(s > name ? name : ".", - _PC_NAME_MAX); - if (max_filename_length == -1 && errno) { - perror( s > name ? name : "." ); - fprintf(stderr, - "%s: cannot get dynamic filename length limit for %s.\n", - progname, s > name ? name : "."); - return 0; - } - if (s > name) *s = tmp; - } -#endif /* USE_PATHCONF */ -#endif /* _PC_NAME_MAX */ -#endif /* !NAME_MAX */ - - if (max_filename_length > 0 && strlen(end) > max_filename_length) { - fprintf(stderr, - "%s: filename \"%s\" is too long (maximum is %ld)\n", - progname, endname(name), max_filename_length ); - return 0; - } - - return 1; -} - -/* - * Return a pointer the suffix of a string, if any. - * A suffix alone has no suffix, an empty suffix can not be had. - */ -static char * suffix P2((name, suf), char *name, char * suf) -{ - size_t nlen = strlen(name); - size_t slen = strlen(suf); - - if (!slen || nlen <= slen) return (char *)0; - name += nlen - slen; - return memcmp(name, suf, slen) ? (char *)0 : name; -} - - -static void catch_signals P1((fun), SIGHANDLER_T (*fun) ()) -{ -#ifdef SIGHUP - signal( SIGHUP, fun ); -#endif -#ifdef SIGINT - signal( SIGINT, fun ); -#endif -#ifdef SIGPIPE - signal( SIGPIPE, fun ); -#endif -#ifdef SIGTERM - signal( SIGTERM, fun ); -#endif -#ifdef SIGXFSZ - signal( SIGXFSZ, fun ); -#endif -} - -static SIGHANDLER_T onintr P0() -{ - char * tmp = outname; - -#ifdef HAS_SYSV_SIGNALS - catch_signals( SIG_IGN ); -#endif - - outname = (char *)0; - if (tmp) (void)unlink(tmp); - - exit(1); -} - -/* - * Allocate some memory and complain if it fails. - */ -static char * emalloc P1((len), size_t len) -{ - char * s; - if (!(s = malloc(len))) { - fprintf(stderr, "%s: failed to malloc %d bytes -- abort\n", - progname, len); - onintr(); - exit(1); - } - return s; -} - -static char* normalname P3((name, want, cut), char *name, char *want,char *cut) -{ - size_t maxlen; - char * s, * p; - - p = (char *)0; - if (!name) return p; - - maxlen = strlen(name) + 1 + strlen(want) + strlen(cut); - p = strcpy(emalloc(maxlen), name); - - if (s = suffix(p, cut)) strcpy(s, want); - else if (*want && !suffix(p, want)) strcat(p, want); - - return p; -} - -/* - * Generate a `plain' (non-encoded) name from a given name. - */ -static char * plainname P1((name), char *name) -{ - return normalname(name, "", SUFFIX_TOASTED ); -} - -/* - * Generate a `code' name from a given name. - */ -static char * codename P1((name), char *name) -{ - return normalname( name, SUFFIX_TOASTED, "" ); -} - -/* - * If we're supposed to ask (fileno (stderr) is a tty, and f_force not - * set), ask the user whether to overwrite a file or not. - */ -static int ok_to_replace P1(( name ), char * name) -{ - int reply, c; - - if (f_force) return 1; /* YES, do replace */ - if (!isatty(fileno(stderr))) return 0; /* NO, don't replace */ - - fprintf(stderr, - "%s already exists; do you wish to overwrite %s (y or n)? ", - name, name); - fflush(stderr); - - for (c = reply = getchar(); c != '\n' && c != EOF; c = getchar()) ; - if (reply == 'y') return 1; - - fprintf(stderr, "\tnot overwritten\n"); - return 0; -} - -static void update_mode P0() -{ - if (!instat.st_nlink) return; /* couldn't stat in */ - -#ifdef HAS_FCHMOD - if (fchmod(fileno(out), instat.st_mode & 07777)) { - perror(outname); - fprintf(stderr, "%s: could not change file mode of \"%s\"\n", - progname, outname); - } -#else -#ifdef HAS_CHMOD - if (outname && chmod(outname, instat.st_mode & 07777)) { - perror(outname); - fprintf(stderr, "%s: could not change file mode of \"%s\"\n", - progname, outname); - } -#endif /* HAS_CHMOD */ -#endif /* HAS_FCHMOD */ -} - -static void update_own P0() -{ - if (!instat.st_nlink) return; /* couldn't stat in */ -#ifdef HAS_FCHOWN - (void)fchown(fileno(out), instat.st_uid, instat.st_gid); -#else -#ifdef HAS_CHOWN - (void)chown(outname, instat.st_uid, instat.st_gid); -#endif /* HAS_CHOWN */ -#endif /* HAS_FCHOWN */ -} - -static void update_times P0() -{ - if (!instat.st_nlink) return; /* couldn't stat in */ - -#ifdef HAS_UTIMES - if (outname) { - struct timeval tv[2]; - - tv[0].tv_sec = instat.st_atime; - tv[1].tv_sec = instat.st_mtime; - tv[0].tv_usec = tv[1].tv_usec = 0; - (void) utimes(outname, tv); - } -#else -#ifdef HAS_UTIME - - if (outname) { - -#ifdef HAS_UTIMBUF - struct utimbuf ut; - - ut.actime = instat.st_atime; - ut.modtime = instat.st_mtime; - -# ifdef HAS_UTIMEUSEC - ut.acusec = instat.st_ausec; - ut.modusec = instat.st_musec; -# endif /* HAS_UTIMEUSEC */ - - (void) utime(outname, &ut); - -#else /* UTIMBUF */ - - time_t ut[2]; - - ut[0] = instat.st_atime; - ut[1] = instat.st_mtime; - - (void) utime(outname, ut); - -#endif /* UTIMBUF */ - } -#endif /* HAS_UTIME */ -#endif /* HAS_UTIMES */ -} - - -static int okay_as_input P3((name,f,st), char* name, FILE* f, struct stat * st) -{ -# ifdef HAS_FSTAT - if (fstat(fileno(f), st) < 0) -# else - if (stat(name, st) < 0) -# endif - { - perror(name); - fprintf(stderr, "%s: cannot stat \"%s\"\n", progname, name); - return 0; - } - - if (!S_ISREG(st->st_mode)) { - fprintf(stderr, - "%s: \"%s\" is not a regular file -- unchanged.\n", - progname, name); - return 0; - } - if (st->st_nlink > 1 && !f_cat && !f_precious) { - fprintf(stderr, - "%s: \"%s\" has %s other link%s -- unchanged.\n", - progname,name,st->st_nlink - 1,"s" + (st->st_nlink<=2)); - return 0; - } - return 1; -} - -static void prepare_io P1(( desc), struct fmtdesc * desc) -{ - output = desc->output; - input = desc->input; - - init_input = desc->init_input; - init_output = desc->init_output; -} - -static struct fmtdesc * grok_format P1((name), char * name) -{ - char * c; - struct fmtdesc ** f; - - if (name) { - c = plainname(name); - - for (f = alldescs; *f; f++) { - if ( (*f)->suffix - && *(*f)->suffix - && suffix(c, (*f)->suffix)) { - - free(c); - return *f; - } - } - - free(c); - } - return (struct fmtdesc *)0; -} - -static int open_input P2((name, st), char * name, struct stat * st) -{ - struct fmtdesc * f = f_format; - - st->st_nlink = 0; /* indicates `undefined' value */ - if (!name) { - inname = (char *)NULL; - in = stdin; -#ifdef HAS__FSETMODE - _fsetmode(in, "b"); -#endif - } - else { - if (f_decode) inname = codename(name); - else { - if (!f_cat && suffix(name, SUFFIX_TOASTED)) { - fprintf(stderr, - "%s: %s already has \"%s\" suffix -- unchanged.\n", - progname, name, SUFFIX_TOASTED ); - return 0; - } - inname = strcpy(emalloc(strlen(name)+1), name); - } - if (!(in = fopen(inname, READ))) { - perror(inname); /* not guaranteed to be valid here */ - fprintf(stderr, "%s: cannot open \"%s\" for reading\n", - progname, inname); - return 0; - } - if (!okay_as_input(inname, in, st)) return 0; - if (!f) f = grok_format(inname); - } - prepare_io( f ? f : & DEFAULT_FORMAT ); - return 1; -} - -static int open_output P1((name), char *name) -{ - if (!name || f_cat) { - out = stdout; - outname = (char *)NULL; -#ifdef HAS__FSETMODE - _fsetmode(out, "b"); -#endif - } - else { - int outfd = -1; - char * o; - - o = (*(f_decode ? plainname : codename))(name); - if (!length_okay(o)) return 0; - if ((outfd = open(o, O_WRITE_EXCL, 0666)) >= 0) - out = fdopen(outfd, WRITE); - else if (errno != EEXIST) out = (FILE *)NULL; - else if (ok_to_replace(o)) out = fopen(o, WRITE); - else return 0; - - if (!out) { - perror(o); - fprintf(stderr, - "%s: can't open \"%s\" for writing\n", - progname, o); - if (outfd >= 0) (void)close(outfd); - return 0; - } - - outname = o; - } - return 1; -} - -static int process_encode P0() -{ - gsm r; - gsm_signal s[ 160 ]; - gsm_frame d; - - int cc; - - if (!(r = gsm_create())) { - perror(progname); - return -1; - } - (void)gsm_option(r, GSM_OPT_FAST, &f_fast); - (void)gsm_option(r, GSM_OPT_VERBOSE, &f_verbose); - (void)gsm_option(r, GSM_OPT_LTP_CUT, &f_ltp_cut); - - while ((cc = (*input)(s)) > 0) { - if (cc < sizeof(s) / sizeof(*s)) - memset((char *)(s+cc), 0, sizeof(s)-(cc * sizeof(*s))); - gsm_encode(r, s, d); - if (fwrite((char *)d, sizeof(d), 1, out) != 1) { - perror(outname ? outname : "stdout"); - fprintf(stderr, "%s: error writing to %s\n", - progname, outname ? outname : "stdout"); - gsm_destroy(r); - return -1; - } - } - if (cc < 0) { - perror(inname ? inname : "stdin"); - fprintf(stderr, "%s: error reading from %s\n", - progname, inname ? inname : "stdin"); - gsm_destroy(r); - return -1; - } - gsm_destroy(r); - - return 0; -} - -static int process_decode P0() -{ - gsm r; - gsm_frame s; - gsm_signal d[ 160 ]; - - int cc; - - if (!(r = gsm_create())) { /* malloc failed */ - perror(progname); - return -1; - } - (void)gsm_option(r, GSM_OPT_FAST, &f_fast); - (void)gsm_option(r, GSM_OPT_VERBOSE, &f_verbose); - - while ((cc = fread(s, 1, sizeof(s), in)) > 0) { - - if (cc != sizeof(s)) { - if (cc >= 0) fprintf(stderr, - "%s: incomplete frame (%d byte%s missing) from %s\n", - progname, sizeof(s) - cc, - "s" + (sizeof(s) - cc == 1), - inname ? inname : "stdin" ); - gsm_destroy(r); - errno = 0; - return -1; - } - if (gsm_decode(r, s, d)) { - fprintf(stderr, "%s: bad frame in %s\n", - progname, inname ? inname : "stdin"); - gsm_destroy(r); - errno = 0; - return -1; - } - - if ((*output)(d) < 0) { - perror(outname); - fprintf(stderr, "%s: error writing to %s\n", - progname, outname); - gsm_destroy(r); - return -1; - } - } - - if (cc < 0) { - perror(inname ? inname : "stdin" ); - fprintf(stderr, "%s: error reading from %s\n", progname, - inname ? inname : "stdin"); - gsm_destroy(r); - return -1; - } - - gsm_destroy(r); - return 0; -} - -static int process P1((name), char * name) -{ - int step = 0; - - out = (FILE *)0; - in = (FILE *)0; - - outname = (char *)0; - inname = (char *)0; - - if (!open_input(name, &instat) || !open_output(name)) - goto err; - - if ((*(f_decode ? init_output : init_input))()) { - fprintf(stderr, "%s: error %s %s\n", - progname, - f_decode ? "writing header to" : "reading header from", - f_decode ? (outname ? outname : "stdout") - : (inname ? inname : "stdin")); - goto err; - } - - if ((*(f_decode ? process_decode : process_encode))()) - goto err; - - if (fflush(out) < 0 || ferror(out)) { - perror(outname ? outname : "stdout"); - fprintf(stderr, "%s: error writing \"%s\"\n", progname, - outname ? outname:"stdout"); - goto err; - } - - if (out != stdout) { - - update_times(); - update_mode (); - update_own (); - - if (fclose(out) < 0) { - perror(outname); - fprintf(stderr, "%s: error writing \"%s\"\n", - progname, outname); - goto err; - } - if (outname != name) free(outname); - outname = (char *)0; - } - out = (FILE *)0; - if (in != stdin) { - (void)fclose(in), in = (FILE *)0; - if (!f_cat && !f_precious) { - if (unlink(inname) < 0) { - perror(inname); - fprintf(stderr, - "%s: source \"%s\" not deleted.\n", - progname, inname); - } - goto err; - } - if (inname != name) free(inname); - inname = (char *)0; - } - return 0; - - /* - * Error handling and cleanup. - */ -err: - if (out && out != stdout) { - (void)fclose(out), out = (FILE *)0; - if (unlink(outname) < 0 && errno != ENOENT && errno != EINTR) { - perror(outname); - fprintf(stderr, "%s: could not unlink \"%s\"\n", - progname, outname); - } - } - if (in && in != stdin) (void)fclose(in), in = (FILE *)0; - - if (inname && inname != name) free(inname); - if (outname && outname != name) free(outname); - - return -1; -} - -static void version P0() -{ - printf( "%s 1.0, version %s\n", - progname, - "$Id: toast.c,v 1.8 1996/07/02 10:41:04 jutta Exp $" ); -} - -static void help P0() -{ - printf("Usage: %s [-fcpdhvaulsFC] [files...]\n", progname); - printf("\n"); - - printf(" -f force Replace existing files without asking\n"); - printf(" -c cat Write to stdout, do not remove source files\n"); - printf(" -d decode Decode data (default is encode)\n"); - printf(" -p precious Do not delete the source\n"); - printf("\n"); - - printf(" -u u-law Force 8 kHz/8 bit u-law in/output format\n"); - printf(" -s sun .au Force Sun .au u-law in/output format\n"); - printf(" -a A-law Force 8 kHz/8 bit A-law in/output format\n"); - printf(" -l linear Force 16 bit linear in/output format\n"); - printf("\n"); - - printf(" -F fast Sacrifice conformance to performance\n"); - printf(" -C cutoff Ignore most samples during LTP\n"); - printf(" -v version Show version information\n"); - printf(" -h help Print this text\n"); - printf("\n"); -} - - -static void set_format P1((f), struct fmtdesc * f) -{ - if (f_format && f_format != f) { - fprintf( stderr, - "%s: only one of -[uals] is possible (%s -h for help)\n", - progname, progname); - exit(1); - } - - f_format = f; -} - -int main P2((ac, av), int ac, char **av) -{ - int opt; - extern int optind; - extern char * optarg; - - parse_argv0(*av); - - while ((opt = getopt(ac, av, "fcdpvhuaslVFC:")) != EOF) switch (opt) { - - case 'd': f_decode = 1; break; - case 'f': f_force = 1; break; - case 'c': f_cat = 1; break; - case 'p': f_precious = 1; break; - case 'F': f_fast = 1; break; - case 'C': f_ltp_cut = 100; break; -#ifndef NDEBUG - case 'V': f_verbose = 1; break; /* undocumented */ -#endif - - case 'u': set_format( &f_ulaw ); break; - case 'l': set_format( &f_linear ); break; - case 'a': set_format( &f_alaw ); break; - case 's': set_format( &f_audio ); break; - - case 'v': version(); exit(0); - case 'h': help(); exit(0); - - default: - usage: - fprintf(stderr, - "Usage: %s [-fcpdhvuaslFC] [files...] (-h for help)\n", - progname); - exit(1); - } - - f_precious |= f_cat; - - av += optind; - ac -= optind; - - catch_signals(onintr); - - if (ac <= 0) process( (char *)0 ); - else while (ac--) process( *av++ ); - - exit(0); -} diff --git a/third_party/gsm/src/toast_alaw.c b/third_party/gsm/src/toast_alaw.c deleted file mode 100644 index 7799342..0000000 --- a/third_party/gsm/src/toast_alaw.c +++ /dev/null @@ -1,334 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /home/kbs/jutta/src/gsm/gsm-1.0/src/RCS/toast_alaw.c,v 1.2 1996/07/05 17:23:46 jutta Exp $ */ - -#include "toast.h" - -/* toast_alaw.c -- manipulate A-law encoded sound. - */ - -extern FILE * in, * out; - -#define A2S(x) (a2s[ (unsigned char )(x) ]) -#define S2A(x) (s2a[ ((unsigned short)(x)) >> 4 ]) - -static unsigned short a2s[] = { - - 60032, 60288, 59520, 59776, 61056, 61312, 60544, 60800, - 57984, 58240, 57472, 57728, 59008, 59264, 58496, 58752, - 62784, 62912, 62528, 62656, 63296, 63424, 63040, 63168, - 61760, 61888, 61504, 61632, 62272, 62400, 62016, 62144, - 43520, 44544, 41472, 42496, 47616, 48640, 45568, 46592, - 35328, 36352, 33280, 34304, 39424, 40448, 37376, 38400, - 54528, 55040, 53504, 54016, 56576, 57088, 55552, 56064, - 50432, 50944, 49408, 49920, 52480, 52992, 51456, 51968, - 65192, 65208, 65160, 65176, 65256, 65272, 65224, 65240, - 65064, 65080, 65032, 65048, 65128, 65144, 65096, 65112, - 65448, 65464, 65416, 65432, 65512, 65528, 65480, 65496, - 65320, 65336, 65288, 65304, 65384, 65400, 65352, 65368, - 64160, 64224, 64032, 64096, 64416, 64480, 64288, 64352, - 63648, 63712, 63520, 63584, 63904, 63968, 63776, 63840, - 64848, 64880, 64784, 64816, 64976, 65008, 64912, 64944, - 64592, 64624, 64528, 64560, 64720, 64752, 64656, 64688, - 5504, 5248, 6016, 5760, 4480, 4224, 4992, 4736, - 7552, 7296, 8064, 7808, 6528, 6272, 7040, 6784, - 2752, 2624, 3008, 2880, 2240, 2112, 2496, 2368, - 3776, 3648, 4032, 3904, 3264, 3136, 3520, 3392, - 22016, 20992, 24064, 23040, 17920, 16896, 19968, 18944, - 30208, 29184, 32256, 31232, 26112, 25088, 28160, 27136, - 11008, 10496, 12032, 11520, 8960, 8448, 9984, 9472, - 15104, 14592, 16128, 15616, 13056, 12544, 14080, 13568, - 344, 328, 376, 360, 280, 264, 312, 296, - 472, 456, 504, 488, 408, 392, 440, 424, - 88, 72, 120, 104, 24, 8, 56, 40, - 216, 200, 248, 232, 152, 136, 184, 168, - 1376, 1312, 1504, 1440, 1120, 1056, 1248, 1184, - 1888, 1824, 2016, 1952, 1632, 1568, 1760, 1696, - 688, 656, 752, 720, 560, 528, 624, 592, - 944, 912, 1008, 976, 816, 784, 880, 848 - -}; - - -static unsigned char s2a[] = { - - 213,212,215,214,209,208,211,210,221,220,223,222,217,216,219,218, - 197,196,199,198,193,192,195,194,205,204,207,206,201,200,203,202, - 245,245,244,244,247,247,246,246,241,241,240,240,243,243,242,242, - 253,253,252,252,255,255,254,254,249,249,248,248,251,251,250,250, - 229,229,229,229,228,228,228,228,231,231,231,231,230,230,230,230, - 225,225,225,225,224,224,224,224,227,227,227,227,226,226,226,226, - 237,237,237,237,236,236,236,236,239,239,239,239,238,238,238,238, - 233,233,233,233,232,232,232,232,235,235,235,235,234,234,234,234, - 149,149,149,149,149,149,149,149,148,148,148,148,148,148,148,148, - 151,151,151,151,151,151,151,151,150,150,150,150,150,150,150,150, - 145,145,145,145,145,145,145,145,144,144,144,144,144,144,144,144, - 147,147,147,147,147,147,147,147,146,146,146,146,146,146,146,146, - 157,157,157,157,157,157,157,157,156,156,156,156,156,156,156,156, - 159,159,159,159,159,159,159,159,158,158,158,158,158,158,158,158, - 153,153,153,153,153,153,153,153,152,152,152,152,152,152,152,152, - 155,155,155,155,155,155,155,155,154,154,154,154,154,154,154,154, - 133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133, - 132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132, - 135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135, - 134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134, - 129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129, - 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, - 131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131, - 130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130, - 141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141, - 140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140, - 143,143,143,143,143,143,143,143,143,143,143,143,143,143,143,143, - 142,142,142,142,142,142,142,142,142,142,142,142,142,142,142,142, - 137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137, - 136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136, - 139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139, - 138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138, - 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181, - 181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181, - 180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180, - 180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180, - 183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183, - 183,183,183,183,183,183,183,183,183,183,183,183,183,183,183,183, - 182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182, - 182,182,182,182,182,182,182,182,182,182,182,182,182,182,182,182, - 177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177, - 177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177, - 176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, - 176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 179,179,179,179,179,179,179,179,179,179,179,179,179,179,179,179, - 178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178, - 178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178, - 189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189, - 189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189, - 188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188, - 188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188, - 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, - 191,191,191,191,191,191,191,191,191,191,191,191,191,191,191,191, - 190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190, - 190,190,190,190,190,190,190,190,190,190,190,190,190,190,190,190, - 185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185, - 185,185,185,185,185,185,185,185,185,185,185,185,185,185,185,185, - 184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184, - 184,184,184,184,184,184,184,184,184,184,184,184,184,184,184,184, - 187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187, - 187,187,187,187,187,187,187,187,187,187,187,187,187,187,187,187, - 186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186, - 186,186,186,186,186,186,186,186,186,186,186,186,186,186,186,186, - 165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165, - 165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165, - 165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165, - 165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165, - 164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164, - 164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164, - 164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164, - 164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164, - 167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, - 167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, - 167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, - 167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167, - 166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166, - 166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166, - 166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166, - 166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166, - 161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161, - 161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161, - 161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161, - 161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161, - 160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160, - 160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160, - 160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160, - 160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160, - 163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, - 163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, - 163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, - 163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163, - 162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162, - 162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162, - 162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162, - 162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162, - 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173, - 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173, - 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173, - 173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173, - 172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172, - 172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172, - 172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172, - 172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172, - 175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175, - 175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175, - 175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175, - 175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175, - 174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174, - 174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174, - 174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174, - 174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174, - 169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169, - 169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169, - 169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169, - 169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169, - 168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168, - 168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168, - 168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168, - 168,168,168,168,168,168,168,168,168,168,168,168,168,168,168,168, - 171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171, - 171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171, - 171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171, - 171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171, - 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170, - 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170, - 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170, - 170,170,170,170,170,170,170,170,170,170,170,170,170,170,170,170, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, 43, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, 35, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, 33, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, 39, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, 58, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, 57, - 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, 62, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, 63, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, 60, - 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, - 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, 61, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, - 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, - 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, - 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, 53, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, - 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, - 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, - 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, - 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31, - 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, - 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, - 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, - 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, - 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, - 106,106,106,106,107,107,107,107,104,104,104,104,105,105,105,105, - 110,110,110,110,111,111,111,111,108,108,108,108,109,109,109,109, - 98, 98, 98, 98, 99, 99, 99, 99, 96, 96, 96, 96, 97, 97, 97, 97, - 102,102,102,102,103,103,103,103,100,100,100,100,101,101,101,101, - 122,122,123,123,120,120,121,121,126,126,127,127,124,124,125,125, - 114,114,115,115,112,112,113,113,118,118,119,119,116,116,117,117, - 74, 75, 72, 73, 78, 79, 76, 77, 66, 67, 64, 65, 70, 71, 68, 69, - 90, 91, 88, 89, 94, 95, 92, 93, 82, 83, 80, 81, 86, 87, 84, 85 -}; - -int alaw_input P1((buf), gsm_signal * buf) -{ - int i, c; - - for (i = 0; i < 160 && (c = fgetc(in)) != EOF; i++) buf[i] = A2S( c ); - if (c == EOF && ferror(in)) return -1; - return i; -} - -int alaw_output P1((buf), gsm_signal * buf) -{ - int i; - - for (i = 0; i < 160; i++, buf++) - if (fputc( S2A( *buf ), out) == EOF) return -1; - return 0; -} - diff --git a/third_party/gsm/src/toast_audio.c b/third_party/gsm/src/toast_audio.c deleted file mode 100644 index f090f23..0000000 --- a/third_party/gsm/src/toast_audio.c +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/toast_audio.c,v 1.6 1995/03/07 21:21:24 jutta Exp $ */ - -#include "toast.h" - -/* toast_audio -- functions to manipulate SunOS audio files. - * - * This is reverse engineered from our present soundfiles - * and in no way portable, durable or aesthetically pleasing. - */ - -extern FILE * in, * out; -extern char * inname; -extern char * progname; - -extern int (*output) P((gsm_signal *)), - (*input ) P((gsm_signal *)); - -extern int alaw_input P((gsm_signal *)), - ulaw_input P((gsm_signal *)), - linear_input P((gsm_signal *)); - -extern int ulaw_output P((gsm_signal *)); - -static int put_u32 P2((f, u), FILE * f, unsigned long u) -{ - /* Write a 32-bit unsigned value msb first. - */ - if ( putc( (char)((u>>24) & 0x0FF), f) == EOF - || putc( (char)((u>>16) & 0x0FF), f) == EOF - || putc( (char)((u>> 8) & 0x0FF), f) == EOF - || putc( (char)( u & 0x0FF), f) == EOF) return -1; - - return 0; -} - -static int get_u32 P2((f, up), FILE * f, unsigned long * up) -{ - /* Read a 32-bit unsigned value msb first. - */ - int i; - unsigned long u; - - if ( (i = getc(f)) == EOF - || ((u = (unsigned char)i), (i = getc(f)) == EOF) - || ((u = (u<<8)|(unsigned char)i), (i = getc(f)) == EOF) - || ((u = (u<<8)|(unsigned char)i), (i = getc(f)) == EOF)) return -1; - *up = (u<<8)|(unsigned char)i; - return 0; -} - -int audio_init_input P0() -{ - unsigned long len, enc; /* unsigned 32 bits */ - - if ( fgetc(in) != '.' - || fgetc(in) != 's' - || fgetc(in) != 'n' - || fgetc(in) != 'd' - || get_u32( in, &len ) - || get_u32( in, &enc ) /* skip this */ - || get_u32( in, &enc )) { - fprintf(stderr, - "%s: bad (missing?) header in Sun audio file \"%s\";\n\ - Try one of -u, -a, -l instead (%s -h for help).\n", - progname, inname ? inname : "stdin", progname); - return -1; - } - - switch (enc) { - case 1: input = ulaw_input; break; - case 2: input = alaw_input; break; - case 3: input = linear_input; break; - default: - fprintf(stderr, -"%s: warning: file format #%lu for %s not implemented, defaulting to u-law.\n", - progname, enc, inname); - input = ulaw_input; - break; - } - - while (len > 4*4) - if (getc(in) == EOF) { - fprintf(stderr, - "%s: EOF in header of Sun audio file \"%s\";\n\ - Try one of -u, -a, -l instead (%s -h for help).\n", - progname, inname ? inname : "stdin", progname); - return -1; - } - else len--; - - return 0; -} - -int audio_init_output P0() -{ - if ( fputs(".snd", out) == EOF - || put_u32(out, 32) - || put_u32(out, ~(unsigned long)0) - || put_u32(out, 1) - || put_u32(out, 8000) - || put_u32(out, 1) - || put_u32(out, 0) - || put_u32(out, 0)) return -1; - - return 0; -} - diff --git a/third_party/gsm/src/toast_lin.c b/third_party/gsm/src/toast_lin.c deleted file mode 100644 index 7b5f845..0000000 --- a/third_party/gsm/src/toast_lin.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/toast_lin.c,v 1.1 1992/10/28 00:15:50 jutta Exp $ */ - -#include "toast.h" - -/* toast_linear.c -- read and write 16 bit linear sound in host byte order. - */ - -extern FILE *in, *out; - -int linear_input (buf) gsm_signal * buf; -{ - return fread( (char *)buf, sizeof(*buf), 160, in ); -} - -int linear_output P1((buf), gsm_signal * buf) -{ - return -( fwrite( (char *)buf, sizeof(*buf), 160, out ) != 160 ); -} diff --git a/third_party/gsm/src/toast_ulaw.c b/third_party/gsm/src/toast_ulaw.c deleted file mode 100644 index 14ef2d0..0000000 --- a/third_party/gsm/src/toast_ulaw.c +++ /dev/null @@ -1,621 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* $Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/toast_ulaw.c,v 1.1 1992/10/28 00:15:50 jutta Exp $ */ - -#include "toast.h" - -/* toast_ulaw -- functions to manipulate u-law encoded sound. - */ - -extern FILE *in, *out; - -#define U2S(x) (u2s[ (unsigned char)(x) ]) -#define S2U(x) (s2u[ ((unsigned short)(x)) >> 3 ]) - -static unsigned short u2s[] = { - 33280, 34308, 35336, 36364, 37393, 38421, 39449, 40477, - 41505, 42534, 43562, 44590, 45618, 46647, 47675, 48703, - 49474, 49988, 50503, 51017, 51531, 52045, 52559, 53073, - 53587, 54101, 54616, 55130, 55644, 56158, 56672, 57186, - 57572, 57829, 58086, 58343, 58600, 58857, 59114, 59371, - 59628, 59885, 60142, 60399, 60656, 60913, 61171, 61428, - 61620, 61749, 61877, 62006, 62134, 62263, 62392, 62520, - 62649, 62777, 62906, 63034, 63163, 63291, 63420, 63548, - 63645, 63709, 63773, 63838, 63902, 63966, 64030, 64095, - 64159, 64223, 64287, 64352, 64416, 64480, 64544, 64609, - 64657, 64689, 64721, 64753, 64785, 64818, 64850, 64882, - 64914, 64946, 64978, 65010, 65042, 65075, 65107, 65139, - 65163, 65179, 65195, 65211, 65227, 65243, 65259, 65275, - 65291, 65308, 65324, 65340, 65356, 65372, 65388, 65404, - 65416, 65424, 65432, 65440, 65448, 65456, 65464, 65472, - 65480, 65488, 65496, 65504, 65512, 65520, 65528, 0, - 32256, 31228, 30200, 29172, 28143, 27115, 26087, 25059, - 24031, 23002, 21974, 20946, 19918, 18889, 17861, 16833, - 16062, 15548, 15033, 14519, 14005, 13491, 12977, 12463, - 11949, 11435, 10920, 10406, 9892, 9378, 8864, 8350, - 7964, 7707, 7450, 7193, 6936, 6679, 6422, 6165, - 5908, 5651, 5394, 5137, 4880, 4623, 4365, 4108, - 3916, 3787, 3659, 3530, 3402, 3273, 3144, 3016, - 2887, 2759, 2630, 2502, 2373, 2245, 2116, 1988, - 1891, 1827, 1763, 1698, 1634, 1570, 1506, 1441, - 1377, 1313, 1249, 1184, 1120, 1056, 992, 927, - 879, 847, 815, 783, 751, 718, 686, 654, - 622, 590, 558, 526, 494, 461, 429, 397, - 373, 357, 341, 325, 309, 293, 277, 261, - 245, 228, 212, 196, 180, 164, 148, 132, - 120, 112, 104, 96, 88, 80, 72, 64, - 56, 48, 40, 32, 24, 16, 8, 0 -}; - -static unsigned char s2u[] = { -0377,0376,0375,0374,0373,0372,0371,0370,0367,0366,0365,0364,0363,0362,0361, -0360,0357,0357,0356,0356,0355,0355,0354,0354,0353,0353,0352,0352,0351,0351, -0350,0350,0347,0347,0346,0346,0345,0345,0344,0344,0343,0343,0342,0342,0341, -0341,0340,0340,0337,0337,0337,0337,0336,0336,0336,0336,0335,0335,0335,0335, -0334,0334,0334,0334,0333,0333,0333,0333,0332,0332,0332,0332,0331,0331,0331, -0331,0330,0330,0330,0330,0327,0327,0327,0327,0326,0326,0326,0326,0325,0325, -0325,0325,0324,0324,0324,0324,0323,0323,0323,0323,0322,0322,0322,0322,0321, -0321,0321,0321,0320,0320,0320,0320,0317,0317,0317,0317,0317,0317,0317,0317, -0316,0316,0316,0316,0316,0316,0316,0316,0315,0315,0315,0315,0315,0315,0315, -0315,0314,0314,0314,0314,0314,0314,0314,0314,0313,0313,0313,0313,0313,0313, -0313,0313,0312,0312,0312,0312,0312,0312,0312,0312,0311,0311,0311,0311,0311, -0311,0311,0311,0310,0310,0310,0310,0310,0310,0310,0310,0307,0307,0307,0307, -0307,0307,0307,0307,0306,0306,0306,0306,0306,0306,0306,0306,0305,0305,0305, -0305,0305,0305,0305,0305,0304,0304,0304,0304,0304,0304,0304,0304,0303,0303, -0303,0303,0303,0303,0303,0303,0303,0302,0302,0302,0302,0302,0302,0302,0302, -0301,0301,0301,0301,0301,0301,0301,0301,0300,0300,0300,0300,0300,0300,0300, -0300,0277,0277,0277,0277,0277,0277,0277,0277,0277,0277,0277,0277,0277,0277, -0277,0277,0276,0276,0276,0276,0276,0276,0276,0276,0276,0276,0276,0276,0276, -0276,0276,0276,0275,0275,0275,0275,0275,0275,0275,0275,0275,0275,0275,0275, -0275,0275,0275,0275,0274,0274,0274,0274,0274,0274,0274,0274,0274,0274,0274, -0274,0274,0274,0274,0274,0273,0273,0273,0273,0273,0273,0273,0273,0273,0273, -0273,0273,0273,0273,0273,0273,0272,0272,0272,0272,0272,0272,0272,0272,0272, -0272,0272,0272,0272,0272,0272,0272,0271,0271,0271,0271,0271,0271,0271,0271, -0271,0271,0271,0271,0271,0271,0271,0271,0270,0270,0270,0270,0270,0270,0270, -0270,0270,0270,0270,0270,0270,0270,0270,0270,0267,0267,0267,0267,0267,0267, -0267,0267,0267,0267,0267,0267,0267,0267,0267,0267,0266,0266,0266,0266,0266, -0266,0266,0266,0266,0266,0266,0266,0266,0266,0266,0266,0265,0265,0265,0265, -0265,0265,0265,0265,0265,0265,0265,0265,0265,0265,0265,0265,0264,0264,0264, -0264,0264,0264,0264,0264,0264,0264,0264,0264,0264,0264,0264,0264,0263,0263, -0263,0263,0263,0263,0263,0263,0263,0263,0263,0263,0263,0263,0263,0263,0262, -0262,0262,0262,0262,0262,0262,0262,0262,0262,0262,0262,0262,0262,0262,0262, -0262,0261,0261,0261,0261,0261,0261,0261,0261,0261,0261,0261,0261,0261,0261, -0261,0261,0260,0260,0260,0260,0260,0260,0260,0260,0260,0260,0260,0260,0260, -0260,0260,0260,0257,0257,0257,0257,0257,0257,0257,0257,0257,0257,0257,0257, -0257,0257,0257,0257,0257,0257,0257,0257,0257,0257,0257,0257,0257,0257,0257, -0257,0257,0257,0257,0257,0256,0256,0256,0256,0256,0256,0256,0256,0256,0256, -0256,0256,0256,0256,0256,0256,0256,0256,0256,0256,0256,0256,0256,0256,0256, -0256,0256,0256,0256,0256,0256,0256,0255,0255,0255,0255,0255,0255,0255,0255, -0255,0255,0255,0255,0255,0255,0255,0255,0255,0255,0255,0255,0255,0255,0255, -0255,0255,0255,0255,0255,0255,0255,0255,0255,0254,0254,0254,0254,0254,0254, -0254,0254,0254,0254,0254,0254,0254,0254,0254,0254,0254,0254,0254,0254,0254, -0254,0254,0254,0254,0254,0254,0254,0254,0254,0254,0254,0253,0253,0253,0253, -0253,0253,0253,0253,0253,0253,0253,0253,0253,0253,0253,0253,0253,0253,0253, -0253,0253,0253,0253,0253,0253,0253,0253,0253,0253,0253,0253,0253,0252,0252, -0252,0252,0252,0252,0252,0252,0252,0252,0252,0252,0252,0252,0252,0252,0252, -0252,0252,0252,0252,0252,0252,0252,0252,0252,0252,0252,0252,0252,0252,0252, -0251,0251,0251,0251,0251,0251,0251,0251,0251,0251,0251,0251,0251,0251,0251, -0251,0251,0251,0251,0251,0251,0251,0251,0251,0251,0251,0251,0251,0251,0251, -0251,0251,0251,0250,0250,0250,0250,0250,0250,0250,0250,0250,0250,0250,0250, -0250,0250,0250,0250,0250,0250,0250,0250,0250,0250,0250,0250,0250,0250,0250, -0250,0250,0250,0250,0250,0247,0247,0247,0247,0247,0247,0247,0247,0247,0247, -0247,0247,0247,0247,0247,0247,0247,0247,0247,0247,0247,0247,0247,0247,0247, -0247,0247,0247,0247,0247,0247,0247,0246,0246,0246,0246,0246,0246,0246,0246, -0246,0246,0246,0246,0246,0246,0246,0246,0246,0246,0246,0246,0246,0246,0246, -0246,0246,0246,0246,0246,0246,0246,0246,0246,0245,0245,0245,0245,0245,0245, -0245,0245,0245,0245,0245,0245,0245,0245,0245,0245,0245,0245,0245,0245,0245, -0245,0245,0245,0245,0245,0245,0245,0245,0245,0245,0245,0244,0244,0244,0244, -0244,0244,0244,0244,0244,0244,0244,0244,0244,0244,0244,0244,0244,0244,0244, -0244,0244,0244,0244,0244,0244,0244,0244,0244,0244,0244,0244,0244,0243,0243, -0243,0243,0243,0243,0243,0243,0243,0243,0243,0243,0243,0243,0243,0243,0243, -0243,0243,0243,0243,0243,0243,0243,0243,0243,0243,0243,0243,0243,0243,0243, -0242,0242,0242,0242,0242,0242,0242,0242,0242,0242,0242,0242,0242,0242,0242, -0242,0242,0242,0242,0242,0242,0242,0242,0242,0242,0242,0242,0242,0242,0242, -0242,0242,0242,0241,0241,0241,0241,0241,0241,0241,0241,0241,0241,0241,0241, -0241,0241,0241,0241,0241,0241,0241,0241,0241,0241,0241,0241,0241,0241,0241, -0241,0241,0241,0241,0241,0240,0240,0240,0240,0240,0240,0240,0240,0240,0240, -0240,0240,0240,0240,0240,0240,0240,0240,0240,0240,0240,0240,0240,0240,0240, -0240,0240,0240,0240,0240,0240,0240,0237,0237,0237,0237,0237,0237,0237,0237, -0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237, -0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237, -0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237, -0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0237,0236,0236,0236,0236, -0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236, -0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236, -0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236, -0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236,0236, -0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235, -0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235, -0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235, -0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235,0235, -0235,0235,0235,0235,0235,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234, -0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234, -0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234, -0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234,0234, -0234,0234,0234,0234,0234,0234,0234,0234,0234,0233,0233,0233,0233,0233,0233, -0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233, -0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233, -0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233, -0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0233,0232,0232, -0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232, -0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232, -0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232, -0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232,0232, -0232,0232,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231, -0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231, -0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231, -0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231,0231, -0231,0231,0231,0231,0231,0231,0231,0230,0230,0230,0230,0230,0230,0230,0230, -0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230, -0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230, -0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230, -0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0230,0227,0227,0227,0227, -0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227, -0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227, -0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227, -0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227,0227, -0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226, -0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226, -0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226, -0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226,0226, -0226,0226,0226,0226,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225, -0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225, -0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225, -0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225,0225, -0225,0225,0225,0225,0225,0225,0225,0225,0225,0224,0224,0224,0224,0224,0224, -0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224, -0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224, -0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224, -0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0224,0223,0223, -0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223, -0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223, -0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223, -0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223,0223, -0223,0223,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222, -0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222, -0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222, -0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222,0222, -0222,0222,0222,0222,0222,0222,0221,0221,0221,0221,0221,0221,0221,0221,0221, -0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221, -0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221, -0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221, -0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0221,0220,0220,0220,0220, -0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220, -0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220, -0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220, -0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220,0220, -0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217, -0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217, -0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217, -0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217, -0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217, -0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217, -0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217, -0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217,0217, -0217,0217,0217,0217,0217,0217,0217,0217,0217,0216,0216,0216,0216,0216,0216, -0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216, -0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216, -0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216, -0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216, -0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216, -0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216, -0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216, -0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216,0216, -0216,0216,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215, -0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215, -0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215, -0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215, -0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215, -0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215, -0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215, -0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215, -0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0215,0214,0214,0214,0214, -0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214, -0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214, -0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214, -0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214, -0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214, -0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214, -0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214, -0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214,0214, -0214,0214,0214,0214,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213, -0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213, -0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213, -0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213, -0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213, -0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213, -0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213, -0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213, -0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0213,0212,0212, -0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212, -0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212, -0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212, -0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212, -0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212, -0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212, -0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212, -0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212,0212, -0212,0212,0212,0212,0212,0212,0211,0211,0211,0211,0211,0211,0211,0211,0211, -0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211, -0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211, -0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211, -0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211, -0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211, -0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211, -0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211, -0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211,0211, -0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210, -0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210, -0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210, -0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210, -0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210, -0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210, -0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210, -0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210,0210, -0210,0210,0210,0210,0210,0210,0210,0210,0207,0207,0207,0207,0207,0207,0207, -0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207, -0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207, -0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207, -0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207, -0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207, -0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207, -0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207, -0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207,0207, -0207,0207,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206, -0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206, -0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206, -0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206, -0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206, -0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206, -0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206, -0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0206, -0206,0206,0206,0206,0206,0206,0206,0206,0206,0206,0205,0205,0205,0205,0205, -0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205, -0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205, -0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205, -0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205, -0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205, -0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205, -0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205, -0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205,0205, -0205,0205,0205,0205,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204, -0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204, -0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204, -0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204, -0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204, -0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204, -0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204, -0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204, -0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0204,0203,0203,0203, -0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203, -0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203, -0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203, -0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203, -0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203, -0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203, -0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203, -0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203,0203, -0203,0203,0203,0203,0203,0203,0202,0202,0202,0202,0202,0202,0202,0202,0202, -0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202, -0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202, -0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202, -0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202, -0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202, -0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202, -0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202, -0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0202,0201, -0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201, -0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201, -0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201, -0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201, -0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201, -0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201, -0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201, -0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201,0201, -0201,0201,0201,0201,0201,0201,0201,0201,0200,0200,0200,0200,0200,0200,0200, -0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200, -0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200, -0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200, -0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200, -0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200, -0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200, -0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200, -0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200,0200, -0200,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, -0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, -0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, -0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, -0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, -0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, -0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, -0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000,0000, -0000,0000,0000,0000,0000,0000,0000,0000,0000,0001,0001,0001,0001,0001,0001, -0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001, -0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001, -0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001, -0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001, -0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001, -0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001, -0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001, -0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001,0001, -0001,0001,0001,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002, -0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002, -0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002, -0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002, -0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002, -0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002, -0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002, -0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002, -0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0002,0003,0003,0003,0003, -0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003, -0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003, -0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003, -0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003, -0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003, -0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003, -0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003, -0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003,0003, -0003,0003,0003,0003,0003,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004, -0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004, -0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004, -0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004, -0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004, -0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004, -0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004, -0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004, -0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0004,0005,0005, -0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005, -0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005, -0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005, -0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005, -0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005, -0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005, -0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005, -0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005,0005, -0005,0005,0005,0005,0005,0005,0005,0006,0006,0006,0006,0006,0006,0006,0006, -0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006, -0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006, -0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006, -0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006, -0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006, -0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006, -0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006, -0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006,0006, -0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007, -0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007, -0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007, -0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007, -0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007, -0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007, -0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007, -0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007,0007, -0007,0007,0007,0007,0007,0007,0007,0007,0007,0010,0010,0010,0010,0010,0010, -0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010, -0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010, -0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010, -0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010, -0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010, -0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010, -0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010, -0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010,0010, -0010,0010,0010,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011, -0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011, -0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011, -0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011, -0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011, -0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011, -0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011, -0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011, -0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0011,0012,0012,0012,0012, -0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012, -0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012, -0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012, -0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012, -0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012, -0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012, -0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012, -0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012,0012, -0012,0012,0012,0012,0012,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013, -0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013, -0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013, -0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013, -0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013, -0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013, -0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013, -0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013, -0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0013,0014,0014, -0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014, -0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014, -0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014, -0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014, -0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014, -0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014, -0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014, -0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014,0014, -0014,0014,0014,0014,0014,0014,0014,0015,0015,0015,0015,0015,0015,0015,0015, -0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015, -0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015, -0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015, -0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015, -0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015, -0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015, -0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015, -0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015,0015, -0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016, -0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016, -0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016, -0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016, -0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016, -0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016, -0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016, -0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016,0016, -0016,0016,0016,0016,0016,0016,0016,0016,0016,0017,0017,0017,0017,0017,0017, -0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017, -0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017, -0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017, -0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017, -0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017, -0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017, -0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017, -0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017,0017, -0017,0017,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020, -0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020, -0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020, -0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020,0020, -0020,0020,0020,0020,0020,0020,0021,0021,0021,0021,0021,0021,0021,0021,0021, -0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021, -0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021, -0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021, -0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0021,0022,0022,0022,0022, -0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022, -0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022, -0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022, -0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022,0022, -0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023, -0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023, -0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023, -0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023,0023, -0023,0023,0023,0023,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024, -0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024, -0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024, -0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024,0024, -0024,0024,0024,0024,0024,0024,0024,0024,0024,0025,0025,0025,0025,0025,0025, -0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025, -0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025, -0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025, -0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0025,0026,0026, -0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026, -0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026, -0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026, -0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026,0026, -0026,0026,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027, -0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027, -0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027, -0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027,0027, -0027,0027,0027,0027,0027,0027,0030,0030,0030,0030,0030,0030,0030,0030,0030, -0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030, -0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030, -0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030, -0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0030,0031,0031,0031,0031, -0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031, -0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031, -0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031, -0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031,0031, -0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032, -0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032, -0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032, -0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032,0032, -0032,0032,0032,0032,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033, -0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033, -0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033, -0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033,0033, -0033,0033,0033,0033,0033,0033,0033,0033,0034,0034,0034,0034,0034,0034,0034, -0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034, -0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034, -0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034, -0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0034,0035,0035, -0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035, -0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035, -0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035, -0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035,0035, -0035,0035,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036, -0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036, -0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036, -0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036,0036, -0036,0036,0036,0036,0036,0036,0037,0037,0037,0037,0037,0037,0037,0037,0037, -0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037, -0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037, -0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0037, -0037,0037,0037,0037,0037,0037,0037,0037,0037,0037,0040,0040,0040,0040,0040, -0040,0040,0040,0040,0040,0040,0040,0040,0040,0040,0040,0040,0040,0040,0040, -0040,0040,0040,0040,0040,0040,0040,0040,0040,0040,0040,0040,0040,0041,0041, -0041,0041,0041,0041,0041,0041,0041,0041,0041,0041,0041,0041,0041,0041,0041, -0041,0041,0041,0041,0041,0041,0041,0041,0041,0041,0041,0041,0041,0041,0041, -0042,0042,0042,0042,0042,0042,0042,0042,0042,0042,0042,0042,0042,0042,0042, -0042,0042,0042,0042,0042,0042,0042,0042,0042,0042,0042,0042,0042,0042,0042, -0042,0042,0043,0043,0043,0043,0043,0043,0043,0043,0043,0043,0043,0043,0043, -0043,0043,0043,0043,0043,0043,0043,0043,0043,0043,0043,0043,0043,0043,0043, -0043,0043,0043,0043,0044,0044,0044,0044,0044,0044,0044,0044,0044,0044,0044, -0044,0044,0044,0044,0044,0044,0044,0044,0044,0044,0044,0044,0044,0044,0044, -0044,0044,0044,0044,0044,0044,0045,0045,0045,0045,0045,0045,0045,0045,0045, -0045,0045,0045,0045,0045,0045,0045,0045,0045,0045,0045,0045,0045,0045,0045, -0045,0045,0045,0045,0045,0045,0045,0045,0046,0046,0046,0046,0046,0046,0046, -0046,0046,0046,0046,0046,0046,0046,0046,0046,0046,0046,0046,0046,0046,0046, -0046,0046,0046,0046,0046,0046,0046,0046,0046,0046,0047,0047,0047,0047,0047, -0047,0047,0047,0047,0047,0047,0047,0047,0047,0047,0047,0047,0047,0047,0047, -0047,0047,0047,0047,0047,0047,0047,0047,0047,0047,0047,0047,0047,0050,0050, -0050,0050,0050,0050,0050,0050,0050,0050,0050,0050,0050,0050,0050,0050,0050, -0050,0050,0050,0050,0050,0050,0050,0050,0050,0050,0050,0050,0050,0050,0050, -0051,0051,0051,0051,0051,0051,0051,0051,0051,0051,0051,0051,0051,0051,0051, -0051,0051,0051,0051,0051,0051,0051,0051,0051,0051,0051,0051,0051,0051,0051, -0051,0051,0052,0052,0052,0052,0052,0052,0052,0052,0052,0052,0052,0052,0052, -0052,0052,0052,0052,0052,0052,0052,0052,0052,0052,0052,0052,0052,0052,0052, -0052,0052,0052,0052,0053,0053,0053,0053,0053,0053,0053,0053,0053,0053,0053, -0053,0053,0053,0053,0053,0053,0053,0053,0053,0053,0053,0053,0053,0053,0053, -0053,0053,0053,0053,0053,0053,0054,0054,0054,0054,0054,0054,0054,0054,0054, -0054,0054,0054,0054,0054,0054,0054,0054,0054,0054,0054,0054,0054,0054,0054, -0054,0054,0054,0054,0054,0054,0054,0054,0055,0055,0055,0055,0055,0055,0055, -0055,0055,0055,0055,0055,0055,0055,0055,0055,0055,0055,0055,0055,0055,0055, -0055,0055,0055,0055,0055,0055,0055,0055,0055,0055,0056,0056,0056,0056,0056, -0056,0056,0056,0056,0056,0056,0056,0056,0056,0056,0056,0056,0056,0056,0056, -0056,0056,0056,0056,0056,0056,0056,0056,0056,0056,0056,0056,0057,0057,0057, -0057,0057,0057,0057,0057,0057,0057,0057,0057,0057,0057,0057,0057,0057,0057, -0057,0057,0057,0057,0057,0057,0057,0057,0057,0057,0057,0057,0057,0057,0057, -0060,0060,0060,0060,0060,0060,0060,0060,0060,0060,0060,0060,0060,0060,0060, -0060,0061,0061,0061,0061,0061,0061,0061,0061,0061,0061,0061,0061,0061,0061, -0061,0061,0062,0062,0062,0062,0062,0062,0062,0062,0062,0062,0062,0062,0062, -0062,0062,0062,0063,0063,0063,0063,0063,0063,0063,0063,0063,0063,0063,0063, -0063,0063,0063,0063,0064,0064,0064,0064,0064,0064,0064,0064,0064,0064,0064, -0064,0064,0064,0064,0064,0065,0065,0065,0065,0065,0065,0065,0065,0065,0065, -0065,0065,0065,0065,0065,0065,0066,0066,0066,0066,0066,0066,0066,0066,0066, -0066,0066,0066,0066,0066,0066,0066,0067,0067,0067,0067,0067,0067,0067,0067, -0067,0067,0067,0067,0067,0067,0067,0067,0070,0070,0070,0070,0070,0070,0070, -0070,0070,0070,0070,0070,0070,0070,0070,0070,0071,0071,0071,0071,0071,0071, -0071,0071,0071,0071,0071,0071,0071,0071,0071,0071,0072,0072,0072,0072,0072, -0072,0072,0072,0072,0072,0072,0072,0072,0072,0072,0072,0073,0073,0073,0073, -0073,0073,0073,0073,0073,0073,0073,0073,0073,0073,0073,0073,0074,0074,0074, -0074,0074,0074,0074,0074,0074,0074,0074,0074,0074,0074,0074,0074,0075,0075, -0075,0075,0075,0075,0075,0075,0075,0075,0075,0075,0075,0075,0075,0075,0075, -0076,0076,0076,0076,0076,0076,0076,0076,0076,0076,0076,0076,0076,0076,0076, -0076,0077,0077,0077,0077,0077,0077,0077,0077,0077,0077,0077,0077,0077,0077, -0077,0077,0100,0100,0100,0100,0100,0100,0100,0100,0101,0101,0101,0101,0101, -0101,0101,0101,0102,0102,0102,0102,0102,0102,0102,0102,0103,0103,0103,0103, -0103,0103,0103,0103,0104,0104,0104,0104,0104,0104,0104,0104,0105,0105,0105, -0105,0105,0105,0105,0105,0106,0106,0106,0106,0106,0106,0106,0106,0107,0107, -0107,0107,0107,0107,0107,0107,0110,0110,0110,0110,0110,0110,0110,0110,0111, -0111,0111,0111,0111,0111,0111,0111,0112,0112,0112,0112,0112,0112,0112,0112, -0113,0113,0113,0113,0113,0113,0113,0113,0114,0114,0114,0114,0114,0114,0114, -0114,0115,0115,0115,0115,0115,0115,0115,0115,0116,0116,0116,0116,0116,0116, -0116,0116,0117,0117,0117,0117,0117,0117,0117,0117,0120,0120,0120,0120,0121, -0121,0121,0121,0122,0122,0122,0122,0123,0123,0123,0123,0124,0124,0124,0124, -0125,0125,0125,0125,0126,0126,0126,0126,0127,0127,0127,0127,0130,0130,0130, -0130,0131,0131,0131,0131,0132,0132,0132,0132,0133,0133,0133,0133,0134,0134, -0134,0134,0135,0135,0135,0135,0136,0136,0136,0136,0137,0137,0137,0137,0140, -0140,0141,0141,0142,0142,0143,0143,0144,0144,0145,0145,0146,0146,0147,0147, -0150,0150,0150,0151,0151,0152,0152,0153,0153,0154,0154,0155,0155,0156,0156, -0157,0157,0160,0161,0162,0163,0164,0165,0166,0167,0170,0171,0172,0173,0174, -0175,0176 -}; - -int ulaw_input P1((buf), gsm_signal * buf) -{ - int i, c; - - for (i = 0; i < 160 && (c = fgetc(in)) != EOF; i++) buf[i] = U2S(c); - if (c == EOF && ferror(in)) return -1; - return i; -} - -int ulaw_output P1((buf), gsm_signal * buf) -{ - int i; - - for(i = 0; i < 160; i++, buf++) - if (fputc( (char)S2U( (unsigned short)*buf ), out) == EOF) - return -1; - return 0; -} diff --git a/third_party/gsm/tls/bitter.c b/third_party/gsm/tls/bitter.c deleted file mode 100644 index 602d8d6..0000000 --- a/third_party/gsm/tls/bitter.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/bitter.c,v 1.1 1992/10/28 00:28:39 jutta Exp $*/ - -/* Generate code to pack a bit array from a name:#bits description */ - -#include -#include "taste.h" -#include "proto.h" - -void write_code P2((s_spex, n_spex), struct spex * s_spex, int n_spex) -{ - struct spex * sp = s_spex; - int bits = 8; - int vars; - - if (!n_spex) return; - - vars = sp->varsize; - - while (n_spex) { - - if (bits == 8) printf("\t*c++ = "); - else printf("\t | "); - - if (vars == bits) { - - printf( (bits==8? "%s & 0x%lX;\n" : "(%s & 0x%lX);\n"), - sp->var, - ~(0xfffffffe << (bits - 1))); - if (!-- n_spex) break; - sp++; - - vars = sp->varsize; - bits = 8; - - } else if (vars < bits) { - - printf( "((%s & 0x%lX) << %d)", - sp->var, - ~(0xfffffffe << (vars - 1)), - bits - vars); - bits -= vars; - if (!--n_spex) { - puts(";"); - break; - } - else putchar('\n'); - sp++; - vars = sp->varsize; - - } else { - printf("((%s >> %d) & 0x%X);\n", - sp->var, - vars - bits, - ~(0xfffffffe << (bits - 1))); - - vars -= bits; - bits = 8; - } - } -} diff --git a/third_party/gsm/tls/bitter.dta b/third_party/gsm/tls/bitter.dta deleted file mode 100644 index d1c42e4..0000000 --- a/third_party/gsm/tls/bitter.dta +++ /dev/null @@ -1,90 +0,0 @@ -; -; Copyright 1992 by Jutta Degener and Carsten Bormann, Technische -; Universitaet Berlin. See the accompanying file "COPYRIGHT" for -; details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. -; -; -; Variable Size - -GSM_MAGIC 4 - -LARc[0] 6 -LARc[1] 6 -LARc[2] 5 -LARc[3] 5 -LARc[4] 4 -LARc[5] 4 -LARc[6] 3 -LARc[7] 3 - -Nc[0] 7 -bc[0] 2 -Mc[0] 2 -xmaxc[0] 6 -xmc[0] 3 -xmc[1] 3 -xmc[2] 3 -xmc[3] 3 -xmc[4] 3 -xmc[5] 3 -xmc[6] 3 -xmc[7] 3 -xmc[8] 3 -xmc[9] 3 -xmc[10] 3 -xmc[11] 3 -xmc[12] 3 - -Nc[1] 7 -bc[1] 2 -Mc[1] 2 -xmaxc[1] 6 -xmc[13] 3 -xmc[14] 3 -xmc[15] 3 -xmc[16] 3 -xmc[17] 3 -xmc[18] 3 -xmc[19] 3 -xmc[20] 3 -xmc[21] 3 -xmc[22] 3 -xmc[23] 3 -xmc[24] 3 -xmc[25] 3 - -Nc[2] 7 -bc[2] 2 -Mc[2] 2 -xmaxc[2] 6 -xmc[26] 3 -xmc[27] 3 -xmc[28] 3 -xmc[29] 3 -xmc[30] 3 -xmc[31] 3 -xmc[32] 3 -xmc[33] 3 -xmc[34] 3 -xmc[35] 3 -xmc[36] 3 -xmc[37] 3 -xmc[38] 3 - -Nc[3] 7 -bc[3] 2 -Mc[3] 2 -xmaxc[3] 6 -xmc[39] 3 -xmc[40] 3 -xmc[41] 3 -xmc[42] 3 -xmc[43] 3 -xmc[44] 3 -xmc[45] 3 -xmc[46] 3 -xmc[47] 3 -xmc[48] 3 -xmc[49] 3 -xmc[50] 3 -xmc[51] 3 diff --git a/third_party/gsm/tls/ginger.c b/third_party/gsm/tls/ginger.c deleted file mode 100644 index d830e20..0000000 --- a/third_party/gsm/tls/ginger.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 1996 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header*/ - -/* Generate code to pack a bit array from a name:#bits description */ - -#include -#include "taste.h" -#include "proto.h" -#include - -/* This module is the opposite of sour. Sweet was already taken, - * that's why it's called ginger. (Add one point if that reminds - * you of Gary Larson.) - */ - -#define WORD_BITS 16 /* sizeof(uword) * CHAR_BIT on the - * target architecture---if this isn't 16, - * you're in trouble with this library anyway. - */ - -#define BYTE_BITS 8 /* CHAR_BIT on the target architecture--- - * if this isn't 8, you're in *deep* trouble. - */ - -void write_code P2((s_spex, n_spex), struct spex * s_spex, int n_spex) -{ - struct spex * sp = s_spex; - int n_in = 0; - - printf("uword sr = 0;\n"); - - for (; n_spex > 0; n_spex--, sp++) { - - while (n_in < sp->varsize) { - if (n_in) printf("sr |= (uword)*c++ << %d;\n", n_in); - else printf("sr = *c++;\n"); - n_in += BYTE_BITS; - } - - printf("%s = sr & %#x; sr >>= %d;\n", - sp->var, ~(~0U << sp->varsize), sp->varsize); - - n_in -= sp->varsize; - } - - if (n_in > 0) { - fprintf(stderr, "%d bits left over\n", n_in); - } -} diff --git a/third_party/gsm/tls/sour.c b/third_party/gsm/tls/sour.c deleted file mode 100644 index b6932e6..0000000 --- a/third_party/gsm/tls/sour.c +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright 1996 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header*/ - -/* Generate code to pack a bit array from a name:#bits description, - * WAV #49 style. - */ - -#include -#include "taste.h" -#include "proto.h" -#include - -/* This module goes back to one Jeff Chilton used for his implementation - * of the #49 WAV GSM format. (In his original patch 8, it replaced - * bitter.c.) - * - * In Microsoft's WAV #49 version of the GSM format, two 32 1/2 - * byte GSM frames are packed together to make one WAV frame, and - * the GSM parameters are packed into bytes right-to-left rather - * than left-to-right. - * - * That is, where toast's GSM format writes - * - * aaaaaabb bbbbcccc cdddddee ... - * ___1____ ___2____ ___3____ - * - * for parameters a (6 bits), b (6 bits), c (5 bits), d (5 bits), e .. - * the WAV format has - * - * bbaaaaaa ccccbbbb eedddddc ... - * ___1____ ___2____ ___3____ - * - * (This format looks a lot prettier if one pictures octets coming - * in through a fifo queue from the left, rather than waiting in the - * right-hand remainder of a C array.) - */ - -#define WORD_BITS 16 /* sizeof(uword) * CHAR_BIT on the - * target architecture---if this isn't 16, - * you're in trouble with this library anyway. - */ - -#define BYTE_BITS 8 /* CHAR_BIT on the target architecture--- - * if this isn't 8, you're in *deep* trouble. - */ - -void write_code P2((s_spex, n_spex), struct spex * s_spex, int n_spex) -{ - struct spex * sp = s_spex; - int n_in = 0; - - printf("uword sr = 0;\n"); - - for (; n_spex > 0; n_spex--, sp++) { - - /* insert old - * new var value unused - * here - * - * [____________xxxxxx**********] - * - * <----- n_in ------> - */ - printf("sr = sr >> %d | %s << %d;\n", - sp->varsize, - sp->var, - WORD_BITS - sp->varsize); - - n_in += sp->varsize; - - while (n_in >= BYTE_BITS) { - printf("*c++ = sr >> %d;\n", - WORD_BITS - n_in); - n_in -= BYTE_BITS; - } - } - - while (n_in >= BYTE_BITS) { - printf("*c++ = sr >> %d;\n", WORD_BITS - n_in); - n_in -= BYTE_BITS; - } - - if (n_in > 0) { - fprintf(stderr, "warning: %d bits left over\n", n_in); - } -} diff --git a/third_party/gsm/tls/sour1.dta b/third_party/gsm/tls/sour1.dta deleted file mode 100644 index 770b24c..0000000 --- a/third_party/gsm/tls/sour1.dta +++ /dev/null @@ -1,88 +0,0 @@ -; -; Copyright 1992 by Jutta Degener and Carsten Bormann, Technische -; Universitaet Berlin. See the accompanying file "COPYRIGHT" for -; details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. -; -; -; Variable Size - -LARc[0] 6 -LARc[1] 6 -LARc[2] 5 -LARc[3] 5 -LARc[4] 4 -LARc[5] 4 -LARc[6] 3 -LARc[7] 3 - -Nc[0] 7 -bc[0] 2 -Mc[0] 2 -xmaxc[0] 6 -xmc[0] 3 -xmc[1] 3 -xmc[2] 3 -xmc[3] 3 -xmc[4] 3 -xmc[5] 3 -xmc[6] 3 -xmc[7] 3 -xmc[8] 3 -xmc[9] 3 -xmc[10] 3 -xmc[11] 3 -xmc[12] 3 - -Nc[1] 7 -bc[1] 2 -Mc[1] 2 -xmaxc[1] 6 -xmc[13] 3 -xmc[14] 3 -xmc[15] 3 -xmc[16] 3 -xmc[17] 3 -xmc[18] 3 -xmc[19] 3 -xmc[20] 3 -xmc[21] 3 -xmc[22] 3 -xmc[23] 3 -xmc[24] 3 -xmc[25] 3 - -Nc[2] 7 -bc[2] 2 -Mc[2] 2 -xmaxc[2] 6 -xmc[26] 3 -xmc[27] 3 -xmc[28] 3 -xmc[29] 3 -xmc[30] 3 -xmc[31] 3 -xmc[32] 3 -xmc[33] 3 -xmc[34] 3 -xmc[35] 3 -xmc[36] 3 -xmc[37] 3 -xmc[38] 3 - -Nc[3] 7 -bc[3] 2 -Mc[3] 2 -xmaxc[3] 6 -xmc[39] 3 -xmc[40] 3 -xmc[41] 3 -xmc[42] 3 -xmc[43] 3 -xmc[44] 3 -xmc[45] 3 -xmc[46] 3 -xmc[47] 3 -xmc[48] 3 -xmc[49] 3 -xmc[50] 3 -xmc[51] 3 diff --git a/third_party/gsm/tls/sour2.dta b/third_party/gsm/tls/sour2.dta deleted file mode 100644 index f56545c..0000000 --- a/third_party/gsm/tls/sour2.dta +++ /dev/null @@ -1,90 +0,0 @@ -; -; Copyright 1992 by Jutta Degener and Carsten Bormann, Technische -; Universitaet Berlin. See the accompanying file "COPYRIGHT" for -; details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. -; -; -; Variable Size - -g->chain 4 - -LARc[0] 6 -LARc[1] 6 -LARc[2] 5 -LARc[3] 5 -LARc[4] 4 -LARc[5] 4 -LARc[6] 3 -LARc[7] 3 - -Nc[0] 7 -bc[0] 2 -Mc[0] 2 -xmaxc[0] 6 -xmc[0] 3 -xmc[1] 3 -xmc[2] 3 -xmc[3] 3 -xmc[4] 3 -xmc[5] 3 -xmc[6] 3 -xmc[7] 3 -xmc[8] 3 -xmc[9] 3 -xmc[10] 3 -xmc[11] 3 -xmc[12] 3 - -Nc[1] 7 -bc[1] 2 -Mc[1] 2 -xmaxc[1] 6 -xmc[13] 3 -xmc[14] 3 -xmc[15] 3 -xmc[16] 3 -xmc[17] 3 -xmc[18] 3 -xmc[19] 3 -xmc[20] 3 -xmc[21] 3 -xmc[22] 3 -xmc[23] 3 -xmc[24] 3 -xmc[25] 3 - -Nc[2] 7 -bc[2] 2 -Mc[2] 2 -xmaxc[2] 6 -xmc[26] 3 -xmc[27] 3 -xmc[28] 3 -xmc[29] 3 -xmc[30] 3 -xmc[31] 3 -xmc[32] 3 -xmc[33] 3 -xmc[34] 3 -xmc[35] 3 -xmc[36] 3 -xmc[37] 3 -xmc[38] 3 - -Nc[3] 7 -bc[3] 2 -Mc[3] 2 -xmaxc[3] 6 -xmc[39] 3 -xmc[40] 3 -xmc[41] 3 -xmc[42] 3 -xmc[43] 3 -xmc[44] 3 -xmc[45] 3 -xmc[46] 3 -xmc[47] 3 -xmc[48] 3 -xmc[49] 3 -xmc[50] 3 -xmc[51] 3 diff --git a/third_party/gsm/tls/sweet.c b/third_party/gsm/tls/sweet.c deleted file mode 100644 index 6a6fb29..0000000 --- a/third_party/gsm/tls/sweet.c +++ /dev/null @@ -1,66 +0,0 @@ - /* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/sweet.c,v 1.2 1996/07/02 10:15:53 jutta Exp $*/ - -/* Generate code to unpack a bit array from name:#bits description */ - -#include -#include "taste.h" -#include "proto.h" - -void write_code P2((s_spex, n_spex), struct spex * s_spex, int n_spex) -{ - struct spex * sp = s_spex; - int bits = 8; - int vars; - - if (!n_spex) return; - - vars = sp->varsize; - - while (n_spex) { - - if (vars == sp->varsize) { - printf("\t%s = ", sp->var); - } else printf("\t%s |= ", sp->var); - - if (vars == bits) { - - if (bits == 8) printf( "*c++;\n" ); - else printf( "*c++ & 0x%lX;\n", - ~(0xfffffffe << (bits - 1)) ); - - if (!-- n_spex) break; - sp++; - vars = sp->varsize; - bits = 8; - - } else if (vars < bits) { - - printf( "(*c >> %d) & 0x%lX;\n", - bits - vars, - ~(0xfffffffe << (vars - 1))); - - bits -= vars; - if (!--n_spex) break; - sp++; - vars = sp->varsize; - - } else { - /* vars > bits. We're eating lower-all of c, - * but we must shift it. - */ - printf( "(*c++ & 0x%X) << %d;\n", - ~(0xfffffffe << (bits - 1)), - vars - bits ); - - vars -= bits; - bits = 8; - } - } -} - diff --git a/third_party/gsm/tls/taste.c b/third_party/gsm/tls/taste.c deleted file mode 100644 index 4bc84ad..0000000 --- a/third_party/gsm/tls/taste.c +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/taste.c,v 1.1 1992/10/28 00:28:39 jutta Exp $*/ - -#include -#include -#include - -#include "config.h" - -#ifdef HAS_STDLIB_H -# include -#else -#include "proto.h" -# ifdef HAS_MALLOC_H -# include -# else - extern char * malloc P((char *)), * realloc P((char *,int)); -# endif - extern int exit P((int)); -#endif - -#include "proto.h" - -/* - * common code to sweet.c and bitter.c: read the name:#bits description. - */ - -#include "taste.h" - -static struct spex * s_spex; -static int n_spex, m_spex; - -extern void write_code P((struct spex *, int)); - -char * strsave P1((str), char * str) /* strdup() + errors */ -{ - int n = strlen(str) + 1; - char * s = malloc(n); - if (!s) { - fprintf(stderr, "Failed to malloc %d bytes, abort\n", - strlen(str) + 1); - exit(1); - } - return memcpy(s, str, n); -} - -struct spex * new_spex P0() -{ - if (n_spex >= m_spex) { - m_spex += 500; - if (!(s_spex = (struct spex *)(n_spex - ? realloc((char *)s_spex, m_spex * sizeof(*s_spex)) - : malloc( m_spex * sizeof(*s_spex))))) { - fprintf(stderr, "Failed to malloc %d bytes, abort\n", - m_spex * sizeof(*s_spex)); - exit(1); - } - } - return s_spex + n_spex; -} - -char * strtek P2((str, sep), char * str, char * sep) { - - static char * S = (char *)0; - char * c, * base; - - if (str) S = str; - - if (!S || !*S) return (char *)0; - - /* Skip delimiters. - */ - while (*S) { - for (c = sep; *c && *c != *S; c++) ; - if (*c) *S++ = 0; - else break; - } - - base = S; - - /* Skip non-delimiters. - */ - for (base = S; *S; S++) { - - for (c = sep; *c; c++) - if (*c == *S) { - *S++ = 0; - return base; - } - } - - return base == S ? (char *)0 : base; -} - -int read_spex P0() -{ - char buf[200]; - char * s, *t; - struct spex * sp = s_spex; - - while (fgets(buf, sizeof buf, stdin)) { - - char * nl; - - if (nl = strchr(buf, '\n')) - *nl = '\0'; - - if (!*buf || *buf == ';') continue; - s = strtek(buf, " \t"); - if (!s) { - fprintf(stderr, "? %s\n", buf); - continue; - } - sp = new_spex(); - sp->var = strsave(s); - s = strtek((char*)0, " \t"); - if (!s) { - fprintf(stderr, "varsize?\n"); - continue; - } - sp->varsize = strtol(s, (char **)0, 0); - n_spex++; - } - - return sp - s_spex; -} - -int main P0() -{ - read_spex(); - write_code(s_spex, n_spex); - - exit(0); -} diff --git a/third_party/gsm/tls/taste.h b/third_party/gsm/tls/taste.h deleted file mode 100644 index 2fc85ef..0000000 --- a/third_party/gsm/tls/taste.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/* - * common code to sweet.c and bitter.c - */ - -#ifndef TASTE_H -#define TASTE_H - -struct spex { - - char * var; - int varsize; -} ; - -#endif /* TASTE_H */ diff --git a/third_party/gsm/tst/cod2lin.c b/third_party/gsm/tst/cod2lin.c deleted file mode 100644 index 07a9510..0000000 --- a/third_party/gsm/tst/cod2lin.c +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/cod2lin.c,v 1.2 1996/07/02 14:33:10 jutta Exp jutta $*/ - -#include -#include - -#include "gsm.h" -#include "proto.h" - -char * pname; - -int debug = 0; -int verbosity = 0; -int fast = 0; -int wav = 0; -int error = 0; - -usage P0() -{ - fprintf(stderr, "Usage: %s [-vwF] [files...]\n", pname); - exit(1); -} - -void process P2((f, filename), FILE * f, char * filename) -{ - gsm_frame buf; - gsm_signal source[160]; - - int cc; - gsm r; - - (void)memset(source, 0x00, sizeof(source)); - - if (!(r = gsm_create())) { - perror("gsm_create"); - error = 1; - return ; - } - gsm_option(r, GSM_OPT_VERBOSE, &verbosity); - gsm_option(r, GSM_OPT_FAST, &fast); - gsm_option(r, GSM_OPT_WAV49, &wav); - for (;;) { - cc = fread((char *)source, sizeof(*source), 76, f); - if (cc == 0) { - gsm_destroy(r); - return; - } - if (cc != 76) { - error = 1; - fprintf(stderr, - "%s: %s -- %d trailing bytes ignored\n", - pname, filename, cc); - gsm_destroy(r); - return; - } - - gsm_implode(r, source, buf); - gsm_decode(r, buf, source); - - if (write(1, source, sizeof(source)) != sizeof(source)) { - perror("write"); - error = 1; - gsm_destroy(r); - return; - } - } -} - -main P2((ac, av), int ac, char ** av) -{ - int opt; - extern char * optarg; - extern int optind; - - FILE * f; - - if (!(pname = av[0])) pname = "cod2out"; - - while ((opt = getopt(ac, av, "vwF")) != EOF) switch (opt) { - case 'v': verbosity++; break; - case 'w': wav++; break; - case 'F': fast++; break; - default: usage(); - } - - ac -= optind; - av += optind; - - if (!ac) process(stdin, "*stdin*"); - else for (; *av; av++) { - if (!(f = fopen(*av, "r"))) perror(*av); - else { - process(f, *av); - fclose(f); - } - } - - exit(error); -} diff --git a/third_party/gsm/tst/cod2txt.c b/third_party/gsm/tst/cod2txt.c deleted file mode 100644 index 71c362e..0000000 --- a/third_party/gsm/tst/cod2txt.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/cod2txt.c,v 1.1 1994/10/21 20:52:11 jutta Exp $*/ - -#include -#include - -#include "gsm.h" -#include "proto.h" - -char * pname; - -int debug = 0; -int verbosity = 0; -int error = 0; - -usage P0() -{ - fprintf(stderr, "Usage: %s [files...]\n", pname); - exit(1); -} - -void process P2((f, filename), FILE * f, char * filename) -{ - gsm_frame buf; - gsm_signal source[160]; - - int cc; - gsm r; - int nr=0; - - (void)memset(source, 0, sizeof(source)); - - if (!(r = gsm_create())) { - perror("gsm_create"); - error = 1; - return ; - } - gsm_option(r, GSM_OPT_VERBOSE, &verbosity); - for (;;) { - cc = fread((char *)source, sizeof(*source), 76, f); - if (cc == 0) { - gsm_destroy(r); - return; - } - if (cc != 76) { - error = 1; - fprintf(stderr, - "%s: %s -- %d trailing bytes ignored\n", - pname, filename, cc); - gsm_destroy(r); - return; - } - - gsm_implode(r, source, buf); - printf("[%d] ", ++nr); - if (gsm_print(stdout, r, buf)) { - fprintf(stderr, - "%s: %s: bad magic\n", pname, filename); - gsm_destroy(r); - return; - - } - } -} - -main P2((ac, av), int ac, char ** av) -{ - int opt; - extern char * optarg; - extern int optind; - - FILE * f; - - if (!(pname = av[0])) pname = "cod2txt"; - - ac--; - av++; - - if (!ac) process(stdin, "*stdin*"); - else for (; *av; av++) { - if (!(f = fopen(*av, "r"))) perror(*av); - else { - process(f, *av); - fclose(f); - } - } - - exit(error); -} diff --git a/third_party/gsm/tst/gsm2cod.c b/third_party/gsm/tst/gsm2cod.c deleted file mode 100644 index f2e7c2c..0000000 --- a/third_party/gsm/tst/gsm2cod.c +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/gsm2cod.c,v 1.1 1994/10/21 20:52:11 jutta Exp $*/ - -#include -#include - -#include "gsm.h" -#include "proto.h" - -char * pname; - -int debug = 0; -int verbosity = 0; -int error = 0; - -usage P0() -{ - fprintf(stderr, "Usage: %s [files...]\n", pname); - exit(1); -} - -void process P2((f, filename), FILE * f, char * filename) -{ - gsm_frame buf; - gsm_signal source[76]; - - int cc; - gsm r; - int nr=0; - - (void)memset(source, 0, sizeof(source)); - - if (!(r = gsm_create())) { - perror("gsm_create"); - error = 1; - return ; - } - gsm_option(r, GSM_OPT_VERBOSE, &verbosity); - for (;;) { - cc = fread((char *)buf, sizeof(buf), 1, f); - if (cc == 0) { - gsm_destroy(r); - return; - } - if (cc != 1) { - error = 1; - fprintf(stderr, - "%s: %s -- trailing bytes ignored\n", - pname, filename); - gsm_destroy(r); - return; - } - - gsm_explode(r, buf, source); - if (write(1, (char *)source, sizeof(source))!= sizeof(source)) { - - perror("write"); - error = 1; - gsm_destroy(r); - return; - } - } -} - -main P2((ac, av), int ac, char ** av) -{ - int opt; - extern char * optarg; - extern int optind; - - FILE * f; - - if (!(pname = av[0])) pname = "gsm2cod"; - - ac--; - av++; - - if (!ac) process(stdin, "*stdin*"); - else for (; *av; av++) { - if (!(f = fopen(*av, "r"))) perror(*av); - else { - process(f, *av); - fclose(f); - } - } - - exit(error); -} diff --git a/third_party/gsm/tst/lin2cod.c b/third_party/gsm/tst/lin2cod.c deleted file mode 100644 index 2c42b10..0000000 --- a/third_party/gsm/tst/lin2cod.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/lin2cod.c,v 1.2 1996/07/02 14:33:13 jutta Exp jutta $*/ - -#include - -#include "gsm.h" -#include "proto.h" - -char * pname; - -int debug = 0; -int verbosity = 0; -int fast = 0; -int wav = 0; -int error = 0; - -usage P0() -{ - fprintf(stderr, "Usage: %s [-vwF] [files...]\n", pname); - exit(1); -} - -void process P2((f, filename), FILE * f, char * filename) -{ - gsm_frame buf; - short source[160]; - int cc; - gsm r; - - if (!(r = gsm_create())) { - perror("gsm_create"); - error = 1; - return ; - } - gsm_option(r, GSM_OPT_VERBOSE, &verbosity); - gsm_option(r, GSM_OPT_FAST, &fast); - gsm_option(r, GSM_OPT_WAV49, &wav); - for (;;) { - - if ((cc = fread((char *)source, 1, sizeof(source), f)) == 0) { - gsm_destroy(r); -#ifdef COUNT_OVERFLOW - dump_overflow(stderr); -#endif - return; - } - - if (cc != sizeof(source)) { - error = 1; - perror(filename); - fprintf(stderr, "%s: cannot read input from %s\n", - pname, filename); - gsm_destroy(r); - return; - } - - gsm_encode(r, source, buf); - gsm_explode(r, buf, source); /* 76 shorts */ - if (write(1, source, sizeof(*source) * 76) - != sizeof(*source) * 76) { - - perror("write"); - error = 1; - gsm_destroy(r); - return; - } - } -} - -main P2((ac, av), int ac, char ** av) -{ - int opt; - extern char * optarg; - extern int optind; - - FILE * f; - - if (!(pname = av[0])) pname = "inp2cod"; - - while ((opt = getopt(ac, av, "vwF")) != EOF) switch (opt) { - case 'v': verbosity++; break; - case 'w': wav++; break; - case 'F': fast++; break; - default: usage(); - } - - ac -= optind; - av += optind; - - if (!ac) process(stdin, "*stdin*"); - else for (; *av; av++) { - if (!(f = fopen(*av, "r"))) perror(*av); - else { - process(f, *av); - fclose(f); - } - } - - exit(error); -} diff --git a/third_party/gsm/tst/lin2txt.c b/third_party/gsm/tst/lin2txt.c deleted file mode 100644 index fb39504..0000000 --- a/third_party/gsm/tst/lin2txt.c +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische - * Universitaet Berlin. See the accompanying file "COPYRIGHT" for - * details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. - */ - -/*$Header: /tmp_amd/presto/export/kbs/jutta/src/gsm/RCS/lin2txt.c,v 1.1 1994/10/21 20:52:11 jutta Exp $*/ - -#include - -#include "gsm.h" -#include "proto.h" - -char * pname; - -int debug = 0; -int verbosity = 0; -int error = 0; - -usage P0() -{ - fprintf(stderr, "Usage: %s [-v] [files...]\n", pname); - exit(1); -} - -void process P2((f, filename), FILE * f, char * filename) -{ - short source[160]; - int cc, j, k; - gsm r; - - if (!(r = gsm_create())) { - perror("gsm_create"); - error = 1; - return ; - } - gsm_option(r, GSM_OPT_VERBOSE, &verbosity); - for (;;) { - - if ((cc = fread((char *)source, 1, sizeof(source), f)) == 0) { - gsm_destroy(r); -#ifdef COUNT_OVERFLOW - dump_overflow(stderr); -#endif - return; - } - - printf("{\t"); - for (j = 0; j < 4; j++) { - printf("{\t"); - for (k = 0; k < 40; k++) { - printf("%d", (int)source[ j * 40 + k ]); - if (k < 39) { - printf(", "); - if (k % 4 == 3) printf("\n\t\t"); - } else { - printf("\t}"); - if (j == 3) printf("\t},\n"); - else printf(",\n\t"); - } - } - } - } -} - -main P2((ac, av), int ac, char ** av) -{ - int opt; - extern char * optarg; - extern int optind; - - FILE * f; - - if (!(pname = av[0])) pname = "inp2txt"; - - while ((opt = getopt(ac, av, "v")) != EOF) switch (opt) { - case 'v': verbosity++; break; - default: usage(); - } - - ac -= optind; - av += optind; - - if (!ac) process(stdin, "*stdin*"); - else for (; *av; av++) { - if (!(f = fopen(*av, "r"))) perror(*av); - else { - process(f, *av); - fclose(f); - } - } - - exit(error); -} diff --git a/third_party/gsm/tst/run b/third_party/gsm/tst/run deleted file mode 100644 index 5eec3b2..0000000 --- a/third_party/gsm/tst/run +++ /dev/null @@ -1,34 +0,0 @@ -: -# -# Copyright 1992 by Jutta Degener and Carsten Bormann, Technische -# Universitaet Berlin. See the accompanying file "COPYRIGHT" for -# details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. -# -if [ ! -f 1.inp ] ; then - echo Sorry, but we cannot provide the test data with this release. - exit -fi - -echo -n 'Linear to code: ' -for i in 1 2 3 4 -do - echo -n $i.. - ./lin2cod < $i.inp | cmp - $i.cod -done -echo "" - -echo -n 'Code to linear: ' -for i in 1 2 3 4 -do - echo -n $i.. - ./cod2lin < $i.cod | cmp - $i.out -done -echo "" - -echo -n 'Toast: ' -for i in 1 2 3 4 -do - echo -n $i.. - ../bin/toast -l < $i.inp | ../bin/toast -dl | cmp - $i.out -done -echo "" diff --git a/third_party/ilbc/FrameClassify.c b/third_party/ilbc/FrameClassify.c deleted file mode 100644 index 80d72d9..0000000 --- a/third_party/ilbc/FrameClassify.c +++ /dev/null @@ -1,114 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - FrameClassify.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include "iLBC_define.h" - - /*---------------------------------------------------------------* - * Classification of subframes to localize start state - *--------------------------------------------------------------*/ - - int FrameClassify( /* index to the max-energy sub-frame */ - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i/o) the encoder state structure */ - float *residual /* (i) lpc residual signal */ - ) { - float max_ssqEn, fssqEn[NSUB_MAX], bssqEn[NSUB_MAX], *pp; - int n, l, max_ssqEn_n; - const float ssqEn_win[NSUB_MAX-1]={(float)0.8,(float)0.9, - (float)1.0,(float)0.9,(float)0.8}; - const float sampEn_win[5]={(float)1.0/(float)6.0, - (float)2.0/(float)6.0, (float)3.0/(float)6.0, - (float)4.0/(float)6.0, (float)5.0/(float)6.0}; - - /* init the front and back energies to zero */ - - memset(fssqEn, 0, NSUB_MAX*sizeof(float)); - memset(bssqEn, 0, NSUB_MAX*sizeof(float)); - - /* Calculate front of first seqence */ - - n=0; - pp=residual; - for (l=0; l<5; l++) { - fssqEn[n] += sampEn_win[l] * (*pp) * (*pp); - pp++; - } - for (l=5; lnsub-1; n++) { - pp=residual+n*SUBL; - for (l=0; l<5; l++) { - fssqEn[n] += sampEn_win[l] * (*pp) * (*pp); - bssqEn[n] += (*pp) * (*pp); - pp++; - } - for (l=5; lnsub-1; - pp=residual+n*SUBL; - for (l=0; lmode==20) l=1; - else l=0; - - max_ssqEn=(fssqEn[0]+bssqEn[1])*ssqEn_win[l]; - max_ssqEn_n=1; - for (n=2; nnsub; n++) { - - - - - - - l++; - if ((fssqEn[n-1]+bssqEn[n])*ssqEn_win[l] > max_ssqEn) { - max_ssqEn=(fssqEn[n-1]+bssqEn[n]) * - ssqEn_win[l]; - max_ssqEn_n=n; - } - } - - return max_ssqEn_n; - } - diff --git a/third_party/ilbc/FrameClassify.h b/third_party/ilbc/FrameClassify.h deleted file mode 100644 index 018ddbe..0000000 --- a/third_party/ilbc/FrameClassify.h +++ /dev/null @@ -1,27 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - FrameClassify.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_FRAMECLASSIFY_H - #define __iLBC_FRAMECLASSIFY_H - - int FrameClassify( /* index to the max-energy sub-frame */ - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i/o) the encoder state structure */ - float *residual /* (i) lpc residual signal */ - ); - - - - - - #endif - diff --git a/third_party/ilbc/LPCdecode.c b/third_party/ilbc/LPCdecode.c deleted file mode 100644 index 81bab90..0000000 --- a/third_party/ilbc/LPCdecode.c +++ /dev/null @@ -1,158 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - LPC_decode.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include - #include - - #include "helpfun.h" - #include "lsf.h" - #include "iLBC_define.h" - #include "constants.h" - - /*---------------------------------------------------------------* - * interpolation of lsf coefficients for the decoder - *--------------------------------------------------------------*/ - - void LSFinterpolate2a_dec( - float *a, /* (o) lpc coefficients for a sub-frame */ - float *lsf1, /* (i) first lsf coefficient vector */ - float *lsf2, /* (i) second lsf coefficient vector */ - float coef, /* (i) interpolation weight */ - int length /* (i) length of lsf vectors */ - ){ - float lsftmp[LPC_FILTERORDER]; - - interpolate(lsftmp, lsf1, lsf2, coef, length); - lsf2a(a, lsftmp); - } - - /*---------------------------------------------------------------* - * obtain dequantized lsf coefficients from quantization index - *--------------------------------------------------------------*/ - - void SimplelsfDEQ( - float *lsfdeq, /* (o) dequantized lsf coefficients */ - int *index, /* (i) quantization index */ - int lpc_n /* (i) number of LPCs */ - ){ - int i, j, pos, cb_pos; - - - - - - /* decode first LSF */ - - pos = 0; - cb_pos = 0; - for (i = 0; i < LSF_NSPLIT; i++) { - for (j = 0; j < dim_lsfCbTbl[i]; j++) { - lsfdeq[pos + j] = lsfCbTbl[cb_pos + - (long)(index[i])*dim_lsfCbTbl[i] + j]; - } - pos += dim_lsfCbTbl[i]; - cb_pos += size_lsfCbTbl[i]*dim_lsfCbTbl[i]; - } - - if (lpc_n>1) { - - /* decode last LSF */ - - pos = 0; - cb_pos = 0; - for (i = 0; i < LSF_NSPLIT; i++) { - for (j = 0; j < dim_lsfCbTbl[i]; j++) { - lsfdeq[LPC_FILTERORDER + pos + j] = - lsfCbTbl[cb_pos + - (long)(index[LSF_NSPLIT + i])* - dim_lsfCbTbl[i] + j]; - } - pos += dim_lsfCbTbl[i]; - cb_pos += size_lsfCbTbl[i]*dim_lsfCbTbl[i]; - } - } - } - - /*----------------------------------------------------------------* - * obtain synthesis and weighting filters form lsf coefficients - *---------------------------------------------------------------*/ - - void DecoderInterpolateLSF( - float *syntdenum, /* (o) synthesis filter coefficients */ - float *weightdenum, /* (o) weighting denumerator - coefficients */ - float *lsfdeq, /* (i) dequantized lsf coefficients */ - int length, /* (i) length of lsf coefficient vector */ - iLBC_Dec_Inst_t *iLBCdec_inst - /* (i) the decoder state structure */ - ){ - int i, pos, lp_length; - float lp[LPC_FILTERORDER + 1], *lsfdeq2; - - - - - - - lsfdeq2 = lsfdeq + length; - lp_length = length + 1; - - if (iLBCdec_inst->mode==30) { - /* sub-frame 1: Interpolation between old and first */ - - LSFinterpolate2a_dec(lp, iLBCdec_inst->lsfdeqold, lsfdeq, - lsf_weightTbl_30ms[0], length); - memcpy(syntdenum,lp,lp_length*sizeof(float)); - bwexpand(weightdenum, lp, LPC_CHIRP_WEIGHTDENUM, - lp_length); - - /* sub-frames 2 to 6: interpolation between first - and last LSF */ - - pos = lp_length; - for (i = 1; i < 6; i++) { - LSFinterpolate2a_dec(lp, lsfdeq, lsfdeq2, - lsf_weightTbl_30ms[i], length); - memcpy(syntdenum + pos,lp,lp_length*sizeof(float)); - bwexpand(weightdenum + pos, lp, - LPC_CHIRP_WEIGHTDENUM, lp_length); - pos += lp_length; - } - } - else { - pos = 0; - for (i = 0; i < iLBCdec_inst->nsub; i++) { - LSFinterpolate2a_dec(lp, iLBCdec_inst->lsfdeqold, - lsfdeq, lsf_weightTbl_20ms[i], length); - memcpy(syntdenum+pos,lp,lp_length*sizeof(float)); - bwexpand(weightdenum+pos, lp, LPC_CHIRP_WEIGHTDENUM, - lp_length); - pos += lp_length; - } - } - - /* update memory */ - - if (iLBCdec_inst->mode==30) - memcpy(iLBCdec_inst->lsfdeqold, lsfdeq2, - length*sizeof(float)); - else - memcpy(iLBCdec_inst->lsfdeqold, lsfdeq, - length*sizeof(float)); - - } - - - - - - diff --git a/third_party/ilbc/LPCdecode.h b/third_party/ilbc/LPCdecode.h deleted file mode 100644 index abe1d7b..0000000 --- a/third_party/ilbc/LPCdecode.h +++ /dev/null @@ -1,52 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - LPC_decode.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_LPC_DECODE_H - #define __iLBC_LPC_DECODE_H - - void LSFinterpolate2a_dec( - float *a, /* (o) lpc coefficients for a sub-frame */ - float *lsf1, /* (i) first lsf coefficient vector */ - float *lsf2, /* (i) second lsf coefficient vector */ - float coef, /* (i) interpolation weight */ - int length /* (i) length of lsf vectors */ - ); - - void SimplelsfDEQ( - float *lsfdeq, /* (o) dequantized lsf coefficients */ - int *index, /* (i) quantization index */ - int lpc_n /* (i) number of LPCs */ - ); - - void DecoderInterpolateLSF( - float *syntdenum, /* (o) synthesis filter coefficients */ - float *weightdenum, /* (o) weighting denumerator - coefficients */ - float *lsfdeq, /* (i) dequantized lsf coefficients */ - int length, /* (i) length of lsf coefficient vector */ - iLBC_Dec_Inst_t *iLBCdec_inst - /* (i) the decoder state structure */ - ); - - #endif - - - - - - - - - - - - diff --git a/third_party/ilbc/LPCencode.c b/third_party/ilbc/LPCencode.c deleted file mode 100644 index 19695c0..0000000 --- a/third_party/ilbc/LPCencode.c +++ /dev/null @@ -1,241 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - LPCencode.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include - - #include "iLBC_define.h" - #include "helpfun.h" - #include "lsf.h" - #include "constants.h" - - - - - - /*----------------------------------------------------------------* - * lpc analysis (subrutine to LPCencode) - *---------------------------------------------------------------*/ - - void SimpleAnalysis( - float *lsf, /* (o) lsf coefficients */ - float *data, /* (i) new data vector */ - iLBC_Enc_Inst_t *iLBCenc_inst - /* (i/o) the encoder state structure */ - ){ - int k, is; - float temp[BLOCKL_MAX], lp[LPC_FILTERORDER + 1]; - float lp2[LPC_FILTERORDER + 1]; - float r[LPC_FILTERORDER + 1]; - - is=LPC_LOOKBACK+BLOCKL_MAX-iLBCenc_inst->blockl; - memcpy(iLBCenc_inst->lpc_buffer+is,data, - iLBCenc_inst->blockl*sizeof(float)); - - /* No lookahead, last window is asymmetric */ - - for (k = 0; k < iLBCenc_inst->lpc_n; k++) { - - is = LPC_LOOKBACK; - - if (k < (iLBCenc_inst->lpc_n - 1)) { - window(temp, lpc_winTbl, - iLBCenc_inst->lpc_buffer, BLOCKL_MAX); - } else { - window(temp, lpc_asymwinTbl, - iLBCenc_inst->lpc_buffer + is, BLOCKL_MAX); - } - - autocorr(r, temp, BLOCKL_MAX, LPC_FILTERORDER); - window(r, r, lpc_lagwinTbl, LPC_FILTERORDER + 1); - - levdurb(lp, temp, r, LPC_FILTERORDER); - bwexpand(lp2, lp, LPC_CHIRP_SYNTDENUM, LPC_FILTERORDER+1); - - a2lsf(lsf + k*LPC_FILTERORDER, lp2); - } - is=LPC_LOOKBACK+BLOCKL_MAX-iLBCenc_inst->blockl; - memmove(iLBCenc_inst->lpc_buffer, - iLBCenc_inst->lpc_buffer+LPC_LOOKBACK+BLOCKL_MAX-is, - is*sizeof(float)); - } - - /*----------------------------------------------------------------* - - - - - - * lsf interpolator and conversion from lsf to a coefficients - * (subrutine to SimpleInterpolateLSF) - *---------------------------------------------------------------*/ - - void LSFinterpolate2a_enc( - float *a, /* (o) lpc coefficients */ - float *lsf1,/* (i) first set of lsf coefficients */ - float *lsf2,/* (i) second set of lsf coefficients */ - float coef, /* (i) weighting coefficient to use between - lsf1 and lsf2 */ - long length /* (i) length of coefficient vectors */ - ){ - float lsftmp[LPC_FILTERORDER]; - - interpolate(lsftmp, lsf1, lsf2, coef, length); - lsf2a(a, lsftmp); - } - - /*----------------------------------------------------------------* - * lsf interpolator (subrutine to LPCencode) - *---------------------------------------------------------------*/ - - void SimpleInterpolateLSF( - float *syntdenum, /* (o) the synthesis filter denominator - resulting from the quantized - interpolated lsf */ - float *weightdenum, /* (o) the weighting filter denominator - resulting from the unquantized - interpolated lsf */ - float *lsf, /* (i) the unquantized lsf coefficients */ - float *lsfdeq, /* (i) the dequantized lsf coefficients */ - float *lsfold, /* (i) the unquantized lsf coefficients of - the previous signal frame */ - float *lsfdeqold, /* (i) the dequantized lsf coefficients of - the previous signal frame */ - int length, /* (i) should equate LPC_FILTERORDER */ - iLBC_Enc_Inst_t *iLBCenc_inst - /* (i/o) the encoder state structure */ - ){ - int i, pos, lp_length; - float lp[LPC_FILTERORDER + 1], *lsf2, *lsfdeq2; - - lsf2 = lsf + length; - lsfdeq2 = lsfdeq + length; - lp_length = length + 1; - - if (iLBCenc_inst->mode==30) { - /* sub-frame 1: Interpolation between old and first - - - - - - set of lsf coefficients */ - - LSFinterpolate2a_enc(lp, lsfdeqold, lsfdeq, - lsf_weightTbl_30ms[0], length); - memcpy(syntdenum,lp,lp_length*sizeof(float)); - LSFinterpolate2a_enc(lp, lsfold, lsf, - lsf_weightTbl_30ms[0], length); - bwexpand(weightdenum, lp, LPC_CHIRP_WEIGHTDENUM, lp_length); - - /* sub-frame 2 to 6: Interpolation between first - and second set of lsf coefficients */ - - pos = lp_length; - for (i = 1; i < iLBCenc_inst->nsub; i++) { - LSFinterpolate2a_enc(lp, lsfdeq, lsfdeq2, - lsf_weightTbl_30ms[i], length); - memcpy(syntdenum + pos,lp,lp_length*sizeof(float)); - - LSFinterpolate2a_enc(lp, lsf, lsf2, - lsf_weightTbl_30ms[i], length); - bwexpand(weightdenum + pos, lp, - LPC_CHIRP_WEIGHTDENUM, lp_length); - pos += lp_length; - } - } - else { - pos = 0; - for (i = 0; i < iLBCenc_inst->nsub; i++) { - LSFinterpolate2a_enc(lp, lsfdeqold, lsfdeq, - lsf_weightTbl_20ms[i], length); - memcpy(syntdenum+pos,lp,lp_length*sizeof(float)); - LSFinterpolate2a_enc(lp, lsfold, lsf, - lsf_weightTbl_20ms[i], length); - bwexpand(weightdenum+pos, lp, - LPC_CHIRP_WEIGHTDENUM, lp_length); - pos += lp_length; - } - } - - /* update memory */ - - if (iLBCenc_inst->mode==30) { - memcpy(lsfold, lsf2, length*sizeof(float)); - memcpy(lsfdeqold, lsfdeq2, length*sizeof(float)); - } - else { - memcpy(lsfold, lsf, length*sizeof(float)); - memcpy(lsfdeqold, lsfdeq, length*sizeof(float)); - - - - - - } - } - - /*----------------------------------------------------------------* - * lsf quantizer (subrutine to LPCencode) - *---------------------------------------------------------------*/ - - void SimplelsfQ( - float *lsfdeq, /* (o) dequantized lsf coefficients - (dimension FILTERORDER) */ - int *index, /* (o) quantization index */ - float *lsf, /* (i) the lsf coefficient vector to be - quantized (dimension FILTERORDER ) */ - int lpc_n /* (i) number of lsf sets to quantize */ - ){ - /* Quantize first LSF with memoryless split VQ */ - SplitVQ(lsfdeq, index, lsf, lsfCbTbl, LSF_NSPLIT, - dim_lsfCbTbl, size_lsfCbTbl); - - if (lpc_n==2) { - /* Quantize second LSF with memoryless split VQ */ - SplitVQ(lsfdeq + LPC_FILTERORDER, index + LSF_NSPLIT, - lsf + LPC_FILTERORDER, lsfCbTbl, LSF_NSPLIT, - dim_lsfCbTbl, size_lsfCbTbl); - } - } - - /*----------------------------------------------------------------* - * lpc encoder - *---------------------------------------------------------------*/ - - void LPCencode( - float *syntdenum, /* (i/o) synthesis filter coefficients - before/after encoding */ - float *weightdenum, /* (i/o) weighting denumerator - coefficients before/after - encoding */ - int *lsf_index, /* (o) lsf quantization index */ - float *data, /* (i) lsf coefficients to quantize */ - iLBC_Enc_Inst_t *iLBCenc_inst - /* (i/o) the encoder state structure */ - ){ - float lsf[LPC_FILTERORDER * LPC_N_MAX]; - float lsfdeq[LPC_FILTERORDER * LPC_N_MAX]; - int change=0; - - SimpleAnalysis(lsf, data, iLBCenc_inst); - SimplelsfQ(lsfdeq, lsf_index, lsf, iLBCenc_inst->lpc_n); - - - - - - change=LSF_check(lsfdeq, LPC_FILTERORDER, iLBCenc_inst->lpc_n); - SimpleInterpolateLSF(syntdenum, weightdenum, - lsf, lsfdeq, iLBCenc_inst->lsfold, - iLBCenc_inst->lsfdeqold, LPC_FILTERORDER, iLBCenc_inst); - } - diff --git a/third_party/ilbc/LPCencode.h b/third_party/ilbc/LPCencode.h deleted file mode 100644 index 39a9b04..0000000 --- a/third_party/ilbc/LPCencode.h +++ /dev/null @@ -1,28 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - LPCencode.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_LPCENCOD_H - #define __iLBC_LPCENCOD_H - - void LPCencode( - float *syntdenum, /* (i/o) synthesis filter coefficients - before/after encoding */ - float *weightdenum, /* (i/o) weighting denumerator coefficients - before/after encoding */ - int *lsf_index, /* (o) lsf quantization index */ - float *data, /* (i) lsf coefficients to quantize */ - iLBC_Enc_Inst_t *iLBCenc_inst - /* (i/o) the encoder state structure */ - ); - - #endif - diff --git a/third_party/ilbc/StateConstructW.c b/third_party/ilbc/StateConstructW.c deleted file mode 100644 index 1d3e65f..0000000 --- a/third_party/ilbc/StateConstructW.c +++ /dev/null @@ -1,86 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - StateConstructW.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include - #include - - #include "iLBC_define.h" - #include "constants.h" - #include "filter.h" - - /*----------------------------------------------------------------* - * decoding of the start state - *---------------------------------------------------------------*/ - - void StateConstructW( - int idxForMax, /* (i) 6-bit index for the quantization of - max amplitude */ - int *idxVec, /* (i) vector of quantization indexes */ - float *syntDenum, /* (i) synthesis filter denumerator */ - - - - - - float *out, /* (o) the decoded state vector */ - int len /* (i) length of a state vector */ - ){ - float maxVal, tmpbuf[LPC_FILTERORDER+2*STATE_LEN], *tmp, - numerator[LPC_FILTERORDER+1]; - float foutbuf[LPC_FILTERORDER+2*STATE_LEN], *fout; - int k,tmpi; - - /* decoding of the maximum value */ - - maxVal = state_frgqTbl[idxForMax]; - maxVal = (float)pow(10,maxVal)/(float)4.5; - - /* initialization of buffers and coefficients */ - - memset(tmpbuf, 0, LPC_FILTERORDER*sizeof(float)); - memset(foutbuf, 0, LPC_FILTERORDER*sizeof(float)); - for (k=0; k - #include - - #include "iLBC_define.h" - #include "constants.h" - #include "filter.h" - #include "helpfun.h" - - /*----------------------------------------------------------------* - * predictive noise shaping encoding of scaled start state - * (subrutine for StateSearchW) - *---------------------------------------------------------------*/ - - void AbsQuantW( - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i) Encoder instance */ - float *in, /* (i) vector to encode */ - float *syntDenum, /* (i) denominator of synthesis filter */ - float *weightDenum, /* (i) denominator of weighting filter */ - int *out, /* (o) vector of quantizer indexes */ - int len, /* (i) length of vector to encode and - vector of quantizer indexes */ - int state_first /* (i) position of start state in the - 80 vec */ - ){ - float *syntOut; - float syntOutBuf[LPC_FILTERORDER+STATE_SHORT_LEN_30MS]; - float toQ, xq; - int n; - int index; - - /* initialization of buffer for filtering */ - - memset(syntOutBuf, 0, LPC_FILTERORDER*sizeof(float)); - - - - - - - /* initialization of pointer for filtering */ - - syntOut = &syntOutBuf[LPC_FILTERORDER]; - - /* synthesis and weighting filters on input */ - - if (state_first) { - AllPoleFilter (in, weightDenum, SUBL, LPC_FILTERORDER); - } else { - AllPoleFilter (in, weightDenum, - iLBCenc_inst->state_short_len-SUBL, - LPC_FILTERORDER); - } - - /* encoding loop */ - - for (n=0; nstate_short_len-SUBL))) { - syntDenum += (LPC_FILTERORDER+1); - weightDenum += (LPC_FILTERORDER+1); - - /* synthesis and weighting filters on input */ - AllPoleFilter (&in[n], weightDenum, len-n, - LPC_FILTERORDER); - - } - - /* prediction of synthesized and weighted input */ - - syntOut[n] = 0.0; - AllPoleFilter (&syntOut[n], weightDenum, 1, - LPC_FILTERORDER); - - /* quantization */ - - toQ = in[n]-syntOut[n]; - - - - - - sort_sq(&xq, &index, toQ, state_sq3Tbl, 8); - out[n]=index; - syntOut[n] = state_sq3Tbl[out[n]]; - - /* update of the prediction filter */ - - AllPoleFilter(&syntOut[n], weightDenum, 1, - LPC_FILTERORDER); - } - } - - /*----------------------------------------------------------------* - * encoding of start state - *---------------------------------------------------------------*/ - - void StateSearchW( - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i) Encoder instance */ - float *residual,/* (i) target residual vector */ - float *syntDenum, /* (i) lpc synthesis filter */ - float *weightDenum, /* (i) weighting filter denuminator */ - int *idxForMax, /* (o) quantizer index for maximum - amplitude */ - int *idxVec, /* (o) vector of quantization indexes */ - int len, /* (i) length of all vectors */ - int state_first /* (i) position of start state in the - 80 vec */ - ){ - float dtmp, maxVal; - float tmpbuf[LPC_FILTERORDER+2*STATE_SHORT_LEN_30MS]; - float *tmp, numerator[1+LPC_FILTERORDER]; - float foutbuf[LPC_FILTERORDER+2*STATE_SHORT_LEN_30MS], *fout; - int k; - float qmax, scal; - - /* initialization of buffers and filter coefficients */ - - memset(tmpbuf, 0, LPC_FILTERORDER*sizeof(float)); - memset(foutbuf, 0, LPC_FILTERORDER*sizeof(float)); - for (k=0; k maxVal*maxVal){ - maxVal = fout[k]; - } - } - maxVal=(float)fabs(maxVal); - - /* encoding of the maximum amplitude value */ - - if (maxVal < 10.0) { - maxVal = 10.0; - } - maxVal = (float)log10(maxVal); - sort_sq(&dtmp, idxForMax, maxVal, state_frgqTbl, 64); - - /* decoding of the maximum amplitude representation value, - and corresponding scaling of start state */ - - maxVal=state_frgqTbl[*idxForMax]; - qmax = (float)pow(10,maxVal); - scal = (float)(4.5)/qmax; - for (k=0; k - #include "iLBC_define.h" - - /*----------------------------------------------------------------* - * LP analysis filter. - *---------------------------------------------------------------*/ - - void anaFilter( - float *In, /* (i) Signal to be filtered */ - float *a, /* (i) LP parameters */ - int len,/* (i) Length of signal */ - float *Out, /* (o) Filtered signal */ - float *mem /* (i/o) Filter state */ - ){ - int i, j; - float *po, *pi, *pm, *pa; - - po = Out; - - /* Filter first part using memory from past */ - - for (i=0; i - #include - - /*----------------------------------------------------------------* - * Construct an additional codebook vector by filtering the - * initial codebook buffer. This vector is then used to expand - * the codebook with an additional section. - *---------------------------------------------------------------*/ - - void filteredCBvecs( - float *cbvectors, /* (o) Codebook vectors for the - higher section */ - float *mem, /* (i) Buffer to create codebook - vector from */ - int lMem /* (i) Length of buffer */ - ){ - int j, k; - float *pp, *pp1; - float tempbuff2[CB_MEML+CB_FILTERLEN]; - float *pos; - - memset(tempbuff2, 0, (CB_HALFFILTERLEN-1)*sizeof(float)); - memcpy(&tempbuff2[CB_HALFFILTERLEN-1], mem, lMem*sizeof(float)); - memset(&tempbuff2[lMem+CB_HALFFILTERLEN-1], 0, - (CB_HALFFILTERLEN+1)*sizeof(float)); - - /* Create codebook vector for higher section by filtering */ - - /* do filtering */ - pos=cbvectors; - memset(pos, 0, lMem*sizeof(float)); - for (k=0; k0.0) { - invenergy[tmpIndex]=(float)1.0/(energy[tmpIndex]+EPS); - } else { - invenergy[tmpIndex] = (float) 0.0; - } - - if (stage==0) { - measure = (float)-10000000.0; - - if (crossDot > 0.0) { - measure = crossDot*crossDot*invenergy[tmpIndex]; - } - } - else { - measure = crossDot*crossDot*invenergy[tmpIndex]; - } - - /* check if measure is better */ - ftmp = crossDot*invenergy[tmpIndex]; - - if ((measure>*max_measure) && (fabs(ftmp) - #include - #include - - - - - - #include "iLBC_define.h" - - /*----------------------------------------------------------------* - * Compute cross correlation and pitch gain for pitch prediction - * of last subframe at given lag. - *---------------------------------------------------------------*/ - - void compCorr( - float *cc, /* (o) cross correlation coefficient */ - float *gc, /* (o) gain */ - float *pm, - float *buffer, /* (i) signal buffer */ - int lag, /* (i) pitch lag */ - int bLen, /* (i) length of buffer */ - int sRange /* (i) correlation search length */ - ){ - int i; - float ftmp1, ftmp2, ftmp3; - - /* Guard against getting outside buffer */ - if ((bLen-sRange-lag)<0) { - sRange=bLen-lag; - } - - ftmp1 = 0.0; - ftmp2 = 0.0; - ftmp3 = 0.0; - for (i=0; i 0.0) { - *cc = ftmp1*ftmp1/ftmp2; - *gc = (float)fabs(ftmp1/ftmp2); - *pm=(float)fabs(ftmp1)/ - ((float)sqrt(ftmp2)*(float)sqrt(ftmp3)); - } - else { - *cc = 0.0; - *gc = 0.0; - *pm=0.0; - } - } - - - - - - /*----------------------------------------------------------------* - * Packet loss concealment routine. Conceals a residual signal - * and LP parameters. If no packet loss, update state. - *---------------------------------------------------------------*/ - - void doThePLC( - float *PLCresidual, /* (o) concealed residual */ - float *PLClpc, /* (o) concealed LP parameters */ - int PLI, /* (i) packet loss indicator - 0 - no PL, 1 = PL */ - float *decresidual, /* (i) decoded residual */ - float *lpc, /* (i) decoded LPC (only used for no PL) */ - int inlag, /* (i) pitch lag */ - iLBC_Dec_Inst_t *iLBCdec_inst - /* (i/o) decoder instance */ - ){ - int lag=20, randlag; - float gain, maxcc; - float use_gain; - float gain_comp, maxcc_comp, per, max_per=0; - int i, pick, use_lag; - float ftmp, randvec[BLOCKL_MAX], pitchfact, energy; - - /* Packet Loss */ - - if (PLI == 1) { - - iLBCdec_inst->consPLICount += 1; - - /* if previous frame not lost, - determine pitch pred. gain */ - - if (iLBCdec_inst->prevPLI != 1) { - - /* Search around the previous lag to find the - best pitch period */ - - lag=inlag-3; - compCorr(&maxcc, &gain, &max_per, - iLBCdec_inst->prevResidual, - lag, iLBCdec_inst->blockl, 60); - for (i=inlag-2;i<=inlag+3;i++) { - compCorr(&maxcc_comp, &gain_comp, &per, - iLBCdec_inst->prevResidual, - i, iLBCdec_inst->blockl, 60); - - if (maxcc_comp>maxcc) { - maxcc=maxcc_comp; - - - - - - gain=gain_comp; - lag=i; - max_per=per; - } - } - - } - - /* previous frame lost, use recorded lag and periodicity */ - - else { - lag=iLBCdec_inst->prevLag; - max_per=iLBCdec_inst->per; - } - - /* downscaling */ - - use_gain=1.0; - if (iLBCdec_inst->consPLICount*iLBCdec_inst->blockl>320) - use_gain=(float)0.9; - else if (iLBCdec_inst->consPLICount* - iLBCdec_inst->blockl>2*320) - use_gain=(float)0.7; - else if (iLBCdec_inst->consPLICount* - iLBCdec_inst->blockl>3*320) - use_gain=(float)0.5; - else if (iLBCdec_inst->consPLICount* - iLBCdec_inst->blockl>4*320) - use_gain=(float)0.0; - - /* mix noise and pitch repeatition */ - ftmp=(float)sqrt(max_per); - if (ftmp>(float)0.7) - pitchfact=(float)1.0; - else if (ftmp>(float)0.4) - pitchfact=(ftmp-(float)0.4)/((float)0.7-(float)0.4); - else - pitchfact=0.0; - - - /* avoid repetition of same pitch cycle */ - use_lag=lag; - if (lag<80) { - use_lag=2*lag; - } - - /* compute concealed residual */ - - - - - - - energy = 0.0; - for (i=0; iblockl; i++) { - - /* noise component */ - - iLBCdec_inst->seed=(iLBCdec_inst->seed*69069L+1) & - (0x80000000L-1); - randlag = 50 + ((signed long) iLBCdec_inst->seed)%70; - pick = i - randlag; - - if (pick < 0) { - randvec[i] = - iLBCdec_inst->prevResidual[ - iLBCdec_inst->blockl+pick]; - } else { - randvec[i] = randvec[pick]; - } - - /* pitch repeatition component */ - pick = i - use_lag; - - if (pick < 0) { - PLCresidual[i] = - iLBCdec_inst->prevResidual[ - iLBCdec_inst->blockl+pick]; - } else { - PLCresidual[i] = PLCresidual[pick]; - } - - /* mix random and periodicity component */ - - if (i<80) - PLCresidual[i] = use_gain*(pitchfact * - PLCresidual[i] + - ((float)1.0 - pitchfact) * randvec[i]); - else if (i<160) - PLCresidual[i] = (float)0.95*use_gain*(pitchfact * - PLCresidual[i] + - ((float)1.0 - pitchfact) * randvec[i]); - else - PLCresidual[i] = (float)0.9*use_gain*(pitchfact * - PLCresidual[i] + - ((float)1.0 - pitchfact) * randvec[i]); - - energy += PLCresidual[i] * PLCresidual[i]; - } - - /* less than 30 dB, use only noise */ - - - - - - - if (sqrt(energy/(float)iLBCdec_inst->blockl) < 30.0) { - gain=0.0; - for (i=0; iblockl; i++) { - PLCresidual[i] = randvec[i]; - } - } - - /* use old LPC */ - - memcpy(PLClpc,iLBCdec_inst->prevLpc, - (LPC_FILTERORDER+1)*sizeof(float)); - - } - - /* no packet loss, copy input */ - - else { - memcpy(PLCresidual, decresidual, - iLBCdec_inst->blockl*sizeof(float)); - memcpy(PLClpc, lpc, (LPC_FILTERORDER+1)*sizeof(float)); - iLBCdec_inst->consPLICount = 0; - } - - /* update state */ - - if (PLI) { - iLBCdec_inst->prevLag = lag; - iLBCdec_inst->per=max_per; - } - - iLBCdec_inst->prevPLI = PLI; - memcpy(iLBCdec_inst->prevLpc, PLClpc, - (LPC_FILTERORDER+1)*sizeof(float)); - memcpy(iLBCdec_inst->prevResidual, PLCresidual, - iLBCdec_inst->blockl*sizeof(float)); - } - diff --git a/third_party/ilbc/doCPLC.h b/third_party/ilbc/doCPLC.h deleted file mode 100644 index 2bda7a1..0000000 --- a/third_party/ilbc/doCPLC.h +++ /dev/null @@ -1,29 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - doCPLC.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_DOLPC_H - #define __iLBC_DOLPC_H - - void doThePLC( - float *PLCresidual, /* (o) concealed residual */ - float *PLClpc, /* (o) concealed LP parameters */ - int PLI, /* (i) packet loss indicator - 0 - no PL, 1 = PL */ - float *decresidual, /* (i) decoded residual */ - float *lpc, /* (i) decoded LPC (only used for no PL) */ - int inlag, /* (i) pitch lag */ - iLBC_Dec_Inst_t *iLBCdec_inst - /* (i/o) decoder instance */ - ); - - #endif - diff --git a/third_party/ilbc/enhancer.c b/third_party/ilbc/enhancer.c deleted file mode 100644 index dee13b0..0000000 --- a/third_party/ilbc/enhancer.c +++ /dev/null @@ -1,701 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - enhancer.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include - #include - #include "iLBC_define.h" - #include "constants.h" - #include "filter.h" - - /*----------------------------------------------------------------* - * Find index in array such that the array element with said - * index is the element of said array closest to "value" - * according to the squared-error criterion - *---------------------------------------------------------------*/ - - void NearestNeighbor( - - - - - - int *index, /* (o) index of array element closest - to value */ - float *array, /* (i) data array */ - float value,/* (i) value */ - int arlength/* (i) dimension of data array */ - ){ - int i; - float bestcrit,crit; - - crit=array[0]-value; - bestcrit=crit*crit; - *index=0; - for (i=1; i dim1 ) { - hfl2=(int) (dim1/2); - for (j=0; j= idatal) { - searchSegEndPos=idatal-ENH_BLOCKL-1; - } - corrdim=searchSegEndPos-searchSegStartPos+1; - - /* compute upsampled correlation (corr33) and find - location of max */ - - mycorr1(corrVec,idata+searchSegStartPos, - corrdim+ENH_BLOCKL-1,idata+centerStartPos,ENH_BLOCKL); - enh_upsample(corrVecUps,corrVec,corrdim,ENH_FL0); - tloc=0; maxv=corrVecUps[0]; - for (i=1; imaxv) { - tloc=i; - maxv=corrVecUps[i]; - } - } - - /* make vector can be upsampled without ever running outside - bounds */ - - *updStartPos= (float)searchSegStartPos + - (float)tloc/(float)ENH_UPS0+(float)1.0; - tloc2=(int)(tloc/ENH_UPS0); - - if (tloc>tloc2*ENH_UPS0) { - tloc2++; - } - st=searchSegStartPos+tloc2-ENH_FL0; - - if (st<0) { - memset(vect,0,-st*sizeof(float)); - memcpy(&vect[-st],idata, (ENH_VECTL+st)*sizeof(float)); - } - else { - - - - - - en=st+ENH_VECTL; - - if (en>idatal) { - memcpy(vect, &idata[st], - (ENH_VECTL-(en-idatal))*sizeof(float)); - memset(&vect[ENH_VECTL-(en-idatal)], 0, - (en-idatal)*sizeof(float)); - } - else { - memcpy(vect, &idata[st], ENH_VECTL*sizeof(float)); - } - } - fraction=tloc2*ENH_UPS0-tloc; - - /* compute the segment (this is actually a convolution) */ - - mycorr1(seg,vect,ENH_VECTL,polyphaserTbl+(2*ENH_FL0+1)*fraction, - 2*ENH_FL0+1); - } - - /*----------------------------------------------------------------* - * find the smoothed output data - *---------------------------------------------------------------*/ - - void smath( - float *odata, /* (o) smoothed output */ - float *sseq,/* (i) said second sequence of waveforms */ - int hl, /* (i) 2*hl+1 is sseq dimension */ - float alpha0/* (i) max smoothing energy fraction */ - ){ - int i,k; - float w00,w10,w11,A,B,C,*psseq,err,errs; - float surround[BLOCKL_MAX]; /* shape contributed by other than - current */ - float wt[2*ENH_HL+1]; /* waveform weighting to get - surround shape */ - float denom; - - /* create shape of contribution from all waveforms except the - current one */ - - for (i=1; i<=2*hl+1; i++) { - wt[i-1] = (float)0.5*(1 - (float)cos(2*PI*i/(2*hl+2))); - } - wt[hl]=0.0; /* for clarity, not used */ - for (i=0; i alpha0 * w00) { - if ( w00 < 1) { - w00=1; - } - denom = (w11*w00-w10*w10)/(w00*w00); - - if (denom > 0.0001) { /* eliminates numerical problems - for if smooth */ - - - - - - A = (float)sqrt( (alpha0- alpha0*alpha0/4)/denom); - B = -alpha0/2 - A * w10/w00; - B = B+1; - } - else { /* essentially no difference between cycles; - smoothing not needed */ - A= 0.0; - B= 1.0; - } - - /* create smoothed sequence */ - - psseq=sseq+hl*ENH_BLOCKL; - for (i=0; i=0; q--) { - blockStartPos[q]=blockStartPos[q+1]-period[lagBlock[q+1]]; - NearestNeighbor(lagBlock+q,plocs, - blockStartPos[q]+ - ENH_BLOCKL_HALF-period[lagBlock[q+1]], periodl); - - - if (blockStartPos[q]-ENH_OVERHANG>=0) { - refiner(sseq+q*ENH_BLOCKL, blockStartPos+q, idata, - idatal, centerStartPos, blockStartPos[q], - period[lagBlock[q+1]]); - } else { - psseq=sseq+q*ENH_BLOCKL; - memset(psseq, 0, ENH_BLOCKL*sizeof(float)); - } - } - - /* future */ - - for (i=0; i 0.0) { - return (float)(ftmp1*ftmp1/ftmp2); - } - - - - - - else { - return (float)0.0; - } - } - - /*----------------------------------------------------------------* - * interface for enhancer - *---------------------------------------------------------------*/ - - int enhancerInterface( - float *out, /* (o) enhanced signal */ - float *in, /* (i) unenhanced signal */ - iLBC_Dec_Inst_t *iLBCdec_inst /* (i) buffers etc */ - ){ - float *enh_buf, *enh_period; - int iblock, isample; - int lag=0, ilag, i, ioffset; - float cc, maxcc; - float ftmp1, ftmp2; - float *inPtr, *enh_bufPtr1, *enh_bufPtr2; - float plc_pred[ENH_BLOCKL]; - - float lpState[6], downsampled[(ENH_NBLOCKS*ENH_BLOCKL+120)/2]; - int inLen=ENH_NBLOCKS*ENH_BLOCKL+120; - int start, plc_blockl, inlag; - - enh_buf=iLBCdec_inst->enh_buf; - enh_period=iLBCdec_inst->enh_period; - - memmove(enh_buf, &enh_buf[iLBCdec_inst->blockl], - (ENH_BUFL-iLBCdec_inst->blockl)*sizeof(float)); - - memcpy(&enh_buf[ENH_BUFL-iLBCdec_inst->blockl], in, - iLBCdec_inst->blockl*sizeof(float)); - - if (iLBCdec_inst->mode==30) - plc_blockl=ENH_BLOCKL; - else - plc_blockl=40; - - /* when 20 ms frame, move processing one block */ - ioffset=0; - if (iLBCdec_inst->mode==20) ioffset=1; - - i=3-ioffset; - memmove(enh_period, &enh_period[i], - (ENH_NBLOCKS_TOT-i)*sizeof(float)); - - - - - - - /* Set state information to the 6 samples right before - the samples to be downsampled. */ - - memcpy(lpState, - enh_buf+(ENH_NBLOCKS_EXTRA+ioffset)*ENH_BLOCKL-126, - 6*sizeof(float)); - - /* Down sample a factor 2 to save computations */ - - DownSample(enh_buf+(ENH_NBLOCKS_EXTRA+ioffset)*ENH_BLOCKL-120, - lpFilt_coefsTbl, inLen-ioffset*ENH_BLOCKL, - lpState, downsampled); - - /* Estimate the pitch in the down sampled domain. */ - for (iblock = 0; iblock maxcc) { - maxcc = cc; - lag = ilag; - } - } - - /* Store the estimated lag in the non-downsampled domain */ - enh_period[iblock+ENH_NBLOCKS_EXTRA+ioffset] = (float)lag*2; - - - } - - - /* PLC was performed on the previous packet */ - if (iLBCdec_inst->prev_enh_pl==1) { - - inlag=(int)enh_period[ENH_NBLOCKS_EXTRA+ioffset]; - - lag = inlag-1; - maxcc = xCorrCoef(in, in+lag, plc_blockl); - for (ilag=inlag; ilag<=inlag+1; ilag++) { - cc = xCorrCoef(in, in+ilag, plc_blockl); - - - - - - - if (cc > maxcc) { - maxcc = cc; - lag = ilag; - } - } - - enh_period[ENH_NBLOCKS_EXTRA+ioffset-1]=(float)lag; - - /* compute new concealed residual for the old lookahead, - mix the forward PLC with a backward PLC from - the new frame */ - - inPtr=&in[lag-1]; - - enh_bufPtr1=&plc_pred[plc_blockl-1]; - - if (lag>plc_blockl) { - start=plc_blockl; - } else { - start=lag; - } - - for (isample = start; isample>0; isample--) { - *enh_bufPtr1-- = *inPtr--; - } - - enh_bufPtr2=&enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl]; - for (isample = (plc_blockl-1-lag); isample>=0; isample--) { - *enh_bufPtr1-- = *enh_bufPtr2--; - } - - /* limit energy change */ - ftmp2=0.0; - ftmp1=0.0; - for (i=0;iblockl-i]* - enh_buf[ENH_BUFL-1-iLBCdec_inst->blockl-i]; - ftmp1+=plc_pred[i]*plc_pred[i]; - } - ftmp1=(float)sqrt(ftmp1/(float)plc_blockl); - ftmp2=(float)sqrt(ftmp2/(float)plc_blockl); - if (ftmp1>(float)2.0*ftmp2 && ftmp1>0.0) { - for (i=0;iblockl]; - for (i=0; imode==20) { - /* Enhancer with 40 samples delay */ - for (iblock = 0; iblock<2; iblock++) { - enhancer(out+iblock*ENH_BLOCKL, enh_buf, - ENH_BUFL, (5+iblock)*ENH_BLOCKL+40, - ENH_ALPHA0, enh_period, enh_plocsTbl, - ENH_NBLOCKS_TOT); - } - } else if (iLBCdec_inst->mode==30) { - /* Enhancer with 80 samples delay */ - for (iblock = 0; iblock<3; iblock++) { - enhancer(out+iblock*ENH_BLOCKL, enh_buf, - ENH_BUFL, (4+iblock)*ENH_BLOCKL, - ENH_ALPHA0, enh_period, enh_plocsTbl, - ENH_NBLOCKS_TOT); - } - } - - return (lag*2); - } - diff --git a/third_party/ilbc/enhancer.h b/third_party/ilbc/enhancer.h deleted file mode 100644 index 8a081fb..0000000 --- a/third_party/ilbc/enhancer.h +++ /dev/null @@ -1,36 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - enhancer.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - - - - - ******************************************************************/ - - #ifndef __ENHANCER_H - #define __ENHANCER_H - - #include "iLBC_define.h" - - float xCorrCoef( - float *target, /* (i) first array */ - float *regressor, /* (i) second array */ - int subl /* (i) dimension arrays */ - ); - - int enhancerInterface( - float *out, /* (o) the enhanced recidual signal */ - float *in, /* (i) the recidual signal to enhance */ - iLBC_Dec_Inst_t *iLBCdec_inst - /* (i/o) the decoder state structure */ - ); - - #endif - diff --git a/third_party/ilbc/filter.c b/third_party/ilbc/filter.c deleted file mode 100644 index 6565c2b..0000000 --- a/third_party/ilbc/filter.c +++ /dev/null @@ -1,175 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - filter.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include "iLBC_define.h" - - /*----------------------------------------------------------------* - * all-pole filter - *---------------------------------------------------------------*/ - - void AllPoleFilter( - float *InOut, /* (i/o) on entrance InOut[-orderCoef] to - InOut[-1] contain the state of the - filter (delayed samples). InOut[0] to - InOut[lengthInOut-1] contain the filter - input, on en exit InOut[-orderCoef] to - InOut[-1] is unchanged and InOut[0] to - InOut[lengthInOut-1] contain filtered - samples */ - float *Coef,/* (i) filter coefficients, Coef[0] is assumed - to be 1.0 */ - int lengthInOut,/* (i) number of input/output samples */ - int orderCoef /* (i) number of filter coefficients */ - ){ - int n,k; - - for(n=0;n - #include - #include "constants.h" - #include "filter.h" - - /*----------------------------------------------------------------* - * quantizer for the gain in the gain-shape coding of residual - *---------------------------------------------------------------*/ - - float gainquant(/* (o) quantized gain value */ - float in, /* (i) gain value */ - float maxIn,/* (i) maximum of gain value */ - int cblen, /* (i) number of quantization indices */ - int *index /* (o) quantization index */ - ){ - int i, tindex; - float minmeasure,measure, *cb, scale; - - /* ensure a lower bound on the scaling factor */ - - scale=maxIn; - - if (scale<0.1) { - scale=(float)0.1; - } - - /* select the quantization table */ - - if (cblen == 8) { - cb = gain_sq3Tbl; - } else if (cblen == 16) { - cb = gain_sq4Tbl; - } else { - cb = gain_sq5Tbl; - } - - /* select the best index in the quantization table */ - - minmeasure=10000000.0; - tindex=0; - for (i=0; i - - /*----------------------------------------------------------------* - * Construct codebook vector for given index. - *---------------------------------------------------------------*/ - - void getCBvec( - - - - - - float *cbvec, /* (o) Constructed codebook vector */ - float *mem, /* (i) Codebook buffer */ - int index, /* (i) Codebook index */ - int lMem, /* (i) Length of codebook buffer */ - int cbveclen/* (i) Codebook vector length */ - ){ - int j, k, n, memInd, sFilt; - float tmpbuf[CB_MEML]; - int base_size; - int ilow, ihigh; - float alfa, alfa1; - - /* Determine size of codebook sections */ - - base_size=lMem-cbveclen+1; - - if (cbveclen==SUBL) { - base_size+=cbveclen/2; - } - - /* No filter -> First codebook section */ - - if (index - - #include "iLBC_define.h" - #include "constants.h" - - /*----------------------------------------------------------------* - * calculation of auto correlation - *---------------------------------------------------------------*/ - - void autocorr( - float *r, /* (o) autocorrelation vector */ - const float *x, /* (i) data vector */ - int N, /* (i) length of data vector */ - int order /* largest lag for calculated - autocorrelations */ - ){ - int lag, n; - float sum; - - for (lag = 0; lag <= order; lag++) { - sum = 0; - for (n = 0; n < N - lag; n++) { - sum += x[n] * x[n+lag]; - } - r[lag] = sum; - } - - - - - - } - - /*----------------------------------------------------------------* - * window multiplication - *---------------------------------------------------------------*/ - - void window( - float *z, /* (o) the windowed data */ - const float *x, /* (i) the original data vector */ - const float *y, /* (i) the window */ - int N /* (i) length of all vectors */ - ){ - int i; - - for (i = 0; i < N; i++) { - z[i] = x[i] * y[i]; - } - } - - /*----------------------------------------------------------------* - * levinson-durbin solution for lpc coefficients - *---------------------------------------------------------------*/ - - void levdurb( - float *a, /* (o) lpc coefficient vector starting - with 1.0 */ - float *k, /* (o) reflection coefficients */ - float *r, /* (i) autocorrelation vector */ - int order /* (i) order of lpc filter */ - ){ - float sum, alpha; - int m, m_h, i; - - a[0] = 1.0; - - if (r[0] < EPS) { /* if r[0] <= 0, set LPC coeff. to zero */ - for (i = 0; i < order; i++) { - k[i] = 0; - a[i+1] = 0; - } - } else { - a[1] = k[0] = -r[1]/r[0]; - alpha = r[0] + r[1] * k[0]; - for (m = 1; m < order; m++){ - sum = r[m + 1]; - for (i = 0; i < m; i++){ - sum += a[i+1] * r[m - i]; - } - - - - - - k[m] = -sum / alpha; - alpha += k[m] * sum; - m_h = (m + 1) >> 1; - for (i = 0; i < m_h; i++){ - sum = a[i+1] + k[m] * a[m - i]; - a[m - i] += k[m] * a[i+1]; - a[i+1] = sum; - } - a[m+1] = k[m]; - } - } - } - - /*----------------------------------------------------------------* - * interpolation between vectors - *---------------------------------------------------------------*/ - - void interpolate( - float *out, /* (o) the interpolated vector */ - float *in1, /* (i) the first vector for the - interpolation */ - float *in2, /* (i) the second vector for the - interpolation */ - float coef, /* (i) interpolation weights */ - int length /* (i) length of all vectors */ - ){ - int i; - float invcoef; - - invcoef = (float)1.0 - coef; - for (i = 0; i < length; i++) { - out[i] = coef * in1[i] + invcoef * in2[i]; - } - } - - /*----------------------------------------------------------------* - * lpc bandwidth expansion - *---------------------------------------------------------------*/ - - void bwexpand( - float *out, /* (o) the bandwidth expanded lpc - coefficients */ - float *in, /* (i) the lpc coefficients before bandwidth - expansion */ - float coef, /* (i) the bandwidth expansion factor */ - int length /* (i) the length of lpc coefficient vectors */ - ){ - int i; - - - - - - float chirp; - - chirp = coef; - - out[0] = in[0]; - for (i = 1; i < length; i++) { - out[i] = chirp * in[i]; - chirp *= coef; - } - } - - /*----------------------------------------------------------------* - * vector quantization - *---------------------------------------------------------------*/ - - void vq( - float *Xq, /* (o) the quantized vector */ - int *index, /* (o) the quantization index */ - const float *CB,/* (i) the vector quantization codebook */ - float *X, /* (i) the vector to quantize */ - int n_cb, /* (i) the number of vectors in the codebook */ - int dim /* (i) the dimension of all vectors */ - ){ - int i, j; - int pos, minindex; - float dist, tmp, mindist; - - pos = 0; - mindist = FLOAT_MAX; - minindex = 0; - for (j = 0; j < n_cb; j++) { - dist = X[0] - CB[pos]; - dist *= dist; - for (i = 1; i < dim; i++) { - tmp = X[i] - CB[pos + i]; - dist += tmp*tmp; - } - - if (dist < mindist) { - mindist = dist; - minindex = j; - } - pos += dim; - } - for (i = 0; i < dim; i++) { - Xq[i] = CB[minindex*dim + i]; - } - *index = minindex; - - - - - - } - - /*----------------------------------------------------------------* - * split vector quantization - *---------------------------------------------------------------*/ - - void SplitVQ( - float *qX, /* (o) the quantized vector */ - int *index, /* (o) a vector of indexes for all vector - codebooks in the split */ - float *X, /* (i) the vector to quantize */ - const float *CB,/* (i) the quantizer codebook */ - int nsplit, /* the number of vector splits */ - const int *dim, /* the dimension of X and qX */ - const int *cbsize /* the number of vectors in the codebook */ - ){ - int cb_pos, X_pos, i; - - cb_pos = 0; - X_pos= 0; - for (i = 0; i < nsplit; i++) { - vq(qX + X_pos, index + i, CB + cb_pos, X + X_pos, - cbsize[i], dim[i]); - X_pos += dim[i]; - cb_pos += dim[i] * cbsize[i]; - } - } - - /*----------------------------------------------------------------* - * scalar quantization - *---------------------------------------------------------------*/ - - void sort_sq( - float *xq, /* (o) the quantized value */ - int *index, /* (o) the quantization index */ - float x, /* (i) the value to quantize */ - const float *cb,/* (i) the quantization codebook */ - int cb_size /* (i) the size of the quantization codebook */ - ){ - int i; - - if (x <= cb[0]) { - *index = 0; - *xq = cb[0]; - } else { - i = 0; - while ((x > cb[i]) && i < cb_size - 1) { - i++; - - - - - - } - - if (x > ((cb[i] + cb[i - 1])/2)) { - *index = i; - *xq = cb[i]; - } else { - *index = i - 1; - *xq = cb[i - 1]; - } - } - } - - /*----------------------------------------------------------------* - * check for stability of lsf coefficients - *---------------------------------------------------------------*/ - - int LSF_check( /* (o) 1 for stable lsf vectors and 0 for - nonstable ones */ - float *lsf, /* (i) a table of lsf vectors */ - int dim, /* (i) the dimension of each lsf vector */ - int NoAn /* (i) the number of lsf vectors in the - table */ - ){ - int k,n,m, Nit=2, change=0,pos; - float tmp; - static float eps=(float)0.039; /* 50 Hz */ - static float eps2=(float)0.0195; - static float maxlsf=(float)3.14; /* 4000 Hz */ - static float minlsf=(float)0.01; /* 0 Hz */ - - /* LSF separation check*/ - - for (n=0; nmaxlsf) { - lsf[pos]=maxlsf; - change=1; - } - } - } - } - - return change; - } - diff --git a/third_party/ilbc/helpfun.h b/third_party/ilbc/helpfun.h deleted file mode 100644 index 931ca68..0000000 --- a/third_party/ilbc/helpfun.h +++ /dev/null @@ -1,106 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - helpfun.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_HELPFUN_H - #define __iLBC_HELPFUN_H - - void autocorr( - float *r, /* (o) autocorrelation vector */ - const float *x, /* (i) data vector */ - int N, /* (i) length of data vector */ - int order /* largest lag for calculated - autocorrelations */ - ); - - void window( - float *z, /* (o) the windowed data */ - const float *x, /* (i) the original data vector */ - const float *y, /* (i) the window */ - int N /* (i) length of all vectors */ - ); - - void levdurb( - float *a, /* (o) lpc coefficient vector starting - with 1.0 */ - float *k, /* (o) reflection coefficients */ - float *r, /* (i) autocorrelation vector */ - int order /* (i) order of lpc filter */ - ); - - void interpolate( - - - - - - float *out, /* (o) the interpolated vector */ - float *in1, /* (i) the first vector for the - interpolation */ - float *in2, /* (i) the second vector for the - interpolation */ - float coef, /* (i) interpolation weights */ - int length /* (i) length of all vectors */ - ); - - void bwexpand( - float *out, /* (o) the bandwidth expanded lpc - coefficients */ - float *in, /* (i) the lpc coefficients before bandwidth - expansion */ - float coef, /* (i) the bandwidth expansion factor */ - int length /* (i) the length of lpc coefficient vectors */ - ); - - void vq( - float *Xq, /* (o) the quantized vector */ - int *index, /* (o) the quantization index */ - const float *CB,/* (i) the vector quantization codebook */ - float *X, /* (i) the vector to quantize */ - int n_cb, /* (i) the number of vectors in the codebook */ - int dim /* (i) the dimension of all vectors */ - ); - - void SplitVQ( - float *qX, /* (o) the quantized vector */ - int *index, /* (o) a vector of indexes for all vector - codebooks in the split */ - float *X, /* (i) the vector to quantize */ - const float *CB,/* (i) the quantizer codebook */ - int nsplit, /* the number of vector splits */ - const int *dim, /* the dimension of X and qX */ - const int *cbsize /* the number of vectors in the codebook */ - ); - - - void sort_sq( - float *xq, /* (o) the quantized value */ - int *index, /* (o) the quantization index */ - float x, /* (i) the value to quantize */ - const float *cb,/* (i) the quantization codebook */ - int cb_size /* (i) the size of the quantization codebook */ - ); - - int LSF_check( /* (o) 1 for stable lsf vectors and 0 for - - - - - - nonstable ones */ - float *lsf, /* (i) a table of lsf vectors */ - int dim, /* (i) the dimension of each lsf vector */ - int NoAn /* (i) the number of lsf vectors in the - table */ - ); - - #endif - diff --git a/third_party/ilbc/hpInput.c b/third_party/ilbc/hpInput.c deleted file mode 100644 index 7ceee09..0000000 --- a/third_party/ilbc/hpInput.c +++ /dev/null @@ -1,65 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - - - - - hpInput.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include "constants.h" - - /*----------------------------------------------------------------* - * Input high-pass filter - *---------------------------------------------------------------*/ - - void hpInput( - float *In, /* (i) vector to filter */ - int len, /* (i) length of vector to filter */ - float *Out, /* (o) the resulting filtered vector */ - float *mem /* (i/o) the filter state */ - ){ - int i; - float *pi, *po; - - /* all-zero section*/ - - pi = &In[0]; - po = &Out[0]; - for (i=0; i - - #include "iLBC_define.h" - #include "gainquant.h" - #include "getCBvec.h" - - /*----------------------------------------------------------------* - * Convert the codebook indexes to make the search easier - *---------------------------------------------------------------*/ - - - - - - - void index_conv_enc( - int *index /* (i/o) Codebook indexes */ - ){ - int k; - - for (k=1; k=108)&&(index[k]<172)) { - index[k]-=64; - } else if (index[k]>=236) { - index[k]-=128; - } else { - /* ERROR */ - } - } - } - - void index_conv_dec( - int *index /* (i/o) Codebook indexes */ - ){ - int k; - - for (k=1; k=44)&&(index[k]<108)) { - index[k]+=64; - } else if ((index[k]>=108)&&(index[k]<128)) { - index[k]+=128; - } else { - /* ERROR */ - } - } - } - - /*----------------------------------------------------------------* - * Construct decoded vector from codebook and gains. - *---------------------------------------------------------------*/ - - void iCBConstruct( - float *decvector, /* (o) Decoded vector */ - int *index, /* (i) Codebook indices */ - int *gain_index,/* (i) Gain quantization indices */ - float *mem, /* (i) Buffer for codevector construction */ - int lMem, /* (i) Length of buffer */ - int veclen, /* (i) Length of vector */ - int nStages /* (i) Number of codebook stages */ - ){ - int j,k; - - - - - - float gain[CB_NSTAGES]; - float cbvec[SUBL]; - - /* gain de-quantization */ - - gain[0] = gaindequant(gain_index[0], 1.0, 32); - if (nStages > 1) { - gain[1] = gaindequant(gain_index[1], - (float)fabs(gain[0]), 16); - } - if (nStages > 2) { - gain[2] = gaindequant(gain_index[2], - (float)fabs(gain[1]), 8); - } - - /* codebook vector construction and construction of - total vector */ - - getCBvec(cbvec, mem, index[0], lMem, veclen); - for (j=0;j 1) { - for (k=1; k - #include - - #include "iLBC_define.h" - #include "gainquant.h" - #include "createCB.h" - #include "filter.h" - #include "constants.h" - - /*----------------------------------------------------------------* - * Search routine for codebook encoding and gain quantization. - *---------------------------------------------------------------*/ - - void iCBSearch( - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i) the encoder state structure */ - int *index, /* (o) Codebook indices */ - int *gain_index,/* (o) Gain quantization indices */ - - - - - - float *intarget,/* (i) Target vector for encoding */ - float *mem, /* (i) Buffer for codebook construction */ - int lMem, /* (i) Length of buffer */ - int lTarget, /* (i) Length of vector */ - int nStages, /* (i) Number of codebook stages */ - float *weightDenum, /* (i) weighting filter coefficients */ - float *weightState, /* (i) weighting filter state */ - int block /* (i) the sub-block number */ - ){ - int i, j, icount, stage, best_index, range, counter; - float max_measure, gain, measure, crossDot, ftmp; - float gains[CB_NSTAGES]; - float target[SUBL]; - int base_index, sInd, eInd, base_size; - int sIndAug=0, eIndAug=0; - float buf[CB_MEML+SUBL+2*LPC_FILTERORDER]; - float invenergy[CB_EXPAND*128], energy[CB_EXPAND*128]; - float *pp, *ppi=0, *ppo=0, *ppe=0; - float cbvectors[CB_MEML]; - float tene, cene, cvec[SUBL]; - float aug_vec[SUBL]; - - memset(cvec,0,SUBL*sizeof(float)); - - /* Determine size of codebook sections */ - - base_size=lMem-lTarget+1; - - if (lTarget==SUBL) { - base_size=lMem-lTarget+1+lTarget/2; - } - - /* setup buffer for weighting */ - - memcpy(buf,weightState,sizeof(float)*LPC_FILTERORDER); - memcpy(buf+LPC_FILTERORDER,mem,lMem*sizeof(float)); - memcpy(buf+LPC_FILTERORDER+lMem,intarget,lTarget*sizeof(float)); - - /* weighting */ - - AllPoleFilter(buf+LPC_FILTERORDER, weightDenum, - lMem+lTarget, LPC_FILTERORDER); - - /* Construct the codebook and target needed */ - - memcpy(target, buf+LPC_FILTERORDER+lMem, lTarget*sizeof(float)); - - tene=0.0; - - - - - - for (i=0; i0.0) { - invenergy[0] = (float) 1.0 / (*ppe + EPS); - } else { - invenergy[0] = (float) 0.0; - - - - - - } - ppe++; - - measure=(float)-10000000.0; - - if (crossDot > 0.0) { - measure = crossDot*crossDot*invenergy[0]; - } - } - else { - measure = crossDot*crossDot*invenergy[0]; - } - - /* check if measure is better */ - ftmp = crossDot*invenergy[0]; - - if ((measure>max_measure) && (fabs(ftmp)0.0) { - invenergy[icount] = - (float)1.0/(energy[icount]+EPS); - } else { - invenergy[icount] = (float) 0.0; - } - - - - - - measure=(float)-10000000.0; - - if (crossDot > 0.0) { - measure = crossDot*crossDot*invenergy[icount]; - } - } - else { - measure = crossDot*crossDot*invenergy[icount]; - } - - /* check if measure is better */ - ftmp = crossDot*invenergy[icount]; - - if ((measure>max_measure) && (fabs(ftmp) range) { - sInd -= (eInd-range); - eInd = range; - } - } else { /* base_index >= (base_size-20) */ - - if (sInd < (base_size-20)) { - sIndAug = 20; - sInd = 0; - eInd = 0; - eIndAug = 19 + CB_RESRANGE; - - if(eIndAug > 39) { - eInd = eIndAug-39; - eIndAug = 39; - } - } else { - sIndAug = 20 + sInd - (base_size-20); - eIndAug = 39; - sInd = 0; - eInd = CB_RESRANGE - (eIndAug-sIndAug+1); - } - } - - } else { /* lTarget = 22 or 23 */ - - if (sInd < 0) { - eInd -= sInd; - - - - - - sInd = 0; - } - - if(eInd > range) { - sInd -= (eInd - range); - eInd = range; - } - } - - //} -# endif /* CB_RESRANGE == -1 */ - - - /* search of higher codebook section */ - - /* index search range */ - counter = sInd; - sInd += base_size; - eInd += base_size; - - - if (stage==0) { - ppe = energy+base_size; - *ppe=0.0; - - pp=cbvectors+lMem-lTarget; - for (j=0; j0.0) { - invenergy[icount] =(float)1.0/(energy[icount]+EPS); - } else { - invenergy[icount] =(float)0.0; - } - - if (stage==0) { - - measure=(float)-10000000.0; - - if (crossDot > 0.0) { - measure = crossDot*crossDot* - invenergy[icount]; - } - } - else { - measure = crossDot*crossDot*invenergy[icount]; - } - - /* check if measure is better */ - ftmp = crossDot*invenergy[icount]; - - if ((measure>max_measure) && (fabs(ftmp)CB_MAXGAIN) { - gain = (float)CB_MAXGAIN; - } - gain = gainquant(gain, 1.0, 32, &gain_index[stage]); - } - else { - if (stage==1) { - gain = gainquant(gain, (float)fabs(gains[stage-1]), - 16, &gain_index[stage]); - } else { - gain = gainquant(gain, (float)fabs(gains[stage-1]), - 8, &gain_index[stage]); - } - } - - /* Extract the best (according to measure) - codebook vector */ - - if (lTarget==(STATE_LEN-iLBCenc_inst->state_short_len)) { - - if (index[stage] - #include - - #include "iLBC_define.h" - #include "StateConstructW.h" - #include "LPCdecode.h" - #include "iCBConstruct.h" - #include "doCPLC.h" - #include "helpfun.h" - #include "constants.h" - #include "packing.h" - #include "string.h" - #include "enhancer.h" - #include "hpOutput.h" - #include "syntFilter.h" - - /*----------------------------------------------------------------* - * Initiation of decoder instance. - *---------------------------------------------------------------*/ - - short initDecode( /* (o) Number of decoded - samples */ - iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */ - int mode, /* (i) frame size mode */ - int use_enhancer /* (i) 1 to use enhancer - 0 to run without - enhancer */ - ){ - int i; - - iLBCdec_inst->mode = mode; - - - - - - if (mode==30) { - iLBCdec_inst->blockl = BLOCKL_30MS; - iLBCdec_inst->nsub = NSUB_30MS; - iLBCdec_inst->nasub = NASUB_30MS; - iLBCdec_inst->lpc_n = LPC_N_30MS; - iLBCdec_inst->no_of_bytes = NO_OF_BYTES_30MS; - iLBCdec_inst->no_of_words = NO_OF_WORDS_30MS; - iLBCdec_inst->state_short_len=STATE_SHORT_LEN_30MS; - /* ULP init */ - iLBCdec_inst->ULP_inst=&ULP_30msTbl; - } - else if (mode==20) { - iLBCdec_inst->blockl = BLOCKL_20MS; - iLBCdec_inst->nsub = NSUB_20MS; - iLBCdec_inst->nasub = NASUB_20MS; - iLBCdec_inst->lpc_n = LPC_N_20MS; - iLBCdec_inst->no_of_bytes = NO_OF_BYTES_20MS; - iLBCdec_inst->no_of_words = NO_OF_WORDS_20MS; - iLBCdec_inst->state_short_len=STATE_SHORT_LEN_20MS; - /* ULP init */ - iLBCdec_inst->ULP_inst=&ULP_20msTbl; - } - else { - exit(2); - } - - memset(iLBCdec_inst->syntMem, 0, - LPC_FILTERORDER*sizeof(float)); - memcpy((*iLBCdec_inst).lsfdeqold, lsfmeanTbl, - LPC_FILTERORDER*sizeof(float)); - - memset(iLBCdec_inst->old_syntdenum, 0, - ((LPC_FILTERORDER + 1)*NSUB_MAX)*sizeof(float)); - for (i=0; iold_syntdenum[i*(LPC_FILTERORDER+1)]=1.0; - - iLBCdec_inst->last_lag = 20; - - iLBCdec_inst->prevLag = 120; - iLBCdec_inst->per = 0.0; - iLBCdec_inst->consPLICount = 0; - iLBCdec_inst->prevPLI = 0; - iLBCdec_inst->prevLpc[0] = 1.0; - memset(iLBCdec_inst->prevLpc+1,0, - LPC_FILTERORDER*sizeof(float)); - memset(iLBCdec_inst->prevResidual, 0, BLOCKL_MAX*sizeof(float)); - iLBCdec_inst->seed=777; - - - - - - - memset(iLBCdec_inst->hpomem, 0, 4*sizeof(float)); - - iLBCdec_inst->use_enhancer = use_enhancer; - memset(iLBCdec_inst->enh_buf, 0, ENH_BUFL*sizeof(float)); - for (i=0;ienh_period[i]=(float)40.0; - - iLBCdec_inst->prev_enh_pl = 0; - - return (short)(iLBCdec_inst->blockl); - } - - /*----------------------------------------------------------------* - * frame residual decoder function (subrutine to iLBC_decode) - *---------------------------------------------------------------*/ - - void Decode( - iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state - structure */ - float *decresidual, /* (o) decoded residual frame */ - int start, /* (i) location of start - state */ - int idxForMax, /* (i) codebook index for the - maximum value */ - int *idxVec, /* (i) codebook indexes for the - samples in the start - state */ - float *syntdenum, /* (i) the decoded synthesis - filter coefficients */ - int *cb_index, /* (i) the indexes for the - adaptive codebook */ - int *gain_index, /* (i) the indexes for the - corresponding gains */ - int *extra_cb_index, /* (i) the indexes for the - adaptive codebook part - of start state */ - int *extra_gain_index, /* (i) the indexes for the - corresponding gains */ - int state_first /* (i) 1 if non adaptive part - of start state comes - first 0 if that part - comes last */ - ){ - float reverseDecresidual[BLOCKL_MAX], mem[CB_MEML]; - int k, meml_gotten, Nfor, Nback, i; - int diff, start_pos; - int subcount, subframe; - - - - - - - diff = STATE_LEN - iLBCdec_inst->state_short_len; - - if (state_first == 1) { - start_pos = (start-1)*SUBL; - } else { - start_pos = (start-1)*SUBL + diff; - } - - /* decode scalar part of start state */ - - StateConstructW(idxForMax, idxVec, - &syntdenum[(start-1)*(LPC_FILTERORDER+1)], - &decresidual[start_pos], iLBCdec_inst->state_short_len); - - - if (state_first) { /* put adaptive part in the end */ - - /* setup memory */ - - memset(mem, 0, - (CB_MEML-iLBCdec_inst->state_short_len)*sizeof(float)); - memcpy(mem+CB_MEML-iLBCdec_inst->state_short_len, - decresidual+start_pos, - iLBCdec_inst->state_short_len*sizeof(float)); - - /* construct decoded vector */ - - iCBConstruct( - &decresidual[start_pos+iLBCdec_inst->state_short_len], - extra_cb_index, extra_gain_index, mem+CB_MEML-stMemLTbl, - stMemLTbl, diff, CB_NSTAGES); - - } - else {/* put adaptive part in the beginning */ - - /* create reversed vectors for prediction */ - - for (k=0; kstate_short_len)]; - } - - /* setup memory */ - - meml_gotten = iLBCdec_inst->state_short_len; - for (k=0; knsub-start-1; - - if ( Nfor > 0 ){ - - /* setup memory */ - - memset(mem, 0, (CB_MEML-STATE_LEN)*sizeof(float)); - memcpy(mem+CB_MEML-STATE_LEN, decresidual+(start-1)*SUBL, - STATE_LEN*sizeof(float)); - - /* loop over sub-frames to encode */ - - for (subframe=0; subframe 0 ) { - - /* setup memory */ - - meml_gotten = SUBL*(iLBCdec_inst->nsub+1-start); - - if ( meml_gotten > CB_MEML ) { - meml_gotten=CB_MEML; - } - for (k=0; k0) { /* the data are good */ - - /* decode data */ - - pbytes=bytes; - pos=0; - - - - - - - /* Set everything to zero before decoding */ - - for (k=0; kstate_short_len; k++) { - idxVec[k]=0; - } - for (k=0; knasub; i++) { - for (k=0; knasub; i++) { - for (k=0; klpc_n; k++){ - unpack( &pbytes, &lastpart, - iLBCdec_inst->ULP_inst->lsf_bits[k][ulp], &pos); - packcombine(&lsf_i[k], lastpart, - iLBCdec_inst->ULP_inst->lsf_bits[k][ulp]); - } - - /* Start block info */ - - unpack( &pbytes, &lastpart, - iLBCdec_inst->ULP_inst->start_bits[ulp], &pos); - packcombine(&start, lastpart, - iLBCdec_inst->ULP_inst->start_bits[ulp]); - - unpack( &pbytes, &lastpart, - - - - - - iLBCdec_inst->ULP_inst->startfirst_bits[ulp], &pos); - packcombine(&state_first, lastpart, - iLBCdec_inst->ULP_inst->startfirst_bits[ulp]); - - unpack( &pbytes, &lastpart, - iLBCdec_inst->ULP_inst->scale_bits[ulp], &pos); - packcombine(&idxForMax, lastpart, - iLBCdec_inst->ULP_inst->scale_bits[ulp]); - - for (k=0; kstate_short_len; k++) { - unpack( &pbytes, &lastpart, - iLBCdec_inst->ULP_inst->state_bits[ulp], &pos); - packcombine(idxVec+k, lastpart, - iLBCdec_inst->ULP_inst->state_bits[ulp]); - } - - /* 23/22 (20ms/30ms) sample block */ - - for (k=0; kULP_inst->extra_cb_index[k][ulp], - &pos); - packcombine(extra_cb_index+k, lastpart, - iLBCdec_inst->ULP_inst->extra_cb_index[k][ulp]); - } - for (k=0; kULP_inst->extra_cb_gain[k][ulp], - &pos); - packcombine(extra_gain_index+k, lastpart, - iLBCdec_inst->ULP_inst->extra_cb_gain[k][ulp]); - } - - /* The two/four (20ms/30ms) 40 sample sub-blocks */ - - for (i=0; inasub; i++) { - for (k=0; kULP_inst->cb_index[i][k][ulp], - &pos); - packcombine(cb_index+i*CB_NSTAGES+k, lastpart, - iLBCdec_inst->ULP_inst->cb_index[i][k][ulp]); - } - } - - for (i=0; inasub; i++) { - for (k=0; kULP_inst->cb_gain[i][k][ulp], - &pos); - packcombine(gain_index+i*CB_NSTAGES+k, lastpart, - iLBCdec_inst->ULP_inst->cb_gain[i][k][ulp]); - } - } - } - /* Extract last bit. If it is 1 this indicates an - empty/lost frame */ - unpack( &pbytes, &last_bit, 1, &pos); - - /* Check for bit errors or empty/lost frames */ - if (start<1) - mode = 0; - if (iLBCdec_inst->mode==20 && start>3) - mode = 0; - if (iLBCdec_inst->mode==30 && start>5) - mode = 0; - if (last_bit==1) - mode = 0; - - if (mode==1) { /* No bit errors was detected, - continue decoding */ - - /* adjust index */ - index_conv_dec(cb_index); - - /* decode the lsf */ - - SimplelsfDEQ(lsfdeq, lsf_i, iLBCdec_inst->lpc_n); - check=LSF_check(lsfdeq, LPC_FILTERORDER, - iLBCdec_inst->lpc_n); - DecoderInterpolateLSF(syntdenum, weightdenum, - lsfdeq, LPC_FILTERORDER, iLBCdec_inst); - - Decode(iLBCdec_inst, decresidual, start, idxForMax, - idxVec, syntdenum, cb_index, gain_index, - extra_cb_index, extra_gain_index, - state_first); - - /* preparing the plc for a future loss! */ - - doThePLC(PLCresidual, PLClpc, 0, decresidual, - syntdenum + - (LPC_FILTERORDER + 1)*(iLBCdec_inst->nsub - 1), - (*iLBCdec_inst).last_lag, iLBCdec_inst); - - - - - - - - memcpy(decresidual, PLCresidual, - iLBCdec_inst->blockl*sizeof(float)); - } - - } - - if (mode == 0) { - /* the data is bad (either a PLC call - * was made or a severe bit error was detected) - */ - - /* packet loss conceal */ - - memset(zeros, 0, BLOCKL_MAX*sizeof(float)); - - one[0] = 1; - memset(one+1, 0, LPC_FILTERORDER*sizeof(float)); - - start=0; - - doThePLC(PLCresidual, PLClpc, 1, zeros, one, - (*iLBCdec_inst).last_lag, iLBCdec_inst); - memcpy(decresidual, PLCresidual, - iLBCdec_inst->blockl*sizeof(float)); - - order_plus_one = LPC_FILTERORDER + 1; - for (i = 0; i < iLBCdec_inst->nsub; i++) { - memcpy(syntdenum+(i*order_plus_one), PLClpc, - order_plus_one*sizeof(float)); - } - } - - if (iLBCdec_inst->use_enhancer == 1) { - - /* post filtering */ - - iLBCdec_inst->last_lag = - enhancerInterface(data, decresidual, iLBCdec_inst); - - /* synthesis filtering */ - - if (iLBCdec_inst->mode==20) { - /* Enhancer has 40 samples delay */ - i=0; - syntFilter(data + i*SUBL, - iLBCdec_inst->old_syntdenum + - (i+iLBCdec_inst->nsub-1)*(LPC_FILTERORDER+1), - SUBL, iLBCdec_inst->syntMem); - - - - - - for (i=1; i < iLBCdec_inst->nsub; i++) { - syntFilter(data + i*SUBL, - syntdenum + (i-1)*(LPC_FILTERORDER+1), - SUBL, iLBCdec_inst->syntMem); - } - } else if (iLBCdec_inst->mode==30) { - /* Enhancer has 80 samples delay */ - for (i=0; i < 2; i++) { - syntFilter(data + i*SUBL, - iLBCdec_inst->old_syntdenum + - (i+iLBCdec_inst->nsub-2)*(LPC_FILTERORDER+1), - SUBL, iLBCdec_inst->syntMem); - } - for (i=2; i < iLBCdec_inst->nsub; i++) { - syntFilter(data + i*SUBL, - syntdenum + (i-2)*(LPC_FILTERORDER+1), SUBL, - iLBCdec_inst->syntMem); - } - } - - } else { - - /* Find last lag */ - lag = 20; - maxcc = xCorrCoef(&decresidual[BLOCKL_MAX-ENH_BLOCKL], - &decresidual[BLOCKL_MAX-ENH_BLOCKL-lag], ENH_BLOCKL); - - for (ilag=21; ilag<120; ilag++) { - cc = xCorrCoef(&decresidual[BLOCKL_MAX-ENH_BLOCKL], - &decresidual[BLOCKL_MAX-ENH_BLOCKL-ilag], - ENH_BLOCKL); - - if (cc > maxcc) { - maxcc = cc; - lag = ilag; - } - } - iLBCdec_inst->last_lag = lag; - - /* copy data and run synthesis filter */ - - memcpy(data, decresidual, - iLBCdec_inst->blockl*sizeof(float)); - for (i=0; i < iLBCdec_inst->nsub; i++) { - syntFilter(data + i*SUBL, - syntdenum + i*(LPC_FILTERORDER+1), SUBL, - iLBCdec_inst->syntMem); - } - - - - - - } - - /* high pass filtering on output if desired, otherwise - copy to out */ - - hpOutput(data, iLBCdec_inst->blockl, - decblock,iLBCdec_inst->hpomem); - - /* memcpy(decblock,data,iLBCdec_inst->blockl*sizeof(float));*/ - - memcpy(iLBCdec_inst->old_syntdenum, syntdenum, - - iLBCdec_inst->nsub*(LPC_FILTERORDER+1)*sizeof(float)); - - iLBCdec_inst->prev_enh_pl=0; - - if (mode==0) { /* PLC was used */ - iLBCdec_inst->prev_enh_pl=1; - } - } - diff --git a/third_party/ilbc/iLBC_decode.h b/third_party/ilbc/iLBC_decode.h deleted file mode 100644 index 5f4384d..0000000 --- a/third_party/ilbc/iLBC_decode.h +++ /dev/null @@ -1,42 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iLBC_decode.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_ILBCDECODE_H - #define __iLBC_ILBCDECODE_H - - #include "iLBC_define.h" - - short initDecode( /* (o) Number of decoded - samples */ - iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */ - int mode, /* (i) frame size mode */ - int use_enhancer /* (i) 1 to use enhancer - 0 to run without - enhancer */ - ); - - void iLBC_decode( - float *decblock, /* (o) decoded signal block */ - unsigned char *bytes, /* (i) encoded signal bits */ - iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) the decoder state - structure */ - int mode /* (i) 0: bad packet, PLC, - 1: normal */ - - - - - - ); - - #endif - diff --git a/third_party/ilbc/iLBC_define.h b/third_party/ilbc/iLBC_define.h deleted file mode 100644 index 480c834..0000000 --- a/third_party/ilbc/iLBC_define.h +++ /dev/null @@ -1,217 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iLBC_define.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - #include - - #ifndef __iLBC_ILBCDEFINE_H - #define __iLBC_ILBCDEFINE_H - - /* general codec settings */ - - #define FS (float)8000.0 - #define BLOCKL_20MS 160 - #define BLOCKL_30MS 240 - #define BLOCKL_MAX 240 - #define NSUB_20MS 4 - #define NSUB_30MS 6 - #define NSUB_MAX 6 - #define NASUB_20MS 2 - - - - - - #define NASUB_30MS 4 - #define NASUB_MAX 4 - #define SUBL 40 - #define STATE_LEN 80 - #define STATE_SHORT_LEN_30MS 58 - #define STATE_SHORT_LEN_20MS 57 - - /* LPC settings */ - - #define LPC_FILTERORDER 10 - #define LPC_CHIRP_SYNTDENUM (float)0.9025 - #define LPC_CHIRP_WEIGHTDENUM (float)0.4222 - #define LPC_LOOKBACK 60 - #define LPC_N_20MS 1 - #define LPC_N_30MS 2 - #define LPC_N_MAX 2 - #define LPC_ASYMDIFF 20 - #define LPC_BW (float)60.0 - #define LPC_WN (float)1.0001 - #define LSF_NSPLIT 3 - #define LSF_NUMBER_OF_STEPS 4 - #define LPC_HALFORDER (LPC_FILTERORDER/2) - - /* cb settings */ - - #define CB_NSTAGES 3 - #define CB_EXPAND 2 - #define CB_MEML 147 - #define CB_FILTERLEN 2*4 - #define CB_HALFFILTERLEN 4 - #define CB_RESRANGE 34 - #define CB_MAXGAIN (float)1.3 - - /* enhancer */ - - #define ENH_BLOCKL 80 /* block length */ - #define ENH_BLOCKL_HALF (ENH_BLOCKL/2) - #define ENH_HL 3 /* 2*ENH_HL+1 is number blocks - in said second sequence */ - #define ENH_SLOP 2 /* max difference estimated and - correct pitch period */ - #define ENH_PLOCSL 20 /* pitch-estimates and pitch- - locations buffer length */ - #define ENH_OVERHANG 2 - #define ENH_UPS0 4 /* upsampling rate */ - #define ENH_FL0 3 /* 2*FLO+1 is the length of - each filter */ - #define ENH_VECTL (ENH_BLOCKL+2*ENH_FL0) - - - - - - #define ENH_CORRDIM (2*ENH_SLOP+1) - #define ENH_NBLOCKS (BLOCKL_MAX/ENH_BLOCKL) - #define ENH_NBLOCKS_EXTRA 5 - #define ENH_NBLOCKS_TOT 8 /* ENH_NBLOCKS + - ENH_NBLOCKS_EXTRA */ - #define ENH_BUFL (ENH_NBLOCKS_TOT)*ENH_BLOCKL - #define ENH_ALPHA0 (float)0.05 - - /* Down sampling */ - - #define FILTERORDER_DS 7 - #define DELAY_DS 3 - #define FACTOR_DS 2 - - /* bit stream defs */ - - #define NO_OF_BYTES_20MS 38 - #define NO_OF_BYTES_30MS 50 - #define NO_OF_WORDS_20MS 19 - #define NO_OF_WORDS_30MS 25 - #define STATE_BITS 3 - #define BYTE_LEN 8 - #define ULP_CLASSES 3 - - /* help parameters */ - - #define FLOAT_MAX (float)1.0e37 - #define EPS (float)2.220446049250313e-016 - #define PI (float)3.14159265358979323846 - #define MIN_SAMPLE -32768 - #define MAX_SAMPLE 32767 - #define TWO_PI (float)6.283185307 - #define PI2 (float)0.159154943 - - /* type definition encoder instance */ - typedef struct iLBC_ULP_Inst_t_ { - int lsf_bits[6][ULP_CLASSES+2]; - int start_bits[ULP_CLASSES+2]; - int startfirst_bits[ULP_CLASSES+2]; - int scale_bits[ULP_CLASSES+2]; - int state_bits[ULP_CLASSES+2]; - int extra_cb_index[CB_NSTAGES][ULP_CLASSES+2]; - int extra_cb_gain[CB_NSTAGES][ULP_CLASSES+2]; - int cb_index[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2]; - int cb_gain[NSUB_MAX][CB_NSTAGES][ULP_CLASSES+2]; - } iLBC_ULP_Inst_t; - - /* type definition encoder instance */ - - - - - - typedef struct iLBC_Enc_Inst_t_ { - - /* flag for frame size mode */ - int mode; - - /* basic parameters for different frame sizes */ - int blockl; - int nsub; - int nasub; - int no_of_bytes, no_of_words; - int lpc_n; - int state_short_len; - const iLBC_ULP_Inst_t *ULP_inst; - - /* analysis filter state */ - float anaMem[LPC_FILTERORDER]; - - /* old lsf parameters for interpolation */ - float lsfold[LPC_FILTERORDER]; - float lsfdeqold[LPC_FILTERORDER]; - - /* signal buffer for LP analysis */ - float lpc_buffer[LPC_LOOKBACK + BLOCKL_MAX]; - - /* state of input HP filter */ - float hpimem[4]; - - } iLBC_Enc_Inst_t; - - /* type definition decoder instance */ - typedef struct iLBC_Dec_Inst_t_ { - - /* flag for frame size mode */ - int mode; - - /* basic parameters for different frame sizes */ - int blockl; - int nsub; - int nasub; - int no_of_bytes, no_of_words; - int lpc_n; - int state_short_len; - const iLBC_ULP_Inst_t *ULP_inst; - - /* synthesis filter state */ - float syntMem[LPC_FILTERORDER]; - - /* old LSF for interpolation */ - - - - - - float lsfdeqold[LPC_FILTERORDER]; - - /* pitch lag estimated in enhancer and used in PLC */ - int last_lag; - - /* PLC state information */ - int prevLag, consPLICount, prevPLI, prev_enh_pl; - float prevLpc[LPC_FILTERORDER+1]; - float prevResidual[NSUB_MAX*SUBL]; - float per; - unsigned long seed; - - /* previous synthesis filter parameters */ - float old_syntdenum[(LPC_FILTERORDER + 1)*NSUB_MAX]; - - /* state of output HP filter */ - float hpomem[4]; - - /* enhancer state information */ - int use_enhancer; - float enh_buf[ENH_BUFL]; - float enh_period[ENH_NBLOCKS_TOT]; - - } iLBC_Dec_Inst_t; - - #endif - diff --git a/third_party/ilbc/iLBC_encode.c b/third_party/ilbc/iLBC_encode.c deleted file mode 100644 index 4385458..0000000 --- a/third_party/ilbc/iLBC_encode.c +++ /dev/null @@ -1,543 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iLBC_encode.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include - #include - #include - - #include "iLBC_define.h" - #include "LPCencode.h" - #include "FrameClassify.h" - #include "StateSearchW.h" - #include "StateConstructW.h" - #include "helpfun.h" - #include "constants.h" - #include "packing.h" - #include "iCBSearch.h" - #include "iCBConstruct.h" - #include "hpInput.h" - #include "anaFilter.h" - #include "syntFilter.h" - - /*----------------------------------------------------------------* - * Initiation of encoder instance. - *---------------------------------------------------------------*/ - - short initEncode( /* (o) Number of bytes - encoded */ - iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */ - int mode /* (i) frame size mode */ - ){ - iLBCenc_inst->mode = mode; - if (mode==30) { - iLBCenc_inst->blockl = BLOCKL_30MS; - iLBCenc_inst->nsub = NSUB_30MS; - iLBCenc_inst->nasub = NASUB_30MS; - iLBCenc_inst->lpc_n = LPC_N_30MS; - iLBCenc_inst->no_of_bytes = NO_OF_BYTES_30MS; - iLBCenc_inst->no_of_words = NO_OF_WORDS_30MS; - - - - - - iLBCenc_inst->state_short_len=STATE_SHORT_LEN_30MS; - /* ULP init */ - iLBCenc_inst->ULP_inst=&ULP_30msTbl; - } - else if (mode==20) { - iLBCenc_inst->blockl = BLOCKL_20MS; - iLBCenc_inst->nsub = NSUB_20MS; - iLBCenc_inst->nasub = NASUB_20MS; - iLBCenc_inst->lpc_n = LPC_N_20MS; - iLBCenc_inst->no_of_bytes = NO_OF_BYTES_20MS; - iLBCenc_inst->no_of_words = NO_OF_WORDS_20MS; - iLBCenc_inst->state_short_len=STATE_SHORT_LEN_20MS; - /* ULP init */ - iLBCenc_inst->ULP_inst=&ULP_20msTbl; - } - else { - exit(2); - } - - memset((*iLBCenc_inst).anaMem, 0, - LPC_FILTERORDER*sizeof(float)); - memcpy((*iLBCenc_inst).lsfold, lsfmeanTbl, - LPC_FILTERORDER*sizeof(float)); - memcpy((*iLBCenc_inst).lsfdeqold, lsfmeanTbl, - LPC_FILTERORDER*sizeof(float)); - memset((*iLBCenc_inst).lpc_buffer, 0, - (LPC_LOOKBACK+BLOCKL_MAX)*sizeof(float)); - memset((*iLBCenc_inst).hpimem, 0, 4*sizeof(float)); - - return (short)(iLBCenc_inst->no_of_bytes); - } - - /*----------------------------------------------------------------* - * main encoder function - *---------------------------------------------------------------*/ - - void iLBC_encode( - unsigned char *bytes, /* (o) encoded data bits iLBC */ - float *block, /* (o) speech vector to - encode */ - iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder - state */ - ){ - - float data[BLOCKL_MAX]; - float residual[BLOCKL_MAX], reverseResidual[BLOCKL_MAX]; - - int start, idxForMax, idxVec[STATE_LEN]; - - - - - - float reverseDecresidual[BLOCKL_MAX], mem[CB_MEML]; - int n, k, meml_gotten, Nfor, Nback, i, pos; - int gain_index[CB_NSTAGES*NASUB_MAX], - extra_gain_index[CB_NSTAGES]; - int cb_index[CB_NSTAGES*NASUB_MAX],extra_cb_index[CB_NSTAGES]; - int lsf_i[LSF_NSPLIT*LPC_N_MAX]; - unsigned char *pbytes; - int diff, start_pos, state_first; - float en1, en2; - int index, ulp, firstpart; - int subcount, subframe; - float weightState[LPC_FILTERORDER]; - float syntdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; - float weightdenum[NSUB_MAX*(LPC_FILTERORDER+1)]; - float decresidual[BLOCKL_MAX]; - - /* high pass filtering of input signal if such is not done - prior to calling this function */ - - hpInput(block, iLBCenc_inst->blockl, - data, (*iLBCenc_inst).hpimem); - - /* otherwise simply copy */ - - /*memcpy(data,block,iLBCenc_inst->blockl*sizeof(float));*/ - - /* LPC of hp filtered input data */ - - LPCencode(syntdenum, weightdenum, lsf_i, data, iLBCenc_inst); - - - /* inverse filter to get residual */ - - for (n=0; nnsub; n++) { - anaFilter(&data[n*SUBL], &syntdenum[n*(LPC_FILTERORDER+1)], - SUBL, &residual[n*SUBL], iLBCenc_inst->anaMem); - } - - /* find state location */ - - start = FrameClassify(iLBCenc_inst, residual); - - /* check if state should be in first or last part of the - two subframes */ - - diff = STATE_LEN - iLBCenc_inst->state_short_len; - en1 = 0; - index = (start-1)*SUBL; - - - - - - for (i = 0; i < iLBCenc_inst->state_short_len; i++) { - en1 += residual[index+i]*residual[index+i]; - } - en2 = 0; - index = (start-1)*SUBL+diff; - for (i = 0; i < iLBCenc_inst->state_short_len; i++) { - en2 += residual[index+i]*residual[index+i]; - } - - - if (en1 > en2) { - state_first = 1; - start_pos = (start-1)*SUBL; - } else { - state_first = 0; - start_pos = (start-1)*SUBL + diff; - } - - /* scalar quantization of state */ - - StateSearchW(iLBCenc_inst, &residual[start_pos], - &syntdenum[(start-1)*(LPC_FILTERORDER+1)], - &weightdenum[(start-1)*(LPC_FILTERORDER+1)], &idxForMax, - idxVec, iLBCenc_inst->state_short_len, state_first); - - StateConstructW(idxForMax, idxVec, - &syntdenum[(start-1)*(LPC_FILTERORDER+1)], - &decresidual[start_pos], iLBCenc_inst->state_short_len); - - /* predictive quantization in state */ - - if (state_first) { /* put adaptive part in the end */ - - /* setup memory */ - - memset(mem, 0, - (CB_MEML-iLBCenc_inst->state_short_len)*sizeof(float)); - memcpy(mem+CB_MEML-iLBCenc_inst->state_short_len, - decresidual+start_pos, - iLBCenc_inst->state_short_len*sizeof(float)); - memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); - - /* encode sub-frames */ - - iCBSearch(iLBCenc_inst, extra_cb_index, extra_gain_index, - &residual[start_pos+iLBCenc_inst->state_short_len], - mem+CB_MEML-stMemLTbl, - stMemLTbl, diff, CB_NSTAGES, - - - - - - &weightdenum[start*(LPC_FILTERORDER+1)], - weightState, 0); - - /* construct decoded vector */ - - iCBConstruct( - &decresidual[start_pos+iLBCenc_inst->state_short_len], - extra_cb_index, extra_gain_index, - mem+CB_MEML-stMemLTbl, - stMemLTbl, diff, CB_NSTAGES); - - } - else { /* put adaptive part in the beginning */ - - /* create reversed vectors for prediction */ - - for (k=0; kstate_short_len)]; - } - - /* setup memory */ - - meml_gotten = iLBCenc_inst->state_short_len; - for (k=0; knsub-start-1; - - - if ( Nfor > 0 ) { - - /* setup memory */ - - memset(mem, 0, (CB_MEML-STATE_LEN)*sizeof(float)); - memcpy(mem+CB_MEML-STATE_LEN, decresidual+(start-1)*SUBL, - STATE_LEN*sizeof(float)); - memset(weightState, 0, LPC_FILTERORDER*sizeof(float)); - - /* loop over sub-frames to encode */ - - for (subframe=0; subframe 0 ) { - - /* create reverse order vectors */ - - for (n=0; nnsub+1-start); - - - if ( meml_gotten > CB_MEML ) { - meml_gotten=CB_MEML; - } - for (k=0; klpc_n; k++) { - packsplit(&lsf_i[k], &firstpart, &lsf_i[k], - iLBCenc_inst->ULP_inst->lsf_bits[k][ulp], - iLBCenc_inst->ULP_inst->lsf_bits[k][ulp]+ - iLBCenc_inst->ULP_inst->lsf_bits[k][ulp+1]+ - iLBCenc_inst->ULP_inst->lsf_bits[k][ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->lsf_bits[k][ulp], &pos); - } - - /* Start block info */ - - packsplit(&start, &firstpart, &start, - iLBCenc_inst->ULP_inst->start_bits[ulp], - iLBCenc_inst->ULP_inst->start_bits[ulp]+ - iLBCenc_inst->ULP_inst->start_bits[ulp+1]+ - iLBCenc_inst->ULP_inst->start_bits[ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->start_bits[ulp], &pos); - - packsplit(&state_first, &firstpart, &state_first, - iLBCenc_inst->ULP_inst->startfirst_bits[ulp], - iLBCenc_inst->ULP_inst->startfirst_bits[ulp]+ - iLBCenc_inst->ULP_inst->startfirst_bits[ulp+1]+ - iLBCenc_inst->ULP_inst->startfirst_bits[ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->startfirst_bits[ulp], &pos); - - packsplit(&idxForMax, &firstpart, &idxForMax, - iLBCenc_inst->ULP_inst->scale_bits[ulp], - iLBCenc_inst->ULP_inst->scale_bits[ulp]+ - iLBCenc_inst->ULP_inst->scale_bits[ulp+1]+ - iLBCenc_inst->ULP_inst->scale_bits[ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->scale_bits[ulp], &pos); - - for (k=0; kstate_short_len; k++) { - packsplit(idxVec+k, &firstpart, idxVec+k, - iLBCenc_inst->ULP_inst->state_bits[ulp], - iLBCenc_inst->ULP_inst->state_bits[ulp]+ - iLBCenc_inst->ULP_inst->state_bits[ulp+1]+ - iLBCenc_inst->ULP_inst->state_bits[ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->state_bits[ulp], &pos); - } - - - - - - - /* 23/22 (20ms/30ms) sample block */ - - for (k=0;kULP_inst->extra_cb_index[k][ulp], - iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp]+ - iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp+1]+ - iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp], - &pos); - } - - for (k=0;kULP_inst->extra_cb_gain[k][ulp], - iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp]+ - iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp+1]+ - iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp], - &pos); - } - - /* The two/four (20ms/30ms) 40 sample sub-blocks */ - - for (i=0; inasub; i++) { - for (k=0; kULP_inst->cb_index[i][k][ulp], - iLBCenc_inst->ULP_inst->cb_index[i][k][ulp]+ - iLBCenc_inst->ULP_inst->cb_index[i][k][ulp+1]+ - iLBCenc_inst->ULP_inst->cb_index[i][k][ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->cb_index[i][k][ulp], - &pos); - } - } - - for (i=0; inasub; i++) { - for (k=0; kULP_inst->cb_gain[i][k][ulp], - iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp]+ - - - - - - iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp+1]+ - iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp+2]); - dopack( &pbytes, firstpart, - iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp], - &pos); - } - } - } - - /* set the last bit to zero (otherwise the decoder - will treat it as a lost frame) */ - dopack( &pbytes, 0, 1, &pos); - } - diff --git a/third_party/ilbc/iLBC_encode.h b/third_party/ilbc/iLBC_encode.h deleted file mode 100644 index a3ab55f..0000000 --- a/third_party/ilbc/iLBC_encode.h +++ /dev/null @@ -1,39 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iLBC_encode.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __iLBC_ILBCENCODE_H - #define __iLBC_ILBCENCODE_H - - #include "iLBC_define.h" - - short initEncode( /* (o) Number of bytes - encoded */ - iLBC_Enc_Inst_t *iLBCenc_inst, /* (i/o) Encoder instance */ - int mode /* (i) frame size mode */ - ); - - void iLBC_encode( - - unsigned char *bytes, /* (o) encoded data bits iLBC */ - float *block, /* (o) speech vector to - encode */ - iLBC_Enc_Inst_t *iLBCenc_inst /* (i/o) the general encoder - state */ - ); - - #endif - - - - - - diff --git a/third_party/ilbc/iLBC_test.c b/third_party/ilbc/iLBC_test.c deleted file mode 100644 index 81985c0..0000000 --- a/third_party/ilbc/iLBC_test.c +++ /dev/null @@ -1,310 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - iLBC_test.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include - #include - #include - #include - #include "iLBC_define.h" - #include "iLBC_encode.h" - #include "iLBC_decode.h" - - /* Runtime statistics */ - #include - - #define ILBCNOOFWORDS_MAX (NO_OF_BYTES_30MS/2) - - /*----------------------------------------------------------------* - * Encoder interface function - - - - - - *---------------------------------------------------------------*/ - - short encode( /* (o) Number of bytes encoded */ - iLBC_Enc_Inst_t *iLBCenc_inst, - /* (i/o) Encoder instance */ - short *encoded_data, /* (o) The encoded bytes */ - short *data /* (i) The signal block to encode*/ - ){ - float block[BLOCKL_MAX]; - int k; - - /* convert signal to float */ - - for (k=0; kblockl; k++) - block[k] = (float)data[k]; - - /* do the actual encoding */ - - iLBC_encode((unsigned char *)encoded_data, block, iLBCenc_inst); - - - return (iLBCenc_inst->no_of_bytes); - } - - /*----------------------------------------------------------------* - * Decoder interface function - *---------------------------------------------------------------*/ - - short decode( /* (o) Number of decoded samples */ - iLBC_Dec_Inst_t *iLBCdec_inst, /* (i/o) Decoder instance */ - short *decoded_data, /* (o) Decoded signal block*/ - short *encoded_data, /* (i) Encoded bytes */ - short mode /* (i) 0=PL, 1=Normal */ - ){ - int k; - float decblock[BLOCKL_MAX], dtmp; - - /* check if mode is valid */ - - if (mode<0 || mode>1) { - printf("\nERROR - Wrong mode - 0, 1 allowed\n"); exit(3);} - - /* do actual decoding of block */ - - iLBC_decode(decblock, (unsigned char *)encoded_data, - iLBCdec_inst, mode); - - /* convert to short */ - - - - - - for (k=0; kblockl; k++){ - dtmp=decblock[k]; - - if (dtmpMAX_SAMPLE) - dtmp=MAX_SAMPLE; - decoded_data[k] = (short) dtmp; - } - - return (iLBCdec_inst->blockl); - } - - /*---------------------------------------------------------------* - * Main program to test iLBC encoding and decoding - * - * Usage: - * exefile_name.exe - * - * : Input file, speech for encoder (16-bit pcm file) - * : Bit stream output from the encoder - * : Output file, decoded speech (16-bit pcm file) - * : Bit error file, optional (16-bit) - * 1 - Packet received correctly - * 0 - Packet Lost - * - *--------------------------------------------------------------*/ - - int main(int argc, char* argv[]) - { - - /* Runtime statistics */ - - float starttime; - float runtime; - float outtime; - - FILE *ifileid,*efileid,*ofileid, *cfileid; - short data[BLOCKL_MAX]; - short encoded_data[ILBCNOOFWORDS_MAX], decoded_data[BLOCKL_MAX]; - int len; - short pli, mode; - int blockcount = 0; - int packetlosscount = 0; - - /* Create structs */ - iLBC_Enc_Inst_t Enc_Inst; - iLBC_Dec_Inst_t Dec_Inst; - - - - - - /* get arguments and open files */ - - if ((argc!=5) && (argc!=6)) { - fprintf(stderr, - "\n*-----------------------------------------------*\n"); - fprintf(stderr, - " %s <20,30> input encoded decoded (channel)\n\n", - argv[0]); - fprintf(stderr, - " mode : Frame size for the encoding/decoding\n"); - fprintf(stderr, - " 20 - 20 ms\n"); - fprintf(stderr, - " 30 - 30 ms\n"); - fprintf(stderr, - " input : Speech for encoder (16-bit pcm file)\n"); - fprintf(stderr, - " encoded : Encoded bit stream\n"); - fprintf(stderr, - " decoded : Decoded speech (16-bit pcm file)\n"); - fprintf(stderr, - " channel : Packet loss pattern, optional (16-bit)\n"); - fprintf(stderr, - " 1 - Packet received correctly\n"); - fprintf(stderr, - " 0 - Packet Lost\n"); - fprintf(stderr, - "*-----------------------------------------------*\n\n"); - exit(1); - } - mode=atoi(argv[1]); - if (mode != 20 && mode != 30) { - fprintf(stderr,"Wrong mode %s, must be 20, or 30\n", - argv[1]); - exit(2); - } - if ( (ifileid=fopen(argv[2],"rb")) == NULL) { - fprintf(stderr,"Cannot open input file %s\n", argv[2]); - exit(2);} - if ( (efileid=fopen(argv[3],"wb")) == NULL) { - fprintf(stderr, "Cannot open encoded file %s\n", - argv[3]); exit(1);} - if ( (ofileid=fopen(argv[4],"wb")) == NULL) { - fprintf(stderr, "Cannot open decoded file %s\n", - argv[4]); exit(1);} - if (argc==6) { - if( (cfileid=fopen(argv[5],"rb")) == NULL) { - fprintf(stderr, "Cannot open channel file %s\n", - - - - - - argv[5]); - exit(1); - } - } else { - cfileid=NULL; - } - - /* print info */ - - fprintf(stderr, "\n"); - fprintf(stderr, - "*---------------------------------------------------*\n"); - fprintf(stderr, - "* *\n"); - fprintf(stderr, - "* iLBC test program *\n"); - fprintf(stderr, - "* *\n"); - fprintf(stderr, - "* *\n"); - fprintf(stderr, - "*---------------------------------------------------*\n"); - fprintf(stderr,"\nMode : %2d ms\n", mode); - fprintf(stderr,"Input file : %s\n", argv[2]); - fprintf(stderr,"Encoded file : %s\n", argv[3]); - fprintf(stderr,"Output file : %s\n", argv[4]); - if (argc==6) { - fprintf(stderr,"Channel file : %s\n", argv[5]); - } - fprintf(stderr,"\n"); - - /* Initialization */ - - initEncode(&Enc_Inst, mode); - initDecode(&Dec_Inst, mode, 1); - - /* Runtime statistics */ - - starttime=clock()/(float)CLOCKS_PER_SEC; - - /* loop over input blocks */ - - while (fread(data,sizeof(short),Enc_Inst.blockl,ifileid)== - (size_t)Enc_Inst.blockl) { - - blockcount++; - - /* encoding */ - - - - - - fprintf(stderr, "--- Encoding block %i --- ",blockcount); - len=encode(&Enc_Inst, encoded_data, data); - fprintf(stderr, "\r"); - - /* write byte file */ - - fwrite(encoded_data, sizeof(unsigned char), len, efileid); - - /* get channel data if provided */ - if (argc==6) { - if (fread(&pli, sizeof(short), 1, cfileid)) { - if ((pli!=0)&&(pli!=1)) { - fprintf(stderr, "Error in channel file\n"); - exit(0); - } - if (pli==0) { - /* Packet loss -> remove info from frame */ - memset(encoded_data, 0, - sizeof(short)*ILBCNOOFWORDS_MAX); - packetlosscount++; - } - } else { - fprintf(stderr, "Error. Channel file too short\n"); - exit(0); - } - } else { - pli=1; - } - - /* decoding */ - - fprintf(stderr, "--- Decoding block %i --- ",blockcount); - - len=decode(&Dec_Inst, decoded_data, encoded_data, pli); - fprintf(stderr, "\r"); - - /* write output file */ - - fwrite(decoded_data,sizeof(short),len,ofileid); - } - - /* Runtime statistics */ - - runtime = (float)(clock()/(float)CLOCKS_PER_SEC-starttime); - outtime = (float)((float)blockcount*(float)mode/1000.0); - printf("\n\nLength of speech file: %.1f s\n", outtime); - printf("Packet loss : %.1f%%\n", - 100.0*(float)packetlosscount/(float)blockcount); - - - - - - printf("Time to run iLBC :"); - printf(" %.1f s (%.1f %% of realtime)\n\n", runtime, - (100*runtime/outtime)); - - /* close files */ - - fclose(ifileid); fclose(efileid); fclose(ofileid); - if (argc==6) { - fclose(cfileid); - } - return(0); - } - diff --git a/third_party/ilbc/lsf.c b/third_party/ilbc/lsf.c deleted file mode 100644 index b4fe0ed..0000000 --- a/third_party/ilbc/lsf.c +++ /dev/null @@ -1,283 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - lsf.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include - - - - - - #include - - #include "iLBC_define.h" - - /*----------------------------------------------------------------* - * conversion from lpc coefficients to lsf coefficients - *---------------------------------------------------------------*/ - - void a2lsf( - float *freq,/* (o) lsf coefficients */ - float *a /* (i) lpc coefficients */ - ){ - float steps[LSF_NUMBER_OF_STEPS] = - {(float)0.00635, (float)0.003175, (float)0.0015875, - (float)0.00079375}; - float step; - int step_idx; - int lsp_index; - float p[LPC_HALFORDER]; - float q[LPC_HALFORDER]; - float p_pre[LPC_HALFORDER]; - float q_pre[LPC_HALFORDER]; - float old_p, old_q, *old; - float *pq_coef; - float omega, old_omega; - int i; - float hlp, hlp1, hlp2, hlp3, hlp4, hlp5; - - for (i=0; i= 0.5)){ - - if (step_idx == (LSF_NUMBER_OF_STEPS - 1)){ - - if (fabs(hlp5) >= fabs(*old)) { - freq[lsp_index] = omega - step; - } else { - freq[lsp_index] = omega; - } - - - - - - - - if ((*old) >= 0.0){ - *old = (float)-1.0 * FLOAT_MAX; - } else { - *old = FLOAT_MAX; - } - - omega = old_omega; - step_idx = 0; - - step_idx = LSF_NUMBER_OF_STEPS; - } else { - - if (step_idx == 0) { - old_omega = omega; - } - - step_idx++; - omega -= steps[step_idx]; - - /* Go back one grid step */ - - step = steps[step_idx]; - } - } else { - - /* increment omega until they are of different sign, - and we know there is at least one root between omega - and old_omega */ - *old = hlp5; - omega += step; - } - } - } - - for (i = 0; i= 0.5)){ - - - if (freq[0] <= 0.0) { - freq[0] = (float)0.022; - } - - - if (freq[LPC_FILTERORDER - 1] >= 0.5) { - freq[LPC_FILTERORDER - 1] = (float)0.499; - } - - hlp = (freq[LPC_FILTERORDER - 1] - freq[0]) / - (float) (LPC_FILTERORDER - 1); - - for (i=1; i - #include - - #include "iLBC_define.h" - #include "constants.h" - #include "helpfun.h" - #include "string.h" - - /*----------------------------------------------------------------* - * splitting an integer into first most significant bits and - * remaining least significant bits - *---------------------------------------------------------------*/ - - void packsplit( - int *index, /* (i) the value to split */ - int *firstpart, /* (o) the value specified by most - significant bits */ - int *rest, /* (o) the value specified by least - significant bits */ - - - - - - int bitno_firstpart, /* (i) number of bits in most - significant part */ - int bitno_total /* (i) number of bits in full range - of value */ - ){ - int bitno_rest = bitno_total-bitno_firstpart; - - *firstpart = *index>>(bitno_rest); - *rest = *index-(*firstpart<<(bitno_rest)); - } - - /*----------------------------------------------------------------* - * combining a value corresponding to msb's with a value - * corresponding to lsb's - *---------------------------------------------------------------*/ - - void packcombine( - int *index, /* (i/o) the msb value in the - combined value out */ - int rest, /* (i) the lsb value */ - int bitno_rest /* (i) the number of bits in the - lsb part */ - ){ - *index = *index<0) { - - /* Jump to the next byte if end of this byte is reached*/ - - if (*pos==8) { - *pos=0; - (*bitstream)++; - **bitstream=0; - } - - posLeft=8-(*pos); - - /* Insert index into the bitstream */ - - if (bitno <= posLeft) { - **bitstream |= (unsigned char)(index<<(posLeft-bitno)); - *pos+=bitno; - bitno=0; - } else { - **bitstream |= (unsigned char)(index>>(bitno-posLeft)); - - *pos=8; - index-=((index>>(bitno-posLeft))<<(bitno-posLeft)); - - bitno-=posLeft; - } - } - } - - /*----------------------------------------------------------------* - * unpacking of bits from bitstream, i.e., vector of bytes - *---------------------------------------------------------------*/ - - void unpack( - unsigned char **bitstream, /* (i/o) on entrance pointer to - place in bitstream to - unpack new data from, on - exit pointer to place in - bitstream to unpack future - data from */ - int *index, /* (o) resulting value */ - int bitno, /* (i) number of bits used to - represent the value */ - int *pos /* (i/o) read position in the - current byte */ - - - - - - ){ - int BitsLeft; - - *index=0; - - while (bitno>0) { - - /* move forward in bitstream when the end of the - byte is reached */ - - if (*pos==8) { - *pos=0; - (*bitstream)++; - } - - BitsLeft=8-(*pos); - - /* Extract bits to index */ - - if (BitsLeft>=bitno) { - *index+=((((**bitstream)<<(*pos)) & 0xFF)>>(8-bitno)); - - *pos+=bitno; - bitno=0; - } else { - - if ((8-bitno)>0) { - *index+=((((**bitstream)<<(*pos)) & 0xFF)>> - (8-bitno)); - *pos=8; - } else { - *index+=(((int)(((**bitstream)<<(*pos)) & 0xFF))<< - (bitno-8)); - *pos=8; - } - bitno-=BitsLeft; - } - } - } - diff --git a/third_party/ilbc/packing.h b/third_party/ilbc/packing.h deleted file mode 100644 index cbb9f82..0000000 --- a/third_party/ilbc/packing.h +++ /dev/null @@ -1,68 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - packing.h - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #ifndef __PACKING_H - #define __PACKING_H - - void packsplit( - int *index, /* (i) the value to split */ - int *firstpart, /* (o) the value specified by most - significant bits */ - int *rest, /* (o) the value specified by least - significant bits */ - int bitno_firstpart, /* (i) number of bits in most - significant part */ - int bitno_total /* (i) number of bits in full range - of value */ - ); - - void packcombine( - int *index, /* (i/o) the msb value in the - combined value out */ - int rest, /* (i) the lsb value */ - int bitno_rest /* (i) the number of bits in the - lsb part */ - ); - - void dopack( - unsigned char **bitstream, /* (i/o) on entrance pointer to - place in bitstream to pack - new data, on exit pointer - to place in bitstream to - pack future data */ - int index, /* (i) the value to pack */ - int bitno, /* (i) the number of bits that the - value will fit within */ - int *pos /* (i/o) write position in the - current byte */ - ); - - - - - - void unpack( - unsigned char **bitstream, /* (i/o) on entrance pointer to - place in bitstream to - unpack new data from, on - exit pointer to place in - bitstream to unpack future - data from */ - int *index, /* (o) resulting value */ - int bitno, /* (i) number of bits used to - represent the value */ - int *pos /* (i/o) read position in the - current byte */ - ); - - #endif - diff --git a/third_party/ilbc/syntFilter.c b/third_party/ilbc/syntFilter.c deleted file mode 100644 index 190eb00..0000000 --- a/third_party/ilbc/syntFilter.c +++ /dev/null @@ -1,80 +0,0 @@ - - /****************************************************************** - - iLBC Speech Coder ANSI-C Source Code - - syntFilter.c - - Copyright (C) The Internet Society (2004). - All Rights Reserved. - - ******************************************************************/ - - #include "iLBC_define.h" - - /*----------------------------------------------------------------* - * LP synthesis filter. - *---------------------------------------------------------------*/ - - void syntFilter( - float *Out, /* (i/o) Signal to be filtered */ - float *a, /* (i) LP parameters */ - int len, /* (i) Length of signal */ - - - - - - float *mem /* (i/o) Filter state */ - ){ - int i, j; - float *po, *pi, *pa, *pm; - - po=Out; - - /* Filter first part using memory from past */ - - for (i=0; i 9th October 2000. - * It uses a number of large (4k) lookup tables to implement the - * algorithm in an efficient manner. - * - * Note: in this implementation the State is stored in four 32-bit - * words, one per column of the State, with the top byte of the - * column being the _least_ significant byte of the word. - * -*-----------------------------------------------------------------*/ - -#include - -#if defined(PJ_IS_LITTLE_ENDIAN) && PJ_IS_LITTLE_ENDIAN != 0 -# define LITTLE_ENDIAN /* For INTEL architecture */ -#endif - -typedef unsigned char u8; -typedef unsigned int u32; - -/* Circular byte rotates of 32 bit values */ - -#define rot1(x) ((x << 8) | (x >> 24)) -#define rot2(x) ((x << 16) | (x >> 16)) -#define rot3(x) ((x << 24) | (x >> 8)) - -/* Extract a byte from a 32-bit u32 */ - -#define byte0(x) ((u8)(x)) -#define byte1(x) ((u8)(x >> 8)) -#define byte2(x) ((u8)(x >> 16)) -#define byte3(x) ((u8)(x >> 24)) - - -/* Put or get a 32 bit u32 (v) in machine order from a byte * - * address in (x) */ - -#ifdef LITTLE_ENDIAN - -#define u32_in(x) (*(u32*)(x)) -#define u32_out(x,y) (*(u32*)(x) = y) - -#else - -/* Invert byte order in a 32 bit variable */ - -__inline u32 byte_swap(const u32 x) -{ - return rot1(x) & 0x00ff00ff | rot3(x) & 0xff00ff00; -} -__inline u32 u32_in(const u8 x[]) -{ - return byte_swap(*(u32*)x); -}; -__inline void u32_out(u8 x[], const u32 v) -{ - *(u32*)x = byte_swap(v); -}; - -#endif - -/*--------------- The lookup tables ----------------------------*/ - -static u32 rnd_con[10] = -{ - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1B, 0x36 -}; - -static u32 ft_tab[4][256] = -{ - { - 0xA56363C6,0x847C7CF8,0x997777EE,0x8D7B7BF6,0x0DF2F2FF,0xBD6B6BD6,0xB16F6FDE,0x54C5C591, - 0x50303060,0x03010102,0xA96767CE,0x7D2B2B56,0x19FEFEE7,0x62D7D7B5,0xE6ABAB4D,0x9A7676EC, - 0x45CACA8F,0x9D82821F,0x40C9C989,0x877D7DFA,0x15FAFAEF,0xEB5959B2,0xC947478E,0x0BF0F0FB, - 0xECADAD41,0x67D4D4B3,0xFDA2A25F,0xEAAFAF45,0xBF9C9C23,0xF7A4A453,0x967272E4,0x5BC0C09B, - 0xC2B7B775,0x1CFDFDE1,0xAE93933D,0x6A26264C,0x5A36366C,0x413F3F7E,0x02F7F7F5,0x4FCCCC83, - 0x5C343468,0xF4A5A551,0x34E5E5D1,0x08F1F1F9,0x937171E2,0x73D8D8AB,0x53313162,0x3F15152A, - 0x0C040408,0x52C7C795,0x65232346,0x5EC3C39D,0x28181830,0xA1969637,0x0F05050A,0xB59A9A2F, - 0x0907070E,0x36121224,0x9B80801B,0x3DE2E2DF,0x26EBEBCD,0x6927274E,0xCDB2B27F,0x9F7575EA, - 0x1B090912,0x9E83831D,0x742C2C58,0x2E1A1A34,0x2D1B1B36,0xB26E6EDC,0xEE5A5AB4,0xFBA0A05B, - 0xF65252A4,0x4D3B3B76,0x61D6D6B7,0xCEB3B37D,0x7B292952,0x3EE3E3DD,0x712F2F5E,0x97848413, - 0xF55353A6,0x68D1D1B9,0000000000,0x2CEDEDC1,0x60202040,0x1FFCFCE3,0xC8B1B179,0xED5B5BB6, - 0xBE6A6AD4,0x46CBCB8D,0xD9BEBE67,0x4B393972,0xDE4A4A94,0xD44C4C98,0xE85858B0,0x4ACFCF85, - 0x6BD0D0BB,0x2AEFEFC5,0xE5AAAA4F,0x16FBFBED,0xC5434386,0xD74D4D9A,0x55333366,0x94858511, - 0xCF45458A,0x10F9F9E9,0x06020204,0x817F7FFE,0xF05050A0,0x443C3C78,0xBA9F9F25,0xE3A8A84B, - 0xF35151A2,0xFEA3A35D,0xC0404080,0x8A8F8F05,0xAD92923F,0xBC9D9D21,0x48383870,0x04F5F5F1, - 0xDFBCBC63,0xC1B6B677,0x75DADAAF,0x63212142,0x30101020,0x1AFFFFE5,0x0EF3F3FD,0x6DD2D2BF, - 0x4CCDCD81,0x140C0C18,0x35131326,0x2FECECC3,0xE15F5FBE,0xA2979735,0xCC444488,0x3917172E, - 0x57C4C493,0xF2A7A755,0x827E7EFC,0x473D3D7A,0xAC6464C8,0xE75D5DBA,0x2B191932,0x957373E6, - 0xA06060C0,0x98818119,0xD14F4F9E,0x7FDCDCA3,0x66222244,0x7E2A2A54,0xAB90903B,0x8388880B, - 0xCA46468C,0x29EEEEC7,0xD3B8B86B,0x3C141428,0x79DEDEA7,0xE25E5EBC,0x1D0B0B16,0x76DBDBAD, - 0x3BE0E0DB,0x56323264,0x4E3A3A74,0x1E0A0A14,0xDB494992,0x0A06060C,0x6C242448,0xE45C5CB8, - 0x5DC2C29F,0x6ED3D3BD,0xEFACAC43,0xA66262C4,0xA8919139,0xA4959531,0x37E4E4D3,0x8B7979F2, - 0x32E7E7D5,0x43C8C88B,0x5937376E,0xB76D6DDA,0x8C8D8D01,0x64D5D5B1,0xD24E4E9C,0xE0A9A949, - 0xB46C6CD8,0xFA5656AC,0x07F4F4F3,0x25EAEACF,0xAF6565CA,0x8E7A7AF4,0xE9AEAE47,0x18080810, - 0xD5BABA6F,0x887878F0,0x6F25254A,0x722E2E5C,0x241C1C38,0xF1A6A657,0xC7B4B473,0x51C6C697, - 0x23E8E8CB,0x7CDDDDA1,0x9C7474E8,0x211F1F3E,0xDD4B4B96,0xDCBDBD61,0x868B8B0D,0x858A8A0F, - 0x907070E0,0x423E3E7C,0xC4B5B571,0xAA6666CC,0xD8484890,0x05030306,0x01F6F6F7,0x120E0E1C, - 0xA36161C2,0x5F35356A,0xF95757AE,0xD0B9B969,0x91868617,0x58C1C199,0x271D1D3A,0xB99E9E27, - 0x38E1E1D9,0x13F8F8EB,0xB398982B,0x33111122,0xBB6969D2,0x70D9D9A9,0x898E8E07,0xA7949433, - 0xB69B9B2D,0x221E1E3C,0x92878715,0x20E9E9C9,0x49CECE87,0xFF5555AA,0x78282850,0x7ADFDFA5, - 0x8F8C8C03,0xF8A1A159,0x80898909,0x170D0D1A,0xDABFBF65,0x31E6E6D7,0xC6424284,0xB86868D0, - 0xC3414182,0xB0999929,0x772D2D5A,0x110F0F1E,0xCBB0B07B,0xFC5454A8,0xD6BBBB6D,0x3A16162C - }, - { - 0x6363C6A5,0x7C7CF884,0x7777EE99,0x7B7BF68D,0xF2F2FF0D,0x6B6BD6BD,0x6F6FDEB1,0xC5C59154, - 0x30306050,0x01010203,0x6767CEA9,0x2B2B567D,0xFEFEE719,0xD7D7B562,0xABAB4DE6,0x7676EC9A, - 0xCACA8F45,0x82821F9D,0xC9C98940,0x7D7DFA87,0xFAFAEF15,0x5959B2EB,0x47478EC9,0xF0F0FB0B, - 0xADAD41EC,0xD4D4B367,0xA2A25FFD,0xAFAF45EA,0x9C9C23BF,0xA4A453F7,0x7272E496,0xC0C09B5B, - 0xB7B775C2,0xFDFDE11C,0x93933DAE,0x26264C6A,0x36366C5A,0x3F3F7E41,0xF7F7F502,0xCCCC834F, - 0x3434685C,0xA5A551F4,0xE5E5D134,0xF1F1F908,0x7171E293,0xD8D8AB73,0x31316253,0x15152A3F, - 0x0404080C,0xC7C79552,0x23234665,0xC3C39D5E,0x18183028,0x969637A1,0x05050A0F,0x9A9A2FB5, - 0x07070E09,0x12122436,0x80801B9B,0xE2E2DF3D,0xEBEBCD26,0x27274E69,0xB2B27FCD,0x7575EA9F, - 0x0909121B,0x83831D9E,0x2C2C5874,0x1A1A342E,0x1B1B362D,0x6E6EDCB2,0x5A5AB4EE,0xA0A05BFB, - 0x5252A4F6,0x3B3B764D,0xD6D6B761,0xB3B37DCE,0x2929527B,0xE3E3DD3E,0x2F2F5E71,0x84841397, - 0x5353A6F5,0xD1D1B968,0000000000,0xEDEDC12C,0x20204060,0xFCFCE31F,0xB1B179C8,0x5B5BB6ED, - 0x6A6AD4BE,0xCBCB8D46,0xBEBE67D9,0x3939724B,0x4A4A94DE,0x4C4C98D4,0x5858B0E8,0xCFCF854A, - 0xD0D0BB6B,0xEFEFC52A,0xAAAA4FE5,0xFBFBED16,0x434386C5,0x4D4D9AD7,0x33336655,0x85851194, - 0x45458ACF,0xF9F9E910,0x02020406,0x7F7FFE81,0x5050A0F0,0x3C3C7844,0x9F9F25BA,0xA8A84BE3, - 0x5151A2F3,0xA3A35DFE,0x404080C0,0x8F8F058A,0x92923FAD,0x9D9D21BC,0x38387048,0xF5F5F104, - 0xBCBC63DF,0xB6B677C1,0xDADAAF75,0x21214263,0x10102030,0xFFFFE51A,0xF3F3FD0E,0xD2D2BF6D, - 0xCDCD814C,0x0C0C1814,0x13132635,0xECECC32F,0x5F5FBEE1,0x979735A2,0x444488CC,0x17172E39, - 0xC4C49357,0xA7A755F2,0x7E7EFC82,0x3D3D7A47,0x6464C8AC,0x5D5DBAE7,0x1919322B,0x7373E695, - 0x6060C0A0,0x81811998,0x4F4F9ED1,0xDCDCA37F,0x22224466,0x2A2A547E,0x90903BAB,0x88880B83, - 0x46468CCA,0xEEEEC729,0xB8B86BD3,0x1414283C,0xDEDEA779,0x5E5EBCE2,0x0B0B161D,0xDBDBAD76, - 0xE0E0DB3B,0x32326456,0x3A3A744E,0x0A0A141E,0x494992DB,0x06060C0A,0x2424486C,0x5C5CB8E4, - 0xC2C29F5D,0xD3D3BD6E,0xACAC43EF,0x6262C4A6,0x919139A8,0x959531A4,0xE4E4D337,0x7979F28B, - 0xE7E7D532,0xC8C88B43,0x37376E59,0x6D6DDAB7,0x8D8D018C,0xD5D5B164,0x4E4E9CD2,0xA9A949E0, - 0x6C6CD8B4,0x5656ACFA,0xF4F4F307,0xEAEACF25,0x6565CAAF,0x7A7AF48E,0xAEAE47E9,0x08081018, - 0xBABA6FD5,0x7878F088,0x25254A6F,0x2E2E5C72,0x1C1C3824,0xA6A657F1,0xB4B473C7,0xC6C69751, - 0xE8E8CB23,0xDDDDA17C,0x7474E89C,0x1F1F3E21,0x4B4B96DD,0xBDBD61DC,0x8B8B0D86,0x8A8A0F85, - 0x7070E090,0x3E3E7C42,0xB5B571C4,0x6666CCAA,0x484890D8,0x03030605,0xF6F6F701,0x0E0E1C12, - 0x6161C2A3,0x35356A5F,0x5757AEF9,0xB9B969D0,0x86861791,0xC1C19958,0x1D1D3A27,0x9E9E27B9, - 0xE1E1D938,0xF8F8EB13,0x98982BB3,0x11112233,0x6969D2BB,0xD9D9A970,0x8E8E0789,0x949433A7, - 0x9B9B2DB6,0x1E1E3C22,0x87871592,0xE9E9C920,0xCECE8749,0x5555AAFF,0x28285078,0xDFDFA57A, - 0x8C8C038F,0xA1A159F8,0x89890980,0x0D0D1A17,0xBFBF65DA,0xE6E6D731,0x424284C6,0x6868D0B8, - 0x414182C3,0x999929B0,0x2D2D5A77,0x0F0F1E11,0xB0B07BCB,0x5454A8FC,0xBBBB6DD6,0x16162C3A - }, - { - 0x63C6A563,0x7CF8847C,0x77EE9977,0x7BF68D7B,0xF2FF0DF2,0x6BD6BD6B,0x6FDEB16F,0xC59154C5, - 0x30605030,0x01020301,0x67CEA967,0x2B567D2B,0xFEE719FE,0xD7B562D7,0xAB4DE6AB,0x76EC9A76, - 0xCA8F45CA,0x821F9D82,0xC98940C9,0x7DFA877D,0xFAEF15FA,0x59B2EB59,0x478EC947,0xF0FB0BF0, - 0xAD41ECAD,0xD4B367D4,0xA25FFDA2,0xAF45EAAF,0x9C23BF9C,0xA453F7A4,0x72E49672,0xC09B5BC0, - 0xB775C2B7,0xFDE11CFD,0x933DAE93,0x264C6A26,0x366C5A36,0x3F7E413F,0xF7F502F7,0xCC834FCC, - 0x34685C34,0xA551F4A5,0xE5D134E5,0xF1F908F1,0x71E29371,0xD8AB73D8,0x31625331,0x152A3F15, - 0x04080C04,0xC79552C7,0x23466523,0xC39D5EC3,0x18302818,0x9637A196,0x050A0F05,0x9A2FB59A, - 0x070E0907,0x12243612,0x801B9B80,0xE2DF3DE2,0xEBCD26EB,0x274E6927,0xB27FCDB2,0x75EA9F75, - 0x09121B09,0x831D9E83,0x2C58742C,0x1A342E1A,0x1B362D1B,0x6EDCB26E,0x5AB4EE5A,0xA05BFBA0, - 0x52A4F652,0x3B764D3B,0xD6B761D6,0xB37DCEB3,0x29527B29,0xE3DD3EE3,0x2F5E712F,0x84139784, - 0x53A6F553,0xD1B968D1,0000000000,0xEDC12CED,0x20406020,0xFCE31FFC,0xB179C8B1,0x5BB6ED5B, - 0x6AD4BE6A,0xCB8D46CB,0xBE67D9BE,0x39724B39,0x4A94DE4A,0x4C98D44C,0x58B0E858,0xCF854ACF, - 0xD0BB6BD0,0xEFC52AEF,0xAA4FE5AA,0xFBED16FB,0x4386C543,0x4D9AD74D,0x33665533,0x85119485, - 0x458ACF45,0xF9E910F9,0x02040602,0x7FFE817F,0x50A0F050,0x3C78443C,0x9F25BA9F,0xA84BE3A8, - 0x51A2F351,0xA35DFEA3,0x4080C040,0x8F058A8F,0x923FAD92,0x9D21BC9D,0x38704838,0xF5F104F5, - 0xBC63DFBC,0xB677C1B6,0xDAAF75DA,0x21426321,0x10203010,0xFFE51AFF,0xF3FD0EF3,0xD2BF6DD2, - 0xCD814CCD,0x0C18140C,0x13263513,0xECC32FEC,0x5FBEE15F,0x9735A297,0x4488CC44,0x172E3917, - 0xC49357C4,0xA755F2A7,0x7EFC827E,0x3D7A473D,0x64C8AC64,0x5DBAE75D,0x19322B19,0x73E69573, - 0x60C0A060,0x81199881,0x4F9ED14F,0xDCA37FDC,0x22446622,0x2A547E2A,0x903BAB90,0x880B8388, - 0x468CCA46,0xEEC729EE,0xB86BD3B8,0x14283C14,0xDEA779DE,0x5EBCE25E,0x0B161D0B,0xDBAD76DB, - 0xE0DB3BE0,0x32645632,0x3A744E3A,0x0A141E0A,0x4992DB49,0x060C0A06,0x24486C24,0x5CB8E45C, - 0xC29F5DC2,0xD3BD6ED3,0xAC43EFAC,0x62C4A662,0x9139A891,0x9531A495,0xE4D337E4,0x79F28B79, - 0xE7D532E7,0xC88B43C8,0x376E5937,0x6DDAB76D,0x8D018C8D,0xD5B164D5,0x4E9CD24E,0xA949E0A9, - 0x6CD8B46C,0x56ACFA56,0xF4F307F4,0xEACF25EA,0x65CAAF65,0x7AF48E7A,0xAE47E9AE,0x08101808, - 0xBA6FD5BA,0x78F08878,0x254A6F25,0x2E5C722E,0x1C38241C,0xA657F1A6,0xB473C7B4,0xC69751C6, - 0xE8CB23E8,0xDDA17CDD,0x74E89C74,0x1F3E211F,0x4B96DD4B,0xBD61DCBD,0x8B0D868B,0x8A0F858A, - 0x70E09070,0x3E7C423E,0xB571C4B5,0x66CCAA66,0x4890D848,0x03060503,0xF6F701F6,0x0E1C120E, - 0x61C2A361,0x356A5F35,0x57AEF957,0xB969D0B9,0x86179186,0xC19958C1,0x1D3A271D,0x9E27B99E, - 0xE1D938E1,0xF8EB13F8,0x982BB398,0x11223311,0x69D2BB69,0xD9A970D9,0x8E07898E,0x9433A794, - 0x9B2DB69B,0x1E3C221E,0x87159287,0xE9C920E9,0xCE8749CE,0x55AAFF55,0x28507828,0xDFA57ADF, - 0x8C038F8C,0xA159F8A1,0x89098089,0x0D1A170D,0xBF65DABF,0xE6D731E6,0x4284C642,0x68D0B868, - 0x4182C341,0x9929B099,0x2D5A772D,0x0F1E110F,0xB07BCBB0,0x54A8FC54,0xBB6DD6BB,0x162C3A16 - }, - { - 0xC6A56363,0xF8847C7C,0xEE997777,0xF68D7B7B,0xFF0DF2F2,0xD6BD6B6B,0xDEB16F6F,0x9154C5C5, - 0x60503030,0x02030101,0xCEA96767,0x567D2B2B,0xE719FEFE,0xB562D7D7,0x4DE6ABAB,0xEC9A7676, - 0x8F45CACA,0x1F9D8282,0x8940C9C9,0xFA877D7D,0xEF15FAFA,0xB2EB5959,0x8EC94747,0xFB0BF0F0, - 0x41ECADAD,0xB367D4D4,0x5FFDA2A2,0x45EAAFAF,0x23BF9C9C,0x53F7A4A4,0xE4967272,0x9B5BC0C0, - 0x75C2B7B7,0xE11CFDFD,0x3DAE9393,0x4C6A2626,0x6C5A3636,0x7E413F3F,0xF502F7F7,0x834FCCCC, - 0x685C3434,0x51F4A5A5,0xD134E5E5,0xF908F1F1,0xE2937171,0xAB73D8D8,0x62533131,0x2A3F1515, - 0x080C0404,0x9552C7C7,0x46652323,0x9D5EC3C3,0x30281818,0x37A19696,0x0A0F0505,0x2FB59A9A, - 0x0E090707,0x24361212,0x1B9B8080,0xDF3DE2E2,0xCD26EBEB,0x4E692727,0x7FCDB2B2,0xEA9F7575, - 0x121B0909,0x1D9E8383,0x58742C2C,0x342E1A1A,0x362D1B1B,0xDCB26E6E,0xB4EE5A5A,0x5BFBA0A0, - 0xA4F65252,0x764D3B3B,0xB761D6D6,0x7DCEB3B3,0x527B2929,0xDD3EE3E3,0x5E712F2F,0x13978484, - 0xA6F55353,0xB968D1D1,0000000000,0xC12CEDED,0x40602020,0xE31FFCFC,0x79C8B1B1,0xB6ED5B5B, - 0xD4BE6A6A,0x8D46CBCB,0x67D9BEBE,0x724B3939,0x94DE4A4A,0x98D44C4C,0xB0E85858,0x854ACFCF, - 0xBB6BD0D0,0xC52AEFEF,0x4FE5AAAA,0xED16FBFB,0x86C54343,0x9AD74D4D,0x66553333,0x11948585, - 0x8ACF4545,0xE910F9F9,0x04060202,0xFE817F7F,0xA0F05050,0x78443C3C,0x25BA9F9F,0x4BE3A8A8, - 0xA2F35151,0x5DFEA3A3,0x80C04040,0x058A8F8F,0x3FAD9292,0x21BC9D9D,0x70483838,0xF104F5F5, - 0x63DFBCBC,0x77C1B6B6,0xAF75DADA,0x42632121,0x20301010,0xE51AFFFF,0xFD0EF3F3,0xBF6DD2D2, - 0x814CCDCD,0x18140C0C,0x26351313,0xC32FECEC,0xBEE15F5F,0x35A29797,0x88CC4444,0x2E391717, - 0x9357C4C4,0x55F2A7A7,0xFC827E7E,0x7A473D3D,0xC8AC6464,0xBAE75D5D,0x322B1919,0xE6957373, - 0xC0A06060,0x19988181,0x9ED14F4F,0xA37FDCDC,0x44662222,0x547E2A2A,0x3BAB9090,0x0B838888, - 0x8CCA4646,0xC729EEEE,0x6BD3B8B8,0x283C1414,0xA779DEDE,0xBCE25E5E,0x161D0B0B,0xAD76DBDB, - 0xDB3BE0E0,0x64563232,0x744E3A3A,0x141E0A0A,0x92DB4949,0x0C0A0606,0x486C2424,0xB8E45C5C, - 0x9F5DC2C2,0xBD6ED3D3,0x43EFACAC,0xC4A66262,0x39A89191,0x31A49595,0xD337E4E4,0xF28B7979, - 0xD532E7E7,0x8B43C8C8,0x6E593737,0xDAB76D6D,0x018C8D8D,0xB164D5D5,0x9CD24E4E,0x49E0A9A9, - 0xD8B46C6C,0xACFA5656,0xF307F4F4,0xCF25EAEA,0xCAAF6565,0xF48E7A7A,0x47E9AEAE,0x10180808, - 0x6FD5BABA,0xF0887878,0x4A6F2525,0x5C722E2E,0x38241C1C,0x57F1A6A6,0x73C7B4B4,0x9751C6C6, - 0xCB23E8E8,0xA17CDDDD,0xE89C7474,0x3E211F1F,0x96DD4B4B,0x61DCBDBD,0x0D868B8B,0x0F858A8A, - 0xE0907070,0x7C423E3E,0x71C4B5B5,0xCCAA6666,0x90D84848,0x06050303,0xF701F6F6,0x1C120E0E, - 0xC2A36161,0x6A5F3535,0xAEF95757,0x69D0B9B9,0x17918686,0x9958C1C1,0x3A271D1D,0x27B99E9E, - 0xD938E1E1,0xEB13F8F8,0x2BB39898,0x22331111,0xD2BB6969,0xA970D9D9,0x07898E8E,0x33A79494, - 0x2DB69B9B,0x3C221E1E,0x15928787,0xC920E9E9,0x8749CECE,0xAAFF5555,0x50782828,0xA57ADFDF, - 0x038F8C8C,0x59F8A1A1,0x09808989,0x1A170D0D,0x65DABFBF,0xD731E6E6,0x84C64242,0xD0B86868, - 0x82C34141,0x29B09999,0x5A772D2D,0x1E110F0F,0x7BCBB0B0,0xA8FC5454,0x6DD6BBBB,0x2C3A1616 - } -}; - -static u32 fl_tab[4][256] = -{ - { - 0x00000063,0x0000007C,0x00000077,0x0000007B,0x000000F2,0x0000006B,0x0000006F,0x000000C5, - 0x00000030,0x00000001,0x00000067,0x0000002B,0x000000FE,0x000000D7,0x000000AB,0x00000076, - 0x000000CA,0x00000082,0x000000C9,0x0000007D,0x000000FA,0x00000059,0x00000047,0x000000F0, - 0x000000AD,0x000000D4,0x000000A2,0x000000AF,0x0000009C,0x000000A4,0x00000072,0x000000C0, - 0x000000B7,0x000000FD,0x00000093,0x00000026,0x00000036,0x0000003F,0x000000F7,0x000000CC, - 0x00000034,0x000000A5,0x000000E5,0x000000F1,0x00000071,0x000000D8,0x00000031,0x00000015, - 0x00000004,0x000000C7,0x00000023,0x000000C3,0x00000018,0x00000096,0x00000005,0x0000009A, - 0x00000007,0x00000012,0x00000080,0x000000E2,0x000000EB,0x00000027,0x000000B2,0x00000075, - 0x00000009,0x00000083,0x0000002C,0x0000001A,0x0000001B,0x0000006E,0x0000005A,0x000000A0, - 0x00000052,0x0000003B,0x000000D6,0x000000B3,0x00000029,0x000000E3,0x0000002F,0x00000084, - 0x00000053,0x000000D1,0x00000000,0x000000ED,0x00000020,0x000000FC,0x000000B1,0x0000005B, - 0x0000006A,0x000000CB,0x000000BE,0x00000039,0x0000004A,0x0000004C,0x00000058,0x000000CF, - 0x000000D0,0x000000EF,0x000000AA,0x000000FB,0x00000043,0x0000004D,0x00000033,0x00000085, - 0x00000045,0x000000F9,0x00000002,0x0000007F,0x00000050,0x0000003C,0x0000009F,0x000000A8, - 0x00000051,0x000000A3,0x00000040,0x0000008F,0x00000092,0x0000009D,0x00000038,0x000000F5, - 0x000000BC,0x000000B6,0x000000DA,0x00000021,0x00000010,0x000000FF,0x000000F3,0x000000D2, - 0x000000CD,0x0000000C,0x00000013,0x000000EC,0x0000005F,0x00000097,0x00000044,0x00000017, - 0x000000C4,0x000000A7,0x0000007E,0x0000003D,0x00000064,0x0000005D,0x00000019,0x00000073, - 0x00000060,0x00000081,0x0000004F,0x000000DC,0x00000022,0x0000002A,0x00000090,0x00000088, - 0x00000046,0x000000EE,0x000000B8,0x00000014,0x000000DE,0x0000005E,0x0000000B,0x000000DB, - 0x000000E0,0x00000032,0x0000003A,0x0000000A,0x00000049,0x00000006,0x00000024,0x0000005C, - 0x000000C2,0x000000D3,0x000000AC,0x00000062,0x00000091,0x00000095,0x000000E4,0x00000079, - 0x000000E7,0x000000C8,0x00000037,0x0000006D,0x0000008D,0x000000D5,0x0000004E,0x000000A9, - 0x0000006C,0x00000056,0x000000F4,0x000000EA,0x00000065,0x0000007A,0x000000AE,0x00000008, - 0x000000BA,0x00000078,0x00000025,0x0000002E,0x0000001C,0x000000A6,0x000000B4,0x000000C6, - 0x000000E8,0x000000DD,0x00000074,0x0000001F,0x0000004B,0x000000BD,0x0000008B,0x0000008A, - 0x00000070,0x0000003E,0x000000B5,0x00000066,0x00000048,0x00000003,0x000000F6,0x0000000E, - 0x00000061,0x00000035,0x00000057,0x000000B9,0x00000086,0x000000C1,0x0000001D,0x0000009E, - 0x000000E1,0x000000F8,0x00000098,0x00000011,0x00000069,0x000000D9,0x0000008E,0x00000094, - 0x0000009B,0x0000001E,0x00000087,0x000000E9,0x000000CE,0x00000055,0x00000028,0x000000DF, - 0x0000008C,0x000000A1,0x00000089,0x0000000D,0x000000BF,0x000000E6,0x00000042,0x00000068, - 0x00000041,0x00000099,0x0000002D,0x0000000F,0x000000B0,0x00000054,0x000000BB,0x00000016 - }, - { - 0x00006300,0x00007C00,0x00007700,0x00007B00,0x0000F200,0x00006B00,0x00006F00,0x0000C500, - 0x00003000,0x00000100,0x00006700,0x00002B00,0x0000FE00,0x0000D700,0x0000AB00,0x00007600, - 0x0000CA00,0x00008200,0x0000C900,0x00007D00,0x0000FA00,0x00005900,0x00004700,0x0000F000, - 0x0000AD00,0x0000D400,0x0000A200,0x0000AF00,0x00009C00,0x0000A400,0x00007200,0x0000C000, - 0x0000B700,0x0000FD00,0x00009300,0x00002600,0x00003600,0x00003F00,0x0000F700,0x0000CC00, - 0x00003400,0x0000A500,0x0000E500,0x0000F100,0x00007100,0x0000D800,0x00003100,0x00001500, - 0x00000400,0x0000C700,0x00002300,0x0000C300,0x00001800,0x00009600,0x00000500,0x00009A00, - 0x00000700,0x00001200,0x00008000,0x0000E200,0x0000EB00,0x00002700,0x0000B200,0x00007500, - 0x00000900,0x00008300,0x00002C00,0x00001A00,0x00001B00,0x00006E00,0x00005A00,0x0000A000, - 0x00005200,0x00003B00,0x0000D600,0x0000B300,0x00002900,0x0000E300,0x00002F00,0x00008400, - 0x00005300,0x0000D100,0000000000,0x0000ED00,0x00002000,0x0000FC00,0x0000B100,0x00005B00, - 0x00006A00,0x0000CB00,0x0000BE00,0x00003900,0x00004A00,0x00004C00,0x00005800,0x0000CF00, - 0x0000D000,0x0000EF00,0x0000AA00,0x0000FB00,0x00004300,0x00004D00,0x00003300,0x00008500, - 0x00004500,0x0000F900,0x00000200,0x00007F00,0x00005000,0x00003C00,0x00009F00,0x0000A800, - 0x00005100,0x0000A300,0x00004000,0x00008F00,0x00009200,0x00009D00,0x00003800,0x0000F500, - 0x0000BC00,0x0000B600,0x0000DA00,0x00002100,0x00001000,0x0000FF00,0x0000F300,0x0000D200, - 0x0000CD00,0x00000C00,0x00001300,0x0000EC00,0x00005F00,0x00009700,0x00004400,0x00001700, - 0x0000C400,0x0000A700,0x00007E00,0x00003D00,0x00006400,0x00005D00,0x00001900,0x00007300, - 0x00006000,0x00008100,0x00004F00,0x0000DC00,0x00002200,0x00002A00,0x00009000,0x00008800, - 0x00004600,0x0000EE00,0x0000B800,0x00001400,0x0000DE00,0x00005E00,0x00000B00,0x0000DB00, - 0x0000E000,0x00003200,0x00003A00,0x00000A00,0x00004900,0x00000600,0x00002400,0x00005C00, - 0x0000C200,0x0000D300,0x0000AC00,0x00006200,0x00009100,0x00009500,0x0000E400,0x00007900, - 0x0000E700,0x0000C800,0x00003700,0x00006D00,0x00008D00,0x0000D500,0x00004E00,0x0000A900, - 0x00006C00,0x00005600,0x0000F400,0x0000EA00,0x00006500,0x00007A00,0x0000AE00,0x00000800, - 0x0000BA00,0x00007800,0x00002500,0x00002E00,0x00001C00,0x0000A600,0x0000B400,0x0000C600, - 0x0000E800,0x0000DD00,0x00007400,0x00001F00,0x00004B00,0x0000BD00,0x00008B00,0x00008A00, - 0x00007000,0x00003E00,0x0000B500,0x00006600,0x00004800,0x00000300,0x0000F600,0x00000E00, - 0x00006100,0x00003500,0x00005700,0x0000B900,0x00008600,0x0000C100,0x00001D00,0x00009E00, - 0x0000E100,0x0000F800,0x00009800,0x00001100,0x00006900,0x0000D900,0x00008E00,0x00009400, - 0x00009B00,0x00001E00,0x00008700,0x0000E900,0x0000CE00,0x00005500,0x00002800,0x0000DF00, - 0x00008C00,0x0000A100,0x00008900,0x00000D00,0x0000BF00,0x0000E600,0x00004200,0x00006800, - 0x00004100,0x00009900,0x00002D00,0x00000F00,0x0000B000,0x00005400,0x0000BB00,0x00001600 - }, - { - 0x00630000,0x007C0000,0x00770000,0x007B0000,0x00F20000,0x006B0000,0x006F0000,0x00C50000, - 0x00300000,0x00010000,0x00670000,0x002B0000,0x00FE0000,0x00D70000,0x00AB0000,0x00760000, - 0x00CA0000,0x00820000,0x00C90000,0x007D0000,0x00FA0000,0x00590000,0x00470000,0x00F00000, - 0x00AD0000,0x00D40000,0x00A20000,0x00AF0000,0x009C0000,0x00A40000,0x00720000,0x00C00000, - 0x00B70000,0x00FD0000,0x00930000,0x00260000,0x00360000,0x003F0000,0x00F70000,0x00CC0000, - 0x00340000,0x00A50000,0x00E50000,0x00F10000,0x00710000,0x00D80000,0x00310000,0x00150000, - 0x00040000,0x00C70000,0x00230000,0x00C30000,0x00180000,0x00960000,0x00050000,0x009A0000, - 0x00070000,0x00120000,0x00800000,0x00E20000,0x00EB0000,0x00270000,0x00B20000,0x00750000, - 0x00090000,0x00830000,0x002C0000,0x001A0000,0x001B0000,0x006E0000,0x005A0000,0x00A00000, - 0x00520000,0x003B0000,0x00D60000,0x00B30000,0x00290000,0x00E30000,0x002F0000,0x00840000, - 0x00530000,0x00D10000,0000000000,0x00ED0000,0x00200000,0x00FC0000,0x00B10000,0x005B0000, - 0x006A0000,0x00CB0000,0x00BE0000,0x00390000,0x004A0000,0x004C0000,0x00580000,0x00CF0000, - 0x00D00000,0x00EF0000,0x00AA0000,0x00FB0000,0x00430000,0x004D0000,0x00330000,0x00850000, - 0x00450000,0x00F90000,0x00020000,0x007F0000,0x00500000,0x003C0000,0x009F0000,0x00A80000, - 0x00510000,0x00A30000,0x00400000,0x008F0000,0x00920000,0x009D0000,0x00380000,0x00F50000, - 0x00BC0000,0x00B60000,0x00DA0000,0x00210000,0x00100000,0x00FF0000,0x00F30000,0x00D20000, - 0x00CD0000,0x000C0000,0x00130000,0x00EC0000,0x005F0000,0x00970000,0x00440000,0x00170000, - 0x00C40000,0x00A70000,0x007E0000,0x003D0000,0x00640000,0x005D0000,0x00190000,0x00730000, - 0x00600000,0x00810000,0x004F0000,0x00DC0000,0x00220000,0x002A0000,0x00900000,0x00880000, - 0x00460000,0x00EE0000,0x00B80000,0x00140000,0x00DE0000,0x005E0000,0x000B0000,0x00DB0000, - 0x00E00000,0x00320000,0x003A0000,0x000A0000,0x00490000,0x00060000,0x00240000,0x005C0000, - 0x00C20000,0x00D30000,0x00AC0000,0x00620000,0x00910000,0x00950000,0x00E40000,0x00790000, - 0x00E70000,0x00C80000,0x00370000,0x006D0000,0x008D0000,0x00D50000,0x004E0000,0x00A90000, - 0x006C0000,0x00560000,0x00F40000,0x00EA0000,0x00650000,0x007A0000,0x00AE0000,0x00080000, - 0x00BA0000,0x00780000,0x00250000,0x002E0000,0x001C0000,0x00A60000,0x00B40000,0x00C60000, - 0x00E80000,0x00DD0000,0x00740000,0x001F0000,0x004B0000,0x00BD0000,0x008B0000,0x008A0000, - 0x00700000,0x003E0000,0x00B50000,0x00660000,0x00480000,0x00030000,0x00F60000,0x000E0000, - 0x00610000,0x00350000,0x00570000,0x00B90000,0x00860000,0x00C10000,0x001D0000,0x009E0000, - 0x00E10000,0x00F80000,0x00980000,0x00110000,0x00690000,0x00D90000,0x008E0000,0x00940000, - 0x009B0000,0x001E0000,0x00870000,0x00E90000,0x00CE0000,0x00550000,0x00280000,0x00DF0000, - 0x008C0000,0x00A10000,0x00890000,0x000D0000,0x00BF0000,0x00E60000,0x00420000,0x00680000, - 0x00410000,0x00990000,0x002D0000,0x000F0000,0x00B00000,0x00540000,0x00BB0000,0x00160000 - }, - { - 0x63000000,0x7C000000,0x77000000,0x7B000000,0xF2000000,0x6B000000,0x6F000000,0xC5000000, - 0x30000000,0x01000000,0x67000000,0x2B000000,0xFE000000,0xD7000000,0xAB000000,0x76000000, - 0xCA000000,0x82000000,0xC9000000,0x7D000000,0xFA000000,0x59000000,0x47000000,0xF0000000, - 0xAD000000,0xD4000000,0xA2000000,0xAF000000,0x9C000000,0xA4000000,0x72000000,0xC0000000, - 0xB7000000,0xFD000000,0x93000000,0x26000000,0x36000000,0x3F000000,0xF7000000,0xCC000000, - 0x34000000,0xA5000000,0xE5000000,0xF1000000,0x71000000,0xD8000000,0x31000000,0x15000000, - 0x04000000,0xC7000000,0x23000000,0xC3000000,0x18000000,0x96000000,0x05000000,0x9A000000, - 0x07000000,0x12000000,0x80000000,0xE2000000,0xEB000000,0x27000000,0xB2000000,0x75000000, - 0x09000000,0x83000000,0x2C000000,0x1A000000,0x1B000000,0x6E000000,0x5A000000,0xA0000000, - 0x52000000,0x3B000000,0xD6000000,0xB3000000,0x29000000,0xE3000000,0x2F000000,0x84000000, - 0x53000000,0xD1000000,0000000000,0xED000000,0x20000000,0xFC000000,0xB1000000,0x5B000000, - 0x6A000000,0xCB000000,0xBE000000,0x39000000,0x4A000000,0x4C000000,0x58000000,0xCF000000, - 0xD0000000,0xEF000000,0xAA000000,0xFB000000,0x43000000,0x4D000000,0x33000000,0x85000000, - 0x45000000,0xF9000000,0x02000000,0x7F000000,0x50000000,0x3C000000,0x9F000000,0xA8000000, - 0x51000000,0xA3000000,0x40000000,0x8F000000,0x92000000,0x9D000000,0x38000000,0xF5000000, - 0xBC000000,0xB6000000,0xDA000000,0x21000000,0x10000000,0xFF000000,0xF3000000,0xD2000000, - 0xCD000000,0x0C000000,0x13000000,0xEC000000,0x5F000000,0x97000000,0x44000000,0x17000000, - 0xC4000000,0xA7000000,0x7E000000,0x3D000000,0x64000000,0x5D000000,0x19000000,0x73000000, - 0x60000000,0x81000000,0x4F000000,0xDC000000,0x22000000,0x2A000000,0x90000000,0x88000000, - 0x46000000,0xEE000000,0xB8000000,0x14000000,0xDE000000,0x5E000000,0x0B000000,0xDB000000, - 0xE0000000,0x32000000,0x3A000000,0x0A000000,0x49000000,0x06000000,0x24000000,0x5C000000, - 0xC2000000,0xD3000000,0xAC000000,0x62000000,0x91000000,0x95000000,0xE4000000,0x79000000, - 0xE7000000,0xC8000000,0x37000000,0x6D000000,0x8D000000,0xD5000000,0x4E000000,0xA9000000, - 0x6C000000,0x56000000,0xF4000000,0xEA000000,0x65000000,0x7A000000,0xAE000000,0x08000000, - 0xBA000000,0x78000000,0x25000000,0x2E000000,0x1C000000,0xA6000000,0xB4000000,0xC6000000, - 0xE8000000,0xDD000000,0x74000000,0x1F000000,0x4B000000,0xBD000000,0x8B000000,0x8A000000, - 0x70000000,0x3E000000,0xB5000000,0x66000000,0x48000000,0x03000000,0xF6000000,0x0E000000, - 0x61000000,0x35000000,0x57000000,0xB9000000,0x86000000,0xC1000000,0x1D000000,0x9E000000, - 0xE1000000,0xF8000000,0x98000000,0x11000000,0x69000000,0xD9000000,0x8E000000,0x94000000, - 0x9B000000,0x1E000000,0x87000000,0xE9000000,0xCE000000,0x55000000,0x28000000,0xDF000000, - 0x8C000000,0xA1000000,0x89000000,0x0D000000,0xBF000000,0xE6000000,0x42000000,0x68000000, - 0x41000000,0x99000000,0x2D000000,0x0F000000,0xB0000000,0x54000000,0xBB000000,0x16000000 - } -}; - -/*----------------- The workspace ------------------------------*/ - -static u32 Ekey[44]; /* The expanded key */ - -/*------ The round Function. 4 table lookups and 4 Exors ------*/ -#define f_rnd(x, n) \ - ( ft_tab[0][byte0(x[n])] \ - ^ ft_tab[1][byte1(x[(n + 1) & 3])] \ - ^ ft_tab[2][byte2(x[(n + 2) & 3])] \ - ^ ft_tab[3][byte3(x[(n + 3) & 3])] ) - -#define f_round(bo, bi, k) \ - bo[0] = f_rnd(bi, 0) ^ k[0]; \ - bo[1] = f_rnd(bi, 1) ^ k[1]; \ - bo[2] = f_rnd(bi, 2) ^ k[2]; \ - bo[3] = f_rnd(bi, 3) ^ k[3]; \ - k += 4 - -/*--- The S Box lookup used in constructing the Key schedule ---*/ -#define ls_box(x) \ - ( fl_tab[0][byte0(x)] \ - ^ fl_tab[1][byte1(x)] \ - ^ fl_tab[2][byte2(x)] \ - ^ fl_tab[3][byte3(x)] ) - -/*------------ The last round function (no MixColumn) ----------*/ -#define lf_rnd(x, n) \ - ( fl_tab[0][byte0(x[n])] \ - ^ fl_tab[1][byte1(x[(n + 1) & 3])] \ - ^ fl_tab[2][byte2(x[(n + 2) & 3])] \ - ^ fl_tab[3][byte3(x[(n + 3) & 3])] ) - - -/*----------------------------------------------------------- - * RijndaelKeySchedule - * Initialise the key schedule from a supplied key - */ -void RijndaelKeySchedule(u8 key[16]) -{ - u32 t; - u32 *ek=Ekey, /* pointer to the expanded key */ - *rc=rnd_con; /* pointer to the round constant */ - - Ekey[0] = u32_in(key ); - Ekey[1] = u32_in(key + 4); - Ekey[2] = u32_in(key + 8); - Ekey[3] = u32_in(key + 12); - - while(ek < Ekey + 40) - { - t = rot3(ek[3]); - ek[4] = ek[0] ^ ls_box(t) ^ *rc++; - ek[5] = ek[1] ^ ek[4]; - ek[6] = ek[2] ^ ek[5]; - ek[7] = ek[3] ^ ek[6]; - ek += 4; - } -} - -/*----------------------------------------------------------- - * RijndaelEncrypt - * Encrypt an input block - */ -void RijndaelEncrypt(u8 in[16], u8 out[16]) -{ - u32 b0[4], b1[4], *kp = Ekey; - - b0[0] = u32_in(in ) ^ *kp++; - b0[1] = u32_in(in + 4) ^ *kp++; - b0[2] = u32_in(in + 8) ^ *kp++; - b0[3] = u32_in(in + 12) ^ *kp++; - - f_round(b1, b0, kp); - f_round(b0, b1, kp); - f_round(b1, b0, kp); - f_round(b0, b1, kp); - f_round(b1, b0, kp); - f_round(b0, b1, kp); - f_round(b1, b0, kp); - f_round(b0, b1, kp); - f_round(b1, b0, kp); - - u32_out(out, lf_rnd(b1, 0) ^ kp[0]); - u32_out(out + 4, lf_rnd(b1, 1) ^ kp[1]); - u32_out(out + 8, lf_rnd(b1, 2) ^ kp[2]); - u32_out(out + 12, lf_rnd(b1, 3) ^ kp[3]); -} diff --git a/third_party/milenage/rijndael.h b/third_party/milenage/rijndael.h deleted file mode 100644 index 4e728a5..0000000 --- a/third_party/milenage/rijndael.h +++ /dev/null @@ -1,26 +0,0 @@ -/*------------------------------------------------------------------- - * Example algorithms f1, f1*, f2, f3, f4, f5, f5* - *------------------------------------------------------------------- - * - * A sample implementation of the example 3GPP authentication and - * key agreement functions f1, f1*, f2, f3, f4, f5 and f5*. This is - * a byte-oriented implementation of the functions, and of the block - * cipher kernel function Rijndael. - * - * This has been coded for clarity, not necessarily for efficiency. - * - * The functions f2, f3, f4 and f5 share the same inputs and have - * been coded together as a single function. f1, f1* and f5* are - * all coded separately. - * - *-----------------------------------------------------------------*/ - -#ifndef RIJNDAEL_H -#define RIJNDAEL_H - - -void RijndaelKeySchedule( u8 key[16] ); -void RijndaelEncrypt( u8 input[16], u8 output[16] ); - - -#endif diff --git a/third_party/mp3/BladeMP3EncDLL.h b/third_party/mp3/BladeMP3EncDLL.h deleted file mode 100644 index 2e32b91..0000000 --- a/third_party/mp3/BladeMP3EncDLL.h +++ /dev/null @@ -1,283 +0,0 @@ -/* - * Blade Type of DLL Interface for Lame encoder - * - * Copyright (c) 1999-2002 A.L. Faber - * Based on bladedll.h version 1.0 written by Jukka Poikolainen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -//#define _BLADEDLL 1 - -#ifndef ___BLADEDLL_H_INCLUDED___ -#define ___BLADEDLL_H_INCLUDED___ - -#ifdef __GNUC__ -//#define ATTRIBUTE_PACKED __attribute__((packed)) -#define ATTRIBUTE_PACKED -#else -#define ATTRIBUTE_PACKED -#pragma pack(push) -#pragma pack(1) -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* encoding formats */ - -#define BE_CONFIG_MP3 0 -#define BE_CONFIG_LAME 256 - -/* type definitions */ - -typedef unsigned long HBE_STREAM; -typedef HBE_STREAM *PHBE_STREAM; -typedef unsigned long BE_ERR; - -/* error codes */ - -#define BE_ERR_SUCCESSFUL 0x00000000 -#define BE_ERR_INVALID_FORMAT 0x00000001 -#define BE_ERR_INVALID_FORMAT_PARAMETERS 0x00000002 -#define BE_ERR_NO_MORE_HANDLES 0x00000003 -#define BE_ERR_INVALID_HANDLE 0x00000004 -#define BE_ERR_BUFFER_TOO_SMALL 0x00000005 - -/* other constants */ - -#define BE_MAX_HOMEPAGE 128 - -/* format specific variables */ - -#define BE_MP3_MODE_STEREO 0 -#define BE_MP3_MODE_JSTEREO 1 -#define BE_MP3_MODE_DUALCHANNEL 2 -#define BE_MP3_MODE_MONO 3 - - - -#define MPEG1 1 -#define MPEG2 0 - -#ifdef _BLADEDLL -#undef FLOAT - #include -#endif - -#define CURRENT_STRUCT_VERSION 1 -#define CURRENT_STRUCT_SIZE sizeof(BE_CONFIG) // is currently 331 bytes - - -typedef enum -{ - VBR_METHOD_NONE = -1, - VBR_METHOD_DEFAULT = 0, - VBR_METHOD_OLD = 1, - VBR_METHOD_NEW = 2, - VBR_METHOD_MTRH = 3, - VBR_METHOD_ABR = 4 -} VBRMETHOD; - -typedef enum -{ - LQP_NOPRESET =-1, - - // QUALITY PRESETS - LQP_NORMAL_QUALITY = 0, - LQP_LOW_QUALITY = 1, - LQP_HIGH_QUALITY = 2, - LQP_VOICE_QUALITY = 3, - LQP_R3MIX = 4, - LQP_VERYHIGH_QUALITY = 5, - LQP_STANDARD = 6, - LQP_FAST_STANDARD = 7, - LQP_EXTREME = 8, - LQP_FAST_EXTREME = 9, - LQP_INSANE = 10, - LQP_ABR = 11, - LQP_CBR = 12, - LQP_MEDIUM = 13, - LQP_FAST_MEDIUM = 14, - - // NEW PRESET VALUES - LQP_PHONE =1000, - LQP_SW =2000, - LQP_AM =3000, - LQP_FM =4000, - LQP_VOICE =5000, - LQP_RADIO =6000, - LQP_TAPE =7000, - LQP_HIFI =8000, - LQP_CD =9000, - LQP_STUDIO =10000 - -} LAME_QUALITY_PRESET; - - - -typedef struct { - unsigned long dwConfig; // BE_CONFIG_XXXXX - // Currently only BE_CONFIG_MP3 is supported - union { - - struct { - - unsigned long dwSampleRate; // 48000, 44100 and 32000 allowed - unsigned char byMode; // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL, BE_MP3_MODE_MONO - unsigned short wBitrate; // 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256 and 320 allowed - int bPrivate; - int bCRC; - int bCopyright; - int bOriginal; - - } mp3; // BE_CONFIG_MP3 - - struct - { - // STRUCTURE INFORMATION - unsigned long dwStructVersion; - unsigned long dwStructSize; - - // BASIC ENCODER SETTINGS - unsigned long dwSampleRate; // SAMPLERATE OF INPUT FILE - unsigned long dwReSampleRate; // DOWNSAMPLERATE, 0=ENCODER DECIDES - long nMode; // BE_MP3_MODE_STEREO, BE_MP3_MODE_DUALCHANNEL, BE_MP3_MODE_MONO - unsigned long dwBitrate; // CBR bitrate, VBR min bitrate - unsigned long dwMaxBitrate; // CBR ignored, VBR Max bitrate - long nPreset; // Quality preset, use one of the settings of the LAME_QUALITY_PRESET enum - unsigned long dwMpegVersion; // FUTURE USE, MPEG-1 OR MPEG-2 - unsigned long dwPsyModel; // FUTURE USE, SET TO 0 - unsigned long dwEmphasis; // FUTURE USE, SET TO 0 - - // BIT STREAM SETTINGS - int bPrivate; // Set Private Bit (TRUE/FALSE) - int bCRC; // Insert CRC (TRUE/FALSE) - int bCopyright; // Set Copyright Bit (TRUE/FALSE) - int bOriginal; // Set Original Bit (TRUE/FALSE) - - // VBR STUFF - int bWriteVBRHeader; // WRITE XING VBR HEADER (TRUE/FALSE) - int bEnableVBR; // USE VBR ENCODING (TRUE/FALSE) - int nVBRQuality; // VBR QUALITY 0..9 - unsigned long dwVbrAbr_bps; // Use ABR in stead of nVBRQuality - VBRMETHOD nVbrMethod; - int bNoRes; // Disable Bit resorvoir (TRUE/FALSE) - - // MISC SETTINGS - int bStrictIso; // Use strict ISO encoding rules (TRUE/FALSE) - unsigned short nQuality; // Quality Setting, HIGH unsigned char should be NOT LOW byte, otherwhise quality=5 - - // FUTURE USE, SET TO 0, align strucutre to 331 bytes - unsigned char btReserved[255-4*sizeof(unsigned long) - sizeof( unsigned short )]; - - } LHV1; // LAME header version 1 - - struct { - - unsigned long dwSampleRate; - unsigned char byMode; - unsigned short wBitrate; - unsigned char byEncodingMethod; - - } aac; - - } format; - -} BE_CONFIG, *PBE_CONFIG ATTRIBUTE_PACKED; - - -typedef struct { - - // BladeEnc DLL Version number - - unsigned char byDLLMajorVersion; - unsigned char byDLLMinorVersion; - - // BladeEnc Engine Version Number - - unsigned char byMajorVersion; - unsigned char byMinorVersion; - - // DLL Release date - - unsigned char byDay; - unsigned char byMonth; - unsigned short wYear; - - // BladeEnc Homepage URL - - char zHomepage[BE_MAX_HOMEPAGE + 1]; - - unsigned char byAlphaLevel; - unsigned char byBetaLevel; - unsigned char byMMXEnabled; - - unsigned char btReserved[125]; - - -} BE_VERSION, *PBE_VERSION ATTRIBUTE_PACKED; - -#ifndef _BLADEDLL - -typedef unsigned long (*BEINITSTREAM) (PBE_CONFIG, unsigned long *, unsigned long *, PHBE_STREAM); -typedef unsigned long (*BEENCODECHUNK) (HBE_STREAM, unsigned long, short *, unsigned char *, unsigned long *); - -// added for floating point audio -- DSPguru, jd -typedef unsigned long (*BEENCODECHUNKFLOATS16NI) (HBE_STREAM, unsigned long, float *, float *, unsigned char *, unsigned long *); -typedef unsigned long (*BEDEINITSTREAM) (HBE_STREAM, unsigned char *, unsigned long *); -typedef unsigned long (*BECLOSESTREAM) (HBE_STREAM); -typedef void (*BEVERSION) (PBE_VERSION); -typedef unsigned long (*BEWRITEVBRHEADER) (const char*); -typedef unsigned long (*BEWRITEINFOTAG) (HBE_STREAM, const char * ); - -#define TEXT_BEINITSTREAM "beInitStream" -#define TEXT_BEENCODECHUNK "beEncodeChunk" -#define TEXT_BEENCODECHUNKFLOATS16NI "beEncodeChunkFloatS16NI" -#define TEXT_BEDEINITSTREAM "beDeinitStream" -#define TEXT_BECLOSESTREAM "beCloseStream" -#define TEXT_BEVERSION "beVersion" -#define TEXT_BEWRITEVBRHEADER "beWriteVBRHeader" -#define TEXT_BEFLUSHNOGAP "beFlushNoGap" -#define TEXT_BEWRITEINFOTAG "beWriteInfoTag" - - -#else - -__declspec(dllexport) unsigned long beInitStream(PBE_CONFIG pbeConfig, Punsigned long dwSamples, Punsigned long dwBufferSize, PHBE_STREAM phbeStream); -__declspec(dllexport) unsigned long beEncodeChunk(HBE_STREAM hbeStream, unsigned long nSamples, PSHORT pSamples, Punsigned char pOutput, Punsigned long pdwOutput); - -// added for floating point audio -- DSPguru, jd -__declspec(dllexport) unsigned long beEncodeChunkFloatS16NI(HBE_STREAM hbeStream, unsigned long nSamples, PFLOAT buffer_l, PFLOAT buffer_r, Punsigned char pOutput, Punsigned long pdwOutput); -__declspec(dllexport) unsigned long beDeinitStream(HBE_STREAM hbeStream, Punsigned char pOutput, Punsigned long pdwOutput); -__declspec(dllexport) unsigned long beCloseStream(HBE_STREAM hbeStream); -__declspec(dllexport) VOID beVersion(PBE_VERSION pbeVersion); -__declspec(dllexport) unsigned long beWriteVBRHeader(LPCSTR lpszFileName); -__declspec(dllexport) unsigned long beFlushNoGap(HBE_STREAM hbeStream, Punsigned char pOutput, Punsigned long pdwOutput); -__declspec(dllexport) unsigned long beWriteInfoTag( HBE_STREAM hbeStream, LPCSTR lpszFileName ); - -#endif - -#ifndef __GNUC__ -#pragma pack(pop) -#endif - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/third_party/mp3/mp3_port.h b/third_party/mp3/mp3_port.h deleted file mode 100644 index fe8bbb7..0000000 --- a/third_party/mp3/mp3_port.h +++ /dev/null @@ -1,147 +0,0 @@ -/* $Id: mp3_port.h 1177 2007-04-09 07:06:08Z bennylp $ */ -/* - * Copyright (C) 2003-2007 Benny Prijono - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Contributed by: - * Toni < buldozer at aufbix dot org > - */ - -#ifndef __PJMEDIA_MP3_PORT_H__ -#define __PJMEDIA_MP3_PORT_H__ - - -/** - * @file mp3_port.h - * @brief MP3 writer - */ -#include - -/** - * @defgroup PJMEDIA_MP3_FILE_REC MP3 Audio File Writer (Recorder) - * @ingroup PJMEDIA_PORT - * @brief MP3 Audio File Writer (Recorder) - * @{ - * - * This section describes MP3 file writer. Currently it only works on Windows - * using BladeEncDLL of the LAME MP3 encoder. Note that the LAME_ENC.DLL - * file must exist in the PATH so that the encoder can work properly. - * - * The MP3 file writer is created with #pjmedia_mp3_writer_port_create() which - * among other things specifies the desired file name and audio properties. - * It then takes PCM input when #pjmedia_port_put_frame() is called and encode - * the PCM input into MP3 streams before writing it to the .mp3 file. - */ - - -PJ_BEGIN_DECL - - -/** - * This structure contains encoding options that can be specified during - * MP3 writer port creation. Application should always zero the structure - * before setting some value to make sure that default options will be used. - */ -typedef struct pjmedia_mp3_encoder_option -{ - /** Specify whether variable bit rate should be used. Variable bitrate - * would normally produce better quality at the expense of probably - * larger file. - */ - pj_bool_t vbr; - - /** Target bitrate, in bps. If VBR is enabled, this settings specifies - * the average bit-rate requested, and will make the encoder ignore - * the quality setting. For CBR, this specifies the actual bitrate, - * and if this option is zero, it will be set to the sampling rate - * multiplied by number of channels. - */ - unsigned bit_rate; - - /** Encoding quality, 0-9, with 0 is the highest quality. For VBR, the - * quality setting will only take effect when bit_rate setting is zero. - */ - unsigned quality; - -} pjmedia_mp3_encoder_option; - - -/** - * Create a media port to record PCM media to a MP3 file. After the port - * is created, application can call #pjmedia_port_put_frame() to feed the - * port with PCM frames. The port then will encode the PCM frame into MP3 - * stream, and store it to MP3 file specified in the argument. - * - * When application has finished with writing MP3 file, it must destroy the - * media port with #pjmedia_port_destroy() so that the MP3 file can be - * closed properly. - * - * @param pool Pool to create memory buffers for this port. - * @param filename File name. - * @param clock_rate The sampling rate. - * @param channel_count Number of channels. - * @param samples_per_frame Number of samples per frame. - * @param bits_per_sample Number of bits per sample (eg 16). - * @param option Optional option to set encoding parameters. - * @param p_port Pointer to receive the file port instance. - * - * @return PJ_SUCCESS on success. - */ -PJ_DECL(pj_status_t) -pjmedia_mp3_writer_port_create(pj_pool_t *pool, - const char *filename, - unsigned clock_rate, - unsigned channel_count, - unsigned samples_per_frame, - unsigned bits_per_sample, - const pjmedia_mp3_encoder_option *option, - pjmedia_port **p_port ); - -/** - * Register the callback to be called when the file writing has reached - * certain size. Application can use this callback, for example, to limit - * the size of the output file. - * - * @param port The file writer port. - * @param pos The file position on which the callback will be called. - * @param user_data User data to be specified in the callback, and will be - * given on the callback. - * @param cb Callback to be called. If the callback returns non- - * PJ_SUCCESS, the writing will stop. Note that if - * application destroys the port in the callback, it must - * return non-PJ_SUCCESS here. - * - * @return PJ_SUCCESS on success. - */ -PJ_DECL(pj_status_t) -pjmedia_mp3_writer_port_set_cb( pjmedia_port *port, - pj_size_t pos, - void *user_data, - pj_status_t (*cb)(pjmedia_port *port, - void *usr_data)); - - -/** - * @} - */ - - -PJ_END_DECL - -#endif /* __PJMEDIA_MP3_PORT_H__ */ - diff --git a/third_party/mp3/mp3_writer.c b/third_party/mp3/mp3_writer.c deleted file mode 100644 index 4abd78d..0000000 --- a/third_party/mp3/mp3_writer.c +++ /dev/null @@ -1,563 +0,0 @@ -/* $Id: mp3_writer.c 1233 2007-04-30 11:05:23Z bennylp $ */ -/* - * Copyright (C) 2003-2007 Benny Prijono - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* - * Contributed by: - * Toni < buldozer at aufbix dot org > - */ -#include "mp3_port.h" -#include -#include -#include -#include -#include -#include -#include -#include - - -/* Include BladeDLL declarations */ -#include "BladeMP3EncDLL.h" - - -#define THIS_FILE "mp3_writer.c" -#define SIGNATURE PJMEDIA_PORT_SIGNATURE('F', 'W', 'M', '3') -#define BYTES_PER_SAMPLE 2 - -static struct BladeDLL -{ - void *hModule; - int refCount; - BEINITSTREAM beInitStream; - BEENCODECHUNK beEncodeChunk; - BEDEINITSTREAM beDeinitStream; - BECLOSESTREAM beCloseStream; - BEVERSION beVersion; - BEWRITEVBRHEADER beWriteVBRHeader; - BEWRITEINFOTAG beWriteInfoTag; -} BladeDLL; - - -struct mp3_file_port -{ - pjmedia_port base; - pj_size_t total; - pj_oshandle_t fd; - pj_size_t cb_size; - pj_status_t (*cb)(pjmedia_port*, void*); - - unsigned silence_duration; - - pj_str_t mp3_filename; - pjmedia_mp3_encoder_option mp3_option; - unsigned mp3_samples_per_frame; - pj_int16_t *mp3_sample_buf; - unsigned mp3_sample_pos; - HBE_STREAM mp3_stream; - unsigned char *mp3_buf; -}; - - -static pj_status_t file_put_frame(pjmedia_port *this_port, - const pjmedia_frame *frame); -static pj_status_t file_get_frame(pjmedia_port *this_port, - pjmedia_frame *frame); -static pj_status_t file_on_destroy(pjmedia_port *this_port); - - -#if defined(PJ_WIN32) || defined(_WIN32) || defined(WIN32) - -#include -#define DLL_NAME PJ_T("LAME_ENC.DLL") - -/* - * Load BladeEncoder DLL. - */ -static pj_status_t init_blade_dll(void) -{ - if (BladeDLL.refCount == 0) { - #define GET_PROC(type, name) \ - BladeDLL.name = (type)GetProcAddress(BladeDLL.hModule, PJ_T(#name)); \ - if (BladeDLL.name == NULL) { \ - PJ_LOG(1,(THIS_FILE, "Unable to find %s in %s", #name, DLL_NAME)); \ - return PJ_RETURN_OS_ERROR(GetLastError()); \ - } - - BE_VERSION beVersion; - BladeDLL.hModule = (void*)LoadLibrary(DLL_NAME); - if (BladeDLL.hModule == NULL) { - pj_status_t status = PJ_RETURN_OS_ERROR(GetLastError()); - char errmsg[PJ_ERR_MSG_SIZE]; - - pj_strerror(status, errmsg, sizeof(errmsg)); - PJ_LOG(1,(THIS_FILE, "Unable to load %s: %s", DLL_NAME, errmsg)); - return status; - } - - GET_PROC(BEINITSTREAM, beInitStream); - GET_PROC(BEENCODECHUNK, beEncodeChunk); - GET_PROC(BEDEINITSTREAM, beDeinitStream); - GET_PROC(BECLOSESTREAM, beCloseStream); - GET_PROC(BEVERSION, beVersion); - GET_PROC(BEWRITEVBRHEADER, beWriteVBRHeader); - GET_PROC(BEWRITEINFOTAG, beWriteInfoTag); - - #undef GET_PROC - - BladeDLL.beVersion(&beVersion); - PJ_LOG(4,(THIS_FILE, "%s encoder v%d.%d loaded (%s)", DLL_NAME, - beVersion.byMajorVersion, beVersion.byMinorVersion, - beVersion.zHomepage)); - } - ++BladeDLL.refCount; - return PJ_SUCCESS; -} - -/* - * Decrement the reference counter of the DLL. - */ -static void deinit_blade_dll() -{ - --BladeDLL.refCount; - if (BladeDLL.refCount == 0 && BladeDLL.hModule) { - FreeLibrary(BladeDLL.hModule); - BladeDLL.hModule = NULL; - PJ_LOG(4,(THIS_FILE, "%s unloaded", DLL_NAME)); - } -} - -#else - -static pj_status_t init_blade_dll(void) -{ - PJ_LOG(1,(THIS_FILE, "Error: MP3 writer port only works on Windows for now")); - return PJ_ENOTSUP; -} - -static void deinit_blade_dll() -{ -} -#endif - - - -/* - * Initialize MP3 encoder. - */ -static pj_status_t init_mp3_encoder(struct mp3_file_port *fport, - pj_pool_t *pool) -{ - BE_CONFIG LConfig; - unsigned long InSamples; - unsigned long OutBuffSize; - long MP3Err; - - /* - * Initialize encoder configuration. - */ - pj_bzero(&LConfig, sizeof(BE_CONFIG)); - LConfig.dwConfig = BE_CONFIG_LAME; - LConfig.format.LHV1.dwStructVersion = 1; - LConfig.format.LHV1.dwStructSize = sizeof(BE_CONFIG); - LConfig.format.LHV1.dwSampleRate = fport->base.info.clock_rate; - LConfig.format.LHV1.dwReSampleRate = 0; - - if (fport->base.info.channel_count==1) - LConfig.format.LHV1.nMode = BE_MP3_MODE_MONO; - else if (fport->base.info.channel_count==2) - LConfig.format.LHV1.nMode = BE_MP3_MODE_STEREO; - else - return PJMEDIA_ENCCHANNEL; - - LConfig.format.LHV1.dwBitrate = fport->mp3_option.bit_rate / 1000; - LConfig.format.LHV1.nPreset = LQP_NOPRESET; - LConfig.format.LHV1.bCopyright = 0; - LConfig.format.LHV1.bCRC = 1; - LConfig.format.LHV1.bOriginal = 1; - LConfig.format.LHV1.bPrivate = 0; - - if (!fport->mp3_option.vbr) { - LConfig.format.LHV1.nVbrMethod = VBR_METHOD_NONE; - LConfig.format.LHV1.bWriteVBRHeader = 0; - LConfig.format.LHV1.bEnableVBR = 0; - } else { - LConfig.format.LHV1.nVbrMethod = VBR_METHOD_DEFAULT; - LConfig.format.LHV1.bWriteVBRHeader = 1; - LConfig.format.LHV1.dwVbrAbr_bps = fport->mp3_option.bit_rate; - LConfig.format.LHV1.nVBRQuality = (pj_uint16_t) - fport->mp3_option.quality; - LConfig.format.LHV1.bEnableVBR = 1; - } - - LConfig.format.LHV1.nQuality = (pj_uint16_t) - (((0-fport->mp3_option.quality-1)<<8) | - fport->mp3_option.quality); - - /* - * Init MP3 stream. - */ - InSamples = 0; - MP3Err = BladeDLL.beInitStream(&LConfig, &InSamples, &OutBuffSize, - &fport->mp3_stream); - if (MP3Err != BE_ERR_SUCCESSFUL) - return PJMEDIA_ERROR; - - /* - * Allocate sample buffer. - */ - fport->mp3_samples_per_frame = (unsigned)InSamples; - fport->mp3_sample_buf = pj_pool_alloc(pool, fport->mp3_samples_per_frame * 2); - if (!fport->mp3_sample_buf) - return PJ_ENOMEM; - - /* - * Allocate encoded MP3 buffer. - */ - fport->mp3_buf = pj_pool_alloc(pool, (pj_size_t)OutBuffSize); - if (fport->mp3_buf == NULL) - return PJ_ENOMEM; - - - return PJ_SUCCESS; -} - - -/* - * Create MP3 file writer port. - */ -PJ_DEF(pj_status_t) -pjmedia_mp3_writer_port_create( pj_pool_t *pool, - const char *filename, - unsigned sampling_rate, - unsigned channel_count, - unsigned samples_per_frame, - unsigned bits_per_sample, - const pjmedia_mp3_encoder_option *param_option, - pjmedia_port **p_port ) -{ - struct mp3_file_port *fport; - pj_status_t status; - - status = init_blade_dll(); - if (status != PJ_SUCCESS) - return status; - - /* Check arguments. */ - PJ_ASSERT_RETURN(pool && filename && p_port, PJ_EINVAL); - - /* Only supports 16bits per sample for now. */ - PJ_ASSERT_RETURN(bits_per_sample == 16, PJ_EINVAL); - - /* Create file port instance. */ - fport = pj_pool_zalloc(pool, sizeof(struct mp3_file_port)); - PJ_ASSERT_RETURN(fport != NULL, PJ_ENOMEM); - - /* Initialize port info. */ - pj_strdup2_with_null(pool, &fport->mp3_filename, filename); - pjmedia_port_info_init(&fport->base.info, &fport->mp3_filename, SIGNATURE, - sampling_rate, channel_count, bits_per_sample, - samples_per_frame); - - fport->base.get_frame = &file_get_frame; - fport->base.put_frame = &file_put_frame; - fport->base.on_destroy = &file_on_destroy; - - - /* Open file in write and read mode. - * We need the read mode because we'll modify the WAVE header once - * the recording has completed. - */ - status = pj_file_open(pool, filename, PJ_O_WRONLY, &fport->fd); - if (status != PJ_SUCCESS) { - deinit_blade_dll(); - return status; - } - - /* Copy and initialize option with default settings */ - if (param_option) { - pj_memcpy(&fport->mp3_option, param_option, - sizeof(pjmedia_mp3_encoder_option)); - } else { - pj_bzero(&fport->mp3_option, sizeof(pjmedia_mp3_encoder_option)); - fport->mp3_option.vbr = PJ_TRUE; - } - - /* Calculate bitrate if it's not specified, only if it's not VBR. */ - if (fport->mp3_option.bit_rate == 0 && !fport->mp3_option.vbr) - fport->mp3_option.bit_rate = sampling_rate * channel_count; - - /* Set default quality if it's not specified */ - if (fport->mp3_option.quality == 0) - fport->mp3_option.quality = 2; - - /* Init mp3 encoder */ - status = init_mp3_encoder(fport, pool); - if (status != PJ_SUCCESS) { - pj_file_close(fport->fd); - deinit_blade_dll(); - return status; - } - - /* Done. */ - *p_port = &fport->base; - - PJ_LOG(4,(THIS_FILE, - "MP3 file writer '%.*s' created: samp.rate=%dKHz, " - "bitrate=%dkbps%s, quality=%d", - (int)fport->base.info.name.slen, - fport->base.info.name.ptr, - fport->base.info.clock_rate/1000, - fport->mp3_option.bit_rate/1000, - (fport->mp3_option.vbr ? " (VBR)" : ""), - fport->mp3_option.quality)); - - return PJ_SUCCESS; -} - - - -/* - * Register callback. - */ -PJ_DEF(pj_status_t) -pjmedia_mp3_writer_port_set_cb( pjmedia_port *port, - pj_size_t pos, - void *user_data, - pj_status_t (*cb)(pjmedia_port *port, - void *usr_data)) -{ - struct mp3_file_port *fport; - - /* Sanity check */ - PJ_ASSERT_RETURN(port && cb, PJ_EINVAL); - - /* Check that this is really a writer port */ - PJ_ASSERT_RETURN(port->info.signature == SIGNATURE, PJ_EINVALIDOP); - - fport = (struct mp3_file_port*) port; - - fport->cb_size = pos; - fport->base.port_data.pdata = user_data; - fport->cb = cb; - - return PJ_SUCCESS; - -} - - -/* - * Put a frame into the buffer. When the buffer is full, flush the buffer - * to the file. - */ -static pj_status_t file_put_frame(pjmedia_port *this_port, - const pjmedia_frame *frame) -{ - struct mp3_file_port *fport = (struct mp3_file_port *)this_port; - unsigned long MP3Err; - pj_ssize_t bytes; - pj_status_t status; - unsigned long WriteSize; - - /* Record silence if input is no-frame */ - if (frame->type == PJMEDIA_FRAME_TYPE_NONE || frame->size == 0) { - unsigned samples_left = fport->base.info.samples_per_frame; - unsigned samples_copied = 0; - - /* Only want to record at most 1 second of silence */ - if (fport->silence_duration >= fport->base.info.clock_rate) - return PJ_SUCCESS; - - while (samples_left) { - unsigned samples_needed = fport->mp3_samples_per_frame - - fport->mp3_sample_pos; - if (samples_needed > samples_left) - samples_needed = samples_left; - - pjmedia_zero_samples(fport->mp3_sample_buf + fport->mp3_sample_pos, - samples_needed); - fport->mp3_sample_pos += samples_needed; - samples_left -= samples_needed; - samples_copied += samples_needed; - - /* Encode if we have full frame */ - if (fport->mp3_sample_pos == fport->mp3_samples_per_frame) { - - /* Clear position */ - fport->mp3_sample_pos = 0; - - /* Encode ! */ - MP3Err = BladeDLL.beEncodeChunk(fport->mp3_stream, - fport->mp3_samples_per_frame, - fport->mp3_sample_buf, - fport->mp3_buf, - &WriteSize); - if (MP3Err != BE_ERR_SUCCESSFUL) - return PJMEDIA_ERROR; - - /* Write the chunk */ - bytes = WriteSize; - status = pj_file_write(fport->fd, fport->mp3_buf, &bytes); - if (status != PJ_SUCCESS) - return status; - - /* Increment total written. */ - fport->total += bytes; - } - } - - fport->silence_duration += fport->base.info.samples_per_frame; - - } - /* If encoder is expecting different sample size, then we need to - * buffer the samples. - */ - else if (fport->mp3_samples_per_frame != - fport->base.info.samples_per_frame) - { - unsigned samples_left = frame->size / 2; - unsigned samples_copied = 0; - const pj_int16_t *src_samples = frame->buf; - - fport->silence_duration = 0; - - while (samples_left) { - unsigned samples_needed = fport->mp3_samples_per_frame - - fport->mp3_sample_pos; - if (samples_needed > samples_left) - samples_needed = samples_left; - - pjmedia_copy_samples(fport->mp3_sample_buf + fport->mp3_sample_pos, - src_samples + samples_copied, - samples_needed); - fport->mp3_sample_pos += samples_needed; - samples_left -= samples_needed; - samples_copied += samples_needed; - - /* Encode if we have full frame */ - if (fport->mp3_sample_pos == fport->mp3_samples_per_frame) { - - /* Clear position */ - fport->mp3_sample_pos = 0; - - /* Encode ! */ - MP3Err = BladeDLL.beEncodeChunk(fport->mp3_stream, - fport->mp3_samples_per_frame, - fport->mp3_sample_buf, - fport->mp3_buf, - &WriteSize); - if (MP3Err != BE_ERR_SUCCESSFUL) - return PJMEDIA_ERROR; - - /* Write the chunk */ - bytes = WriteSize; - status = pj_file_write(fport->fd, fport->mp3_buf, &bytes); - if (status != PJ_SUCCESS) - return status; - - /* Increment total written. */ - fport->total += bytes; - } - } - - } else { - - fport->silence_duration = 0; - - /* Encode ! */ - MP3Err = BladeDLL.beEncodeChunk(fport->mp3_stream, - fport->mp3_samples_per_frame, - frame->buf, - fport->mp3_buf, - &WriteSize); - if (MP3Err != BE_ERR_SUCCESSFUL) - return PJMEDIA_ERROR; - - /* Write the chunk */ - bytes = WriteSize; - status = pj_file_write(fport->fd, fport->mp3_buf, &bytes); - if (status != PJ_SUCCESS) - return status; - - /* Increment total written. */ - fport->total += bytes; - } - - /* Increment total written, and check if we need to call callback */ - - if (fport->cb && fport->total >= fport->cb_size) { - pj_status_t (*cb)(pjmedia_port*, void*); - pj_status_t status; - - cb = fport->cb; - fport->cb = NULL; - - status = (*cb)(this_port, this_port->port_data.pdata); - return status; - } - - return PJ_SUCCESS; -} - -/* - * Get frame, basicy is a no-op operation. - */ -static pj_status_t file_get_frame(pjmedia_port *this_port, - pjmedia_frame *frame) -{ - PJ_UNUSED_ARG(this_port); - PJ_UNUSED_ARG(frame); - return PJ_EINVALIDOP; -} - - -/* - * Close the port, modify file header with updated file length. - */ -static pj_status_t file_on_destroy(pjmedia_port *this_port) -{ - struct mp3_file_port *fport = (struct mp3_file_port*)this_port; - pj_status_t status; - unsigned long WriteSize; - unsigned long MP3Err; - - - /* Close encoder */ - MP3Err = BladeDLL.beDeinitStream(fport->mp3_stream, fport->mp3_buf, - &WriteSize); - if (MP3Err == BE_ERR_SUCCESSFUL) { - pj_ssize_t bytes = WriteSize; - status = pj_file_write(fport->fd, fport->mp3_buf, &bytes); - } - - /* Close file */ - status = pj_file_close(fport->fd); - - /* Write additional VBR header */ - if (fport->mp3_option.vbr) { - MP3Err = BladeDLL.beWriteVBRHeader(fport->mp3_filename.ptr); - } - - - /* Decrement DLL reference counter */ - deinit_blade_dll(); - - /* Done. */ - return PJ_SUCCESS; -} - diff --git a/third_party/portaudio/Doxyfile b/third_party/portaudio/Doxyfile deleted file mode 100644 index 7dbfdfe..0000000 --- a/third_party/portaudio/Doxyfile +++ /dev/null @@ -1,239 +0,0 @@ -# Doxyfile 1.4.6 - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -PROJECT_NAME = PortAudio -PROJECT_NUMBER = 2.0 -OUTPUT_DIRECTORY = ./doc/ -CREATE_SUBDIRS = NO -OUTPUT_LANGUAGE = English -USE_WINDOWS_ENCODING = NO -BRIEF_MEMBER_DESC = YES -REPEAT_BRIEF = YES -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the -ALWAYS_DETAILED_SEC = NO -INLINE_INHERITED_MEMB = NO -FULL_PATH_NAMES = NO -STRIP_FROM_PATH = -STRIP_FROM_INC_PATH = -SHORT_NAMES = NO -JAVADOC_AUTOBRIEF = NO -MULTILINE_CPP_IS_BRIEF = NO -DETAILS_AT_TOP = NO -INHERIT_DOCS = YES -SEPARATE_MEMBER_PAGES = NO -TAB_SIZE = 8 -ALIASES = -OPTIMIZE_OUTPUT_FOR_C = YES -OPTIMIZE_OUTPUT_JAVA = NO -BUILTIN_STL_SUPPORT = NO -DISTRIBUTE_GROUP_DOC = NO -SUBGROUPING = YES -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- -EXTRACT_ALL = YES -EXTRACT_PRIVATE = NO -EXTRACT_STATIC = NO -EXTRACT_LOCAL_CLASSES = YES -EXTRACT_LOCAL_METHODS = NO -HIDE_UNDOC_MEMBERS = NO -HIDE_UNDOC_CLASSES = NO -HIDE_FRIEND_COMPOUNDS = NO -HIDE_IN_BODY_DOCS = NO -INTERNAL_DOCS = NO -CASE_SENSE_NAMES = YES -HIDE_SCOPE_NAMES = NO -SHOW_INCLUDE_FILES = YES -INLINE_INFO = YES -SORT_MEMBER_DOCS = YES -SORT_BRIEF_DOCS = NO -SORT_BY_SCOPE_NAME = NO -GENERATE_TODOLIST = YES -GENERATE_TESTLIST = YES -GENERATE_BUGLIST = YES -GENERATE_DEPRECATEDLIST= YES -ENABLED_SECTIONS = -MAX_INITIALIZER_LINES = 30 -SHOW_USED_FILES = YES -SHOW_DIRECTORIES = NO -FILE_VERSION_FILTER = -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- -QUIET = NO -WARNINGS = YES -WARN_IF_UNDOCUMENTED = YES -WARN_IF_DOC_ERROR = YES -WARN_NO_PARAMDOC = NO -WARN_FORMAT = "$file:$line: $text" -WARN_LOGFILE = -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- -INPUT = doc/src \ - src \ - include \ - test -FILE_PATTERNS = *.h \ - *.c \ - *.cpp \ - *.dox -RECURSIVE = YES -EXCLUDE = -EXCLUDE_SYMLINKS = NO -EXCLUDE_PATTERNS = -EXAMPLE_PATH = -EXAMPLE_PATTERNS = -EXAMPLE_RECURSIVE = NO -IMAGE_PATH = -INPUT_FILTER = -FILTER_PATTERNS = -FILTER_SOURCE_FILES = NO -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- -SOURCE_BROWSER = NO -INLINE_SOURCES = NO -STRIP_CODE_COMMENTS = YES -REFERENCED_BY_RELATION = YES -REFERENCES_RELATION = YES -USE_HTAGS = NO -VERBATIM_HEADERS = YES -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- -ALPHABETICAL_INDEX = NO -COLS_IN_ALPHA_INDEX = 5 -IGNORE_PREFIX = -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- -GENERATE_HTML = YES -HTML_OUTPUT = html -HTML_FILE_EXTENSION = .html -HTML_HEADER = -HTML_FOOTER = -HTML_STYLESHEET = -HTML_ALIGN_MEMBERS = YES -GENERATE_HTMLHELP = NO -CHM_FILE = -HHC_LOCATION = -GENERATE_CHI = NO -BINARY_TOC = NO -TOC_EXPAND = NO -DISABLE_INDEX = NO -ENUM_VALUES_PER_LINE = 4 -GENERATE_TREEVIEW = NO -TREEVIEW_WIDTH = 250 -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- -GENERATE_LATEX = NO -LATEX_OUTPUT = latex -LATEX_CMD_NAME = latex -MAKEINDEX_CMD_NAME = makeindex -COMPACT_LATEX = NO -PAPER_TYPE = a4wide -EXTRA_PACKAGES = -LATEX_HEADER = -PDF_HYPERLINKS = NO -USE_PDFLATEX = NO -LATEX_BATCHMODE = NO -LATEX_HIDE_INDICES = NO -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- -GENERATE_RTF = NO -RTF_OUTPUT = rtf -COMPACT_RTF = NO -RTF_HYPERLINKS = NO -RTF_STYLESHEET_FILE = -RTF_EXTENSIONS_FILE = -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- -GENERATE_MAN = NO -MAN_OUTPUT = man -MAN_EXTENSION = .3 -MAN_LINKS = NO -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- -GENERATE_XML = NO -XML_OUTPUT = xml -XML_SCHEMA = -XML_DTD = -XML_PROGRAMLISTING = YES -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- -GENERATE_AUTOGEN_DEF = NO -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- -GENERATE_PERLMOD = NO -PERLMOD_LATEX = NO -PERLMOD_PRETTY = YES -PERLMOD_MAKEVAR_PREFIX = -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- -ENABLE_PREPROCESSING = YES -MACRO_EXPANSION = NO -EXPAND_ONLY_PREDEF = NO -SEARCH_INCLUDES = YES -INCLUDE_PATH = -INCLUDE_FILE_PATTERNS = -PREDEFINED = -EXPAND_AS_DEFINED = -SKIP_FUNCTION_MACROS = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- -TAGFILES = -GENERATE_TAGFILE = -ALLEXTERNALS = NO -EXTERNAL_GROUPS = YES -PERL_PATH = /usr/bin/perl -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- -CLASS_DIAGRAMS = NO -HIDE_UNDOC_RELATIONS = NO -HAVE_DOT = NO -CLASS_GRAPH = YES -COLLABORATION_GRAPH = YES -GROUP_GRAPHS = YES -UML_LOOK = NO -TEMPLATE_RELATIONS = YES -INCLUDE_GRAPH = YES -INCLUDED_BY_GRAPH = YES -CALL_GRAPH = NO -GRAPHICAL_HIERARCHY = YES -DIRECTORY_GRAPH = YES -DOT_IMAGE_FORMAT = png -DOT_PATH = -DOTFILE_DIRS = -MAX_DOT_GRAPH_WIDTH = 1024 -MAX_DOT_GRAPH_HEIGHT = 1024 -MAX_DOT_GRAPH_DEPTH = 1000 -DOT_TRANSPARENT = NO -DOT_MULTI_TARGETS = NO -GENERATE_LEGEND = YES -DOT_CLEANUP = YES -#--------------------------------------------------------------------------- -# Configuration::additions related to the search engine -#--------------------------------------------------------------------------- -SEARCHENGINE = NO diff --git a/third_party/portaudio/LICENSE.txt b/third_party/portaudio/LICENSE.txt deleted file mode 100644 index e0ac4e8..0000000 --- a/third_party/portaudio/LICENSE.txt +++ /dev/null @@ -1,81 +0,0 @@ -Portable header file to contain: ->>>>> -/* - * PortAudio Portable Real-Time Audio Library - * PortAudio API Header File - * Latest version available at: http://www.portaudio.com - * - * Copyright (c) 1999-2006 Ross Bencina and Phil Burk - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ -<<<<< - - -Implementation files to contain: ->>>>> -/* - * PortAudio Portable Real-Time Audio Library - * Latest version at: http://www.portaudio.com - * Implementation - * Copyright (c) 1999-2000 - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ -<<<<< \ No newline at end of file diff --git a/third_party/portaudio/Makefile.in b/third_party/portaudio/Makefile.in deleted file mode 100644 index 58c95cd..0000000 --- a/third_party/portaudio/Makefile.in +++ /dev/null @@ -1,223 +0,0 @@ -# -# PortAudio V19 Makefile.in -# -# Dominic Mazzoni -# Modifications by Mikael Magnusson -# Modifications by Stelios Bounanos -# - -top_srcdir = @top_srcdir@ -srcdir = @srcdir@ -VPATH = @srcdir@ -top_builddir = . -PREFIX = @prefix@ -prefix = $(PREFIX) -exec_prefix = @exec_prefix@ -bindir = @bindir@ -libdir = @libdir@ -includedir = @includedir@ -CC = @CC@ -CXX = @CXX@ -CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src/common -I$(top_srcdir)/src/os/unix @CFLAGS@ @DEFS@ -LIBS = @LIBS@ -AR = @AR@ -RANLIB = @RANLIB@ -LIBTOOL = @LIBTOOL@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -SHARED_FLAGS = @SHARED_FLAGS@ -LDFLAGS = @LDFLAGS@ -DLL_LIBS = @DLL_LIBS@ -CXXFLAGS = @CXXFLAGS@ -NASM = @NASM@ -NASMOPT = @NASMOPT@ -LN_S = @LN_S@ -LT_CURRENT=@LT_CURRENT@ -LT_REVISION=@LT_REVISION@ -LT_AGE=@LT_AGE@ - -OTHER_OBJS = @OTHER_OBJS@ - -PALIB = libportaudio.la -PAINC = include/portaudio.h - -PA_LDFLAGS = $(LDFLAGS) $(SHARED_FLAGS) -rpath $(libdir) -no-undefined \ - -export-symbols-regex "(Pa|PaMacCore|PaJack|PaAlsa|PaAsio)_.*" \ - -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) - -COMMON_OBJS = \ - src/common/pa_allocation.o \ - src/common/pa_converters.o \ - src/common/pa_cpuload.o \ - src/common/pa_dither.o \ - src/common/pa_debugprint.o \ - src/common/pa_front.o \ - src/common/pa_process.o \ - src/common/pa_skeleton.o \ - src/common/pa_stream.o \ - src/common/pa_trace.o - -TESTS = \ - bin/paqa_devs \ - bin/paqa_errs \ - bin/patest1 \ - bin/patest_buffer \ - bin/patest_callbackstop \ - bin/patest_clip \ - bin/patest_dither \ - bin/patest_hang \ - bin/patest_in_overflow \ - bin/patest_latency \ - bin/patest_leftright \ - bin/patest_longsine \ - bin/patest_many \ - bin/patest_maxsines \ - bin/patest_multi_sine \ - bin/patest_out_underflow \ - bin/patest_pink \ - bin/patest_prime \ - bin/patest_read_record \ - bin/patest_read_write_wire \ - bin/patest_record \ - bin/patest_ringmix \ - bin/patest_saw \ - bin/patest_sine8 \ - bin/patest_sine \ - bin/patest_sine_channelmaps \ - bin/patest_sine_formats \ - bin/patest_sine_time \ - bin/patest_sine_srate \ - bin/patest_start_stop \ - bin/patest_stop \ - bin/patest_stop_playout \ - bin/patest_toomanysines \ - bin/patest_underflow \ - bin/patest_wire \ - bin/patest_write_sine \ - bin/pa_devs \ - bin/pa_fuzz \ - bin/pa_minlat - -# Most of these don't compile yet. Put them in TESTS, above, if -# you want to try to compile them... -ALL_TESTS = \ - $(TESTS) \ - bin/patest_sync \ - bin/debug_convert \ - bin/debug_dither_calc \ - bin/debug_dual \ - bin/debug_multi_in \ - bin/debug_multi_out \ - bin/debug_record \ - bin/debug_record_reuse \ - bin/debug_sine_amp \ - bin/debug_sine \ - bin/debug_sine_formats \ - bin/debug_srate \ - bin/debug_test1 - -OBJS := $(COMMON_OBJS) $(OTHER_OBJS) - -LTOBJS := $(OBJS:.o=.lo) - -SRC_DIRS = \ - src/common \ - src/hostapi/alsa \ - src/hostapi/asihpi \ - src/hostapi/asio \ - src/hostapi/coreaudio \ - src/hostapi/dsound \ - src/hostapi/jack \ - src/hostapi/oss \ - src/hostapi/wasapi \ - src/hostapi/wdmks \ - src/hostapi/wmme \ - src/os/mac_osx \ - src/os/unix \ - src/os/win - -SUBDIRS = -@ENABLE_CXX_TRUE@SUBDIRS += bindings/cpp - -all: lib/$(PALIB) all-recursive tests - -tests: bin-stamp $(TESTS) - - -# With ASIO enabled we must link libportaudio and all test programs with CXX -lib/$(PALIB): lib-stamp $(LTOBJS) $(MAKEFILE) $(PAINC) - @WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS) - @WITH_ASIO_TRUE@ $(LIBTOOL) --mode=link --tag=CXX $(CXX) $(PA_LDFLAGS) -o lib/$(PALIB) $(LTOBJS) $(DLL_LIBS) - -$(ALL_TESTS): bin/%: lib/$(PALIB) $(MAKEFILE) $(PAINC) test/%.c - @WITH_ASIO_FALSE@ $(LIBTOOL) --mode=link $(CC) -o $@ $(CFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS) - @WITH_ASIO_TRUE@ $(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $(CXXFLAGS) $(top_srcdir)/test/$*.c lib/$(PALIB) $(LIBS) - - -install: lib/$(PALIB) portaudio-2.0.pc - $(INSTALL) -d $(DESTDIR)$(libdir) - $(LIBTOOL) --mode=install $(INSTALL) lib/$(PALIB) $(DESTDIR)$(libdir) - $(INSTALL) -d $(DESTDIR)$(includedir) - $(INSTALL_DATA) -m 644 $(top_srcdir)/$(PAINC) $(DESTDIR)$(includedir)/portaudio.h - $(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig - $(INSTALL) -m 644 portaudio-2.0.pc $(DESTDIR)$(libdir)/pkgconfig/portaudio-2.0.pc - @echo "" - @echo "------------------------------------------------------------" - @echo "PortAudio was successfully installed." - @echo "" - @echo "On some systems (e.g. Linux) you should run 'ldconfig' now" - @echo "to make the shared object available. You may also need to" - @echo "modify your LD_LIBRARY_PATH environment variable to include" - @echo "the directory $(libdir)" - @echo "------------------------------------------------------------" - @echo "" - $(MAKE) install-recursive - -uninstall: - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(PALIB) - $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(includedir)/portaudio.h - $(MAKE) uninstall-recursive - -clean: - $(LIBTOOL) --mode=clean rm -f $(LTOBJS) $(ALL_TESTS) lib/$(PALIB) - $(RM) bin-stamp lib-stamp - -$(RM) -r bin lib - -distclean: clean - $(RM) config.log config.status Makefile libtool portaudio-2.0.pc - -%.o: %.c $(MAKEFILE) $(PAINC) - $(CC) -c $(CFLAGS) $< -o $@ - -%.lo: %.c $(MAKEFILE) $(PAINC) - $(LIBTOOL) --mode=compile $(CC) -c $(CFLAGS) $< -o $@ - -%.lo: %.cpp $(MAKEFILE) $(PAINC) - $(LIBTOOL) --mode=compile --tag=CXX $(CXX) -c $(CXXFLAGS) $< -o $@ - -%.o: %.cpp $(MAKEFILE) $(PAINC) - $(CXX) -c $(CXXFLAGS) $< -o $@ - -%.o: %.asm - $(NASM) $(NASMOPT) -o $@ $< - -bin-stamp: - -mkdir bin - touch $@ - -lib-stamp: - -mkdir lib - -mkdir -p $(SRC_DIRS) - touch $@ - -Makefile: Makefile.in config.status - $(SHELL) config.status - -all-recursive: - if test -n "$(SUBDIRS)" ; then for dir in "$(SUBDIRS)"; do $(MAKE) -C $$dir all; done ; fi - -install-recursive: - if test -n "$(SUBDIRS)" ; then for dir in "$(SUBDIRS)"; do $(MAKE) -C $$dir install; done ; fi - -uninstall-recursive: - if test -n "$(SUBDIRS)" ; then for dir in "$(SUBDIRS)"; do $(MAKE) -C $$dir uninstall; done ; fi diff --git a/third_party/portaudio/README.txt b/third_party/portaudio/README.txt deleted file mode 100644 index 2113827..0000000 --- a/third_party/portaudio/README.txt +++ /dev/null @@ -1,98 +0,0 @@ -README for PortAudio - -/* - * PortAudio Portable Real-Time Audio Library - * Latest Version at: http://www.portaudio.com - * - * Copyright (c) 1999-2008 Phil Burk and Ross Bencina - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files - * (the "Software"), to deal in the Software without restriction, - * including without limitation the rights to use, copy, modify, merge, - * publish, distribute, sublicense, and/or sell copies of the Software, - * and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * The text above constitutes the entire PortAudio license; however, - * the PortAudio community also makes the following non-binding requests: - * - * Any person wishing to distribute modifications to the Software is - * requested to send the modifications to the original developer so that - * they can be incorporated into the canonical version. It is also - * requested that these non-binding requests be included along with the - * license above. - */ - - -PortAudio is a portable audio I/O library designed for cross-platform -support of audio. It uses either a callback mechanism to request audio -processing, or blocking read/write calls to buffer data between the -native audio subsystem and the client. Audio can be processed in various -formats, including 32 bit floating point, and will be converted to the -native format internally. - -Documentation: - Documentation is available in "/doc/html/index.html" - Also see "src/common/portaudio.h" for API spec. - Also see http://www.portaudio.com/docs/ - And see the "test/" directory for many examples of usage - (we suggest "test/patest_saw.c" for an example) - -For information on compiling programs with PortAudio, please see the -tutorial at: - - http://portaudio.com/trac/wiki/TutorialDir/TutorialStart - -We have an active mailing list for user and developer discussions. -Please feel free to join. See http://www.portaudio.com for details. - - -Important Files and Folders: - include/portaudio.h = header file for PortAudio API. Specifies API. - src/common/ = platform independant code, host independant - code for all implementations. - src/os = os specific (but host api neutral) code - src/hostapi = implementations for different host apis - - -Host API Implementations: - src/hostapi/alsa = Advanced Linux Sound Architecture (ALSA) - src/hostapi/asihpi = AudioScience HPI - src/hostapi/asio = ASIO for Windows and Macintosh - src/hostapi/coreaudio = Macintosh Core Audio for OS X - src/hostapi/dsound = Windows Direct Sound - src/hostapi/jack = JACK Audio Connection Kit - src/hostapi/oss = Unix Open Sound System (OSS) - src/hostapi/wasapi = Windows Vista WASAPI - src/hostapi/wdmks = Windows WDM Kernel Streaming - src/hostapi/wmme = Windows MultiMedia Extensions (MME) - - -Test Programs: - test/pa_fuzz.c = guitar fuzz box - test/pa_devs.c = print a list of available devices - test/pa_minlat.c = determine minimum latency for your machine - test/paqa_devs.c = self test that opens all devices - test/paqa_errs.c = test error detection and reporting - test/patest_clip.c = hear a sine wave clipped and unclipped - test/patest_dither.c = hear effects of dithering (extremely subtle) - test/patest_pink.c = fun with pink noise - test/patest_record.c = record and playback some audio - test/patest_maxsines.c = how many sine waves can we play? Tests Pa_GetCPULoad(). - test/patest_sine.c = output a sine wave in a simple PA app - test/patest_sync.c = test syncronization of audio and video - test/patest_wire.c = pass input to output, wire simulator diff --git a/third_party/portaudio/SConstruct b/third_party/portaudio/SConstruct deleted file mode 100644 index 37e67ba..0000000 --- a/third_party/portaudio/SConstruct +++ /dev/null @@ -1,197 +0,0 @@ -import sys, os.path - -def rsplit(toSplit, sub, max=-1): - """ str.rsplit seems to have been introduced in 2.4 :( """ - l = [] - i = 0 - while i != max: - try: idx = toSplit.rindex(sub) - except ValueError: break - - toSplit, splitOff = toSplit[:idx], toSplit[idx + len(sub):] - l.insert(0, splitOff) - i += 1 - - l.insert(0, toSplit) - return l - -sconsDir = os.path.join("build", "scons") -SConscript(os.path.join(sconsDir, "SConscript_common")) -Import("Platform", "Posix", "ApiVer") - -# SConscript_opts exports PortAudio options -optsDict = SConscript(os.path.join(sconsDir, "SConscript_opts")) -optionsCache = os.path.join(sconsDir, "options.cache") # Save options between runs in this cache -options = Options(optionsCache, args=ARGUMENTS) -for k in ("Installation Dirs", "Build Targets", "Host APIs", "Build Parameters", "Bindings"): - options.AddOptions(*optsDict[k]) -# Propagate options into environment -env = Environment(options=options) -# Save options for next run -options.Save(optionsCache, env) -# Generate help text for options -env.Help(options.GenerateHelpText(env)) - -buildDir = os.path.join("#", sconsDir, env["PLATFORM"]) - -# Determine parameters to build tools -if Platform in Posix: - threadCFlags = '' - if Platform != 'darwin': - threadCFlags = "-pthread " - baseLinkFlags = threadCFlags - baseCxxFlags = baseCFlags = "-Wall -pedantic -pipe " + threadCFlags - debugCxxFlags = debugCFlags = "-g" - optCxxFlags = optCFlags = "-O2" -env.Append(CCFLAGS = baseCFlags) -env.Append(CXXFLAGS = baseCxxFlags) -env.Append(LINKFLAGS = baseLinkFlags) -if env["enableDebug"]: - env.AppendUnique(CCFLAGS=debugCFlags.split()) - env.AppendUnique(CXXFLAGS=debugCxxFlags.split()) -if env["enableOptimize"]: - env.AppendUnique(CCFLAGS=optCFlags.split()) - env.AppendUnique(CXXFLAGS=optCxxFlags.split()) -if not env["enableAsserts"]: - env.AppendUnique(CPPDEFINES=["-DNDEBUG"]) -if env["customCFlags"]: - env.Append(CCFLAGS=Split(env["customCFlags"])) -if env["customCxxFlags"]: - env.Append(CXXFLAGS=Split(env["customCxxFlags"])) -if env["customLinkFlags"]: - env.Append(LINKFLAGS=Split(env["customLinkFlags"])) - -env.Append(CPPPATH=[os.path.join("#", "include"), "common"]) - -# Store all signatures in one file, otherwise .sconsign files will get installed along with our own files -env.SConsignFile(os.path.join(sconsDir, ".sconsign")) - -env.SConscriptChdir(False) -sources, sharedLib, staticLib, tests, portEnv, hostApis = env.SConscript(os.path.join("src", "SConscript"), - build_dir=buildDir, duplicate=False, exports=["env"]) - -if Platform in Posix: - prefix = env["prefix"] - includeDir = os.path.join(prefix, "include") - libDir = os.path.join(prefix, "lib") - env.Alias("install", includeDir) - env.Alias("install", libDir) - - # pkg-config - - def installPkgconfig(env, target, source): - tgt = str(target[0]) - src = str(source[0]) - f = open(src) - try: txt = f.read() - finally: f.close() - txt = txt.replace("@prefix@", prefix) - txt = txt.replace("@exec_prefix@", prefix) - txt = txt.replace("@libdir@", libDir) - txt = txt.replace("@includedir@", includeDir) - txt = txt.replace("@LIBS@", " ".join(["-l%s" % l for l in portEnv["LIBS"]])) - txt = txt.replace("@THREAD_CFLAGS@", threadCFlags) - - f = open(tgt, "w") - try: f.write(txt) - finally: f.close() - - pkgconfigTgt = "portaudio-%d.0.pc" % int(ApiVer.split(".", 1)[0]) - env.Command(os.path.join(libDir, "pkgconfig", pkgconfigTgt), - os.path.join("#", pkgconfigTgt + ".in"), installPkgconfig) - -# Default to None, since if the user disables all targets and no Default is set, all targets -# are built by default -env.Default(None) -if env["enableTests"]: - env.Default(tests) -if env["enableShared"]: - env.Default(sharedLib) - - if Platform in Posix: - def symlink(env, target, source): - trgt = str(target[0]) - src = str(source[0]) - - if os.path.islink(trgt) or os.path.exists(trgt): - os.remove(trgt) - os.symlink(os.path.basename(src), trgt) - - major, minor, micro = [int(c) for c in ApiVer.split(".")] - - soFile = "%s.%s" % (os.path.basename(str(sharedLib[0])), ApiVer) - env.InstallAs(target=os.path.join(libDir, soFile), source=sharedLib) - # Install symlinks - symTrgt = os.path.join(libDir, soFile) - env.Command(os.path.join(libDir, "libportaudio.so.%d.%d" % (major, minor)), - symTrgt, symlink) - symTrgt = rsplit(symTrgt, ".", 1)[0] - env.Command(os.path.join(libDir, "libportaudio.so.%d" % major), symTrgt, symlink) - symTrgt = rsplit(symTrgt, ".", 1)[0] - env.Command(os.path.join(libDir, "libportaudio.so"), symTrgt, symlink) - -if env["enableStatic"]: - env.Default(staticLib) - env.Install(libDir, staticLib) - -env.Install(includeDir, os.path.join("include", "portaudio.h")) - - -if env["enableCxx"]: - env.SConscriptChdir(True) - cxxEnv = env.Copy() - sharedLibs, staticLibs, headers = env.SConscript(os.path.join("bindings", "cpp", "SConscript"), - exports={"env": cxxEnv, "buildDir": buildDir}, build_dir=os.path.join(buildDir, "portaudiocpp"), duplicate=False) - if env["enableStatic"]: - env.Default(staticLibs) - env.Install(libDir, staticLibs) - if env["enableShared"]: - env.Default(sharedLibs) - env.Install(libDir, sharedLibs) - env.Install(os.path.join(includeDir, "portaudiocpp"), headers) - -# Generate portaudio_config.h header with compile-time definitions of which PA -# back-ends are available, and which includes back-end extension headers - -# Host-specific headers -hostApiHeaders = {"ALSA": "pa_linux_alsa.h", - "ASIO": "pa_asio.h", - "COREAUDIO": "pa_mac_core.h", - "JACK": "pa_jack.h", - "WMME": "pa_winwmme.h", - } - -def buildConfigH(target, source, env): - """builder for portaudio_config.h""" - global hostApiHeaders, hostApis - out = "" - for hostApi in hostApis: - out += "#define PA_HAVE_%s\n" % hostApi - - hostApiSpecificHeader = hostApiHeaders.get(hostApi, None) - if hostApiSpecificHeader: - out += "#include \"%s\"\n" % hostApiSpecificHeader - - out += "\n" - # Strip the last newline - if out and out[-1] == "\n": - out = out[:-1] - - f = file(str(target[0]), 'w') - try: f.write(out) - finally: f.close() - return 0 - -# Define the builder for the config header -env.Append(BUILDERS={"portaudioConfig": env.Builder( - action=Action(buildConfigH), target_factory=env.fs.File)}) - -confH = env.portaudioConfig(File("portaudio_config.h", "include"), - File("portaudio.h", "include")) -env.Default(confH) -env.Install(os.path.join(includeDir, "portaudio"), confH) - -for api in hostApis: - if api in hostApiHeaders: - env.Install(os.path.join(includeDir, "portaudio"), - File(hostApiHeaders[api], "include")) diff --git a/third_party/portaudio/aclocal.m4 b/third_party/portaudio/aclocal.m4 deleted file mode 100644 index 9e5b4fd..0000000 --- a/third_party/portaudio/aclocal.m4 +++ /dev/null @@ -1,6627 +0,0 @@ -# aclocal.m4 generated automatically by aclocal 1.6.3 -*- Autoconf -*- - -# Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- - -# serial 48 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Check if we have a version mismatch between libtool.m4 and ltmain.sh. -# -# Note: This should be in AC_LIBTOOL_SETUP, _after_ $ltmain have been defined. -# We also should do it _before_ AC_LIBTOOL_LANG_C_CONFIG that actually -# calls AC_LIBTOOL_CONFIG and creates libtool. -# -_LT_VERSION_CHECK - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_VERSION_CHECK -# ----------------- -AC_DEFUN([_LT_VERSION_CHECK], -[AC_MSG_CHECKING([for correct ltmain.sh version]) -if test "x$ltmain" = "x" ; then - AC_MSG_RESULT(no) - AC_MSG_ERROR([ - -*** @<:@Gentoo@:>@ sanity check failed! *** -*** \$ltmain is not defined, please check the patch for consistency! *** -]) -fi -gentoo_lt_version="1.5.22" -gentoo_ltmain_version=`sed -n '/^[[ ]]*VERSION=/{s/^[[ ]]*VERSION=//;p;q;}' "$ltmain"` -if test "x$gentoo_lt_version" != "x$gentoo_ltmain_version" ; then - AC_MSG_RESULT(no) - AC_MSG_ERROR([ - -*** @<:@Gentoo@:>@ sanity check failed! *** -*** libtool.m4 and ltmain.sh have a version mismatch! *** -*** (libtool.m4 = $gentoo_lt_version, ltmain.sh = $gentoo_ltmain_version) *** - -Please run: - - libtoolize --copy --force - -if appropriate, please contact the maintainer of this -package (or your distribution) for help. -]) -else - AC_MSG_RESULT(yes) -fi -])# _LT_VERSION_CHECK - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_AC_SYS_COMPILER - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -AC_DEFUN([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -AC_DEFUN([_LT_LINKER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_LINKER_BOILERPLATE - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# ------------------ -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# --------------------------------------------------------------------- -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ---------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_AC_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - linux*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - if test $supports_anon_versioning = yes; then - archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ -cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ -$echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - else - $archive_expsym_cmds="$archive_cmds" - fi - else - ld_shlibs=no - fi - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[123]]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - # Handle Gentoo/FreeBSD as it was Linux - case $host_vendor in - gentoo) - version_type=linux ;; - *) - version_type=freebsd-$objformat ;; - esac - - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - linux) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - need_lib_prefix=no - need_version=no - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 DLLs -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -# set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="ifelse([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` - while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do - ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix3*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -])# AC_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# it is assumed to be `libltdl'. LIBLTDL will be prefixed with -# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' -# (note the single quotes!). If your package is not flat and you're not -# using automake, define top_builddir and top_srcdir appropriately in -# the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# and an installed libltdl is not found, it is assumed to be `libltdl'. -# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and top_srcdir -# appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - -# _LT_AC_PROG_CXXCPP -# ------------------ -AC_DEFUN([_LT_AC_PROG_CXXCPP], -[ -AC_REQUIRE([AC_PROG_CXX]) -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -fi -])# _LT_AC_PROG_CXXCPP - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# ------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF - -# Report which library types will actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - $as_unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - $as_unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_LD - - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - with_gnu_ld=no - wlarc= - - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - ;; - *) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e 1s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1) - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# Compile-time system search path for libraries -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDGIRSTW]]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - _LT_CC_BASENAME([$compiler]) - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi[[45]]*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_MSG_RESULT([$SED]) -]) - -# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- -# -# Copyright © 2004 Scott James Remnant . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# PKG_PROG_PKG_CONFIG([MIN-VERSION]) -# ---------------------------------- -AC_DEFUN([PKG_PROG_PKG_CONFIG], -[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) -m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=m4_default([$1], [0.9.0]) - AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - PKG_CONFIG="" - fi - -fi[]dnl -])# PKG_PROG_PKG_CONFIG - -# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# Check to see whether a particular set of modules exists. Similar -# to PKG_CHECK_MODULES(), but does not set variables or print errors. -# -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure to call -# PKG_CHECK_EXISTS manually -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_EXISTS], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -if test -n "$PKG_CONFIG" && \ - AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_ifval([$2], [$2], [:]) -m4_ifvaln([$3], [else - $3])dnl -fi]) - - -# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) -# --------------------------------------------- -m4_define([_PKG_CONFIG], -[if test -n "$PKG_CONFIG"; then - if test -n "$$1"; then - pkg_cv_[]$1="$$1" - else - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - fi -else - pkg_failed=untried -fi[]dnl -])# _PKG_CONFIG - -# _PKG_SHORT_ERRORS_SUPPORTED -# ----------------------------- -AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi[]dnl -])# _PKG_SHORT_ERRORS_SUPPORTED - - -# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], -# [ACTION-IF-NOT-FOUND]) -# -# -# Note that if there is a possibility the first call to -# PKG_CHECK_MODULES might not happen, you should be sure to include an -# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac -# -# -# -------------------------------------------------------------- -AC_DEFUN([PKG_CHECK_MODULES], -[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl -AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl -AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl - -pkg_failed=no -AC_MSG_CHECKING([for $1]) - -_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) -_PKG_CONFIG([$1][_LIBS], [libs], [$2]) - -m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS -and $1[]_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details.]) - -if test $pkg_failed = yes; then - _PKG_SHORT_ERRORS_SUPPORTED - if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` - else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` - fi - # Put the nasty error message in config.log where it belongs - echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - - ifelse([$4], , [AC_MSG_ERROR(dnl -[Package requirements ($2) were not met: - -$$1_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -_PKG_TEXT -])], - [$4]) -elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl -[The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -_PKG_TEXT - -To get pkg-config, see .])], - [$4]) -else - $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS - $1[]_LIBS=$pkg_cv_[]$1[]_LIBS - AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) -fi[]dnl -])# PKG_CHECK_MODULES - diff --git a/third_party/portaudio/bindings/cpp/.keep b/third_party/portaudio/bindings/cpp/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/third_party/portaudio/build/dev-cpp/Makefile-dll b/third_party/portaudio/build/dev-cpp/Makefile-dll deleted file mode 100644 index 856af63..0000000 --- a/third_party/portaudio/build/dev-cpp/Makefile-dll +++ /dev/null @@ -1,78 +0,0 @@ -# Project: portaudio-dll -# Makefile created by Dev-C++ 4.9.8.2 - -CPP = g++.exe -CC = gcc.exe -WINDRES = windres.exe -RES = -OBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES) -LINKOBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES) -LIBS = -L"C:/Dev-CPP/lib" -fmessage-length=0 --no-export-all-symbols --add-stdcall-alias ../../../asiosdk2/asiosdk2.a -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lwinmm -O3 -s -INCS = -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../pa_common" -CXXINCS = -I"C:/Dev-CPP/include/c++" -I"C:/Dev-CPP/include/c++/mingw32" -I"C:/Dev-CPP/include/c++/backward" -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../pa_common" -BIN = portaudio-dll.dll -CXXFLAGS = $(CXXINCS)-O3 -fmessage-length=0 -Wall -CFLAGS = $(INCS)-DBUILDING_DLL=1 -O3 -fmessage-length=0 -Wall - -.PHONY: all all-before all-after clean clean-custom - -all: all-before portaudio-dll.dll all-after - - -clean: clean-custom - rm -f $(OBJ) $(BIN) - -DLLWRAP=dllwrap.exe -DEFFILE=libportaudio-dll.def -STATICLIB=libportaudio-dll.a - -$(BIN): $(LINKOBJ) - $(DLLWRAP) --output-def $(DEFFILE) --driver-name c++ --implib $(STATICLIB) $(LINKOBJ) $(LIBS) -o $(BIN) - -./pa_skeleton.o: ../../pa_common/pa_skeleton.c - $(CPP) -c ../../pa_common/pa_skeleton.c -o ./pa_skeleton.o $(CXXFLAGS) - -./pa_stream.o: ../../pa_common/pa_stream.c - $(CPP) -c ../../pa_common/pa_stream.c -o ./pa_stream.o $(CXXFLAGS) - -./pa_trace.o: ../../pa_common/pa_trace.c - $(CPP) -c ../../pa_common/pa_trace.c -o ./pa_trace.o $(CXXFLAGS) - -./pa_allocation.o: ../../pa_common/pa_allocation.c - $(CPP) -c ../../pa_common/pa_allocation.c -o ./pa_allocation.o $(CXXFLAGS) - -./pa_converters.o: ../../pa_common/pa_converters.c - $(CPP) -c ../../pa_common/pa_converters.c -o ./pa_converters.o $(CXXFLAGS) - -./pa_cpuload.o: ../../pa_common/pa_cpuload.c - $(CPP) -c ../../pa_common/pa_cpuload.c -o ./pa_cpuload.o $(CXXFLAGS) - -./pa_dither.o: ../../pa_common/pa_dither.c - $(CPP) -c ../../pa_common/pa_dither.c -o ./pa_dither.o $(CXXFLAGS) - -./pa_front.o: ../../pa_common/pa_front.c - $(CPP) -c ../../pa_common/pa_front.c -o ./pa_front.o $(CXXFLAGS) - -./pa_process.o: ../../pa_common/pa_process.c - $(CPP) -c ../../pa_common/pa_process.c -o ./pa_process.o $(CXXFLAGS) - -./pa_asio.o: ../../pa_asio/pa_asio.cpp - $(CPP) -c ../../pa_asio/pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS) - -./pa_win_util.o: ../pa_win_util.c - $(CPP) -c ../pa_win_util.c -o ./pa_win_util.o $(CXXFLAGS) - -./pa_win_hostapis.o: ../pa_win_hostapis.c - $(CPP) -c ../pa_win_hostapis.c -o ./pa_win_hostapis.o $(CXXFLAGS) - -./pa_win_ds.o: ../../pa_win_ds/pa_win_ds.c - $(CPP) -c ../../pa_win_ds/pa_win_ds.c -o ./pa_win_ds.o $(CXXFLAGS) - -./dsound_wrapper.o: ../../pa_win_ds/dsound_wrapper.c - $(CPP) -c ../../pa_win_ds/dsound_wrapper.c -o ./dsound_wrapper.o $(CXXFLAGS) - -./pa_win_wmme.o: ../../pa_win_wmme/pa_win_wmme.c - $(CPP) -c ../../pa_win_wmme/pa_win_wmme.c -o ./pa_win_wmme.o $(CXXFLAGS) - -./iasiothiscallresolver.o: ../../pa_asio/iasiothiscallresolver.cpp - $(CPP) -c ../../pa_asio/iasiothiscallresolver.cpp -o ./iasiothiscallresolver.o $(CXXFLAGS) diff --git a/third_party/portaudio/build/dev-cpp/Makefile-static b/third_party/portaudio/build/dev-cpp/Makefile-static deleted file mode 100644 index 2a1647d..0000000 --- a/third_party/portaudio/build/dev-cpp/Makefile-static +++ /dev/null @@ -1,75 +0,0 @@ -# Project: portaudio-static -# Makefile created by Dev-C++ 4.9.8.2 - -CPP = g++.exe -CC = gcc.exe -WINDRES = windres.exe -RES = -OBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES) -LINKOBJ = ./pa_skeleton.o ./pa_stream.o ./pa_trace.o ./pa_allocation.o ./pa_converters.o ./pa_cpuload.o ./pa_dither.o ./pa_front.o ./pa_process.o ./pa_asio.o ./pa_win_util.o ./pa_win_hostapis.o ./pa_win_ds.o ./dsound_wrapper.o ./pa_win_wmme.o ./iasiothiscallresolver.o $(RES) -LIBS = -L"C:/Dev-CPP/lib" -fmessage-length=0 -O3 -s -INCS = -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../pa_common" -CXXINCS = -I"C:/Dev-CPP/include/c++" -I"C:/Dev-CPP/include/c++/mingw32" -I"C:/Dev-CPP/include/c++/backward" -I"C:/Dev-CPP/include" -I"../../../asiosdk2" -I"../../../asiosdk2/common" -I"../../../asiosdk2/host" -I"../../../asiosdk2/host/pc" -I"../../pa_common" -BIN = portaudio-static.a -CXXFLAGS = $(CXXINCS)-O3 -fmessage-length=0 -Wall -CFLAGS = $(INCS)-O3 -fmessage-length=0 -Wall - -.PHONY: all all-before all-after clean clean-custom - -all: all-before portaudio-static.a all-after - - -clean: clean-custom - rm -f $(OBJ) $(BIN) - -$(BIN): $(LINKOBJ) - ar r $(BIN) $(LINKOBJ) - ranlib $(BIN) - -./pa_skeleton.o: ../../pa_common/pa_skeleton.c - $(CPP) -c ../../pa_common/pa_skeleton.c -o ./pa_skeleton.o $(CXXFLAGS) - -./pa_stream.o: ../../pa_common/pa_stream.c - $(CPP) -c ../../pa_common/pa_stream.c -o ./pa_stream.o $(CXXFLAGS) - -./pa_trace.o: ../../pa_common/pa_trace.c - $(CPP) -c ../../pa_common/pa_trace.c -o ./pa_trace.o $(CXXFLAGS) - -./pa_allocation.o: ../../pa_common/pa_allocation.c - $(CPP) -c ../../pa_common/pa_allocation.c -o ./pa_allocation.o $(CXXFLAGS) - -./pa_converters.o: ../../pa_common/pa_converters.c - $(CPP) -c ../../pa_common/pa_converters.c -o ./pa_converters.o $(CXXFLAGS) - -./pa_cpuload.o: ../../pa_common/pa_cpuload.c - $(CPP) -c ../../pa_common/pa_cpuload.c -o ./pa_cpuload.o $(CXXFLAGS) - -./pa_dither.o: ../../pa_common/pa_dither.c - $(CPP) -c ../../pa_common/pa_dither.c -o ./pa_dither.o $(CXXFLAGS) - -./pa_front.o: ../../pa_common/pa_front.c - $(CPP) -c ../../pa_common/pa_front.c -o ./pa_front.o $(CXXFLAGS) - -./pa_process.o: ../../pa_common/pa_process.c - $(CPP) -c ../../pa_common/pa_process.c -o ./pa_process.o $(CXXFLAGS) - -./pa_asio.o: ../../pa_asio/pa_asio.cpp - $(CPP) -c ../../pa_asio/pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS) - -./pa_win_util.o: ../pa_win_util.c - $(CPP) -c ../pa_win_util.c -o ./pa_win_util.o $(CXXFLAGS) - -./pa_win_hostapis.o: ../pa_win_hostapis.c - $(CPP) -c ../pa_win_hostapis.c -o ./pa_win_hostapis.o $(CXXFLAGS) - -./pa_win_ds.o: ../../pa_win_ds/pa_win_ds.c - $(CPP) -c ../../pa_win_ds/pa_win_ds.c -o ./pa_win_ds.o $(CXXFLAGS) - -./dsound_wrapper.o: ../../pa_win_ds/dsound_wrapper.c - $(CPP) -c ../../pa_win_ds/dsound_wrapper.c -o ./dsound_wrapper.o $(CXXFLAGS) - -./pa_win_wmme.o: ../../pa_win_wmme/pa_win_wmme.c - $(CPP) -c ../../pa_win_wmme/pa_win_wmme.c -o ./pa_win_wmme.o $(CXXFLAGS) - -./iasiothiscallresolver.o: ../../pa_asio/iasiothiscallresolver.cpp - $(CPP) -c ../../pa_asio/iasiothiscallresolver.cpp -o ./iasiothiscallresolver.o $(CXXFLAGS) diff --git a/third_party/portaudio/build/dev-cpp/portaudio-dll.dev b/third_party/portaudio/build/dev-cpp/portaudio-dll.dev deleted file mode 100644 index 086e109..0000000 --- a/third_party/portaudio/build/dev-cpp/portaudio-dll.dev +++ /dev/null @@ -1,209 +0,0 @@ -[Project] -FileName=portaudio-dll.dev -Name=portaudio-dll -UnitCount=16 -Type=3 -Ver=1 -ObjFiles= -Includes=..\..\..\asiosdk2;..\..\..\asiosdk2\common;..\..\..\asiosdk2\host;..\..\..\asiosdk2\host\pc;..\..\pa_common -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler=-DBUILDING_DLL=1_@@_-O3_@@_ -CppCompiler=-O3_@@_ -Linker=--no-export-all-symbols --add-stdcall-alias_@@_../../../asiosdk2/asiosdk2.a_@@_-lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32 -lwinmm_@@_-O3 -s_@@_ -IsCpp=1 -Icon= -ExeOutput=. -ObjectOutput=. -OverrideOutput=0 -OverrideOutputName=portaudio.a -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=..\..\pa_common\pa_skeleton.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_skeleton.c -o ./pa_skeleton.o $(CFLAGS) - -[Unit2] -FileName=..\..\pa_common\pa_stream.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_stream.c -o ./pa_stream.o $(CFLAGS) - -[Unit3] -FileName=..\..\pa_common\pa_trace.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_trace.c -o ./pa_trace.o $(CFLAGS) - -[Unit4] -FileName=..\..\pa_common\pa_allocation.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_allocation.c -o ./pa_allocation.o $(CFLAGS) - -[Unit5] -FileName=..\..\pa_common\pa_converters.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_converters.c -o ./pa_converters.o $(CFLAGS) - -[Unit6] -FileName=..\..\pa_common\pa_cpuload.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_cpuload.c -o ./pa_cpuload.o $(CFLAGS) - -[Unit7] -FileName=..\..\pa_common\pa_dither.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_dither.c -o ./pa_dither.o $(CFLAGS) - -[Unit8] -FileName=..\..\pa_common\pa_front.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_front.c -o ./pa_front.o $(CFLAGS) - -[Unit9] -FileName=..\..\pa_common\pa_process.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_process.c -o ./pa_process.o $(CFLAGS) - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Developed using the Dev-C++ IDE -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - -[Unit10] -FileName=..\..\pa_asio\pa_asio.cpp -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CPP) -c pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS) - -[Unit11] -FileName=..\pa_win_util.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_win_util.c -o ./pa_win_util.o $(CFLAGS) - -[Unit12] -FileName=..\pa_win_hostapis.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_win_hostapis.c -o ./pa_win_hostapis.o $(CFLAGS) - -[Unit13] -FileName=..\..\pa_win_ds\pa_win_ds.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_win_ds.c -o ./pa_win_ds.o $(CFLAGS) - -[Unit14] -FileName=..\..\pa_win_ds\dsound_wrapper.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c dsound_wrapper.c -o ./dsound_wrapper.o $(CFLAGS) - -[Unit15] -FileName=..\..\pa_win_wmme\pa_win_wmme.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_win_wmme.c -o ./pa_win_wmme.o $(CFLAGS) - -[Unit16] -FileName=..\..\pa_asio\iasiothiscallresolver.cpp -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - diff --git a/third_party/portaudio/build/dev-cpp/portaudio-static.dev b/third_party/portaudio/build/dev-cpp/portaudio-static.dev deleted file mode 100644 index 2aae584..0000000 --- a/third_party/portaudio/build/dev-cpp/portaudio-static.dev +++ /dev/null @@ -1,209 +0,0 @@ -[Project] -FileName=portaudio-static.dev -Name=portaudio-static -UnitCount=16 -Type=2 -Ver=1 -ObjFiles= -Includes=..\..\..\asiosdk2;..\..\..\asiosdk2\common;..\..\..\asiosdk2\host;..\..\..\asiosdk2\host\pc;..\..\pa_common -Libs= -PrivateResource= -ResourceIncludes= -MakeIncludes= -Compiler=-O3_@@_ -CppCompiler=-O3_@@_ -Linker=-O3 -s_@@_ -IsCpp=1 -Icon= -ExeOutput=. -ObjectOutput=. -OverrideOutput=0 -OverrideOutputName=portaudio.a -HostApplication= -Folders= -CommandLine= -IncludeVersionInfo=0 -SupportXPThemes=0 -CompilerSet=0 -CompilerSettings=0000000000000000000 -UseCustomMakefile=0 -CustomMakefile= - -[Unit1] -FileName=..\..\pa_common\pa_skeleton.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_skeleton.c -o ./pa_skeleton.o $(CFLAGS) - -[Unit2] -FileName=..\..\pa_common\pa_stream.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_stream.c -o ./pa_stream.o $(CFLAGS) - -[Unit3] -FileName=..\..\pa_common\pa_trace.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_trace.c -o ./pa_trace.o $(CFLAGS) - -[Unit4] -FileName=..\..\pa_common\pa_allocation.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_allocation.c -o ./pa_allocation.o $(CFLAGS) - -[Unit5] -FileName=..\..\pa_common\pa_converters.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_converters.c -o ./pa_converters.o $(CFLAGS) - -[Unit6] -FileName=..\..\pa_common\pa_cpuload.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_cpuload.c -o ./pa_cpuload.o $(CFLAGS) - -[Unit7] -FileName=..\..\pa_common\pa_dither.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_dither.c -o ./pa_dither.o $(CFLAGS) - -[Unit8] -FileName=..\..\pa_common\pa_front.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_front.c -o ./pa_front.o $(CFLAGS) - -[Unit9] -FileName=..\..\pa_common\pa_process.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_process.c -o ./pa_process.o $(CFLAGS) - -[VersionInfo] -Major=0 -Minor=1 -Release=1 -Build=1 -LanguageID=1033 -CharsetID=1252 -CompanyName= -FileVersion= -FileDescription=Developed using the Dev-C++ IDE -InternalName= -LegalCopyright= -LegalTrademarks= -OriginalFilename= -ProductName= -ProductVersion= -AutoIncBuildNr=0 - -[Unit10] -FileName=..\..\pa_asio\pa_asio.cpp -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CPP) -c pa_asio.cpp -o ./pa_asio.o $(CXXFLAGS) - -[Unit11] -FileName=..\..\pa_win\pa_win_util.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_win_util.c -o ./pa_win_util.o $(CFLAGS) - -[Unit12] -FileName=..\..\pa_win\pa_win_hostapis.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_win_hostapis.c -o ./pa_win_hostapis.o $(CFLAGS) - -[Unit13] -FileName=..\..\pa_win_ds\pa_win_ds.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_win_ds.c -o ./pa_win_ds.o $(CFLAGS) - -[Unit14] -FileName=..\..\pa_win_ds\dsound_wrapper.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c dsound_wrapper.c -o ./dsound_wrapper.o $(CFLAGS) - -[Unit15] -FileName=..\..\pa_win_wmme\pa_win_wmme.c -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd=$(CC) -c pa_win_wmme.c -o ./pa_win_wmme.o $(CFLAGS) - -[Unit16] -FileName=..\..\pa_asio\iasiothiscallresolver.cpp -CompileCpp=1 -Folder=portaudio -Compile=1 -Link=1 -Priority=1000 -OverrideBuildCmd=0 -BuildCmd= - diff --git a/third_party/portaudio/build/dev-cpp/readme.txt b/third_party/portaudio/build/dev-cpp/readme.txt deleted file mode 100644 index 07108a7..0000000 --- a/third_party/portaudio/build/dev-cpp/readme.txt +++ /dev/null @@ -1,23 +0,0 @@ -From: "Peter L Jones" -Sent: Wednesday, September 17, 2003 5:18 AM -Subject: Dev-C++ project files - -I attach two project files intended for portaudio/pa_win/dev-cpp (i.e. in -parallel with the msvc directory), if you want them. One is for a static -library build and one for a DLL. I've used the static library (in building -a single monolithic DLL) but I can't guarantee the DLL version will build a -working library (I think it's mostly there, though!). - -I also attach the resulting makefiles, which may be of use to other MinGW -users. - -They're rooted in the directory given above and drop their object and -library files in the same place. They assume the asiosdk2 files are in the -same directory as portaudio/ in a sub-directory called asiosdk2/. Oh! The -DLL is built against a static asiosdk2.a library... maybe not the best way -to do it... I ought to figure out how to link against a "home made" dll in -Dev-C++, I guess ;-) - -Cheers, - --- Peter diff --git a/third_party/portaudio/build/msvc/portaudio.def b/third_party/portaudio/build/msvc/portaudio.def deleted file mode 100644 index 08929d6..0000000 --- a/third_party/portaudio/build/msvc/portaudio.def +++ /dev/null @@ -1,43 +0,0 @@ -EXPORTS - -; -Pa_GetVersion @1 -Pa_GetVersionText @2 -Pa_GetErrorText @3 -Pa_Initialize @4 -Pa_Terminate @5 -Pa_GetHostApiCount @6 -Pa_GetDefaultHostApi @7 -Pa_GetHostApiInfo @8 -Pa_HostApiTypeIdToHostApiIndex @9 -Pa_HostApiDeviceIndexToDeviceIndex @10 -Pa_GetLastHostErrorInfo @11 -Pa_GetDeviceCount @12 -Pa_GetDefaultInputDevice @13 -Pa_GetDefaultOutputDevice @14 -Pa_GetDeviceInfo @15 -Pa_IsFormatSupported @16 -Pa_OpenStream @17 -Pa_OpenDefaultStream @18 -Pa_CloseStream @19 -Pa_SetStreamFinishedCallback @20 -Pa_StartStream @21 -Pa_StopStream @22 -Pa_AbortStream @23 -Pa_IsStreamStopped @24 -Pa_IsStreamActive @25 -Pa_GetStreamInfo @26 -Pa_GetStreamTime @27 -Pa_GetStreamCpuLoad @28 -Pa_ReadStream @29 -Pa_WriteStream @30 -Pa_GetStreamReadAvailable @31 -Pa_GetStreamWriteAvailable @32 -Pa_GetSampleSize @33 -Pa_Sleep @34 -PaAsio_GetAvailableLatencyValues @50 -PaAsio_ShowControlPanel @51 -PaUtil_InitializeX86PlainConverters @52 -PaAsio_GetInputChannelName @53 -PaAsio_GetOutputChannelName @54 -PaUtil_SetDebugPrintFunction @55 \ No newline at end of file diff --git a/third_party/portaudio/build/msvc/portaudio.dsp b/third_party/portaudio/build/msvc/portaudio.dsp deleted file mode 100644 index bb2ce45..0000000 --- a/third_party/portaudio/build/msvc/portaudio.dsp +++ /dev/null @@ -1,269 +0,0 @@ -# Microsoft Developer Studio Project File - Name="portaudio" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=portaudio - Win32 Release -!MESSAGE This is not a valid makefile. To build this project using NMAKE, -!MESSAGE use the Export Makefile command and run -!MESSAGE -!MESSAGE NMAKE /f "portaudio.mak". -!MESSAGE -!MESSAGE You can specify a configuration when running NMAKE -!MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE -!MESSAGE NMAKE /f "portaudio.mak" CFG="portaudio - Win32 Release" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "portaudio - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "portaudio - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "portaudio - Win32 Release" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "Release_x86" -# PROP BASE Intermediate_Dir "Release_x86" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 0 -# PROP Output_Dir "Release_x86" -# PROP Intermediate_Dir "Release_x86" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FD /c -# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\..\src\common" /I "..\..\include" /I ".\\" /I "..\..\src\os\win" /D "WIN32" /D "NDEBUG" /D "_USRDLL" /D "PA_ENABLE_DEBUG_OUTPUT" /D "_CRT_SECURE_NO_DEPRECATE" /D "PAWIN_USE_WDMKS_DEVICE_INFO" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "NDEBUG" -# ADD RSC /l 0x409 /d "NDEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setupapi.lib /nologo /dll /machine:I386 /out:"./Release_x86/portaudio_x86.dll" - -!ELSEIF "$(CFG)" == "portaudio - Win32 Debug" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "Debug_x86" -# PROP BASE Intermediate_Dir "Debug_x86" -# PROP BASE Target_Dir "" -# PROP Use_MFC 0 -# PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug_x86" -# PROP Intermediate_Dir "Debug_x86" -# PROP Ignore_Export_Lib 0 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\..\src\common" /I "..\..\include" /I ".\\" /I "..\..\src\os\win" /D "WIN32" /D "_DEBUG" /D "_USRDLL" /D "PA_ENABLE_DEBUG_OUTPUT" /D "_CRT_SECURE_NO_DEPRECATE" /D "PAWIN_USE_WDMKS_DEVICE_INFO" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /d "_DEBUG" -# ADD RSC /l 0x409 /d "_DEBUG" -BSC32=bscmake.exe -# ADD BASE BSC32 /nologo -# ADD BSC32 /nologo -LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib setupapi.lib /nologo /dll /debug /machine:I386 /out:"./Debug_x86/portaudio_x86.dll" /pdbtype:sept - -!ENDIF - -# Begin Target - -# Name "portaudio - Win32 Release" -# Name "portaudio - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Group "common" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\src\common\pa_allocation.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\pa_converters.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\pa_cpuload.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\pa_debugprint.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\pa_dither.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\pa_front.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\pa_process.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\pa_ringbuffer.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\pa_skeleton.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\common\pa_stream.c -# End Source File -# End Group -# Begin Group "hostapi" - -# PROP Default_Filter "" -# Begin Group "ASIO" - -# PROP Default_Filter "" -# Begin Group "ASIOSDK" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\src\hostapi\asio\ASIOSDK\common\asio.cpp -# ADD CPP /I "..\..\src\hostapi\asio\ASIOSDK\host" /I "..\..\src\hostapi\asio\ASIOSDK\host\pc" /I "..\..\src\hostapi\asio\ASIOSDK\common" -# End Source File -# Begin Source File - -SOURCE=..\..\src\hostapi\asio\ASIOSDK\host\ASIOConvertSamples.cpp -# ADD CPP /I "..\..\src\hostapi\asio\ASIOSDK\host" /I "..\..\src\hostapi\asio\ASIOSDK\host\pc" /I "..\..\src\hostapi\asio\ASIOSDK\common" -# End Source File -# Begin Source File - -SOURCE=..\..\src\hostapi\asio\ASIOSDK\host\asiodrivers.cpp -# ADD CPP /I "..\..\src\hostapi\asio\ASIOSDK\host" /I "..\..\src\hostapi\asio\ASIOSDK\host\pc" /I "..\..\src\hostapi\asio\ASIOSDK\common" -# End Source File -# Begin Source File - -SOURCE=..\..\src\hostapi\asio\ASIOSDK\host\pc\asiolist.cpp -# ADD CPP /I "..\..\src\hostapi\asio\ASIOSDK\host" /I "..\..\src\hostapi\asio\ASIOSDK\host\pc" /I "..\..\src\hostapi\asio\ASIOSDK\common" -# End Source File -# Begin Source File - -SOURCE=..\..\src\hostapi\asio\ASIOSDK\common\combase.cpp -# ADD CPP /I "..\..\src\hostapi\asio\ASIOSDK\host" /I "..\..\src\hostapi\asio\ASIOSDK\host\pc" /I "..\..\src\hostapi\asio\ASIOSDK\common" -# End Source File -# Begin Source File - -SOURCE=..\..\src\hostapi\asio\ASIOSDK\common\debugmessage.cpp -# ADD CPP /I "..\..\src\hostapi\asio\ASIOSDK\host" /I "..\..\src\hostapi\asio\ASIOSDK\host\pc" /I "..\..\src\hostapi\asio\ASIOSDK\common" -# End Source File -# Begin Source File - -SOURCE=..\..\src\hostapi\asio\ASIOSDK\common\register.cpp -# ADD CPP /I "..\..\src\hostapi\asio\ASIOSDK\host" /I "..\..\src\hostapi\asio\ASIOSDK\host\pc" /I "..\..\src\hostapi\asio\ASIOSDK\common" -# End Source File -# End Group -# Begin Source File - -SOURCE=..\..\src\hostapi\asio\pa_asio.cpp -# ADD CPP /I "..\..\src\hostapi\asio\ASIOSDK\host" /I "..\..\src\hostapi\asio\ASIOSDK\host\pc" /I "..\..\src\hostapi\asio\ASIOSDK\common" -# End Source File -# End Group -# Begin Group "dsound" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\src\hostapi\dsound\pa_win_ds.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\hostapi\dsound\pa_win_ds_dynlink.c -# End Source File -# End Group -# Begin Group "wmme" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\src\hostapi\wmme\pa_win_wmme.c -# End Source File -# End Group -# Begin Group "wasapi" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\src\hostapi\wasapi\pa_win_wasapi.cpp -# End Source File -# End Group -# Begin Group "wdm-ks" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\src\hostapi\wdmks\pa_win_wdmks.c -# End Source File -# End Group -# End Group -# Begin Group "os" - -# PROP Default_Filter "" -# Begin Group "win" - -# PROP Default_Filter "" -# Begin Source File - -SOURCE=..\..\src\os\win\pa_win_hostapis.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\os\win\pa_win_util.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\os\win\pa_win_waveformat.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\os\win\pa_win_wdmks_utils.c -# End Source File -# Begin Source File - -SOURCE=..\..\src\os\win\pa_x86_plain_converters.c -# End Source File -# End Group -# End Group -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# End Group -# Begin Group "Resource Files" - -# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" -# Begin Source File - -SOURCE=.\portaudio.def -# End Source File -# End Group -# End Target -# End Project diff --git a/third_party/portaudio/build/msvc/portaudio.dsw b/third_party/portaudio/build/msvc/portaudio.dsw deleted file mode 100644 index 6af88f4..0000000 --- a/third_party/portaudio/build/msvc/portaudio.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "portaudio"=".\portaudio.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/third_party/portaudio/build/msvc/portaudio.sln b/third_party/portaudio/build/msvc/portaudio.sln deleted file mode 100644 index d4cc5dc..0000000 --- a/third_party/portaudio/build/msvc/portaudio.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "portaudio", "portaudio.vcproj", "{0A18A071-125E-442F-AFF7-A3F68ABECF99}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.ActiveCfg = Debug|Win32 - {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|Win32.Build.0 = Debug|Win32 - {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.ActiveCfg = Debug|x64 - {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Debug|x64.Build.0 = Debug|x64 - {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.ActiveCfg = Release|Win32 - {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|Win32.Build.0 = Release|Win32 - {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.ActiveCfg = Release|x64 - {0A18A071-125E-442F-AFF7-A3F68ABECF99}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/third_party/portaudio/build/msvc/portaudio.vcproj b/third_party/portaudio/build/msvc/portaudio.vcproj deleted file mode 100644 index 759f934..0000000 --- a/third_party/portaudio/build/msvc/portaudio.vcproj +++ /dev/null @@ -1,1512 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/third_party/portaudio/build/msvc/readme.txt b/third_party/portaudio/build/msvc/readme.txt deleted file mode 100644 index b7d2f0b..0000000 --- a/third_party/portaudio/build/msvc/readme.txt +++ /dev/null @@ -1,109 +0,0 @@ -Hello - - This is a small list of steps in order to build portaudio -(Currently v19-devel) into a VC6 DLL and lib file. -This DLL contains all 3 current win32 PA APIS (MM/DS/ASIO) - -1)Copy the source dirs that comes with the ASIO SDK inside src\hostapi\asio\ASIOSDK - so you should now have example: - - portaudio19svn\src\hostapi\asio\ASIOSDK\common - portaudio19svn\src\hostapi\asio\ASIOSDK\host - portaudio19svn\src\hostapi\asio\ASIOSDK\host\sample - portaudio19svn\src\hostapi\asio\ASIOSDK\host\pc - portaudio19svn\src\hostapi\asio\ASIOSDK\host\mac (not needed) - - You dont need "driver" - - To build without ASIO (or another Host API) see the "Building without ASIO support" section below. - -2) - *If you have Visual Studio 6.0*, please make sure you have it updated with the latest (and final) - microsoft libraries for it, namely: - - Service pack 5: - Latest known URL: - http://msdn2.microsoft.com/en-us/vstudio/aa718363.aspx - Yes there EXISTS a service pack 6 , but the processor pack (below) isnt compatible with it. - - Processor Pack(only works with above SP5) - Latest known URL: - http://msdn2.microsoft.com/en-us/vstudio/Aa718349.aspx - This isnt absolutely required for portaudio, but if you plan on using SSE intrinsics and similar things. - Up to you to decide upon Service pack 5 or 6 depending on your need for intrinsics. - - Platform SDK (Feb 2003) : - Latest known URL: - http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm - (This will allow your code base to be x64 friendly, with correct defines - for LONG_PTR and such) - NOTE A) Yes you have to use IE activex scripts to install that - wont work in Firefox, you - may have to temporarily change tyour default browser(aint life unfair) - NOTE B) Dont forget to hit "Register PSDK Directories with Visual Studio". - you can make sure its right in VC6 if you open tools/options/directories/include files and you see SDK 2003 as the FIRST entry - (it must be the same for libs) - - DirectX 9.0 SDK Update - (Summer 2003) - Latest known URL: - http://www.microsoft.com/downloads/details.aspx?familyid=9216652f-51e0-402e-b7b5-feb68d00f298&displaylang=en - Again register the links in VC6, and check inside vc6 if headers are in second place right after SDk 2003 - - *If you have 7.0(VC.NET/2001) or 7.1(VC.2003) * - then I suggest you open portaudio.dsp (and convert if needed) - - *If you have Visual Studio 2005*, I suggest you open the portaudio.sln file - which contains 4 configurations. Win32/x64 in both Release and Debug variants - - hit compile and hope for the best. - -3)Now in any project, in which you require portaudio, - you can just link with portaudio_x86.lib, (or _x64) and of course include the - relevant headers - (portaudio.h, and/or pa_asio.h , pa_x86_plain_converters.h) See (*) - -4) Your new exe should now use portaudio_xXX.dll. - - -Have fun! - -(*): you may want to add/remove some DLL entry points. -Right now those 6 entries are _not_ from portaudio.h - -(from portaudio.def) -(...) -PaAsio_GetAvailableLatencyValues @50 -PaAsio_ShowControlPanel @51 -PaUtil_InitializeX86PlainConverters @52 -PaAsio_GetInputChannelName @53 -PaAsio_GetOutputChannelName @54 -PaUtil_SetLogPrintFunction @55 - - -*** Building without ASIO support *** - -To build PortAudio without ASIO support you need to: - A. Make sure your project doesn't try to build any ASIO SDK files. - If you're using one of the shipped projects, remove the ASIO related files - from the project. - - B. Make sure your project doesn't try to build the PortAudio ASIO - implementation files: - src/hostapi/pa_asio.cpp src/hostapi/iasiothiscallresolver.cpp - If you're using one of the shipped projects remove them from the project. - - C. Define the PA_NO_ASIO preprocessor symbol in the project properties. - In VS2005 this can be added under - Project Properties > Configuration Properties > C/C++ > Preprocessor > Preprocessor Definitions - - Defining PA_NO_ASIO stops src/os/win/pa_win_hostapis.c - from trying to initialize the PA ASIO implementation. - - D. Remove PaAsio_* entry points from portaudio.def - -A similar procedure can be used to omit any of the other host APIs from the -build. The relevant preprocessor symbols used by pa_win_hostapis.c are: -PA_NO_WMME, PA_NO_DS, PA_NO_ASIO, PA_NO_WASAPI and PA_NO_WDMKS - - ------ -David Viens, davidv@plogue.com \ No newline at end of file diff --git a/third_party/portaudio/build/scons/SConscript_common b/third_party/portaudio/build/scons/SConscript_common deleted file mode 100644 index eaf4e3c..0000000 --- a/third_party/portaudio/build/scons/SConscript_common +++ /dev/null @@ -1,30 +0,0 @@ -import os.path, sys - -class ConfigurationError(Exception): - def __init__(self, reason): - Exception.__init__(self, "Configuration failed: %s" % reason) - -env = Environment() - -# sunos, aix, hpux, irix, sunos appear to be platforms known by SCons, assuming they're POSIX compliant -Posix = ("linux", "darwin", "sunos", "aix", "hpux", "irix", "sunos", "netbsd") -Windows = ("win32", "cygwin") - -if env["PLATFORM"] == "posix": - if sys.platform[:5] == "linux": - Platform = "linux" - elif sys.platform[:6] == "netbsd": - Platform = "netbsd" - else: - raise ConfigurationError("Unknown platform %s" % sys.platform) -else: - if not env["PLATFORM"] in ("win32", "cygwin") + Posix: - raise ConfigurationError("Unknown platform %s" % env["PLATFORM"]) - Platform = env["PLATFORM"] - -# Inspired by the versioning scheme followed by Qt, it seems sensible enough. There are three components: major, minor -# and micro. Major changes with each subtraction from the API (backward-incompatible, i.e. V19 vs. V18), minor changes -# with each addition to the API (backward-compatible), micro changes with each revision of the source code. -ApiVer = "2.0.0" - -Export("Platform", "Posix", "ConfigurationError", "ApiVer") diff --git a/third_party/portaudio/build/scons/SConscript_opts b/third_party/portaudio/build/scons/SConscript_opts deleted file mode 100644 index 6a4b0a9..0000000 --- a/third_party/portaudio/build/scons/SConscript_opts +++ /dev/null @@ -1,91 +0,0 @@ -import os.path, sys - -def _PackageOption(pkgName, default=1): - """ Allow user to choose whether a package should be used if available. This results in a commandline option use, - where Pkgname is the name of the package with a capitalized first letter. - @param pkgName: Name of package. - @param default: The default value for this option ("yes"/"no"). - """ - return BoolOption("use%s" % pkgName[0].upper() + pkgName[1:], "use %s if available" % (pkgName), default) - -def _BoolOption(opt, explanation, default=1): - """ Allow user to enable/disable a certain option. This results in a commandline option enable