• Home
  • Raw
  • Download

Lines Matching +full:int16 +full:- +full:array

5  * Copyright (C) 1994-1996, Thomas G. Lane.
6 * libjpeg-turbo Modifications:
8 * Copyright (C) 2009, 2011, 2014-2015, 2020, D. R. Commander.
27 * At typical sampling ratios, this eliminates half or three-quarters of the
34 * Corner-aligned (non-CCIR601) sampling alignment.
50 #define SCALEBITS 16 /* speediest right-shift on some machines */
51 #define ONE_HALF ((JLONG)1 << (SCALEBITS - 1))
157 * Initialize tables for YCC->RGB colorspace conversion.
164 my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample; in build_ycc_rgb_table()
169 upsample->Cr_r_tab = (int *) in build_ycc_rgb_table()
170 (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, in build_ycc_rgb_table()
172 upsample->Cb_b_tab = (int *) in build_ycc_rgb_table()
173 (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, in build_ycc_rgb_table()
175 upsample->Cr_g_tab = (JLONG *) in build_ycc_rgb_table()
176 (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, in build_ycc_rgb_table()
178 upsample->Cb_g_tab = (JLONG *) in build_ycc_rgb_table()
179 (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, in build_ycc_rgb_table()
182 for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { in build_ycc_rgb_table()
184 /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ in build_ycc_rgb_table()
186 upsample->Cr_r_tab[i] = (int) in build_ycc_rgb_table()
189 upsample->Cb_b_tab[i] = (int) in build_ycc_rgb_table()
191 /* Cr=>G value is scaled-up -0.71414 * x */ in build_ycc_rgb_table()
192 upsample->Cr_g_tab[i] = (-FIX(0.71414)) * x; in build_ycc_rgb_table()
193 /* Cb=>G value is scaled-up -0.34414 * x */ in build_ycc_rgb_table()
195 upsample->Cb_g_tab[i] = (-FIX(0.34414)) * x + ONE_HALF; in build_ycc_rgb_table()
207 my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample; in start_pass_merged_upsample()
210 upsample->spare_full = FALSE; in start_pass_merged_upsample()
211 /* Initialize total-height counter for detecting bottom of image */ in start_pass_merged_upsample()
212 upsample->rows_to_go = cinfo->output_height; in start_pass_merged_upsample()
229 my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample; in merged_2v_upsample()
233 if (upsample->spare_full) { in merged_2v_upsample()
235 JDIMENSION size = upsample->out_row_width; in merged_2v_upsample()
236 if (cinfo->out_color_space == JCS_RGB565) in merged_2v_upsample()
237 size = cinfo->output_width * 2; in merged_2v_upsample()
238 jcopy_sample_rows(&upsample->spare_row, 0, output_buf + *out_row_ctr, 0, 1, in merged_2v_upsample()
241 upsample->spare_full = FALSE; in merged_2v_upsample()
246 if (num_rows > upsample->rows_to_go) in merged_2v_upsample()
247 num_rows = upsample->rows_to_go; in merged_2v_upsample()
249 out_rows_avail -= *out_row_ctr; in merged_2v_upsample()
252 /* Create output pointer array for upsampler. */ in merged_2v_upsample()
257 work_ptrs[1] = upsample->spare_row; in merged_2v_upsample()
258 upsample->spare_full = TRUE; in merged_2v_upsample()
261 (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs); in merged_2v_upsample()
266 upsample->rows_to_go -= num_rows; in merged_2v_upsample()
268 if (!upsample->spare_full) in merged_2v_upsample()
280 my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample; in merged_1v_upsample()
283 (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, in merged_1v_upsample()
295 * Note: since we may be writing directly into application-supplied buffers,
309 switch (cinfo->out_color_space) { in h2v1_merged_upsample()
354 switch (cinfo->out_color_space) { in h2v2_merged_upsample()
404 ((INT16 *)(addr))[0] = (INT16)(pixels); \
405 ((INT16 *)(addr))[1] = (INT16)((pixels) >> 16); \
408 ((INT16 *)(addr))[1] = (INT16)(pixels); \
409 ((INT16 *)(addr))[0] = (INT16)((pixels) >> 16); \
419 * We use a 4x4 ordered dither array packed into 32 bits. This array is
543 (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, in jinit_merged_upsampler()
545 cinfo->upsample = (struct jpeg_upsampler *)upsample; in jinit_merged_upsampler()
546 upsample->pub.start_pass = start_pass_merged_upsample; in jinit_merged_upsampler()
547 upsample->pub.need_context_rows = FALSE; in jinit_merged_upsampler()
549 upsample->out_row_width = cinfo->output_width * cinfo->out_color_components; in jinit_merged_upsampler()
551 if (cinfo->max_v_samp_factor == 2) { in jinit_merged_upsampler()
552 upsample->pub.upsample = merged_2v_upsample; in jinit_merged_upsampler()
554 upsample->upmethod = jsimd_h2v2_merged_upsample; in jinit_merged_upsampler()
556 upsample->upmethod = h2v2_merged_upsample; in jinit_merged_upsampler()
557 if (cinfo->out_color_space == JCS_RGB565) { in jinit_merged_upsampler()
558 if (cinfo->dither_mode != JDITHER_NONE) { in jinit_merged_upsampler()
559 upsample->upmethod = h2v2_merged_upsample_565D; in jinit_merged_upsampler()
561 upsample->upmethod = h2v2_merged_upsample_565; in jinit_merged_upsampler()
565 upsample->spare_row = (JSAMPROW) in jinit_merged_upsampler()
566 (*cinfo->mem->alloc_large) ((j_common_ptr)cinfo, JPOOL_IMAGE, in jinit_merged_upsampler()
567 (size_t)(upsample->out_row_width * sizeof(JSAMPLE))); in jinit_merged_upsampler()
569 upsample->pub.upsample = merged_1v_upsample; in jinit_merged_upsampler()
571 upsample->upmethod = jsimd_h2v1_merged_upsample; in jinit_merged_upsampler()
573 upsample->upmethod = h2v1_merged_upsample; in jinit_merged_upsampler()
574 if (cinfo->out_color_space == JCS_RGB565) { in jinit_merged_upsampler()
575 if (cinfo->dither_mode != JDITHER_NONE) { in jinit_merged_upsampler()
576 upsample->upmethod = h2v1_merged_upsample_565D; in jinit_merged_upsampler()
578 upsample->upmethod = h2v1_merged_upsample_565; in jinit_merged_upsampler()
582 upsample->spare_row = NULL; in jinit_merged_upsampler()