]> granicus.if.org Git - libvpx/commitdiff
Merge "Refactor vp9_update_rd_thresh_fact"
authorJingning Han <jingning@google.com>
Fri, 31 Oct 2014 15:55:28 +0000 (08:55 -0700)
committerGerrit Code Review <gerrit@gerrit.golo.chromium.org>
Fri, 31 Oct 2014 15:55:28 +0000 (08:55 -0700)
1  2 
vp9/encoder/vp9_pickmode.c
vp9/encoder/vp9_rd.c
vp9/encoder/vp9_rdopt.c

Simple merge
index 13e317d6d78cee8d001a249aa3c4c00fc8f23a85,fa8482ff62a80cef05c3e208b963119c63460c96..2f19d29420b6b046be244d2060d7cd9240422682
@@@ -594,21 -594,26 +594,20 @@@ void vp9_set_rd_speed_thresholds_sub8x8
    const SPEED_FEATURES *const sf = &cpi->sf;
    RD_OPT *const rd = &cpi->rd;
    int i;
 -
 -  for (i = 0; i < MAX_REFS; ++i)
 -    rd->thresh_mult_sub8x8[i] = cpi->oxcf.mode == BEST ? -500 : 0;
 -
 -  rd->thresh_mult_sub8x8[THR_LAST] += 2500;
 -  rd->thresh_mult_sub8x8[THR_GOLD] += 2500;
 -  rd->thresh_mult_sub8x8[THR_ALTR] += 2500;
 -  rd->thresh_mult_sub8x8[THR_INTRA] += 2500;
 -  rd->thresh_mult_sub8x8[THR_COMP_LA] += 4500;
 -  rd->thresh_mult_sub8x8[THR_COMP_GA] += 4500;
 -
 -  // Check for masked out split cases.
 -  for (i = 0; i < MAX_REFS; ++i)
 -    if (sf->disable_split_mask & (1 << i))
 -      rd->thresh_mult_sub8x8[i] = INT_MAX;
 +  static const int thresh_mult[2][MAX_REFS] =
 +      {{2500, 2500, 2500, 4500, 4500, 2500},
 +       {2000, 2000, 2000, 4000, 4000, 2000}};
 +
 +  for (i = 0; i < MAX_REFS; ++i) {
 +    rd->thresh_mult_sub8x8[i] =
 +        (sf->disable_split_mask & (1 << i)) ?
 +            INT_MAX : thresh_mult[cpi->oxcf.mode == BEST][i];
 +  }
  }
  
- // TODO(jingning) Refactor this function. Use targeted smaller struct as inputs.
- void vp9_update_rd_thresh_fact(VP9_COMP *cpi, TileDataEnc *tile_data,
+ void vp9_update_rd_thresh_fact(int (*factor_buf)[MAX_MODES], int rd_thresh,
                                 int bsize, int best_mode_index) {
-   if (cpi->sf.adaptive_rd_thresh > 0) {
+   if (rd_thresh > 0) {
      const int top_mode = bsize < BLOCK_8X8 ? MAX_REFS : MAX_MODES;
      int mode;
      for (mode = 0; mode < top_mode; ++mode) {
Simple merge