Skip to content

Commit

Permalink
Revert "Revert "Enable and test high bit depth input (xiph#437)" (xip…
Browse files Browse the repository at this point in the history
…h#442)" (xiph#447)

* Attempt to process 10-bit Y4M input

Currently compiles, encodes and decodes with desynchronization

* Use high bit depth quantization tables

* Move context::clamp() to util.rs

* Fix partition context initialization for high bit depth

* Enable and test 10-bit input

* Add 10- and 12-bit test clips to build.sh

Commented out by default, to enable as needed for local testing.

* Use the same bit depth as y4m_dec for y4m_enc

* Fix benchmark module compilation

* Fix high bit depth test encoding in 8-bit

* Fix header syntax for 12-bit 4:2:0 input

* Enable and test 12-bit input

* Reflect 12-bit support in README.md

* Keep the default C420jpeg color space in y4m_encoder

* Do not allow reconstruction output at high bit depths

* Fix reconstruction output at high bit depths

* Clean up reconstruction copy to frame buffers
  • Loading branch information
rzumer authored and tdaede committed Aug 13, 2018
1 parent 018569c commit 80f8e1a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/util.rs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,15 @@ impl Fixed for usize {
pub fn is_aligned<T>(ptr: *const T, n: usize) -> bool {
return ((ptr as usize) & ((1 << n) - 1)) == 0;
}

pub fn clamp<T: PartialOrd>(input: T, min: T, max: T) -> T {
if input < min {
return min;
}
else if input > max {
return max;
}
else {
return input;
}
}

0 comments on commit 80f8e1a

Please sign in to comment.