[FFmpeg-devel] [PATCH] avfilter: add allrgb

Clément Bœsch u at pkh.me
Sat Aug 29 14:56:35 CEST 2015


On Sun, Aug 16, 2015 at 11:05:35AM +0200, Nicolas George wrote:
[...]
> Not very important since it is called only once, but people may use it as a
> base for more speed-relevant code: this is probably more efficient.
> 
>     line = frame->data[0];
>     for (y = 0; y < 4096; y++) {
>         pix = line;
>         for (x = 0; x < 4096; x++) {
>             *(pix++) = y >> 4;
>             *(pix++) = (y << 4) | (x >> 8);
>             *(pix++) = x;
>         }
>         line += linesize;
>     }
> 
> Another point: this would probably look nicer as an image:
> 
>             *(pix++) = x;
>             *(pix++) = y;
>             *(pix++) = (x >> 8) | ((y >>8) << 4);

I picked that one, because yeah it's prettier.

Pushed, thanks

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150829/5ff97a3d/attachment.sig>


More information about the ffmpeg-devel mailing list