aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-duck/src
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2020-02-06 18:43:24 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2020-02-06 18:43:24 +0100
commitf712521586d85c7f6ab03c7b5b79c460f044a109 (patch)
tree18c3d94f518281fd2b3fc775a17f394e2e82d1c6 /nihav-duck/src
parent7be4326ba1558068402a6f3e3aa90fd0644701be (diff)
downloadnihav-f712521586d85c7f6ab03c7b5b79c460f044a109.tar.gz
vp7: fix inter mode DC predictor
Diffstat (limited to 'nihav-duck/src')
-rw-r--r--nihav-duck/src/codecs/vp7.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/nihav-duck/src/codecs/vp7.rs b/nihav-duck/src/codecs/vp7.rs
index a4d361c..ea423ad 100644
--- a/nihav-duck/src/codecs/vp7.rs
+++ b/nihav-duck/src/codecs/vp7.rs
@@ -544,11 +544,11 @@ impl VP7Decoder {
y2block[0] = dc;
}
if (pval == 0) || (dc == 0) || ((pval ^ dc) < 0) {
- self.dstate.pdc_pred_val = dc;
self.dstate.pdc_pred_count = 0;
} else if dc == pval {
self.dstate.pdc_pred_count += 1;
}
+ self.dstate.pdc_pred_val = dc;
}
if has_ac[24] {
idct4x4(y2block);
@@ -1246,8 +1246,10 @@ impl NADecoder for VP7Decoder {
let mut mb_idx = 0;
self.pcache.reset();
- self.dstate.pdc_pred_val = 0;
- self.dstate.pdc_pred_count = 0;
+ if self.dstate.is_intra || (self.dstate.version > 0) {
+ self.dstate.pdc_pred_val = 0;
+ self.dstate.pdc_pred_count = 0;
+ }
let mut use_last = true;
for mb_y in 0..self.mb_h {
for mb_x in 0..self.mb_w {