]> granicus.if.org Git - libvpx/commitdiff
Minor cleanups
authorYaowu Xu <yaowu@google.com>
Fri, 28 Jun 2013 16:19:50 +0000 (09:19 -0700)
committerYaowu Xu <yaowu@google.com>
Fri, 28 Jun 2013 16:19:50 +0000 (09:19 -0700)
Change-Id: I379617c1c731a686b3f7e032b8805860c1055b12

vp9/encoder/vp9_encodeintra.c
vp9/encoder/vp9_rdopt.c

index f29dba0c113a2a22dd85c20ec1b2d418a980987d..5cab867a8aa9455e8f8dc31c0b4690cf719c1547 100644 (file)
@@ -20,13 +20,8 @@ int vp9_encode_intra(VP9_COMP *cpi, MACROBLOCK *x, int use_16x16_pred) {
   (void) cpi;
   mbmi->mode = DC_PRED;
   mbmi->ref_frame[0] = INTRA_FRAME;
-  if (use_16x16_pred) {
-    mbmi->txfm_size = mbmi->sb_type >= BLOCK_SIZE_MB16X16 ? TX_16X16 : TX_8X8;
-    vp9_encode_intra_block_y(&cpi->common, x, mbmi->sb_type);
-  } else {
-    mbmi->txfm_size = TX_4X4;
-    vp9_encode_intra_block_y(&cpi->common, x, mbmi->sb_type);
-  }
-
+  mbmi->txfm_size = use_16x16_pred ? (mbmi->sb_type >= BLOCK_SIZE_MB16X16 ?
+                                     TX_16X16 : TX_8X8) : TX_4X4;
+  vp9_encode_intra_block_y(&cpi->common, x, mbmi->sb_type);
   return vp9_get_mb_ss(x->plane[0].src_diff);
 }
index 87f72894c7fb76d4b38a0e5057a326645124f5bd..37fc9316dc2ee93169116440eeb1a3ab8b1366a1 100644 (file)
@@ -932,23 +932,13 @@ static void super_block_uvrd(VP9_COMMON *const cm, MACROBLOCK *x,
                              BLOCK_SIZE_TYPE bsize) {
   MACROBLOCKD *const xd = &x->e_mbd;
   MB_MODE_INFO *const mbmi = &xd->mode_info_context->mbmi;
+  TX_SIZE uv_txfm_size = get_uv_tx_size(mbmi);
 
   if (mbmi->ref_frame[0] > INTRA_FRAME)
     vp9_subtract_sbuv(x, bsize);
 
-  if (mbmi->txfm_size >= TX_32X32 && bsize >= BLOCK_SIZE_SB64X64) {
-    super_block_uvrd_for_txfm(cm, x, rate, distortion, skippable, bsize,
-                              TX_32X32);
-  } else if (mbmi->txfm_size >= TX_16X16 && bsize >= BLOCK_SIZE_SB32X32) {
-    super_block_uvrd_for_txfm(cm, x, rate, distortion, skippable, bsize,
-                              TX_16X16);
-  } else if (mbmi->txfm_size >= TX_8X8 && bsize >= BLOCK_SIZE_MB16X16) {
-    super_block_uvrd_for_txfm(cm, x, rate, distortion, skippable, bsize,
-                              TX_8X8);
-  } else {
-    super_block_uvrd_for_txfm(cm, x, rate, distortion, skippable, bsize,
-                              TX_4X4);
-  }
+  super_block_uvrd_for_txfm(cm, x, rate, distortion, skippable, bsize,
+                            uv_txfm_size);
 }
 
 static int64_t rd_pick_intra_sbuv_mode(VP9_COMP *cpi, MACROBLOCK *x,