summaryrefslogtreecommitdiffstats
path: root/nihav-codec-support/src
diff options
context:
space:
mode:
authorKostya Shishkov <[email protected]>2020-04-03 11:56:20 +0200
committerKostya Shishkov <[email protected]>2020-04-03 11:56:20 +0200
commitacf6187c1717166984d7783e2b5bde26733c8b56 (patch)
tree9764c45673ea08dc68fa924b880e3a204b433991 /nihav-codec-support/src
parent5c75af61b7cb1dae933d0c14eabda3488c4bb93c (diff)
codec_support/h263: fix DC clipping function
Diffstat (limited to 'nihav-codec-support/src')
-rw-r--r--nihav-codec-support/src/codecs/h263/decoder.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/nihav-codec-support/src/codecs/h263/decoder.rs b/nihav-codec-support/src/codecs/h263/decoder.rs
index 929854a..2707e76 100644
--- a/nihav-codec-support/src/codecs/h263/decoder.rs
+++ b/nihav-codec-support/src/codecs/h263/decoder.rs
@@ -141,9 +141,9 @@ pub struct H263BaseDecoder {
#[inline]
fn clip_dc(dc: i16) -> i16 {
- if dc < 0 { 0 }
- else if dc > 2046 { 2046 }
- else { (dc + 1) & !1 }
+ if dc <= 0 { 0 }
+ else if dc > 2046 { 2047 }
+ else { dc | 1 }
}
#[inline]