Commit 7a730d59 authored by Yury Gitman's avatar Yury Gitman

Add cpi parameter for forcing segmentation update

Change-Id: I1b0bcb1ffe7604117bfaa0b9989d0e25ff04d28c
parent 57f49db8
......@@ -41,7 +41,8 @@ void vp9_360aq_frame_setup(VP9_COMP *cpi) {
struct segmentation *seg = &cm->seg;
int i;
if (frame_is_intra_only(cm) || cm->error_resilient_mode) {
if (frame_is_intra_only(cm) || cpi->force_update_segmentation ||
cm->error_resilient_mode) {
vp9_enable_segmentation(seg);
vp9_clearall_segfeatures(seg);
......
......@@ -52,7 +52,7 @@ void vp9_setup_in_frame_q_adj(VP9_COMP *cpi) {
vpx_clear_system_state();
if (frame_is_intra_only(cm) || cm->error_resilient_mode ||
cpi->refresh_alt_ref_frame ||
cpi->refresh_alt_ref_frame || cpi->force_update_segmentation ||
(cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
int segment;
const int aq_strength = get_aq_c_strength(cm->base_qindex, cm->bit_depth);
......
......@@ -502,7 +502,7 @@ void vp9_cyclic_refresh_setup(VP9_COMP *const cpi) {
if (cm->current_video_frame == 0) cr->low_content_avg = 0.0;
// Don't apply refresh on key frame or temporal enhancement layer frames.
if (!apply_cyclic_refresh || (cm->frame_type == KEY_FRAME) ||
(cpi->svc.temporal_layer_id > 0)) {
(cpi->force_update_segmentation) || (cpi->svc.temporal_layer_id > 0)) {
// Set segmentation map to 0 and disable.
unsigned char *const seg_map = cpi->segmentation_map;
memset(seg_map, 0, cm->mi_rows * cm->mi_cols);
......
......@@ -49,7 +49,7 @@ void vp9_vaq_frame_setup(VP9_COMP *cpi) {
int i;
if (frame_is_intra_only(cm) || cm->error_resilient_mode ||
cpi->refresh_alt_ref_frame ||
cpi->refresh_alt_ref_frame || cpi->force_update_segmentation ||
(cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
vp9_enable_segmentation(seg);
vp9_clearall_segfeatures(seg);
......
......@@ -1338,7 +1338,9 @@ static void rd_pick_sb_modes(VP9_COMP *cpi, TileDataEnc *tile_data,
if (aq_mode == VARIANCE_AQ) {
const int energy =
bsize <= BLOCK_16X16 ? x->mb_energy : vp9_block_energy(cpi, x, bsize);
if (cm->frame_type == KEY_FRAME || cpi->refresh_alt_ref_frame ||
cpi->force_update_segmentation ||
(cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
mi->segment_id = vp9_vaq_segment_id(energy);
} else {
......@@ -1348,7 +1350,7 @@ static void rd_pick_sb_modes(VP9_COMP *cpi, TileDataEnc *tile_data,
}
x->rdmult = set_segment_rdmult(cpi, x, mi->segment_id);
} else if (aq_mode == EQUATOR360_AQ) {
if (cm->frame_type == KEY_FRAME) {
if (cm->frame_type == KEY_FRAME || cpi->force_update_segmentation) {
mi->segment_id = vp9_360aq_segment_id(mi_row, cm->mi_rows);
} else {
const uint8_t *const map =
......
......@@ -477,6 +477,9 @@ typedef struct VP9_COMP {
TWO_PASS twopass;
// Force recalculation of segment_ids for each mode info
uint8_t force_update_segmentation;
YV12_BUFFER_CONFIG alt_ref_buffer;
#if CONFIG_INTERNAL_STATS
......
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