]> git.nihav.org Git - nihav.git/commitdiff
vp7: skip DC transform for empty block
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 6 Feb 2020 17:44:32 +0000 (18:44 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 6 Feb 2020 17:44:32 +0000 (18:44 +0100)
nihav-duck/src/codecs/vp7.rs

index ea423ad26145b2070bd88df7c038eea9620b9a23..50fe5db8f983cae96cf3f4d8e5a1393c1bd8e581 100644 (file)
@@ -552,7 +552,7 @@ impl VP7Decoder {
             }
             if has_ac[24] {
                 idct4x4(y2block);
-            } else {
+            } else if y2block[0] != 0 {
                 idct4x4_dc(y2block);
             }
             for i in 0..16 {
@@ -562,7 +562,7 @@ impl VP7Decoder {
         for i in 0..24 {
             if has_ac[i] {
                 idct4x4(&mut self.coeffs[i]);
-            } else {
+            } else if self.coeffs[i][0] != 0 {
                 idct4x4_dc(&mut self.coeffs[i]);
             }
         }