Commit 3542c01f authored by Raphaël Zumer's avatar Raphaël Zumer

Fix some indentation and whitespace

parent 5311eeea
......@@ -294,10 +294,9 @@ impl Context {
}
pub fn container_sequence_header(&mut self) -> Vec<u8> {
use bitstream_io::*;
use std::io;
fn sequence_header_inner(seq: &Sequence) -> io::Result<Vec<u8>> {
let mut buf = Vec::new();
{
let mut bw = BitWriter::endian(&mut buf, BigEndian);
bw.write_bit(true)?; // marker
......@@ -317,6 +316,7 @@ impl Context {
bw.write(4, 0)?; // reserved
}
Ok(buf)
}
......
......@@ -274,6 +274,7 @@ impl<S> WriterBase<S> {
fn new(storage: S) -> Self {
WriterBase { rng: 0x8000, cnt: -9, debug: false, s: storage }
}
/// Compute low and range values from token cdf values and local state
fn lr_compute(&mut self, fl: u16, fh: u16, nms: u16) -> (ec_window, u16) {
let u: u32;
......@@ -292,6 +293,7 @@ impl<S> WriterBase<S> {
(0, r as u16)
}
}
/// Given the current total integer number of bits used and the current value of
/// rng, computes the fraction number of bits used to `OD_BITRES` precision.
/// This is used by `od_ec_enc_tell_frac()` and `od_ec_dec_tell_frac()`.
......@@ -326,7 +328,8 @@ impl<S> WriterBase<S> {
}
nbits - l
}
/// Function to update the CDF for Writer calls that do so.
// Function to update the CDF for Writer calls that do so.
fn update_cdf(cdf: &mut [u16], val: u32) {
let nsymbs = cdf.len() - 1;
let rate = 3 + (nsymbs >> 1).min(2) + (cdf[nsymbs] >> 4) as usize;
......
......@@ -45,8 +45,5 @@ mod api;
pub use api::*;
pub use encoder::*;
// #[cfg(test)]
#[cfg(all(test, feature="decode_test"))]
mod test_encode_decode;
......@@ -14,7 +14,6 @@ pub const RESTORE_SWITCHABLE: u8 = 1;
pub const RESTORE_WIENER: u8 = 2;
pub const RESTORE_SGRPROJ: u8 = 3;
pub const WIENER_TAPS_MIN: [i8; 3] = [ -5, -23, -17 ];
pub const WIENER_TAPS_MID: [i8; 3] = [ 3, -7, 15 ];
pub const WIENER_TAPS_MAX: [i8; 3] = [ 10, 8, 46 ];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment