Merge "Add cpi parameter for forcing segmentation update"
This commit is contained in:
@@ -41,7 +41,8 @@ void vp9_360aq_frame_setup(VP9_COMP *cpi) {
|
|||||||
struct segmentation *seg = &cm->seg;
|
struct segmentation *seg = &cm->seg;
|
||||||
int i;
|
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_enable_segmentation(seg);
|
||||||
vp9_clearall_segfeatures(seg);
|
vp9_clearall_segfeatures(seg);
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ void vp9_setup_in_frame_q_adj(VP9_COMP *cpi) {
|
|||||||
vpx_clear_system_state();
|
vpx_clear_system_state();
|
||||||
|
|
||||||
if (frame_is_intra_only(cm) || cm->error_resilient_mode ||
|
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)) {
|
(cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
|
||||||
int segment;
|
int segment;
|
||||||
const int aq_strength = get_aq_c_strength(cm->base_qindex, cm->bit_depth);
|
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;
|
if (cm->current_video_frame == 0) cr->low_content_avg = 0.0;
|
||||||
// Don't apply refresh on key frame or temporal enhancement layer frames.
|
// Don't apply refresh on key frame or temporal enhancement layer frames.
|
||||||
if (!apply_cyclic_refresh || (cm->frame_type == KEY_FRAME) ||
|
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.
|
// Set segmentation map to 0 and disable.
|
||||||
unsigned char *const seg_map = cpi->segmentation_map;
|
unsigned char *const seg_map = cpi->segmentation_map;
|
||||||
memset(seg_map, 0, cm->mi_rows * cm->mi_cols);
|
memset(seg_map, 0, cm->mi_rows * cm->mi_cols);
|
||||||
|
@@ -49,7 +49,7 @@ void vp9_vaq_frame_setup(VP9_COMP *cpi) {
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (frame_is_intra_only(cm) || cm->error_resilient_mode ||
|
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)) {
|
(cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
|
||||||
vp9_enable_segmentation(seg);
|
vp9_enable_segmentation(seg);
|
||||||
vp9_clearall_segfeatures(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) {
|
if (aq_mode == VARIANCE_AQ) {
|
||||||
const int energy =
|
const int energy =
|
||||||
bsize <= BLOCK_16X16 ? x->mb_energy : vp9_block_energy(cpi, x, bsize);
|
bsize <= BLOCK_16X16 ? x->mb_energy : vp9_block_energy(cpi, x, bsize);
|
||||||
|
|
||||||
if (cm->frame_type == KEY_FRAME || cpi->refresh_alt_ref_frame ||
|
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)) {
|
(cpi->refresh_golden_frame && !cpi->rc.is_src_frame_alt_ref)) {
|
||||||
mi->segment_id = vp9_vaq_segment_id(energy);
|
mi->segment_id = vp9_vaq_segment_id(energy);
|
||||||
} else {
|
} 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);
|
x->rdmult = set_segment_rdmult(cpi, x, mi->segment_id);
|
||||||
} else if (aq_mode == EQUATOR360_AQ) {
|
} 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);
|
mi->segment_id = vp9_360aq_segment_id(mi_row, cm->mi_rows);
|
||||||
} else {
|
} else {
|
||||||
const uint8_t *const map =
|
const uint8_t *const map =
|
||||||
|
@@ -477,6 +477,9 @@ typedef struct VP9_COMP {
|
|||||||
|
|
||||||
TWO_PASS twopass;
|
TWO_PASS twopass;
|
||||||
|
|
||||||
|
// Force recalculation of segment_ids for each mode info
|
||||||
|
uint8_t force_update_segmentation;
|
||||||
|
|
||||||
YV12_BUFFER_CONFIG alt_ref_buffer;
|
YV12_BUFFER_CONFIG alt_ref_buffer;
|
||||||
|
|
||||||
#if CONFIG_INTERNAL_STATS
|
#if CONFIG_INTERNAL_STATS
|
||||||
|
Reference in New Issue
Block a user