summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_rd.c
diff options
context:
space:
mode:
Diffstat (limited to 'vp9/encoder/vp9_rd.c')
-rw-r--r--vp9/encoder/vp9_rd.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/vp9/encoder/vp9_rd.c b/vp9/encoder/vp9_rd.c
index 13e317d6d..2f19d2942 100644
--- a/vp9/encoder/vp9_rd.c
+++ b/vp9/encoder/vp9_rd.c
@@ -605,10 +605,9 @@ void vp9_set_rd_speed_thresholds_sub8x8(VP9_COMP *cpi) {
}
}
-// 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) {
@@ -616,12 +615,12 @@ void vp9_update_rd_thresh_fact(VP9_COMP *cpi, TileDataEnc *tile_data,
const BLOCK_SIZE max_size = MIN(bsize + 2, BLOCK_64X64);
BLOCK_SIZE bs;
for (bs = min_size; bs <= max_size; ++bs) {
- int *const fact = &tile_data->thresh_freq_fact[bs][mode];
+ int *const fact = &factor_buf[bs][mode];
if (mode == best_mode_index) {
*fact -= (*fact >> 4);
} else {
*fact = MIN(*fact + RD_THRESH_INC,
- cpi->sf.adaptive_rd_thresh * RD_THRESH_MAX_FACT);
+ rd_thresh * RD_THRESH_MAX_FACT);
}
}
}