summaryrefslogtreecommitdiff
path: root/jcdctmgr.c
diff options
context:
space:
mode:
authorhbono@chromium.org <hbono@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c>2011-08-03 03:13:08 +0000
committerhbono@chromium.org <hbono@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c>2011-08-03 03:13:08 +0000
commit9862697206250265c6bb37a4186b0a411c78de3b (patch)
tree1713b1df6c111f7d47cceb3cf138e7584ac764d0 /jcdctmgr.c
parent0758f15d76566a0504857c18bdce8530074f816a (diff)
Updates libjpeg-turbo to 1.1.90
This change updates our copy of libjpeg-turbo to 1.1.90 (r677), which supports ARM NEON. BUG=none TEST=none Review URL: http://codereview.chromium.org/7554002 git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/libjpeg_turbo@95196 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Diffstat (limited to 'jcdctmgr.c')
-rw-r--r--jcdctmgr.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/jcdctmgr.c b/jcdctmgr.c
index 156957a..711f9da 100644
--- a/jcdctmgr.c
+++ b/jcdctmgr.c
@@ -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 @@ typedef JMETHOD(void, float_quantize_method_ptr,
(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 @@ flss (UINT16 val)
* 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 @@ compute_reciprocal (UINT16 divisor, DCTELEM * dtbl)
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 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
}
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 @@ start_pass_fdctmgr (j_compress_ptr cinfo)
}
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;