[vlc-devel] [PATCH] Contribs: ffmpeg, enable small when deactivating encoder
Rafaël Carré
funman at videolan.org
Sun Feb 5 18:36:07 CET 2012
Le 2012-02-04 08:31, Jean-Baptiste Kempf a écrit :
> On Sat, Feb 04, 2012 at 02:27:33PM +0100, Jean-Baptiste Kempf wrote :
>> ---
>> contrib/src/ffmpeg/rules.mak | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak
>> index 98ce743..3255134 100644
>> --- a/contrib/src/ffmpeg/rules.mak
>> +++ b/contrib/src/ffmpeg/rules.mak
>> @@ -30,7 +30,7 @@ FFMPEGCONF += --enable-libmp3lame --enable-libvpx
>> DEPS_ffmpeg += lame $(DEPS_lame) vpx $(DEPS_vpx)
>> else
>> FFMPEGCONF += --disable-encoders --disable-muxers
>> -# XXX: REVISIT --enable-small ?
>> +FFMPEGCONF += --enable-small --optflags=-O2
>> endif
>
> So, this is a quite quick solution. But maybe we should de-couple
> small and encoders-deactivation.
> I just thought that if you deactivate encoders, this is mainly because
> you are on embedded devices, so you need small.
>
> Opinions?
The doc says:
--enable-small optimize for size instead of speed
and it does two things:
* remove __attribute__((always_inline))
* add -Os to CFLAGS, which you override with -O2; instead of -O3 previously.
I have a few questions:
* Why override -O3 with -O2?
* Why override -Os, when you want to optimize for size?
* What is the result of this patch:
* How much smaller is libav*?
* How much faster/slower?
IMO it does not make sense at all to optimize ffmpeg for size; unless
decoding speed is not affected negatively, or at a very small rate.
In any case it should be benchmarked before and after the patch.
My android device is a dual core 1.2GHz with 1GB of ram, I think I have
enough memory to optimize FFmpeg for size.
Encoders are disabled because I use it to consume media, not to create.
I for sure have a couple megabytes of RAM to spare to get the fastest
decoders, especially when faster decoding means longer battery life.
If you are too cheap to have FFmpeg use more memory, then you should
have added specific options to your CFLAGS like -mthumb -Os or
-vomit-frame-pointer, but in the default case it should optimize for
speed (configure does that itself already).
>
> Best regards,
>
More information about the vlc-devel
mailing list