16cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK/* -----------------------------------------------------------------------------
22228e360595641dd906bf1773307f43d304f5b2The Android Open Source ProjectSoftware License for The Fraunhofer FDK AAC Codec Library for Android
32228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
46cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK© Copyright  1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
56cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKForschung e.V. All rights reserved.
62228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
72228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project 1.    INTRODUCTION
86cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKThe Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software
96cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKthat implements the MPEG Advanced Audio Coding ("AAC") encoding and decoding
106cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKscheme for digital audio. This FDK AAC Codec software is intended to be used on
116cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKa wide variety of Android devices.
126cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK
136cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKAAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient
146cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKgeneral perceptual audio codecs. AAC-ELD is considered the best-performing
156cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKfull-bandwidth communications codec by independent studies and is widely
166cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKdeployed. AAC has been standardized by ISO and IEC as part of the MPEG
176cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKspecifications.
186cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK
196cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKPatent licenses for necessary patent claims for the FDK AAC Codec (including
206cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKthose of Fraunhofer) may be obtained through Via Licensing
216cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK(www.vialicensing.com) or through the respective patent owners individually for
226cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKthe purpose of encoding or decoding bit streams in products that are compliant
236cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKwith the ISO/IEC MPEG audio standards. Please note that most manufacturers of
246cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKAndroid devices already license these patent claims through Via Licensing or
256cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKdirectly from the patent owners, and therefore FDK AAC Codec software may
266cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKalready be covered under those patent licenses when it is used for those
276cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKlicensed purposes only.
286cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK
296cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKCommercially-licensed AAC software libraries, including floating-point versions
306cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKwith enhanced sound quality, are also available from Fraunhofer. Users are
316cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKencouraged to check the Fraunhofer website for additional applications
326cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKinformation and documentation.
332228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
342228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project2.    COPYRIGHT LICENSE
352228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
366cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKRedistribution and use in source and binary forms, with or without modification,
376cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKare permitted without payment of copyright license fees provided that you
386cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKsatisfy the following conditions:
392228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
406cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKYou must retain the complete text of this software license in redistributions of
416cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKthe FDK AAC Codec or your modifications thereto in source code form.
422228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
436cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKYou must retain the complete text of this software license in the documentation
446cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKand/or other materials provided with redistributions of the FDK AAC Codec or
456cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKyour modifications thereto in binary form. You must make available free of
466cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKcharge copies of the complete source code of the FDK AAC Codec and your
472228e360595641dd906bf1773307f43d304f5b2The Android Open Source Projectmodifications thereto to recipients of copies in binary form.
482228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
496cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKThe name of Fraunhofer may not be used to endorse or promote products derived
506cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKfrom this library without prior written permission.
512228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
526cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKYou may not charge copyright license fees for anyone to use, copy or distribute
536cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKthe FDK AAC Codec software or your modifications thereto.
542228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
556cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKYour modified versions of the FDK AAC Codec must carry prominent notices stating
566cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKthat you changed the software and the date of any change. For modified versions
576cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKof the FDK AAC Codec, the term "Fraunhofer FDK AAC Codec Library for Android"
586cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKmust be replaced by the term "Third-Party Modified Version of the Fraunhofer FDK
596cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKAAC Codec Library for Android."
602228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
612228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project3.    NO PATENT LICENSE
622228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
636cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKNO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without
646cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKlimitation the patents of Fraunhofer, ARE GRANTED BY THIS SOFTWARE LICENSE.
656cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKFraunhofer provides no warranty of patent non-infringement with respect to this
666cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKsoftware.
672228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
686cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKYou may use this FDK AAC Codec software or modifications thereto only for
696cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKpurposes that are authorized by appropriate patent licenses.
702228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
712228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project4.    DISCLAIMER
722228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
736cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKThis FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright
746cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKholders and contributors "AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES,
756cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKincluding but not limited to the implied warranties of merchantability and
766cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKfitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
776cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKCONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary,
786cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKor consequential damages, including but not limited to procurement of substitute
796cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKgoods or services; loss of use, data, or profits, or business interruption,
806cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKhowever caused and on any theory of liability, whether in contract, strict
816cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKliability, or tort (including negligence), arising in any way out of the use of
826cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKthis software, even if advised of the possibility of such damage.
832228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
842228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project5.    CONTACT INFORMATION
852228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
862228e360595641dd906bf1773307f43d304f5b2The Android Open Source ProjectFraunhofer Institute for Integrated Circuits IIS
872228e360595641dd906bf1773307f43d304f5b2The Android Open Source ProjectAttention: Audio and Multimedia Departments - FDK AAC LL
882228e360595641dd906bf1773307f43d304f5b2The Android Open Source ProjectAm Wolfsmantel 33
892228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project91058 Erlangen, Germany
902228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
912228e360595641dd906bf1773307f43d304f5b2The Android Open Source Projectwww.iis.fraunhofer.de/amm
922228e360595641dd906bf1773307f43d304f5b2The Android Open Source Projectamm-info@iis.fraunhofer.de
936cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK----------------------------------------------------------------------------- */
942228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
956cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK/******************* Library for basic calculation routines ********************
962228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
972228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project   Author(s):   M. Lohwasser
982228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
996cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK   Description: fixed point abs definitions
1002228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
1016cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK*******************************************************************************/
1022228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
1036cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK#ifndef AUTOCORR2ND_H
1046cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK#define AUTOCORR2ND_H
1052228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
1062228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project#include "common_fix.h"
1072228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
1082228e360595641dd906bf1773307f43d304f5b2The Android Open Source Projecttypedef struct {
1096cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK  FIXP_DBL r00r;
1106cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK  FIXP_DBL r11r;
1116cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK  FIXP_DBL r22r;
1126cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK  FIXP_DBL r01r;
1136cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK  FIXP_DBL r02r;
1146cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK  FIXP_DBL r12r;
1156cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK  FIXP_DBL r01i;
1166cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK  FIXP_DBL r02i;
1176cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK  FIXP_DBL r12i;
1186cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK  FIXP_DBL det;
1192228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project  int det_scale;
1202228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project} ACORR_COEFS;
1212228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
1222228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project#define LPC_ORDER 2
1232228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
1246cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKINT autoCorr2nd_real(
1256cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK    ACORR_COEFS *ac,          /*!< Pointer to autocorrelation coeffs */
1266cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK    const FIXP_DBL *reBuffer, /*!< Pointer to to real part of spectrum */
1276cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK    const int len             /*!< Number of qmf slots */
1286cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK);
1292228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
1306cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDKINT autoCorr2nd_cplx(
1316cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK    ACORR_COEFS *ac,          /*!< Pointer to autocorrelation coeffs */
1326cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK    const FIXP_DBL *reBuffer, /*!< Pointer to to real part of spectrum */
1336cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK    const FIXP_DBL *imBuffer, /*!< Pointer to imag part of spectrum */
1346cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK    const int len             /*!< Number of qmf slots */
1356cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK);
1362228e360595641dd906bf1773307f43d304f5b2The Android Open Source Project
1376cfabd35363c3ef5e3b209b867169a500b3ccc3cFraunhofer IIS FDK#endif /* AUTOCORR2ND_H */
138