├── .gitignore ├── Android.bp ├── ChangeLog ├── MODULE_LICENSE_FRAUNHOFER ├── Makefile.am ├── Makefile.vc ├── NOTICE ├── OWNERS ├── README.md ├── aac-enc.c ├── autogen.sh ├── bootstrap ├── configure.ac ├── documentation ├── aacDecoder.pdf └── aacEncoder.pdf ├── fdk-aac.pc.in ├── fdk-aac.sym ├── libAACdec ├── include │ └── aacdecoder_lib.h └── src │ ├── aac_ram.cpp │ ├── aac_ram.h │ ├── aac_rom.cpp │ ├── aac_rom.h │ ├── aacdec_drc.cpp │ ├── aacdec_drc.h │ ├── aacdec_drc_types.h │ ├── aacdec_hcr.cpp │ ├── aacdec_hcr.h │ ├── aacdec_hcr_bit.cpp │ ├── aacdec_hcr_bit.h │ ├── aacdec_hcr_types.h │ ├── aacdec_hcrs.cpp │ ├── aacdec_hcrs.h │ ├── aacdec_pns.cpp │ ├── aacdec_pns.h │ ├── aacdec_tns.cpp │ ├── aacdec_tns.h │ ├── aacdecoder.cpp │ ├── aacdecoder.h │ ├── aacdecoder_lib.cpp │ ├── arm │ └── block_arm.cpp │ ├── block.cpp │ ├── block.h │ ├── channel.cpp │ ├── channel.h │ ├── channelinfo.cpp │ ├── channelinfo.h │ ├── conceal.cpp │ ├── conceal.h │ ├── conceal_types.h │ ├── debug.h │ ├── ldfiltbank.cpp │ ├── ldfiltbank.h │ ├── overlapadd.h │ ├── pulsedata.cpp │ ├── pulsedata.h │ ├── rvlc.cpp │ ├── rvlc.h │ ├── rvlc_info.h │ ├── rvlcbit.cpp │ ├── rvlcbit.h │ ├── rvlcconceal.cpp │ ├── rvlcconceal.h │ ├── stereo.cpp │ └── stereo.h ├── libAACenc ├── include │ └── aacenc_lib.h └── src │ ├── aacEnc_ram.cpp │ ├── aacEnc_ram.h │ ├── aacEnc_rom.cpp │ ├── aacEnc_rom.h │ ├── aacenc.cpp │ ├── aacenc.h │ ├── aacenc_lib.cpp │ ├── aacenc_pns.cpp │ ├── aacenc_pns.h │ ├── aacenc_tns.cpp │ ├── aacenc_tns.h │ ├── adj_thr.cpp │ ├── adj_thr.h │ ├── adj_thr_data.h │ ├── band_nrg.cpp │ ├── band_nrg.h │ ├── bandwidth.cpp │ ├── bandwidth.h │ ├── bit_cnt.cpp │ ├── bit_cnt.h │ ├── bitenc.cpp │ ├── bitenc.h │ ├── block_switch.cpp │ ├── block_switch.h │ ├── channel_map.cpp │ ├── channel_map.h │ ├── chaosmeasure.cpp │ ├── chaosmeasure.h │ ├── dyn_bits.cpp │ ├── dyn_bits.h │ ├── grp_data.cpp │ ├── grp_data.h │ ├── intensity.cpp │ ├── intensity.h │ ├── interface.h │ ├── line_pe.cpp │ ├── line_pe.h │ ├── metadata_compressor.cpp │ ├── metadata_compressor.h │ ├── metadata_main.cpp │ ├── metadata_main.h │ ├── ms_stereo.cpp │ ├── ms_stereo.h │ ├── noisedet.cpp │ ├── noisedet.h │ ├── pns_func.h │ ├── pnsparam.cpp │ ├── pnsparam.h │ ├── pre_echo_control.cpp │ ├── pre_echo_control.h │ ├── psy_configuration.cpp │ ├── psy_configuration.h │ ├── psy_const.h │ ├── psy_data.h │ ├── psy_main.cpp │ ├── psy_main.h │ ├── qc_data.h │ ├── qc_main.cpp │ ├── qc_main.h │ ├── quantize.cpp │ ├── quantize.h │ ├── sf_estim.cpp │ ├── sf_estim.h │ ├── spreading.cpp │ ├── spreading.h │ ├── tns_func.h │ ├── tonality.cpp │ ├── tonality.h │ ├── transform.cpp │ └── transform.h ├── libFDK ├── include │ ├── FDK_archdef.h │ ├── FDK_bitbuffer.h │ ├── FDK_bitstream.h │ ├── FDK_core.h │ ├── FDK_crc.h │ ├── FDK_hybrid.h │ ├── FDK_tools_rom.h │ ├── FDK_trigFcts.h │ ├── aarch64 │ │ ├── clz_aarch64.h │ │ └── fixmul_aarch64.h │ ├── abs.h │ ├── arm │ │ ├── clz_arm.h │ │ ├── cplx_mul.h │ │ ├── fixmadd_arm.h │ │ ├── fixmul_arm.h │ │ ├── scale.h │ │ └── scramble.h │ ├── autocorr2nd.h │ ├── clz.h │ ├── common_fix.h │ ├── cplx_mul.h │ ├── dct.h │ ├── fft.h │ ├── fft_rad2.h │ ├── fixmadd.h │ ├── fixminmax.h │ ├── fixmul.h │ ├── fixpoint_math.h │ ├── mdct.h │ ├── mips │ │ ├── abs_mips.h │ │ ├── clz_mips.h │ │ ├── cplx_mul.h │ │ ├── fixmadd_mips.h │ │ ├── fixmul_mips.h │ │ ├── scale.h │ │ └── scramble.h │ ├── ppc │ │ ├── clz_ppc.h │ │ └── fixmul_ppc.h │ ├── qmf.h │ ├── scale.h │ ├── scramble.h │ └── x86 │ │ ├── abs_x86.h │ │ ├── clz_x86.h │ │ └── fixmul_x86.h └── src │ ├── FDK_bitbuffer.cpp │ ├── FDK_core.cpp │ ├── FDK_crc.cpp │ ├── FDK_hybrid.cpp │ ├── FDK_tools_rom.cpp │ ├── FDK_trigFcts.cpp │ ├── arm │ ├── autocorr2nd.cpp │ ├── dct_arm.cpp │ ├── fft_rad2_arm.cpp │ ├── qmf_arm.cpp │ └── scale_arm.cpp │ ├── autocorr2nd.cpp │ ├── dct.cpp │ ├── fft.cpp │ ├── fft_rad2.cpp │ ├── fixpoint_math.cpp │ ├── mdct.cpp │ ├── mips │ ├── fft_rad2_mips.cpp │ ├── mips_fft_twiddles.cpp │ └── scale.cpp │ ├── qmf.cpp │ └── scale.cpp ├── libMpegTPDec ├── include │ ├── mpegFileRead.h │ ├── tp_data.h │ └── tpdec_lib.h └── src │ ├── mpegFileFormat.h │ ├── tpdec_adif.cpp │ ├── tpdec_adif.h │ ├── tpdec_adts.cpp │ ├── tpdec_adts.h │ ├── tpdec_asc.cpp │ ├── tpdec_drm.cpp │ ├── tpdec_drm.h │ ├── tpdec_latm.cpp │ ├── tpdec_latm.h │ ├── tpdec_lib.cpp │ └── version ├── libMpegTPEnc ├── include │ ├── mpegFileWrite.h │ ├── tp_data.h │ └── tpenc_lib.h └── src │ ├── tpenc_adif.cpp │ ├── tpenc_adif.h │ ├── tpenc_adts.cpp │ ├── tpenc_adts.h │ ├── tpenc_asc.cpp │ ├── tpenc_asc.h │ ├── tpenc_dab.cpp │ ├── tpenc_dab.h │ ├── tpenc_latm.cpp │ ├── tpenc_latm.h │ ├── tpenc_lib.cpp │ └── version ├── libPCMutils ├── include │ ├── limiter.h │ └── pcmutils_lib.h └── src │ ├── limiter.cpp │ └── pcmutils_lib.cpp ├── libSBRdec ├── include │ └── sbrdecoder.h └── src │ ├── arm │ ├── env_calc_arm.cpp │ └── lpp_tran_arm.cpp │ ├── env_calc.cpp │ ├── env_calc.h │ ├── env_dec.cpp │ ├── env_dec.h │ ├── env_extr.cpp │ ├── env_extr.h │ ├── huff_dec.cpp │ ├── huff_dec.h │ ├── lpp_tran.cpp │ ├── lpp_tran.h │ ├── psbitdec.cpp │ ├── psbitdec.h │ ├── psdec.cpp │ ├── psdec.h │ ├── psdec_hybrid.cpp │ ├── psdec_hybrid.h │ ├── sbr_crc.cpp │ ├── sbr_crc.h │ ├── sbr_deb.cpp │ ├── sbr_deb.h │ ├── sbr_dec.cpp │ ├── sbr_dec.h │ ├── sbr_ram.cpp │ ├── sbr_ram.h │ ├── sbr_rom.cpp │ ├── sbr_rom.h │ ├── sbr_scale.h │ ├── sbrdec_drc.cpp │ ├── sbrdec_drc.h │ ├── sbrdec_freq_sca.cpp │ ├── sbrdec_freq_sca.h │ ├── sbrdecoder.cpp │ └── transcendent.h ├── libSBRenc ├── include │ └── sbr_encoder.h └── src │ ├── bit_sbr.cpp │ ├── bit_sbr.h │ ├── cmondata.h │ ├── code_env.cpp │ ├── code_env.h │ ├── env_bit.cpp │ ├── env_bit.h │ ├── env_est.cpp │ ├── env_est.h │ ├── fram_gen.cpp │ ├── fram_gen.h │ ├── invf_est.cpp │ ├── invf_est.h │ ├── mh_det.cpp │ ├── mh_det.h │ ├── nf_est.cpp │ ├── nf_est.h │ ├── ps_bitenc.cpp │ ├── ps_bitenc.h │ ├── ps_const.h │ ├── ps_encode.cpp │ ├── ps_encode.h │ ├── ps_main.cpp │ ├── ps_main.h │ ├── resampler.cpp │ ├── resampler.h │ ├── sbr.h │ ├── sbr_def.h │ ├── sbr_encoder.cpp │ ├── sbr_misc.cpp │ ├── sbr_misc.h │ ├── sbr_ram.cpp │ ├── sbr_ram.h │ ├── sbr_rom.cpp │ ├── sbr_rom.h │ ├── sbrenc_freq_sca.cpp │ ├── sbrenc_freq_sca.h │ ├── ton_corr.cpp │ ├── ton_corr.h │ ├── tran_det.cpp │ └── tran_det.h ├── libSYS ├── include │ ├── FDK_audio.h │ ├── audio.h │ ├── cmdl_parser.h │ ├── conv_string.h │ ├── genericStds.h │ ├── machine_type.h │ └── wav_file.h └── src │ ├── cmdl_parser.cpp │ ├── conv_string.cpp │ ├── genericStds.cpp │ ├── linux │ ├── FDK_stackload_linux.cpp │ ├── audio_linux.cpp │ ├── coresup_linux.cpp │ ├── genericStds_linux.cpp │ └── uart_linux.cpp │ ├── mips │ └── genericStds_mips.cpp │ └── wav_file.cpp ├── m4 └── .gitkeep ├── wavreader.c ├── wavreader.h └── win32 └── getopt.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.lo 3 | *.la 4 | .deps 5 | .libs 6 | .dirstamp 7 | Makefile 8 | Makefile.in 9 | aclocal.m4 10 | autom4te.cache 11 | configure 12 | fdk-aac.pc 13 | config.guess 14 | config.log 15 | config.status 16 | config.sub 17 | depcomp 18 | install-sh 19 | libtool 20 | ltmain.sh 21 | m4/libtool.m4 22 | m4/ltoptions.m4 23 | m4/ltsugar.m4 24 | m4/ltversion.m4 25 | m4/lt~obsolete.m4 26 | missing 27 | stamp-h1 28 | aac-enc 29 | compile 30 | -------------------------------------------------------------------------------- /Android.bp: -------------------------------------------------------------------------------- 1 | cc_library_static { 2 | name: "libFraunhoferAAC", 3 | vendor_available: true, 4 | srcs: [ 5 | "libAACdec/src/*.cpp", 6 | "libAACenc/src/*.cpp", 7 | "libPCMutils/src/*.cpp", 8 | "libFDK/src/*.cpp", 9 | "libSYS/src/*.cpp", 10 | "libMpegTPDec/src/*.cpp", 11 | "libMpegTPEnc/src/*.cpp", 12 | "libSBRdec/src/*.cpp", 13 | "libSBRenc/src/*.cpp", 14 | ], 15 | cflags: [ 16 | "-Werror", 17 | "-Wno-constant-conversion", 18 | "-Wno-sequence-point", 19 | "-Wno-extra", 20 | "-Wno-#warnings", 21 | "-Wno-constant-logical-operand", 22 | "-Wno-self-assign", 23 | ], 24 | export_include_dirs: [ 25 | "libAACdec/include", 26 | "libAACenc/include", 27 | "libPCMutils/include", 28 | "libFDK/include", 29 | "libSYS/include", 30 | "libMpegTPDec/include", 31 | "libMpegTPEnc/include", 32 | "libSBRdec/include", 33 | "libSBRenc/include", 34 | ], 35 | } 36 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 0.1.6 2 | - Lots of minor assorted crash/fuzz fixes, mostly for the decoder but 3 | also some for the encoder 4 | 5 | 0.1.5 6 | - Updated upstream sources 7 | - Fixed building with GCC 3.3 and 3.4 8 | - Fixed building with GCC 6 9 | - AArch64 optimizations 10 | - Makefiles for building with MSVC 11 | - Support building the code in C++11 mode 12 | 13 | 0.1.4 14 | - Updated upstream sources, with minor changes to the decoder API 15 | breaking the ABI. (Calling code using AUDIO_CHANNEL_TYPE may need to 16 | be updated. A new option AAC_PCM_LIMITER_ENABLE has been added, enabled 17 | by default, which incurs extra decoding delay.) 18 | - PowerPC optimizations, fixes for building on AIX 19 | - Support for reading streamed wav files in the encoder example 20 | - Fix VBR encoding of sample rates over 64 kHz 21 | 22 | 0.1.3 23 | - Updated upstream sources, with a number of crash fixes and new features 24 | (including support for encoding 7.1) 25 | 26 | 0.1.2 27 | - Fix a few more crashes 28 | - Include dependency libs (such as -lm) in the pkg-config file 29 | 30 | 0.1.1 31 | - Updated to a new upstream version from Android 4.2, fixing a lot of crashes 32 | - Cleanup of autotools usage 33 | - Make sure the shared library links to libm if necessary 34 | - Performance improvements on x86 35 | - Added support for WG4/DVD audio channel mappings 36 | - Minimized the differences to upstream 37 | - Added an example encoder tool 38 | 39 | 0.1.0 40 | - Initial release of fdk-aac 41 | - autotools based build system 42 | - Enable setting VBR bitrate modes 43 | -------------------------------------------------------------------------------- /MODULE_LICENSE_FRAUNHOFER: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/MODULE_LICENSE_FRAUNHOFER -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ACLOCAL_AMFLAGS = -I m4 2 | AUTOMAKE_OPTIONS = subdir-objects 3 | 4 | AM_CPPFLAGS = \ 5 | -I$(top_srcdir)/libAACdec/include \ 6 | -I$(top_srcdir)/libAACenc/include \ 7 | -I$(top_srcdir)/libSBRdec/include \ 8 | -I$(top_srcdir)/libSBRenc/include \ 9 | -I$(top_srcdir)/libMpegTPDec/include \ 10 | -I$(top_srcdir)/libMpegTPEnc/include \ 11 | -I$(top_srcdir)/libSYS/include \ 12 | -I$(top_srcdir)/libFDK/include \ 13 | -I$(top_srcdir)/libPCMutils/include 14 | 15 | AM_CXXFLAGS = -fno-exceptions -fno-rtti 16 | libfdk_aac_la_LINK = $(LINK) $(libfdk_aac_la_LDFLAGS) 17 | # Mention a dummy pure C file to trigger generation of the $(LINK) variable 18 | nodist_EXTRA_libfdk_aac_la_SOURCES = dummy.c 19 | 20 | fdk_aacincludedir = $(includedir)/fdk-aac 21 | fdk_aacinclude_HEADERS = \ 22 | $(top_srcdir)/libSYS/include/machine_type.h \ 23 | $(top_srcdir)/libSYS/include/genericStds.h \ 24 | $(top_srcdir)/libSYS/include/FDK_audio.h \ 25 | $(top_srcdir)/libAACenc/include/aacenc_lib.h \ 26 | $(top_srcdir)/libAACdec/include/aacdecoder_lib.h 27 | 28 | pkgconfigdir = $(libdir)/pkgconfig 29 | pkgconfig_DATA = fdk-aac.pc 30 | 31 | lib_LTLIBRARIES = libfdk-aac.la 32 | 33 | libfdk_aac_la_LDFLAGS = -version-info @FDK_AAC_VERSION@ -no-undefined \ 34 | -export-symbols $(top_srcdir)/fdk-aac.sym 35 | 36 | if EXAMPLE 37 | bin_PROGRAMS = aac-enc$(EXEEXT) 38 | 39 | aac_enc_LDADD = libfdk-aac.la 40 | aac_enc_SOURCES = aac-enc.c wavreader.c 41 | 42 | noinst_HEADERS = wavreader.h 43 | endif 44 | 45 | AACDEC_SRC = \ 46 | libAACdec/src/aacdec_drc.cpp \ 47 | libAACdec/src/aacdec_hcr.cpp \ 48 | libAACdec/src/aacdecoder.cpp \ 49 | libAACdec/src/aacdec_pns.cpp \ 50 | libAACdec/src/aac_ram.cpp \ 51 | libAACdec/src/block.cpp \ 52 | libAACdec/src/channelinfo.cpp \ 53 | libAACdec/src/ldfiltbank.cpp \ 54 | libAACdec/src/rvlcbit.cpp \ 55 | libAACdec/src/rvlc.cpp \ 56 | libAACdec/src/aacdec_hcr_bit.cpp \ 57 | libAACdec/src/aacdec_hcrs.cpp \ 58 | libAACdec/src/aacdecoder_lib.cpp \ 59 | libAACdec/src/aacdec_tns.cpp \ 60 | libAACdec/src/aac_rom.cpp \ 61 | libAACdec/src/channel.cpp \ 62 | libAACdec/src/conceal.cpp \ 63 | libAACdec/src/pulsedata.cpp \ 64 | libAACdec/src/rvlcconceal.cpp \ 65 | libAACdec/src/stereo.cpp 66 | 67 | AACENC_SRC = \ 68 | libAACenc/src/aacenc.cpp \ 69 | libAACenc/src/aacEnc_ram.cpp \ 70 | libAACenc/src/band_nrg.cpp \ 71 | libAACenc/src/block_switch.cpp \ 72 | libAACenc/src/grp_data.cpp \ 73 | libAACenc/src/metadata_main.cpp \ 74 | libAACenc/src/pre_echo_control.cpp \ 75 | libAACenc/src/quantize.cpp \ 76 | libAACenc/src/tonality.cpp \ 77 | libAACenc/src/aacEnc_rom.cpp \ 78 | libAACenc/src/bandwidth.cpp \ 79 | libAACenc/src/channel_map.cpp \ 80 | libAACenc/src/intensity.cpp \ 81 | libAACenc/src/ms_stereo.cpp \ 82 | libAACenc/src/psy_configuration.cpp \ 83 | libAACenc/src/sf_estim.cpp \ 84 | libAACenc/src/transform.cpp \ 85 | libAACenc/src/aacenc_lib.cpp \ 86 | libAACenc/src/aacenc_tns.cpp \ 87 | libAACenc/src/bit_cnt.cpp \ 88 | libAACenc/src/chaosmeasure.cpp \ 89 | libAACenc/src/line_pe.cpp \ 90 | libAACenc/src/noisedet.cpp \ 91 | libAACenc/src/psy_main.cpp \ 92 | libAACenc/src/spreading.cpp \ 93 | libAACenc/src/aacenc_pns.cpp \ 94 | libAACenc/src/adj_thr.cpp \ 95 | libAACenc/src/bitenc.cpp \ 96 | libAACenc/src/dyn_bits.cpp \ 97 | libAACenc/src/metadata_compressor.cpp \ 98 | libAACenc/src/pnsparam.cpp \ 99 | libAACenc/src/qc_main.cpp 100 | 101 | FDK_SRC = \ 102 | libFDK/src/autocorr2nd.cpp \ 103 | libFDK/src/dct.cpp \ 104 | libFDK/src/FDK_bitbuffer.cpp \ 105 | libFDK/src/FDK_core.cpp \ 106 | libFDK/src/FDK_crc.cpp \ 107 | libFDK/src/FDK_hybrid.cpp \ 108 | libFDK/src/FDK_tools_rom.cpp \ 109 | libFDK/src/FDK_trigFcts.cpp \ 110 | libFDK/src/fft.cpp \ 111 | libFDK/src/fft_rad2.cpp \ 112 | libFDK/src/fixpoint_math.cpp \ 113 | libFDK/src/mdct.cpp \ 114 | libFDK/src/qmf.cpp \ 115 | libFDK/src/scale.cpp 116 | 117 | MPEGTPDEC_SRC = \ 118 | libMpegTPDec/src/tpdec_adif.cpp \ 119 | libMpegTPDec/src/tpdec_adts.cpp \ 120 | libMpegTPDec/src/tpdec_asc.cpp \ 121 | libMpegTPDec/src/tpdec_drm.cpp \ 122 | libMpegTPDec/src/tpdec_latm.cpp \ 123 | libMpegTPDec/src/tpdec_lib.cpp 124 | 125 | MPEGTPENC_SRC = \ 126 | libMpegTPEnc/src/tpenc_adif.cpp \ 127 | libMpegTPEnc/src/tpenc_adts.cpp \ 128 | libMpegTPEnc/src/tpenc_asc.cpp \ 129 | libMpegTPEnc/src/tpenc_latm.cpp \ 130 | libMpegTPEnc/src/tpenc_lib.cpp \ 131 | libMpegTPEnc/src/tpenc_dab.cpp 132 | 133 | PCMUTILS_SRC = \ 134 | libPCMutils/src/limiter.cpp \ 135 | libPCMutils/src/pcmutils_lib.cpp 136 | 137 | SBRDEC_SRC = \ 138 | libSBRdec/src/env_calc.cpp \ 139 | libSBRdec/src/env_dec.cpp \ 140 | libSBRdec/src/env_extr.cpp \ 141 | libSBRdec/src/huff_dec.cpp \ 142 | libSBRdec/src/lpp_tran.cpp \ 143 | libSBRdec/src/psbitdec.cpp \ 144 | libSBRdec/src/psdec.cpp \ 145 | libSBRdec/src/psdec_hybrid.cpp \ 146 | libSBRdec/src/sbr_crc.cpp \ 147 | libSBRdec/src/sbr_deb.cpp \ 148 | libSBRdec/src/sbr_dec.cpp \ 149 | libSBRdec/src/sbrdec_drc.cpp \ 150 | libSBRdec/src/sbrdec_freq_sca.cpp \ 151 | libSBRdec/src/sbrdecoder.cpp \ 152 | libSBRdec/src/sbr_ram.cpp \ 153 | libSBRdec/src/sbr_rom.cpp 154 | 155 | SBRENC_SRC = \ 156 | libSBRenc/src/bit_sbr.cpp \ 157 | libSBRenc/src/env_bit.cpp \ 158 | libSBRenc/src/fram_gen.cpp \ 159 | libSBRenc/src/mh_det.cpp \ 160 | libSBRenc/src/ps_bitenc.cpp \ 161 | libSBRenc/src/ps_encode.cpp \ 162 | libSBRenc/src/resampler.cpp \ 163 | libSBRenc/src/sbr_encoder.cpp \ 164 | libSBRenc/src/sbr_ram.cpp \ 165 | libSBRenc/src/ton_corr.cpp \ 166 | libSBRenc/src/code_env.cpp \ 167 | libSBRenc/src/env_est.cpp \ 168 | libSBRenc/src/invf_est.cpp \ 169 | libSBRenc/src/nf_est.cpp \ 170 | libSBRenc/src/ps_main.cpp \ 171 | libSBRenc/src/sbrenc_freq_sca.cpp \ 172 | libSBRenc/src/sbr_misc.cpp \ 173 | libSBRenc/src/sbr_rom.cpp \ 174 | libSBRenc/src/tran_det.cpp 175 | 176 | SYS_SRC = \ 177 | libSYS/src/cmdl_parser.cpp \ 178 | libSYS/src/conv_string.cpp \ 179 | libSYS/src/genericStds.cpp \ 180 | libSYS/src/wav_file.cpp 181 | 182 | libfdk_aac_la_SOURCES = \ 183 | $(AACDEC_SRC) $(AACENC_SRC) \ 184 | $(MPEGTPDEC_SRC) $(MPEGTPENC_SRC) \ 185 | $(SBRDEC_SRC) $(SBRENC_SRC) \ 186 | $(PCMUTILS_SRC) $(FDK_SRC) $(SYS_SRC) 187 | 188 | EXTRA_DIST = \ 189 | $(top_srcdir)/autogen.sh \ 190 | $(top_srcdir)/MODULE_LICENSE_FRAUNHOFER \ 191 | $(top_srcdir)/NOTICE \ 192 | $(top_srcdir)/OWNERS \ 193 | $(top_srcdir)/Android.bp \ 194 | $(top_srcdir)/fdk-aac.sym \ 195 | $(top_srcdir)/Makefile.vc \ 196 | $(top_srcdir)/documentation/*.pdf \ 197 | $(top_srcdir)/libAACdec/src/*.h \ 198 | $(top_srcdir)/libAACdec/src/arm/*.cpp \ 199 | $(top_srcdir)/libAACenc/src/*.h \ 200 | $(top_srcdir)/libSBRenc/src/*.h \ 201 | $(top_srcdir)/libSBRenc/include/*.h \ 202 | $(top_srcdir)/libSBRdec/src/*.h \ 203 | $(top_srcdir)/libSBRdec/src/arm/*.cpp \ 204 | $(top_srcdir)/libSBRdec/include/*.h \ 205 | $(top_srcdir)/libSYS/include/*.h \ 206 | $(top_srcdir)/libSYS/src/linux/*.cpp \ 207 | $(top_srcdir)/libSYS/src/mips/*.cpp \ 208 | $(top_srcdir)/libPCMutils/include/*.h \ 209 | $(top_srcdir)/libMpegTPEnc/include/*.h \ 210 | $(top_srcdir)/libMpegTPEnc/src/*.h \ 211 | $(top_srcdir)/libMpegTPEnc/src/version \ 212 | $(top_srcdir)/libMpegTPDec/include/*.h \ 213 | $(top_srcdir)/libMpegTPDec/src/*.h \ 214 | $(top_srcdir)/libMpegTPDec/src/version \ 215 | $(top_srcdir)/libFDK/include/*.h \ 216 | $(top_srcdir)/libFDK/include/aarch64/*.h \ 217 | $(top_srcdir)/libFDK/include/arm/*.h \ 218 | $(top_srcdir)/libFDK/include/mips/*.h \ 219 | $(top_srcdir)/libFDK/include/ppc/*.h \ 220 | $(top_srcdir)/libFDK/include/x86/*.h \ 221 | $(top_srcdir)/libFDK/src/arm/*.cpp \ 222 | $(top_srcdir)/libFDK/src/mips/*.cpp \ 223 | $(top_srcdir)/win32/*.h 224 | 225 | -------------------------------------------------------------------------------- /Makefile.vc: -------------------------------------------------------------------------------- 1 | # 2 | # Options: 3 | # prefix=\path\to\install 4 | # 5 | # Compiling: nmake -f Makefile.vc 6 | # Installing: nmake -f Makefile.vc prefix=\path\to\x install 7 | # 8 | 9 | VERSION=0.1.5 10 | 11 | # Linker and librarian commands 12 | LD = link 13 | AR = lib 14 | 15 | !IFDEF HOME 16 | # In case we are using a cross compiler shell. 17 | MKDIR_FLAGS = -p 18 | !ENDIF 19 | 20 | AM_CPPFLAGS = \ 21 | -Iwin32 \ 22 | -IlibAACdec/include \ 23 | -IlibAACenc/include \ 24 | -IlibSBRdec/include \ 25 | -IlibSBRenc/include \ 26 | -IlibMpegTPDec/include \ 27 | -IlibMpegTPEnc/include \ 28 | -IlibSYS/include \ 29 | -IlibFDK/include \ 30 | -IlibPCMutils/include 31 | 32 | AACDEC_SRC = \ 33 | libAACdec/src/aacdec_drc.cpp \ 34 | libAACdec/src/aacdec_hcr.cpp \ 35 | libAACdec/src/aacdecoder.cpp \ 36 | libAACdec/src/aacdec_pns.cpp \ 37 | libAACdec/src/aac_ram.cpp \ 38 | libAACdec/src/block.cpp \ 39 | libAACdec/src/channelinfo.cpp \ 40 | libAACdec/src/ldfiltbank.cpp \ 41 | libAACdec/src/rvlcbit.cpp \ 42 | libAACdec/src/rvlc.cpp \ 43 | libAACdec/src/aacdec_hcr_bit.cpp \ 44 | libAACdec/src/aacdec_hcrs.cpp \ 45 | libAACdec/src/aacdecoder_lib.cpp \ 46 | libAACdec/src/aacdec_tns.cpp \ 47 | libAACdec/src/aac_rom.cpp \ 48 | libAACdec/src/channel.cpp \ 49 | libAACdec/src/conceal.cpp \ 50 | libAACdec/src/pulsedata.cpp \ 51 | libAACdec/src/rvlcconceal.cpp \ 52 | libAACdec/src/stereo.cpp 53 | 54 | AACENC_SRC = \ 55 | libAACenc/src/aacenc.cpp \ 56 | libAACenc/src/aacEnc_ram.cpp \ 57 | libAACenc/src/band_nrg.cpp \ 58 | libAACenc/src/block_switch.cpp \ 59 | libAACenc/src/grp_data.cpp \ 60 | libAACenc/src/metadata_main.cpp \ 61 | libAACenc/src/pre_echo_control.cpp \ 62 | libAACenc/src/quantize.cpp \ 63 | libAACenc/src/tonality.cpp \ 64 | libAACenc/src/aacEnc_rom.cpp \ 65 | libAACenc/src/bandwidth.cpp \ 66 | libAACenc/src/channel_map.cpp \ 67 | libAACenc/src/intensity.cpp \ 68 | libAACenc/src/ms_stereo.cpp \ 69 | libAACenc/src/psy_configuration.cpp \ 70 | libAACenc/src/sf_estim.cpp \ 71 | libAACenc/src/transform.cpp \ 72 | libAACenc/src/aacenc_lib.cpp \ 73 | libAACenc/src/aacenc_tns.cpp \ 74 | libAACenc/src/bit_cnt.cpp \ 75 | libAACenc/src/chaosmeasure.cpp \ 76 | libAACenc/src/line_pe.cpp \ 77 | libAACenc/src/noisedet.cpp \ 78 | libAACenc/src/psy_main.cpp \ 79 | libAACenc/src/spreading.cpp \ 80 | libAACenc/src/aacenc_pns.cpp \ 81 | libAACenc/src/adj_thr.cpp \ 82 | libAACenc/src/bitenc.cpp \ 83 | libAACenc/src/dyn_bits.cpp \ 84 | libAACenc/src/metadata_compressor.cpp \ 85 | libAACenc/src/pnsparam.cpp \ 86 | libAACenc/src/qc_main.cpp 87 | 88 | FDK_SRC = \ 89 | libFDK/src/autocorr2nd.cpp \ 90 | libFDK/src/dct.cpp \ 91 | libFDK/src/FDK_bitbuffer.cpp \ 92 | libFDK/src/FDK_core.cpp \ 93 | libFDK/src/FDK_crc.cpp \ 94 | libFDK/src/FDK_hybrid.cpp \ 95 | libFDK/src/FDK_tools_rom.cpp \ 96 | libFDK/src/FDK_trigFcts.cpp \ 97 | libFDK/src/fft.cpp \ 98 | libFDK/src/fft_rad2.cpp \ 99 | libFDK/src/fixpoint_math.cpp \ 100 | libFDK/src/mdct.cpp \ 101 | libFDK/src/qmf.cpp \ 102 | libFDK/src/scale.cpp \ 103 | 104 | MPEGTPDEC_SRC = \ 105 | libMpegTPDec/src/tpdec_adif.cpp \ 106 | libMpegTPDec/src/tpdec_adts.cpp \ 107 | libMpegTPDec/src/tpdec_asc.cpp \ 108 | libMpegTPDec/src/tpdec_drm.cpp \ 109 | libMpegTPDec/src/tpdec_latm.cpp \ 110 | libMpegTPDec/src/tpdec_lib.cpp 111 | 112 | MPEGTPENC_SRC = \ 113 | libMpegTPEnc/src/tpenc_adif.cpp \ 114 | libMpegTPEnc/src/tpenc_adts.cpp \ 115 | libMpegTPEnc/src/tpenc_asc.cpp \ 116 | libMpegTPEnc/src/tpenc_latm.cpp \ 117 | libMpegTPEnc/src/tpenc_lib.cpp 118 | 119 | PCMUTILS_SRC = \ 120 | libPCMutils/src/limiter.cpp \ 121 | libPCMutils/src/pcmutils_lib.cpp 122 | 123 | SBRDEC_SRC = \ 124 | libSBRdec/src/env_calc.cpp \ 125 | libSBRdec/src/env_dec.cpp \ 126 | libSBRdec/src/env_extr.cpp \ 127 | libSBRdec/src/huff_dec.cpp \ 128 | libSBRdec/src/lpp_tran.cpp \ 129 | libSBRdec/src/psbitdec.cpp \ 130 | libSBRdec/src/psdec.cpp \ 131 | libSBRdec/src/psdec_hybrid.cpp \ 132 | libSBRdec/src/sbr_crc.cpp \ 133 | libSBRdec/src/sbr_deb.cpp \ 134 | libSBRdec/src/sbr_dec.cpp \ 135 | libSBRdec/src/sbrdec_drc.cpp \ 136 | libSBRdec/src/sbrdec_freq_sca.cpp \ 137 | libSBRdec/src/sbrdecoder.cpp \ 138 | libSBRdec/src/sbr_ram.cpp \ 139 | libSBRdec/src/sbr_rom.cpp 140 | 141 | SBRENC_SRC = \ 142 | libSBRenc/src/bit_sbr.cpp \ 143 | libSBRenc/src/env_bit.cpp \ 144 | libSBRenc/src/fram_gen.cpp \ 145 | libSBRenc/src/mh_det.cpp \ 146 | libSBRenc/src/ps_bitenc.cpp \ 147 | libSBRenc/src/ps_encode.cpp \ 148 | libSBRenc/src/resampler.cpp \ 149 | libSBRenc/src/sbr_encoder.cpp \ 150 | libSBRenc/src/sbr_ram.cpp \ 151 | libSBRenc/src/ton_corr.cpp \ 152 | libSBRenc/src/code_env.cpp \ 153 | libSBRenc/src/env_est.cpp \ 154 | libSBRenc/src/invf_est.cpp \ 155 | libSBRenc/src/nf_est.cpp \ 156 | libSBRenc/src/ps_main.cpp \ 157 | libSBRenc/src/sbrenc_freq_sca.cpp \ 158 | libSBRenc/src/sbr_misc.cpp \ 159 | libSBRenc/src/sbr_rom.cpp \ 160 | libSBRenc/src/tran_det.cpp 161 | 162 | SYS_SRC = \ 163 | libSYS/src/cmdl_parser.cpp \ 164 | libSYS/src/conv_string.cpp \ 165 | libSYS/src/genericStds.cpp \ 166 | libSYS/src/wav_file.cpp 167 | 168 | libfdk_aac_SOURCES = \ 169 | $(AACDEC_SRC) $(AACENC_SRC) \ 170 | $(MPEGTPDEC_SRC) $(MPEGTPENC_SRC) \ 171 | $(SBRDEC_SRC) $(SBRENC_SRC) \ 172 | $(PCMUTILS_SRC) $(FDK_SRC) $(SYS_SRC) 173 | 174 | 175 | aac_enc_SOURCES = aac-enc.c wavreader.c 176 | 177 | prefix = \usr\local 178 | prefix_win = $(prefix:/=\) # In case we are using MSYS or MinGW. 179 | 180 | CFLAGS = /nologo /W3 /Ox /MT /EHsc /Dinline=__inline $(TARGET_FLAGS) $(AM_CPPFLAGS) $(XCFLAGS) 181 | CXXFLAGS = $(CFLAGS) 182 | CPPFLAGS = $(CFLAGS) 183 | LDFLAGS = -nologo $(XLDFLAGS) 184 | ARFLAGS = -nologo 185 | 186 | incdir = $(prefix_win)\include\fdk-aac 187 | bindir = $(prefix_win)\bin 188 | libdir = $(prefix_win)\lib 189 | 190 | INST_DIRS = $(bindir) $(incdir) $(libdir) 191 | 192 | LIB_DEF = fdk-aac.def 193 | STATIC_LIB = fdk-aac.lib 194 | SHARED_LIB = fdk-aac-1.dll 195 | IMP_LIB = fdk-aac.dll.lib 196 | 197 | AAC_ENC_OBJS = $(aac_enc_SOURCES:.c=.obj) 198 | FDK_OBJS = $(libfdk_aac_SOURCES:.cpp=.obj) 199 | 200 | PROGS = aac-enc.exe 201 | 202 | 203 | 204 | all: $(LIB_DEF) $(STATIC_LIB) $(SHARED_LIB) $(IMP_LIB) $(PROGS) 205 | 206 | clean: 207 | del /f $(LIB_DEF) $(STATIC_LIB) $(SHARED_LIB) $(IMP_LIB) $(PROGS) libfdk-aac.pc 2>NUL 208 | del /f *.obj *.exp 2>NUL 209 | del /f libAACdec\src\*.obj 2>NUL 210 | del /f libAACenc\src\*.obj 2>NUL 211 | del /f libFDK\src\*.obj 2>NUL 212 | del /f libMpegTPDec\src\*.obj 2>NUL 213 | del /f libMpegTPEnc\src\*.obj 2>NUL 214 | del /f libPCMutils\src\*.obj 2>NUL 215 | del /f libSBRdec\src\*.obj 2>NUL 216 | del /f libSBRenc\src\*.obj 2>NUL 217 | del /f libSYS\src\*.obj 2>NUL 218 | 219 | install: $(INST_DIRS) 220 | copy libAACdec\include\aacdecoder_lib.h $(incdir) 221 | copy libAACenc\include\aacenc_lib.h $(incdir) 222 | copy libSYS\include\FDK_audio.h $(incdir) 223 | copy libSYS\include\genericStds.h $(incdir) 224 | copy libSYS\include\machine_type.h $(incdir) 225 | copy $(STATIC_LIB) $(libdir) 226 | copy $(IMP_LIB) $(libdir) 227 | copy $(SHARED_LIB) $(bindir) 228 | copy $(PROGS) $(bindir) 229 | copy $(LIB_DEF) $(libdir) 230 | 231 | $(INST_DIRS): 232 | @mkdir $(MKDIR_FLAGS) $@ 233 | 234 | $(STATIC_LIB): $(FDK_OBJS) 235 | $(AR) $(ARFLAGS) -out:$@ $(FDK_OBJS) 236 | 237 | $(IMP_LIB): $(SHARED_LIB) 238 | 239 | $(SHARED_LIB): $(FDK_OBJS) 240 | $(LD) $(LDFLAGS) -OUT:$@ -DEF:$(LIB_DEF) -implib:$(IMP_LIB) -DLL $(FDK_OBJS) 241 | 242 | $(PROGS): $(AAC_ENC_OBJS) 243 | $(LD) $(LDFLAGS) -out:$@ $(AAC_ENC_OBJS) $(STATIC_LIB) 244 | 245 | .cpp.obj: 246 | $(CXX) $(CXXFLAGS) -c -Fo$@ $< 247 | 248 | $(LIB_DEF): 249 | @echo EXPORTS > $(LIB_DEF) 250 | @type fdk-aac.sym >> $(LIB_DEF) 251 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Software License for The Fraunhofer FDK AAC Codec Library for Android 2 | 3 | © Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. 4 | All rights reserved. 5 | 6 | 1. INTRODUCTION 7 | The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software that implements 8 | the MPEG Advanced Audio Coding ("AAC") encoding and decoding scheme for digital audio. 9 | This FDK AAC Codec software is intended to be used on a wide variety of Android devices. 10 | 11 | AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient general perceptual 12 | audio codecs. AAC-ELD is considered the best-performing full-bandwidth communications codec by 13 | independent studies and is widely deployed. AAC has been standardized by ISO and IEC as part 14 | of the MPEG specifications. 15 | 16 | Patent licenses for necessary patent claims for the FDK AAC Codec (including those of Fraunhofer) 17 | may be obtained through Via Licensing (www.vialicensing.com) or through the respective patent owners 18 | individually for the purpose of encoding or decoding bit streams in products that are compliant with 19 | the ISO/IEC MPEG audio standards. Please note that most manufacturers of Android devices already license 20 | these patent claims through Via Licensing or directly from the patent owners, and therefore FDK AAC Codec 21 | software may already be covered under those patent licenses when it is used for those licensed purposes only. 22 | 23 | Commercially-licensed AAC software libraries, including floating-point versions with enhanced sound quality, 24 | are also available from Fraunhofer. Users are encouraged to check the Fraunhofer website for additional 25 | applications information and documentation. 26 | 27 | 2. COPYRIGHT LICENSE 28 | 29 | Redistribution and use in source and binary forms, with or without modification, are permitted without 30 | payment of copyright license fees provided that you satisfy the following conditions: 31 | 32 | You must retain the complete text of this software license in redistributions of the FDK AAC Codec or 33 | your modifications thereto in source code form. 34 | 35 | You must retain the complete text of this software license in the documentation and/or other materials 36 | provided with redistributions of the FDK AAC Codec or your modifications thereto in binary form. 37 | You must make available free of charge copies of the complete source code of the FDK AAC Codec and your 38 | modifications thereto to recipients of copies in binary form. 39 | 40 | The name of Fraunhofer may not be used to endorse or promote products derived from this library without 41 | prior written permission. 42 | 43 | You may not charge copyright license fees for anyone to use, copy or distribute the FDK AAC Codec 44 | software or your modifications thereto. 45 | 46 | Your modified versions of the FDK AAC Codec must carry prominent notices stating that you changed the software 47 | and the date of any change. For modified versions of the FDK AAC Codec, the term 48 | "Fraunhofer FDK AAC Codec Library for Android" must be replaced by the term 49 | "Third-Party Modified Version of the Fraunhofer FDK AAC Codec Library for Android." 50 | 51 | 3. NO PATENT LICENSE 52 | 53 | NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without limitation the patents of Fraunhofer, 54 | ARE GRANTED BY THIS SOFTWARE LICENSE. Fraunhofer provides no warranty of patent non-infringement with 55 | respect to this software. 56 | 57 | You may use this FDK AAC Codec software or modifications thereto only for purposes that are authorized 58 | by appropriate patent licenses. 59 | 60 | 4. DISCLAIMER 61 | 62 | This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright holders and contributors 63 | "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, including but not limited to the implied warranties 64 | of merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 65 | CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary, or consequential damages, 66 | including but not limited to procurement of substitute goods or services; loss of use, data, or profits, 67 | or business interruption, however caused and on any theory of liability, whether in contract, strict 68 | liability, or tort (including negligence), arising in any way out of the use of this software, even if 69 | advised of the possibility of such damage. 70 | 71 | 5. CONTACT INFORMATION 72 | 73 | Fraunhofer Institute for Integrated Circuits IIS 74 | Attention: Audio and Multimedia Departments - FDK AAC LL 75 | Am Wolfsmantel 33 76 | 91058 Erlangen, Germany 77 | 78 | www.iis.fraunhofer.de/amm 79 | amm-info@iis.fraunhofer.de 80 | 81 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | jmtrivi@google.com 2 | gkasten@android.com 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | A patched version of fdk-aac with DAB+ support 2 | ============================================== 3 | 4 | This is a modified version of fdk-aac that supports the AOTs 5 | required for DAB+ encoding. 6 | 7 | This library is a dependency for ODR-AudioEnc. 8 | 9 | See www.opendigitalradio.org for more 10 | -------------------------------------------------------------------------------- /aac-enc.c: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 2011 Martin Storsjo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #if defined(_MSC_VER) 23 | #include 24 | #else 25 | #include 26 | #endif 27 | 28 | #include 29 | #include "libAACenc/include/aacenc_lib.h" 30 | #include "wavreader.h" 31 | 32 | void usage(const char* name) { 33 | fprintf(stderr, "%s [-r bitrate] [-t aot] [-a afterburner] [-s sbr] [-v vbr] in.wav out.aac\n", name); 34 | fprintf(stderr, "Supported AOTs:\n"); 35 | fprintf(stderr, "\t2\tAAC-LC\n"); 36 | fprintf(stderr, "\t5\tHE-AAC\n"); 37 | fprintf(stderr, "\t29\tHE-AAC v2\n"); 38 | fprintf(stderr, "\t23\tAAC-LD\n"); 39 | fprintf(stderr, "\t39\tAAC-ELD\n"); 40 | } 41 | 42 | int main(int argc, char *argv[]) { 43 | int bitrate = 64000; 44 | int ch; 45 | const char *infile, *outfile; 46 | FILE *out; 47 | void *wav; 48 | int format, sample_rate, channels, bits_per_sample; 49 | int input_size; 50 | uint8_t* input_buf; 51 | int16_t* convert_buf; 52 | int aot = 2; 53 | int afterburner = 1; 54 | int eld_sbr = 0; 55 | int vbr = 0; 56 | HANDLE_AACENCODER handle; 57 | CHANNEL_MODE mode; 58 | AACENC_InfoStruct info = { 0 }; 59 | while ((ch = getopt(argc, argv, "r:t:a:s:v:")) != -1) { 60 | switch (ch) { 61 | case 'r': 62 | bitrate = atoi(optarg); 63 | break; 64 | case 't': 65 | aot = atoi(optarg); 66 | break; 67 | case 'a': 68 | afterburner = atoi(optarg); 69 | break; 70 | case 's': 71 | eld_sbr = atoi(optarg); 72 | break; 73 | case 'v': 74 | vbr = atoi(optarg); 75 | break; 76 | case '?': 77 | default: 78 | usage(argv[0]); 79 | return 1; 80 | } 81 | } 82 | if (argc - optind < 2) { 83 | usage(argv[0]); 84 | return 1; 85 | } 86 | infile = argv[optind]; 87 | outfile = argv[optind + 1]; 88 | 89 | wav = wav_read_open(infile); 90 | if (!wav) { 91 | fprintf(stderr, "Unable to open wav file %s\n", infile); 92 | return 1; 93 | } 94 | if (!wav_get_header(wav, &format, &channels, &sample_rate, &bits_per_sample, NULL)) { 95 | fprintf(stderr, "Bad wav file %s\n", infile); 96 | return 1; 97 | } 98 | if (format != 1) { 99 | fprintf(stderr, "Unsupported WAV format %d\n", format); 100 | return 1; 101 | } 102 | if (bits_per_sample != 16) { 103 | fprintf(stderr, "Unsupported WAV sample depth %d\n", bits_per_sample); 104 | return 1; 105 | } 106 | switch (channels) { 107 | case 1: mode = MODE_1; break; 108 | case 2: mode = MODE_2; break; 109 | case 3: mode = MODE_1_2; break; 110 | case 4: mode = MODE_1_2_1; break; 111 | case 5: mode = MODE_1_2_2; break; 112 | case 6: mode = MODE_1_2_2_1; break; 113 | default: 114 | fprintf(stderr, "Unsupported WAV channels %d\n", channels); 115 | return 1; 116 | } 117 | if (aacEncOpen(&handle, 0, channels) != AACENC_OK) { 118 | fprintf(stderr, "Unable to open encoder\n"); 119 | return 1; 120 | } 121 | if (aacEncoder_SetParam(handle, AACENC_AOT, aot) != AACENC_OK) { 122 | fprintf(stderr, "Unable to set the AOT\n"); 123 | return 1; 124 | } 125 | if (aot == 39 && eld_sbr) { 126 | if (aacEncoder_SetParam(handle, AACENC_SBR_MODE, 1) != AACENC_OK) { 127 | fprintf(stderr, "Unable to set SBR mode for ELD\n"); 128 | return 1; 129 | } 130 | } 131 | if (aacEncoder_SetParam(handle, AACENC_SAMPLERATE, sample_rate) != AACENC_OK) { 132 | fprintf(stderr, "Unable to set the AOT\n"); 133 | return 1; 134 | } 135 | if (aacEncoder_SetParam(handle, AACENC_CHANNELMODE, mode) != AACENC_OK) { 136 | fprintf(stderr, "Unable to set the channel mode\n"); 137 | return 1; 138 | } 139 | if (aacEncoder_SetParam(handle, AACENC_CHANNELORDER, 1) != AACENC_OK) { 140 | fprintf(stderr, "Unable to set the wav channel order\n"); 141 | return 1; 142 | } 143 | if (vbr) { 144 | if (aacEncoder_SetParam(handle, AACENC_BITRATEMODE, vbr) != AACENC_OK) { 145 | fprintf(stderr, "Unable to set the VBR bitrate mode\n"); 146 | return 1; 147 | } 148 | } else { 149 | if (aacEncoder_SetParam(handle, AACENC_BITRATE, bitrate) != AACENC_OK) { 150 | fprintf(stderr, "Unable to set the bitrate\n"); 151 | return 1; 152 | } 153 | } 154 | if (aacEncoder_SetParam(handle, AACENC_TRANSMUX, 2) != AACENC_OK) { 155 | fprintf(stderr, "Unable to set the ADTS transmux\n"); 156 | return 1; 157 | } 158 | if (aacEncoder_SetParam(handle, AACENC_AFTERBURNER, afterburner) != AACENC_OK) { 159 | fprintf(stderr, "Unable to set the afterburner mode\n"); 160 | return 1; 161 | } 162 | if (aacEncEncode(handle, NULL, NULL, NULL, NULL) != AACENC_OK) { 163 | fprintf(stderr, "Unable to initialize the encoder\n"); 164 | return 1; 165 | } 166 | if (aacEncInfo(handle, &info) != AACENC_OK) { 167 | fprintf(stderr, "Unable to get the encoder info\n"); 168 | return 1; 169 | } 170 | 171 | out = fopen(outfile, "wb"); 172 | if (!out) { 173 | perror(outfile); 174 | return 1; 175 | } 176 | 177 | input_size = channels*2*info.frameLength; 178 | input_buf = (uint8_t*) malloc(input_size); 179 | convert_buf = (int16_t*) malloc(input_size); 180 | 181 | while (1) { 182 | AACENC_BufDesc in_buf = { 0 }, out_buf = { 0 }; 183 | AACENC_InArgs in_args = { 0 }; 184 | AACENC_OutArgs out_args = { 0 }; 185 | int in_identifier = IN_AUDIO_DATA; 186 | int in_size, in_elem_size; 187 | int out_identifier = OUT_BITSTREAM_DATA; 188 | int out_size, out_elem_size; 189 | int read, i; 190 | void *in_ptr, *out_ptr; 191 | uint8_t outbuf[20480]; 192 | AACENC_ERROR err; 193 | 194 | read = wav_read_data(wav, input_buf, input_size); 195 | for (i = 0; i < read/2; i++) { 196 | const uint8_t* in = &input_buf[2*i]; 197 | convert_buf[i] = in[0] | (in[1] << 8); 198 | } 199 | if (read <= 0) { 200 | in_args.numInSamples = -1; 201 | } else { 202 | in_ptr = convert_buf; 203 | in_size = read; 204 | in_elem_size = 2; 205 | 206 | in_args.numInSamples = read/2; 207 | in_buf.numBufs = 1; 208 | in_buf.bufs = &in_ptr; 209 | in_buf.bufferIdentifiers = &in_identifier; 210 | in_buf.bufSizes = &in_size; 211 | in_buf.bufElSizes = &in_elem_size; 212 | } 213 | out_ptr = outbuf; 214 | out_size = sizeof(outbuf); 215 | out_elem_size = 1; 216 | out_buf.numBufs = 1; 217 | out_buf.bufs = &out_ptr; 218 | out_buf.bufferIdentifiers = &out_identifier; 219 | out_buf.bufSizes = &out_size; 220 | out_buf.bufElSizes = &out_elem_size; 221 | 222 | if ((err = aacEncEncode(handle, &in_buf, &out_buf, &in_args, &out_args)) != AACENC_OK) { 223 | if (err == AACENC_ENCODE_EOF) 224 | break; 225 | fprintf(stderr, "Encoding failed\n"); 226 | return 1; 227 | } 228 | if (out_args.numOutBytes == 0) 229 | continue; 230 | fwrite(outbuf, 1, out_args.numOutBytes, out); 231 | } 232 | free(input_buf); 233 | free(convert_buf); 234 | fclose(out); 235 | wav_read_close(wav); 236 | aacEncClose(&handle); 237 | 238 | return 0; 239 | } 240 | 241 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | autoreconf -fiv 3 | -------------------------------------------------------------------------------- /bootstrap: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | autoreconf --install && \ 4 | echo "You can call ./configure now" 5 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | dnl -*- Autoconf -*- 2 | dnl Process this file with autoconf to produce a configure script. 3 | 4 | AC_INIT([fdk-aac], [0.1.6], [http://sourceforge.net/projects/opencore-amr/]) 5 | AC_CONFIG_AUX_DIR(.) 6 | AC_CONFIG_MACRO_DIR([m4]) 7 | AM_INIT_AUTOMAKE([tar-ustar foreign]) 8 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 9 | 10 | dnl Various options for configure 11 | AC_ARG_ENABLE([example], 12 | [AS_HELP_STRING([--enable-example], 13 | [enable example encoding program (default is no)])], 14 | [example=$enableval], [example=no]) 15 | 16 | dnl Automake conditionals to set 17 | AM_CONDITIONAL(EXAMPLE, test x$example = xyes) 18 | 19 | dnl Checks for programs. 20 | AC_PROG_CC 21 | AC_PROG_CXX 22 | LT_INIT 23 | 24 | AC_SEARCH_LIBS([sin], [m]) 25 | 26 | dnl soname version to use 27 | dnl goes by ‘current[:revision[:age]]’ with the soname ending up as 28 | dnl current.age.revision 29 | FDK_AAC_VERSION=1:1:0 30 | 31 | AS_IF([test x$enable_shared = xyes], [LIBS_PRIVATE=$LIBS], [LIBS_PUBLIC=$LIBS]) 32 | AC_SUBST(FDK_AAC_VERSION) 33 | AC_SUBST(LIBS_PUBLIC) 34 | AC_SUBST(LIBS_PRIVATE) 35 | 36 | AC_CONFIG_FILES([Makefile 37 | fdk-aac.pc]) 38 | AC_OUTPUT 39 | -------------------------------------------------------------------------------- /documentation/aacDecoder.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/documentation/aacDecoder.pdf -------------------------------------------------------------------------------- /documentation/aacEncoder.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/documentation/aacEncoder.pdf -------------------------------------------------------------------------------- /fdk-aac.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: Fraunhofer FDK AAC Codec Library 7 | Description: AAC codec library 8 | Version: @PACKAGE_VERSION@ 9 | Libs: -L${libdir} -lfdk-aac @LIBS_PUBLIC@ 10 | Libs.private: @LIBS_PRIVATE@ 11 | Cflags: -I${includedir} 12 | -------------------------------------------------------------------------------- /fdk-aac.sym: -------------------------------------------------------------------------------- 1 | aacDecoder_AncDataGet 2 | aacDecoder_AncDataInit 3 | aacDecoder_Close 4 | aacDecoder_ConfigRaw 5 | aacDecoder_DecodeFrame 6 | aacDecoder_Fill 7 | aacDecoder_GetFreeBytes 8 | aacDecoder_GetLibInfo 9 | aacDecoder_GetStreamInfo 10 | aacDecoder_Open 11 | aacDecoder_SetParam 12 | aacEncClose 13 | aacEncEncode 14 | aacEncGetLibInfo 15 | aacEncInfo 16 | aacEncOpen 17 | aacEncoder_GetParam 18 | aacEncoder_SetParam 19 | -------------------------------------------------------------------------------- /libAACdec/include/aacdecoder_lib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/include/aacdecoder_lib.h -------------------------------------------------------------------------------- /libAACdec/src/aac_ram.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aac_ram.cpp -------------------------------------------------------------------------------- /libAACdec/src/aac_ram.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aac_ram.h -------------------------------------------------------------------------------- /libAACdec/src/aac_rom.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aac_rom.cpp -------------------------------------------------------------------------------- /libAACdec/src/aac_rom.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aac_rom.h -------------------------------------------------------------------------------- /libAACdec/src/aacdec_drc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_drc.h -------------------------------------------------------------------------------- /libAACdec/src/aacdec_drc_types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_drc_types.h -------------------------------------------------------------------------------- /libAACdec/src/aacdec_hcr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_hcr.cpp -------------------------------------------------------------------------------- /libAACdec/src/aacdec_hcr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_hcr.h -------------------------------------------------------------------------------- /libAACdec/src/aacdec_hcr_bit.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_hcr_bit.cpp -------------------------------------------------------------------------------- /libAACdec/src/aacdec_hcr_bit.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_hcr_bit.h -------------------------------------------------------------------------------- /libAACdec/src/aacdec_hcr_types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_hcr_types.h -------------------------------------------------------------------------------- /libAACdec/src/aacdec_hcrs.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_hcrs.cpp -------------------------------------------------------------------------------- /libAACdec/src/aacdec_hcrs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_hcrs.h -------------------------------------------------------------------------------- /libAACdec/src/aacdec_pns.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_pns.cpp -------------------------------------------------------------------------------- /libAACdec/src/aacdec_pns.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_pns.h -------------------------------------------------------------------------------- /libAACdec/src/aacdec_tns.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_tns.cpp -------------------------------------------------------------------------------- /libAACdec/src/aacdec_tns.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdec_tns.h -------------------------------------------------------------------------------- /libAACdec/src/aacdecoder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdecoder.cpp -------------------------------------------------------------------------------- /libAACdec/src/aacdecoder.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdecoder.h -------------------------------------------------------------------------------- /libAACdec/src/aacdecoder_lib.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/aacdecoder_lib.cpp -------------------------------------------------------------------------------- /libAACdec/src/arm/block_arm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/arm/block_arm.cpp -------------------------------------------------------------------------------- /libAACdec/src/block.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/block.cpp -------------------------------------------------------------------------------- /libAACdec/src/block.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/block.h -------------------------------------------------------------------------------- /libAACdec/src/channel.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/channel.cpp -------------------------------------------------------------------------------- /libAACdec/src/channel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/channel.h -------------------------------------------------------------------------------- /libAACdec/src/channelinfo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/channelinfo.cpp -------------------------------------------------------------------------------- /libAACdec/src/channelinfo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/channelinfo.h -------------------------------------------------------------------------------- /libAACdec/src/conceal.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/conceal.cpp -------------------------------------------------------------------------------- /libAACdec/src/conceal.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/conceal.h -------------------------------------------------------------------------------- /libAACdec/src/conceal_types.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/conceal_types.h -------------------------------------------------------------------------------- /libAACdec/src/debug.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/debug.h -------------------------------------------------------------------------------- /libAACdec/src/ldfiltbank.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/ldfiltbank.cpp -------------------------------------------------------------------------------- /libAACdec/src/ldfiltbank.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/ldfiltbank.h -------------------------------------------------------------------------------- /libAACdec/src/overlapadd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/overlapadd.h -------------------------------------------------------------------------------- /libAACdec/src/pulsedata.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/pulsedata.cpp -------------------------------------------------------------------------------- /libAACdec/src/pulsedata.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/pulsedata.h -------------------------------------------------------------------------------- /libAACdec/src/rvlc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/rvlc.cpp -------------------------------------------------------------------------------- /libAACdec/src/rvlc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/rvlc.h -------------------------------------------------------------------------------- /libAACdec/src/rvlc_info.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/rvlc_info.h -------------------------------------------------------------------------------- /libAACdec/src/rvlcbit.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/rvlcbit.cpp -------------------------------------------------------------------------------- /libAACdec/src/rvlcbit.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/rvlcbit.h -------------------------------------------------------------------------------- /libAACdec/src/rvlcconceal.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/rvlcconceal.cpp -------------------------------------------------------------------------------- /libAACdec/src/rvlcconceal.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/rvlcconceal.h -------------------------------------------------------------------------------- /libAACdec/src/stereo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/stereo.cpp -------------------------------------------------------------------------------- /libAACdec/src/stereo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACdec/src/stereo.h -------------------------------------------------------------------------------- /libAACenc/include/aacenc_lib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/include/aacenc_lib.h -------------------------------------------------------------------------------- /libAACenc/src/aacEnc_ram.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/aacEnc_ram.cpp -------------------------------------------------------------------------------- /libAACenc/src/aacEnc_ram.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/aacEnc_ram.h -------------------------------------------------------------------------------- /libAACenc/src/aacEnc_rom.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/aacEnc_rom.cpp -------------------------------------------------------------------------------- /libAACenc/src/aacEnc_rom.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/aacEnc_rom.h -------------------------------------------------------------------------------- /libAACenc/src/aacenc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/aacenc.cpp -------------------------------------------------------------------------------- /libAACenc/src/aacenc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/aacenc.h -------------------------------------------------------------------------------- /libAACenc/src/aacenc_lib.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/aacenc_lib.cpp -------------------------------------------------------------------------------- /libAACenc/src/aacenc_pns.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/aacenc_pns.cpp -------------------------------------------------------------------------------- /libAACenc/src/aacenc_pns.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/aacenc_pns.h -------------------------------------------------------------------------------- /libAACenc/src/aacenc_tns.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/aacenc_tns.cpp -------------------------------------------------------------------------------- /libAACenc/src/aacenc_tns.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/aacenc_tns.h -------------------------------------------------------------------------------- /libAACenc/src/adj_thr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/adj_thr.cpp -------------------------------------------------------------------------------- /libAACenc/src/adj_thr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/adj_thr.h -------------------------------------------------------------------------------- /libAACenc/src/adj_thr_data.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/adj_thr_data.h -------------------------------------------------------------------------------- /libAACenc/src/band_nrg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/band_nrg.cpp -------------------------------------------------------------------------------- /libAACenc/src/band_nrg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/band_nrg.h -------------------------------------------------------------------------------- /libAACenc/src/bandwidth.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/bandwidth.cpp -------------------------------------------------------------------------------- /libAACenc/src/bandwidth.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/bandwidth.h -------------------------------------------------------------------------------- /libAACenc/src/bit_cnt.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/bit_cnt.cpp -------------------------------------------------------------------------------- /libAACenc/src/bit_cnt.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/bit_cnt.h -------------------------------------------------------------------------------- /libAACenc/src/bitenc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/bitenc.cpp -------------------------------------------------------------------------------- /libAACenc/src/bitenc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/bitenc.h -------------------------------------------------------------------------------- /libAACenc/src/block_switch.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/block_switch.cpp -------------------------------------------------------------------------------- /libAACenc/src/block_switch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/block_switch.h -------------------------------------------------------------------------------- /libAACenc/src/channel_map.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/channel_map.cpp -------------------------------------------------------------------------------- /libAACenc/src/channel_map.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/channel_map.h -------------------------------------------------------------------------------- /libAACenc/src/chaosmeasure.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/chaosmeasure.cpp -------------------------------------------------------------------------------- /libAACenc/src/chaosmeasure.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/chaosmeasure.h -------------------------------------------------------------------------------- /libAACenc/src/dyn_bits.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/dyn_bits.cpp -------------------------------------------------------------------------------- /libAACenc/src/dyn_bits.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/dyn_bits.h -------------------------------------------------------------------------------- /libAACenc/src/grp_data.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/grp_data.cpp -------------------------------------------------------------------------------- /libAACenc/src/grp_data.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/grp_data.h -------------------------------------------------------------------------------- /libAACenc/src/intensity.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/intensity.cpp -------------------------------------------------------------------------------- /libAACenc/src/intensity.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/intensity.h -------------------------------------------------------------------------------- /libAACenc/src/interface.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/interface.h -------------------------------------------------------------------------------- /libAACenc/src/line_pe.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/line_pe.cpp -------------------------------------------------------------------------------- /libAACenc/src/line_pe.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/line_pe.h -------------------------------------------------------------------------------- /libAACenc/src/metadata_compressor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/metadata_compressor.cpp -------------------------------------------------------------------------------- /libAACenc/src/metadata_compressor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/metadata_compressor.h -------------------------------------------------------------------------------- /libAACenc/src/metadata_main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/metadata_main.cpp -------------------------------------------------------------------------------- /libAACenc/src/metadata_main.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/metadata_main.h -------------------------------------------------------------------------------- /libAACenc/src/ms_stereo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/ms_stereo.cpp -------------------------------------------------------------------------------- /libAACenc/src/ms_stereo.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/ms_stereo.h -------------------------------------------------------------------------------- /libAACenc/src/noisedet.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/noisedet.cpp -------------------------------------------------------------------------------- /libAACenc/src/noisedet.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/noisedet.h -------------------------------------------------------------------------------- /libAACenc/src/pns_func.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/pns_func.h -------------------------------------------------------------------------------- /libAACenc/src/pnsparam.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/pnsparam.cpp -------------------------------------------------------------------------------- /libAACenc/src/pnsparam.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/pnsparam.h -------------------------------------------------------------------------------- /libAACenc/src/pre_echo_control.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/pre_echo_control.cpp -------------------------------------------------------------------------------- /libAACenc/src/pre_echo_control.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/pre_echo_control.h -------------------------------------------------------------------------------- /libAACenc/src/psy_configuration.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/psy_configuration.cpp -------------------------------------------------------------------------------- /libAACenc/src/psy_configuration.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/psy_configuration.h -------------------------------------------------------------------------------- /libAACenc/src/psy_const.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/psy_const.h -------------------------------------------------------------------------------- /libAACenc/src/psy_data.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/psy_data.h -------------------------------------------------------------------------------- /libAACenc/src/psy_main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/psy_main.cpp -------------------------------------------------------------------------------- /libAACenc/src/psy_main.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/psy_main.h -------------------------------------------------------------------------------- /libAACenc/src/qc_data.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/qc_data.h -------------------------------------------------------------------------------- /libAACenc/src/qc_main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/qc_main.cpp -------------------------------------------------------------------------------- /libAACenc/src/qc_main.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/qc_main.h -------------------------------------------------------------------------------- /libAACenc/src/quantize.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/quantize.cpp -------------------------------------------------------------------------------- /libAACenc/src/quantize.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/quantize.h -------------------------------------------------------------------------------- /libAACenc/src/sf_estim.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/sf_estim.cpp -------------------------------------------------------------------------------- /libAACenc/src/sf_estim.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/sf_estim.h -------------------------------------------------------------------------------- /libAACenc/src/spreading.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/spreading.cpp -------------------------------------------------------------------------------- /libAACenc/src/spreading.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/spreading.h -------------------------------------------------------------------------------- /libAACenc/src/tns_func.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/tns_func.h -------------------------------------------------------------------------------- /libAACenc/src/tonality.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/tonality.cpp -------------------------------------------------------------------------------- /libAACenc/src/tonality.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/tonality.h -------------------------------------------------------------------------------- /libAACenc/src/transform.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/transform.cpp -------------------------------------------------------------------------------- /libAACenc/src/transform.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libAACenc/src/transform.h -------------------------------------------------------------------------------- /libFDK/include/FDK_archdef.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/FDK_archdef.h -------------------------------------------------------------------------------- /libFDK/include/FDK_bitbuffer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/FDK_bitbuffer.h -------------------------------------------------------------------------------- /libFDK/include/FDK_bitstream.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/FDK_bitstream.h -------------------------------------------------------------------------------- /libFDK/include/FDK_core.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/FDK_core.h -------------------------------------------------------------------------------- /libFDK/include/FDK_crc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/FDK_crc.h -------------------------------------------------------------------------------- /libFDK/include/FDK_hybrid.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/FDK_hybrid.h -------------------------------------------------------------------------------- /libFDK/include/FDK_tools_rom.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/FDK_tools_rom.h -------------------------------------------------------------------------------- /libFDK/include/FDK_trigFcts.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/FDK_trigFcts.h -------------------------------------------------------------------------------- /libFDK/include/aarch64/clz_aarch64.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/aarch64/clz_aarch64.h -------------------------------------------------------------------------------- /libFDK/include/aarch64/fixmul_aarch64.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/aarch64/fixmul_aarch64.h -------------------------------------------------------------------------------- /libFDK/include/abs.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/abs.h -------------------------------------------------------------------------------- /libFDK/include/arm/clz_arm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/arm/clz_arm.h -------------------------------------------------------------------------------- /libFDK/include/arm/cplx_mul.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/arm/cplx_mul.h -------------------------------------------------------------------------------- /libFDK/include/arm/fixmadd_arm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/arm/fixmadd_arm.h -------------------------------------------------------------------------------- /libFDK/include/arm/fixmul_arm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/arm/fixmul_arm.h -------------------------------------------------------------------------------- /libFDK/include/arm/scale.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/arm/scale.h -------------------------------------------------------------------------------- /libFDK/include/arm/scramble.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/arm/scramble.h -------------------------------------------------------------------------------- /libFDK/include/autocorr2nd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/autocorr2nd.h -------------------------------------------------------------------------------- /libFDK/include/clz.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/clz.h -------------------------------------------------------------------------------- /libFDK/include/common_fix.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/common_fix.h -------------------------------------------------------------------------------- /libFDK/include/cplx_mul.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/cplx_mul.h -------------------------------------------------------------------------------- /libFDK/include/dct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/dct.h -------------------------------------------------------------------------------- /libFDK/include/fft.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/fft.h -------------------------------------------------------------------------------- /libFDK/include/fft_rad2.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/fft_rad2.h -------------------------------------------------------------------------------- /libFDK/include/fixmadd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/fixmadd.h -------------------------------------------------------------------------------- /libFDK/include/fixminmax.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/fixminmax.h -------------------------------------------------------------------------------- /libFDK/include/fixmul.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/fixmul.h -------------------------------------------------------------------------------- /libFDK/include/fixpoint_math.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/fixpoint_math.h -------------------------------------------------------------------------------- /libFDK/include/mdct.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/mdct.h -------------------------------------------------------------------------------- /libFDK/include/mips/abs_mips.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/mips/abs_mips.h -------------------------------------------------------------------------------- /libFDK/include/mips/clz_mips.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/mips/clz_mips.h -------------------------------------------------------------------------------- /libFDK/include/mips/cplx_mul.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/mips/cplx_mul.h -------------------------------------------------------------------------------- /libFDK/include/mips/fixmadd_mips.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/mips/fixmadd_mips.h -------------------------------------------------------------------------------- /libFDK/include/mips/fixmul_mips.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/mips/fixmul_mips.h -------------------------------------------------------------------------------- /libFDK/include/mips/scale.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/mips/scale.h -------------------------------------------------------------------------------- /libFDK/include/mips/scramble.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/mips/scramble.h -------------------------------------------------------------------------------- /libFDK/include/ppc/clz_ppc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/ppc/clz_ppc.h -------------------------------------------------------------------------------- /libFDK/include/ppc/fixmul_ppc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/ppc/fixmul_ppc.h -------------------------------------------------------------------------------- /libFDK/include/qmf.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/qmf.h -------------------------------------------------------------------------------- /libFDK/include/scale.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/scale.h -------------------------------------------------------------------------------- /libFDK/include/scramble.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/scramble.h -------------------------------------------------------------------------------- /libFDK/include/x86/abs_x86.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/x86/abs_x86.h -------------------------------------------------------------------------------- /libFDK/include/x86/clz_x86.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/x86/clz_x86.h -------------------------------------------------------------------------------- /libFDK/include/x86/fixmul_x86.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/include/x86/fixmul_x86.h -------------------------------------------------------------------------------- /libFDK/src/FDK_bitbuffer.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/FDK_bitbuffer.cpp -------------------------------------------------------------------------------- /libFDK/src/FDK_core.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/FDK_core.cpp -------------------------------------------------------------------------------- /libFDK/src/FDK_crc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/FDK_crc.cpp -------------------------------------------------------------------------------- /libFDK/src/FDK_hybrid.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/FDK_hybrid.cpp -------------------------------------------------------------------------------- /libFDK/src/FDK_tools_rom.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/FDK_tools_rom.cpp -------------------------------------------------------------------------------- /libFDK/src/FDK_trigFcts.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/FDK_trigFcts.cpp -------------------------------------------------------------------------------- /libFDK/src/arm/autocorr2nd.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/arm/autocorr2nd.cpp -------------------------------------------------------------------------------- /libFDK/src/arm/dct_arm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/arm/dct_arm.cpp -------------------------------------------------------------------------------- /libFDK/src/arm/fft_rad2_arm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/arm/fft_rad2_arm.cpp -------------------------------------------------------------------------------- /libFDK/src/arm/qmf_arm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/arm/qmf_arm.cpp -------------------------------------------------------------------------------- /libFDK/src/arm/scale_arm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/arm/scale_arm.cpp -------------------------------------------------------------------------------- /libFDK/src/autocorr2nd.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/autocorr2nd.cpp -------------------------------------------------------------------------------- /libFDK/src/dct.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/dct.cpp -------------------------------------------------------------------------------- /libFDK/src/fft.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/fft.cpp -------------------------------------------------------------------------------- /libFDK/src/fft_rad2.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/fft_rad2.cpp -------------------------------------------------------------------------------- /libFDK/src/fixpoint_math.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/fixpoint_math.cpp -------------------------------------------------------------------------------- /libFDK/src/mdct.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/mdct.cpp -------------------------------------------------------------------------------- /libFDK/src/mips/fft_rad2_mips.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/mips/fft_rad2_mips.cpp -------------------------------------------------------------------------------- /libFDK/src/mips/mips_fft_twiddles.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/mips/mips_fft_twiddles.cpp -------------------------------------------------------------------------------- /libFDK/src/mips/scale.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/mips/scale.cpp -------------------------------------------------------------------------------- /libFDK/src/qmf.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/qmf.cpp -------------------------------------------------------------------------------- /libFDK/src/scale.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libFDK/src/scale.cpp -------------------------------------------------------------------------------- /libMpegTPDec/include/mpegFileRead.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/include/mpegFileRead.h -------------------------------------------------------------------------------- /libMpegTPDec/include/tp_data.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/include/tp_data.h -------------------------------------------------------------------------------- /libMpegTPDec/include/tpdec_lib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/include/tpdec_lib.h -------------------------------------------------------------------------------- /libMpegTPDec/src/mpegFileFormat.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/src/mpegFileFormat.h -------------------------------------------------------------------------------- /libMpegTPDec/src/tpdec_adif.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/src/tpdec_adif.cpp -------------------------------------------------------------------------------- /libMpegTPDec/src/tpdec_adif.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/src/tpdec_adif.h -------------------------------------------------------------------------------- /libMpegTPDec/src/tpdec_adts.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/src/tpdec_adts.cpp -------------------------------------------------------------------------------- /libMpegTPDec/src/tpdec_adts.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/src/tpdec_adts.h -------------------------------------------------------------------------------- /libMpegTPDec/src/tpdec_asc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/src/tpdec_asc.cpp -------------------------------------------------------------------------------- /libMpegTPDec/src/tpdec_drm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/src/tpdec_drm.cpp -------------------------------------------------------------------------------- /libMpegTPDec/src/tpdec_drm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/src/tpdec_drm.h -------------------------------------------------------------------------------- /libMpegTPDec/src/tpdec_latm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/src/tpdec_latm.cpp -------------------------------------------------------------------------------- /libMpegTPDec/src/tpdec_latm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/src/tpdec_latm.h -------------------------------------------------------------------------------- /libMpegTPDec/src/tpdec_lib.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPDec/src/tpdec_lib.cpp -------------------------------------------------------------------------------- /libMpegTPDec/src/version: -------------------------------------------------------------------------------- 1 | 2 | /* library info */ 3 | #define TP_LIB_VL0 2 4 | #define TP_LIB_VL1 3 5 | #define TP_LIB_VL2 7 6 | #define TP_LIB_TITLE "MPEG Transport" 7 | #ifdef __ANDROID__ 8 | #define TP_LIB_BUILD_DATE "" 9 | #define TP_LIB_BUILD_TIME "" 10 | #else 11 | #define TP_LIB_BUILD_DATE __DATE__ 12 | #define TP_LIB_BUILD_TIME __TIME__ 13 | #endif 14 | -------------------------------------------------------------------------------- /libMpegTPEnc/include/mpegFileWrite.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPEnc/include/mpegFileWrite.h -------------------------------------------------------------------------------- /libMpegTPEnc/include/tp_data.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPEnc/include/tp_data.h -------------------------------------------------------------------------------- /libMpegTPEnc/include/tpenc_lib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPEnc/include/tpenc_lib.h -------------------------------------------------------------------------------- /libMpegTPEnc/src/tpenc_adif.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPEnc/src/tpenc_adif.cpp -------------------------------------------------------------------------------- /libMpegTPEnc/src/tpenc_adif.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPEnc/src/tpenc_adif.h -------------------------------------------------------------------------------- /libMpegTPEnc/src/tpenc_adts.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPEnc/src/tpenc_adts.cpp -------------------------------------------------------------------------------- /libMpegTPEnc/src/tpenc_adts.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPEnc/src/tpenc_adts.h -------------------------------------------------------------------------------- /libMpegTPEnc/src/tpenc_asc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPEnc/src/tpenc_asc.cpp -------------------------------------------------------------------------------- /libMpegTPEnc/src/tpenc_asc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPEnc/src/tpenc_asc.h -------------------------------------------------------------------------------- /libMpegTPEnc/src/tpenc_dab.cpp: -------------------------------------------------------------------------------- 1 | 2 | /* ----------------------------------------------------------------------------------------------------------- 3 | Software License for The Fraunhofer FDK AAC Codec Library for Android 4 | 5 | � Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur F�rderung der angewandten Forschung e.V. 6 | All rights reserved. 7 | 8 | 1. INTRODUCTION 9 | The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software that implements 10 | the MPEG Advanced Audio Coding ("AAC") encoding and decoding scheme for digital audio. 11 | This FDK AAC Codec software is intended to be used on a wide variety of Android devices. 12 | 13 | AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient general perceptual 14 | audio codecs. AAC-ELD is considered the best-performing full-bandwidth communications codec by 15 | independent studies and is widely deployed. AAC has been standardized by ISO and IEC as part 16 | of the MPEG specifications. 17 | 18 | Patent licenses for necessary patent claims for the FDK AAC Codec (including those of Fraunhofer) 19 | may be obtained through Via Licensing (www.vialicensing.com) or through the respective patent owners 20 | individually for the purpose of encoding or decoding bit streams in products that are compliant with 21 | the ISO/IEC MPEG audio standards. Please note that most manufacturers of Android devices already license 22 | these patent claims through Via Licensing or directly from the patent owners, and therefore FDK AAC Codec 23 | software may already be covered under those patent licenses when it is used for those licensed purposes only. 24 | 25 | Commercially-licensed AAC software libraries, including floating-point versions with enhanced sound quality, 26 | are also available from Fraunhofer. Users are encouraged to check the Fraunhofer website for additional 27 | applications information and documentation. 28 | 29 | 2. COPYRIGHT LICENSE 30 | 31 | Redistribution and use in source and binary forms, with or without modification, are permitted without 32 | payment of copyright license fees provided that you satisfy the following conditions: 33 | 34 | You must retain the complete text of this software license in redistributions of the FDK AAC Codec or 35 | your modifications thereto in source code form. 36 | 37 | You must retain the complete text of this software license in the documentation and/or other materials 38 | provided with redistributions of the FDK AAC Codec or your modifications thereto in binary form. 39 | You must make available free of charge copies of the complete source code of the FDK AAC Codec and your 40 | modifications thereto to recipients of copies in binary form. 41 | 42 | The name of Fraunhofer may not be used to endorse or promote products derived from this library without 43 | prior written permission. 44 | 45 | You may not charge copyright license fees for anyone to use, copy or distribute the FDK AAC Codec 46 | software or your modifications thereto. 47 | 48 | Your modified versions of the FDK AAC Codec must carry prominent notices stating that you changed the software 49 | and the date of any change. For modified versions of the FDK AAC Codec, the term 50 | "Fraunhofer FDK AAC Codec Library for Android" must be replaced by the term 51 | "Third-Party Modified Version of the Fraunhofer FDK AAC Codec Library for Android." 52 | 53 | 3. NO PATENT LICENSE 54 | 55 | NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without limitation the patents of Fraunhofer, 56 | ARE GRANTED BY THIS SOFTWARE LICENSE. Fraunhofer provides no warranty of patent non-infringement with 57 | respect to this software. 58 | 59 | You may use this FDK AAC Codec software or modifications thereto only for purposes that are authorized 60 | by appropriate patent licenses. 61 | 62 | 4. DISCLAIMER 63 | 64 | This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright holders and contributors 65 | "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, including but not limited to the implied warranties 66 | of merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 67 | CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary, or consequential damages, 68 | including but not limited to procurement of substitute goods or services; loss of use, data, or profits, 69 | or business interruption, however caused and on any theory of liability, whether in contract, strict 70 | liability, or tort (including negligence), arising in any way out of the use of this software, even if 71 | advised of the possibility of such damage. 72 | 73 | 5. CONTACT INFORMATION 74 | 75 | Fraunhofer Institute for Integrated Circuits IIS 76 | Attention: Audio and Multimedia Departments - FDK AAC LL 77 | Am Wolfsmantel 33 78 | 91058 Erlangen, Germany 79 | 80 | www.iis.fraunhofer.de/amm 81 | amm-info@iis.fraunhofer.de 82 | ----------------------------------------------------------------------------------------------------------- */ 83 | 84 | /******************************** MPEG Audio Encoder ************************** 85 | 86 | Initial author: serge 87 | contents/description: DAB Transport Headers support 88 | 89 | ******************************************************************************/ 90 | #include 91 | #include "FDK_audio.h" 92 | #include "tpenc_dab.h" 93 | 94 | 95 | #include "tpenc_lib.h" 96 | #include "tpenc_asc.h" 97 | 98 | #include "common_fix.h" 99 | 100 | int dabWrite_CrcStartReg( 101 | HANDLE_DAB pDab, /*!< pointer to dab stucture */ 102 | HANDLE_FDK_BITSTREAM hBs, /*!< handle to current bit buffer structure */ 103 | int mBits /*!< number of bits in crc region */ 104 | ) 105 | { 106 | //fprintf(stderr, "dabWrite_CrcStartReg(%p): bits in crc region=%d\n", hBs, mBits); 107 | return ( FDKcrcStartReg(&pDab->crcInfo2, hBs, mBits) ); 108 | } 109 | 110 | void dabWrite_CrcEndReg( 111 | HANDLE_DAB pDab, /*!< pointer to dab crc info stucture */ 112 | HANDLE_FDK_BITSTREAM hBs, /*!< handle to current bit buffer structure */ 113 | int reg /*!< crc region */ 114 | ) 115 | { 116 | //fprintf(stderr, "dabWrite_CrcEndReg(%p): crc region=%d\n", hBs, reg); 117 | FDKcrcEndReg(&pDab->crcInfo2, hBs, reg); 118 | } 119 | 120 | int dabWrite_GetHeaderBits( HANDLE_DAB hDab ) 121 | { 122 | int bits = 0; 123 | 124 | if (hDab->currentBlock == 0) { 125 | /* Static and variable header bits */ 126 | bits += 16; //header_firecode 16 127 | bits += 8; //rfa=1, dac_rate=1, sbr_flag=1, aac_channel_mode=1, ps_flag=1, mpeg_surround_config=3 128 | bits += 12 * hDab->num_raw_blocks; //au_start[1...num_aus] 12 bit AU start position markers 129 | 130 | //4 byte alignment 131 | if (hDab->dac_rate == 0 || hDab->sbr_flag == 0) 132 | bits+=4; 133 | //16sbr => 16 + 5 + 3 + 12*(2-1) => 36 => 40 bits 5 134 | //24sbr => 16 + 5 + 3 + 12*(3-1) => 48 ok 6 135 | //32sbr => 16 + 5 + 3 + 12*(4-1) => 60 => 64 bits 8 136 | //48sbr => 16 + 5 + 3 + 12*(6-1) => 84 => 88 bits 11 137 | } 138 | 139 | /* Add raw data block CRC bits. Not really part of the header, put they cause bit overhead to be accounted. */ 140 | bits += 16; 141 | 142 | 143 | return bits; 144 | } 145 | 146 | 147 | int dabWrite_CountTotalBitDemandHeader( HANDLE_DAB hDab, unsigned int streamDataLength ) 148 | { 149 | //fprintf(stderr, "streamDataLength=%d (%d bytes)\n", streamDataLength, streamDataLength >> 3); 150 | return dabWrite_GetHeaderBits(hDab); 151 | } 152 | 153 | 154 | INT dabWrite_Init(HANDLE_DAB hDab, CODER_CONFIG *config) 155 | { 156 | /* Sanity checks */ 157 | if((int)config->aot > 4 158 | || (int)config->aot < 1 ) { 159 | return -1; 160 | } 161 | 162 | /* Sanity checks DAB-specific */ 163 | if ( !(config->nSubFrames == 2 && config->samplingRate == 16000 && (config->flags & CC_SBR)) && 164 | !(config->nSubFrames == 3 && config->samplingRate == 24000 && (config->flags & CC_SBR)) && 165 | !(config->nSubFrames == 4 && config->samplingRate == 32000) && 166 | !(config->nSubFrames == 6 && config->samplingRate == 48000)) { 167 | return -1; 168 | } 169 | 170 | hDab->dac_rate = 0; 171 | hDab->aac_channel_mode=0; 172 | hDab->sbr_flag = 0; 173 | hDab->ps_flag = 0; 174 | hDab->mpeg_surround_config=0; 175 | hDab->subchannels_num=config->bitRate/8000; 176 | 177 | 178 | if(config->samplingRate == 24000 || config->samplingRate == 48000) 179 | hDab->dac_rate = 1; 180 | 181 | if (config->extAOT==AOT_SBR || config->extAOT == AOT_PS) 182 | hDab->sbr_flag = 1; 183 | 184 | if(config->extAOT == AOT_PS) 185 | hDab->ps_flag = 1; 186 | 187 | 188 | if(config->channelMode == MODE_2) 189 | hDab->aac_channel_mode = 1; 190 | 191 | //fprintf(stderr, "hDab->dac_rate=%d\n", hDab->dac_rate); 192 | //fprintf(stderr, "hDab->sbr_flag=%d\n", hDab->sbr_flag); 193 | //fprintf(stderr, "hDab->ps_flag=%d\n", hDab->ps_flag); 194 | //fprintf(stderr, "hDab->aac_channel_mode=%d\n", hDab->aac_channel_mode); 195 | //fprintf(stderr, "hDab->subchannels_num=%d\n", hDab->subchannels_num); 196 | //fprintf(stderr, "cc->nSubFrames=%d\n", config->nSubFrames); 197 | 198 | hDab->num_raw_blocks=config->nSubFrames-1; /* 0 means 1 raw data block */ 199 | 200 | FDKcrcInit(&hDab->crcInfo, 0x1021, 0xFFFF, 16); 201 | FDKcrcInit(&hDab->crcFire, 0x782d, 0, 16); 202 | FDKcrcInit(&hDab->crcInfo2, 0x8005, 0xFFFF, 16); 203 | 204 | hDab->currentBlock = 0; 205 | hDab->headerBits = dabWrite_GetHeaderBits(hDab); 206 | 207 | return 0; 208 | } 209 | 210 | int dabWrite_EncodeHeader(HANDLE_DAB hDab, 211 | HANDLE_FDK_BITSTREAM hBitStream, 212 | int buffer_fullness, 213 | int frame_length) 214 | { 215 | INT crcIndex = 0; 216 | 217 | 218 | FDK_ASSERT(((frame_length+hDab->headerBits)/8)<0x2000); /*13 bit*/ 219 | FDK_ASSERT(buffer_fullness<0x800); /* 11 bit */ 220 | 221 | FDKcrcReset(&hDab->crcInfo); 222 | 223 | 224 | // fprintf(stderr, "dabWrite_EncodeHeader() hDab->currentBlock=%d, frame_length=%d, buffer_fullness=%d\n", 225 | // hDab->currentBlock, frame_length, buffer_fullness); 226 | 227 | // if (hDab->currentBlock == 0) { 228 | // //hDab->subFrameStartPrev=dabWrite_GetHeaderBits(hDab); 229 | // fprintf(stderr, "header bits[%d] [%d]\n", hDab->subFrameStartPrev, hDab->subFrameStartPrev >> 3); 230 | // FDKresetBitbuffer(hBitStream, BS_WRITER); 231 | // } 232 | 233 | //hDab->subFrameStartBit = FDKgetValidBits(hBitStream); 234 | // fprintf(stderr, "dabWrite_EncodeHeader() hDab->subFrameStartBit=%d [%d]\n", hDab->subFrameStartBit, hDab->subFrameStartBit >> 3); 235 | 236 | //hDab->subFrameStartBit = FDKgetValidBits(hBitStream); 237 | /* Skip new header if this is raw data block 1..n */ 238 | if (hDab->currentBlock == 0) 239 | { 240 | FDKresetBitbuffer(hBitStream, BS_WRITER); 241 | // fprintf(stderr, "dabWrite_EncodeHeader() after FDKresetBitbuffer=%d [%d]\n", FDKgetValidBits(hBitStream), FDKgetValidBits(hBitStream) >> 3); 242 | 243 | /* fixed header */ 244 | FDKwriteBits(hBitStream, 0, 16); //header_firecode 245 | FDKwriteBits(hBitStream, 0, 1); //rfa 246 | FDKwriteBits(hBitStream, hDab->dac_rate, 1); 247 | FDKwriteBits(hBitStream, hDab->sbr_flag, 1); 248 | FDKwriteBits(hBitStream, hDab->aac_channel_mode, 1); 249 | FDKwriteBits(hBitStream, hDab->ps_flag, 1); 250 | FDKwriteBits(hBitStream, hDab->mpeg_surround_config, 3); 251 | /* variable header */ 252 | int i; 253 | for(i=0; inum_raw_blocks; i++) 254 | FDKwriteBits(hBitStream, 0, 12); 255 | /* padding */ 256 | if (hDab->dac_rate == 0 || hDab->sbr_flag == 0) { 257 | FDKwriteBits(hBitStream, 0, 4); 258 | } 259 | } /* End of DAB header */ 260 | 261 | hDab->subFrameStartBit = FDKgetValidBits(hBitStream); 262 | FDK_ASSERT(FDKgetValidBits(hBitStream) % 8 == 0); //only aligned header 263 | 264 | // fprintf(stderr, "dabWrite_EncodeHeader() FDKgetValidBits(hBitStream)=%d [%d]\n", FDKgetValidBits(hBitStream), FDKgetValidBits(hBitStream) >> 3); 265 | return 0; 266 | } 267 | 268 | int dabWrite_writeExtensionFillPayload(HANDLE_FDK_BITSTREAM hBitStream, int extPayloadBits) 269 | { 270 | #define EXT_TYPE_BITS ( 4 ) 271 | #define DATA_EL_VERSION_BITS ( 4 ) 272 | #define FILL_NIBBLE_BITS ( 4 ) 273 | 274 | #define EXT_TYPE_BITS ( 4 ) 275 | #define DATA_EL_VERSION_BITS ( 4 ) 276 | #define FILL_NIBBLE_BITS ( 4 ) 277 | 278 | INT extBitsUsed = 0; 279 | INT extPayloadType = EXT_FIL; 280 | //fprintf(stderr, "FDKaacEnc_writeExtensionPayload() extPayloadType=%d\n", extPayloadType); 281 | if (extPayloadBits >= EXT_TYPE_BITS) 282 | { 283 | UCHAR fillByte = 0x00; /* for EXT_FIL and EXT_FILL_DATA */ 284 | 285 | if (hBitStream != NULL) { 286 | FDKwriteBits(hBitStream, extPayloadType, EXT_TYPE_BITS); 287 | } 288 | extBitsUsed += EXT_TYPE_BITS; 289 | 290 | switch (extPayloadType) { 291 | case EXT_FILL_DATA: 292 | fillByte = 0xA5; 293 | case EXT_FIL: 294 | default: 295 | if (hBitStream != NULL) { 296 | int writeBits = extPayloadBits; 297 | FDKwriteBits(hBitStream, 0x00, FILL_NIBBLE_BITS); 298 | writeBits -= 8; /* acount for the extension type and the fill nibble */ 299 | while (writeBits >= 8) { 300 | FDKwriteBits(hBitStream, fillByte, 8); 301 | writeBits -= 8; 302 | } 303 | } 304 | extBitsUsed += FILL_NIBBLE_BITS + (extPayloadBits & ~0x7) - 8; 305 | break; 306 | } 307 | } 308 | 309 | return (extBitsUsed); 310 | } 311 | 312 | void dabWrite_FillRawDataBlock(HANDLE_FDK_BITSTREAM hBitStream, int payloadBits) 313 | { 314 | INT extBitsUsed = 0; 315 | #define EL_ID_BITS ( 3 ) 316 | #define FILL_EL_COUNT_BITS ( 4 ) 317 | #define FILL_EL_ESC_COUNT_BITS ( 8 ) 318 | #define MAX_FILL_DATA_BYTES ( 269 ) 319 | while (payloadBits >= (EL_ID_BITS + FILL_EL_COUNT_BITS)) { 320 | INT cnt, esc_count=-1, alignBits=7; 321 | 322 | payloadBits -= EL_ID_BITS + FILL_EL_COUNT_BITS; 323 | if (payloadBits >= 15*8) { 324 | payloadBits -= FILL_EL_ESC_COUNT_BITS; 325 | esc_count = 0; /* write esc_count even if cnt becomes smaller 15 */ 326 | } 327 | alignBits = 0; 328 | 329 | cnt = fixMin(MAX_FILL_DATA_BYTES, (payloadBits+alignBits)>>3); 330 | 331 | if (cnt >= 15) { 332 | esc_count = cnt - 15 + 1; 333 | } 334 | 335 | if (hBitStream != NULL) { 336 | /* write bitstream */ 337 | FDKwriteBits(hBitStream, ID_FIL, EL_ID_BITS); 338 | if (esc_count >= 0) { 339 | FDKwriteBits(hBitStream, 15, FILL_EL_COUNT_BITS); 340 | FDKwriteBits(hBitStream, esc_count, FILL_EL_ESC_COUNT_BITS); 341 | } else { 342 | FDKwriteBits(hBitStream, cnt, FILL_EL_COUNT_BITS); 343 | } 344 | } 345 | 346 | extBitsUsed += EL_ID_BITS + FILL_EL_COUNT_BITS + ((esc_count>=0) ? FILL_EL_ESC_COUNT_BITS : 0); 347 | 348 | cnt = fixMin(cnt*8, payloadBits); /* convert back to bits */ 349 | #if 0 350 | extBitsUsed += FDKaacEnc_writeExtensionPayload( hBitStream, 351 | pExtension->type, 352 | pExtension->pPayload, 353 | cnt ); 354 | #else 355 | extBitsUsed += dabWrite_writeExtensionFillPayload(hBitStream, cnt); 356 | #endif 357 | payloadBits -= cnt; 358 | } 359 | } 360 | 361 | void dabWrite_EndRawDataBlock(HANDLE_DAB hDab, 362 | HANDLE_FDK_BITSTREAM hBs, 363 | int *pBits) 364 | { 365 | FDK_BITSTREAM bsWriter; 366 | INT crcIndex = 0; 367 | USHORT crcData; 368 | INT writeBits=0; 369 | INT writeBitsNonLastBlock=0; 370 | INT writeBitsLastBlock=0; 371 | #if 1 372 | if (hDab->currentBlock == hDab->num_raw_blocks) { 373 | //calculate byte-alignment before writing ID_FIL 374 | if((FDKgetValidBits(hBs)+3) % 8){ 375 | writeBits = 8 - ((FDKgetValidBits(hBs)+3) % 8); 376 | } 377 | 378 | INT offset_end = hDab->subchannels_num*110*8 - 2*8 - 3; 379 | writeBitsLastBlock = offset_end - FDKgetValidBits(hBs); 380 | dabWrite_FillRawDataBlock(hBs, writeBitsLastBlock); 381 | FDKsyncCache(hBs); 382 | //fprintf(stderr, "FIL-element written=%d\n", writeBitsLastBlock); 383 | writeBitsLastBlock=writeBits; 384 | } 385 | #endif 386 | FDKwriteBits(hBs, 7, 3); //finalize AU: ID_END 387 | FDKsyncCache(hBs); 388 | //byte-align (if ID_FIL doesn't align it). 389 | if(FDKgetValidBits(hBs) % 8){ 390 | writeBits = 8 - (FDKgetValidBits(hBs) % 8); 391 | FDKwriteBits(hBs, 0x00, writeBits); 392 | FDKsyncCache(hBs); 393 | } 394 | 395 | //fake-written bits alignment for last AU 396 | if (hDab->currentBlock == hDab->num_raw_blocks) 397 | writeBits=writeBitsLastBlock; 398 | 399 | INT frameLen = (FDKgetValidBits(hBs) - hDab->subFrameStartBit) >> 3; 400 | //fprintf(stderr, "frame=%d, offset writeBits=%d\n", frameLen, writeBits); 401 | 402 | FDK_ASSERT(FDKgetValidBits(hBs) % 8 == 0); //only aligned au's 403 | FDK_ASSERT(hDab->subchannels_num*110*8 >= FDKgetValidBits(hBs)+2*8); //don't overlap superframe 404 | 405 | FDKinitBitStream(&bsWriter, hBs->hBitBuf.Buffer, hBs->hBitBuf.bufSize, 0, BS_WRITER); 406 | FDKpushFor(&bsWriter, hDab->subFrameStartBit); 407 | FDKcrcReset(&hDab->crcInfo); 408 | hDab->crcIndex = FDKcrcStartReg(&hDab->crcInfo, &bsWriter, 0); 409 | #if 0 410 | if (hDab->currentBlock == hDab->num_raw_blocks) { 411 | INT offset_size = hDab->subchannels_num*110*8 - 2*8 - FDKgetValidBits(hBs); 412 | //fprintf(stderr, "offset_size=%d\n", offset_size >> 3); 413 | FDKpushFor(hBs, offset_size); 414 | } 415 | #endif 416 | 417 | FDKpushFor(&bsWriter, FDKgetValidBits(hBs) - hDab->subFrameStartBit); 418 | FDKcrcEndReg(&hDab->crcInfo, &bsWriter, hDab->crcIndex); 419 | crcData = FDKcrcGetCRC(&hDab->crcInfo); 420 | //fprintf(stderr, "crcData = %04x\n", crcData); 421 | /* Write inverted CRC of current raw data block */ 422 | FDKwriteBits(hBs, crcData ^ 0xffff, 16); 423 | FDKsyncCache(hBs); 424 | 425 | 426 | /* Write distance to current data block */ 427 | if(hDab->currentBlock) { 428 | FDKinitBitStream(&bsWriter, hBs->hBitBuf.Buffer, hBs->hBitBuf.bufSize, 0, BS_WRITER); 429 | FDKpushFor(&bsWriter, 24 + (hDab->currentBlock-1)*12); 430 | //fprintf(stderr, "FDKwriteBits() = %d\n", hDab->subFrameStartBit>>3); 431 | FDKwriteBits(&bsWriter, (hDab->subFrameStartBit>>3), 12); 432 | FDKsyncCache(&bsWriter); 433 | } 434 | 435 | /* Write FireCode */ 436 | if (hDab->currentBlock == hDab->num_raw_blocks) { 437 | FDKinitBitStream(&bsWriter, hBs->hBitBuf.Buffer, hBs->hBitBuf.bufSize, 0, BS_WRITER); 438 | FDKpushFor(&bsWriter, 16); 439 | 440 | FDKcrcReset(&hDab->crcFire); 441 | crcIndex = FDKcrcStartReg(&hDab->crcFire, &bsWriter, 72); 442 | FDKpushFor(&bsWriter, 9*8); //9bytes 443 | FDKcrcEndReg(&hDab->crcFire, &bsWriter, crcIndex); 444 | 445 | crcData = FDKcrcGetCRC(&hDab->crcFire); 446 | //fprintf(stderr, "Firecode: %04x\n", crcData); 447 | 448 | FDKinitBitStream(&bsWriter, hBs->hBitBuf.Buffer, hBs->hBitBuf.bufSize, 0, BS_WRITER); 449 | FDKwriteBits(&bsWriter, crcData, 16); 450 | FDKsyncCache(&bsWriter); 451 | } 452 | 453 | if (hDab->currentBlock == 0) 454 | *pBits += hDab->headerBits; 455 | else 456 | *pBits += 16; 457 | 458 | *pBits += writeBits + 3; //size: ID_END + alignment 459 | 460 | /* Correct *pBits to reflect the amount of bits of the current subframe */ 461 | *pBits -= hDab->subFrameStartBit; 462 | /* Fixup CRC bits, since they come after each raw data block */ 463 | 464 | hDab->currentBlock++; 465 | //fprintf(stderr, "dabWrite_EndRawDataBlock() *pBits=%d (%d)\n", *pBits, *pBits >> 3); 466 | } 467 | 468 | -------------------------------------------------------------------------------- /libMpegTPEnc/src/tpenc_dab.h: -------------------------------------------------------------------------------- 1 | 2 | /* ----------------------------------------------------------------------------------------------------------- 3 | Software License for The Fraunhofer FDK AAC Codec Library for Android 4 | 5 | � Copyright 1995 - 2012 Fraunhofer-Gesellschaft zur F�rderung der angewandten Forschung e.V. 6 | All rights reserved. 7 | 8 | 1. INTRODUCTION 9 | The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software that implements 10 | the MPEG Advanced Audio Coding ("AAC") encoding and decoding scheme for digital audio. 11 | This FDK AAC Codec software is intended to be used on a wide variety of Android devices. 12 | 13 | AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient general perceptual 14 | audio codecs. AAC-ELD is considered the best-performing full-bandwidth communications codec by 15 | independent studies and is widely deployed. AAC has been standardized by ISO and IEC as part 16 | of the MPEG specifications. 17 | 18 | Patent licenses for necessary patent claims for the FDK AAC Codec (including those of Fraunhofer) 19 | may be obtained through Via Licensing (www.vialicensing.com) or through the respective patent owners 20 | individually for the purpose of encoding or decoding bit streams in products that are compliant with 21 | the ISO/IEC MPEG audio standards. Please note that most manufacturers of Android devices already license 22 | these patent claims through Via Licensing or directly from the patent owners, and therefore FDK AAC Codec 23 | software may already be covered under those patent licenses when it is used for those licensed purposes only. 24 | 25 | Commercially-licensed AAC software libraries, including floating-point versions with enhanced sound quality, 26 | are also available from Fraunhofer. Users are encouraged to check the Fraunhofer website for additional 27 | applications information and documentation. 28 | 29 | 2. COPYRIGHT LICENSE 30 | 31 | Redistribution and use in source and binary forms, with or without modification, are permitted without 32 | payment of copyright license fees provided that you satisfy the following conditions: 33 | 34 | You must retain the complete text of this software license in redistributions of the FDK AAC Codec or 35 | your modifications thereto in source code form. 36 | 37 | You must retain the complete text of this software license in the documentation and/or other materials 38 | provided with redistributions of the FDK AAC Codec or your modifications thereto in binary form. 39 | You must make available free of charge copies of the complete source code of the FDK AAC Codec and your 40 | modifications thereto to recipients of copies in binary form. 41 | 42 | The name of Fraunhofer may not be used to endorse or promote products derived from this library without 43 | prior written permission. 44 | 45 | You may not charge copyright license fees for anyone to use, copy or distribute the FDK AAC Codec 46 | software or your modifications thereto. 47 | 48 | Your modified versions of the FDK AAC Codec must carry prominent notices stating that you changed the software 49 | and the date of any change. For modified versions of the FDK AAC Codec, the term 50 | "Fraunhofer FDK AAC Codec Library for Android" must be replaced by the term 51 | "Third-Party Modified Version of the Fraunhofer FDK AAC Codec Library for Android." 52 | 53 | 3. NO PATENT LICENSE 54 | 55 | NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without limitation the patents of Fraunhofer, 56 | ARE GRANTED BY THIS SOFTWARE LICENSE. Fraunhofer provides no warranty of patent non-infringement with 57 | respect to this software. 58 | 59 | You may use this FDK AAC Codec software or modifications thereto only for purposes that are authorized 60 | by appropriate patent licenses. 61 | 62 | 4. DISCLAIMER 63 | 64 | This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright holders and contributors 65 | "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, including but not limited to the implied warranties 66 | of merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 67 | CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary, or consequential damages, 68 | including but not limited to procurement of substitute goods or services; loss of use, data, or profits, 69 | or business interruption, however caused and on any theory of liability, whether in contract, strict 70 | liability, or tort (including negligence), arising in any way out of the use of this software, even if 71 | advised of the possibility of such damage. 72 | 73 | 5. CONTACT INFORMATION 74 | 75 | Fraunhofer Institute for Integrated Circuits IIS 76 | Attention: Audio and Multimedia Departments - FDK AAC LL 77 | Am Wolfsmantel 33 78 | 91058 Erlangen, Germany 79 | 80 | www.iis.fraunhofer.de/amm 81 | amm-info@iis.fraunhofer.de 82 | ----------------------------------------------------------------------------------------------------------- */ 83 | 84 | /******************************** MPEG Audio Encoder ************************** 85 | 86 | Initial author: serge 87 | contents/description: DAB Transport writer 88 | 89 | ******************************************************************************/ 90 | 91 | #ifndef TPENC_DAB_H 92 | #define TPENC_DAB_H 93 | 94 | 95 | 96 | #include "tp_data.h" 97 | 98 | #include "FDK_crc.h" 99 | 100 | typedef struct { 101 | USHORT frame_length; 102 | UCHAR dac_rate; 103 | UCHAR aac_channel_mode; 104 | UCHAR sbr_flag; 105 | UCHAR ps_flag; 106 | UCHAR mpeg_surround_config; 107 | UCHAR num_raw_blocks; 108 | UCHAR BufferFullnesStartFlag; 109 | int subchannels_num; 110 | int headerBits; /*!< Header bit demand for the current raw data block */ 111 | int currentBlock; /*!< Index of current raw data block */ 112 | int subFrameStartBit; /*!< Bit position where the current raw data block begins */ 113 | //int subFrameStartPrev; /*!< Bit position where the previous raw data block begins */ 114 | int crcIndex; 115 | FDK_CRCINFO crcInfo; 116 | FDK_CRCINFO crcFire; 117 | FDK_CRCINFO crcInfo2; 118 | USHORT tab[256]; 119 | } STRUCT_DAB; 120 | 121 | typedef STRUCT_DAB *HANDLE_DAB; 122 | 123 | /** 124 | * \brief Initialize DAB data structure 125 | * 126 | * \param hDab DAB data handle 127 | * \param config a valid CODER_CONFIG struct from where the required 128 | * information for the DAB header is extrated from 129 | * 130 | * \return 0 in case of success. 131 | */ 132 | INT dabWrite_Init( 133 | HANDLE_DAB hDab, 134 | CODER_CONFIG *config 135 | ); 136 | 137 | /** 138 | * \brief Get the total bit overhead caused by DAB 139 | * 140 | * \hDab handle to DAB data 141 | * 142 | * \return Amount of additional bits required for the current raw data block 143 | */ 144 | int dabWrite_GetHeaderBits( HANDLE_DAB hDab ); 145 | int dabWrite_CountTotalBitDemandHeader( HANDLE_DAB hDab, unsigned int streamDataLength ); 146 | 147 | /** 148 | * \brief Write an DAB header into the given bitstream. May not write a header 149 | * in case of multiple raw data blocks. 150 | * 151 | * \param hDab DAB data handle 152 | * \param hBitStream bitstream handle into which the DAB may be written into 153 | * \param buffer_fullness the buffer fullness value for the DAB header 154 | * \param the current raw data block length 155 | * 156 | * \return 0 in case of success. 157 | */ 158 | INT dabWrite_EncodeHeader( 159 | HANDLE_DAB hDab, 160 | HANDLE_FDK_BITSTREAM hBitStream, 161 | int bufferFullness, 162 | int frame_length 163 | ); 164 | /** 165 | * \brief Finish a DAB raw data block 166 | * 167 | * \param hDab DAB data handle 168 | * \param hBs bitstream handle into which the DAB may be written into 169 | * \param pBits a pointer to a integer holding the current bitstream buffer bit count, 170 | * which is corrected to the current raw data block boundary. 171 | * 172 | */ 173 | void dabWrite_EndRawDataBlock( 174 | HANDLE_DAB hDab, 175 | HANDLE_FDK_BITSTREAM hBs, 176 | int *bits 177 | ); 178 | 179 | 180 | /** 181 | * \brief Start CRC region with a maximum number of bits 182 | * If mBits is positive zero padding will be used for CRC calculation, if there 183 | * are less than mBits bits available. 184 | * If mBits is negative no zero padding is done. 185 | * If mBits is zero the memory for the buffer is allocated dynamically, the 186 | * number of bits is not limited. 187 | * 188 | * \param pDab DAB data handle 189 | * \param hBs bitstream handle of which the CRC region ends 190 | * \param mBits limit of number of bits to be considered for the requested CRC region 191 | * 192 | * \return ID for the created region, -1 in case of an error 193 | */ 194 | int dabWrite_CrcStartReg( 195 | HANDLE_DAB pDab, 196 | HANDLE_FDK_BITSTREAM hBs, 197 | int mBits 198 | ); 199 | 200 | /** 201 | * \brief Ends CRC region identified by reg 202 | * 203 | * \param pDab DAB data handle 204 | * \param hBs bitstream handle of which the CRC region ends 205 | * \param reg a CRC region ID returned previously by dabWrite_CrcStartReg() 206 | */ 207 | void dabWrite_CrcEndReg( 208 | HANDLE_DAB pDab, 209 | HANDLE_FDK_BITSTREAM hBs, 210 | int reg 211 | ); 212 | 213 | 214 | 215 | 216 | #endif /* TPENC_DAB_H */ 217 | 218 | -------------------------------------------------------------------------------- /libMpegTPEnc/src/tpenc_latm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPEnc/src/tpenc_latm.cpp -------------------------------------------------------------------------------- /libMpegTPEnc/src/tpenc_latm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPEnc/src/tpenc_latm.h -------------------------------------------------------------------------------- /libMpegTPEnc/src/tpenc_lib.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libMpegTPEnc/src/tpenc_lib.cpp -------------------------------------------------------------------------------- /libMpegTPEnc/src/version: -------------------------------------------------------------------------------- 1 | 2 | /* library info */ 3 | #define TP_LIB_VL0 2 4 | #define TP_LIB_VL1 3 5 | #define TP_LIB_VL2 6 6 | #define TP_LIB_TITLE "MPEG Transport" 7 | #ifdef __ANDROID__ 8 | #define TP_LIB_BUILD_DATE "" 9 | #define TP_LIB_BUILD_TIME "" 10 | #else 11 | #define TP_LIB_BUILD_DATE __DATE__ 12 | #define TP_LIB_BUILD_TIME __TIME__ 13 | #endif 14 | -------------------------------------------------------------------------------- /libPCMutils/include/limiter.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libPCMutils/include/limiter.h -------------------------------------------------------------------------------- /libPCMutils/include/pcmutils_lib.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libPCMutils/include/pcmutils_lib.h -------------------------------------------------------------------------------- /libPCMutils/src/limiter.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libPCMutils/src/limiter.cpp -------------------------------------------------------------------------------- /libPCMutils/src/pcmutils_lib.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libPCMutils/src/pcmutils_lib.cpp -------------------------------------------------------------------------------- /libSBRdec/include/sbrdecoder.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/include/sbrdecoder.h -------------------------------------------------------------------------------- /libSBRdec/src/arm/env_calc_arm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/arm/env_calc_arm.cpp -------------------------------------------------------------------------------- /libSBRdec/src/arm/lpp_tran_arm.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/arm/lpp_tran_arm.cpp -------------------------------------------------------------------------------- /libSBRdec/src/env_calc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/env_calc.cpp -------------------------------------------------------------------------------- /libSBRdec/src/env_calc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/env_calc.h -------------------------------------------------------------------------------- /libSBRdec/src/env_dec.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/env_dec.cpp -------------------------------------------------------------------------------- /libSBRdec/src/env_dec.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/env_dec.h -------------------------------------------------------------------------------- /libSBRdec/src/env_extr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/env_extr.cpp -------------------------------------------------------------------------------- /libSBRdec/src/env_extr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/env_extr.h -------------------------------------------------------------------------------- /libSBRdec/src/huff_dec.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/huff_dec.cpp -------------------------------------------------------------------------------- /libSBRdec/src/huff_dec.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/huff_dec.h -------------------------------------------------------------------------------- /libSBRdec/src/lpp_tran.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/lpp_tran.cpp -------------------------------------------------------------------------------- /libSBRdec/src/lpp_tran.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/lpp_tran.h -------------------------------------------------------------------------------- /libSBRdec/src/psbitdec.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/psbitdec.cpp -------------------------------------------------------------------------------- /libSBRdec/src/psbitdec.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/psbitdec.h -------------------------------------------------------------------------------- /libSBRdec/src/psdec.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/psdec.cpp -------------------------------------------------------------------------------- /libSBRdec/src/psdec.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/psdec.h -------------------------------------------------------------------------------- /libSBRdec/src/psdec_hybrid.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/psdec_hybrid.cpp -------------------------------------------------------------------------------- /libSBRdec/src/psdec_hybrid.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/psdec_hybrid.h -------------------------------------------------------------------------------- /libSBRdec/src/sbr_crc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbr_crc.cpp -------------------------------------------------------------------------------- /libSBRdec/src/sbr_crc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbr_crc.h -------------------------------------------------------------------------------- /libSBRdec/src/sbr_deb.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbr_deb.cpp -------------------------------------------------------------------------------- /libSBRdec/src/sbr_deb.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbr_deb.h -------------------------------------------------------------------------------- /libSBRdec/src/sbr_dec.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbr_dec.cpp -------------------------------------------------------------------------------- /libSBRdec/src/sbr_dec.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbr_dec.h -------------------------------------------------------------------------------- /libSBRdec/src/sbr_ram.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbr_ram.cpp -------------------------------------------------------------------------------- /libSBRdec/src/sbr_ram.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbr_ram.h -------------------------------------------------------------------------------- /libSBRdec/src/sbr_rom.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbr_rom.cpp -------------------------------------------------------------------------------- /libSBRdec/src/sbr_rom.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbr_rom.h -------------------------------------------------------------------------------- /libSBRdec/src/sbr_scale.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbr_scale.h -------------------------------------------------------------------------------- /libSBRdec/src/sbrdec_drc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbrdec_drc.cpp -------------------------------------------------------------------------------- /libSBRdec/src/sbrdec_drc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbrdec_drc.h -------------------------------------------------------------------------------- /libSBRdec/src/sbrdec_freq_sca.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbrdec_freq_sca.cpp -------------------------------------------------------------------------------- /libSBRdec/src/sbrdec_freq_sca.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbrdec_freq_sca.h -------------------------------------------------------------------------------- /libSBRdec/src/sbrdecoder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/sbrdecoder.cpp -------------------------------------------------------------------------------- /libSBRdec/src/transcendent.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRdec/src/transcendent.h -------------------------------------------------------------------------------- /libSBRenc/include/sbr_encoder.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/include/sbr_encoder.h -------------------------------------------------------------------------------- /libSBRenc/src/bit_sbr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/bit_sbr.cpp -------------------------------------------------------------------------------- /libSBRenc/src/bit_sbr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/bit_sbr.h -------------------------------------------------------------------------------- /libSBRenc/src/cmondata.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/cmondata.h -------------------------------------------------------------------------------- /libSBRenc/src/code_env.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/code_env.cpp -------------------------------------------------------------------------------- /libSBRenc/src/code_env.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/code_env.h -------------------------------------------------------------------------------- /libSBRenc/src/env_bit.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/env_bit.cpp -------------------------------------------------------------------------------- /libSBRenc/src/env_bit.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/env_bit.h -------------------------------------------------------------------------------- /libSBRenc/src/env_est.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/env_est.cpp -------------------------------------------------------------------------------- /libSBRenc/src/env_est.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/env_est.h -------------------------------------------------------------------------------- /libSBRenc/src/fram_gen.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/fram_gen.cpp -------------------------------------------------------------------------------- /libSBRenc/src/fram_gen.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/fram_gen.h -------------------------------------------------------------------------------- /libSBRenc/src/invf_est.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/invf_est.cpp -------------------------------------------------------------------------------- /libSBRenc/src/invf_est.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/invf_est.h -------------------------------------------------------------------------------- /libSBRenc/src/mh_det.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/mh_det.cpp -------------------------------------------------------------------------------- /libSBRenc/src/mh_det.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/mh_det.h -------------------------------------------------------------------------------- /libSBRenc/src/nf_est.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/nf_est.cpp -------------------------------------------------------------------------------- /libSBRenc/src/nf_est.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/nf_est.h -------------------------------------------------------------------------------- /libSBRenc/src/ps_bitenc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/ps_bitenc.cpp -------------------------------------------------------------------------------- /libSBRenc/src/ps_bitenc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/ps_bitenc.h -------------------------------------------------------------------------------- /libSBRenc/src/ps_const.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/ps_const.h -------------------------------------------------------------------------------- /libSBRenc/src/ps_encode.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/ps_encode.cpp -------------------------------------------------------------------------------- /libSBRenc/src/ps_encode.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/ps_encode.h -------------------------------------------------------------------------------- /libSBRenc/src/ps_main.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/ps_main.cpp -------------------------------------------------------------------------------- /libSBRenc/src/ps_main.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/ps_main.h -------------------------------------------------------------------------------- /libSBRenc/src/resampler.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/resampler.cpp -------------------------------------------------------------------------------- /libSBRenc/src/resampler.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/resampler.h -------------------------------------------------------------------------------- /libSBRenc/src/sbr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/sbr.h -------------------------------------------------------------------------------- /libSBRenc/src/sbr_def.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/sbr_def.h -------------------------------------------------------------------------------- /libSBRenc/src/sbr_encoder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/sbr_encoder.cpp -------------------------------------------------------------------------------- /libSBRenc/src/sbr_misc.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/sbr_misc.cpp -------------------------------------------------------------------------------- /libSBRenc/src/sbr_misc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/sbr_misc.h -------------------------------------------------------------------------------- /libSBRenc/src/sbr_ram.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/sbr_ram.cpp -------------------------------------------------------------------------------- /libSBRenc/src/sbr_ram.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/sbr_ram.h -------------------------------------------------------------------------------- /libSBRenc/src/sbr_rom.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/sbr_rom.cpp -------------------------------------------------------------------------------- /libSBRenc/src/sbr_rom.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/sbr_rom.h -------------------------------------------------------------------------------- /libSBRenc/src/sbrenc_freq_sca.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/sbrenc_freq_sca.cpp -------------------------------------------------------------------------------- /libSBRenc/src/sbrenc_freq_sca.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/sbrenc_freq_sca.h -------------------------------------------------------------------------------- /libSBRenc/src/ton_corr.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/ton_corr.cpp -------------------------------------------------------------------------------- /libSBRenc/src/ton_corr.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/ton_corr.h -------------------------------------------------------------------------------- /libSBRenc/src/tran_det.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/tran_det.cpp -------------------------------------------------------------------------------- /libSBRenc/src/tran_det.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSBRenc/src/tran_det.h -------------------------------------------------------------------------------- /libSYS/include/FDK_audio.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/include/FDK_audio.h -------------------------------------------------------------------------------- /libSYS/include/audio.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/include/audio.h -------------------------------------------------------------------------------- /libSYS/include/cmdl_parser.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/include/cmdl_parser.h -------------------------------------------------------------------------------- /libSYS/include/conv_string.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/include/conv_string.h -------------------------------------------------------------------------------- /libSYS/include/genericStds.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/include/genericStds.h -------------------------------------------------------------------------------- /libSYS/include/machine_type.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/include/machine_type.h -------------------------------------------------------------------------------- /libSYS/include/wav_file.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/include/wav_file.h -------------------------------------------------------------------------------- /libSYS/src/cmdl_parser.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/src/cmdl_parser.cpp -------------------------------------------------------------------------------- /libSYS/src/conv_string.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/src/conv_string.cpp -------------------------------------------------------------------------------- /libSYS/src/genericStds.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/src/genericStds.cpp -------------------------------------------------------------------------------- /libSYS/src/linux/FDK_stackload_linux.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/src/linux/FDK_stackload_linux.cpp -------------------------------------------------------------------------------- /libSYS/src/linux/audio_linux.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/src/linux/audio_linux.cpp -------------------------------------------------------------------------------- /libSYS/src/linux/coresup_linux.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/src/linux/coresup_linux.cpp -------------------------------------------------------------------------------- /libSYS/src/linux/genericStds_linux.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/src/linux/genericStds_linux.cpp -------------------------------------------------------------------------------- /libSYS/src/linux/uart_linux.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/src/linux/uart_linux.cpp -------------------------------------------------------------------------------- /libSYS/src/mips/genericStds_mips.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/src/mips/genericStds_mips.cpp -------------------------------------------------------------------------------- /libSYS/src/wav_file.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/libSYS/src/wav_file.cpp -------------------------------------------------------------------------------- /m4/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Opendigitalradio/fdk-aac/3eab23670d4d9fb2a8ee01c1be7b4acfc14c1552/m4/.gitkeep -------------------------------------------------------------------------------- /wavreader.c: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 2009 Martin Storsjo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | #include "wavreader.h" 20 | #include 21 | #include 22 | #include 23 | #include 24 | 25 | #define TAG(a, b, c, d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) 26 | 27 | struct wav_reader { 28 | FILE *wav; 29 | uint32_t data_length; 30 | 31 | int format; 32 | int sample_rate; 33 | int bits_per_sample; 34 | int channels; 35 | int byte_rate; 36 | int block_align; 37 | 38 | int streamed; 39 | }; 40 | 41 | static uint32_t read_tag(struct wav_reader* wr) { 42 | uint32_t tag = 0; 43 | tag = (tag << 8) | fgetc(wr->wav); 44 | tag = (tag << 8) | fgetc(wr->wav); 45 | tag = (tag << 8) | fgetc(wr->wav); 46 | tag = (tag << 8) | fgetc(wr->wav); 47 | return tag; 48 | } 49 | 50 | static uint32_t read_int32(struct wav_reader* wr) { 51 | uint32_t value = 0; 52 | value |= fgetc(wr->wav) << 0; 53 | value |= fgetc(wr->wav) << 8; 54 | value |= fgetc(wr->wav) << 16; 55 | value |= fgetc(wr->wav) << 24; 56 | return value; 57 | } 58 | 59 | static uint16_t read_int16(struct wav_reader* wr) { 60 | uint16_t value = 0; 61 | value |= fgetc(wr->wav) << 0; 62 | value |= fgetc(wr->wav) << 8; 63 | return value; 64 | } 65 | 66 | static void skip(FILE *f, int n) { 67 | int i; 68 | for (i = 0; i < n; i++) 69 | fgetc(f); 70 | } 71 | 72 | void* wav_read_open(const char *filename) { 73 | struct wav_reader* wr = (struct wav_reader*) malloc(sizeof(*wr)); 74 | long data_pos = 0; 75 | memset(wr, 0, sizeof(*wr)); 76 | 77 | if (!strcmp(filename, "-")) 78 | wr->wav = stdin; 79 | else 80 | wr->wav = fopen(filename, "rb"); 81 | if (wr->wav == NULL) { 82 | free(wr); 83 | return NULL; 84 | } 85 | 86 | while (1) { 87 | uint32_t tag, tag2, length; 88 | tag = read_tag(wr); 89 | if (feof(wr->wav)) 90 | break; 91 | length = read_int32(wr); 92 | if (!length || length >= 0x7fff0000) { 93 | wr->streamed = 1; 94 | length = ~0; 95 | } 96 | if (tag != TAG('R', 'I', 'F', 'F') || length < 4) { 97 | fseek(wr->wav, length, SEEK_CUR); 98 | continue; 99 | } 100 | tag2 = read_tag(wr); 101 | length -= 4; 102 | if (tag2 != TAG('W', 'A', 'V', 'E')) { 103 | fseek(wr->wav, length, SEEK_CUR); 104 | continue; 105 | } 106 | // RIFF chunk found, iterate through it 107 | while (length >= 8) { 108 | uint32_t subtag, sublength; 109 | subtag = read_tag(wr); 110 | if (feof(wr->wav)) 111 | break; 112 | sublength = read_int32(wr); 113 | length -= 8; 114 | if (length < sublength) 115 | break; 116 | if (subtag == TAG('f', 'm', 't', ' ')) { 117 | if (sublength < 16) { 118 | // Insufficient data for 'fmt ' 119 | break; 120 | } 121 | wr->format = read_int16(wr); 122 | wr->channels = read_int16(wr); 123 | wr->sample_rate = read_int32(wr); 124 | wr->byte_rate = read_int32(wr); 125 | wr->block_align = read_int16(wr); 126 | wr->bits_per_sample = read_int16(wr); 127 | if (wr->format == 0xfffe) { 128 | if (sublength < 28) { 129 | // Insufficient data for waveformatex 130 | break; 131 | } 132 | skip(wr->wav, 8); 133 | wr->format = read_int32(wr); 134 | skip(wr->wav, sublength - 28); 135 | } else { 136 | skip(wr->wav, sublength - 16); 137 | } 138 | } else if (subtag == TAG('d', 'a', 't', 'a')) { 139 | data_pos = ftell(wr->wav); 140 | wr->data_length = sublength; 141 | if (!wr->data_length || wr->streamed) { 142 | wr->streamed = 1; 143 | return wr; 144 | } 145 | fseek(wr->wav, sublength, SEEK_CUR); 146 | } else { 147 | skip(wr->wav, sublength); 148 | } 149 | length -= sublength; 150 | } 151 | if (length > 0) { 152 | // Bad chunk? 153 | fseek(wr->wav, length, SEEK_CUR); 154 | } 155 | } 156 | fseek(wr->wav, data_pos, SEEK_SET); 157 | return wr; 158 | } 159 | 160 | void wav_read_close(void* obj) { 161 | struct wav_reader* wr = (struct wav_reader*) obj; 162 | if (wr->wav != stdin) 163 | fclose(wr->wav); 164 | free(wr); 165 | } 166 | 167 | int wav_get_header(void* obj, int* format, int* channels, int* sample_rate, int* bits_per_sample, unsigned int* data_length) { 168 | struct wav_reader* wr = (struct wav_reader*) obj; 169 | if (format) 170 | *format = wr->format; 171 | if (channels) 172 | *channels = wr->channels; 173 | if (sample_rate) 174 | *sample_rate = wr->sample_rate; 175 | if (bits_per_sample) 176 | *bits_per_sample = wr->bits_per_sample; 177 | if (data_length) 178 | *data_length = wr->data_length; 179 | return wr->format && wr->sample_rate; 180 | } 181 | 182 | int wav_read_data(void* obj, unsigned char* data, unsigned int length) { 183 | struct wav_reader* wr = (struct wav_reader*) obj; 184 | int n; 185 | if (wr->wav == NULL) 186 | return -1; 187 | if (length > wr->data_length && !wr->streamed) 188 | length = wr->data_length; 189 | n = fread(data, 1, length, wr->wav); 190 | wr->data_length -= length; 191 | return n; 192 | } 193 | 194 | -------------------------------------------------------------------------------- /wavreader.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 2009 Martin Storsjo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | #ifndef WAVREADER_H 20 | #define WAVREADER_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void* wav_read_open(const char *filename); 27 | void wav_read_close(void* obj); 28 | 29 | int wav_get_header(void* obj, int* format, int* channels, int* sample_rate, int* bits_per_sample, unsigned int* data_length); 30 | int wav_read_data(void* obj, unsigned char* data, unsigned int length); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /win32/getopt.h: -------------------------------------------------------------------------------- 1 | #ifndef __GETOPT_H__ 2 | /** 3 | * DISCLAIMER 4 | * This file has no copyright assigned and is placed in the Public Domain. 5 | * This file is part of the mingw-w64 runtime package. 6 | * 7 | * The mingw-w64 runtime package and its code is distributed in the hope that it 8 | * will be useful but WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESSED OR 9 | * IMPLIED ARE HEREBY DISCLAIMED. This includes but is not limited to 10 | * warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | */ 12 | /* 13 | * Implementation of the `getopt', `getopt_long' and `getopt_long_only' 14 | * APIs, for inclusion in the MinGW runtime library. 15 | * 16 | * This file is part of the MinGW32 package set. 17 | * 18 | * Written by Keith Marshall 19 | * Copyright (C) 2008, 2009, 2011, 2012, MinGW.org Project. 20 | * 21 | * --------------------------------------------------------------------------- 22 | * 23 | * Permission is hereby granted, free of charge, to any person obtaining a 24 | * copy of this software and associated documentation files (the "Software"), 25 | * to deal in the Software without restriction, including without limitation 26 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 27 | * and/or sell copies of the Software, and to permit persons to whom the 28 | * Software is furnished to do so, subject to the following conditions: 29 | * 30 | * The above copyright notice, this permission notice, and the following 31 | * disclaimer shall be included in all copies or substantial portions of 32 | * the Software. 33 | * 34 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 35 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 37 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 39 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 40 | * DEALINGS IN THE SOFTWARE. 41 | * 42 | * --------------------------------------------------------------------------- 43 | * 44 | */ 45 | 46 | #define __GETOPT_H__ 47 | 48 | /* All the headers include this file. */ 49 | #include 50 | #include 51 | #include 52 | #include 53 | 54 | #ifdef __cplusplus 55 | extern "C" { 56 | #endif 57 | 58 | extern int optind; /* index of first non-option in argv */ 59 | extern int optopt; /* single option character, as parsed */ 60 | extern int opterr; /* flag to enable built-in diagnostics... */ 61 | /* (user may set to zero, to suppress) */ 62 | 63 | extern char *optarg; /* pointer to argument of current option */ 64 | 65 | /* Identify how to get the calling program name, for use in messages... 66 | */ 67 | #ifdef __CYGWIN__ 68 | /* 69 | * CYGWIN uses this DLL reference... 70 | */ 71 | # define PROGNAME __progname 72 | extern char __declspec(dllimport) *__progname; 73 | #else 74 | /* 75 | * ...while elsewhere, we simply use the first argument passed. 76 | */ 77 | # define PROGNAME *argv 78 | #endif 79 | 80 | extern int getopt(int nargc, char * const *nargv, const char *options); 81 | 82 | #ifdef _BSD_SOURCE 83 | /* 84 | * BSD adds the non-standard `optreset' feature, for reinitialisation 85 | * of `getopt' parsing. We support this feature, for applications which 86 | * proclaim their BSD heritage, before including this header; however, 87 | * to maintain portability, developers are advised to avoid it. 88 | */ 89 | # define optreset __mingw_optreset 90 | extern int optreset; 91 | #endif 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | /* 96 | * POSIX requires the `getopt' API to be specified in `unistd.h'; 97 | * thus, `unistd.h' includes this header. However, we do not want 98 | * to expose the `getopt_long' or `getopt_long_only' APIs, when 99 | * included in this manner. Thus, close the standard __GETOPT_H__ 100 | * declarations block, and open an additional __GETOPT_LONG_H__ 101 | * specific block, only when *not* __UNISTD_H_SOURCED__, in which 102 | * to declare the extended API. 103 | */ 104 | #endif /* !defined(__GETOPT_H__) */ 105 | 106 | #if !defined(__UNISTD_H_SOURCED__) && !defined(__GETOPT_LONG_H__) 107 | #define __GETOPT_LONG_H__ 108 | 109 | #ifdef __cplusplus 110 | extern "C" { 111 | #endif 112 | 113 | struct option /* specification for a long form option... */ 114 | { 115 | const char *name; /* option name, without leading hyphens */ 116 | int has_arg; /* does it take an argument? */ 117 | int *flag; /* where to save its status, or NULL */ 118 | int val; /* its associated status value */ 119 | }; 120 | 121 | enum /* permitted values for its `has_arg' field... */ 122 | { 123 | no_argument = 0, /* option never takes an argument */ 124 | required_argument, /* option always requires an argument */ 125 | optional_argument /* option may take an argument */ 126 | }; 127 | 128 | extern int getopt_long(int nargc, char * const *nargv, const char *options, 129 | const struct option *long_options, int *idx); 130 | extern int getopt_long_only(int nargc, char * const *nargv, const char *options, 131 | const struct option *long_options, int *idx); 132 | /* 133 | * Previous MinGW implementation had... 134 | */ 135 | #ifndef HAVE_DECL_GETOPT 136 | /* 137 | * ...for the long form API only; keep this for compatibility. 138 | */ 139 | # define HAVE_DECL_GETOPT 1 140 | #endif 141 | 142 | 143 | 144 | /* Identify how to get the calling program name, for use in messages... 145 | */ 146 | #ifdef __CYGWIN__ 147 | /* 148 | * CYGWIN uses this DLL reference... 149 | */ 150 | # define PROGNAME __progname 151 | extern char __declspec(dllimport) *__progname; 152 | #else 153 | /* 154 | * ...while elsewhere, we simply use the first argument passed. 155 | */ 156 | # define PROGNAME *argv 157 | #endif 158 | 159 | /* Initialise the public variables. */ 160 | 161 | int optind = 1; /* index for first non-option arg */ 162 | int opterr = 1; /* enable built-in error messages */ 163 | 164 | char *optarg = NULL; /* pointer to current option argument */ 165 | 166 | #define CHAR char /* argument type selector */ 167 | 168 | #define getopt_switchar '-' /* option prefix character in argv */ 169 | #define getopt_pluschar '+' /* prefix for POSIX mode in optstring */ 170 | #define getopt_takes_argument ':' /* marker for optarg in optstring */ 171 | #define getopt_arg_assign '=' /* longopt argument field separator */ 172 | #define getopt_unknown '?' /* return code for unmatched option */ 173 | #define getopt_ordered 1 /* return code for ordered non-option */ 174 | 175 | #define getopt_all_done -1 /* return code to indicate completion */ 176 | 177 | enum 178 | { /* All `getopt' API functions are implemented via calls to the 179 | * common static function `getopt_parse()'; these `mode' selectors 180 | * determine the behaviour of `getopt_parse()', to deliver the 181 | * appropriate result in each case. 182 | */ 183 | getopt_mode_standard = 0, /* getopt() */ 184 | getopt_mode_long, /* getopt_long() */ 185 | getopt_mode_long_only /* getopt_long_only() */ 186 | }; 187 | 188 | enum 189 | { /* When attempting to match a command line argument to a long form option, 190 | * these indicate the status of the match. 191 | */ 192 | getopt_no_match = 0, /* no successful match */ 193 | getopt_abbreviated_match, /* argument is an abbreviation for an option */ 194 | getopt_exact_match /* argument matches the full option name */ 195 | }; 196 | 197 | int optopt = getopt_unknown; /* return value for option being evaluated */ 198 | 199 | /* Some BSD applications expect to be able to reinitialise `getopt' parsing 200 | * by setting a global variable called `optreset'. We provide an obfuscated 201 | * API, which allows applications to emulate this brain damage; however, any 202 | * use of this is non-portable, and is strongly discouraged. 203 | */ 204 | #define optreset __mingw_optreset 205 | int optreset = 0; 206 | 207 | static 208 | int getopt_missing_arg( const CHAR *optstring ) 209 | { 210 | /* Helper function to determine the appropriate return value, 211 | * for the case where a required option argument is missing. 212 | */ 213 | if( (*optstring == getopt_pluschar) || (*optstring == getopt_switchar) ) 214 | ++optstring; 215 | return (*optstring == getopt_takes_argument) 216 | ? getopt_takes_argument 217 | : getopt_unknown; 218 | } 219 | 220 | /* `complain' macro facilitates the generation of simple built-in 221 | * error messages, displayed on various fault conditions, provided 222 | * `opterr' is non-zero. 223 | */ 224 | #define complain( MSG, ARG ) if( opterr ) \ 225 | fprintf( stderr, "%s: "MSG"\n", PROGNAME, ARG ) 226 | 227 | static 228 | int getopt_argerror( int mode, char *fmt, CHAR *prog, struct option *opt, int retval ) 229 | { 230 | /* Helper function, to generate more complex built-in error 231 | * messages, for invalid arguments to long form options ... 232 | */ 233 | if( opterr ) 234 | { 235 | /* ... but, displayed only if `opterr' is non-zero. 236 | */ 237 | char flag[] = "--"; 238 | if( mode != getopt_mode_long ) 239 | /* 240 | * only display one hyphen, for implicit long form options, 241 | * improperly resolved by `getopt_long_only()'. 242 | */ 243 | flag[1] = 0; 244 | /* 245 | * always preface the program name ... 246 | */ 247 | fprintf( stderr, "%s: ", prog ); 248 | /* 249 | * to the appropriate, option specific message. 250 | */ 251 | fprintf( stderr, fmt, flag, opt->name ); 252 | } 253 | /* Whether displaying the message, or not, always set `optopt' 254 | * to identify the faulty option ... 255 | */ 256 | optopt = opt->val; 257 | /* 258 | * and return the `invalid option' indicator. 259 | */ 260 | return retval; 261 | } 262 | 263 | /* `getopt_conventions' establish behavioural options, to control 264 | * the operation of `getopt_parse()', e.g. to select between POSIX 265 | * and GNU style argument parsing behaviour. 266 | */ 267 | #define getopt_set_conventions 0x1000 268 | #define getopt_posixly_correct 0x0010 269 | 270 | static 271 | int getopt_conventions( int flags ) 272 | { 273 | static int conventions = 0; 274 | 275 | if( (conventions == 0) && ((flags & getopt_set_conventions) == 0) ) 276 | { 277 | /* default conventions have not yet been established; 278 | * initialise them now! 279 | */ 280 | conventions = getopt_set_conventions; 281 | if( flags == getopt_pluschar ) 282 | conventions |= getopt_posixly_correct; 283 | } 284 | 285 | else if( flags & getopt_set_conventions ) 286 | /* 287 | * default conventions may have already been established, 288 | * but this is a specific request to augment them. 289 | */ 290 | conventions |= flags; 291 | 292 | /* in any event, return the currently established conventions. 293 | */ 294 | return conventions; 295 | } 296 | 297 | static 298 | int is_switchar( CHAR flag ) 299 | { 300 | /* A simple helper function, used to identify the switch character 301 | * introducing an optional command line argument. 302 | */ 303 | return flag == getopt_switchar; 304 | } 305 | 306 | static 307 | const CHAR *getopt_match( CHAR lookup, const CHAR *opt_string ) 308 | { 309 | /* Helper function, used to identify short form options. 310 | */ 311 | if( (*opt_string == getopt_pluschar) || (*opt_string == getopt_switchar) ) 312 | ++opt_string; 313 | if( *opt_string == getopt_takes_argument ) 314 | ++opt_string; 315 | do if( lookup == *opt_string ) return opt_string; 316 | while( *++opt_string ); 317 | return NULL; 318 | } 319 | 320 | static 321 | int getopt_match_long( const CHAR *nextchar, const CHAR *optname ) 322 | { 323 | /* Helper function, used to identify potential matches for 324 | * long form options. 325 | */ 326 | CHAR matchchar; 327 | while( (matchchar = *nextchar++) && (matchchar == *optname) ) 328 | /* 329 | * skip over initial substring which DOES match. 330 | */ 331 | ++optname; 332 | 333 | if( matchchar ) 334 | { 335 | /* did NOT match the entire argument to an initial substring 336 | * of a defined option name ... 337 | */ 338 | if( matchchar != getopt_arg_assign ) 339 | /* 340 | * ... and didn't stop at an `=' internal field separator, 341 | * so this is NOT a possible match. 342 | */ 343 | return getopt_no_match; 344 | 345 | /* DID stop at an `=' internal field separator, 346 | * so this IS a possible match, and what follows is an 347 | * argument to the possibly matched option. 348 | */ 349 | optarg = (char *)(nextchar); 350 | } 351 | return *optname 352 | /* 353 | * if we DIDN'T match the ENTIRE text of the option name, 354 | * then it's a possible abbreviated match ... 355 | */ 356 | ? getopt_abbreviated_match 357 | /* 358 | * but if we DID match the entire option name, 359 | * then it's a DEFINITE EXACT match. 360 | */ 361 | : getopt_exact_match; 362 | } 363 | 364 | static 365 | int getopt_resolved( int mode, int argc, CHAR *const *argv, int *argind, 366 | struct option *opt, int index, int *retindex, const CHAR *optstring ) 367 | { 368 | /* Helper function to establish appropriate return conditions, 369 | * on resolution of a long form option. 370 | */ 371 | if( retindex != NULL ) 372 | *retindex = index; 373 | 374 | /* On return, `optind' should normally refer to the argument, if any, 375 | * which follows the current one; it is convenient to set this, before 376 | * checking for the presence of any `optarg'. 377 | */ 378 | optind = *argind + 1; 379 | 380 | if( optarg && (opt[index].has_arg == no_argument) ) 381 | /* 382 | * it is an error for the user to specify an option specific argument 383 | * with an option which doesn't expect one! 384 | */ 385 | return getopt_argerror( mode, "option `%s%s' doesn't accept an argument\n", 386 | PROGNAME, opt + index, getopt_unknown ); 387 | 388 | else if( (optarg == NULL) && (opt[index].has_arg == required_argument) ) 389 | { 390 | /* similarly, it is an error if no argument is specified 391 | * with an option which requires one ... 392 | */ 393 | if( optind < argc ) 394 | /* 395 | * ... except that the requirement may be satisfied from 396 | * the following command line argument, if any ... 397 | */ 398 | optarg = argv[*argind = optind++]; 399 | 400 | else 401 | /* so fail this case, only if no such argument exists! 402 | */ 403 | return getopt_argerror( mode, "option `%s%s' requires an argument\n", 404 | PROGNAME, opt + index, getopt_missing_arg( optstring ) ); 405 | } 406 | 407 | /* when the caller has provided a return buffer ... 408 | */ 409 | if( opt[index].flag != NULL ) 410 | { 411 | /* ... then we place the proper return value there, 412 | * and return a status code of zero ... 413 | */ 414 | *(opt[index].flag) = opt[index].val; 415 | return 0; 416 | } 417 | /* ... otherwise, the return value becomes the status code. 418 | */ 419 | return opt[index].val; 420 | } 421 | 422 | static 423 | int getopt_verify( const CHAR *nextchar, const CHAR *optstring ) 424 | { 425 | /* Helper function, called by getopt_parse() when invoked 426 | * by getopt_long_only(), to verify when an unmatched or an 427 | * ambiguously matched long form option string is valid as 428 | * a short form option specification. 429 | */ 430 | if( ! (nextchar && *nextchar && optstring && *optstring) ) 431 | /* 432 | * There are no characters to be matched, or there are no 433 | * valid short form option characters to which they can be 434 | * matched, so this can never be valid. 435 | */ 436 | return 0; 437 | 438 | while( *nextchar ) 439 | { 440 | /* For each command line character in turn ... 441 | */ 442 | const CHAR *test; 443 | if( (test = getopt_match( *nextchar++, optstring )) == NULL ) 444 | /* 445 | * ... there is no short form option to match the current 446 | * candidate, so the entire argument fails. 447 | */ 448 | return 0; 449 | 450 | if( test[1] == getopt_takes_argument ) 451 | /* 452 | * The current candidate is valid, and it matches an option 453 | * which takes an argument, so this command line argument is 454 | * a valid short form option specification; accept it. 455 | */ 456 | return 1; 457 | } 458 | /* If we get to here, then every character in the command line 459 | * argument was valid as a short form option; accept it. 460 | */ 461 | return 1; 462 | } 463 | 464 | static 465 | #define getopt_std_args int argc, CHAR *const argv[], const CHAR *optstring 466 | int getopt_parse( int mode, getopt_std_args, ... ) 467 | { 468 | /* Common core implementation for ALL `getopt' functions. 469 | */ 470 | static int argind = 0; 471 | static int optbase = 0; 472 | static const CHAR *nextchar = NULL; 473 | static int optmark = 0; 474 | 475 | if( (optreset |= (optind < 1)) || (optind < optbase) ) 476 | { 477 | /* POSIX does not prescribe any definitive mechanism for restarting 478 | * a `getopt' scan, but some applications may require such capability. 479 | * We will support it, by allowing the caller to adjust the value of 480 | * `optind' downwards, (nominally setting it to zero). Since POSIX 481 | * wants `optind' to have an initial value of one, but we want all 482 | * of our internal place holders to be initialised to zero, when we 483 | * are called for the first time, we will handle such a reset by 484 | * adjusting all of the internal place holders to one less than 485 | * the adjusted `optind' value, (but never to less than zero). 486 | */ 487 | if( optreset ) 488 | { 489 | /* User has explicitly requested reinitialisation... 490 | * We need to reset `optind' to it's normal initial value of 1, 491 | * to avoid a potential infinitely recursive loop; by doing this 492 | * up front, we also ensure that the remaining place holders 493 | * will be correctly reinitialised to no less than zero. 494 | */ 495 | optind = 1; 496 | 497 | /* We also need to clear the `optreset' request... 498 | */ 499 | optreset = 0; 500 | } 501 | 502 | /* Now, we may safely reinitialise the internal place holders, to 503 | * one less than `optind', without fear of making them negative. 504 | */ 505 | optmark = optbase = argind = optind - 1; 506 | nextchar = NULL; 507 | } 508 | 509 | /* From a POSIX perspective, the following is `undefined behaviour'; 510 | * we implement it thus, for compatibility with GNU and BSD getopt. 511 | */ 512 | else if( optind > (argind + 1) ) 513 | { 514 | /* Some applications expect to be able to manipulate `optind', 515 | * causing `getopt' to skip over one or more elements of `argv'; 516 | * POSIX doesn't require us to support this brain-damaged concept; 517 | * (indeed, POSIX defines no particular behaviour, in the event of 518 | * such usage, so it must be considered a bug for an application 519 | * to rely on any particular outcome); nonetheless, Mac-OS-X and 520 | * BSD actually provide *documented* support for this capability, 521 | * so we ensure that our internal place holders keep track of 522 | * external `optind' increments; (`argind' must lag by one). 523 | */ 524 | argind = optind - 1; 525 | 526 | /* When `optind' is misused, in this fashion, we also abandon any 527 | * residual text in the argument we had been parsing; this is done 528 | * without any further processing of such abandoned text, assuming 529 | * that the caller is equipped to handle it appropriately. 530 | */ 531 | nextchar = NULL; 532 | } 533 | 534 | if( nextchar && *nextchar ) 535 | { 536 | /* we are parsing a standard, or short format, option argument ... 537 | */ 538 | const CHAR *optchar; 539 | if( (optchar = getopt_match( optopt = *nextchar++, optstring )) != NULL ) 540 | { 541 | /* we have identified it as valid ... 542 | */ 543 | if( optchar[1] == getopt_takes_argument ) 544 | { 545 | /* and determined that it requires an associated argument ... 546 | */ 547 | if( ! *(optarg = (char *)(nextchar)) ) 548 | { 549 | /* the argument is NOT attached ... 550 | */ 551 | if( optchar[2] == getopt_takes_argument ) 552 | /* 553 | * but this GNU extension marks it as optional, 554 | * so we don't provide one on this occasion. 555 | */ 556 | optarg = NULL; 557 | 558 | /* otherwise this option takes a mandatory argument, 559 | * so, provided there is one available ... 560 | */ 561 | else if( (argc - argind) > 1 ) 562 | /* 563 | * we take the following command line argument, 564 | * as the appropriate option argument. 565 | */ 566 | optarg = argv[++argind]; 567 | 568 | /* but if no further argument is available, 569 | * then there is nothing we can do, except for 570 | * issuing the requisite diagnostic message. 571 | */ 572 | else 573 | { 574 | complain( "option requires an argument -- %c", optopt ); 575 | return getopt_missing_arg( optstring ); 576 | } 577 | } 578 | optind = argind + 1; 579 | nextchar = NULL; 580 | } 581 | else 582 | optarg = NULL; 583 | optind = (nextchar && *nextchar) ? argind : argind + 1; 584 | return optopt; 585 | } 586 | /* if we didn't find a valid match for the specified option character, 587 | * then we fall through to here, so take appropriate diagnostic action. 588 | */ 589 | if( mode == getopt_mode_long_only ) 590 | { 591 | complain( "unrecognised option `-%s'", --nextchar ); 592 | nextchar = NULL; 593 | optopt = 0; 594 | } 595 | else 596 | complain( "invalid option -- %c", optopt ); 597 | optind = (nextchar && *nextchar) ? argind : argind + 1; 598 | return getopt_unknown; 599 | } 600 | 601 | if( optmark > optbase ) 602 | { 603 | /* This can happen, in GNU parsing mode ONLY, when we have 604 | * skipped over non-option arguments, and found a subsequent 605 | * option argument; in this case we permute the arguments. 606 | */ 607 | int index; 608 | /* 609 | * `optspan' specifies the number of contiguous arguments 610 | * which are spanned by the current option, and so must be 611 | * moved together during permutation. 612 | */ 613 | const int optspan = argind - optmark + 1; 614 | /* 615 | * we use `this_arg' to store these temporarily. 616 | */ 617 | CHAR **this_arg = malloc(sizeof(CHAR*) * optspan); 618 | /* 619 | * we cannot manipulate `argv' directly, since the `getopt' 620 | * API prototypes it as `read-only'; this cast to `arglist' 621 | * allows us to work around that restriction. 622 | */ 623 | CHAR **arglist = (char **)(argv); 624 | 625 | /* save temporary copies of the arguments which are associated 626 | * with the current option ... 627 | */ 628 | for( index = 0; index < optspan; ++index ) 629 | this_arg[index] = arglist[optmark + index]; 630 | 631 | /* move all preceding non-option arguments to the right, 632 | * overwriting these saved arguments, while making space 633 | * to replace them in their permuted location. 634 | */ 635 | for( --optmark; optmark >= optbase; --optmark ) 636 | arglist[optmark + optspan] = arglist[optmark]; 637 | 638 | /* restore the temporarily saved option arguments to 639 | * their permuted location. 640 | */ 641 | for( index = 0; index < optspan; ++index ) 642 | arglist[optbase + index] = this_arg[index]; 643 | 644 | /* adjust `optbase', to account for the relocated option. 645 | */ 646 | optbase += optspan; 647 | 648 | free(this_arg); 649 | } 650 | 651 | else 652 | /* no permutation occurred ... 653 | * simply adjust `optbase' for all options parsed so far. 654 | */ 655 | optbase = argind + 1; 656 | 657 | /* enter main parsing loop ... 658 | */ 659 | while( argc > ++argind ) 660 | { 661 | /* inspect each argument in turn, identifying possible options ... 662 | */ 663 | if( is_switchar( *(nextchar = argv[optmark = argind]) ) && *++nextchar ) 664 | { 665 | /* we've found a candidate option argument ... */ 666 | 667 | if( is_switchar( *nextchar ) ) 668 | { 669 | /* it's a double hyphen argument ... */ 670 | 671 | const CHAR *refchar = nextchar; 672 | if( *++refchar ) 673 | { 674 | /* and it looks like a long format option ... 675 | * `getopt_long' mode must be active to accept it as such, 676 | * `getopt_long_only' also qualifies, but we must downgrade 677 | * it to force explicit handling as a long format option. 678 | */ 679 | if( mode >= getopt_mode_long ) 680 | { 681 | nextchar = refchar; 682 | mode = getopt_mode_long; 683 | } 684 | } 685 | else 686 | { 687 | /* this is an explicit `--' end of options marker, so wrap up now! 688 | */ 689 | if( optmark > optbase ) 690 | { 691 | /* permuting the argument list as necessary ... 692 | * (note use of `this_arg' and `arglist', as above). 693 | */ 694 | CHAR *this_arg = argv[optmark]; 695 | CHAR **arglist = (CHAR **)(argv); 696 | 697 | /* move all preceding non-option arguments to the right ... 698 | */ 699 | do arglist[optmark] = arglist[optmark - 1]; 700 | while( optmark-- > optbase ); 701 | 702 | /* reinstate the `--' marker, in its permuted location. 703 | */ 704 | arglist[optbase] = this_arg; 705 | } 706 | /* ... before finally bumping `optbase' past the `--' marker, 707 | * and returning the `all done' completion indicator. 708 | */ 709 | optind = ++optbase; 710 | return getopt_all_done; 711 | } 712 | } 713 | else if( mode < getopt_mode_long_only ) 714 | { 715 | /* it's not an explicit long option, and `getopt_long_only' isn't active, 716 | * so we must explicitly try to match it as a short option. 717 | */ 718 | mode = getopt_mode_standard; 719 | } 720 | 721 | if( mode >= getopt_mode_long ) 722 | { 723 | /* the current argument is a long form option, (either explicitly, 724 | * introduced by a double hyphen, or implicitly because we were called 725 | * by `getopt_long_only'); this is where we parse it. 726 | */ 727 | int lookup; 728 | int matched = -1; 729 | 730 | /* we need to fetch the `extra' function arguments, which are 731 | * specified for the `getopt_long' APIs. 732 | */ 733 | va_list refptr; 734 | struct option *longopts; 735 | int *optindex; 736 | va_start( refptr, optstring ); 737 | longopts = va_arg( refptr, struct option * ); 738 | optindex = va_arg( refptr, int * ); 739 | va_end( refptr ); 740 | 741 | /* ensuring that `optarg' does not inherit any junk, from parsing 742 | * preceding arguments ... 743 | */ 744 | optarg = NULL; 745 | for( lookup = 0; longopts && longopts[lookup].name; ++lookup ) 746 | { 747 | /* scan the list of defined long form options ... 748 | */ 749 | switch( getopt_match_long( nextchar, longopts[lookup].name ) ) 750 | { 751 | /* looking for possible matches for the current argument. 752 | */ 753 | case getopt_exact_match: 754 | /* 755 | * when an exact match is found, 756 | * return it immediately, setting `nextchar' to NULL, 757 | * to ensure we don't mistakenly try to match any 758 | * subsequent characters as short form options. 759 | */ 760 | nextchar = NULL; 761 | return getopt_resolved( mode, argc, argv, &argind, 762 | longopts, lookup, optindex, optstring ); 763 | 764 | case getopt_abbreviated_match: 765 | /* 766 | * but, for a partial (initial substring) match ... 767 | */ 768 | if( matched >= 0 ) 769 | { 770 | /* if this is not the first, then we have an ambiguity ... 771 | */ 772 | if( (mode == getopt_mode_long_only) 773 | /* 774 | * However, in the case of getopt_long_only(), if 775 | * the entire ambiguously matched string represents 776 | * a valid short option specification, then we may 777 | * proceed to interpret it as such. 778 | */ 779 | && getopt_verify( nextchar, optstring ) ) 780 | return getopt_parse( mode, argc, argv, optstring ); 781 | 782 | /* If we get to here, then the ambiguously matched 783 | * partial long option isn't valid for short option 784 | * evaluation; reset parser context to resume with 785 | * the following command line argument, diagnose 786 | * ambiguity, and bail out. 787 | */ 788 | optopt = 0; 789 | nextchar = NULL; 790 | optind = argind + 1; 791 | complain( "option `%s' is ambiguous", argv[argind] ); 792 | return getopt_unknown; 793 | } 794 | /* otherwise just note that we've found a possible match ... 795 | */ 796 | matched = lookup; 797 | } 798 | } 799 | if( matched >= 0 ) 800 | { 801 | /* if we get to here, then we found exactly one partial match, 802 | * so return it, as for an exact match. 803 | */ 804 | nextchar = NULL; 805 | return getopt_resolved( mode, argc, argv, &argind, 806 | longopts, matched, optindex, optstring ); 807 | } 808 | /* if here, then we had what SHOULD have been a long form option, 809 | * but it is unmatched ... 810 | */ 811 | if( (mode < getopt_mode_long_only) 812 | /* 813 | * ... although paradoxically, `mode == getopt_mode_long_only' 814 | * allows us to still try to match it as a short form option. 815 | */ 816 | || (getopt_verify( nextchar, optstring ) == 0) ) 817 | { 818 | /* When it cannot be matched, reset the parsing context to 819 | * resume from the next argument, diagnose the failed match, 820 | * and bail out. 821 | */ 822 | optopt = 0; 823 | nextchar = NULL; 824 | optind = argind + 1; 825 | complain( "unrecognised option `%s'", argv[argind] ); 826 | return getopt_unknown; 827 | } 828 | } 829 | /* fall through to handle standard short form options... 830 | * when the option argument format is neither explictly identified 831 | * as long, nor implicitly matched as such, and the argument isn't 832 | * just a bare hyphen, (which isn't an option), then we make one 833 | * recursive call to explicitly interpret it as short format. 834 | */ 835 | if( *nextchar ) 836 | return getopt_parse( mode, argc, argv, optstring ); 837 | } 838 | /* if we get to here, then we've parsed a non-option argument ... 839 | * in GNU compatibility mode, we step over it, so we can permute 840 | * any subsequent option arguments, but ... 841 | */ 842 | if( *optstring == getopt_switchar ) 843 | { 844 | /* if `optstring' begins with a `-' character, this special 845 | * GNU specific behaviour requires us to return the non-option 846 | * arguments in strict order, as pseudo-arguments to a special 847 | * option, with return value defined as `getopt_ordered'. 848 | */ 849 | nextchar = NULL; 850 | optind = argind + 1; 851 | optarg = argv[argind]; 852 | return getopt_ordered; 853 | } 854 | if( getopt_conventions( *optstring ) & getopt_posixly_correct ) 855 | /* 856 | * otherwise ... 857 | * for POSIXLY_CORRECT behaviour, or if `optstring' begins with 858 | * a `+' character, then we break out of the parsing loop, so that 859 | * the scan ends at the current argument, with no permutation. 860 | */ 861 | break; 862 | } 863 | /* fall through when all arguments have been evaluated, 864 | */ 865 | optind = optbase; 866 | return getopt_all_done; 867 | } 868 | 869 | /* All three public API entry points are trivially defined, 870 | * in terms of the internal `getopt_parse' function. 871 | */ 872 | int getopt( getopt_std_args ) 873 | { 874 | return getopt_parse( getopt_mode_standard, argc, argv, optstring ); 875 | } 876 | 877 | int getopt_long( getopt_std_args, const struct option *opts, int *index ) 878 | { 879 | return getopt_parse( getopt_mode_long, argc, argv, optstring, opts, index ); 880 | } 881 | 882 | int getopt_long_only( getopt_std_args, const struct option *opts, int *index ) 883 | { 884 | return getopt_parse( getopt_mode_long_only, argc, argv, optstring, opts, index ); 885 | } 886 | 887 | #ifdef __weak_alias 888 | /* 889 | * These Microsnot style uglified aliases are provided for compatibility 890 | * with the previous MinGW implementation of the getopt API. 891 | */ 892 | __weak_alias( getopt, _getopt ) 893 | __weak_alias( getopt_long, _getopt_long ) 894 | __weak_alias( getopt_long_only, _getopt_long_only ) 895 | #endif 896 | 897 | 898 | 899 | 900 | #ifdef __cplusplus 901 | } 902 | #endif 903 | 904 | #endif /* !defined(__UNISTD_H_SOURCED__) && !defined(__GETOPT_LONG_H__) */ 905 | --------------------------------------------------------------------------------