Merge "More optimizations for cost_coeffs()."
authorRonald S. Bultje <rbultje@google.com>
Wed, 24 Jul 2013 04:36:12 +0000 (21:36 -0700)
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>
Wed, 24 Jul 2013 04:36:12 +0000 (21:36 -0700)
1  2 
vp9/encoder/vp9_rdopt.c

@@@ -708,9 -658,10 +657,10 @@@ static void rate_block(int plane, int b
  static int rdcost_plane(VP9_COMMON * const cm, MACROBLOCK *x, int plane,
                          BLOCK_SIZE_TYPE bsize, TX_SIZE tx_size) {
    MACROBLOCKD * const xd = &x->e_mbd;
 -  const int bwl = b_width_log2(bsize) - xd->plane[plane].subsampling_x;
 -  const int bhl = b_height_log2(bsize) - xd->plane[plane].subsampling_y;
 +  const int bwl = plane_block_width_log2by4(bsize, &xd->plane[plane]);
 +  const int bhl = plane_block_height_log2by4(bsize, &xd->plane[plane]);
    const int bw = 1 << bwl, bh = 1 << bhl;
+   int i;
    struct rdcost_block_args args = { cm, x, { 0 }, { 0 }, tx_size, bw, bh,
      0, 0, 0, INT64_MAX, 0 };
  
@@@ -799,9 -782,10 +781,10 @@@ static void super_block_yrd_for_txfm(VP
                                       BLOCK_SIZE_TYPE bsize, TX_SIZE tx_size) {
    MACROBLOCKD *const xd = &x->e_mbd;
    struct macroblockd_plane *const pd = &xd->plane[0];
 -  const int bwl = b_width_log2(bsize) - xd->plane[0].subsampling_x;
 -  const int bhl = b_height_log2(bsize) - xd->plane[0].subsampling_y;
 +  const int bwl = plane_block_width_log2by4(bsize, pd);
 +  const int bhl = plane_block_height_log2by4(bsize, pd);
    const int bw = 1 << bwl, bh = 1 << bhl;
+   int i;
    struct rdcost_block_args args = { cm, x, { 0 }, { 0 }, tx_size, bw, bh,
                                      0, 0, 0, ref_best_rd, 0 };
    xd->mode_info_context->mbmi.txfm_size = tx_size;
@@@ -1209,9 -1224,10 +1223,10 @@@ static int64_t rd_pick_intra4x4block(VP
      vpx_memcpy(tempa, ta, sizeof(ta));
      vpx_memcpy(templ, tl, sizeof(tl));
  
 -    for (idy = 0; idy < bh; ++idy) {
 -      for (idx = 0; idx < bw; ++idx) {
 +    for (idy = 0; idy < num_4x4_blocks_high; ++idy) {
 +      for (idx = 0; idx < num_4x4_blocks_wide; ++idx) {
          int64_t ssz;
+         const int16_t *scan;
  
          block = ib + idy * 2 + idx;
          xd->mode_info_context->bmi[block].as_mode = mode;