diff options
author | Leander Beernaert <leander.beernaert@qt.io> | 2019-11-14 13:03:46 +0100 |
---|---|---|
committer | Leander Beernaert <leander.beernaert@qt.io> | 2019-11-19 13:53:21 +0100 |
commit | 26e876912435bdafbca2b425af43824d7ec5b876 (patch) | |
tree | b7ee83cdd9de18ce5970bab0bb217a972d3d2445 /src/3rdparty/libjpeg/src/jdsample.c | |
parent | 7a6c6da2ebbfef33f7284ce5c96aa0c3acabc6bc (diff) | |
parent | bac999f38ca10147832846f6d7df1e4a051d3760 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Change-Id: Ifecc2d9db396d783124df8567553ba5f846f30bb
Diffstat (limited to 'src/3rdparty/libjpeg/src/jdsample.c')
-rw-r--r-- | src/3rdparty/libjpeg/src/jdsample.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/3rdparty/libjpeg/src/jdsample.c b/src/3rdparty/libjpeg/src/jdsample.c index 52ee9af49b..50a68b3013 100644 --- a/src/3rdparty/libjpeg/src/jdsample.c +++ b/src/3rdparty/libjpeg/src/jdsample.c @@ -8,6 +8,7 @@ * Copyright (C) 2010, 2015-2016, D. R. Commander. * Copyright (C) 2014, MIPS Technologies, Inc., California. * Copyright (C) 2015, Google, Inc. + * Copyright (C) 2019, Arm Limited. * For conditions of distribution and use, see the accompanying README.ijg * file. * @@ -315,9 +316,9 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr, JSAMPARRAY output_data = *output_data_ptr; JSAMPROW inptr0, inptr1, outptr; #if BITS_IN_JSAMPLE == 8 - int thiscolsum; + int thiscolsum, bias; #else - JLONG thiscolsum; + JLONG thiscolsum, bias; #endif JDIMENSION colctr; int inrow, outrow, v; @@ -327,15 +328,18 @@ h1v2_fancy_upsample(j_decompress_ptr cinfo, jpeg_component_info *compptr, for (v = 0; v < 2; v++) { /* inptr0 points to nearest input row, inptr1 points to next nearest */ inptr0 = input_data[inrow]; - if (v == 0) /* next nearest is row above */ + if (v == 0) { /* next nearest is row above */ inptr1 = input_data[inrow - 1]; - else /* next nearest is row below */ + bias = 1; + } else { /* next nearest is row below */ inptr1 = input_data[inrow + 1]; + bias = 2; + } outptr = output_data[outrow++]; for (colctr = 0; colctr < compptr->downsampled_width; colctr++) { thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++); - *outptr++ = (JSAMPLE)((thiscolsum + 1) >> 2); + *outptr++ = (JSAMPLE)((thiscolsum + bias) >> 2); } } inrow++; |