Commit 133f1920 authored by David Michael Barr's avatar David Michael Barr

Fill subsampled luma AC buffer in dav1d layout

That is, with Block::W stride rather than fixed 32 stride.
parent a394931b
......@@ -1953,7 +1953,7 @@ pub fn luma_ac(
+ luma.p(x, y + 1)
+ luma.p(x + 1, y + 1))
<< 1) as i16;
ac[sub_y * 32 + sub_x] = sample;
ac[sub_y * plane_bsize.width() + sub_x] = sample;
sum += sample as i32;
}
}
......@@ -1961,7 +1961,7 @@ pub fn luma_ac(
let average = ((sum + (1 << (shift - 1))) >> shift) as i16;
for sub_y in 0..plane_bsize.height() {
for sub_x in 0..plane_bsize.width() {
ac[sub_y * 32 + sub_x] -= average;
ac[sub_y * plane_bsize.width() + sub_x] -= average;
}
}
}
......
......@@ -570,7 +570,7 @@ where
let max = _mm_set1_epi16((1 << bit_depth) - 1);
for j in 0..Self::H {
let luma = ac.as_ptr().add(32 * j);
let luma = ac.as_ptr().add(Self::W * j);
let line = output.as_mut_ptr().add(stride * j);
let mut i = 0isize;
......@@ -634,7 +634,7 @@ where
let avg: i32 = output[0].into();
for (line, luma) in
output.chunks_mut(stride).zip(ac.chunks(32)).take(Self::H)
output.chunks_mut(stride).zip(ac.chunks(Self::W)).take(Self::H)
{
for (v, &l) in line[..Self::W].iter_mut().zip(luma[..Self::W].iter()) {
*v =
......@@ -717,9 +717,13 @@ pub mod test {
pub fn pred_cfl_4x4(
output: &mut [u16], stride: usize, ac: &[i16], alpha: i16, bd: i32
) {
let mut ac32 = [0; 4*32];
for (l32, l) in ac32.chunks_mut(32).zip(ac.chunks(4).take(4)) {
l32[..4].copy_from_slice(&l);
}
unsafe {
cfl_predict_hbd_c(
ac.as_ptr(),
ac32.as_ptr(),
output.as_mut_ptr(),
stride as libc::ptrdiff_t,
alpha as libc::c_int,
......
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