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

Unified Diff: third_party/libjpeg_turbo/jcdctmgr.c

Issue 7554002: Updates libjpeg-turbo to 1.1.90 (r677) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/
Patch Set: '' Created 9 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 | « third_party/libjpeg_turbo/jccolor.c ('k') | third_party/libjpeg_turbo/jchuff.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libjpeg_turbo/jcdctmgr.c
===================================================================
--- third_party/libjpeg_turbo/jcdctmgr.c (revision 95020)
+++ third_party/libjpeg_turbo/jcdctmgr.c (working copy)
@@ -4,6 +4,7 @@
* Copyright (C) 1994-1996, Thomas G. Lane.
* Copyright (C) 1999-2006, MIYASAKA Masaru.
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
+ * Copyright (C) 2011 D. R. Commander
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@@ -39,6 +40,8 @@
(JCOEFPTR coef_block, FAST_FLOAT * divisors,
FAST_FLOAT * workspace));
+METHODDEF(void) quantize (JCOEFPTR, DCTELEM *, DCTELEM *);
+
typedef struct {
struct jpeg_forward_dct pub; /* public fields */
@@ -160,7 +163,7 @@
* of in a consecutive manner, yet again in order to allow SIMD
* routines.
*/
-LOCAL(void)
+LOCAL(int)
compute_reciprocal (UINT16 divisor, DCTELEM * dtbl)
{
UDCTELEM2 fq, fr;
@@ -189,6 +192,9 @@
dtbl[DCTSIZE2 * 1] = (DCTELEM) c; /* correction + roundfactor */
dtbl[DCTSIZE2 * 2] = (DCTELEM) (1 << (sizeof(DCTELEM)*8*2 - r)); /* scale */
dtbl[DCTSIZE2 * 3] = (DCTELEM) r - sizeof(DCTELEM)*8; /* shift */
+
+ if(r <= 16) return 0;
+ else return 1;
}
/*
@@ -232,7 +238,9 @@
}
dtbl = fdct->divisors[qtblno];
for (i = 0; i < DCTSIZE2; i++) {
- compute_reciprocal(qtbl->quantval[i] << 3, &dtbl[i]);
+ if(!compute_reciprocal(qtbl->quantval[i] << 3, &dtbl[i])
+ && fdct->quantize == jsimd_quantize)
+ fdct->quantize = quantize;
}
break;
#endif
@@ -266,10 +274,12 @@
}
dtbl = fdct->divisors[qtblno];
for (i = 0; i < DCTSIZE2; i++) {
- compute_reciprocal(
+ if(!compute_reciprocal(
DESCALE(MULTIPLY16V16((INT32) qtbl->quantval[i],
(INT32) aanscales[i]),
- CONST_BITS-3), &dtbl[i]);
+ CONST_BITS-3), &dtbl[i])
+ && fdct->quantize == jsimd_quantize)
+ fdct->quantize = quantize;
}
}
break;
« no previous file with comments | « third_party/libjpeg_turbo/jccolor.c ('k') | third_party/libjpeg_turbo/jchuff.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698