Commit 53ff43ad authored by Deb Mukherjee's avatar Deb Mukherjee

Prunes out full-rd computation based on modeled rd

Adds a speed feature to eliminate full-rd computation if the modeled
rd or rd based on a different parameter in the same mode is already
a lot larger than the best rd yet.

Specifically, only search the sharp and smooth filters if the modeled
rd cost based on the  regular filter is within a certain factor of the
best rd cost so far. Also, skip full-rd computation of non splitmv
inter modes if the modeled rd cost based on pred error is within the
same factor of the best rd cost so far.

Also adds some enhancements in the rd search for splitmv mode to
speed things up by early breakouts. Negligible impact on performance.

Resuts on derfraw300:
psnr:    -0.013% with the splitmv enhancements, -0.24% with the rd
         breakout feature on.
speedup: 6% with splitmv enhancements, 20% with also residual breakout
         (tested on football sequence at 600 Kbps)

Change-Id: I37abc308ea9f110c1679ce649b6a7e73ab1ad5fc
parent 417df1d4
......@@ -469,8 +469,8 @@ static void setup_block_dptrs(MACROBLOCKD *xd, int ss_x, int ss_y) {
}
#if CONFIG_ALPHA
// TODO(jkoleszar): Using the Y w/h for now
mb->plane[3].subsampling_x = 0;
mb->plane[3].subsampling_y = 0;
xd->plane[3].subsampling_x = 0;
xd->plane[3].subsampling_y = 0;
#endif
}
......
......@@ -720,6 +720,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
sf->disable_splitmv = 0;
sf->mode_search_skip_flags = 0;
sf->last_chroma_intra_mode = TM_PRED;
sf->use_rd_breakout = 0;
// Skip any mode not chosen at size < X for all sizes > X
// Hence BLOCK_SIZE_SB64X64 (skip is off)
......@@ -767,6 +768,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
FLAG_SKIP_INTRA_BESTINTER |
FLAG_SKIP_COMP_BESTINTRA;
sf->last_chroma_intra_mode = H_PRED;
sf->use_rd_breakout = 1;
}
if (speed == 2) {
sf->adjust_thresholds_by_speed = 1;
......@@ -790,6 +792,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
FLAG_SKIP_COMP_BESTINTRA |
FLAG_SKIP_COMP_REFMISMATCH;
sf->last_chroma_intra_mode = DC_PRED;
sf->use_rd_breakout = 1;
}
if (speed == 3) {
sf->comp_inter_joint_search_thresh = BLOCK_SIZE_TYPES;
......@@ -804,6 +807,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
FLAG_SKIP_INTRA_BESTINTER |
FLAG_SKIP_COMP_BESTINTRA |
FLAG_SKIP_COMP_REFMISMATCH;
sf->use_rd_breakout = 1;
}
if (speed == 4) {
sf->comp_inter_joint_search_thresh = BLOCK_SIZE_TYPES;
......@@ -818,6 +822,7 @@ void vp9_set_speed_features(VP9_COMP *cpi) {
FLAG_SKIP_INTRA_BESTINTER |
FLAG_SKIP_COMP_BESTINTRA |
FLAG_SKIP_COMP_REFMISMATCH;
sf->use_rd_breakout = 1;
}
/*
if (speed == 2) {
......
......@@ -275,6 +275,7 @@ typedef struct {
// defined in the MODE_SEARCH_SKIP_HEURISTICS enum
unsigned int mode_search_skip_flags;
MB_PREDICTION_MODE last_chroma_intra_mode;
int use_rd_breakout;
} SPEED_FEATURES;
enum BlockSize {
......
This diff is collapsed.
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