]> granicus.if.org Git - libvpx/commitdiff
Populate q_index in multi-thread encoding
authorYunqing Wang <yunqingwang@google.com>
Mon, 28 Nov 2011 19:43:25 +0000 (14:43 -0500)
committerYunqing Wang <yunqingwang@google.com>
Mon, 28 Nov 2011 20:58:28 +0000 (15:58 -0500)
This value needs to be copied to each thread's data structure.
This fixed artifact problem in multi-thread encoder.

Change-Id: Iab6d9745a1d44846aa503184705376f63a505597

vp8/encoder/ethreading.c
vp8/encoder/quantize.c

index 557080dba50a760e5afe7e4ef122526b5149145b..8c496686a2168d707b1c5172662b99aceeb89ae8 100644 (file)
@@ -343,6 +343,9 @@ static void setup_mbby_copy(MACROBLOCK *mbdst, MACROBLOCK *mbsrc)
         z->block[i].zbin            = x->block[i].zbin;
         z->block[i].zrun_zbin_boost   = x->block[i].zrun_zbin_boost;
         z->block[i].round           = x->block[i].round;
+        z->q_index                  = x->q_index;
+        z->act_zbin_adj             = x->act_zbin_adj;
+        z->last_act_zbin_adj        = x->last_act_zbin_adj;
         /*
         z->block[i].src             = x->block[i].src;
         */
index e57a264302d83b4adbf42f3b5b61ffcb0e5e7e28..3ca8758efeca36edbbc1e7f5ff51abd7a3940d81 100644 (file)
@@ -609,6 +609,9 @@ void vp8cx_mb_init_quantizer(VP8_COMP *cpi, MACROBLOCK *x, int ok_to_skip)
 
     /* This initialization should be called at least once. Use ok_to_skip to
      * decide if it is ok to skip.
+     * Before encoding a frame, this function is always called with ok_to_skip
+     * =0, which means no skiping of calculations. The "last" values are
+     * initialized at that time.
      */
     if (!ok_to_skip || QIndex != x->q_index)
     {