[SCM] libav/experimental: 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.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:25:49 UTC 2013


The following commit has been merged in the experimental branch:
commit 5916af1954f0c25f06e87d2076aaf536c684ed98
Author: Vitor Sessak <vitor1001 at gmail.com>
Date:   Wed Jul 23 03:54:31 2008 +0000

    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.
    
    Originally committed as revision 14340 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/elbg.c b/libavcodec/elbg.c
index 130f5f6..9f8ed22 100644
--- a/libavcodec/elbg.c
+++ b/libavcodec/elbg.c
@@ -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);
         }

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list