[MPlayer-dev-eng] [PATCH] vop eq2 with gamma correction

Hampa Hug hhug at student.ethz.ch
Wed Sep 25 08:16:50 CEST 2002


Milan Cutka wrote:

> > for (j = 0; j < h; j++) {
> >    for (i = 0; i < w; i++) {
> >      *(dst++) = lut[*(src++)];
> >    }
> > }
> 
> You could try this:
> 
> for (j = 0; j < h; j++) {
>    for (i = 0; i < w; i+=4,src+=4,dst+=4) {
>      *(unsigned int*)dst=
>        (lut[src[3]]<<24)|(lut[src[2]]<<16)|(lut[src[1]]<<8)|lut[src[0]];
>    }
> }

The problem is that this is highly non-portable. There are at least
three issues here (endianness, alignment and sizeof(int)).


> It works faster for me in ffdshow. Of course the best would be to add
> some MMX optimizations, but I don't know how it would be possible to use MMX here.
> For faster but not precise MMX optimized gamma correction look here:
> http://www.stereopsis.com/polygamma.html.

The main reason for me to use a LUT is that it is possible to combine
multiple filters in a single LUT.

regards
Hampa



More information about the MPlayer-dev-eng mailing list