Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Sep 2015 20:37:05 +0000 (UTC)
From:      Antoine Brodin <antoine@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r396859 - in head/graphics/mozjpeg: . files
Message-ID:  <201509132037.t8DKb5k9054529@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: antoine
Date: Sun Sep 13 20:37:04 2015
New Revision: 396859
URL: https://svnweb.freebsd.org/changeset/ports/396859

Log:
  Fix negative shift with IFAST FDCT and qual=100
  This fixes regression tests with clang 3.7.0
  
  PR:		202763
  Obtained from:	https://github.com/libjpeg-turbo/libjpeg-turbo/commit/4cfa3f4c39c2e46eca3a65c67411d15e08a3fc70
  Submitted upstream in:	https://github.com/mozilla/mozjpeg/pull/186
  Approved by:	maintainer timeout (2 weeks)

Added:
  head/graphics/mozjpeg/files/
  head/graphics/mozjpeg/files/patch-jcdctmgr.c   (contents, props changed)
Modified:
  head/graphics/mozjpeg/Makefile

Modified: head/graphics/mozjpeg/Makefile
==============================================================================
--- head/graphics/mozjpeg/Makefile	Sun Sep 13 20:36:22 2015	(r396858)
+++ head/graphics/mozjpeg/Makefile	Sun Sep 13 20:37:04 2015	(r396859)
@@ -4,6 +4,7 @@
 PORTNAME=	mozjpeg
 PORTVERSION=	3.1
 DISTVERSIONPREFIX=	v
+PORTREVISION=	1
 CATEGORIES=	graphics
 
 MAINTAINER=	horia@racoviceanu.com

Added: head/graphics/mozjpeg/files/patch-jcdctmgr.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/mozjpeg/files/patch-jcdctmgr.c	Sun Sep 13 20:37:04 2015	(r396859)
@@ -0,0 +1,41 @@
+--- jcdctmgr.c.orig	2015-05-18 14:28:09 UTC
++++ jcdctmgr.c
+@@ -6,7 +6,7 @@
+  * libjpeg-turbo Modifications:
+  * Copyright (C) 1999-2006, MIYASAKA Masaru.
+  * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
+- * Copyright (C) 2011, 2014 D. R. Commander
++ * Copyright (C) 2011, 2014-2015 D. R. Commander
+  * mozjpeg Modifications:
+  * Copyright (C) 2014, Mozilla Corporation.
+  * For conditions of distribution and use, see the accompanying README file.
+@@ -185,6 +185,19 @@ compute_reciprocal (UINT16 divisor, DCTE
+   UDCTELEM c;
+   int b, r;
+ 
++  if (divisor == 1) {
++    /* divisor == 1 means unquantized, so these reciprocal/correction/shift
++     * values will cause the C quantization algorithm to act like the
++     * identity function.  Since only the C quantization algorithm is used in
++     * these cases, the scale value is irrelevant.
++     */
++    dtbl[DCTSIZE2 * 0] = (DCTELEM) 1;                       /* reciprocal */
++    dtbl[DCTSIZE2 * 1] = (DCTELEM) 0;                       /* correction */
++    dtbl[DCTSIZE2 * 2] = (DCTELEM) 1;                       /* scale */
++    dtbl[DCTSIZE2 * 3] = (DCTELEM) (-sizeof(DCTELEM) * 8);  /* shift */
++    return 0;
++  }
++
+   b = flss(divisor) - 1;
+   r  = sizeof(DCTELEM) * 8 + b;
+ 
+@@ -589,7 +602,8 @@ quantize (JCOEFPTR coef_block, DCTELEM *
+ 
+ #if BITS_IN_JSAMPLE == 8
+ 
+-  UDCTELEM recip, corr, shift;
++  UDCTELEM recip, corr;
++  int shift;
+   UDCTELEM2 product;
+ 
+   for (i = 0; i < DCTSIZE2; i++) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201509132037.t8DKb5k9054529>