Merge "Refine VP10 REFRESH_FRAME_CONTEXT_MODE" into nextgenv2

This commit is contained in:
Yunqing Wang 2016-05-10 15:53:48 +00:00 коммит произвёл Gerrit Code Review
Родитель 73d28a4068 484ba02435
Коммит a2676565d3
4 изменённых файлов: 11 добавлений и 26 удалений

Просмотреть файл

@ -66,10 +66,6 @@ typedef enum {
} RESET_FRAME_CONTEXT_MODE;
typedef enum {
/**
* Don't update frame context
*/
REFRESH_FRAME_CONTEXT_OFF,
/**
* Update frame context to values resulting from forward probability
* updates signaled in the frame header

Просмотреть файл

@ -3739,14 +3739,9 @@ static size_t read_uncompressed_header(VP10Decoder *pbi,
if (!cm->error_resilient_mode) {
cm->refresh_frame_context =
vpx_rb_read_bit(rb) ? REFRESH_FRAME_CONTEXT_FORWARD
: REFRESH_FRAME_CONTEXT_OFF;
if (cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_FORWARD) {
cm->refresh_frame_context =
vpx_rb_read_bit(rb) ? REFRESH_FRAME_CONTEXT_FORWARD
: REFRESH_FRAME_CONTEXT_BACKWARD;
}
: REFRESH_FRAME_CONTEXT_BACKWARD;
} else {
cm->refresh_frame_context = REFRESH_FRAME_CONTEXT_OFF;
cm->refresh_frame_context = REFRESH_FRAME_CONTEXT_FORWARD;
}
// This flag will be overridden by the call to vp10_setup_past_independence
@ -4274,7 +4269,6 @@ void vp10_decode_frame(VP10Decoder *pbi,
}
// Non frame parallel update frame context here.
if (cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_OFF &&
!context_updated)
if (!cm->error_resilient_mode && !context_updated)
cm->frame_contexts[cm->frame_context_idx] = *cm->fc;
}

Просмотреть файл

@ -3051,10 +3051,7 @@ static void write_uncompressed_header(VP10_COMP *cpi,
if (!cm->error_resilient_mode) {
vpx_wb_write_bit(wb,
cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_OFF);
if (cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_OFF)
vpx_wb_write_bit(wb, cm->refresh_frame_context !=
REFRESH_FRAME_CONTEXT_BACKWARD);
cm->refresh_frame_context == REFRESH_FRAME_CONTEXT_FORWARD);
}
vpx_wb_write_literal(wb, cm->frame_context_idx, FRAME_CONTEXTS_LOG2);

Просмотреть файл

@ -1986,9 +1986,8 @@ void vp10_change_config(struct VP10_COMP *cpi, const VP10EncoderConfig *oxcf) {
cpi->refresh_last_frame = 1;
cm->refresh_frame_context =
oxcf->error_resilient_mode ? REFRESH_FRAME_CONTEXT_OFF :
oxcf->frame_parallel_decoding_mode ? REFRESH_FRAME_CONTEXT_FORWARD
: REFRESH_FRAME_CONTEXT_BACKWARD;
(oxcf->error_resilient_mode || oxcf->frame_parallel_decoding_mode) ?
REFRESH_FRAME_CONTEXT_FORWARD : REFRESH_FRAME_CONTEXT_BACKWARD;
cm->reset_frame_context = RESET_FRAME_CONTEXT_NONE;
cm->allow_screen_content_tools = (cpi->oxcf.content == VP9E_CONTENT_SCREEN);
@ -4324,7 +4323,7 @@ static void encode_frame_to_data_rate(VP10_COMP *cpi,
// By default, encoder assumes decoder can use prev_mi.
if (cm->error_resilient_mode) {
cm->reset_frame_context = RESET_FRAME_CONTEXT_NONE;
cm->refresh_frame_context = REFRESH_FRAME_CONTEXT_OFF;
cm->refresh_frame_context = REFRESH_FRAME_CONTEXT_FORWARD;
} else if (cm->intra_only) {
// Only reset the current context.
cm->reset_frame_context = RESET_FRAME_CONTEXT_CURRENT;
@ -4616,7 +4615,7 @@ static int frame_is_reference(const VP10_COMP *cpi) {
cpi->refresh_last_frame ||
cpi->refresh_golden_frame ||
cpi->refresh_alt_ref_frame ||
cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_OFF ||
!cm->error_resilient_mode ||
cm->lf.mode_ref_delta_update ||
cm->seg.update_map ||
cm->seg.update_data;
@ -4844,9 +4843,8 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
// Normal defaults
cm->reset_frame_context = RESET_FRAME_CONTEXT_NONE;
cm->refresh_frame_context =
oxcf->error_resilient_mode ? REFRESH_FRAME_CONTEXT_OFF :
oxcf->frame_parallel_decoding_mode ? REFRESH_FRAME_CONTEXT_FORWARD
: REFRESH_FRAME_CONTEXT_BACKWARD;
(oxcf->error_resilient_mode || oxcf->frame_parallel_decoding_mode) ?
REFRESH_FRAME_CONTEXT_FORWARD : REFRESH_FRAME_CONTEXT_BACKWARD;
cpi->refresh_last_frame = 1;
cpi->refresh_golden_frame = 0;
@ -4990,7 +4988,7 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
Pass0Encode(cpi, size, dest, frame_flags);
}
if (cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_OFF)
if (!cm->error_resilient_mode)
cm->frame_contexts[cm->frame_context_idx] = *cm->fc;
// No frame encoded, or frame was dropped, release scaled references.