]> granicus.if.org Git - libvpx/commitdiff
added transform type to MB_MODE_INFO
authorYaowu Xu <yaowu@google.com>
Fri, 18 Nov 2011 02:31:00 +0000 (18:31 -0800)
committerYaowu Xu <yaowu@google.com>
Thu, 1 Dec 2011 15:34:27 +0000 (07:34 -0800)
this commit is to add an variable in the macroblock level mode
info structure to track the transform size used in each MB, so
the information can be used later in the loop filter to change
how loop filter works on MBs with different transform sizes.

Change-Id: Id0eeaba6cc854c6d1be00ed8d237b3d9e250e447

vp8/common/blockd.h
vp8/decoder/decodframe.c
vp8/encoder/encodeintra.c
vp8/encoder/encodemb.c
vp8/encoder/onyx_if.c
vp8/encoder/tokenize.c

index cef66f02ecf0d7110c45aa71f98cec21d0b872e4..d51e881b4251f60bfcd22e758e9e8a67bc75b655 100644 (file)
@@ -180,6 +180,9 @@ typedef struct
 {
     MB_PREDICTION_MODE mode, uv_mode;
     MV_REFERENCE_FRAME ref_frame;
+#if CONFIG_T8X8
+    TX_SIZE txfm_size;
+#endif
     int_mv mv;
     unsigned char partitioning;
     unsigned char mb_skip_coeff;                                /* does this mb has coefficients at all, 1=no coefficients, 0=need decode tokens */
index 3d2ba2da9ea5002453c29c013206a2e54178e834..a3421ef89ea58963a6eaaefd3974ce3f17abffac 100644 (file)
@@ -210,10 +210,11 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
     int i;
 
 #if CONFIG_T8X8
-    int tx_type = get_seg_tx_type(xd, xd->mode_info_context->mbmi.segment_id);
+    int tx_type = get_seg_tx_type( xd,
+                                  xd->mode_info_context->mbmi.segment_id);
+    xd->mode_info_context->mbmi.txfm_size = tx_type;
 #endif
 
-
     if (xd->mode_info_context->mbmi.mb_skip_coeff)
     {
         vp8_reset_mb_tokens_context(xd);
index ee1e8784714d946113a052e7b2fed7a962e09007..3c0456092e2b614a47273878e259024dd4ce014e 100644 (file)
@@ -100,6 +100,7 @@ void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x)
 #if CONFIG_T8X8
     int tx_type = get_seg_tx_type(&x->e_mbd,
                                   x->e_mbd.mode_info_context->mbmi.segment_id);
+    x->e_mbd.mode_info_context->mbmi.txfm_size = tx_type;
 #endif
 
     RECON_INVOKE(&rtcd->common->recon, build_intra_predictors_mby)(&x->e_mbd);
@@ -178,6 +179,7 @@ void vp8_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x)
 #if CONFIG_T8X8
     int tx_type = get_seg_tx_type(&x->e_mbd,
                                   x->e_mbd.mode_info_context->mbmi.segment_id);
+    x->e_mbd.mode_info_context->mbmi.txfm_size = tx_type;
 #endif
 
     RECON_INVOKE(&rtcd->common->recon, build_intra_predictors_mbuv)(&x->e_mbd);
index da727eb5624dc2f36d4d9def39b2f70da50fa659..483ec768f7e296a90a73f7c769c0db137381bd54 100644 (file)
@@ -1277,6 +1277,7 @@ void vp8_encode_inter16x16(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x)
 #if CONFIG_T8X8
     int tx_type = get_seg_tx_type(&x->e_mbd,
                                   x->e_mbd.mode_info_context->mbmi.segment_id);
+    x->e_mbd.mode_info_context->mbmi.txfm_size = tx_type;
 #endif
 
     vp8_build_inter_predictors_mb(&x->e_mbd);
index 799a656eb8157ea332489bacb3cf31f696283792..c9d91aeaf91cfc89435e1e3918c1a1c8fc1113be 100644 (file)
@@ -476,18 +476,8 @@ static void init_seg_features(VP8_COMP *cpi)
             // Where relevant assume segment data is delta data
             xd->mb_segement_abs_delta = SEGMENT_DELTADATA;
 
-#if CONFIG_T8X8
-            // 8x8TX test code.
-            // This assignment does not necessarily make sense but is
-            // just to test the mechanism for now.
-            enable_segfeature(xd, 0, SEG_LVL_TRANSFORM);
-            set_segdata( xd, 0, SEG_LVL_TRANSFORM, TX_4X4 );
-            enable_segfeature(xd, 1, SEG_LVL_TRANSFORM);
-            set_segdata( xd, 1, SEG_LVL_TRANSFORM, TX_8X8 );
-#endif
         }
     }
-
     // All other frames if segmentation has been enabled
     else if ( xd->segmentation_enabled )
     {
@@ -586,6 +576,25 @@ static void init_seg_features(VP8_COMP *cpi)
             // No updeates.. leave things as they are.
             xd->update_mb_segmentation_map = 0;
             xd->update_mb_segmentation_data = 0;
+
+#if CONFIG_T8X8
+            {
+                vp8_disable_segmentation((VP8_PTR)cpi);\r
+                clearall_segfeatures(xd);
+                vp8_enable_segmentation((VP8_PTR)cpi);
+                // 8x8TX test code.
+                // This assignment does not necessarily make sense but is
+                // just to test the mechanism for now.
+                enable_segfeature(xd, 0, SEG_LVL_TRANSFORM);
+                set_segdata( xd, 0, SEG_LVL_TRANSFORM, TX_4X4 );
+                enable_segfeature(xd, 1, SEG_LVL_TRANSFORM);
+                set_segdata( xd, 1, SEG_LVL_TRANSFORM, TX_8X8 );
+                /* force every mb to use 8x8 transform for testing*/
+                vpx_memset(cpi->segmentation_map, 1,
+                    cpi->common.mb_rows * cpi->common.mb_cols);
+
+            }
+#endif
         }
     }
 }
index e01093ef7ddb0811913a33ceff8581312310ece4..304bb4f9844f131245f520066e4d3b27d4b7141b 100644 (file)
@@ -457,7 +457,7 @@ static int mb_is_skippable_8x8(MACROBLOCKD *x)
     int has_y2_block;
     int skip = 1;
     int i = 0;
+
     has_y2_block = (x->mode_info_context->mbmi.mode != B_PRED
                     && x->mode_info_context->mbmi.mode != SPLITMV);
     if (has_y2_block)