[FFmpeg-cvslog] r14340 - trunk/libavcodec/elbg.c

vitor subversion
Wed Jul 23 05:54:31 CEST 2008


Author: vitor
Date: Wed Jul 23 05:54:31 2008
New Revision: 14340

Log:
The codebook generator algorithm involves picking three 
different codebook centroids ("high utility", "low 
utility" and "closest to the low utility one"). This 
change avoid the corner case of choosing two times the 
same centroid.


Modified:
   trunk/libavcodec/elbg.c

Modified: trunk/libavcodec/elbg.c
==============================================================================
--- trunk/libavcodec/elbg.c	(original)
+++ trunk/libavcodec/elbg.c	Wed Jul 23 05:54:31 2008
@@ -299,8 +299,10 @@ static void do_shiftings(elbg_data *elbg
             if (elbg->utility_inc[elbg->numCB-1] == 0)
                 return;
 
-            idx[1] = get_high_utility_cell(elbg);
             idx[2] = get_closest_codebook(elbg, idx[0]);
+            do {
+                idx[1] = get_high_utility_cell(elbg);
+            } while (idx[1] == idx[0] || idx[1] == idx[2]);
 
             try_shift_candidate(elbg, idx);
         }




More information about the ffmpeg-cvslog mailing list