[FFmpeg-devel] [PATCH] Add a codebook generator

Vitor vitor1001
Wed May 30 12:45:07 CEST 2007


Hi

Benoit Fouet wrote:
> Hi,
>   
>> And the rest I agree. Btw, if it is accepted, I suggest the log
>> message "Codebook generator using the ELBG algorithm."
>>
>> -Vitor
>> ------------------------------------------------------------------------
>>
>> Index: libavcodec/elbg.c
>> ===================================================================
>> --- libavcodec/elbg.c	(revision 0)
>> +++ libavcodec/elbg.c	(revision 0)
>>   
>>     
>
> [snip]
>
>   
>> +static inline void vect_division(int *res, int *vect, int div, int dim)
>> +{
>> +    int i;
>> +    if (div > 1)
>>   
>>     
>
> why not just if(div) ?
>   
>> +        for (i=0; i<dim; i++)
>> +            res[i] = vect[i]/div;
>> +}
>> +
>>   
>>     
>
>   
The idea was not to spend time dividing the whole vector by 1. But there 
was a bug in the code, I changed it to

if (div > 1)
for (i=0; i<dim; i++)
res[i] = vect[i]/div;
else if (res != vect)
for (i=0; i<dim; i++)
res[i] = vect[i];


And I agree with the other comments.

-Vitor

-------------- next part --------------
A non-text attachment was scrubbed...
Name: elbg3.diff
Type: text/x-patch
Size: 16680 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070530/d725e78d/attachment.bin>



More information about the ffmpeg-devel mailing list