[MPlayer-dev-eng] [PATCH] vop eq2 with gamma correction
Milan Cutka
cutka at szm.sk
Wed Sep 25 08:25:33 CEST 2002
HH> 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]];
>> }
>> }
HH> The problem is that this is highly non-portable. There are at least
HH> three issues here (endianness, alignment and sizeof(int)).
Sorry, but I've never needed to care about portability. Maybe I should
try to port some of ffdshow image filters to mplayer to learn that.
>> 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.
HH> The main reason for me to use a LUT is that it is possible to combine
HH> multiple filters in a single LUT.
Maybe I will try this too in ffdshow.
Milan
More information about the MPlayer-dev-eng
mailing list