[FFmpeg-devel] [PATCH] swscale: Do not misuse HAVE_* flags.

Ramiro Polla ramiro.polla
Mon Jul 27 08:54:59 CEST 2009


On Sat, Jul 25, 2009 at 5:17 AM, Michael Niedermayer<michaelni at gmx.at> wrote:
> On Fri, Jul 24, 2009 at 03:01:22AM -0300, Ramiro Polla wrote:
>> On Sun, Apr 5, 2009 at 6:11 PM, Michael Niedermayer<michaelni at gmx.at> wrote:
>> > On Sun, Apr 05, 2009 at 06:00:19PM -0300, Ramiro Polla wrote:
>> >> On Sun, Apr 5, 2009 at 5:51 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> >> > On Sun, Apr 05, 2009 at 05:28:21PM -0300, Ramiro Polla wrote:
>> >> >> On Sun, Apr 5, 2009 at 5:14 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
>> >> >> > On Sun, Apr 05, 2009 at 02:14:15PM -0300, Ramiro Polla wrote:
>> >> >> >> swscale: Do not misuse HAVE_* flags.
>> >> >> >> Rename COMPILE_* to SWSCALE_COMPILE_*.
>> >> >> >> Rename wrong uses of HAVE_* to COMPILE_*.
>> >> >> >
>> >> >> > [...]
>> >> >> >> @@ -1594,7 +1592,7 @@ error:
>> >> >> >> ? ? ?return ret;
>> >> >> >> ?}
>> >> >> >>
>> >> >> >> -#if COMPILE_MMX2
>> >> >> >> +#if SWSCALE_COMPILE_MMX2
>> >> >> >> ?static void initMMX2HScaler(int dstW, int xInc, uint8_t *funnyCode, int16_t *filter, int32_t *filterPos, int numSplits)
>> >> >> >> ?{
>> >> >> >> ? ? ?uint8_t *fragmentA;
>> >> >> >
>> >> >> > this should be HAVE_MMX2 when HAVE* are not changed
>> >> >>
>> >> >> SWSCALE_COMPILE_MMX2 is HAVE_MMX2 && CONFIG_GPL. If CONFIG_GPL is not
>> >> >> set, we shouldn't be compiling this. Besides, using SWSCALE_COMPILE_*
>> >> >> makes it consistent with the rest of the file.
>> >> >>
>> >> >> Or am I missing something?
>> >> >
>> >> > #if CONFIG_GPL
>> >> > # ? undef HAVE_MMX
>> >> > ...
>> >> > #endif
>> >>
>> >> I don't think it's a good idea to fiddle around with HAVE_* flags, and
>> >> this patch removes code that currently does it. Also if/when people
>> >> start rewriting parts of the GPL code, we will end up with some GPL
>> >> and some LGPL code. Keeping the HAVE_ flags intact is better to decide
>> >> what to build.
>> >
>> > iam currently maintainer of swscale and i prefer not to make
>> > the #ifdeffery worse than what it already is.
>>
>> New patch attached (it doesn't depend on a previous patch like the
>> first one in this thread did).
>
> fine if tested

Applied.

>> IMO it does not make the ifdeffery worse, in fact I think it makes it
>> cleaner. COMPILE_TEMPLATE_ sounds much more intuitive than HAVE_ for
>> the given purpose, and HAVE_ is used for another purpose on the rest
>> of FFmpeg.
>>
>> I read in an old thread you said you would not review MMX rewrites
>> [0]. In my previous reply to this thread I was still under the
>> impression that swscale MMX code was mostly written by other people
>> (like the libmpeg2 folks) and that's why it was GPL. I'm sorry if my
>> reasoning for the patch made it sound like I wanted to encourage
>> rewrites of your code. I just want (L)GPL code to be easily
>> selectable, and with the current if(!GPL) disable MMX approach it's
>> impossible. IIRC Kostya has been writing swscale code under LGPL, and
>> we already have some LGPL MMX optimization [1] which is not being
>> compiled in LGPL builds.
>
> I dont mind to have the existing LGPL code enabled but i would
> prefer if some of thouse many companies using ffmpeg and who would
> benefit from LGPL sws would pay the GPL authors to relicense it
> instead of more being rewritten by some of us for free.
>
> This world is nasty, the supermarkets around here _do_ charge money
> for the food, and ISP, electricity, ... aint free either.
> Maybe i should get a job, iam not particularely short on offers but
> that wouldnt help ffmpeg as i would likely have significantly less
> time for it ...
> I hope people understand now why iam annoyed by a sws LGPL rewrite,
> iam simply seeing the possibility of covering some past expenses.
> Outside of that i dont really care if my code is GPL or LGPL, i
> might slightly prefer GPL but thats not a big thing ...
>
> To summarize it again
> A. some of us working for free to please companies who dont pay us
> ? ->we also have less time for other things and we do need to pay
> ? ? food,ISP,appartment,electricity,failed computer components,...
> ? ? that occur during that time
> B. receiving some money and simply relicensing to LGPL
>
> Writing FOSS is supposed to be a fun thing and working for free for
> someone who does make money of ones work but donates none of it isnt
> fun IMHO.
> The way it should be is IMHO
> * we write code we like under a license we like not write what some
> ?rich company wants so they can fill their pockets even more ...
>
> In that sense i also think it would be nice if companies who have
> money would donate some to the devel who fixed a bug for them that
> they wanted fixed.
> As a sideeffect that might (though noone can know for sure of course)
> have a positive effect on the amount of bugs that are open...

We could start a "Adopt a scaler" campaign, where people can pay for a
scaler and after they've all been "adopted" you relicense all the
optimizations...

Ramiro Polla



More information about the ffmpeg-devel mailing list