Add dependency between SAO rows

This commit is contained in:
Laurent Fasnacht 2014-05-21 13:52:56 +02:00
parent 90f46dc56f
commit 37c20b8ce5

View file

@ -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]);