Commit 46675098 authored by Hui Su's avatar Hui Su

Move init of delta_q/lf_present_flag to encode_frame_internal()

encode_with_recode_loop() may encode a frame multiple times with
different q-index values. delta_q/lf_present_flag need to be
initialized every time.

Change-Id: Iee4891c9c52a06416afdb30360e377462ef85f22
parent 10215e42
......@@ -3970,6 +3970,11 @@ static void encode_frame_internal(AV1_COMP *cpi) {
// Set delta_q_present_flag before it is used for the first time
#if CONFIG_EXT_DELTA_Q
cm->delta_lf_res = DEFAULT_DELTA_LF_RES;
cm->delta_q_present_flag = cpi->oxcf.deltaq_mode != NO_DELTA_Q;
cm->delta_lf_present_flag = cpi->oxcf.deltaq_mode == DELTA_Q_LF;
#if CONFIG_LOOPFILTER_LEVEL
cm->delta_lf_multi = DEFAULT_DELTA_LF_MULTI;
#endif // CONFIG_LOOPFILTER_LEVEL
// update delta_q_present_flag and delta_lf_present_flag based on base_qindex
cm->delta_q_present_flag &= cm->base_qindex > 0;
cm->delta_lf_present_flag &= cm->base_qindex > 0;
......
......@@ -6065,14 +6065,6 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
}
#endif // CONFIG_REFERENCE_BUFFER
#if CONFIG_EXT_DELTA_Q
cm->delta_q_present_flag = cpi->oxcf.deltaq_mode != NO_DELTA_Q;
cm->delta_lf_present_flag = cpi->oxcf.deltaq_mode == DELTA_Q_LF;
#if CONFIG_LOOPFILTER_LEVEL
cm->delta_lf_multi = DEFAULT_DELTA_LF_MULTI;
#endif // CONFIG_LOOPFILTER_LEVEL
#endif
if (cpi->sf.recode_loop == DISALLOW_RECODE) {
encode_without_recode_loop(cpi);
} else {
......
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