The JPEG specification describes the extended JPEG process (BitDepths != 8) in P2 & P4. Right now we always write out a precision of 8 (see https://github.com/vstroebel/jpeg-encoder/blob/main/src/writer.rs#L406), which is correct for baseline JPEG.
In zune-jpeg i did a PR implementing the decoding of extended JPEG, by providing a generic PRECISION argument to the functions, which is then used to calculate any constants within the function body. Maybe a similar approach could be used here?
The JPEG specification describes the extended JPEG process (BitDepths != 8) in P2 & P4. Right now we always write out a precision of 8 (see https://github.com/vstroebel/jpeg-encoder/blob/main/src/writer.rs#L406), which is correct for baseline JPEG.
In zune-jpeg i did a PR implementing the decoding of extended JPEG, by providing a generic PRECISION argument to the functions, which is then used to calculate any constants within the function body. Maybe a similar approach could be used here?