Implement arithmetic coding with 12-bit precision
This actually works and apparently always has worked. It only failed because the libjpeg code, which did not originally support arithmetic coding, assumed that optimize_coding should always be TRUE for 12-bit data precision.
This commit is contained in:
@@ -2728,8 +2728,10 @@ DLLEXPORT int tj3Transform(tjhandle handle, const unsigned char *jpegBuf,
|
||||
if (this->progressive || t[i].options & TJXOPT_PROGRESSIVE)
|
||||
jpeg_simple_progression(cinfo);
|
||||
#endif
|
||||
if (this->arithmetic || t[i].options & TJXOPT_ARITHMETIC)
|
||||
if (this->arithmetic || t[i].options & TJXOPT_ARITHMETIC) {
|
||||
cinfo->arith_code = TRUE;
|
||||
cinfo->optimize_coding = FALSE;
|
||||
}
|
||||
if (!(t[i].options & TJXOPT_NOOUTPUT)) {
|
||||
jpeg_write_coefficients(cinfo, dstcoefs);
|
||||
jcopy_markers_execute(dinfo, cinfo, t[i].options & TJXOPT_COPYNONE ?
|
||||
|
||||
Reference in New Issue
Block a user