Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(547)

Unified Diff: turbojpeg.c

Issue 10700197: Update libjpeg-turbo to r856. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libjpeg_turbo/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « turbojpeg.h ('k') | turbojpeg-jni.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: turbojpeg.c
===================================================================
--- turbojpeg.c (revision 144411)
+++ turbojpeg.c (working copy)
@@ -145,7 +145,7 @@
}
static int setCompDefaults(struct jpeg_compress_struct *cinfo,
- int pixelFormat, int subsamp, int jpegQual)
+ int pixelFormat, int subsamp, int jpegQual, int flags)
{
int retval=0;
@@ -191,7 +191,7 @@
if(jpegQual>=0)
{
jpeg_set_quality(cinfo, jpegQual, TRUE);
- if(jpegQual>=96) cinfo->dct_method=JDCT_ISLOW;
+ if(jpegQual>=96 || flags&TJFLAG_ACCURATEDCT) cinfo->dct_method=JDCT_ISLOW;
else cinfo->dct_method=JDCT_FASTEST;
}
if(subsamp==TJSAMP_GRAY)
@@ -210,7 +210,7 @@
}
static int setDecompDefaults(struct jpeg_decompress_struct *dinfo,
- int pixelFormat)
+ int pixelFormat, int flags)
{
int retval=0;
@@ -258,6 +258,8 @@
_throw("Unsupported pixel format");
}
+ if(flags&TJFLAG_FASTDCT) dinfo->dct_method=JDCT_FASTEST;
+
bailout:
return retval;
}
@@ -618,7 +620,7 @@
alloc=0; *jpegSize=tjBufSize(width, height, jpegSubsamp);
}
jpeg_mem_dest_tj(cinfo, jpegBuf, jpegSize, alloc);
- if(setCompDefaults(cinfo, pixelFormat, jpegSubsamp, jpegQual)==-1)
+ if(setCompDefaults(cinfo, pixelFormat, jpegSubsamp, jpegQual, flags)==-1)
return -1;
jpeg_start_compress(cinfo, TRUE);
@@ -726,7 +728,7 @@
yuvsize=tjBufSizeYUV(width, height, subsamp);
jpeg_mem_dest_tj(cinfo, &dstBuf, &yuvsize, 0);
- if(setCompDefaults(cinfo, pixelFormat, subsamp, -1)==-1) return -1;
+ if(setCompDefaults(cinfo, pixelFormat, subsamp, -1, flags)==-1) return -1;
jpeg_start_compress(cinfo, TRUE);
pw=PAD(width, cinfo->max_h_samp_factor);
@@ -955,7 +957,7 @@
jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
jpeg_read_header(dinfo, TRUE);
- if(setDecompDefaults(dinfo, pixelFormat)==-1)
+ if(setDecompDefaults(dinfo, pixelFormat, flags)==-1)
{
retval=-1; goto bailout;
}
@@ -1110,6 +1112,7 @@
}
if(flags&TJFLAG_FASTUPSAMPLE) dinfo->do_fancy_upsampling=FALSE;
+ if(flags&TJFLAG_FASTDCT) dinfo->dct_method=JDCT_FASTEST;
dinfo->raw_data_out=TRUE;
jpeg_start_decompress(dinfo);
« no previous file with comments | « turbojpeg.h ('k') | turbojpeg-jni.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698