Compiling faad2 on the Android platform

Source: Internet
Author: User

1, download the source code from the official website

2. Edit a config.h:

/* config.h.  Generated from config.h.in by configure.  *//* config.h.in.  Generated from Configure.in by Autoheader. *//* Define If you want to use Libfaad together with Digital Radio Mondiale (DRM) *//* #undef DRM *//* Define If you wan T support for Digital Radio Mondiale (DRM) parametric stereo *//* #undef drm_ps *//* Define to 1 if you have the &LT;DLF Cn.h> header file. */#define HAVE_DLFCN_H 1/* define to 1 if you have the <errno.h> header file. */#define HAVE_ERRNO_H 1/* define if needed *//* #undef have_float32_t *//* define to 1 if you have the the <float.h> he Ader file. */#define HAVE_FLOAT_H 1/* define to 1 if you have the ' getpwuid ' function. */#define HAVE_GETPWUID 1/* define to 1 if you have the <inttypes.h> header file. */#define HAVE_INTTYPES_H 1/* Define if you had the IOKit API *//* #undef have_iokit_iokitlib_h *//* define to 1 if you H Ave the <limits.h> header file. */#define HAVE_LIMITS_H 1/* define if you have C99 ' s lrintf function. */#dEfine have_lrintf 1/* Define to 1 if you have the <mathf.h> header file. *//* #undef have_mathf_h *//* Define to 1 if you have the ' memcpy ' function. */#define HAVE_MEMCPY 1/* define to 1 if you have the <memory.h> header file. */#define HAVE_MEMORY_H 1/* define to 1 if you have the <stdint.h> header file. */#define HAVE_STDINT_H 1/* define to 1 if you have the <stdlib.h> header file. */#define HAVE_STDLIB_H 1/* define to 1 if you have the ' strchr ' function. */#define HAVE_STRCHR 1/* define to 1 if you have the <strings.h> header file. */#define HAVE_STRINGS_H 1/* define to 1 if you have the <string.h> header file. */#define HAVE_STRING_H 1/* define to 1 if you have the ' strsep ' function. */#define HAVE_STRSEP 1/* define to 1 if you have the <sysfs/libsysfs.h> header file. *//* #undef have_sysfs_libsysfs_h *//* Define to 1 if you have the <sys/stat.h> header file. */#define HAVE_SYS_STAT_H 1/* define to 1 if you have the <sys/time.h> Header file. */#define HAVE_SYS_TIME_H 1/* define to 1 if you have the <sys/types.h> header file. */#define HAVE_SYS_TYPES_H 1/* define to 1 if you have the <unistd.h> header file. */#define HAVE_UNISTD_H 1/* define to 1 if your C compiler doesn ' t accept-c and-o together. *//* #undef no_minus_c_minus_o *//* Name of package */#define PACKAGE "faad2"/* Define to the address where bug reports fo R This package should is sent. */#define PACKAGE_BUGREPORT ""/* define to the full name of the "the". */#define PACKAGE_NAME ""/* define to the full NAME and version of the "the". */#define PACKAGE_STRING ""/* define to the one symbol short name of the "the". */#define PACKAGE_TARNAME ""/* define to the version of the. */#define PACKAGE_VERSION ""/* define to 1 if you have the ANSI C header files. */#define Stdc_headers 1/* define to 1 if you can safely include both <sys/time.h> and <time.h>. */#define TIME_WITH_SYS_TIME 1/* Version Number of package */#define VERSION "2.7.0"/* Define to 1 if your processor stores words with the most significant byte first (like Motorola And SPARC, unlike Intel and VAX). *//* #undef Words_bigendian *//* Define to ' __inline__ ' or ' __inline ' if that's what's the C compiler calls it, or to Noth  ing if ' inline ' is not a supported under any name. */#ifndef __cplusplus/* #undef Inline */#endif/* Define to ' long int ' If <sys/types.h> does not Define. *//* #undef off_t */

3, Write Android.mk

Local_path: = $ (call My-dir) include $ (clear_vars) local_module:= Faadlocal_arm_mode: = armlocal_c_includes: = $ (LOCAL_ PATH) $ (Local_path)/include$ (Local_path)/libfaad$ (Local_path)/common/mp4ff$ (Local_path)/libfaad/codebooklocal_ Src_files: = libfaad/bits.c libfaad/cfft.c libfaad/decoder.c libfaad/drc.c libfaad/drm_dec.c libfaad/error.c Lib FAAD/FILTBANK.C libfaad/ic_predict.c libfaad/is.c libfaad/lt_predict.c libfaad/mdct.c libfaad/mp4.c libfaad/ms.c libfaad/output.c libfaad/pns.c libfaad/ps_dec.c libfaad/ps_syntax.c libfaad/pulse.c libfaad/specrec.c libfaad/ SYNTAX.C libfaad/tns.c libfaad/hcr.c libfaad/huffman.c libfaad/rvlc.c libfaad/ssr.c libfaad/ssr_fb.c libfaad/ssr_ IPQF.C libfaad/common.c libfaad/sbr_dct.c libfaad/sbr_e_nf.c libfaad/sbr_fbt.c libfaad/sbr_hfadj.c libfaad/sbr_ HFGEN.C libfaad/sbr_huff.c libfaad/sbr_qmf.c libfaad/sbr_syntax.c libfaad/sbr_tf_grid.c libfaad/sbr_dec.ccommon/ Mp4ff/mp4atom.ccommon/mp4ff/mp4ff.ccommon/mp4ff/mp4meta.ccommon/mp4ff/mp4sample.c common/mp4ff/mp4tagupdate.ccommon/mp4ff/mp4util.ccom_iflytek_codec_aac_faadaacnativedecoder.clocal_cflags:=-DHAVE_CONFIG_ Hlocal_ldlibs: =-lloginclude $ (build_shared_library)

4, compile.

5, fixed-point:

The above compiler is floating point, can be compiled to fixed point, the method is to open the Faad/libfaad/common.h two macros:

#define Fixed_point#define big_iq_table

Then rinse the compilation, on my phone, using fixed point, can be 5 times times faster.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.