From: Kostya Shishkov Date: Tue, 6 Aug 2024 16:23:50 +0000 (+0200) Subject: hwdec-vaapi: align back kodaed frame dimensions X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=3107322b99c016aa4e41b72e29957a2c62a0ab68;p=nihav-player.git hwdec-vaapi: align back kodaed frame dimensions --- diff --git a/hwdec-vaapi/src/lib.rs b/hwdec-vaapi/src/lib.rs index 6310eac..d7c1c9d 100644 --- a/hwdec-vaapi/src/lib.rs +++ b/hwdec-vaapi/src/lib.rs @@ -357,8 +357,8 @@ fn copy_luma(dst: &mut [u8], dstride: usize, src: &[u8], sstride: usize, w: usiz #[cfg(target_arch="x86_64")] fn deint_chroma(frm: NASimpleVideoFrame, src: &[u8], sstride: usize) { unsafe { - let width = frm.width[1]; - let height = frm.height[1]; + let width = (frm.width[1] + 7) & !7; + let height = (frm.height[1] + 7) & !7; let dst = frm.data.as_mut_ptr(); let udst = dst.add(frm.offset[1]); let vdst = dst.add(frm.offset[2]); @@ -439,7 +439,7 @@ fn fill_frame(ifmt: VAImageFormat, pic: &Picture, frm: &mut NABuffe validate!(iimg.width == (((frm.width[0] + 15) & !15) as u16)); validate!(iimg.height == (((frm.height[0] + 15) & !15) as u16)); - copy_luma(&mut frm.data[frm.offset[0]..], frm.stride[0], &imgdata[iimg.offsets[0] as usize..], iimg.pitches[0] as usize, frm.width[0], frm.height[0]); + copy_luma(&mut frm.data[frm.offset[0]..], frm.stride[0], &imgdata[iimg.offsets[0] as usize..], iimg.pitches[0] as usize, (frm.width[0] + 15) & !15, (frm.height[0] + 15) & !15); deint_chroma(frm, &imgdata[iimg.offsets[1] as usize..], iimg.pitches[1] as usize); },