[FFmpeg-devel] snowenc.c

Michael Niedermayer michaelni at gmx.at
Mon Jan 9 20:50:22 CET 2012


On Mon, Jan 09, 2012 at 02:59:11AM +0100, yann.lepetitcorps at free.fr wrote:
> Hi,
> 
> 
> I see this into the libavcodec/snowenc.c :
> 
> //near copy & paste from dsputil, FIXME
> static int pix_sum(uint8_t * pix, int line_size, int w)
> {
>     int s, i, j;
> 
>     s = 0;
>     for (i = 0; i < w; i++) {
>         for (j = 0; j < w; j++) {
>             s += pix[0];
>             pix ++;
>         }
>         pix += line_size - w;
>     }
>     return s;
> }
> 
> => it was a reason for to use this :
> 
>     for (i = 0; i < w; i++) {
>         for (j = 0; j < w; j++) {
>             s += pix[0];
>             pix ++;
>         }
>         pix += line_size - w;
>     }
> 
> instead this ?
> 
>     for (i = 0; i < w; i++) {
>         for (j = 0; j < w; j++) {
>             s += pix[j];
>         }
>         pix += line_size;
>     }
> 
> 
> (if not, I think that a similar modification can be make at the pix_norm1() func
> too)
> 
> And is this used for make the sum of values of a w*w quad started on the pixel
> pointed by pix ?

yes


> 
> In this case, why not using a w*h **rectangular** quad instead a **square** w*w
> quad ?

> (this is more generic, so can be certainly reused in more places)

where can it be reused ?


Note, if you just want to work on something and dont know what.
Please see our bug tracker (http://ffmpeg.org/trac/ffmpeg or
http://wiki.multimedia.cx/index.php?title=Small_FFmpeg_Tasks)

Thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120109/d8950b74/attachment.asc>


More information about the ffmpeg-devel mailing list