From ed4165117e3348e3b2b8484733469012b7b4c182 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Tue, 17 Dec 2019 18:13:33 +0100 Subject: [PATCH] vp3: add loop filter for chroma --- nihav-duck/src/codecs/vp3.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/nihav-duck/src/codecs/vp3.rs b/nihav-duck/src/codecs/vp3.rs index 059ff9d..114237a 100644 --- a/nihav-duck/src/codecs/vp3.rs +++ b/nihav-duck/src/codecs/vp3.rs @@ -1709,12 +1709,27 @@ println!("intra, ver {} (self {})", version, self.version); } blk_idx += blk_w; } -/* for plane in 1..3 { + let blk_w = self.mb_w; + for plane in 1..3 { for by in 0..self.mb_h { for bx in 0..self.mb_w { + let blk = &self.blocks[blk_idx + bx]; + if (bx > 0) && blk.coded { + vp31_loop_filter_v(frm, bx * 8, by * 8, plane, self.loop_str); + } + if (by > 0) && blk.coded { + vp31_loop_filter_h(frm, bx * 8, by * 8, plane, self.loop_str); + } + if (bx < blk_w - 1) && !self.blocks[blk_idx + bx + 1].coded { + vp31_loop_filter_v(frm, bx * 8 + 8, by * 8, plane, self.loop_str); + } + if (by < self.mb_h - 1) && !self.blocks[blk_idx + bx + blk_w].coded { + vp31_loop_filter_h(frm, bx * 8, by * 8 + 8, plane, self.loop_str); + } } + blk_idx += blk_w; } - }*/ + } } fn generate_block_addr(&mut self) { let sb_w_y = (self.width + 31) >> 5; -- 2.39.5