From 4bec6cec935268f902001b32907dd85414bfccc7 Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Tue, 17 Mar 2015 11:22:50 +0200 Subject: [PATCH] Simplify wavefront handling. - Move the reconstruction status assignment out of the main for job loop. --- src/encoderstate.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/encoderstate.c b/src/encoderstate.c index fb13dbb2..3a67fec5 100644 --- a/src/encoderstate.c +++ b/src/encoderstate.c @@ -409,15 +409,14 @@ static void encoder_state_encode_leaf(encoder_state_t * const state) { threadqueue_job_unwait_job(state->encoder_control->threadqueue, state->tile->wf_jobs[lcu->id]); } - - // In the case where SAO is not enabled, the wavefront row is - // done when the last LCU in the row is done. - if (lcu->position.x == state->tile->frame->width_in_lcu - 1) { - if (!state->encoder_control->sao_enable) { - assert(!state->tqj_recon_done); - state->tqj_recon_done = state->tile->wf_jobs[lcu->id]; - } - } + } + + // In the case where SAO is not enabled, the wavefront row is + // done when the last LCU in the row is done. + if (!state->encoder_control->sao_enable) { + assert(!state->tqj_recon_done); + int last_lcu = state->lcu_order_count - 1; + state->tqj_recon_done = state->tile->wf_jobs[last_lcu]; } } }