[FFmpeg-devel] ZMBV Improved Motion Estimation

Jason Garrett-Glaser darkshikari
Sun May 11 20:45:31 CEST 2008


> probably its that histogram is uint8_t and thus 256==0

I'm not sure if uint16_t is going to be slower or faster than uint8_t
or uint32_t.

Index: libavcodec/zmbvenc.c
===================================================================
--- libavcodec/zmbvenc.c	(revision 13112)
+++ libavcodec/zmbvenc.c	(working copy)
@@ -64,7 +64,7 @@
 {
     int sum = 0;
     int i, j;
-    uint8_t histogram[256]={0};
+    uint16_t histogram[256]={0};

     for(j = 0; j < bh; j++){
         for(i = 0; i < bw; i++)
@@ -76,7 +76,7 @@
     for(i=1; i<256; i++)
         sum+= score_tab[histogram[i]];

-    return sum;
+    return sum + 256*bw*bh - histogram[0]*256;
 }

 /** Motion estimation function

Dark Shikari




More information about the ffmpeg-devel mailing list