Ticket #47120: libfdk-aac-0.1.4.diff

File libfdk-aac-0.1.4.diff, 16.5 KB (added by mopihopi, 9 years ago)
  • Portfile

     
    44PortSystem          1.0
    55
    66name                libfdk-aac
    7 version             0.1.3
    8 revision            1
     7version             0.1.4
     8revision            0
    99categories          audio
    1010license             Restrictive
    1111platforms           darwin
     
    1313description         Fraunhofer FDK AAC Codec Library
    1414long_description    Fraunhofer FDK AAC Codec Library, released as part of Android, \
    1515                    from the opencore-amr project.  High-quality encoding and decoding \
    16                     of AAC audio supporting 5.1 channels, AAC-LC, Main profile, SBR, \
    17                     and Parametric Stereo (HE-AAC v1 and v2).
     16                    of AAC audio supporting 7.1 channels, AAC-LC, HE-AAC, HE-AACv2, \
     17                    AAC-LD, and AAC-ELD.
    1818
    1919compiler.blacklist  gcc-4.2
    2020
     
    2121homepage            http://sourceforge.net/projects/opencore-amr/
    2222master_sites        sourceforge:project/opencore-amr/fdk-aac
    2323distname            fdk-aac-${version}
    24 checksums           rmd160  e9e4898e1af3315e106a255d2f0655ea49968341 \
    25                     sha256  a9cb872802cfb7a2aff7a549c114c547d1e518dd60c2f85942229cc20c0d0c8d
     24checksums           rmd160  570aa87ba8e05884f79425794692b47352532603 \
     25                    sha256  5910fe788677ca13532e3f47b7afaa01d72334d46a2d5e1d1f080f1173ff15ab
    2626
    27 patchfiles          fdk-aac-ppc.diff
    28 
    2927livecheck.type      regex
    3028livecheck.url       http://sourceforge.net/projects/opencore-amr/files/fdk-aac/
    3129livecheck.regex     "fdk-aac-(\\d+(?:\\.\\d+)*)${extract.suffix}"
  • files/fdk-aac-ppc.diff

     
    1 --- libFDK/include/FDK_archdef.h
    2 +++ libFDK/include/FDK_archdef.h
    3 @@ -107,6 +107,10 @@ amm-info@iis.fraunhofer.de
    4  #define __arm__
    5  #endif
    6  
    7 +#if defined(_ARCH_PPC) && !defined(__powerpc__)
    8 +#define __powerpc__ 1
    9 +#endif
    10 +
    11  
    12  
    13  /* Define __ARM_ARCH_5TE__ if armv5te features are supported  */
    14 @@ -158,7 +162,7 @@ amm-info@iis.fraunhofer.de
    15  /* Define preferred Multiplication type */
    16  #if defined(FDK_HIGH_PERFORMANCE) && !defined(FDK_HIGH_QUALITY) /* FDK_HIGH_PERFORMANCE */
    17  
    18 -#if defined(__mips__) || defined(__powerpc__) || defined(__sh__)
    19 +#if defined(__mips__) || defined(__sh__)
    20  #define ARCH_PREFER_MULT_16x16
    21  #undef SINETABLE_16BIT
    22  #undef POW2COEFF_16BIT
    23 @@ -201,6 +205,14 @@ amm-info@iis.fraunhofer.de
    24  #define POW2COEFF_16BIT
    25  #define LDCOEFF_16BIT
    26  
    27 +#elif defined(__powerpc__)
    28 +#define ARCH_PREFER_MULT_32x32
    29 +#define ARCH_PREFER_MULT_32x16
    30 +#define SINETABLE_16BIT
    31 +#define POW2COEFF_16BIT
    32 +#define LDCOEFF_16BIT
    33 +#define WINDOWTABLE_16BIT
    34 +
    35  #else
    36  
    37    #error  >>>> Please set architecture characterization defines for your platform (FDK_HIGH_PERFORMANCE)! <<<<
    38 --- libFDK/include/clz.h
    39 +++ libFDK/include/clz.h
    40 @@ -103,6 +103,9 @@ amm-info@iis.fraunhofer.de
    41  #elif defined(__x86__) /* cppp replaced: elif */
    42  #include "x86/clz_x86.h"
    43  
    44 +#elif defined(__powerpc__)
    45 +#include "ppc/clz_ppc.h"
    46 +
    47  #endif /* all cores */
    48  
    49  
    50 --- libFDK/include/common_fix.h
    51 +++ libFDK/include/common_fix.h
    52 @@ -226,7 +226,7 @@ FDK_INLINE FIXP_SGL fAbs(FIXP_SGL x)
    53                  { return fixabs_S(x); }
    54  
    55  /* workaround for TI C6x compiler but not for TI ARM9E compiler */
    56 -#if (!defined(__TI_COMPILER_VERSION__) || defined(__TI_TMS470_V5__)) && !defined(__x86_64__)
    57 +#if (!defined(__TI_COMPILER_VERSION__) || defined(__TI_TMS470_V5__)) && !defined(__LP64__)
    58  FDK_INLINE INT  fAbs(INT x)
    59                  { return fixabs_I(x); }
    60  #endif
    61 @@ -336,7 +336,7 @@ FDK_INLINE FIXP_SGL fMax(FIXP_SGL a, FIXP_SGL b)
    62                  { return fixmax_S(a,b); }
    63  
    64  /* workaround for TI C6x compiler but not for TI ARM9E */
    65 -#if ((!defined(__TI_COMPILER_VERSION__) || defined(__TI_TMS470_V5__)) && !defined(__x86_64__)) || (FIX_FRACT == 1)
    66 +#if ((!defined(__TI_COMPILER_VERSION__) || defined(__TI_TMS470_V5__)) && !defined(__LP64__)) || (FIX_FRACT == 1)
    67  FDK_INLINE INT fMax(INT a, INT b)
    68                  { return fixmax_I(a,b); }
    69  FDK_INLINE INT fMin(INT a, INT b)
    70 --- libFDK/include/fixmul.h
    71 +++ libFDK/include/fixmul.h
    72 @@ -104,6 +104,9 @@ amm-info@iis.fraunhofer.de
    73  #elif defined(__x86__) /* cppp replaced: elif */
    74  #include "x86/fixmul_x86.h"
    75  
    76 +#elif defined(__powerpc__)
    77 +#include "ppc/fixmul_ppc.h"
    78 +
    79  #endif /* all cores */
    80  
    81  /*************************************************************************
    82 --- /dev/null
    83 +++ libFDK/include/ppc/clz_ppc.h
    84 @@ -0,0 +1,102 @@
    85 +
    86 +/* -----------------------------------------------------------------------------------------------------------
    87 +Software License for The Fraunhofer FDK AAC Codec Library for Android
    88 +
    89 +© Copyright  1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
    90 +  All rights reserved.
    91 +
    92 + 1.    INTRODUCTION
    93 +The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software that implements
    94 +the MPEG Advanced Audio Coding ("AAC") encoding and decoding scheme for digital audio.
    95 +This FDK AAC Codec software is intended to be used on a wide variety of Android devices.
    96 +
    97 +AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient general perceptual
    98 +audio codecs. AAC-ELD is considered the best-performing full-bandwidth communications codec by
    99 +independent studies and is widely deployed. AAC has been standardized by ISO and IEC as part
    100 +of the MPEG specifications.
    101 +
    102 +Patent licenses for necessary patent claims for the FDK AAC Codec (including those of Fraunhofer)
    103 +may be obtained through Via Licensing (www.vialicensing.com) or through the respective patent owners
    104 +individually for the purpose of encoding or decoding bit streams in products that are compliant with
    105 +the ISO/IEC MPEG audio standards. Please note that most manufacturers of Android devices already license
    106 +these patent claims through Via Licensing or directly from the patent owners, and therefore FDK AAC Codec
    107 +software may already be covered under those patent licenses when it is used for those licensed purposes only.
    108 +
    109 +Commercially-licensed AAC software libraries, including floating-point versions with enhanced sound quality,
    110 +are also available from Fraunhofer. Users are encouraged to check the Fraunhofer website for additional
    111 +applications information and documentation.
    112 +
    113 +2.    COPYRIGHT LICENSE
    114 +
    115 +Redistribution and use in source and binary forms, with or without modification, are permitted without
    116 +payment of copyright license fees provided that you satisfy the following conditions:
    117 +
    118 +You must retain the complete text of this software license in redistributions of the FDK AAC Codec or
    119 +your modifications thereto in source code form.
    120 +
    121 +You must retain the complete text of this software license in the documentation and/or other materials
    122 +provided with redistributions of the FDK AAC Codec or your modifications thereto in binary form.
    123 +You must make available free of charge copies of the complete source code of the FDK AAC Codec and your
    124 +modifications thereto to recipients of copies in binary form.
    125 +
    126 +The name of Fraunhofer may not be used to endorse or promote products derived from this library without
    127 +prior written permission.
    128 +
    129 +You may not charge copyright license fees for anyone to use, copy or distribute the FDK AAC Codec
    130 +software or your modifications thereto.
    131 +
    132 +Your modified versions of the FDK AAC Codec must carry prominent notices stating that you changed the software
    133 +and the date of any change. For modified versions of the FDK AAC Codec, the term
    134 +"Fraunhofer FDK AAC Codec Library for Android" must be replaced by the term
    135 +"Third-Party Modified Version of the Fraunhofer FDK AAC Codec Library for Android."
    136 +
    137 +3.    NO PATENT LICENSE
    138 +
    139 +NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without limitation the patents of Fraunhofer,
    140 +ARE GRANTED BY THIS SOFTWARE LICENSE. Fraunhofer provides no warranty of patent non-infringement with
    141 +respect to this software.
    142 +
    143 +You may use this FDK AAC Codec software or modifications thereto only for purposes that are authorized
    144 +by appropriate patent licenses.
    145 +
    146 +4.    DISCLAIMER
    147 +
    148 +This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright holders and contributors
    149 +"AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, including but not limited to the implied warranties
    150 +of merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
    151 +CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary, or consequential damages,
    152 +including but not limited to procurement of substitute goods or services; loss of use, data, or profits,
    153 +or business interruption, however caused and on any theory of liability, whether in contract, strict
    154 +liability, or tort (including negligence), arising in any way out of the use of this software, even if
    155 +advised of the possibility of such damage.
    156 +
    157 +5.    CONTACT INFORMATION
    158 +
    159 +Fraunhofer Institute for Integrated Circuits IIS
    160 +Attention: Audio and Multimedia Departments - FDK AAC LL
    161 +Am Wolfsmantel 33
    162 +91058 Erlangen, Germany
    163 +
    164 +www.iis.fraunhofer.de/amm
    165 +amm-info@iis.fraunhofer.de
    166 +----------------------------------------------------------------------------------------------------------- */
    167 +
    168 +/***************************  Fraunhofer IIS FDK Tools  **********************
    169 +
    170 +   Author(s):
    171 +   Description: fixed point intrinsics
    172 +
    173 +******************************************************************************/
    174 +
    175 +#if defined(__powerpc__) && (defined(__GNUC__) || defined(__xlC__))
    176 +
    177 +#define FUNCTION_fixnormz_D
    178 +
    179 +inline INT fixnormz_D(LONG value)
    180 +{
    181 +  INT result;
    182 +  __asm__ ("cntlzw %0, %1" : "=r" (result) : "r" (value));
    183 +  return result;
    184 +}
    185 +
    186 +#endif /* __powerpc__ && (__GNUC__ || __xlC__) */
    187 --- /dev/null
    188 +++ libFDK/include/ppc/fixmul_ppc.h
    189 @@ -0,0 +1,115 @@
    190 +
    191 +/* -----------------------------------------------------------------------------------------------------------
    192 +Software License for The Fraunhofer FDK AAC Codec Library for Android
    193 +
    194 +© Copyright  1995 - 2013 Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V.
    195 +  All rights reserved.
    196 +
    197 + 1.    INTRODUCTION
    198 +The Fraunhofer FDK AAC Codec Library for Android ("FDK AAC Codec") is software that implements
    199 +the MPEG Advanced Audio Coding ("AAC") encoding and decoding scheme for digital audio.
    200 +This FDK AAC Codec software is intended to be used on a wide variety of Android devices.
    201 +
    202 +AAC's HE-AAC and HE-AAC v2 versions are regarded as today's most efficient general perceptual
    203 +audio codecs. AAC-ELD is considered the best-performing full-bandwidth communications codec by
    204 +independent studies and is widely deployed. AAC has been standardized by ISO and IEC as part
    205 +of the MPEG specifications.
    206 +
    207 +Patent licenses for necessary patent claims for the FDK AAC Codec (including those of Fraunhofer)
    208 +may be obtained through Via Licensing (www.vialicensing.com) or through the respective patent owners
    209 +individually for the purpose of encoding or decoding bit streams in products that are compliant with
    210 +the ISO/IEC MPEG audio standards. Please note that most manufacturers of Android devices already license
    211 +these patent claims through Via Licensing or directly from the patent owners, and therefore FDK AAC Codec
    212 +software may already be covered under those patent licenses when it is used for those licensed purposes only.
    213 +
    214 +Commercially-licensed AAC software libraries, including floating-point versions with enhanced sound quality,
    215 +are also available from Fraunhofer. Users are encouraged to check the Fraunhofer website for additional
    216 +applications information and documentation.
    217 +
    218 +2.    COPYRIGHT LICENSE
    219 +
    220 +Redistribution and use in source and binary forms, with or without modification, are permitted without
    221 +payment of copyright license fees provided that you satisfy the following conditions:
    222 +
    223 +You must retain the complete text of this software license in redistributions of the FDK AAC Codec or
    224 +your modifications thereto in source code form.
    225 +
    226 +You must retain the complete text of this software license in the documentation and/or other materials
    227 +provided with redistributions of the FDK AAC Codec or your modifications thereto in binary form.
    228 +You must make available free of charge copies of the complete source code of the FDK AAC Codec and your
    229 +modifications thereto to recipients of copies in binary form.
    230 +
    231 +The name of Fraunhofer may not be used to endorse or promote products derived from this library without
    232 +prior written permission.
    233 +
    234 +You may not charge copyright license fees for anyone to use, copy or distribute the FDK AAC Codec
    235 +software or your modifications thereto.
    236 +
    237 +Your modified versions of the FDK AAC Codec must carry prominent notices stating that you changed the software
    238 +and the date of any change. For modified versions of the FDK AAC Codec, the term
    239 +"Fraunhofer FDK AAC Codec Library for Android" must be replaced by the term
    240 +"Third-Party Modified Version of the Fraunhofer FDK AAC Codec Library for Android."
    241 +
    242 +3.    NO PATENT LICENSE
    243 +
    244 +NO EXPRESS OR IMPLIED LICENSES TO ANY PATENT CLAIMS, including without limitation the patents of Fraunhofer,
    245 +ARE GRANTED BY THIS SOFTWARE LICENSE. Fraunhofer provides no warranty of patent non-infringement with
    246 +respect to this software.
    247 +
    248 +You may use this FDK AAC Codec software or modifications thereto only for purposes that are authorized
    249 +by appropriate patent licenses.
    250 +
    251 +4.    DISCLAIMER
    252 +
    253 +This FDK AAC Codec software is provided by Fraunhofer on behalf of the copyright holders and contributors
    254 +"AS IS" and WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, including but not limited to the implied warranties
    255 +of merchantability and fitness for a particular purpose. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
    256 +CONTRIBUTORS BE LIABLE for any direct, indirect, incidental, special, exemplary, or consequential damages,
    257 +including but not limited to procurement of substitute goods or services; loss of use, data, or profits,
    258 +or business interruption, however caused and on any theory of liability, whether in contract, strict
    259 +liability, or tort (including negligence), arising in any way out of the use of this software, even if
    260 +advised of the possibility of such damage.
    261 +
    262 +5.    CONTACT INFORMATION
    263 +
    264 +Fraunhofer Institute for Integrated Circuits IIS
    265 +Attention: Audio and Multimedia Departments - FDK AAC LL
    266 +Am Wolfsmantel 33
    267 +91058 Erlangen, Germany
    268 +
    269 +www.iis.fraunhofer.de/amm
    270 +amm-info@iis.fraunhofer.de
    271 +----------------------------------------------------------------------------------------------------------- */
    272 +
    273 +/***************************  Fraunhofer IIS FDK Tools  **********************
    274 +
    275 +   Author(s):
    276 +   Description: fixed point intrinsics
    277 +
    278 +******************************************************************************/
    279 +
    280 +#if defined(__powerpc__) && (defined(__GNUC__) || defined(__xlC__))
    281 +
    282 +#define FUNCTION_fixmuldiv2_DD
    283 +
    284 +#define FUNCTION_fixmuldiv2BitExact_DD
    285 +#define fixmuldiv2BitExact_DD(a,b) fixmuldiv2_DD(a,b)
    286 +
    287 +#define FUNCTION_fixmulBitExact_DD
    288 +#define fixmulBitExact_DD(a,b) fixmul_DD(a,b)
    289 +
    290 +#define FUNCTION_fixmuldiv2BitExact_DS
    291 +#define fixmuldiv2BitExact_DS(a,b) fixmuldiv2_DS(a,b)
    292 +
    293 +#define FUNCTION_fixmulBitExact_DS
    294 +#define fixmulBitExact_DS(a,b) fixmul_DS(a,b)
    295 +
    296 +
    297 +inline INT fixmuldiv2_DD (const INT a, const INT b)
    298 +{
    299 +  INT result;
    300 +  __asm__ ("mulhw %0, %1, %2" : "=r" (result) : "r" (a), "r" (b));
    301 +  return result;
    302 +}
    303 +
    304 +#endif /* __powerpc__ && (__GNUC__ || __xlC__) */
    305 --- libSYS/include/machine_type.h
    306 +++ libSYS/include/machine_type.h
    307 @@ -154,15 +154,15 @@ amm-info@iis.fraunhofer.de
    308  
    309    typedef signed int INT;
    310    typedef unsigned int UINT;
    311 -#ifdef __x86_64__
    312 +#ifdef __LP64__
    313    /* force FDK long-datatypes to 4 byte  */
    314    /* jdr: Use defines to avoid type alias problems on 64 bit machines. */
    315    #define LONG INT
    316    #define ULONG UINT
    317 -#else /* __x86_64__ */
    318 +#else /* __LP64__ */
    319    typedef signed long LONG;
    320    typedef unsigned long ULONG;
    321 -#endif /* __x86_64__ */
    322 +#endif /* __LP64__ */
    323    typedef signed short SHORT;
    324    typedef unsigned short USHORT;
    325    typedef signed char SCHAR;
    326 --- libSYS/src/genericStds.cpp
    327 +++ libSYS/src/genericStds.cpp
    328 @@ -92,10 +92,10 @@ amm-info@iis.fraunhofer.de
    329  
    330  #define _CRT_SECURE_NO_WARNINGS
    331  
    332 -#include "genericStds.h"
    333 -
    334  #include <math.h>
    335  
    336 +#include "genericStds.h"
    337 +
    338  /* library info */
    339  #define SYS_LIB_VL0 1
    340  #define SYS_LIB_VL1 3