From 9713a68719fce63f5d86b77a569e0abe6d57aee3 Mon Sep 17 00:00:00 2001 From: Dmitry Kovalev Date: Fri, 26 Apr 2013 14:39:58 -0700 Subject: [PATCH] Renaming refresh_entropy_probs to refresh_frame_context. Change-Id: I5429c02246d198eb1b6aadbc3313b26bf3436062 --- vp9/common/vp9_onyxc_int.h | 2 +- vp9/decoder/vp9_decodframe.c | 6 +++--- vp9/encoder/vp9_bitstream.c | 2 +- vp9/encoder/vp9_onyx_if.c | 19 +++++++------------ vp9/encoder/vp9_ratectrl.c | 3 +-- 5 files changed, 13 insertions(+), 19 deletions(-) diff --git a/vp9/common/vp9_onyxc_int.h b/vp9/common/vp9_onyxc_int.h index 839d5a82c..dbf3bad5f 100644 --- a/vp9/common/vp9_onyxc_int.h +++ b/vp9/common/vp9_onyxc_int.h @@ -245,7 +245,7 @@ typedef struct VP9Common { int sharpness_level; int dering_enabled; - int refresh_entropy_probs; /* Two state 0 = NO, 1 = YES */ + int refresh_frame_context; /* Two state 0 = NO, 1 = YES */ int ref_frame_sign_bias[MAX_REF_FRAMES]; /* Two state 0, 1 */ diff --git a/vp9/decoder/vp9_decodframe.c b/vp9/decoder/vp9_decodframe.c index 0b3d145fc..f6ed41443 100644 --- a/vp9/decoder/vp9_decodframe.c +++ b/vp9/decoder/vp9_decodframe.c @@ -1508,10 +1508,10 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) { } if (!pc->error_resilient_mode) { - pc->refresh_entropy_probs = vp9_read_bit(&header_bc); + pc->refresh_frame_context = vp9_read_bit(&header_bc); pc->frame_parallel_decoding_mode = vp9_read_bit(&header_bc); } else { - pc->refresh_entropy_probs = 0; + pc->refresh_frame_context = 0; pc->frame_parallel_decoding_mode = 1; } @@ -1603,7 +1603,7 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) { } #endif - if (pc->refresh_entropy_probs) + if (pc->refresh_frame_context) pc->frame_contexts[pc->frame_context_idx] = pc->fc; *p_data_end = vp9_reader_find_end(&residual_bc); diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c index 870d9d41b..7d504c74d 100644 --- a/vp9/encoder/vp9_bitstream.c +++ b/vp9/encoder/vp9_bitstream.c @@ -1986,7 +1986,7 @@ void vp9_pack_bitstream(VP9_COMP *cpi, unsigned char *dest, } if (!pc->error_resilient_mode) { - vp9_write_bit(&header_bc, pc->refresh_entropy_probs); + vp9_write_bit(&header_bc, pc->refresh_frame_context); vp9_write_bit(&header_bc, pc->frame_parallel_decoding_mode); } diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index 0b64fe1d9..7f8c029bd 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -1206,7 +1206,7 @@ void vp9_change_config(VP9_PTR ptr, VP9_CONFIG *oxcf) { // cpi->use_last_frame_only = 0; cpi->refresh_golden_frame = 0; cpi->refresh_last_frame = 1; - cm->refresh_entropy_probs = 1; + cm->refresh_frame_context = 1; setup_features(cpi); cpi->mb.e_mbd.allow_high_precision_mv = 0; // Default mv precision adaptation @@ -2135,10 +2135,7 @@ int vp9_set_reference_enc(VP9_PTR ptr, VP9_REFFRAME ref_frame_flag, return 0; } int vp9_update_entropy(VP9_PTR comp, int update) { - VP9_COMP *cpi = (VP9_COMP *) comp; - VP9_COMMON *cm = &cpi->common; - cm->refresh_entropy_probs = update; - + ((VP9_COMP *)comp)->common.refresh_frame_context = update; return 0; } @@ -2751,7 +2748,7 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, (cpi->oxcf.frame_parallel_decoding_mode != 0); if (cm->error_resilient_mode) { cm->frame_parallel_decoding_mode = 1; - cm->refresh_entropy_probs = 0; + cm->refresh_frame_context = 0; } } @@ -3730,7 +3727,7 @@ static int frame_is_reference(const VP9_COMP *cpi) { cpi->refresh_last_frame || cpi->refresh_golden_frame || cpi->refresh_alt_ref_frame || - cm->refresh_entropy_probs || + cm->refresh_frame_context || mb->mode_ref_lf_delta_update || mb->update_mb_segmentation_map || mb->update_mb_segmentation_data; @@ -4000,17 +3997,15 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags, encode_frame_to_data_rate(cpi, size, dest, frame_flags); } - if (cm->refresh_entropy_probs) { - vpx_memcpy(&cm->frame_contexts[cm->frame_context_idx], &cm->fc, - sizeof(cm->fc)); - } + if (cm->refresh_frame_context) + cm->frame_contexts[cm->frame_context_idx] = cm->fc; if (*size > 0) { // if its a dropped frame honor the requests on subsequent frames cpi->droppable = !frame_is_reference(cpi); // return to normal state - cm->refresh_entropy_probs = 1; + cm->refresh_frame_context = 1; cpi->refresh_alt_ref_frame = 0; cpi->refresh_golden_frame = 0; cpi->refresh_last_frame = 1; diff --git a/vp9/encoder/vp9_ratectrl.c b/vp9/encoder/vp9_ratectrl.c index 7a419fb61..e3f6f45a7 100644 --- a/vp9/encoder/vp9_ratectrl.c +++ b/vp9/encoder/vp9_ratectrl.c @@ -262,8 +262,7 @@ void vp9_setup_inter_frame(VP9_COMP *cpi) { vp9_setup_past_independence(cm, xd); assert(cm->frame_context_idx < NUM_FRAME_CONTEXTS); - vpx_memcpy(&cm->fc, &cm->frame_contexts[cm->frame_context_idx], - sizeof(cm->fc)); + cm->fc = cm->frame_contexts[cm->frame_context_idx]; } static int estimate_bits_at_q(int frame_kind, int q, int mbs,