Commit 508cd5a6 authored by Dmitry Kovalev's avatar Dmitry Kovalev
Browse files

Reusing rd_less_than_thresh() function.

Change-Id: I29df10fde86128467f5e99fc373ac04f004257e1
parent 66ce10c1
...@@ -284,9 +284,8 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -284,9 +284,8 @@ int64_t vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
(1 << INTER_OFFSET(this_mode))) (1 << INTER_OFFSET(this_mode)))
continue; continue;
if (best_rd < ((int64_t)rd_threshes[mode_idx[this_mode]] * if (rd_less_than_thresh(best_rd, rd_threshes[mode_idx[this_mode]],
rd_thresh_freq_fact[this_mode] >> 5) || rd_thresh_freq_fact[this_mode]))
rd_threshes[mode_idx[this_mode]] == INT_MAX)
continue; continue;
if (this_mode == NEWMV) { if (this_mode == NEWMV) {
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
*/ */
#include <assert.h> #include <assert.h>
#include <limits.h>
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
...@@ -2991,11 +2990,6 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -2991,11 +2990,6 @@ void vp9_rd_pick_intra_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
ctx->mic = *xd->mi[0]; ctx->mic = *xd->mi[0];
} }
static INLINE int rd_less_than_thresh(int64_t best_rd, int thresh,
int thresh_fact) {
return best_rd < ((int64_t)thresh * thresh_fact >> 5) || thresh == INT_MAX;
}
// Updating rd_thresh_freq_fact[] here means that the different // Updating rd_thresh_freq_fact[] here means that the different
// partition/block sizes are handled independently based on the best // partition/block sizes are handled independently based on the best
// choice for the current partition. It may well be better to keep a scaled // choice for the current partition. It may well be better to keep a scaled
...@@ -3228,7 +3222,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x, ...@@ -3228,7 +3222,7 @@ int64_t vp9_rd_pick_inter_mode_sb(VP9_COMP *cpi, MACROBLOCK *x,
// Test best rd so far against threshold for trying this mode. // Test best rd so far against threshold for trying this mode.
if (rd_less_than_thresh(best_rd, rd_threshes[mode_index], if (rd_less_than_thresh(best_rd, rd_threshes[mode_index],
rd_thresh_freq_fact[mode_index])) rd_thresh_freq_fact[mode_index]))
continue; continue;
this_mode = vp9_mode_order[mode_index].mode; this_mode = vp9_mode_order[mode_index].mode;
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#ifndef VP9_ENCODER_VP9_RDOPT_H_ #ifndef VP9_ENCODER_VP9_RDOPT_H_
#define VP9_ENCODER_VP9_RDOPT_H_ #define VP9_ENCODER_VP9_RDOPT_H_
#include <limits.h>
#include "vp9/encoder/vp9_encoder.h" #include "vp9/encoder/vp9_encoder.h"
#ifdef __cplusplus #ifdef __cplusplus
...@@ -87,6 +89,11 @@ void vp9_set_rd_speed_thresholds(VP9_COMP *cpi); ...@@ -87,6 +89,11 @@ void vp9_set_rd_speed_thresholds(VP9_COMP *cpi);
void vp9_set_rd_speed_thresholds_sub8x8(VP9_COMP *cpi); void vp9_set_rd_speed_thresholds_sub8x8(VP9_COMP *cpi);
static INLINE int rd_less_than_thresh(int64_t best_rd, int thresh,
int thresh_fact) {
return best_rd < ((int64_t)thresh * thresh_fact >> 5) || thresh == INT_MAX;
}
static INLINE int full_pixel_search(VP9_COMP *cpi, MACROBLOCK *x, static INLINE int full_pixel_search(VP9_COMP *cpi, MACROBLOCK *x,
BLOCK_SIZE bsize, MV *mvp_full, BLOCK_SIZE bsize, MV *mvp_full,
int step_param, int error_per_bit, int step_param, int error_per_bit,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment