From 37c20b8ce5b093367857d091f60d9b82ed1558e5 Mon Sep 17 00:00:00 2001 From: Laurent Fasnacht Date: Wed, 21 May 2014 13:52:56 +0200 Subject: [PATCH] Add dependency between SAO rows --- src/encoder.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/encoder.c b/src/encoder.c index 48410ba9..64b35c6b 100644 --- a/src/encoder.c +++ b/src/encoder.c @@ -1576,6 +1576,7 @@ static void encoder_state_encode(encoder_state * const main_state) { if (main_state->encoder_control->sao_enable && main_state->children[0].type == ENCODER_STATE_TYPE_WAVEFRONT_ROW) { int y; picture * const cur_pic = main_state->tile->cur_pic; + threadqueue_job *previous_job = NULL; for (y = 0; y < cur_pic->height_in_lcu; ++y) { worker_sao_reconstruct_lcu_data *data = MALLOC(worker_sao_reconstruct_lcu_data, 1); @@ -1591,6 +1592,11 @@ static void encoder_state_encode(encoder_state * const main_state) { job = threadqueue_submit(main_state->encoder_control->threadqueue, worker_sao_reconstruct_lcu, data, 1, job_description); + if (previous_job) { + threadqueue_job_dep_add(job, previous_job); + } + previous_job = job; + if (y < cur_pic->height_in_lcu - 1) { //Not last row: depend on the last LCU of the row below threadqueue_job_dep_add(job, main_state->tile->wf_jobs[(y + 1) * cur_pic->width_in_lcu + cur_pic->width_in_lcu - 1]);