ref: bed27a960a0ed44e4f555f4f74d5fb243df5bd24
parent: 863204e64dbd8366b7e9a0f67f1f026473a0a145
author: Yaowu Xu <[email protected]>
date: Wed Jul 10 04:59:18 EDT 2013
Add a feature to reduce chrome intra mode search Change-Id: I721ebdeef2b53ce3e5c3eba3f7462ae2103c95a8
--- a/vp9/encoder/vp9_onyx_if.c
+++ b/vp9/encoder/vp9_onyx_if.c
@@ -719,6 +719,7 @@
sf->last_partitioning_redo_frequency = 4;
sf->disable_splitmv = 0;
sf->mode_search_skip_flags = 0;
+ sf->last_chroma_intra_mode = TM_PRED;
// Skip any mode not chosen at size < X for all sizes > X
// Hence BLOCK_SIZE_SB64X64 (skip is off)
@@ -746,6 +747,7 @@
sf->auto_mv_step_size = 1;
sf->use_avoid_tested_higherror = 1;
sf->adaptive_rd_thresh = 1;
+ sf->last_chroma_intra_mode = TM_PRED;
if (speed == 1) {
sf->comp_inter_joint_search_thresh = BLOCK_SIZE_TYPES;
@@ -764,6 +766,7 @@
sf->mode_search_skip_flags = FLAG_SKIP_INTRA_DIRMISMATCH |
FLAG_SKIP_INTRA_BESTINTER |
FLAG_SKIP_COMP_BESTINTRA;
+ sf->last_chroma_intra_mode = H_PRED;
}
if (speed == 2) {
sf->adjust_thresholds_by_speed = 1;
@@ -786,6 +789,7 @@
FLAG_SKIP_INTRA_BESTINTER |
FLAG_SKIP_COMP_BESTINTRA |
FLAG_SKIP_COMP_REFMISMATCH;
+ sf->last_chroma_intra_mode = DC_PRED;
}
if (speed == 3) {
sf->comp_inter_joint_search_thresh = BLOCK_SIZE_TYPES;
--- a/vp9/encoder/vp9_onyx_int.h
+++ b/vp9/encoder/vp9_onyx_int.h
@@ -274,6 +274,7 @@
// The heuristics selected are based on flags
// defined in the MODE_SEARCH_SKIP_HEURISTICS enum
unsigned int mode_search_skip_flags;
+ MB_PREDICTION_MODE last_chroma_intra_mode;
} SPEED_FEATURES;
enum BlockSize {
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1500,12 +1500,16 @@
int64_t *distortion, int *skippable,
BLOCK_SIZE_TYPE bsize) {
MB_PREDICTION_MODE mode;
+ MB_PREDICTION_MODE last_mode;
MB_PREDICTION_MODE UNINITIALIZED_IS_SAFE(mode_selected);
int64_t best_rd = INT64_MAX, this_rd;
int this_rate_tokenonly, this_rate, s;
int64_t this_distortion;
- for (mode = DC_PRED; mode <= TM_PRED; mode++) {
+ last_mode = bsize <= BLOCK_SIZE_SB8X8 ?
+ TM_PRED : cpi->sf.last_chroma_intra_mode;
+
+ for (mode = DC_PRED; mode <= last_mode; mode++) {
x->e_mbd.mode_info_context->mbmi.uv_mode = mode;
super_block_uvrd(&cpi->common, x, &this_rate_tokenonly,
&this_distortion, &s, NULL, bsize);