-
Notifications
You must be signed in to change notification settings - Fork 8
/
10252.diff
82 lines (65 loc) · 2.79 KB
/
10252.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
commit 32017745b0b4cb6d69ced6250dd67d9faf6282f8
Author: Ravi Chaudhary <[email protected]>
Date: Fri Sep 14 14:04:31 2018 +0530
Fix initialization in loop restoration mt
When luma loop restoration is disabled, the initialization of
cur_sb_col in lr_sync was not happening correctly.
BUG=b/114647746
BUG=oss-fuzz:10252
Change-Id: I842a4a142680fdc78265c2f037b8bb1641f5e5d3
diff --git a/av1/common/thread_common.c b/av1/common/thread_common.c
index 1206cdda3b..8df4c9a09d 100644
--- a/av1/common/thread_common.c
+++ b/av1/common/thread_common.c
@@ -708,60 +708,62 @@ static int loop_restoration_row_worker(void *arg1, void *arg2) {
static void foreach_rest_unit_in_planes_mt(AV1LrStruct *lr_ctxt,
AVxWorker *workers, int nworkers,
AV1LrSync *lr_sync, AV1_COMMON *cm) {
FilterFrameCtxt *ctxt = lr_ctxt->ctxt;
const int num_planes = av1_num_planes(cm);
const AVxWorkerInterface *const winterface = aom_get_worker_interface();
int num_rows_lr = 0;
for (int plane = 0; plane < num_planes; plane++) {
+ if (cm->rst_info[plane].frame_restoration_type == RESTORE_NONE) continue;
+
const AV1PixelRect tile_rect = ctxt[plane].tile_rect;
const int max_tile_h = tile_rect.bottom - tile_rect.top;
- const int unit_size = cm->seq_params.sb_size == BLOCK_128X128 ? 128 : 64;
+ const int unit_size = cm->rst_info[plane].restoration_unit_size;
num_rows_lr =
AOMMAX(num_rows_lr, av1_lr_count_units_in_tile(unit_size, max_tile_h));
}
const int num_workers = nworkers;
int i;
assert(MAX_MB_PLANE == 3);
if (!lr_sync->sync_range || num_rows_lr != lr_sync->rows ||
num_workers > lr_sync->num_workers || num_planes != lr_sync->num_planes) {
av1_loop_restoration_dealloc(lr_sync, num_workers);
loop_restoration_alloc(lr_sync, cm, num_workers, num_rows_lr, num_planes,
cm->width);
}
// Initialize cur_sb_col to -1 for all SB rows.
for (i = 0; i < num_planes; i++) {
memset(lr_sync->cur_sb_col[i], -1,
sizeof(*(lr_sync->cur_sb_col[i])) * num_rows_lr);
}
enqueue_lr_jobs(lr_sync, lr_ctxt, cm);
// Set up looprestoration thread data.
for (i = 0; i < num_workers; ++i) {
AVxWorker *const worker = &workers[i];
lr_sync->lrworkerdata[i].lr_ctxt = (void *)lr_ctxt;
worker->hook = loop_restoration_row_worker;
worker->data1 = lr_sync;
worker->data2 = &lr_sync->lrworkerdata[i];
// Start loopfiltering
if (i == num_workers - 1) {
winterface->execute(worker);
} else {
winterface->launch(worker);
}
}
// Wait till all rows are finished
for (i = 0; i < num_workers; ++i) {
winterface->sync(&workers[i]);
}
}