diff --git a/src/dep_quant.c b/src/dep_quant.c index 16591390..85e4f304 100644 --- a/src/dep_quant.c +++ b/src/dep_quant.c @@ -573,8 +573,8 @@ static INLINE void update_common_context( uint8_t* sbbFlags = cc->m_allSbbCtx[cc->m_curr_sbb_ctx_offset].sbbFlags; uint8_t* levels = cc->m_allSbbCtx[cc->m_curr_sbb_ctx_offset].levels; size_t setCpSize = cc->m_nbInfo[scan_pos - 1].maxDist * sizeof(uint8_t); - int8_t prev_sbb_state = ctxs->m_allStates.m_refSbbCtxId[prev_state]; - if (prev_state != -1 && prev_sbb_state >= 0) { + if (prev_state != -1) { + const int8_t prev_sbb_state = ctxs->m_allStates.m_refSbbCtxId[prev_state]; for (int i = 0; i < numSbb; ++i) { sbbFlags[i * 4 + curr_state_without_offset] = cc->m_allSbbCtx[cc->m_prev_sbb_ctx_offset].sbbFlags[i * 4 + prev_sbb_state]; }