[FFmpeg-devel] Extend/optimize RGB to RGB conversions funcsintorgb2rgb.c

Clément Bœsch ubitux at gmail.com
Tue Sep 11 00:30:25 CEST 2012


On Tue, Sep 11, 2012 at 12:25:32AM +0200, yann.lepetitcorps at free.fr wrote:
> And found this at
> http://stackoverflow.com/questions/7194452/fast-vectorized-conversion-from-rgb-to-bgra
> 
> #include <tmmintrin.h>
> 
> /* in and out must be 16-byte aligned */
> void rgb_to_bgrx_sse(unsigned w, const void *in, void *out)
> {
>     const __m128i *in_vec = in;
>     __m128i *out_vec = out;
> 
>     w /= 16;
> 
>     while (w-- > 0) {
>         /*             0  1  2  3  4  5  6  7  8  9  10 11 12 13 14 15
>          * in_vec[0]   Ra Ga Ba Rb Gb Bb Rc Gc Bc Rd Gd Bd Re Ge Be Rf
>          * in_vec[1]   Gg Bg Rh Gh Bh Ri Gi Bi Rj Gj Bj Rk Gk Bk Rl Gl
>          * in_vec[2]   Bl Rm Gm Bm Rn Gn Bn Ro Go Bo Rp Gp Bp Rq Gq Bq
>          */
>         __m128i in1, in2, in3;
>         __m128i out;
> 
[...]

If you are willing to add SSE optims or similar, you should check
libswscale/x86/rgb2rgb_template.c and related files. It's likely they
already exist.

Also, it's hard to follow the thread when you are top posting.

Regards,

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120911/988ccb92/attachment.asc>


More information about the ffmpeg-devel mailing list