Merge "Fix Tsan errors"

This commit is contained in:
Yunqing Wang 2015-04-15 15:34:03 -07:00 committed by Gerrit Code Review
commit 14e7203e7b
4 changed files with 32 additions and 15 deletions

View File

@ -458,8 +458,7 @@ static int set_vt_partitioning(VP9_COMP *cpi,
return 0; return 0;
} }
void vp9_set_vbp_thresholds(VP9_COMP *cpi, int q) {
void vp9_set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q) {
SPEED_FEATURES *const sf = &cpi->sf; SPEED_FEATURES *const sf = &cpi->sf;
if (sf->partition_search_type != VAR_BASED_PARTITION && if (sf->partition_search_type != VAR_BASED_PARTITION &&
sf->partition_search_type != REFERENCE_PARTITION) { sf->partition_search_type != REFERENCE_PARTITION) {
@ -480,25 +479,41 @@ void vp9_set_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q) {
// Array index: 0 - threshold_64x64; 1 - threshold_32x32; // Array index: 0 - threshold_64x64; 1 - threshold_32x32;
// 2 - threshold_16x16; 3 - vbp_threshold_8x8; // 2 - threshold_16x16; 3 - vbp_threshold_8x8;
if (is_key_frame) { if (is_key_frame) {
thresholds[0] = threshold_base; cpi->vbp_thresholds[0] = threshold_base;
thresholds[1] = threshold_base >> 2; cpi->vbp_thresholds[1] = threshold_base >> 2;
thresholds[2] = threshold_base >> 2; cpi->vbp_thresholds[2] = threshold_base >> 2;
thresholds[3] = threshold_base << 2; cpi->vbp_thresholds[3] = threshold_base << 2;
cpi->vbp_bsize_min = BLOCK_8X8; cpi->vbp_bsize_min = BLOCK_8X8;
} else { } else {
thresholds[1] = threshold_base; cpi->vbp_thresholds[1] = threshold_base;
if (cm->width <= 352 && cm->height <= 288) { if (cm->width <= 352 && cm->height <= 288) {
thresholds[0] = threshold_base >> 2; cpi->vbp_thresholds[0] = threshold_base >> 2;
thresholds[2] = threshold_base << 3; cpi->vbp_thresholds[2] = threshold_base << 3;
} else { } else {
thresholds[0] = threshold_base; cpi->vbp_thresholds[0] = threshold_base;
thresholds[2] = threshold_base << cpi->oxcf.speed; cpi->vbp_thresholds[2] = threshold_base << cpi->oxcf.speed;
} }
cpi->vbp_bsize_min = BLOCK_16X16; cpi->vbp_bsize_min = BLOCK_16X16;
} }
} }
} }
static void modify_vbp_thresholds(VP9_COMP *cpi, int64_t thresholds[], int q) {
VP9_COMMON *const cm = &cpi->common;
const int64_t threshold_base = (int64_t)(cpi->y_dequant[q][1]);
// Array index: 0 - threshold_64x64; 1 - threshold_32x32;
// 2 - threshold_16x16; 3 - vbp_threshold_8x8;
thresholds[1] = threshold_base;
if (cm->width <= 352 && cm->height <= 288) {
thresholds[0] = threshold_base >> 2;
thresholds[2] = threshold_base << 3;
} else {
thresholds[0] = threshold_base;
thresholds[2] = threshold_base << cpi->oxcf.speed;
}
}
static void fill_variance_4x4avg(const uint8_t *s, int sp, const uint8_t *d, static void fill_variance_4x4avg(const uint8_t *s, int sp, const uint8_t *d,
int dp, int x8_idx, int y8_idx, v8x8 *vst, int dp, int x8_idx, int y8_idx, v8x8 *vst,
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
@ -611,7 +626,7 @@ static void choose_partitioning(VP9_COMP *cpi,
if (cyclic_refresh_segment_id_boosted(segment_id)) { if (cyclic_refresh_segment_id_boosted(segment_id)) {
int q = vp9_get_qindex(&cm->seg, segment_id, cm->base_qindex); int q = vp9_get_qindex(&cm->seg, segment_id, cm->base_qindex);
vp9_set_vbp_thresholds(cpi, thresholds, q); modify_vbp_thresholds(cpi, thresholds, q);
} }
} }
@ -3854,6 +3869,9 @@ static void encode_frame_internal(VP9_COMP *cpi) {
} }
vp9_zero(x->zcoeff_blk); vp9_zero(x->zcoeff_blk);
if (cm->frame_type != KEY_FRAME && cpi->rc.frames_since_golden == 0)
cpi->ref_frame_flags &= (~VP9_GOLD_FLAG);
if (sf->partition_search_type == SOURCE_VAR_BASED_PARTITION) if (sf->partition_search_type == SOURCE_VAR_BASED_PARTITION)
source_var_based_partition_search_method(cpi); source_var_based_partition_search_method(cpi);
} }

View File

@ -40,7 +40,7 @@ void vp9_init_tile_data(struct VP9_COMP *cpi);
void vp9_encode_tile(struct VP9_COMP *cpi, struct ThreadData *td, void vp9_encode_tile(struct VP9_COMP *cpi, struct ThreadData *td,
int tile_row, int tile_col); int tile_row, int tile_col);
void vp9_set_vbp_thresholds(struct VP9_COMP *cpi, int64_t thresholds[], int q); void vp9_set_vbp_thresholds(struct VP9_COMP *cpi, int q);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"

View File

@ -2960,7 +2960,7 @@ static void encode_without_recode_loop(VP9_COMP *cpi) {
set_size_dependent_vars(cpi, &q, &bottom_index, &top_index); set_size_dependent_vars(cpi, &q, &bottom_index, &top_index);
vp9_set_quantizer(cm, q); vp9_set_quantizer(cm, q);
vp9_set_vbp_thresholds(cpi, cpi->vbp_thresholds, q); vp9_set_vbp_thresholds(cpi, q);
setup_frame(cpi); setup_frame(cpi);

View File

@ -1125,7 +1125,6 @@ void vp9_pick_inter_mode(VP9_COMP *cpi, MACROBLOCK *x,
#endif #endif
if (cpi->rc.frames_since_golden == 0) { if (cpi->rc.frames_since_golden == 0) {
cpi->ref_frame_flags &= (~VP9_GOLD_FLAG);
usable_ref_frame = LAST_FRAME; usable_ref_frame = LAST_FRAME;
} else { } else {
usable_ref_frame = GOLDEN_FRAME; usable_ref_frame = GOLDEN_FRAME;