[FFmpeg-cvslog] r14218 - trunk/libavcodec/ra288.c

Måns Rullgård mans
Mon Jul 14 18:09:12 CEST 2008


Vitor Sessak wrote:
> Reimar D?ffinger wrote:
>> Hello,
>> On Sun, Jul 13, 2008 at 10:41:09PM +0200, vitor wrote:
>>> Author: vitor
>>> Date: Sun Jul 13 22:41:09 2008
>>> New Revision: 14218
>>>
>>> Log:
>>> Simplify
>>>
>>> Modified:
>>>    trunk/libavcodec/ra288.c
>>>
>>> Modified: trunk/libavcodec/ra288.c
>>> ==============================================================================
>>> --- trunk/libavcodec/ra288.c	(original)
>>> +++ trunk/libavcodec/ra288.c	Sun Jul 13 22:41:09 2008
>>> @@ -69,9 +69,7 @@ static void decode(Real288_internal *glo
>>>      for (x=0; x < 5; x++)
>>>          buffer[x] = codetable[cb_coef][x] * sumsum;
>>>
>>> -    sum = scalar_product_float(buffer, buffer, 5) / 5;
>>> -
>>> -    sum = FFMAX(sum, 1);
>>> +    sum = FFMAX(1, scalar_product_float(buffer, buffer, 5) / 5);
>>
>> Personally I think this is more an obfuscation than a simplification,
>
> This is a matter of taste. I, personally, hate the construction "var =
> fct(var);".

What's the alternative?  A new operator, perhaps:

  var ()= fct;

Or to replace fct(var, args, ...):

  var (args, ...)= fct;

This could be extended to other operators too.  Take array index, for
instance.  Instead of

  var = array[var];

we could write

  var []= array;

And linked lists can be improved too.  Just replace all those ugly

  item = item->next;

with the much better

  item ->= next;

The ,= operator is left as an exercise for the reader.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-cvslog mailing list