Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cdef_apply_tmpl_16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ pub unsafe extern "C" fn dav1d_cdef_brow_16bpc(
layout,
);
}
let mut lr_bak: [[[[pixel; 2]; 8]; 3]; 2] = [[[[0; 2]; 8]; 3]; 2];
let mut lr_bak: Align16<[[[[pixel; 2]; 8]; 3]; 2]> = Align16([[[[0; 2]; 8]; 3]; 2]);
let mut iptrs: [*mut pixel; 3] = [ptrs[0], ptrs[1], ptrs[2]];
edges = ::core::mem::transmute::<libc::c_uint, CdefEdgeFlags>(
edges as libc::c_uint & !(CDEF_HAVE_LEFT as libc::c_int) as libc::c_uint,
Expand Down
2 changes: 1 addition & 1 deletion src/cdef_apply_tmpl_8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ pub unsafe extern "C" fn dav1d_cdef_brow_8bpc(
layout,
);
}
let mut lr_bak: [[[[pixel; 2]; 8]; 3]; 2] = [[[[0; 2]; 8]; 3]; 2];
let mut lr_bak: Align16<[[[[pixel; 2]; 8]; 3]; 2]> = Align16([[[[0; 2]; 8]; 3]; 2]);
let mut iptrs: [*mut pixel; 3] = [ptrs[0], ptrs[1], ptrs[2]];
edges = ::core::mem::transmute::<libc::c_uint, CdefEdgeFlags>(
edges as libc::c_uint & !(CDEF_HAVE_LEFT as libc::c_int) as libc::c_uint,
Expand Down
8 changes: 4 additions & 4 deletions src/cdef_tmpl_8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -845,8 +845,8 @@ unsafe extern "C" fn cdef_filter_4x4_neon(
damping: libc::c_int,
edges: CdefEdgeFlags,
) {
let mut tmp_buf = [0; 104];
let mut tmp = tmp_buf.as_mut_ptr().offset(2 * 8).offset(8);
let mut tmp_buf = Align16([0; 104]);
let mut tmp = tmp_buf.0.as_mut_ptr().offset(2 * 8).offset(8);
dav1d_cdef_padding4_8bpc_neon(tmp, dst, stride, left, top, bottom, 4, edges);
dav1d_cdef_filter4_8bpc_neon(
dst,
Expand Down Expand Up @@ -875,8 +875,8 @@ unsafe extern "C" fn cdef_filter_4x8_neon(
damping: libc::c_int,
edges: CdefEdgeFlags,
) {
let mut tmp_buf = [0; 104];
let mut tmp = tmp_buf.as_mut_ptr().offset(2 * 8).offset(8);
let mut tmp_buf = Align16([0; 104]);
let mut tmp = tmp_buf.0.as_mut_ptr().offset(2 * 8).offset(8);
dav1d_cdef_padding4_8bpc_neon(tmp, dst, stride, left, top, bottom, 8, edges);
dav1d_cdef_filter4_8bpc_neon(
dst,
Expand Down
4 changes: 2 additions & 2 deletions src/fg_apply_tmpl_16.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::include::stddef::*;
use crate::include::stdint::*;
use crate::src::align::{Align16, Align64};
use crate::src::align::{Align1, Align16};
use ::libc;
extern "C" {
pub type Dav1dRef;
Expand Down Expand Up @@ -392,7 +392,7 @@ pub unsafe extern "C" fn dav1d_apply_grain_16bpc(
in_0: *const Dav1dPicture,
) {
let mut grain_lut = Align16([[[0; 82]; 74]; 3]);
let mut scaling = Align64([[0; 4096]; 3]);
let mut scaling = Align1([[0; 4096]; 3]);
let rows = (*out).p.h + 31 >> 5;
dav1d_prep_grain_16bpc(
dsp,
Expand Down
15 changes: 13 additions & 2 deletions src/fg_apply_tmpl_8.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use crate::include::stddef::*;
use crate::include::stdint::*;
use crate::src::align::{Align16, Align64};
use crate::src::align::Align16;
use ::libc;
use cfg_if::cfg_if;
extern "C" {
pub type Dav1dRef;
fn memcpy(_: *mut libc::c_void, _: *const libc::c_void, _: libc::c_ulong) -> *mut libc::c_void;
Expand Down Expand Up @@ -348,7 +349,17 @@ pub unsafe extern "C" fn dav1d_apply_grain_8bpc(
in_0: *const Dav1dPicture,
) {
let mut grain_lut = Align16([[[0; 82]; 74]; 3]);
let mut scaling = Align64([[0; 256]; 3]);
cfg_if! {
if #[cfg(target_arch = "x86_64")] {
use crate::src::align::Align64;

let mut scaling = Align64([[0; 256]; 3]);
} else {
use crate::src::align::Align1;

let mut scaling = Align1([[0; 256]; 3]);
}
}
let rows = (*out).p.h + 31 >> 5;
dav1d_prep_grain_8bpc(
dsp,
Expand Down
7 changes: 5 additions & 2 deletions src/lf_mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ use crate::include::common::intops::iclip;
use crate::include::common::intops::imax;
use crate::include::common::intops::imin;
use crate::src::tables::TxfmInfo;

use crate::src::align::Align16;

unsafe extern "C" fn decomp_tx(
txa: *mut [[[uint8_t; 32]; 32]; 2],
from: RectTxfmSize,
Expand Down Expand Up @@ -324,15 +327,15 @@ unsafe extern "C" fn mask_edges_inter(
&*dav1d_txfm_dimensions.as_ptr().offset(max_tx as isize) as *const TxfmInfo;
let mut y = 0;
let mut x = 0;
let mut txa: [[[[uint8_t; 32]; 32]; 2]; 2] = [[[[0; 32]; 32]; 2]; 2];
let mut txa: Align16<[[[[uint8_t; 32]; 32]; 2]; 2]> = Align16([[[[0; 32]; 32]; 2]; 2]);
let mut y_off = 0;
let mut y_0 = 0;
while y_0 < h4 {
let mut x_off = 0;
let mut x_0 = 0;
while x_0 < w4 {
decomp_tx(
&mut *(*(*(*txa.as_mut_ptr().offset(0)).as_mut_ptr().offset(0))
&mut *(*(*(*txa.0.as_mut_ptr().offset(0)).as_mut_ptr().offset(0))
.as_mut_ptr()
.offset(y_0 as isize))
.as_mut_ptr()
Expand Down
2 changes: 1 addition & 1 deletion src/lr_apply_tmpl_16.rs
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ unsafe extern "C" fn lr_sbrow(
let max_unit_size = unit_size + half_unit_size;
let row_y = y + (8 >> ss_ver) * (y != 0) as libc::c_int;
let shift_hor = 7 - ss_hor;
let mut pre_lr_border: [[[pixel; 4]; 136]; 2] = [[[0; 4]; 136]; 2];
let mut pre_lr_border: Align16<[[[pixel; 4]; 136]; 2]> = Align16([[[0; 4]; 136]; 2]);
let mut lr: [*const Av1RestorationUnit; 2] = [0 as *const Av1RestorationUnit; 2];
let mut edges: LrEdgeFlags = ((if y > 0 {
LR_HAVE_TOP as libc::c_int
Expand Down
2 changes: 1 addition & 1 deletion src/lr_apply_tmpl_8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ unsafe extern "C" fn lr_sbrow(
let max_unit_size = unit_size + half_unit_size;
let row_y = y + (8 >> ss_ver) * (y != 0) as libc::c_int;
let shift_hor = 7 - ss_hor;
let mut pre_lr_border: [[[pixel; 4]; 136]; 2] = [[[0; 4]; 136]; 2];
let mut pre_lr_border: Align16<[[[pixel; 4]; 136]; 2]> = Align16([[[0; 4]; 136]; 2]);
let mut lr: [*const Av1RestorationUnit; 2] = [0 as *const Av1RestorationUnit; 2];
let mut edges: LrEdgeFlags = ((if y > 0 {
LR_HAVE_TOP as libc::c_int
Expand Down