[FFmpeg-devel] What about pre-processing?

Ramiro Polla ramiro
Sat Apr 19 15:10:08 CEST 2008


Hello,

The same way the libmimic decoder had lots of post-processing, the 
libmimic encoder does one pre-processing on the luma planes. It copies 
bytes from the previous frame, if that same byte on the current frame is 
no more than 7 greater or smaller then the previous frame's byte. Like 
in this code:

     for (i = 0; i < height; i++) {
         for (j = 0; j < width; j++) {
             if (FFABS(prev[j] - cur[j]) < 7)
                 cur[j] = prev[j];
         }
         cur  += stride;
         prev += stride;
     }

This way the block has more chances of being like the previous frame's 
one. It has the disadvantage of possibly making the block more different 
than the backreference frames, since it is only checked against the 
previous frame.

I am thinking of just removing this pre-processing and raising the 
threshold for the cmp functions. Is this the right way to go?

Ramiro Polla




More information about the ffmpeg-devel mailing list