diff options
author | metamuffin <metamuffin@disroot.org> | 2023-03-09 18:09:07 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-03-09 18:09:07 +0100 |
commit | 4fbf4bb4310da4bede43c9428809ac9a8804982a (patch) | |
tree | daa7b2b34bb0aad4c188550b413ccd725eb1c5c4 /lvc/src/huff.rs | |
parent | ecb81ba6448d6e33a9e7ecd3cd5d41513713f814 (diff) | |
download | video-codec-experiments-4fbf4bb4310da4bede43c9428809ac9a8804982a.tar video-codec-experiments-4fbf4bb4310da4bede43c9428809ac9a8804982a.tar.bz2 video-codec-experiments-4fbf4bb4310da4bede43c9428809ac9a8804982a.tar.zst |
works very well
Diffstat (limited to 'lvc/src/huff.rs')
-rw-r--r-- | lvc/src/huff.rs | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lvc/src/huff.rs b/lvc/src/huff.rs index b00aaa0..6d74c42 100644 --- a/lvc/src/huff.rs +++ b/lvc/src/huff.rs @@ -22,6 +22,7 @@ pub fn write_huff(buf: &[u8], w: &mut impl Write) -> Result<usize> { tree.create_lut(&mut table, 1); tree.write(&mut w)?; + for b in buf { let mut k = table[*b as usize]; while k != 1 { @@ -31,7 +32,6 @@ pub fn write_huff(buf: &[u8], w: &mut impl Write) -> Result<usize> { } w.flush()?; - eprintln!("{}", w.position); Ok(w.position) } @@ -43,9 +43,7 @@ pub fn read_huff(r: &mut impl Read, buf: &mut Vec<u8>) -> Result<usize> { len |= (r.rbyte()? as usize) << 8; len |= (r.rbyte()? as usize) << 16; - eprintln!("len={len:?}"); let root = HT::read(&mut r)?; - // eprintln!("{root:?}"); let root = match &root { HT::Branch(a, b) => [a, b], _ => panic!("no!"), @@ -64,8 +62,6 @@ pub fn read_huff(r: &mut impl Read, buf: &mut Vec<u8>) -> Result<usize> { } } } - eprintln!("len(buf)={}", buf.len()); - eprintln!("{}", r.position); Ok(r.position) } |