summaryrefslogtreecommitdiff
Diffstat
-rw-r--r--Android.mk1
-rwxr-xr-xamadec/Android.mk282
-rw-r--r--amadec/acodec_lib_50/libstagefright_soft_dcvdec.so80
-rw-r--r--amadec/acodec_lib_50/libstagefright_soft_dtshd.so85
-rw-r--r--amadec/acodec_lib_50/libstagefright_soft_truehddec.so41
-rw-r--r--amadec/acodec_lib_android_n/libstagefright_soft_dcvdec.so109
-rw-r--r--amadec/acodec_lib_android_n/libstagefright_soft_dtshd.so272
-rw-r--r--amadec/acodec_lib_android_n/libstagefright_soft_truehddec.so87
-rwxr-xr-xamadec/acodec_lib_mx/libstagefright_soft_ddpdec.so113
-rwxr-xr-xamadec/acodec_lib_mx/libstagefright_soft_dtshd.so121
-rw-r--r--amadec/adec-armdec-mgt.h57
-rw-r--r--amadec/adec-external-ctrl.c899
-rw-r--r--amadec/adec-ffmpeg-mgt.c1550
-rw-r--r--amadec/adec-internal-mgt.c772
-rw-r--r--amadec/adec-message.c156
-rw-r--r--amadec/adec-message.h61
-rwxr-xr-xamadec/adec-pts-mgt.c1107
-rw-r--r--amadec/adec-pts-mgt.h82
-rw-r--r--amadec/adec-wfd-out.cpp361
-rw-r--r--amadec/adec-wfd.c811
-rw-r--r--amadec/adec_omx_brige.c284
-rw-r--r--amadec/adec_omx_brige.h56
-rw-r--r--amadec/adec_read.c200
-rw-r--r--amadec/adec_reg.h76
-rw-r--r--amadec/adec_write.c189
-rw-r--r--amadec/adec_write.h42
-rw-r--r--amadec/audio-dec.h314
-rw-r--r--amadec/audio_out/alsa-out.c1082
-rw-r--r--amadec/audio_out/aml_resample.c708
-rw-r--r--amadec/audio_out/aml_resample.h86
-rwxr-xr-xamadec/audio_out/android-out.cpp1640
-rw-r--r--amadec/audiodsp_update_format.c188
-rw-r--r--amadec/dsp/audiodsp-ctl.c471
-rw-r--r--amadec/dts_enc.c209
-rw-r--r--amadec/dts_enc.h11
-rw-r--r--amadec/dts_transenc_api.c143
-rw-r--r--amadec/dts_transenc_api.h19
-rw-r--r--amadec/feeder.c231
-rw-r--r--amadec/feeder.h26
-rw-r--r--amadec/include/adec-external-ctrl.h63
-rwxr-xr-xamadec/include/adec-macros.h41
-rw-r--r--amadec/include/adec-types.h53
-rwxr-xr-xamadec/include/alsa-out.h26
-rw-r--r--amadec/include/audio-out.h41
-rw-r--r--amadec/include/audiodsp.h142
-rw-r--r--amadec/include/audiodsp_update_format.h25
-rw-r--r--amadec/include/log-print.h26
-rwxr-xr-xamadec/omx_audio/ALAC_mediasource.cpp205
-rw-r--r--amadec/omx_audio/ALAC_mediasource.h62
-rwxr-xr-xamadec/omx_audio/ASF_mediasource.cpp184
-rw-r--r--amadec/omx_audio/ASF_mediasource.h127
-rwxr-xr-xamadec/omx_audio/Android.mk34
-rwxr-xr-xamadec/omx_audio/DDP_mediasource.cpp528
-rw-r--r--amadec/omx_audio/DDP_mediasource.h141
-rw-r--r--amadec/omx_audio/DTSHD_mediasource.cpp316
-rw-r--r--amadec/omx_audio/DTSHD_mediasource.h74
-rwxr-xr-xamadec/omx_audio/MP3_mediasource.cpp579
-rw-r--r--amadec/omx_audio/MP3_mediasource.h80
-rw-r--r--amadec/omx_audio/THD_mediasource.cpp229
-rw-r--r--amadec/omx_audio/THD_mediasource.h74
-rwxr-xr-xamadec/omx_audio/Vorbis_mediasource.cpp245
-rw-r--r--amadec/omx_audio/Vorbis_mediasource.h58
-rw-r--r--amadec/omx_audio/adec_omx.cpp421
-rw-r--r--amadec/omx_audio/adec_omx.h71
-rwxr-xr-xamadec/omx_audio/audio_mediasource.cpp37
-rw-r--r--amadec/omx_audio/audio_mediasource.h46
-rw-r--r--amadec/omx_audio/audio_medissource.h137
-rw-r--r--amadec/pcmenc_api.c147
-rw-r--r--amadec/pcmenc_api.h25
-rw-r--r--amadec/spdif_api.c306
-rw-r--r--amadec/spdif_api.h26
-rwxr-xr-xaudio_codec/Android.mk1
-rw-r--r--audio_codec/config.mk10
-rwxr-xr-xaudio_codec/libadpcm/Android.mk12
-rw-r--r--audio_codec/libadpcm/adpcm.h346
-rw-r--r--audio_codec/libadpcm/adpcm_decode.c841
-rwxr-xr-xaudio_codec/libamr/Android.mk25
-rwxr-xr-xaudio_codec/libamr/Makefile5
-rw-r--r--audio_codec/libamr/amr_decode.c186
-rw-r--r--audio_codec/libamr/amr_decode.h8
-rwxr-xr-xaudio_codec/libamr/dec.h18
-rw-r--r--audio_codec/libamr/dec_acelp.c620
-rwxr-xr-xaudio_codec/libamr/dec_acelp.h17
-rw-r--r--audio_codec/libamr/dec_dtx.c683
-rw-r--r--audio_codec/libamr/dec_dtx.h49
-rw-r--r--audio_codec/libamr/dec_gain.c853
-rw-r--r--audio_codec/libamr/dec_gain.h28
-rw-r--r--audio_codec/libamr/dec_if.c834
-rwxr-xr-xaudio_codec/libamr/dec_if.h23
-rw-r--r--audio_codec/libamr/dec_lpc.c789
-rw-r--r--audio_codec/libamr/dec_lpc.h25
-rw-r--r--audio_codec/libamr/dec_main.c842
-rw-r--r--audio_codec/libamr/dec_main.h57
-rw-r--r--audio_codec/libamr/dec_rom.c2114
-rw-r--r--audio_codec/libamr/dec_util.c1304
-rw-r--r--audio_codec/libamr/dec_util.h33
-rw-r--r--audio_codec/libamr/if_rom.c1030
-rwxr-xr-xaudio_codec/libamr/if_rom.h70
-rw-r--r--audio_codec/libamr/interf_dec.c906
-rw-r--r--audio_codec/libamr/interf_dec.h56
-rw-r--r--audio_codec/libamr/interf_rom.h1788
-rw-r--r--audio_codec/libamr/rom_dec.h13274
-rw-r--r--audio_codec/libamr/sp_dec.c6078
-rw-r--r--audio_codec/libamr/sp_dec.h83
-rwxr-xr-xaudio_codec/libamr/typedef.h17
-rwxr-xr-xaudio_codec/libape/Android.mk28
-rw-r--r--audio_codec/libape/Ape_decoder.h216
-rw-r--r--audio_codec/libape/amlogic_r30813_audio_ape_lib.c1
-rw-r--r--audio_codec/libape/apedec.c1120
-rw-r--r--audio_codec/libcook/Android.mk28
-rw-r--r--audio_codec/libcook/aac_bitstream.h133
-rw-r--r--audio_codec/libcook/aac_decode.h148
-rw-r--r--audio_codec/libcook/aac_reorder.h53
-rw-r--r--audio_codec/libcook/assembly.h119
-rw-r--r--audio_codec/libcook/challenge.h132
-rw-r--r--audio_codec/libcook/codec_defines.h93
-rw-r--r--audio_codec/libcook/coder.h287
-rw-r--r--audio_codec/libcook/cook_codec.h30
-rw-r--r--audio_codec/libcook/cook_decode.c624
-rw-r--r--audio_codec/libcook/cook_decode.h35
-rw-r--r--audio_codec/libcook/ga_config.h86
-rw-r--r--audio_codec/libcook/gecko2codec.c833
-rw-r--r--audio_codec/libcook/gecko2codec.h60
-rw-r--r--audio_codec/libcook/helix_config.h92
-rw-r--r--audio_codec/libcook/helix_mime_types.h56
-rw-r--r--audio_codec/libcook/helix_result.h107
-rw-r--r--audio_codec/libcook/helix_types.h305
-rw-r--r--audio_codec/libcook/helix_utils.h106
-rw-r--r--audio_codec/libcook/md5.h113
-rw-r--r--audio_codec/libcook/memory_utils.c100
-rw-r--r--audio_codec/libcook/memory_utils.h58
-rw-r--r--audio_codec/libcook/pack_utils.c306
-rw-r--r--audio_codec/libcook/pack_utils.h93
-rw-r--r--audio_codec/libcook/packet_defines.h48
-rw-r--r--audio_codec/libcook/ra8lbr_decode.c378
-rw-r--r--audio_codec/libcook/ra8lbr_decode.h161
-rw-r--r--audio_codec/libcook/ra_backend.h94
-rw-r--r--audio_codec/libcook/ra_bitpack.c197
-rw-r--r--audio_codec/libcook/ra_buffers.c127
-rw-r--r--audio_codec/libcook/ra_category.c298
-rw-r--r--audio_codec/libcook/ra_couple.c224
-rw-r--r--audio_codec/libcook/ra_decode.c321
-rw-r--r--audio_codec/libcook/ra_decode.h183
-rw-r--r--audio_codec/libcook/ra_depack.c230
-rw-r--r--audio_codec/libcook/ra_depack.h177
-rw-r--r--audio_codec/libcook/ra_depack_internal.c1710
-rw-r--r--audio_codec/libcook/ra_depack_internal.h232
-rw-r--r--audio_codec/libcook/ra_envelope.c123
-rw-r--r--audio_codec/libcook/ra_fft.c368
-rw-r--r--audio_codec/libcook/ra_format_info.h60
-rw-r--r--audio_codec/libcook/ra_gainctrl.c584
-rw-r--r--audio_codec/libcook/ra_huffman.c86
-rw-r--r--audio_codec/libcook/ra_hufftabs.c244
-rw-r--r--audio_codec/libcook/ra_mlt.c357
-rw-r--r--audio_codec/libcook/ra_sqvh.c431
-rw-r--r--audio_codec/libcook/ra_trigtabs.c932
-rw-r--r--audio_codec/libcook/rasl.c376
-rw-r--r--audio_codec/libcook/rasl.h71
-rw-r--r--audio_codec/libcook/rdtpck.h153
-rw-r--r--audio_codec/libcook/rm_error.h54
-rw-r--r--audio_codec/libcook/rm_error_default.c58
-rw-r--r--audio_codec/libcook/rm_error_default.h53
-rw-r--r--audio_codec/libcook/rm_io_default.c101
-rw-r--r--audio_codec/libcook/rm_io_default.h49
-rw-r--r--audio_codec/libcook/rm_memory.h54
-rw-r--r--audio_codec/libcook/rm_memory_default.c54
-rw-r--r--audio_codec/libcook/rm_memory_default.h46
-rw-r--r--audio_codec/libcook/rm_packet.c117
-rw-r--r--audio_codec/libcook/rm_packet.h80
-rw-r--r--audio_codec/libcook/rm_parse.h302
-rw-r--r--audio_codec/libcook/rm_parser.c649
-rw-r--r--audio_codec/libcook/rm_parser_internal.c3342
-rw-r--r--audio_codec/libcook/rm_parser_internal.h420
-rw-r--r--audio_codec/libcook/rm_property.c105
-rw-r--r--audio_codec/libcook/rm_property.h107
-rw-r--r--audio_codec/libcook/rm_stream.c356
-rw-r--r--audio_codec/libcook/rm_stream.h115
-rw-r--r--audio_codec/libcook/rm_stream_internal.h77
-rw-r--r--audio_codec/libcook/rv20backend.h69
-rw-r--r--audio_codec/libcook/rv30backend.h68
-rw-r--r--audio_codec/libcook/rv_backend.h84
-rw-r--r--audio_codec/libcook/rv_backend_types.h198
-rw-r--r--audio_codec/libcook/rv_decode.h208
-rw-r--r--audio_codec/libcook/rv_decode_message.h492
-rw-r--r--audio_codec/libcook/rv_depack.c271
-rw-r--r--audio_codec/libcook/rv_depack.h162
-rw-r--r--audio_codec/libcook/rv_depack_internal.c1071
-rw-r--r--audio_codec/libcook/rv_depack_internal.h171
-rw-r--r--audio_codec/libcook/rv_format_info.h91
-rw-r--r--audio_codec/libcook/statname.h118
-rw-r--r--audio_codec/libcook/stream_hdr_structs.h66
-rw-r--r--audio_codec/libcook/stream_hdr_utils.c136
-rw-r--r--audio_codec/libcook/stream_hdr_utils.h77
-rw-r--r--audio_codec/libcook/string_utils.c87
-rw-r--r--audio_codec/libcook/string_utils.h62
-rw-r--r--audio_codec/libcook/tngpkt.h400
-rwxr-xr-xaudio_codec/libfaad/Android.mk101
-rwxr-xr-xaudio_codec/libfaad/Makefile130
-rw-r--r--audio_codec/libfaad/analysis.h52
-rwxr-xr-xaudio_codec/libfaad/audio.d3
-rw-r--r--audio_codec/libfaad/bits.c261
-rwxr-xr-xaudio_codec/libfaad/bits.d18
-rw-r--r--audio_codec/libfaad/bits.h446
-rw-r--r--audio_codec/libfaad/cfft.c988
-rw-r--r--audio_codec/libfaad/cfft.h55
-rw-r--r--audio_codec/libfaad/cfft_tab.h1816
-rw-r--r--audio_codec/libfaad/codebook/hcb.h140
-rw-r--r--audio_codec/libfaad/codebook/hcb_1.h186
-rw-r--r--audio_codec/libfaad/codebook/hcb_10.h312
-rw-r--r--audio_codec/libfaad/codebook/hcb_11.h415
-rw-r--r--audio_codec/libfaad/codebook/hcb_2.h185
-rw-r--r--audio_codec/libfaad/codebook/hcb_3.h196
-rw-r--r--audio_codec/libfaad/codebook/hcb_4.h199
-rw-r--r--audio_codec/libfaad/codebook/hcb_5.h196
-rw-r--r--audio_codec/libfaad/codebook/hcb_6.h182
-rw-r--r--audio_codec/libfaad/codebook/hcb_7.h162
-rw-r--r--audio_codec/libfaad/codebook/hcb_8.h173
-rw-r--r--audio_codec/libfaad/codebook/hcb_9.h372
-rw-r--r--audio_codec/libfaad/codebook/hcb_sf.h276
-rw-r--r--audio_codec/libfaad/common.c558
-rw-r--r--audio_codec/libfaad/common.h453
-rw-r--r--audio_codec/libfaad/decoder.c2266
-rw-r--r--audio_codec/libfaad/drc.c173
-rw-r--r--audio_codec/libfaad/drc.h49
-rw-r--r--audio_codec/libfaad/drm_dec.c912
-rw-r--r--audio_codec/libfaad/drm_dec.h99
-rw-r--r--audio_codec/libfaad/error.c72
-rw-r--r--audio_codec/libfaad/error.h44
-rw-r--r--audio_codec/libfaad/filtbank.c408
-rw-r--r--audio_codec/libfaad/filtbank.h61
-rw-r--r--audio_codec/libfaad/fixed.h287
-rw-r--r--audio_codec/libfaad/hcr.c422
-rw-r--r--audio_codec/libfaad/helixaac/aaccommon.h210
-rw-r--r--audio_codec/libfaad/helixaac/aacdec.c508
-rw-r--r--audio_codec/libfaad/helixaac/aacdec.h206
-rw-r--r--audio_codec/libfaad/helixaac/aactabs.c157
-rw-r--r--audio_codec/libfaad/helixaac/assembly.h631
-rw-r--r--audio_codec/libfaad/helixaac/assembly_mw.h743
-rw-r--r--audio_codec/libfaad/helixaac/bitstream.c261
-rw-r--r--audio_codec/libfaad/helixaac/bitstream.h74
-rw-r--r--audio_codec/libfaad/helixaac/buffers.c140
-rw-r--r--audio_codec/libfaad/helixaac/coder.h369
-rw-r--r--audio_codec/libfaad/helixaac/dct4.c337
-rw-r--r--audio_codec/libfaad/helixaac/decelmnt.c445
-rw-r--r--audio_codec/libfaad/helixaac/dequant.c379
-rw-r--r--audio_codec/libfaad/helixaac/fft.c391
-rw-r--r--audio_codec/libfaad/helixaac/filefmt.c539
-rw-r--r--audio_codec/libfaad/helixaac/huffman_helix.c450
-rw-r--r--audio_codec/libfaad/helixaac/hufftabs.c177
-rw-r--r--audio_codec/libfaad/helixaac/imdct.c596
-rw-r--r--audio_codec/libfaad/helixaac/noiseless.c513
-rw-r--r--audio_codec/libfaad/helixaac/pns_helix.c371
-rw-r--r--audio_codec/libfaad/helixaac/sbr.c433
-rw-r--r--audio_codec/libfaad/helixaac/sbr.h380
-rw-r--r--audio_codec/libfaad/helixaac/sbrfft.c368
-rw-r--r--audio_codec/libfaad/helixaac/sbrfreq.c673
-rw-r--r--audio_codec/libfaad/helixaac/sbrhfadj.c882
-rw-r--r--audio_codec/libfaad/helixaac/sbrhfgen.c655
-rw-r--r--audio_codec/libfaad/helixaac/sbrhuff.c494
-rw-r--r--audio_codec/libfaad/helixaac/sbrimdct.c447
-rw-r--r--audio_codec/libfaad/helixaac/sbrmath.c198
-rw-r--r--audio_codec/libfaad/helixaac/sbrqmf.c648
-rw-r--r--audio_codec/libfaad/helixaac/sbrside.c634
-rw-r--r--audio_codec/libfaad/helixaac/sbrtabs.c400
-rw-r--r--audio_codec/libfaad/helixaac/statname.h115
-rw-r--r--audio_codec/libfaad/helixaac/stproc.c251
-rw-r--r--audio_codec/libfaad/helixaac/tns_helix.c307
-rw-r--r--audio_codec/libfaad/helixaac/trigtabs.c1000
-rw-r--r--audio_codec/libfaad/helixaac/trigtabs_fltgen.c357
-rw-r--r--audio_codec/libfaad/huffman.c582
-rw-r--r--audio_codec/libfaad/huffman.h47
-rw-r--r--audio_codec/libfaad/ic_predict.c258
-rw-r--r--audio_codec/libfaad/ic_predict.h252
-rw-r--r--audio_codec/libfaad/iq_table.h16456
-rw-r--r--audio_codec/libfaad/is.c106
-rw-r--r--audio_codec/libfaad/is.h67
-rw-r--r--audio_codec/libfaad/kbd_win.h2294
-rw-r--r--audio_codec/libfaad/libaacdec.c544
-rw-r--r--audio_codec/libfaad/libaacdec.h64
-rwxr-xr-xaudio_codec/libfaad/libfaad2.def14
-rw-r--r--audio_codec/libfaad/lt_predict.c205
-rw-r--r--audio_codec/libfaad/lt_predict.h66
-rw-r--r--audio_codec/libfaad/mdct.c307
-rw-r--r--audio_codec/libfaad/mdct.h48
-rw-r--r--audio_codec/libfaad/mdct_tab.h3639
-rw-r--r--audio_codec/libfaad/mp4.c307
-rw-r--r--audio_codec/libfaad/mp4.h52
-rw-r--r--audio_codec/libfaad/ms.c71
-rw-r--r--audio_codec/libfaad/ms.h44
-rw-r--r--audio_codec/libfaad/neaacdec.h257
-rw-r--r--audio_codec/libfaad/output.c583
-rw-r--r--audio_codec/libfaad/output.h48
-rw-r--r--audio_codec/libfaad/pns.c273
-rw-r--r--audio_codec/libfaad/pns.h58
-rw-r--r--audio_codec/libfaad/ps_dec.c1905
-rw-r--r--audio_codec/libfaad/ps_dec.h151
-rw-r--r--audio_codec/libfaad/ps_syntax.c532
-rw-r--r--audio_codec/libfaad/ps_tables.h547
-rw-r--r--audio_codec/libfaad/pulse.c59
-rw-r--r--audio_codec/libfaad/pulse.h43
-rw-r--r--audio_codec/libfaad/rvlc.c524
-rw-r--r--audio_codec/libfaad/rvlc.h55
-rw-r--r--audio_codec/libfaad/sbr_dct.c2267
-rw-r--r--audio_codec/libfaad/sbr_dct.h52
-rw-r--r--audio_codec/libfaad/sbr_dec.c679
-rw-r--r--audio_codec/libfaad/sbr_dec.h253
-rw-r--r--audio_codec/libfaad/sbr_e_nf.c475
-rw-r--r--audio_codec/libfaad/sbr_e_nf.h50
-rw-r--r--audio_codec/libfaad/sbr_fbt.c737
-rw-r--r--audio_codec/libfaad/sbr_fbt.h55
-rw-r--r--audio_codec/libfaad/sbr_hfadj.c1644
-rw-r--r--audio_codec/libfaad/sbr_hfadj.h56
-rw-r--r--audio_codec/libfaad/sbr_hfgen.c647
-rw-r--r--audio_codec/libfaad/sbr_hfgen.h49
-rw-r--r--audio_codec/libfaad/sbr_huff.c344
-rw-r--r--audio_codec/libfaad/sbr_huff.h46
-rw-r--r--audio_codec/libfaad/sbr_noise.h564
-rw-r--r--audio_codec/libfaad/sbr_qmf.c614
-rw-r--r--audio_codec/libfaad/sbr_qmf.h55
-rw-r--r--audio_codec/libfaad/sbr_qmf_c.h368
-rw-r--r--audio_codec/libfaad/sbr_syntax.c893
-rw-r--r--audio_codec/libfaad/sbr_syntax.h68
-rw-r--r--audio_codec/libfaad/sbr_tf_grid.c247
-rw-r--r--audio_codec/libfaad/sbr_tf_grid.h47
-rw-r--r--audio_codec/libfaad/sine_win.h4296
-rw-r--r--audio_codec/libfaad/specrec.c1249
-rw-r--r--audio_codec/libfaad/specrec.h49
-rw-r--r--audio_codec/libfaad/ssr.c170
-rw-r--r--audio_codec/libfaad/ssr.h59
-rw-r--r--audio_codec/libfaad/ssr_fb.c191
-rw-r--r--audio_codec/libfaad/ssr_fb.h53
-rw-r--r--audio_codec/libfaad/ssr_ipqf.c171
-rw-r--r--audio_codec/libfaad/ssr_ipqf.h46
-rw-r--r--audio_codec/libfaad/ssr_win.h635
-rw-r--r--audio_codec/libfaad/structs.h513
-rw-r--r--audio_codec/libfaad/syntax.c2539
-rw-r--r--audio_codec/libfaad/syntax.h129
-rw-r--r--audio_codec/libfaad/tns.c304
-rw-r--r--audio_codec/libfaad/tns.h51
-rwxr-xr-xaudio_codec/libflac/Android.mk22
-rw-r--r--audio_codec/libflac/avcodec.h337
-rw-r--r--audio_codec/libflac/bswap.h94
-rw-r--r--audio_codec/libflac/codec.h36
-rw-r--r--audio_codec/libflac/codec_message.h109
-rw-r--r--audio_codec/libflac/common.h356
-rw-r--r--audio_codec/libflac/crc.c146
-rw-r--r--audio_codec/libflac/crc.h46
-rw-r--r--audio_codec/libflac/flac.c43
-rw-r--r--audio_codec/libflac/flac.h124
-rw-r--r--audio_codec/libflac/flac_decode.c943
-rw-r--r--audio_codec/libflac/flacdata.c38
-rw-r--r--audio_codec/libflac/flacdata.h29
-rw-r--r--audio_codec/libflac/get_bits.h564
-rw-r--r--audio_codec/libflac/golomb.h585
-rw-r--r--audio_codec/libflac/internal.h195
-rw-r--r--audio_codec/libflac/intreadwrite.h390
-rw-r--r--audio_codec/libflac/mathops.h78
-rw-r--r--audio_codec/libflac/types.h49
-rwxr-xr-xaudio_codec/liblpcm/Android.mk13
-rw-r--r--audio_codec/liblpcm/lpcm_decode.c437
-rwxr-xr-xaudio_codec/libmad/Android.mk13
-rwxr-xr-xaudio_codec/libmad/D.dat607
-rw-r--r--audio_codec/libmad/bit.c244
-rw-r--r--audio_codec/libmad/bit.h47
-rw-r--r--audio_codec/libmad/config.h133
-rw-r--r--audio_codec/libmad/decoder.c1102
-rw-r--r--audio_codec/libmad/decoder.h91
-rw-r--r--audio_codec/libmad/fixed.c85
-rw-r--r--audio_codec/libmad/fixed.h499
-rw-r--r--audio_codec/libmad/frame.c525
-rw-r--r--audio_codec/libmad/frame.h118
-rw-r--r--audio_codec/libmad/global.h58
-rw-r--r--audio_codec/libmad/huffman.c3109
-rw-r--r--audio_codec/libmad/huffman.h66
-rwxr-xr-xaudio_codec/libmad/imdct_l_arm.S1000
-rwxr-xr-xaudio_codec/libmad/imdct_s.dat62
-rw-r--r--audio_codec/libmad/layer12.c552
-rwxr-xr-xaudio_codec/libmad/layer12.h31
-rw-r--r--audio_codec/libmad/layer3.c2742
-rwxr-xr-xaudio_codec/libmad/layer3.h30
-rw-r--r--audio_codec/libmad/mad.h966
-rwxr-xr-xaudio_codec/libmad/qc_table.dat77
-rwxr-xr-xaudio_codec/libmad/rq_table.dat8747
-rwxr-xr-xaudio_codec/libmad/sf_table.dat106
-rw-r--r--audio_codec/libmad/stream.c185
-rw-r--r--audio_codec/libmad/stream.h111
-rw-r--r--audio_codec/libmad/synth.c921
-rw-r--r--audio_codec/libmad/synth.h69
-rw-r--r--audio_codec/libmad/timer.c493
-rw-r--r--audio_codec/libmad/timer.h100
-rw-r--r--audio_codec/libmad/version.c91
-rw-r--r--audio_codec/libmad/version.h47
-rwxr-xr-xaudio_codec/libpcm/Android.mk11
-rw-r--r--audio_codec/libpcm/intreadwrite.h390
-rw-r--r--audio_codec/libpcm/pcm_decode.c780
-rw-r--r--audio_codec/libraac/Android.mk51
-rw-r--r--audio_codec/libraac/aac_bitstream.c200
-rw-r--r--audio_codec/libraac/aac_bitstream.h133
-rw-r--r--audio_codec/libraac/aac_decode.h148
-rw-r--r--audio_codec/libraac/aac_decode_main.c396
-rw-r--r--audio_codec/libraac/aac_reorder.c85
-rw-r--r--audio_codec/libraac/aac_reorder.h53
-rw-r--r--audio_codec/libraac/aaccommon.h200
-rw-r--r--audio_codec/libraac/aacdec.c607
-rw-r--r--audio_codec/libraac/aacdec.h200
-rw-r--r--audio_codec/libraac/aactabs.c157
-rw-r--r--audio_codec/libraac/assembly.h147
-rw-r--r--audio_codec/libraac/bitstream.c451
-rw-r--r--audio_codec/libraac/bitstream.h76
-rw-r--r--audio_codec/libraac/buffers.c132
-rw-r--r--audio_codec/libraac/coder.h370
-rw-r--r--audio_codec/libraac/dct4.c339
-rw-r--r--audio_codec/libraac/decelmnt.c451
-rw-r--r--audio_codec/libraac/dequant.c382
-rw-r--r--audio_codec/libraac/fft.c393
-rw-r--r--audio_codec/libraac/filefmt.c531
-rw-r--r--audio_codec/libraac/ga_config.c209
-rw-r--r--audio_codec/libraac/ga_config.h86
-rw-r--r--audio_codec/libraac/huffman.c449
-rw-r--r--audio_codec/libraac/hufftabs.c177
-rw-r--r--audio_codec/libraac/imdct.c598
-rw-r--r--audio_codec/libraac/include/challenge.h132
-rw-r--r--audio_codec/libraac/include/codec_defines.h93
-rw-r--r--audio_codec/libraac/include/gecko2codec.h60
-rw-r--r--audio_codec/libraac/include/helix_config.h92
-rw-r--r--audio_codec/libraac/include/helix_mime_types.h56
-rw-r--r--audio_codec/libraac/include/helix_result.h107
-rw-r--r--audio_codec/libraac/include/helix_types.h305
-rw-r--r--audio_codec/libraac/include/helix_utils.h106
-rw-r--r--audio_codec/libraac/include/md5.h113
-rw-r--r--audio_codec/libraac/include/memory_utils.h58
-rw-r--r--audio_codec/libraac/include/pack_utils.h93
-rw-r--r--audio_codec/libraac/include/packet_defines.h48
-rw-r--r--audio_codec/libraac/include/ra8lbr_decode.h161
-rw-r--r--audio_codec/libraac/include/ra_backend.h94
-rw-r--r--audio_codec/libraac/include/ra_decode.h183
-rw-r--r--audio_codec/libraac/include/ra_depack.h177
-rw-r--r--audio_codec/libraac/include/ra_format_info.h60
-rw-r--r--audio_codec/libraac/include/rasl.h71
-rw-r--r--audio_codec/libraac/include/rdtpck.h153
-rw-r--r--audio_codec/libraac/include/rm_error.h54
-rw-r--r--audio_codec/libraac/include/rm_error_default.h53
-rw-r--r--audio_codec/libraac/include/rm_io_default.h49
-rw-r--r--audio_codec/libraac/include/rm_memory.h54
-rw-r--r--audio_codec/libraac/include/rm_memory_default.h46
-rw-r--r--audio_codec/libraac/include/rm_packet.h80
-rw-r--r--audio_codec/libraac/include/rm_parse.h302
-rw-r--r--audio_codec/libraac/include/rm_property.h107
-rw-r--r--audio_codec/libraac/include/rm_stream.h115
-rw-r--r--audio_codec/libraac/include/rm_stream_internal.h77
-rw-r--r--audio_codec/libraac/include/rv20backend.h69
-rw-r--r--audio_codec/libraac/include/rv30backend.h68
-rw-r--r--audio_codec/libraac/include/rv_backend.h84
-rw-r--r--audio_codec/libraac/include/rv_backend_types.h198
-rw-r--r--audio_codec/libraac/include/rv_decode.h208
-rw-r--r--audio_codec/libraac/include/rv_decode_message.h492
-rw-r--r--audio_codec/libraac/include/rv_depack.h162
-rw-r--r--audio_codec/libraac/include/rv_format_info.h91
-rw-r--r--audio_codec/libraac/include/statname.h118
-rw-r--r--audio_codec/libraac/include/stream_hdr_structs.h66
-rw-r--r--audio_codec/libraac/include/stream_hdr_utils.h77
-rw-r--r--audio_codec/libraac/include/string_utils.h62
-rw-r--r--audio_codec/libraac/include/tngpkt.h400
-rw-r--r--audio_codec/libraac/memory_utils.c100
-rw-r--r--audio_codec/libraac/noiseless.c503
-rw-r--r--audio_codec/libraac/pack_utils.c306
-rw-r--r--audio_codec/libraac/pns.c369
-rw-r--r--audio_codec/libraac/ra_depack.c230
-rw-r--r--audio_codec/libraac/ra_depack_internal.c1713
-rw-r--r--audio_codec/libraac/ra_depack_internal.h232
-rw-r--r--audio_codec/libraac/raac_decode.c854
-rw-r--r--audio_codec/libraac/raac_decode.h37
-rw-r--r--audio_codec/libraac/rm_error_default.c60
-rw-r--r--audio_codec/libraac/rm_io_default.c101
-rw-r--r--audio_codec/libraac/rm_memory_default.c54
-rw-r--r--audio_codec/libraac/rm_packet.c117
-rw-r--r--audio_codec/libraac/rm_parser.c649
-rw-r--r--audio_codec/libraac/rm_parser_internal.c3342
-rw-r--r--audio_codec/libraac/rm_parser_internal.h420
-rw-r--r--audio_codec/libraac/rm_property.c105
-rw-r--r--audio_codec/libraac/rm_stream.c356
-rw-r--r--audio_codec/libraac/rv_depack.c271
-rw-r--r--audio_codec/libraac/rv_depack_internal.c1071
-rw-r--r--audio_codec/libraac/rv_depack_internal.h171
-rw-r--r--audio_codec/libraac/sbr.c431
-rw-r--r--audio_codec/libraac/sbr.h381
-rwxr-xr-xaudio_codec/libraac/sbrcov.s164
-rw-r--r--audio_codec/libraac/sbrfft.c368
-rw-r--r--audio_codec/libraac/sbrfreq.c667
-rw-r--r--audio_codec/libraac/sbrhfadj.c877
-rw-r--r--audio_codec/libraac/sbrhfgen.c646
-rw-r--r--audio_codec/libraac/sbrhuff.c492
-rw-r--r--audio_codec/libraac/sbrimdct.c447
-rw-r--r--audio_codec/libraac/sbrmath.c198
-rw-r--r--audio_codec/libraac/sbrqmf.c643
-rwxr-xr-xaudio_codec/libraac/sbrqmfak.s182
-rwxr-xr-xaudio_codec/libraac/sbrqmfsk.s130
-rw-r--r--audio_codec/libraac/sbrside.c615
-rw-r--r--audio_codec/libraac/sbrtabs.c400
-rw-r--r--audio_codec/libraac/statname.h115
-rw-r--r--audio_codec/libraac/stproc.c252
-rw-r--r--audio_codec/libraac/stream_hdr_utils.c136
-rw-r--r--audio_codec/libraac/string_utils.c87
-rw-r--r--audio_codec/libraac/tns.c307
-rw-r--r--audio_codec/libraac/trigtabs.c1000
-rw-r--r--audio_codec/libraac/trigtabs_fltgen.c357
-rwxr-xr-xaudio_codec/wfd_aac_decoder/Android.mk23
-rw-r--r--audio_codec/wfd_aac_decoder/aaccommon.h210
-rw-r--r--audio_codec/wfd_aac_decoder/aacdec.c508
-rw-r--r--audio_codec/wfd_aac_decoder/aacdec.h206
-rw-r--r--audio_codec/wfd_aac_decoder/aactabs.c157
-rw-r--r--audio_codec/wfd_aac_decoder/assembly.h640
-rw-r--r--audio_codec/wfd_aac_decoder/assembly_mw.h743
-rw-r--r--audio_codec/wfd_aac_decoder/bitstream.c261
-rw-r--r--audio_codec/wfd_aac_decoder/bitstream.h74
-rw-r--r--audio_codec/wfd_aac_decoder/buffers.c140
-rw-r--r--audio_codec/wfd_aac_decoder/coder.h369
-rw-r--r--audio_codec/wfd_aac_decoder/dct4.c337
-rw-r--r--audio_codec/wfd_aac_decoder/decelmnt.c445
-rw-r--r--audio_codec/wfd_aac_decoder/dequant.c379
-rw-r--r--audio_codec/wfd_aac_decoder/fft.c391
-rw-r--r--audio_codec/wfd_aac_decoder/filefmt.c539
-rw-r--r--audio_codec/wfd_aac_decoder/helix_aac_decode.c548
-rw-r--r--audio_codec/wfd_aac_decoder/huffman.c450
-rw-r--r--audio_codec/wfd_aac_decoder/hufftabs.c177
-rw-r--r--audio_codec/wfd_aac_decoder/imdct.c596
-rw-r--r--audio_codec/wfd_aac_decoder/noiseless.c513
-rw-r--r--audio_codec/wfd_aac_decoder/pns.c371
-rw-r--r--audio_codec/wfd_aac_decoder/sbr.c434
-rw-r--r--audio_codec/wfd_aac_decoder/sbr.h380
-rw-r--r--audio_codec/wfd_aac_decoder/sbrfft.c368
-rw-r--r--audio_codec/wfd_aac_decoder/sbrfreq.c673
-rw-r--r--audio_codec/wfd_aac_decoder/sbrhfadj.c882
-rw-r--r--audio_codec/wfd_aac_decoder/sbrhfgen.c655
-rw-r--r--audio_codec/wfd_aac_decoder/sbrhuff.c494
-rw-r--r--audio_codec/wfd_aac_decoder/sbrimdct.c447
-rw-r--r--audio_codec/wfd_aac_decoder/sbrmath.c198
-rw-r--r--audio_codec/wfd_aac_decoder/sbrqmf.c648
-rw-r--r--audio_codec/wfd_aac_decoder/sbrside.c634
-rw-r--r--audio_codec/wfd_aac_decoder/sbrtabs.c400
-rw-r--r--audio_codec/wfd_aac_decoder/statname.h115
-rw-r--r--audio_codec/wfd_aac_decoder/stproc.c251
-rw-r--r--audio_codec/wfd_aac_decoder/tns.c307
-rw-r--r--audio_codec/wfd_aac_decoder/trigtabs.c1000
-rw-r--r--audio_codec/wfd_aac_decoder/trigtabs_fltgen.c357
545 files changed, 230976 insertions, 0 deletions
diff --git a/audio_codec/libfaad/ps_syntax.c b/audio_codec/libfaad/ps_syntax.c
new file mode 100644
index 0000000..23ce7a9
--- a/dev/null
+++ b/audio_codec/libfaad/ps_syntax.c
@@ -0,0 +1,532 @@
+/*
+** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
+** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
+**
+** This program is free software; you can redistribute it and/or modify
+** it under the terms of the GNU General Public License as published by
+** the Free Software Foundation; either version 2 of the License, or
+** (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+** GNU General Public License for more details.
+**
+** You should have received a copy of the GNU General Public License
+** along with this program; if not, write to the Free Software
+** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+**
+** Any non-GPL usage of this software or parts of this software is strictly
+** forbidden.
+**
+** The "appropriate copyright message" mentioned in section 2c of the GPLv2
+** must read: "Code from FAAD2 is copyright (c) Nero AG, www.nero.com"
+**
+** Commercial non-GPL licensing of this software is possible.
+** For more info contact Nero AG through Mpeg4AAClicense@nero.com.
+**
+** $Id: ps_syntax.c,v 1.11 2007/11/01 12:33:33 menno Exp $
+**/
+
+#include "common.h"
+
+#ifdef PS_DEC
+
+#include "bits.h"
+#include "ps_dec.h"
+
+/* type definitaions */
+typedef const int8_t (*ps_huff_tab)[2];
+
+/* static data tables */
+static const uint8_t nr_iid_par_tab[] = {
+ 10, 20, 34, 10, 20, 34, 0, 0
+};
+static const uint8_t nr_ipdopd_par_tab[] = {
+ 5, 11, 17, 5, 11, 17, 0, 0
+};
+static const uint8_t nr_icc_par_tab[] = {
+ 10, 20, 34, 10, 20, 34, 0, 0
+};
+static const uint8_t num_env_tab[][4] = {
+ { 0, 1, 2, 4 },
+ { 1, 2, 3, 4 }
+};
+
+/* binary lookup huffman tables */
+static const int8_t f_huff_iid_def[][2] = {
+ { /*0*/ -31, 1 }, /* index 0: 1 bits: x */
+ { 2, 3 }, /* index 1: 2 bits: 1x */
+ { /*1*/ -30, /*-1*/ -32 }, /* index 2: 3 bits: 10x */
+ { 4, 5 }, /* index 3: 3 bits: 11x */
+ { /*2*/ -29, /*-2*/ -33 }, /* index 4: 4 bits: 110x */
+ { 6, 7 }, /* index 5: 4 bits: 111x */
+ { /*3*/ -28, /*-3*/ -34 }, /* index 6: 5 bits: 1110x */
+ { 8, 9 }, /* index 7: 5 bits: 1111x */
+ { /*-4*/ -35, /*4*/ -27 }, /* index 8: 6 bits: 11110x */
+ { /*5*/ -26, 10 }, /* index 9: 6 bits: 11111x */
+ { /*-5*/ -36, 11 }, /* index 10: 7 bits: 111111x */
+ { /*6*/ -25, 12 }, /* index 11: 8 bits: 1111111x */
+ { /*-6*/ -37, 13 }, /* index 12: 9 bits: 11111111x */
+ { /*-7*/ -38, 14 }, /* index 13: 10 bits: 111111111x */
+ { /*7*/ -24, 15 }, /* index 14: 11 bits: 1111111111x */
+ { 16, 17 }, /* index 15: 12 bits: 11111111111x */
+ { /*8*/ -23, /*-8*/ -39 }, /* index 16: 13 bits: 111111111110x */
+ { 18, 19 }, /* index 17: 13 bits: 111111111111x */
+ { /*9*/ -22, /*10*/ -21 }, /* index 18: 14 bits: 1111111111110x */
+ { 20, 21 }, /* index 19: 14 bits: 1111111111111x */
+ { /*-9*/ -40, /*11*/ -20 }, /* index 20: 15 bits: 11111111111110x */
+ { 22, 23 }, /* index 21: 15 bits: 11111111111111x */
+ { /*-10*/ -41, 24 }, /* index 22: 16 bits: 111111111111110x */
+ { 25, 26 }, /* index 23: 16 bits: 111111111111111x */
+ { /*-11*/ -42, /*-14*/ -45 }, /* index 24: 17 bits: 1111111111111101x */
+ { /*-13*/ -44, /*-12*/ -43 }, /* index 25: 17 bits: 1111111111111110x */
+ { /*12*/ -19, 27 }, /* index 26: 17 bits: 1111111111111111x */
+ { /*13*/ -18, /*14*/ -17 } /* index 27: 18 bits: 11111111111111111x */
+};
+
+static const int8_t t_huff_iid_def[][2] = {
+ { /*0*/ -31, 1 }, /* index 0: 1 bits: x */
+ { /*-1*/ -32, 2 }, /* index 1: 2 bits: 1x */
+ { /*1*/ -30, 3 }, /* index 2: 3 bits: 11x */
+ { /*-2*/ -33, 4 }, /* index 3: 4 bits: 111x */
+ { /*2*/ -29, 5 }, /* index 4: 5 bits: 1111x */
+ { /*-3*/ -34, 6 }, /* index 5: 6 bits: 11111x */
+ { /*3*/ -28, 7 }, /* index 6: 7 bits: 111111x */
+ { /*-4*/ -35, 8 }, /* index 7: 8 bits: 1111111x */
+ { /*4*/ -27, 9 }, /* index 8: 9 bits: 11111111x */
+ { /*-5*/ -36, 10 }, /* index 9: 10 bits: 111111111x */
+ { /*5*/ -26, 11 }, /* index 10: 11 bits: 1111111111x */
+ { /*-6*/ -37, 12 }, /* index 11: 12 bits: 11111111111x */
+ { /*6*/ -25, 13 }, /* index 12: 13 bits: 111111111111x */
+ { /*7*/ -24, 14 }, /* index 13: 14 bits: 1111111111111x */
+ { /*-7*/ -38, 15 }, /* index 14: 15 bits: 11111111111111x */
+ { 16, 17 }, /* index 15: 16 bits: 111111111111111x */
+ { /*8*/ -23, /*-8*/ -39 }, /* index 16: 17 bits: 1111111111111110x */
+ { 18, 19 }, /* index 17: 17 bits: 1111111111111111x */
+ { 20, 21 }, /* index 18: 18 bits: 11111111111111110x */
+ { 22, 23 }, /* index 19: 18 bits: 11111111111111111x */
+ { /*9*/ -22, /*-14*/ -45 }, /* index 20: 19 bits: 111111111111111100x */
+ { /*-13*/ -44, /*-12*/ -43 }, /* index 21: 19 bits: 111111111111111101x */
+ { 24, 25 }, /* index 22: 19 bits: 111111111111111110x */
+ { 26, 27 }, /* index 23: 19 bits: 111111111111111111x */
+ { /*-11*/ -42, /*-10*/ -41 }, /* index 24: 20 bits: 1111111111111111100x */
+ { /*-9*/ -40, /*10*/ -21 }, /* index 25: 20 bits: 1111111111111111101x */
+ { /*11*/ -20, /*12*/ -19 }, /* index 26: 20 bits: 1111111111111111110x */
+ { /*13*/ -18, /*14*/ -17 } /* index 27: 20 bits: 1111111111111111111x */
+};
+
+static const int8_t f_huff_iid_fine[][2] = {
+ { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
+ { 2, 3 }, /* index 1: 2 bits: 0x */
+ { 4, /*-1*/ -32 }, /* index 2: 3 bits: 00x */
+ { /*1*/ -30, 5 }, /* index 3: 3 bits: 01x */
+ { /*-2*/ -33, /*2*/ -29 }, /* index 4: 4 bits: 000x */
+ { 6, 7 }, /* index 5: 4 bits: 011x */
+ { /*-3*/ -34, /*3*/ -28 }, /* index 6: 5 bits: 0110x */
+ { 8, 9 }, /* index 7: 5 bits: 0111x */
+ { /*-4*/ -35, /*4*/ -27 }, /* index 8: 6 bits: 01110x */
+ { 10, 11 }, /* index 9: 6 bits: 01111x */
+ { /*-5*/ -36, /*5*/ -26 }, /* index 10: 7 bits: 011110x */
+ { 12, 13 }, /* index 11: 7 bits: 011111x */
+ { /*-6*/ -37, /*6*/ -25 }, /* index 12: 8 bits: 0111110x */
+ { 14, 15 }, /* index 13: 8 bits: 0111111x */
+ { /*7*/ -24, 16 }, /* index 14: 9 bits: 01111110x */
+ { 17, 18 }, /* index 15: 9 bits: 01111111x */
+ { 19, /*-8*/ -39 }, /* index 16: 10 bits: 011111101x */
+ { /*8*/ -23, 20 }, /* index 17: 10 bits: 011111110x */
+ { 21, /*-7*/ -38 }, /* index 18: 10 bits: 011111111x */
+ { /*10*/ -21, 22 }, /* index 19: 11 bits: 0111111010x */
+ { 23, /*-9*/ -40 }, /* index 20: 11 bits: 0111111101x */
+ { /*9*/ -22, 24 }, /* index 21: 11 bits: 0111111110x */
+ { /*-11*/ -42, /*11*/ -20 }, /* index 22: 12 bits: 01111110101x */
+ { 25, 26 }, /* index 23: 12 bits: 01111111010x */
+ { 27, /*-10*/ -41 }, /* index 24: 12 bits: 01111111101x */
+ { 28, /*-12*/ -43 }, /* index 25: 13 bits: 011111110100x */
+ { /*12*/ -19, 29 }, /* index 26: 13 bits: 011111110101x */
+ { 30, 31 }, /* index 27: 13 bits: 011111111010x */
+ { 32, /*-14*/ -45 }, /* index 28: 14 bits: 0111111101000x */
+ { /*14*/ -17, 33 }, /* index 29: 14 bits: 0111111101011x */
+ { 34, /*-13*/ -44 }, /* index 30: 14 bits: 0111111110100x */
+ { /*13*/ -18, 35 }, /* index 31: 14 bits: 0111111110101x */
+ { 36, 37 }, /* index 32: 15 bits: 01111111010000x */
+ { 38, /*-15*/ -46 }, /* index 33: 15 bits: 01111111010111x */
+ { /*15*/ -16, 39 }, /* index 34: 15 bits: 01111111101000x */
+ { 40, 41 }, /* index 35: 15 bits: 01111111101011x */
+ { 42, 43 }, /* index 36: 16 bits: 011111110100000x */
+ { /*-17*/ -48, /*17*/ -14 }, /* index 37: 16 bits: 011111110100001x */
+ { 44, 45 }, /* index 38: 16 bits: 011111110101110x */
+ { 46, 47 }, /* index 39: 16 bits: 011111111010001x */
+ { 48, 49 }, /* index 40: 16 bits: 011111111010110x */
+ { /*-16*/ -47, /*16*/ -15 }, /* index 41: 16 bits: 011111111010111x */
+ { /*-21*/ -52, /*21*/ -10 }, /* index 42: 17 bits: 0111111101000000x */
+ { /*-19*/ -50, /*19*/ -12 }, /* index 43: 17 bits: 0111111101000001x */
+ { /*-18*/ -49, /*18*/ -13 }, /* index 44: 17 bits: 0111111101011100x */
+ { 50, 51 }, /* index 45: 17 bits: 0111111101011101x */
+ { 52, 53 }, /* index 46: 17 bits: 0111111110100010x */
+ { 54, 55 }, /* index 47: 17 bits: 0111111110100011x */
+ { 56, 57 }, /* index 48: 17 bits: 0111111110101100x */
+ { 58, 59 }, /* index 49: 17 bits: 0111111110101101x */
+ { /*-26*/ -57, /*-25*/ -56 }, /* index 50: 18 bits: 01111111010111010x */
+ { /*-28*/ -59, /*-27*/ -58 }, /* index 51: 18 bits: 01111111010111011x */
+ { /*-22*/ -53, /*22*/ -9 }, /* index 52: 18 bits: 01111111101000100x */
+ { /*-24*/ -55, /*-23*/ -54 }, /* index 53: 18 bits: 01111111101000101x */
+ { /*25*/ -6, /*26*/ -5 }, /* index 54: 18 bits: 01111111101000110x */
+ { /*23*/ -8, /*24*/ -7 }, /* index 55: 18 bits: 01111111101000111x */
+ { /*29*/ -2, /*30*/ -1 }, /* index 56: 18 bits: 01111111101011000x */
+ { /*27*/ -4, /*28*/ -3 }, /* index 57: 18 bits: 01111111101011001x */
+ { /*-30*/ -61, /*-29*/ -60 }, /* index 58: 18 bits: 01111111101011010x */
+ { /*-20*/ -51, /*20*/ -11 } /* index 59: 18 bits: 01111111101011011x */
+};
+
+static const int8_t t_huff_iid_fine[][2] = {
+ { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
+ { /*1*/ -30, 2 }, /* index 1: 2 bits: 0x */
+ { 3, /*-1*/ -32 }, /* index 2: 3 bits: 01x */
+ { 4, 5 }, /* index 3: 4 bits: 010x */
+ { 6, 7 }, /* index 4: 5 bits: 0100x */
+ { /*-2*/ -33, /*2*/ -29 }, /* index 5: 5 bits: 0101x */
+ { 8, /*-3*/ -34 }, /* index 6: 6 bits: 01000x */
+ { /*3*/ -28, 9 }, /* index 7: 6 bits: 01001x */
+ { /*-4*/ -35, /*4*/ -27 }, /* index 8: 7 bits: 010000x */
+ { 10, 11 }, /* index 9: 7 bits: 010011x */
+ { /*5*/ -26, 12 }, /* index 10: 8 bits: 0100110x */
+ { 13, 14 }, /* index 11: 8 bits: 0100111x */
+ { /*-6*/ -37, /*6*/ -25 }, /* index 12: 9 bits: 01001101x */
+ { 15, 16 }, /* index 13: 9 bits: 01001110x */
+ { 17, /*-5*/ -36 }, /* index 14: 9 bits: 01001111x */
+ { 18, /*-7*/ -38 }, /* index 15: 10 bits: 010011100x */
+ { /*7*/ -24, 19 }, /* index 16: 10 bits: 010011101x */
+ { 20, 21 }, /* index 17: 10 bits: 010011110x */
+ { /*9*/ -22, 22 }, /* index 18: 11 bits: 0100111000x */
+ { 23, 24 }, /* index 19: 11 bits: 0100111011x */
+ { /*-8*/ -39, /*8*/ -23 }, /* index 20: 11 bits: 0100111100x */
+ { 25, 26 }, /* index 21: 11 bits: 0100111101x */
+ { /*11*/ -20, 27 }, /* index 22: 12 bits: 01001110001x */
+ { 28, 29 }, /* index 23: 12 bits: 01001110110x */
+ { /*-10*/ -41, /*10*/ -21 }, /* index 24: 12 bits: 01001110111x */
+ { 30, 31 }, /* index 25: 12 bits: 01001111010x */
+ { 32, /*-9*/ -40 }, /* index 26: 12 bits: 01001111011x */
+ { 33, /*-13*/ -44 }, /* index 27: 13 bits: 010011100011x */
+ { /*13*/ -18, 34 }, /* index 28: 13 bits: 010011101100x */
+ { 35, 36 }, /* index 29: 13 bits: 010011101101x */
+ { 37, /*-12*/ -43 }, /* index 30: 13 bits: 010011110100x */
+ { /*12*/ -19, 38 }, /* index 31: 13 bits: 010011110101x */
+ { 39, /*-11*/ -42 }, /* index 32: 13 bits: 010011110110x */
+ { 40, 41 }, /* index 33: 14 bits: 0100111000110x */
+ { 42, 43 }, /* index 34: 14 bits: 0100111011001x */
+ { 44, 45 }, /* index 35: 14 bits: 0100111011010x */
+ { 46, /*-15*/ -46 }, /* index 36: 14 bits: 0100111011011x */
+ { /*15*/ -16, 47 }, /* index 37: 14 bits: 0100111101000x */
+ { /*-14*/ -45, /*14*/ -17 }, /* index 38: 14 bits: 0100111101011x */
+ { 48, 49 }, /* index 39: 14 bits: 0100111101100x */
+ { /*-21*/ -52, /*-20*/ -51 }, /* index 40: 15 bits: 01001110001100x */
+ { /*18*/ -13, /*19*/ -12 }, /* index 41: 15 bits: 01001110001101x */
+ { /*-19*/ -50, /*-18*/ -49 }, /* index 42: 15 bits: 01001110110010x */
+ { 50, 51 }, /* index 43: 15 bits: 01001110110011x */
+ { 52, 53 }, /* index 44: 15 bits: 01001110110100x */
+ { 54, 55 }, /* index 45: 15 bits: 01001110110101x */
+ { 56, /*-17*/ -48 }, /* index 46: 15 bits: 01001110110110x */
+ { /*17*/ -14, 57 }, /* index 47: 15 bits: 01001111010001x */
+ { 58, /*-16*/ -47 }, /* index 48: 15 bits: 01001111011000x */
+ { /*16*/ -15, 59 }, /* index 49: 15 bits: 01001111011001x */
+ { /*-26*/ -57, /*26*/ -5 }, /* index 50: 16 bits: 010011101100110x */
+ { /*-28*/ -59, /*-27*/ -58 }, /* index 51: 16 bits: 010011101100111x */
+ { /*29*/ -2, /*30*/ -1 }, /* index 52: 16 bits: 010011101101000x */
+ { /*27*/ -4, /*28*/ -3 }, /* index 53: 16 bits: 010011101101001x */
+ { /*-30*/ -61, /*-29*/ -60 }, /* index 54: 16 bits: 010011101101010x */
+ { /*-25*/ -56, /*25*/ -6 }, /* index 55: 16 bits: 010011101101011x */
+ { /*-24*/ -55, /*24*/ -7 }, /* index 56: 16 bits: 010011101101100x */
+ { /*-23*/ -54, /*23*/ -8 }, /* index 57: 16 bits: 010011110100011x */
+ { /*-22*/ -53, /*22*/ -9 }, /* index 58: 16 bits: 010011110110000x */
+ { /*20*/ -11, /*21*/ -10 } /* index 59: 16 bits: 010011110110011x */
+};
+
+static const int8_t f_huff_icc[][2] = {
+ { /*0*/ -31, 1 }, /* index 0: 1 bits: x */
+ { /*1*/ -30, 2 }, /* index 1: 2 bits: 1x */
+ { /*-1*/ -32, 3 }, /* index 2: 3 bits: 11x */
+ { /*2*/ -29, 4 }, /* index 3: 4 bits: 111x */
+ { /*-2*/ -33, 5 }, /* index 4: 5 bits: 1111x */
+ { /*3*/ -28, 6 }, /* index 5: 6 bits: 11111x */
+ { /*-3*/ -34, 7 }, /* index 6: 7 bits: 111111x */
+ { /*4*/ -27, 8 }, /* index 7: 8 bits: 1111111x */
+ { /*5*/ -26, 9 }, /* index 8: 9 bits: 11111111x */
+ { /*-4*/ -35, 10 }, /* index 9: 10 bits: 111111111x */
+ { /*6*/ -25, 11 }, /* index 10: 11 bits: 1111111111x */
+ { /*-5*/ -36, 12 }, /* index 11: 12 bits: 11111111111x */
+ { /*7*/ -24, 13 }, /* index 12: 13 bits: 111111111111x */
+ { /*-6*/ -37, /*-7*/ -38 } /* index 13: 14 bits: 1111111111111x */
+};
+
+static const int8_t t_huff_icc[][2] = {
+ { /*0*/ -31, 1 }, /* index 0: 1 bits: x */
+ { /*1*/ -30, 2 }, /* index 1: 2 bits: 1x */
+ { /*-1*/ -32, 3 }, /* index 2: 3 bits: 11x */
+ { /*2*/ -29, 4 }, /* index 3: 4 bits: 111x */
+ { /*-2*/ -33, 5 }, /* index 4: 5 bits: 1111x */
+ { /*3*/ -28, 6 }, /* index 5: 6 bits: 11111x */
+ { /*-3*/ -34, 7 }, /* index 6: 7 bits: 111111x */
+ { /*4*/ -27, 8 }, /* index 7: 8 bits: 1111111x */
+ { /*-4*/ -35, 9 }, /* index 8: 9 bits: 11111111x */
+ { /*5*/ -26, 10 }, /* index 9: 10 bits: 111111111x */
+ { /*-5*/ -36, 11 }, /* index 10: 11 bits: 1111111111x */
+ { /*6*/ -25, 12 }, /* index 11: 12 bits: 11111111111x */
+ { /*-6*/ -37, 13 }, /* index 12: 13 bits: 111111111111x */
+ { /*-7*/ -38, /*7*/ -24 } /* index 13: 14 bits: 1111111111111x */
+};
+
+static const int8_t f_huff_ipd[][2] = {
+ { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
+ { 2, 3 }, /* index 1: 2 bits: 0x */
+ { /*1*/ -30, 4 }, /* index 2: 3 bits: 00x */
+ { 5, 6 }, /* index 3: 3 bits: 01x */
+ { /*4*/ -27, /*5*/ -26 }, /* index 4: 4 bits: 001x */
+ { /*3*/ -28, /*6*/ -25 }, /* index 5: 4 bits: 010x */
+ { /*2*/ -29, /*7*/ -24 } /* index 6: 4 bits: 011x */
+};
+
+static const int8_t t_huff_ipd[][2] = {
+ { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
+ { 2, 3 }, /* index 1: 2 bits: 0x */
+ { 4, 5 }, /* index 2: 3 bits: 00x */
+ { /*1*/ -30, /*7*/ -24 }, /* index 3: 3 bits: 01x */
+ { /*5*/ -26, 6 }, /* index 4: 4 bits: 000x */
+ { /*2*/ -29, /*6*/ -25 }, /* index 5: 4 bits: 001x */
+ { /*4*/ -27, /*3*/ -28 } /* index 6: 5 bits: 0001x */
+};
+
+static const int8_t f_huff_opd[][2] = {
+ { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
+ { 2, 3 }, /* index 1: 2 bits: 0x */
+ { /*7*/ -24, /*1*/ -30 }, /* index 2: 3 bits: 00x */
+ { 4, 5 }, /* index 3: 3 bits: 01x */
+ { /*3*/ -28, /*6*/ -25 }, /* index 4: 4 bits: 010x */
+ { /*2*/ -29, 6 }, /* index 5: 4 bits: 011x */
+ { /*5*/ -26, /*4*/ -27 } /* index 6: 5 bits: 0111x */
+};
+
+static const int8_t t_huff_opd[][2] = {
+ { 1, /*0*/ -31 }, /* index 0: 1 bits: x */
+ { 2, 3 }, /* index 1: 2 bits: 0x */
+ { 4, 5 }, /* index 2: 3 bits: 00x */
+ { /*1*/ -30, /*7*/ -24 }, /* index 3: 3 bits: 01x */
+ { /*5*/ -26, /*2*/ -29 }, /* index 4: 4 bits: 000x */
+ { /*6*/ -25, 6 }, /* index 5: 4 bits: 001x */
+ { /*4*/ -27, /*3*/ -28 } /* index 6: 5 bits: 0011x */
+};
+
+/* static function declarations */
+static uint16_t ps_extension(ps_info *ps, bitfile *ld,
+ const uint8_t ps_extension_id,
+ const uint16_t num_bits_left);
+static void huff_data(bitfile *ld, const uint8_t dt, const uint8_t nr_par,
+ ps_huff_tab t_huff, ps_huff_tab f_huff, int8_t *par);
+static INLINE int8_t ps_huff_dec(bitfile *ld, ps_huff_tab t_huff);
+
+
+uint16_t ps_data(ps_info *ps, bitfile *ld, uint8_t *header)
+{
+ uint8_t tmp, n;
+ uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
+
+ *header = 0;
+
+ /* check for new PS header */
+ if (faad_get1bit(ld
+ DEBUGVAR(1, 1000, "ps_data(): enable_ps_header"))) {
+ *header = 1;
+
+ ps->header_read = 1;
+
+ ps->use34hybrid_bands = 0;
+
+ /* Inter-channel Intensity Difference (IID) parameters enabled */
+ ps->enable_iid = (uint8_t)faad_get1bit(ld
+ DEBUGVAR(1, 1001, "ps_data(): enable_iid"));
+
+ if (ps->enable_iid) {
+ ps->iid_mode = (uint8_t)faad_getbits(ld, 3
+ DEBUGVAR(1, 1002, "ps_data(): iid_mode"));
+
+ ps->nr_iid_par = nr_iid_par_tab[ps->iid_mode];
+ ps->nr_ipdopd_par = nr_ipdopd_par_tab[ps->iid_mode];
+
+ if (ps->iid_mode == 2 || ps->iid_mode == 5) {
+ ps->use34hybrid_bands = 1;
+ }
+
+ /* IPD freq res equal to IID freq res */
+ ps->ipd_mode = ps->iid_mode;
+ }
+
+ /* Inter-channel Coherence (ICC) parameters enabled */
+ ps->enable_icc = (uint8_t)faad_get1bit(ld
+ DEBUGVAR(1, 1003, "ps_data(): enable_icc"));
+
+ if (ps->enable_icc) {
+ ps->icc_mode = (uint8_t)faad_getbits(ld, 3
+ DEBUGVAR(1, 1004, "ps_data(): icc_mode"));
+
+ ps->nr_icc_par = nr_icc_par_tab[ps->icc_mode];
+
+ if (ps->icc_mode == 2 || ps->icc_mode == 5) {
+ ps->use34hybrid_bands = 1;
+ }
+ }
+
+ /* PS extension layer enabled */
+ ps->enable_ext = (uint8_t)faad_get1bit(ld
+ DEBUGVAR(1, 1005, "ps_data(): enable_ext"));
+ }
+
+ /* we are here, but no header has been read yet */
+ if (ps->header_read == 0) {
+ ps->ps_data_available = 0;
+ return 1;
+ }
+
+ ps->frame_class = (uint8_t)faad_get1bit(ld
+ DEBUGVAR(1, 1006, "ps_data(): frame_class"));
+ tmp = (uint8_t)faad_getbits(ld, 2
+ DEBUGVAR(1, 1007, "ps_data(): num_env_idx"));
+
+ ps->num_env = num_env_tab[ps->frame_class][tmp];
+
+ if (ps->frame_class) {
+ for (n = 1; n < ps->num_env + 1; n++) {
+ ps->border_position[n] = (uint8_t)faad_getbits(ld, 5
+ DEBUGVAR(1, 1008, "ps_data(): border_position")) + 1;
+ }
+ }
+
+ if (ps->enable_iid) {
+ for (n = 0; n < ps->num_env; n++) {
+ ps->iid_dt[n] = (uint8_t)faad_get1bit(ld
+ DEBUGVAR(1, 1009, "ps_data(): iid_dt"));
+
+ /* iid_data */
+ if (ps->iid_mode < 3) {
+ huff_data(ld, ps->iid_dt[n], ps->nr_iid_par, t_huff_iid_def,
+ f_huff_iid_def, ps->iid_index[n]);
+ } else {
+ huff_data(ld, ps->iid_dt[n], ps->nr_iid_par, t_huff_iid_fine,
+ f_huff_iid_fine, ps->iid_index[n]);
+ }
+ }
+ }
+
+ if (ps->enable_icc) {
+ for (n = 0; n < ps->num_env; n++) {
+ ps->icc_dt[n] = (uint8_t)faad_get1bit(ld
+ DEBUGVAR(1, 1010, "ps_data(): icc_dt"));
+
+ /* icc_data */
+ huff_data(ld, ps->icc_dt[n], ps->nr_icc_par, t_huff_icc,
+ f_huff_icc, ps->icc_index[n]);
+ }
+ }
+
+ if (ps->enable_ext) {
+ uint16_t num_bits_left;
+ uint16_t cnt = (uint16_t)faad_getbits(ld, 4
+ DEBUGVAR(1, 1011, "ps_data(): ps_extension_size"));
+ if (cnt == 15) {
+ cnt += (uint16_t)faad_getbits(ld, 8
+ DEBUGVAR(1, 1012, "ps_data(): esc_count"));
+ }
+
+ num_bits_left = 8 * cnt;
+ while (num_bits_left > 7) {
+ uint8_t ps_extension_id = (uint8_t)faad_getbits(ld, 2
+ DEBUGVAR(1, 1013, "ps_data(): ps_extension_size"));
+
+ num_bits_left -= 2;
+ num_bits_left -= ps_extension(ps, ld, ps_extension_id, num_bits_left);
+ }
+
+ faad_getbits(ld, num_bits_left
+ DEBUGVAR(1, 1014, "ps_data(): fill_bits"));
+ }
+
+ bits = (uint16_t)faad_get_processed_bits(ld) - bits;
+
+ ps->ps_data_available = 1;
+
+ return bits;
+}
+
+static uint16_t ps_extension(ps_info *ps, bitfile *ld,
+ const uint8_t ps_extension_id,
+ const uint16_t num_bits_left)
+{
+ uint8_t n;
+ uint16_t bits = (uint16_t)faad_get_processed_bits(ld);
+
+ if (ps_extension_id == 0) {
+ ps->enable_ipdopd = (uint8_t)faad_get1bit(ld
+ DEBUGVAR(1, 1015, "ps_extension(): enable_ipdopd"));
+
+ if (ps->enable_ipdopd) {
+ for (n = 0; n < ps->num_env; n++) {
+ ps->ipd_dt[n] = (uint8_t)faad_get1bit(ld
+ DEBUGVAR(1, 1016, "ps_extension(): ipd_dt"));
+
+ /* ipd_data */
+ huff_data(ld, ps->ipd_dt[n], ps->nr_ipdopd_par, t_huff_ipd,
+ f_huff_ipd, ps->ipd_index[n]);
+
+ ps->opd_dt[n] = (uint8_t)faad_get1bit(ld
+ DEBUGVAR(1, 1017, "ps_extension(): opd_dt"));
+
+ /* opd_data */
+ huff_data(ld, ps->opd_dt[n], ps->nr_ipdopd_par, t_huff_opd,
+ f_huff_opd, ps->opd_index[n]);
+ }
+ }
+ faad_get1bit(ld
+ DEBUGVAR(1, 1018, "ps_extension(): reserved_ps"));
+ }
+
+ /* return number of bits read */
+ bits = (uint16_t)faad_get_processed_bits(ld) - bits;
+
+ return bits;
+}
+
+/* read huffman data coded in either the frequency or the time direction */
+static void huff_data(bitfile *ld, const uint8_t dt, const uint8_t nr_par,
+ ps_huff_tab t_huff, ps_huff_tab f_huff, int8_t *par)
+{
+ uint8_t n;
+
+ if (dt) {
+ /* coded in time direction */
+ for (n = 0; n < nr_par; n++) {
+ par[n] = ps_huff_dec(ld, t_huff);
+ }
+ } else {
+ /* coded in frequency direction */
+ par[0] = ps_huff_dec(ld, f_huff);
+
+ for (n = 1; n < nr_par; n++) {
+ par[n] = ps_huff_dec(ld, f_huff);
+ }
+ }
+}
+
+/* binary search huffman decoding */
+static INLINE int8_t ps_huff_dec(bitfile *ld, ps_huff_tab t_huff)
+{
+ uint8_t bit;
+ int16_t index = 0;
+
+ while (index >= 0) {
+ bit = (uint8_t)faad_get1bit(ld);
+ index = t_huff[index][bit];
+ }
+
+ return index + 31;
+}
+
+#endif