fn remove_padding_bits(
    out: &mut [u8],
    inp: &[u8],
    olinebits: usize,
    ilinebits: usize,
    h: usize,
) {
    let diff = ilinebits - olinebits; /*input and output bit pointers*/
    let mut ibp = 0;
    let mut obp = 0;
    for _ in 0..h {
        for _ in 0..olinebits {
            let bit = read_bit_from_reversed_stream(&mut ibp, inp);
            set_bit_of_reversed_stream(&mut obp, out, bit);
        }
        ibp += diff;
    }
}
/*
After filtering there are still padding bits if scanlines have non multiple of 8 bit amounts. They need
to be removed (except at last scanline of (Adam7-reduced) image) before working with pure image buffers
for the Adam7 code, the color convert code and the output to the user.
in and out are allowed to be the same buffer, in may also be higher but still overlapping; in must
have >= ilinebits*h bits, out must have >= olinebits*h bits, olinebits must be <= ilinebits
also used to move bits after earlier such operations happened, e.g. in a sequence of reduced images from Adam7
only useful if (ilinebits - olinebits) is a value in the range 1..7
*/
After filtering there are still padding bits if scanlines have non multiple of 8 bit amounts. They need
to be removed (except at last scanline of (Adam7-reduced) image) before working with pure image buffers
for the Adam7 code, the color convert code and the output to the user.
in and out are allowed to be the same buffer, in may also be higher but still overlapping; in must
have >= ilinebits*h bits, out must have >= olinebits*h bits, olinebits must be <= ilinebits
also used to move bits after earlier such operations happened, e.g. in a sequence of reduced images from Adam7
only useful if (ilinebits - olinebits) is a value in the range 1..7
After filtering there are still padding bits if scanlines have non multiple of 8 bit amounts . They need to be removed ( except at last scanline of ( Adam7 - reduced ) image ) before working with pure image buffers for the Adam7 code the color convert code and the output to the user . in and out are allowed to be the same buffer in may also be higher but still overlapping ; in must have > = ilinebits * h bits out must have > = olinebits * h bits olinebits must be < = ilinebits also used to move bits after earlier such operations happened e . g . in a sequence of reduced images from Adam7 only useful if ( ilinebits - olinebits ) is a value in the range 1 .. 7
fn remove_padding_bits(
    out: &mut [u8],
    inp: &[u8],
    olinebits: usize,
    ilinebits: usize,
    h: usize,
) {
    let diff = ilinebits - olinebits; /*input and output bit pointers*/
    let mut ibp = 0;
    let mut obp = 0;
    for _ in 0..h {
        for _ in 0..olinebits {
            let bit = read_bit_from_reversed_stream(&mut ibp, inp);
            set_bit_of_reversed_stream(&mut obp, out, bit);
        }
        ibp += diff;
    }
}
fn remove_padding_bits ( out : & mut [ u8 ] , inp : & [ u8 ] , olinebits : usize , ilinebits : usize , h : usize , ) { let diff = ilinebits - olinebits ; /*input and output bit pointers*/ let mut ibp = 0 ; let mut obp = 0 ; for _ in 0 .. h { for _ in 0 .. olinebits { let bit = read_bit_from_reversed_stream ( & mut ibp , inp ) ; set_bit_of_reversed_stream ( & mut obp , out , bit ) ; } ibp += diff ; } }
After filtering there are still padding bits if scanlines have non multiple of 8 bit amounts.
After filtering there are still padding bits if scanlines have non multiple of 8 bit amounts .
out
&mut [u8]
inp
&[u8]
olinebits
usize
ilinebits
usize
h
usize