From 52e16fb1be7929072c09e2fd989cd92246ae7b54 Mon Sep 17 00:00:00 2001 From: Albrecht Schlosser Date: Thu, 25 Feb 2021 15:27:01 +0100 Subject: Update bundled libs to current versions - update README.bundled-libs.txt + some comments - update bundled jpeg lib from version 9c to 9d All bundled libs are now up-to-date. For current update status please see README.bundled-libs.txt. --- jpeg/jpegint.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'jpeg/jpegint.h') diff --git a/jpeg/jpegint.h b/jpeg/jpegint.h index e312e1af9..52c708d4e 100644 --- a/jpeg/jpegint.h +++ b/jpeg/jpegint.h @@ -2,7 +2,7 @@ * jpegint.h * * Copyright (C) 1991-1997, Thomas G. Lane. - * Modified 1997-2017 by Guido Vollbeding. + * Modified 1997-2019 by Guido Vollbeding. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -302,6 +302,13 @@ struct jpeg_color_quantizer { #define RIGHT_SHIFT(x,shft) ((x) >> (shft)) #endif +/* Descale and correctly round an INT32 value that's scaled by N bits. + * We assume RIGHT_SHIFT rounds towards minus infinity, so adding + * the fudge factor is correct for either sign of X. + */ + +#define DESCALE(x,n) RIGHT_SHIFT((x) + ((INT32) 1 << ((n)-1)), n) + /* Short forms of external names for systems with brain-damaged linkers. */ -- cgit v1.2.3