diff options
author | Tom Hudson <tomhudson@google.com> | 2016-05-04 13:22:56 -0400 |
---|---|---|
committer | Tom Hudson <tomhudson@google.com> | 2016-05-04 13:22:56 -0400 |
commit | 0d47d2d3a728e78676a15b1d818cc668cb7e5a9c (patch) | |
tree | 044a430eeaa2dec4d6de7b624da15fda1b8ed25f /jdmrg565.c | |
parent | 9d35298a6223278a66423f828a949d93d94d5911 (diff) |
Update to libjpeg_turbo 1.4.90
(Duplicate of https://codereview.chromium.org/1939823002/ for landing.)
TBR=noel@chromium.org,thakis@chromium.org
BUG=608347, 398235, 591927
Review URL: https://codereview.chromium.org/1953443002 .
Diffstat (limited to 'jdmrg565.c')
-rw-r--r-- | jdmrg565.c | 47 |
1 files changed, 24 insertions, 23 deletions
@@ -5,8 +5,9 @@ * Copyright (C) 1994-1996, Thomas G. Lane. * libjpeg-turbo Modifications: * Copyright (C) 2013, Linaro Limited. - * Copyright (C) 2014, D. R. Commander. - * For conditions of distribution and use, see the accompanying README file. + * Copyright (C) 2014-2015, D. R. Commander. + * For conditions of distribution and use, see the accompanying README.ijg + * file. * * This file contains code for merged upsampling/color conversion. */ @@ -29,10 +30,10 @@ h2v1_merged_upsample_565_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; int * Crrtab = upsample->Cr_r_tab; int * Cbbtab = upsample->Cb_b_tab; - INT32 * Crgtab = upsample->Cr_g_tab; - INT32 * Cbgtab = upsample->Cb_g_tab; + JLONG * Crgtab = upsample->Cr_g_tab; + JLONG * Cbgtab = upsample->Cb_g_tab; unsigned int r, g, b; - INT32 rgb; + JLONG rgb; SHIFT_TEMPS inptr0 = input_buf[0][in_row_group_ctr]; @@ -78,7 +79,7 @@ h2v1_merged_upsample_565_internal (j_decompress_ptr cinfo, g = range_limit[y + cgreen]; b = range_limit[y + cblue]; rgb = PACK_SHORT_565(r, g, b); - *(INT16*)outptr = rgb; + *(INT16*)outptr = (INT16)rgb; } } @@ -100,11 +101,11 @@ h2v1_merged_upsample_565D_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; int * Crrtab = upsample->Cr_r_tab; int * Cbbtab = upsample->Cb_b_tab; - INT32 * Crgtab = upsample->Cr_g_tab; - INT32 * Cbgtab = upsample->Cb_g_tab; - INT32 d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; + JLONG * Crgtab = upsample->Cr_g_tab; + JLONG * Cbgtab = upsample->Cb_g_tab; + JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; unsigned int r, g, b; - INT32 rgb; + JLONG rgb; SHIFT_TEMPS inptr0 = input_buf[0][in_row_group_ctr]; @@ -152,7 +153,7 @@ h2v1_merged_upsample_565D_internal (j_decompress_ptr cinfo, g = range_limit[DITHER_565_G(y + cgreen, d0)]; b = range_limit[DITHER_565_B(y + cblue, d0)]; rgb = PACK_SHORT_565(r, g, b); - *(INT16*)outptr = rgb; + *(INT16*)outptr = (INT16)rgb; } } @@ -174,10 +175,10 @@ h2v2_merged_upsample_565_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; int * Crrtab = upsample->Cr_r_tab; int * Cbbtab = upsample->Cb_b_tab; - INT32 * Crgtab = upsample->Cr_g_tab; - INT32 * Cbgtab = upsample->Cb_g_tab; + JLONG * Crgtab = upsample->Cr_g_tab; + JLONG * Cbgtab = upsample->Cb_g_tab; unsigned int r, g, b; - INT32 rgb; + JLONG rgb; SHIFT_TEMPS inptr00 = input_buf[0][in_row_group_ctr * 2]; @@ -241,14 +242,14 @@ h2v2_merged_upsample_565_internal (j_decompress_ptr cinfo, g = range_limit[y + cgreen]; b = range_limit[y + cblue]; rgb = PACK_SHORT_565(r, g, b); - *(INT16*)outptr0 = rgb; + *(INT16*)outptr0 = (INT16)rgb; y = GETJSAMPLE(*inptr01); r = range_limit[y + cred]; g = range_limit[y + cgreen]; b = range_limit[y + cblue]; rgb = PACK_SHORT_565(r, g, b); - *(INT16*)outptr1 = rgb; + *(INT16*)outptr1 = (INT16)rgb; } } @@ -270,12 +271,12 @@ h2v2_merged_upsample_565D_internal (j_decompress_ptr cinfo, register JSAMPLE * range_limit = cinfo->sample_range_limit; int * Crrtab = upsample->Cr_r_tab; int * Cbbtab = upsample->Cb_b_tab; - INT32 * Crgtab = upsample->Cr_g_tab; - INT32 * Cbgtab = upsample->Cb_g_tab; - INT32 d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; - INT32 d1 = dither_matrix[(cinfo->output_scanline+1) & DITHER_MASK]; + JLONG * Crgtab = upsample->Cr_g_tab; + JLONG * Cbgtab = upsample->Cb_g_tab; + JLONG d0 = dither_matrix[cinfo->output_scanline & DITHER_MASK]; + JLONG d1 = dither_matrix[(cinfo->output_scanline+1) & DITHER_MASK]; unsigned int r, g, b; - INT32 rgb; + JLONG rgb; SHIFT_TEMPS inptr00 = input_buf[0][in_row_group_ctr*2]; @@ -343,13 +344,13 @@ h2v2_merged_upsample_565D_internal (j_decompress_ptr cinfo, g = range_limit[DITHER_565_G(y + cgreen, d0)]; b = range_limit[DITHER_565_B(y + cblue, d0)]; rgb = PACK_SHORT_565(r, g, b); - *(INT16*)outptr0 = rgb; + *(INT16*)outptr0 = (INT16)rgb; y = GETJSAMPLE(*inptr01); r = range_limit[DITHER_565_R(y + cred, d1)]; g = range_limit[DITHER_565_G(y + cgreen, d1)]; b = range_limit[DITHER_565_B(y + cblue, d1)]; rgb = PACK_SHORT_565(r, g, b); - *(INT16*)outptr1 = rgb; + *(INT16*)outptr1 = (INT16)rgb; } } |