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/wfd_aac_decoder/sbrqmf.c b/audio_codec/wfd_aac_decoder/sbrqmf.c
new file mode 100644
index 0000000..6a9464a
--- a/dev/null
+++ b/audio_codec/wfd_aac_decoder/sbrqmf.c
@@ -0,0 +1,648 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Source last modified: $Id: sbrqmf.c,v 1.1.2.2 2005/05/19 21:00:01 jrecker Exp $
+ *
+ * Portions Copyright (c) 1995-2005 RealNetworks, Inc. All Rights Reserved.
+ *
+ * The contents of this file, and the files included with this file,
+ * are subject to the current version of the RealNetworks Public
+ * Source License (the "RPSL") available at
+ * http://www.helixcommunity.org/content/rpsl unless you have licensed
+ * the file under the current version of the RealNetworks Community
+ * Source License (the "RCSL") available at
+ * http://www.helixcommunity.org/content/rcsl, in which case the RCSL
+ * will apply. You may also obtain the license terms directly from
+ * RealNetworks. You may not use this file except in compliance with
+ * the RPSL or, if you have a valid RCSL with RealNetworks applicable
+ * to this file, the RCSL. Please see the applicable RPSL or RCSL for
+ * the rights, obligations and limitations governing use of the
+ * contents of the file.
+ *
+ * This file is part of the Helix DNA Technology. RealNetworks is the
+ * developer of the Original Code and owns the copyrights in the
+ * portions it created.
+ *
+ * This file, and the files included with this file, is distributed
+ * and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY
+ * KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS
+ * ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET
+ * ENJOYMENT OR NON-INFRINGEMENT.
+ *
+ * Technology Compatibility Kit Test Suite(s) Location:
+ * http://www.helixcommunity.org/content/tck
+ *
+ * Contributor(s):
+ *
+ * ***** END LICENSE BLOCK ***** */
+
+/**************************************************************************************
+ * Fixed-point HE-AAC decoder
+ * Jon Recker (jrecker@real.com)
+ * February 2005
+ *
+ * sbrqmf.c - analysis and synthesis QMF filters for SBR
+ **************************************************************************************/
+
+#include "sbr.h"
+#include "assembly.h"
+
+/* PreMultiply64() table
+ * format = Q30
+ * reordered for sequential access
+ *
+ * for (i = 0; i < 64/4; i++) {
+ * angle = (i + 0.25) * M_PI / nmdct;
+ * x = (cos(angle) + sin(angle));
+ * x = sin(angle);
+ *
+ * angle = (nmdct/2 - 1 - i + 0.25) * M_PI / nmdct;
+ * x = (cos(angle) + sin(angle));
+ * x = sin(angle);
+ * }
+ */
+static const int cos4sin4tab64[64] = {
+ 0x40c7d2bd, 0x00c90e90, 0x424ff28f, 0x3ff4e5e0, 0x43cdd89a, 0x03ecadcf, 0x454149fc, 0x3fc395f9,
+ 0x46aa0d6d, 0x070de172, 0x4807eb4b, 0x3f6af2e3, 0x495aada2, 0x0a2abb59, 0x4aa22036, 0x3eeb3347,
+ 0x4bde1089, 0x0d415013, 0x4d0e4de2, 0x3e44a5ef, 0x4e32a956, 0x104fb80e, 0x4f4af5d1, 0x3d77b192,
+ 0x50570819, 0x135410c3, 0x5156b6d9, 0x3c84d496, 0x5249daa2, 0x164c7ddd, 0x53304df6, 0x3b6ca4c4,
+ 0x5409ed4b, 0x19372a64, 0x54d69714, 0x3a2fcee8, 0x55962bc0, 0x1c1249d8, 0x56488dc5, 0x38cf1669,
+ 0x56eda1a0, 0x1edc1953, 0x57854ddd, 0x374b54ce, 0x580f7b19, 0x2192e09b, 0x588c1404, 0x35a5793c,
+ 0x58fb0568, 0x2434f332, 0x595c3e2a, 0x33de87de, 0x59afaf4c, 0x26c0b162, 0x59f54bee, 0x31f79948,
+ 0x5a2d0957, 0x29348937, 0x5a56deec, 0x2ff1d9c7, 0x5a72c63b, 0x2b8ef77d, 0x5a80baf6, 0x2dce88aa,
+};
+
+/* PostMultiply64() table
+ * format = Q30
+ * reordered for sequential access
+ *
+ * for (i = 0; i <= (32/2); i++) {
+ * angle = i * M_PI / 64;
+ * x = (cos(angle) + sin(angle));
+ * x = sin(angle);
+ * }
+ */
+static const int cos1sin1tab64[34] = {
+ 0x40000000, 0x00000000, 0x43103085, 0x0323ecbe, 0x45f704f7, 0x0645e9af, 0x48b2b335, 0x09640837,
+ 0x4b418bbe, 0x0c7c5c1e, 0x4da1fab5, 0x0f8cfcbe, 0x4fd288dc, 0x1294062f, 0x51d1dc80, 0x158f9a76,
+ 0x539eba45, 0x187de2a7, 0x553805f2, 0x1b5d100a, 0x569cc31b, 0x1e2b5d38, 0x57cc15bc, 0x20e70f32,
+ 0x58c542c5, 0x238e7673, 0x5987b08a, 0x261feffa, 0x5a12e720, 0x2899e64a, 0x5a6690ae, 0x2afad269,
+ 0x5a82799a, 0x2d413ccd,
+};
+
+/**************************************************************************************
+ * Function: PreMultiply64
+ *
+ * Description: pre-twiddle stage of 64-point DCT-IV
+ *
+ * Inputs: buffer of 64 samples
+ *
+ * Outputs: processed samples in same buffer
+ *
+ * Return: none
+ *
+ * Notes: minimum 1 GB in, 2 GB out, gains 2 int bits
+ * gbOut = gbIn + 1
+ * output is limited to sqrt(2)/2 plus GB in full GB
+ * uses 3-mul, 3-add butterflies instead of 4-mul, 2-add
+ **************************************************************************************/
+static void PreMultiply64(int *zbuf1)
+{
+ int i, ar1, ai1, ar2, ai2, z1, z2;
+ int t, cms2, cps2a, sin2a, cps2b, sin2b;
+ int *zbuf2;
+ const int *csptr;
+
+ zbuf2 = zbuf1 + 64 - 1;
+ csptr = cos4sin4tab64;
+
+ /* whole thing should fit in registers - verify that compiler does this */
+ for (i = 64 >> 2; i != 0; i--) {
+ /* cps2 = (cos+sin), sin2 = sin, cms2 = (cos-sin) */
+ cps2a = *csptr++;
+ sin2a = *csptr++;
+ cps2b = *csptr++;
+ sin2b = *csptr++;
+
+ ar1 = *(zbuf1 + 0);
+ ai2 = *(zbuf1 + 1);
+ ai1 = *(zbuf2 + 0);
+ ar2 = *(zbuf2 - 1);
+
+ /* gain 2 ints bit from MULSHIFT32 by Q30
+ * max per-sample gain (ignoring implicit scaling) = MAX(sin(angle)+cos(angle)) = 1.414
+ * i.e. gain 1 GB since worst case is sin(angle) = cos(angle) = 0.707 (Q30), gain 2 from
+ * extra sign bits, and eat one in adding
+ */
+ t = MULSHIFT32(sin2a, ar1 + ai1);
+ z2 = MULSHIFT32(cps2a, ai1) - t;
+ cms2 = cps2a - 2 * sin2a;
+ z1 = MULSHIFT32(cms2, ar1) + t;
+ *zbuf1++ = z1; /* cos*ar1 + sin*ai1 */
+ *zbuf1++ = z2; /* cos*ai1 - sin*ar1 */
+
+ t = MULSHIFT32(sin2b, ar2 + ai2);
+ z2 = MULSHIFT32(cps2b, ai2) - t;
+ cms2 = cps2b - 2 * sin2b;
+ z1 = MULSHIFT32(cms2, ar2) + t;
+ *zbuf2-- = z2; /* cos*ai2 - sin*ar2 */
+ *zbuf2-- = z1; /* cos*ar2 + sin*ai2 */
+ }
+}
+
+/**************************************************************************************
+ * Function: PostMultiply64
+ *
+ * Description: post-twiddle stage of 64-point type-IV DCT
+ *
+ * Inputs: buffer of 64 samples
+ * number of output samples to calculate
+ *
+ * Outputs: processed samples in same buffer
+ *
+ * Return: none
+ *
+ * Notes: minimum 1 GB in, 2 GB out, gains 2 int bits
+ * gbOut = gbIn + 1
+ * output is limited to sqrt(2)/2 plus GB in full GB
+ * nSampsOut is rounded up to next multiple of 4, since we calculate
+ * 4 samples per loop
+ **************************************************************************************/
+static void PostMultiply64(int *fft1, int nSampsOut)
+{
+ int i, ar1, ai1, ar2, ai2;
+ int t, cms2, cps2, sin2;
+ int *fft2;
+ const int *csptr;
+
+ csptr = cos1sin1tab64;
+ fft2 = fft1 + 64 - 1;
+
+ /* load coeffs for first pass
+ * cps2 = (cos+sin)/2, sin2 = sin/2, cms2 = (cos-sin)/2
+ */
+ cps2 = *csptr++;
+ sin2 = *csptr++;
+ cms2 = cps2 - 2 * sin2;
+
+ for (i = (nSampsOut + 3) >> 2; i != 0; i--) {
+ ar1 = *(fft1 + 0);
+ ai1 = *(fft1 + 1);
+ ar2 = *(fft2 - 1);
+ ai2 = *(fft2 + 0);
+
+ /* gain 2 int bits (multiplying by Q30), max gain = sqrt(2) */
+ t = MULSHIFT32(sin2, ar1 + ai1);
+ *fft2-- = t - MULSHIFT32(cps2, ai1);
+ *fft1++ = t + MULSHIFT32(cms2, ar1);
+
+ cps2 = *csptr++;
+ sin2 = *csptr++;
+
+ ai2 = -ai2;
+ t = MULSHIFT32(sin2, ar2 + ai2);
+ *fft2-- = t - MULSHIFT32(cps2, ai2);
+ cms2 = cps2 - 2 * sin2;
+ *fft1++ = t + MULSHIFT32(cms2, ar2);
+ }
+}
+
+/**************************************************************************************
+ * Function: QMFAnalysisConv
+ *
+ * Description: convolution kernel for analysis QMF
+ *
+ * Inputs: pointer to coefficient table, reordered for sequential access
+ * delay buffer of size 32*10 = 320 real-valued PCM samples
+ * index for delay ring buffer (range = [0, 9])
+ *
+ * Outputs: 64 consecutive 32-bit samples
+ *
+ * Return: none
+ *
+ * Notes: this is carefully written to be efficient on ARM
+ * use the assembly code version in sbrqmfak.s when building for ARM!
+ **************************************************************************************/
+#if 0// (defined (__arm) && defined (__ARMCC_VERSION)) || (defined (_WIN32) && defined (_WIN32_WCE) && defined (ARM)) || (defined(__GNUC__) && defined(__arm__))
+#ifdef __cplusplus
+extern "C"
+#endif
+void QMFAnalysisConv(int *cTab, int *delay, int dIdx, int *uBuf);
+#else
+void QMFAnalysisConv(int *cTab, int *delay, int dIdx, int *uBuf)
+{
+ int k, dOff;
+ int *cPtr0, *cPtr1;
+ U64 u64lo, u64hi;
+
+ dOff = dIdx * 32 + 31;
+ cPtr0 = cTab;
+ cPtr1 = cTab + 33 * 5 - 1;
+
+ /* special first pass since we need to flip sign to create cTab[384], cTab[512] */
+ u64lo.w64 = 0;
+ u64hi.w64 = 0;
+ u64lo.w64 = MADD64(u64lo.w64, *cPtr0++, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64hi.w64 = MADD64(u64hi.w64, *cPtr0++, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64lo.w64 = MADD64(u64lo.w64, *cPtr0++, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64hi.w64 = MADD64(u64hi.w64, *cPtr0++, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64lo.w64 = MADD64(u64lo.w64, *cPtr0++, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64hi.w64 = MADD64(u64hi.w64, *cPtr1--, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64lo.w64 = MADD64(u64lo.w64, -(*cPtr1--), delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64hi.w64 = MADD64(u64hi.w64, *cPtr1--, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64lo.w64 = MADD64(u64lo.w64, -(*cPtr1--), delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64hi.w64 = MADD64(u64hi.w64, *cPtr1--, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+
+ uBuf[0] = u64lo.r.hi32;
+ uBuf[32] = u64hi.r.hi32;
+ uBuf++;
+ dOff--;
+
+ /* max gain for any sample in uBuf, after scaling by cTab, ~= 0.99
+ * so we can just sum the uBuf values with no overflow problems
+ */
+ for (k = 1; k <= 31; k++) {
+ u64lo.w64 = 0;
+ u64hi.w64 = 0;
+ u64lo.w64 = MADD64(u64lo.w64, *cPtr0++, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64hi.w64 = MADD64(u64hi.w64, *cPtr0++, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64lo.w64 = MADD64(u64lo.w64, *cPtr0++, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64hi.w64 = MADD64(u64hi.w64, *cPtr0++, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64lo.w64 = MADD64(u64lo.w64, *cPtr0++, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64hi.w64 = MADD64(u64hi.w64, *cPtr1--, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64lo.w64 = MADD64(u64lo.w64, *cPtr1--, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64hi.w64 = MADD64(u64hi.w64, *cPtr1--, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64lo.w64 = MADD64(u64lo.w64, *cPtr1--, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+ u64hi.w64 = MADD64(u64hi.w64, *cPtr1--, delay[dOff]);
+ dOff -= 32;
+ if (dOff < 0) {
+ dOff += 320;
+ }
+
+ uBuf[0] = u64lo.r.hi32;
+ uBuf[32] = u64hi.r.hi32;
+ uBuf++;
+ dOff--;
+ }
+}
+#endif
+
+/**************************************************************************************
+ * Function: QMFAnalysis
+ *
+ * Description: 32-subband analysis QMF (4.6.18.4.1)
+ *
+ * Inputs: 32 consecutive samples of decoded 32-bit PCM, format = Q(fBitsIn)
+ * delay buffer of size 32*10 = 320 PCM samples
+ * number of fraction bits in input PCM
+ * index for delay ring buffer (range = [0, 9])
+ * number of subbands to calculate (range = [0, 32])
+ *
+ * Outputs: qmfaBands complex subband samples, format = Q(FBITS_OUT_QMFA)
+ * updated delay buffer
+ * updated delay index
+ *
+ * Return: guard bit mask
+ *
+ * Notes: output stored as RE{X0}, IM{X0}, RE{X1}, IM{X1}, ... RE{X31}, IM{X31}
+ * output stored in int buffer of size 64*2 = 128
+ * (zero-filled from XBuf[2*qmfaBands] to XBuf[127])
+ **************************************************************************************/
+int QMFAnalysis(int *inbuf, int *delay, int *XBuf, int fBitsIn, int *delayIdx, int qmfaBands)
+{
+ int n, y, shift, gbMask;
+ int *delayPtr, *uBuf, *tBuf;
+
+ /* use XBuf[128] as temp buffer for reordering */
+ uBuf = XBuf; /* first 64 samples */
+ tBuf = XBuf + 64; /* second 64 samples */
+
+ /* overwrite oldest PCM with new PCM
+ * delay[n] has 1 GB after shifting (either << or >>)
+ */
+ delayPtr = delay + (*delayIdx * 32);
+ if (fBitsIn > FBITS_IN_QMFA) {
+ shift = MIN(fBitsIn - FBITS_IN_QMFA, 31);
+ for (n = 32; n != 0; n--) {
+ y = (*inbuf) >> shift;
+ inbuf++;
+ *delayPtr++ = y;
+ }
+ } else {
+ shift = MIN(FBITS_IN_QMFA - fBitsIn, 30);
+ for (n = 32; n != 0; n--) {
+ y = *inbuf++;
+ CLIP_2N_SHIFT30(y, shift);
+ *delayPtr++ = y;
+ }
+ }
+
+ QMFAnalysisConv((int *)cTabA, delay, *delayIdx, uBuf);
+
+ /* uBuf has at least 2 GB right now (1 from clipping to Q(FBITS_IN_QMFA), one from
+ * the scaling by cTab (MULSHIFT32(*delayPtr--, *cPtr++), with net gain of < 1.0)
+ * TODO - fuse with QMFAnalysisConv to avoid separate reordering
+ */
+ tBuf[2 * 0 + 0] = uBuf[0];
+ tBuf[2 * 0 + 1] = uBuf[1];
+ for (n = 1; n < 31; n++) {
+ tBuf[2 * n + 0] = -uBuf[64 - n];
+ tBuf[2 * n + 1] = uBuf[n + 1];
+ }
+ tBuf[2 * 31 + 1] = uBuf[32];
+ tBuf[2 * 31 + 0] = -uBuf[33];
+
+ /* fast in-place DCT-IV - only need 2*qmfaBands output samples */
+ PreMultiply64(tBuf); /* 2 GB in, 3 GB out */
+ FFT32C(tBuf); /* 3 GB in, 1 GB out */
+ PostMultiply64(tBuf, qmfaBands * 2); /* 1 GB in, 2 GB out */
+
+ /* TODO - roll into PostMultiply (if enough registers) */
+ gbMask = 0;
+ for (n = 0; n < qmfaBands; n++) {
+ XBuf[2 * n + 0] = tBuf[ n + 0]; /* implicit scaling of 2 in our output Q format */
+ gbMask |= FASTABS(XBuf[2 * n + 0]);
+ XBuf[2 * n + 1] = -tBuf[63 - n];
+ gbMask |= FASTABS(XBuf[2 * n + 1]);
+ }
+
+ /* fill top section with zeros for HF generation */
+ for (; n < 64; n++) {
+ XBuf[2 * n + 0] = 0;
+ XBuf[2 * n + 1] = 0;
+ }
+
+ *delayIdx = (*delayIdx == NUM_QMF_DELAY_BUFS - 1 ? 0 : *delayIdx + 1);
+
+ /* minimum of 2 GB in output */
+ return gbMask;
+}
+
+/* lose FBITS_LOST_DCT4_64 in DCT4, gain 6 for implicit scaling by 1/64, lose 1 for cTab multiply (Q31) */
+#define FBITS_OUT_QMFS (FBITS_IN_QMFS - FBITS_LOST_DCT4_64 + 6 - 1)
+#define RND_VAL (1 << (FBITS_OUT_QMFS-1))
+
+/**************************************************************************************
+ * Function: QMFSynthesisConv
+ *
+ * Description: final convolution kernel for synthesis QMF
+ *
+ * Inputs: pointer to coefficient table, reordered for sequential access
+ * delay buffer of size 64*10 = 640 complex samples (1280 ints)
+ * index for delay ring buffer (range = [0, 9])
+ * number of QMF subbands to process (range = [0, 64])
+ * number of channels
+ *
+ * Outputs: 64 consecutive 16-bit PCM samples, interleaved by factor of nChans
+ *
+ * Return: none
+ *
+ * Notes: this is carefully written to be efficient on ARM
+ * use the assembly code version in sbrqmfsk.s when building for ARM!
+ **************************************************************************************/
+#if 0// (defined (__arm) && defined (__ARMCC_VERSION)) || (defined (_WIN32) && defined (_WIN32_WCE) && defined (ARM)) || (defined(__GNUC__) && defined(__arm__))
+#ifdef __cplusplus
+extern "C"
+#endif
+void QMFSynthesisConv(int *cPtr, int *delay, int dIdx, short *outbuf, int nChans);
+#else
+void QMFSynthesisConv(int *cPtr, int *delay, int dIdx, short *outbuf, int nChans)
+{
+ int k, dOff0, dOff1;
+ U64 sum64;
+
+ dOff0 = (dIdx) * 128;
+ dOff1 = dOff0 - 1;
+ if (dOff1 < 0) {
+ dOff1 += 1280;
+ }
+
+ /* scaling note: total gain of coefs (cPtr[0]-cPtr[9] for any k) is < 2.0, so 1 GB in delay values is adequate */
+ for (k = 0; k <= 63; k++) {
+ sum64.w64 = 0;
+ sum64.w64 = MADD64(sum64.w64, *cPtr++, delay[dOff0]);
+ dOff0 -= 256;
+ if (dOff0 < 0) {
+ dOff0 += 1280;
+ }
+ sum64.w64 = MADD64(sum64.w64, *cPtr++, delay[dOff1]);
+ dOff1 -= 256;
+ if (dOff1 < 0) {
+ dOff1 += 1280;
+ }
+ sum64.w64 = MADD64(sum64.w64, *cPtr++, delay[dOff0]);
+ dOff0 -= 256;
+ if (dOff0 < 0) {
+ dOff0 += 1280;
+ }
+ sum64.w64 = MADD64(sum64.w64, *cPtr++, delay[dOff1]);
+ dOff1 -= 256;
+ if (dOff1 < 0) {
+ dOff1 += 1280;
+ }
+ sum64.w64 = MADD64(sum64.w64, *cPtr++, delay[dOff0]);
+ dOff0 -= 256;
+ if (dOff0 < 0) {
+ dOff0 += 1280;
+ }
+ sum64.w64 = MADD64(sum64.w64, *cPtr++, delay[dOff1]);
+ dOff1 -= 256;
+ if (dOff1 < 0) {
+ dOff1 += 1280;
+ }
+ sum64.w64 = MADD64(sum64.w64, *cPtr++, delay[dOff0]);
+ dOff0 -= 256;
+ if (dOff0 < 0) {
+ dOff0 += 1280;
+ }
+ sum64.w64 = MADD64(sum64.w64, *cPtr++, delay[dOff1]);
+ dOff1 -= 256;
+ if (dOff1 < 0) {
+ dOff1 += 1280;
+ }
+ sum64.w64 = MADD64(sum64.w64, *cPtr++, delay[dOff0]);
+ dOff0 -= 256;
+ if (dOff0 < 0) {
+ dOff0 += 1280;
+ }
+ sum64.w64 = MADD64(sum64.w64, *cPtr++, delay[dOff1]);
+ dOff1 -= 256;
+ if (dOff1 < 0) {
+ dOff1 += 1280;
+ }
+
+ dOff0++;
+ dOff1--;
+ *outbuf = CLIPTOSHORT((sum64.r.hi32 + RND_VAL) >> FBITS_OUT_QMFS);
+ outbuf += nChans;
+ }
+}
+#endif
+
+/**************************************************************************************
+ * Function: QMFSynthesis
+ *
+ * Description: 64-subband synthesis QMF (4.6.18.4.2)
+ *
+ * Inputs: 64 consecutive complex subband QMF samples, format = Q(FBITS_IN_QMFS)
+ * delay buffer of size 64*10 = 640 complex samples (1280 ints)
+ * index for delay ring buffer (range = [0, 9])
+ * number of QMF subbands to process (range = [0, 64])
+ * number of channels
+ *
+ * Outputs: 64 consecutive 16-bit PCM samples, interleaved by factor of nChans
+ * updated delay buffer
+ * updated delay index
+ *
+ * Return: none
+ *
+ * Notes: assumes MIN_GBITS_IN_QMFS guard bits in input, either from
+ * QMFAnalysis (if upsampling only) or from MapHF (if SBR on)
+ **************************************************************************************/
+void QMFSynthesis(int *inbuf, int *delay, int *delayIdx, int qmfsBands, short *outbuf, int nChans)
+{
+ int n, a0, a1, b0, b1, dOff0, dOff1, dIdx;
+ int *tBufLo, *tBufHi;
+
+ dIdx = *delayIdx;
+ tBufLo = delay + dIdx * 128 + 0;
+ tBufHi = delay + dIdx * 128 + 127;
+
+ /* reorder inputs to DCT-IV, only use first qmfsBands (complex) samples
+ * TODO - fuse with PreMultiply64 to avoid separate reordering steps
+ */
+ for (n = 0; n < qmfsBands >> 1; n++) {
+ a0 = *inbuf++;
+ b0 = *inbuf++;
+ a1 = *inbuf++;
+ b1 = *inbuf++;
+ *tBufLo++ = a0;
+ *tBufLo++ = a1;
+ *tBufHi-- = b0;
+ *tBufHi-- = b1;
+ }
+ if (qmfsBands & 0x01) {
+ a0 = *inbuf++;
+ b0 = *inbuf++;
+ *tBufLo++ = a0;
+ *tBufHi-- = b0;
+ *tBufLo++ = 0;
+ *tBufHi-- = 0;
+ n++;
+ }
+ for (; n < 32; n++) {
+ *tBufLo++ = 0;
+ *tBufHi-- = 0;
+ *tBufLo++ = 0;
+ *tBufHi-- = 0;
+ }
+
+ tBufLo = delay + dIdx * 128 + 0;
+ tBufHi = delay + dIdx * 128 + 64;
+
+ /* 2 GB in, 3 GB out */
+ PreMultiply64(tBufLo);
+ PreMultiply64(tBufHi);
+
+ /* 3 GB in, 1 GB out */
+ FFT32C(tBufLo);
+ FFT32C(tBufHi);
+
+ /* 1 GB in, 2 GB out */
+ PostMultiply64(tBufLo, 64);
+ PostMultiply64(tBufHi, 64);
+
+ /* could fuse with PostMultiply64 to avoid separate pass */
+ dOff0 = dIdx * 128;
+ dOff1 = dIdx * 128 + 64;
+ for (n = 32; n != 0; n--) {
+ a0 = (*tBufLo++);
+ a1 = (*tBufLo++);
+ b0 = (*tBufHi++);
+ b1 = -(*tBufHi++);
+
+ delay[dOff0++] = (b0 - a0);
+ delay[dOff0++] = (b1 - a1);
+ delay[dOff1++] = (b0 + a0);
+ delay[dOff1++] = (b1 + a1);
+ }
+
+ QMFSynthesisConv((int *)cTabS, delay, dIdx, outbuf, nChans);
+
+ *delayIdx = (*delayIdx == NUM_QMF_DELAY_BUFS - 1 ? 0 : *delayIdx + 1);
+}