mstorsjo / fdk-aac

A standalone library of the Fraunhofer FDK AAC code from Android.
https://sourceforge.net/projects/opencore-amr/
Other
1.18k stars 389 forks source link

How to compile fdkaac into much smaller library? #141

Open Shumpert820 opened 2 years ago

Shumpert820 commented 2 years ago

Hello, my project only need acodec for aac eld(16k sample rate 480 sample numbers) and aac lc(16k sample rate 1024 sample numbers). The size of libfdk-aac after I compiled is about 2MB. However, the device's memory is limited. so, is there any way to compile this lib much smaller, 100KB or even smaller is perfect.

widgetii commented 2 years ago

Hi, if you need only AAC encoder on your device you might try my own fdk-aac fork with precise configuration for CMake build options https://github.com/widgetii/fdk-aac/tree/tinification:

-DDISABLE_SBR_ENCODER=ON 
-DDISABLE_SAC_ENCODER=ON
-DDISABLE_META_ENCODER=ON
-DDISABLE_DECODERS=ON

With LTO enabled and static build, I have about 250Kb of the whole AAC encoder binary size. I'm sure there is some space for improvements still

Shumpert820 commented 2 years ago

Hi, if you need only AAC encoder on your device you might try my own fdk-aac fork with precise configuration for CMake build options https://github.com/widgetii/fdk-aac/tree/tinification:

-DDISABLE_SBR_ENCODER=ON 
-DDISABLE_SAC_ENCODER=ON
-DDISABLE_META_ENCODER=ON
-DDISABLE_DECODERS=ON

With LTO enabled and static build, I have about 250Kb of the whole AAC encoder binary size. I'm sure there is some space for improvements still

Thank you very much. Is the same way to compress AAC decoder?

widgetii commented 2 years ago

I guess you can try the same way to adapt source code as well but I didn't need it for my purposes