fdk-aac icon indicating copy to clipboard operation
fdk-aac copied to clipboard

libfdkaac.a too big

Open jinlong0813 opened this issue 8 years ago • 4 comments

Dears, I cross_compile this project, but the library libfdkaac.a is too big for my arm device. I only want to encode the pcm data to aac format. What parameter can I use when I do the compile? Waiting for your reply, Thanks.

jinlong0813 avatar Oct 14 '16 13:10 jinlong0813

If you mean that the resulting binary executable is too large, it's hard to do anything about it, since normally, only the actually used parts of a static library gets included, so the decoder half is not included unless you actually use it. If you have a problem that the .a file itself is too large, you can probably comment out the decoder side of things from Makefile.am.

mstorsjo avatar Oct 18 '16 06:10 mstorsjo

@mstorsjo hello, I also want to make this lib smallest, this two folders : libAACdec and libAACenc can be compiled and used standalone?

xsjqqq123 avatar Nov 24 '16 05:11 xsjqqq123

Hello, I would appreciate an answer to the above question from xsjqqq123 .

EduardMariniuc avatar Nov 07 '17 15:11 EduardMariniuc

Yes, libAACdec and libAACenc are completely disjoint so they can be built without each other. If you want to try this, you can modify the line libfdk_aac_la_SOURCES in Makefile.am and rerun ´./autogen.sh`.

However, if you are building a static library, this will only shrink the size of the library, not the size of the actual binary you build from it.

As an example - if I build normally from the latest version, these are the sizes of files I get:

-rwxrwxr-x 1 martin martin 2.5M Nov  7 21:42 aac-enc
-rw-rw-r-- 1 martin martin 7.7M Nov  7 21:42 .libs/libfdk-aac.a

If I remove $(AACDEC_SRC), $(MPEGTPDEC_SRC) and $(SBRDEC_SRC) and rebuild, I get the following sizes:

-rwxrwxr-x 1 martin martin 2.5M Nov  7 21:43 aac-enc
-rw-rw-r-- 1 martin martin 4.6M Nov  7 21:43 .libs/libfdk-aac.a

So yes, this did reduce the size of libfdk-aac.a, but aac-enc (or whichever executable that links in the static library) will only include what it actually uses (in this case, the encoder half), so for aac-enc it doesn't matter if the library contains the decoder ot not.

mstorsjo avatar Nov 07 '17 19:11 mstorsjo