realmedia/rv3040: pass mb_h into loop filter
authorKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 23 Mar 2020 17:59:08 +0000 (18:59 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Mon, 23 Mar 2020 17:59:08 +0000 (18:59 +0100)
nihav-realmedia/src/codecs/rv3040.rs
nihav-realmedia/src/codecs/rv30dsp.rs
nihav-realmedia/src/codecs/rv40dsp.rs

index e45b62b0682204306551761a04f147b1a3871264..c3526196356ca9da336dfd4f891b17c46affa7a1 100644 (file)
@@ -503,7 +503,7 @@ pub trait RV34BitstreamDecoder {
 }
 
 pub trait RV34DSP {
-    fn loop_filter(&self, frame: &mut NAVideoBuffer<u8>, ftype: FrameType, mbinfo: &[RV34MBInfo], mb_w: usize, row: usize);
+    fn loop_filter(&self, frame: &mut NAVideoBuffer<u8>, ftype: FrameType, mbinfo: &[RV34MBInfo], mb_w: usize, mb_h: usize, row: usize);
     fn do_luma_mc(&self, frame: &mut NAVideoBuffer<u8>, prev_frame: &NAVideoBuffer<u8>, x: usize, y: usize, mv: MV, use16: bool, avg: bool);
     fn do_chroma_mc(&self, frame: &mut NAVideoBuffer<u8>, prev_frame: &NAVideoBuffer<u8>, x: usize, y: usize, comp: usize, mv: MV, use8: bool, avg: bool);
 }
@@ -1265,12 +1265,12 @@ impl RV34Decoder {
                 mb_pos += 1;
             }
             if hdr0.deblock && (mb_y >= 1) {
-                self.dsp.loop_filter(&mut buf, hdr0.ftype, &mbinfo, mb_w, mb_y - 1);
+                self.dsp.loop_filter(&mut buf, hdr0.ftype, &mbinfo, mb_w, mb_h, mb_y - 1);
             }
             imode.update();
         }
         if hdr0.deblock {
-            self.dsp.loop_filter(&mut buf, hdr0.ftype, &mbinfo, mb_w, mb_h - 1);
+            self.dsp.loop_filter(&mut buf, hdr0.ftype, &mbinfo, mb_w, mb_h, mb_h - 1);
         }
         if !self.is_b {
             self.ipbs.add_frame(buf.clone());
index 19618900851a8895110f52d4ceab64b49b82b279..fbe03607c679aef54e9c95d526caadaa1f84fd9f 100644 (file)
@@ -238,7 +238,7 @@ const RV30_EDGE1: [isize; 3] = [ 0, 1, 1 ];
 const RV30_EDGE2: [isize; 3] = [ 0, 2, 2 ];
 
 impl RV34DSP for RV30DSP {
-    fn loop_filter(&self, frame: &mut NAVideoBuffer<u8>, _ftype: FrameType, mbinfo: &[RV34MBInfo], mb_w: usize, row: usize) {
+    fn loop_filter(&self, frame: &mut NAVideoBuffer<u8>, _ftype: FrameType, mbinfo: &[RV34MBInfo], mb_w: usize, _mb_h: usize, row: usize) {
         let mut offs:   [usize; 3] = [0; 3];
         let mut stride: [usize; 3] = [0; 3];
 
index 0dfec4772a1285ea217092409e38aa4e3cf32c0a..b40ef532a427b852652bad5249d198e998570f10 100644 (file)
@@ -566,7 +566,7 @@ const RV40_EDGE1: [isize; 4] = [ 0, 2, 2, 2 ];
 const RV40_EDGE2: [isize; 4] = [ 0, 3, 3, 3 ];
 
 impl RV34DSP for RV40DSP {
-    fn loop_filter(&self, frame: &mut NAVideoBuffer<u8>, _ftype: FrameType, mbinfo: &[RV34MBInfo], mb_w: usize, row: usize) {
+    fn loop_filter(&self, frame: &mut NAVideoBuffer<u8>, _ftype: FrameType, mbinfo: &[RV34MBInfo], mb_w: usize, mb_h: usize, row: usize) {
         // todo proper B-frame filtering?
         let mut offs:   [usize; 3] = [0; 3];
         let mut stride: [usize; 3] = [0; 3];