Commit 07f818fb authored by Ronald S. Bultje's avatar Ronald S. Bultje

Make allocation of frame_thread.pal aligned

Allows aligned accesses to this array in SIMD. Fixes #246.
parent 1cec875c
......@@ -2700,11 +2700,12 @@ int dav1d_decode_frame(Dav1dFrameContext *const f) {
freep(&f->frame_thread.cbi);
dav1d_freep_aligned(&f->frame_thread.cf);
dav1d_freep_aligned(&f->frame_thread.pal_idx);
freep(&f->frame_thread.pal);
dav1d_freep_aligned(&f->frame_thread.pal);
f->frame_thread.b = malloc(sizeof(*f->frame_thread.b) *
f->sb128w * f->sb128h * 32 * 32);
f->frame_thread.pal = malloc(sizeof(*f->frame_thread.pal) *
f->sb128w * f->sb128h * 16 * 16);
f->frame_thread.pal =
dav1d_alloc_aligned(sizeof(*f->frame_thread.pal) *
f->sb128w * f->sb128h * 16 * 16, 32);
f->frame_thread.pal_idx =
dav1d_alloc_aligned(sizeof(*f->frame_thread.pal_idx) *
f->sb128w * f->sb128h * 128 * 128 * 2, 32);
......
......@@ -458,7 +458,7 @@ static void close_internal(Dav1dContext **const c_out, int flush) {
dav1d_freep_aligned(&f->frame_thread.pal_idx);
dav1d_freep_aligned(&f->frame_thread.cf);
freep(&f->frame_thread.tile_start_off);
freep(&f->frame_thread.pal);
dav1d_freep_aligned(&f->frame_thread.pal);
freep(&f->frame_thread.cbi);
pthread_mutex_destroy(&f->frame_thread.td.lock);
pthread_cond_destroy(&f->frame_thread.td.cond);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment