Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * jdmerge.c |
| 3 | * |
DRC | a73e870 | 2012-12-31 02:52:30 +0000 | [diff] [blame] | 4 | * This file was part of the Independent JPEG Group's software: |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 5 | * Copyright (C) 1994-1996, Thomas G. Lane. |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 6 | * Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB |
DRC | a6ef282 | 2013-09-28 03:23:49 +0000 | [diff] [blame] | 7 | * libjpeg-turbo Modifications: |
DRC | 1e32fe3 | 2015-10-14 17:32:39 -0500 | [diff] [blame] | 8 | * Copyright (C) 2009, 2011, 2014-2015, D. R. Commander. |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 9 | * Copyright (C) 2013, Linaro Limited. |
DRC | 7e3acc0 | 2015-10-10 10:25:46 -0500 | [diff] [blame] | 10 | * For conditions of distribution and use, see the accompanying README.ijg |
| 11 | * file. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 12 | * |
| 13 | * This file contains code for merged upsampling/color conversion. |
| 14 | * |
| 15 | * This file combines functions from jdsample.c and jdcolor.c; |
| 16 | * read those files first to understand what's going on. |
| 17 | * |
| 18 | * When the chroma components are to be upsampled by simple replication |
| 19 | * (ie, box filtering), we can save some work in color conversion by |
| 20 | * calculating all the output pixels corresponding to a pair of chroma |
| 21 | * samples at one time. In the conversion equations |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 22 | * R = Y + K1 * Cr |
| 23 | * G = Y + K2 * Cb + K3 * Cr |
| 24 | * B = Y + K4 * Cb |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 25 | * only the Y term varies among the group of pixels corresponding to a pair |
| 26 | * of chroma samples, so the rest of the terms can be calculated just once. |
| 27 | * At typical sampling ratios, this eliminates half or three-quarters of the |
| 28 | * multiplications needed for color conversion. |
| 29 | * |
| 30 | * This file currently provides implementations for the following cases: |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 31 | * YCbCr => RGB color conversion only. |
| 32 | * Sampling ratios of 2h1v or 2h2v. |
| 33 | * No scaling needed at upsample time. |
| 34 | * Corner-aligned (non-CCIR601) sampling alignment. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 35 | * Other special cases could be added, but in most applications these are |
| 36 | * the only common cases. (For uncommon cases we fall back on the more |
| 37 | * general code in jdsample.c and jdcolor.c.) |
| 38 | */ |
| 39 | |
| 40 | #define JPEG_INTERNALS |
| 41 | #include "jinclude.h" |
| 42 | #include "jpeglib.h" |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 43 | #include "jsimd.h" |
DRC | ff6961f | 2014-04-20 09:17:11 +0000 | [diff] [blame] | 44 | #include "jconfigint.h" |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 45 | |
| 46 | #ifdef UPSAMPLE_MERGING_SUPPORTED |
| 47 | |
| 48 | |
| 49 | /* Private subobject */ |
| 50 | |
| 51 | typedef struct { |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 52 | struct jpeg_upsampler pub; /* public fields */ |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 53 | |
| 54 | /* Pointer to routine to do actual upsampling/conversion of one row group */ |
DRC | bc56b75 | 2014-05-16 10:43:44 +0000 | [diff] [blame] | 55 | void (*upmethod) (j_decompress_ptr cinfo, JSAMPIMAGE input_buf, |
| 56 | JDIMENSION in_row_group_ctr, JSAMPARRAY output_buf); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 57 | |
| 58 | /* Private state for YCC->RGB conversion */ |
DRC | bd49803 | 2016-02-19 08:53:33 -0600 | [diff] [blame^] | 59 | int *Cr_r_tab; /* => table for Cr to R conversion */ |
| 60 | int *Cb_b_tab; /* => table for Cb to B conversion */ |
| 61 | JLONG *Cr_g_tab; /* => table for Cr to G conversion */ |
| 62 | JLONG *Cb_g_tab; /* => table for Cb to G conversion */ |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 63 | |
| 64 | /* For 2:1 vertical sampling, we produce two output rows at a time. |
| 65 | * We need a "spare" row buffer to hold the second output row if the |
| 66 | * application provides just a one-row buffer; we also use the spare |
| 67 | * to discard the dummy last row if the image height is odd. |
| 68 | */ |
| 69 | JSAMPROW spare_row; |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 70 | boolean spare_full; /* T if spare buffer is occupied */ |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 71 | |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 72 | JDIMENSION out_row_width; /* samples per output row */ |
| 73 | JDIMENSION rows_to_go; /* counts rows remaining in image */ |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 74 | } my_upsampler; |
| 75 | |
DRC | bd49803 | 2016-02-19 08:53:33 -0600 | [diff] [blame^] | 76 | typedef my_upsampler *my_upsample_ptr; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 77 | |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 78 | #define SCALEBITS 16 /* speediest right-shift on some machines */ |
DRC | 1e32fe3 | 2015-10-14 17:32:39 -0500 | [diff] [blame] | 79 | #define ONE_HALF ((JLONG) 1 << (SCALEBITS-1)) |
| 80 | #define FIX(x) ((JLONG) ((x) * (1L<<SCALEBITS) + 0.5)) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 81 | |
| 82 | |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 83 | /* Include inline routines for colorspace extensions */ |
| 84 | |
| 85 | #include "jdmrgext.c" |
| 86 | #undef RGB_RED |
| 87 | #undef RGB_GREEN |
| 88 | #undef RGB_BLUE |
| 89 | #undef RGB_PIXELSIZE |
| 90 | |
| 91 | #define RGB_RED EXT_RGB_RED |
| 92 | #define RGB_GREEN EXT_RGB_GREEN |
| 93 | #define RGB_BLUE EXT_RGB_BLUE |
| 94 | #define RGB_PIXELSIZE EXT_RGB_PIXELSIZE |
| 95 | #define h2v1_merged_upsample_internal extrgb_h2v1_merged_upsample_internal |
| 96 | #define h2v2_merged_upsample_internal extrgb_h2v2_merged_upsample_internal |
| 97 | #include "jdmrgext.c" |
| 98 | #undef RGB_RED |
| 99 | #undef RGB_GREEN |
| 100 | #undef RGB_BLUE |
| 101 | #undef RGB_PIXELSIZE |
| 102 | #undef h2v1_merged_upsample_internal |
| 103 | #undef h2v2_merged_upsample_internal |
| 104 | |
| 105 | #define RGB_RED EXT_RGBX_RED |
| 106 | #define RGB_GREEN EXT_RGBX_GREEN |
| 107 | #define RGB_BLUE EXT_RGBX_BLUE |
DRC | cac1051 | 2012-03-16 14:37:36 +0000 | [diff] [blame] | 108 | #define RGB_ALPHA 3 |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 109 | #define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE |
| 110 | #define h2v1_merged_upsample_internal extrgbx_h2v1_merged_upsample_internal |
| 111 | #define h2v2_merged_upsample_internal extrgbx_h2v2_merged_upsample_internal |
| 112 | #include "jdmrgext.c" |
| 113 | #undef RGB_RED |
| 114 | #undef RGB_GREEN |
| 115 | #undef RGB_BLUE |
DRC | cac1051 | 2012-03-16 14:37:36 +0000 | [diff] [blame] | 116 | #undef RGB_ALPHA |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 117 | #undef RGB_PIXELSIZE |
| 118 | #undef h2v1_merged_upsample_internal |
| 119 | #undef h2v2_merged_upsample_internal |
| 120 | |
| 121 | #define RGB_RED EXT_BGR_RED |
| 122 | #define RGB_GREEN EXT_BGR_GREEN |
| 123 | #define RGB_BLUE EXT_BGR_BLUE |
| 124 | #define RGB_PIXELSIZE EXT_BGR_PIXELSIZE |
| 125 | #define h2v1_merged_upsample_internal extbgr_h2v1_merged_upsample_internal |
| 126 | #define h2v2_merged_upsample_internal extbgr_h2v2_merged_upsample_internal |
| 127 | #include "jdmrgext.c" |
| 128 | #undef RGB_RED |
| 129 | #undef RGB_GREEN |
| 130 | #undef RGB_BLUE |
| 131 | #undef RGB_PIXELSIZE |
| 132 | #undef h2v1_merged_upsample_internal |
| 133 | #undef h2v2_merged_upsample_internal |
| 134 | |
| 135 | #define RGB_RED EXT_BGRX_RED |
| 136 | #define RGB_GREEN EXT_BGRX_GREEN |
| 137 | #define RGB_BLUE EXT_BGRX_BLUE |
DRC | cac1051 | 2012-03-16 14:37:36 +0000 | [diff] [blame] | 138 | #define RGB_ALPHA 3 |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 139 | #define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE |
| 140 | #define h2v1_merged_upsample_internal extbgrx_h2v1_merged_upsample_internal |
| 141 | #define h2v2_merged_upsample_internal extbgrx_h2v2_merged_upsample_internal |
| 142 | #include "jdmrgext.c" |
| 143 | #undef RGB_RED |
| 144 | #undef RGB_GREEN |
| 145 | #undef RGB_BLUE |
DRC | cac1051 | 2012-03-16 14:37:36 +0000 | [diff] [blame] | 146 | #undef RGB_ALPHA |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 147 | #undef RGB_PIXELSIZE |
| 148 | #undef h2v1_merged_upsample_internal |
| 149 | #undef h2v2_merged_upsample_internal |
| 150 | |
| 151 | #define RGB_RED EXT_XBGR_RED |
| 152 | #define RGB_GREEN EXT_XBGR_GREEN |
| 153 | #define RGB_BLUE EXT_XBGR_BLUE |
DRC | cac1051 | 2012-03-16 14:37:36 +0000 | [diff] [blame] | 154 | #define RGB_ALPHA 0 |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 155 | #define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE |
| 156 | #define h2v1_merged_upsample_internal extxbgr_h2v1_merged_upsample_internal |
| 157 | #define h2v2_merged_upsample_internal extxbgr_h2v2_merged_upsample_internal |
| 158 | #include "jdmrgext.c" |
| 159 | #undef RGB_RED |
| 160 | #undef RGB_GREEN |
| 161 | #undef RGB_BLUE |
DRC | cac1051 | 2012-03-16 14:37:36 +0000 | [diff] [blame] | 162 | #undef RGB_ALPHA |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 163 | #undef RGB_PIXELSIZE |
| 164 | #undef h2v1_merged_upsample_internal |
| 165 | #undef h2v2_merged_upsample_internal |
| 166 | |
| 167 | #define RGB_RED EXT_XRGB_RED |
| 168 | #define RGB_GREEN EXT_XRGB_GREEN |
| 169 | #define RGB_BLUE EXT_XRGB_BLUE |
DRC | cac1051 | 2012-03-16 14:37:36 +0000 | [diff] [blame] | 170 | #define RGB_ALPHA 0 |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 171 | #define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE |
| 172 | #define h2v1_merged_upsample_internal extxrgb_h2v1_merged_upsample_internal |
| 173 | #define h2v2_merged_upsample_internal extxrgb_h2v2_merged_upsample_internal |
| 174 | #include "jdmrgext.c" |
| 175 | #undef RGB_RED |
| 176 | #undef RGB_GREEN |
| 177 | #undef RGB_BLUE |
DRC | cac1051 | 2012-03-16 14:37:36 +0000 | [diff] [blame] | 178 | #undef RGB_ALPHA |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 179 | #undef RGB_PIXELSIZE |
| 180 | #undef h2v1_merged_upsample_internal |
| 181 | #undef h2v2_merged_upsample_internal |
| 182 | |
| 183 | |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 184 | /* |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 185 | * Initialize tables for YCC->RGB colorspace conversion. |
| 186 | * This is taken directly from jdcolor.c; see that file for more info. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 187 | */ |
| 188 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 189 | LOCAL(void) |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 190 | build_ycc_rgb_table (j_decompress_ptr cinfo) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 191 | { |
| 192 | my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 193 | int i; |
DRC | 1e32fe3 | 2015-10-14 17:32:39 -0500 | [diff] [blame] | 194 | JLONG x; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 195 | SHIFT_TEMPS |
| 196 | |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 197 | upsample->Cr_r_tab = (int *) |
| 198 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
DRC | 5de454b | 2014-05-18 19:04:03 +0000 | [diff] [blame] | 199 | (MAXJSAMPLE+1) * sizeof(int)); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 200 | upsample->Cb_b_tab = (int *) |
| 201 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
DRC | 5de454b | 2014-05-18 19:04:03 +0000 | [diff] [blame] | 202 | (MAXJSAMPLE+1) * sizeof(int)); |
DRC | 1e32fe3 | 2015-10-14 17:32:39 -0500 | [diff] [blame] | 203 | upsample->Cr_g_tab = (JLONG *) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 204 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
DRC | 1e32fe3 | 2015-10-14 17:32:39 -0500 | [diff] [blame] | 205 | (MAXJSAMPLE+1) * sizeof(JLONG)); |
| 206 | upsample->Cb_g_tab = (JLONG *) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 207 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
DRC | 1e32fe3 | 2015-10-14 17:32:39 -0500 | [diff] [blame] | 208 | (MAXJSAMPLE+1) * sizeof(JLONG)); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 209 | |
Thomas G. Lane | 9ba2f5e | 1994-12-07 00:00:00 +0000 | [diff] [blame] | 210 | for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) { |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 211 | /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */ |
Thomas G. Lane | 9ba2f5e | 1994-12-07 00:00:00 +0000 | [diff] [blame] | 212 | /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */ |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 213 | /* Cr=>R value is nearest int to 1.40200 * x */ |
| 214 | upsample->Cr_r_tab[i] = (int) |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 215 | RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 216 | /* Cb=>B value is nearest int to 1.77200 * x */ |
| 217 | upsample->Cb_b_tab[i] = (int) |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 218 | RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 219 | /* Cr=>G value is scaled-up -0.71414 * x */ |
Thomas G. Lane | 9ba2f5e | 1994-12-07 00:00:00 +0000 | [diff] [blame] | 220 | upsample->Cr_g_tab[i] = (- FIX(0.71414)) * x; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 221 | /* Cb=>G value is scaled-up -0.34414 * x */ |
| 222 | /* We also add in ONE_HALF so that need not do it in inner loop */ |
Thomas G. Lane | 9ba2f5e | 1994-12-07 00:00:00 +0000 | [diff] [blame] | 223 | upsample->Cb_g_tab[i] = (- FIX(0.34414)) * x + ONE_HALF; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 224 | } |
| 225 | } |
| 226 | |
| 227 | |
| 228 | /* |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 229 | * Initialize for an upsampling pass. |
| 230 | */ |
| 231 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 232 | METHODDEF(void) |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 233 | start_pass_merged_upsample (j_decompress_ptr cinfo) |
| 234 | { |
| 235 | my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; |
| 236 | |
| 237 | /* Mark the spare buffer empty */ |
| 238 | upsample->spare_full = FALSE; |
| 239 | /* Initialize total-height counter for detecting bottom of image */ |
| 240 | upsample->rows_to_go = cinfo->output_height; |
| 241 | } |
| 242 | |
| 243 | |
| 244 | /* |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 245 | * Control routine to do upsampling (and color conversion). |
| 246 | * |
| 247 | * The control routine just handles the row buffering considerations. |
| 248 | */ |
| 249 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 250 | METHODDEF(void) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 251 | merged_2v_upsample (j_decompress_ptr cinfo, |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 252 | JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, |
| 253 | JDIMENSION in_row_groups_avail, |
| 254 | JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, |
| 255 | JDIMENSION out_rows_avail) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 256 | /* 2:1 vertical sampling case: may need a spare row. */ |
| 257 | { |
| 258 | my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; |
| 259 | JSAMPROW work_ptrs[2]; |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 260 | JDIMENSION num_rows; /* number of rows returned to caller */ |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 261 | |
| 262 | if (upsample->spare_full) { |
| 263 | /* If we have a spare row saved from a previous cycle, just return it. */ |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 264 | JDIMENSION size = upsample->out_row_width; |
| 265 | if (cinfo->out_color_space == JCS_RGB565) |
| 266 | size = cinfo->output_width * 2; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 267 | jcopy_sample_rows(& upsample->spare_row, 0, output_buf + *out_row_ctr, 0, |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 268 | 1, size); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 269 | num_rows = 1; |
| 270 | upsample->spare_full = FALSE; |
| 271 | } else { |
| 272 | /* Figure number of rows to return to caller. */ |
| 273 | num_rows = 2; |
| 274 | /* Not more than the distance to the end of the image. */ |
| 275 | if (num_rows > upsample->rows_to_go) |
| 276 | num_rows = upsample->rows_to_go; |
| 277 | /* And not more than what the client can accept: */ |
| 278 | out_rows_avail -= *out_row_ctr; |
| 279 | if (num_rows > out_rows_avail) |
| 280 | num_rows = out_rows_avail; |
| 281 | /* Create output pointer array for upsampler. */ |
| 282 | work_ptrs[0] = output_buf[*out_row_ctr]; |
| 283 | if (num_rows > 1) { |
| 284 | work_ptrs[1] = output_buf[*out_row_ctr + 1]; |
| 285 | } else { |
| 286 | work_ptrs[1] = upsample->spare_row; |
| 287 | upsample->spare_full = TRUE; |
| 288 | } |
| 289 | /* Now do the upsampling. */ |
| 290 | (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs); |
| 291 | } |
| 292 | |
| 293 | /* Adjust counts */ |
| 294 | *out_row_ctr += num_rows; |
| 295 | upsample->rows_to_go -= num_rows; |
| 296 | /* When the buffer is emptied, declare this input row group consumed */ |
| 297 | if (! upsample->spare_full) |
| 298 | (*in_row_group_ctr)++; |
| 299 | } |
| 300 | |
| 301 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 302 | METHODDEF(void) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 303 | merged_1v_upsample (j_decompress_ptr cinfo, |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 304 | JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, |
| 305 | JDIMENSION in_row_groups_avail, |
| 306 | JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, |
| 307 | JDIMENSION out_rows_avail) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 308 | /* 1:1 vertical sampling case: much easier, never need a spare row. */ |
| 309 | { |
| 310 | my_upsample_ptr upsample = (my_upsample_ptr) cinfo->upsample; |
| 311 | |
| 312 | /* Just do the upsampling. */ |
| 313 | (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 314 | output_buf + *out_row_ctr); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 315 | /* Adjust counts */ |
| 316 | (*out_row_ctr)++; |
| 317 | (*in_row_group_ctr)++; |
| 318 | } |
| 319 | |
| 320 | |
| 321 | /* |
| 322 | * These are the routines invoked by the control routines to do |
| 323 | * the actual upsampling/conversion. One row group is processed per call. |
| 324 | * |
| 325 | * Note: since we may be writing directly into application-supplied buffers, |
| 326 | * we have to be honest about the output width; we can't assume the buffer |
| 327 | * has been rounded up to an even width. |
| 328 | */ |
| 329 | |
| 330 | |
| 331 | /* |
| 332 | * Upsample and color convert for the case of 2:1 horizontal and 1:1 vertical. |
| 333 | */ |
| 334 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 335 | METHODDEF(void) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 336 | h2v1_merged_upsample (j_decompress_ptr cinfo, |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 337 | JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, |
| 338 | JSAMPARRAY output_buf) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 339 | { |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 340 | switch (cinfo->out_color_space) { |
| 341 | case JCS_EXT_RGB: |
| 342 | extrgb_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 343 | output_buf); |
| 344 | break; |
| 345 | case JCS_EXT_RGBX: |
DRC | 67ce3b2 | 2011-12-19 02:21:03 +0000 | [diff] [blame] | 346 | case JCS_EXT_RGBA: |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 347 | extrgbx_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 348 | output_buf); |
| 349 | break; |
| 350 | case JCS_EXT_BGR: |
| 351 | extbgr_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 352 | output_buf); |
| 353 | break; |
| 354 | case JCS_EXT_BGRX: |
DRC | 67ce3b2 | 2011-12-19 02:21:03 +0000 | [diff] [blame] | 355 | case JCS_EXT_BGRA: |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 356 | extbgrx_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 357 | output_buf); |
| 358 | break; |
| 359 | case JCS_EXT_XBGR: |
DRC | 67ce3b2 | 2011-12-19 02:21:03 +0000 | [diff] [blame] | 360 | case JCS_EXT_ABGR: |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 361 | extxbgr_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 362 | output_buf); |
| 363 | break; |
| 364 | case JCS_EXT_XRGB: |
DRC | 67ce3b2 | 2011-12-19 02:21:03 +0000 | [diff] [blame] | 365 | case JCS_EXT_ARGB: |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 366 | extxrgb_h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 367 | output_buf); |
| 368 | break; |
| 369 | default: |
| 370 | h2v1_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 371 | output_buf); |
| 372 | break; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 373 | } |
| 374 | } |
| 375 | |
| 376 | |
| 377 | /* |
| 378 | * Upsample and color convert for the case of 2:1 horizontal and 2:1 vertical. |
| 379 | */ |
| 380 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 381 | METHODDEF(void) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 382 | h2v2_merged_upsample (j_decompress_ptr cinfo, |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 383 | JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, |
| 384 | JSAMPARRAY output_buf) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 385 | { |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 386 | switch (cinfo->out_color_space) { |
| 387 | case JCS_EXT_RGB: |
| 388 | extrgb_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 389 | output_buf); |
| 390 | break; |
| 391 | case JCS_EXT_RGBX: |
DRC | 67ce3b2 | 2011-12-19 02:21:03 +0000 | [diff] [blame] | 392 | case JCS_EXT_RGBA: |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 393 | extrgbx_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 394 | output_buf); |
| 395 | break; |
| 396 | case JCS_EXT_BGR: |
| 397 | extbgr_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 398 | output_buf); |
| 399 | break; |
| 400 | case JCS_EXT_BGRX: |
DRC | 67ce3b2 | 2011-12-19 02:21:03 +0000 | [diff] [blame] | 401 | case JCS_EXT_BGRA: |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 402 | extbgrx_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 403 | output_buf); |
| 404 | break; |
| 405 | case JCS_EXT_XBGR: |
DRC | 67ce3b2 | 2011-12-19 02:21:03 +0000 | [diff] [blame] | 406 | case JCS_EXT_ABGR: |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 407 | extxbgr_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 408 | output_buf); |
| 409 | break; |
| 410 | case JCS_EXT_XRGB: |
DRC | 67ce3b2 | 2011-12-19 02:21:03 +0000 | [diff] [blame] | 411 | case JCS_EXT_ARGB: |
DRC | b4570bb | 2011-09-07 06:31:00 +0000 | [diff] [blame] | 412 | extxrgb_h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 413 | output_buf); |
| 414 | break; |
| 415 | default: |
| 416 | h2v2_merged_upsample_internal(cinfo, input_buf, in_row_group_ctr, |
| 417 | output_buf); |
| 418 | break; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 419 | } |
| 420 | } |
| 421 | |
| 422 | |
DRC | 72a3cc0 | 2014-08-30 20:37:50 +0000 | [diff] [blame] | 423 | /* |
| 424 | * RGB565 conversion |
| 425 | */ |
| 426 | |
| 427 | #define PACK_SHORT_565_LE(r, g, b) ((((r) << 8) & 0xF800) | \ |
| 428 | (((g) << 3) & 0x7E0) | ((b) >> 3)) |
| 429 | #define PACK_SHORT_565_BE(r, g, b) (((r) & 0xF8) | ((g) >> 5) | \ |
| 430 | (((g) << 11) & 0xE000) | \ |
| 431 | (((b) << 5) & 0x1F00)) |
| 432 | |
| 433 | #define PACK_TWO_PIXELS_LE(l, r) ((r << 16) | l) |
| 434 | #define PACK_TWO_PIXELS_BE(l, r) ((l << 16) | r) |
| 435 | |
| 436 | #define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3) |
| 437 | |
| 438 | #define WRITE_TWO_PIXELS_LE(addr, pixels) { \ |
DRC | aa769fe | 2015-10-15 02:25:00 -0500 | [diff] [blame] | 439 | ((INT16*)(addr))[0] = (INT16)(pixels); \ |
| 440 | ((INT16*)(addr))[1] = (INT16)((pixels) >> 16); \ |
DRC | 72a3cc0 | 2014-08-30 20:37:50 +0000 | [diff] [blame] | 441 | } |
| 442 | #define WRITE_TWO_PIXELS_BE(addr, pixels) { \ |
DRC | aa769fe | 2015-10-15 02:25:00 -0500 | [diff] [blame] | 443 | ((INT16*)(addr))[1] = (INT16)(pixels); \ |
| 444 | ((INT16*)(addr))[0] = (INT16)((pixels) >> 16); \ |
DRC | 72a3cc0 | 2014-08-30 20:37:50 +0000 | [diff] [blame] | 445 | } |
| 446 | |
DRC | 72a3cc0 | 2014-08-30 20:37:50 +0000 | [diff] [blame] | 447 | #define DITHER_565_R(r, dither) ((r) + ((dither) & 0xFF)) |
| 448 | #define DITHER_565_G(g, dither) ((g) + (((dither) & 0xFF) >> 1)) |
| 449 | #define DITHER_565_B(b, dither) ((b) + ((dither) & 0xFF)) |
| 450 | |
| 451 | |
| 452 | /* Declarations for ordered dithering |
| 453 | * |
| 454 | * We use a 4x4 ordered dither array packed into 32 bits. This array is |
| 455 | * sufficent for dithering RGB888 to RGB565. |
| 456 | */ |
| 457 | |
| 458 | #define DITHER_MASK 0x3 |
DRC | d65e768 | 2015-10-14 22:26:25 -0500 | [diff] [blame] | 459 | #define DITHER_ROTATE(x) ((((x) & 0xFF) << 24) | (((x) >> 8) & 0x00FFFFFF)) |
DRC | 1e32fe3 | 2015-10-14 17:32:39 -0500 | [diff] [blame] | 460 | static const JLONG dither_matrix[4] = { |
DRC | 72a3cc0 | 2014-08-30 20:37:50 +0000 | [diff] [blame] | 461 | 0x0008020A, |
| 462 | 0x0C040E06, |
| 463 | 0x030B0109, |
| 464 | 0x0F070D05 |
| 465 | }; |
| 466 | |
| 467 | |
| 468 | /* Include inline routines for RGB565 conversion */ |
| 469 | |
| 470 | #define PACK_SHORT_565 PACK_SHORT_565_LE |
| 471 | #define PACK_TWO_PIXELS PACK_TWO_PIXELS_LE |
| 472 | #define WRITE_TWO_PIXELS WRITE_TWO_PIXELS_LE |
| 473 | #define h2v1_merged_upsample_565_internal h2v1_merged_upsample_565_le |
| 474 | #define h2v1_merged_upsample_565D_internal h2v1_merged_upsample_565D_le |
| 475 | #define h2v2_merged_upsample_565_internal h2v2_merged_upsample_565_le |
| 476 | #define h2v2_merged_upsample_565D_internal h2v2_merged_upsample_565D_le |
| 477 | #include "jdmrg565.c" |
| 478 | #undef PACK_SHORT_565 |
| 479 | #undef PACK_TWO_PIXELS |
| 480 | #undef WRITE_TWO_PIXELS |
| 481 | #undef h2v1_merged_upsample_565_internal |
| 482 | #undef h2v1_merged_upsample_565D_internal |
| 483 | #undef h2v2_merged_upsample_565_internal |
| 484 | #undef h2v2_merged_upsample_565D_internal |
| 485 | |
| 486 | #define PACK_SHORT_565 PACK_SHORT_565_BE |
| 487 | #define PACK_TWO_PIXELS PACK_TWO_PIXELS_BE |
| 488 | #define WRITE_TWO_PIXELS WRITE_TWO_PIXELS_BE |
| 489 | #define h2v1_merged_upsample_565_internal h2v1_merged_upsample_565_be |
| 490 | #define h2v1_merged_upsample_565D_internal h2v1_merged_upsample_565D_be |
| 491 | #define h2v2_merged_upsample_565_internal h2v2_merged_upsample_565_be |
| 492 | #define h2v2_merged_upsample_565D_internal h2v2_merged_upsample_565D_be |
| 493 | #include "jdmrg565.c" |
| 494 | #undef PACK_SHORT_565 |
| 495 | #undef PACK_TWO_PIXELS |
| 496 | #undef WRITE_TWO_PIXELS |
| 497 | #undef h2v1_merged_upsample_565_internal |
| 498 | #undef h2v1_merged_upsample_565D_internal |
| 499 | #undef h2v2_merged_upsample_565_internal |
| 500 | #undef h2v2_merged_upsample_565D_internal |
| 501 | |
| 502 | |
| 503 | static INLINE boolean is_big_endian(void) |
| 504 | { |
| 505 | int test_value = 1; |
| 506 | if(*(char *)&test_value != 1) |
| 507 | return TRUE; |
| 508 | return FALSE; |
| 509 | } |
| 510 | |
| 511 | |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 512 | METHODDEF(void) |
| 513 | h2v1_merged_upsample_565 (j_decompress_ptr cinfo, |
| 514 | JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, |
| 515 | JSAMPARRAY output_buf) |
| 516 | { |
DRC | 72a3cc0 | 2014-08-30 20:37:50 +0000 | [diff] [blame] | 517 | if (is_big_endian()) |
| 518 | h2v1_merged_upsample_565_be(cinfo, input_buf, in_row_group_ctr, |
| 519 | output_buf); |
| 520 | else |
| 521 | h2v1_merged_upsample_565_le(cinfo, input_buf, in_row_group_ctr, |
| 522 | output_buf); |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 523 | } |
| 524 | |
| 525 | |
| 526 | METHODDEF(void) |
| 527 | h2v1_merged_upsample_565D (j_decompress_ptr cinfo, |
| 528 | JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, |
| 529 | JSAMPARRAY output_buf) |
| 530 | { |
DRC | 72a3cc0 | 2014-08-30 20:37:50 +0000 | [diff] [blame] | 531 | if (is_big_endian()) |
| 532 | h2v1_merged_upsample_565D_be(cinfo, input_buf, in_row_group_ctr, |
| 533 | output_buf); |
| 534 | else |
| 535 | h2v1_merged_upsample_565D_le(cinfo, input_buf, in_row_group_ctr, |
| 536 | output_buf); |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 537 | } |
| 538 | |
| 539 | |
| 540 | METHODDEF(void) |
| 541 | h2v2_merged_upsample_565 (j_decompress_ptr cinfo, |
| 542 | JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, |
| 543 | JSAMPARRAY output_buf) |
| 544 | { |
DRC | 72a3cc0 | 2014-08-30 20:37:50 +0000 | [diff] [blame] | 545 | if (is_big_endian()) |
| 546 | h2v2_merged_upsample_565_be(cinfo, input_buf, in_row_group_ctr, |
| 547 | output_buf); |
| 548 | else |
| 549 | h2v2_merged_upsample_565_le(cinfo, input_buf, in_row_group_ctr, |
| 550 | output_buf); |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 551 | } |
| 552 | |
| 553 | |
| 554 | METHODDEF(void) |
| 555 | h2v2_merged_upsample_565D (j_decompress_ptr cinfo, |
| 556 | JSAMPIMAGE input_buf, JDIMENSION in_row_group_ctr, |
| 557 | JSAMPARRAY output_buf) |
| 558 | { |
DRC | 72a3cc0 | 2014-08-30 20:37:50 +0000 | [diff] [blame] | 559 | if (is_big_endian()) |
| 560 | h2v2_merged_upsample_565D_be(cinfo, input_buf, in_row_group_ctr, |
| 561 | output_buf); |
| 562 | else |
| 563 | h2v2_merged_upsample_565D_le(cinfo, input_buf, in_row_group_ctr, |
| 564 | output_buf); |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 565 | } |
| 566 | |
| 567 | |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 568 | /* |
| 569 | * Module initialization routine for merged upsampling/color conversion. |
| 570 | * |
| 571 | * NB: this is called under the conditions determined by use_merged_upsample() |
| 572 | * in jdmaster.c. That routine MUST correspond to the actual capabilities |
| 573 | * of this module; no safety checks are made here. |
| 574 | */ |
| 575 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 576 | GLOBAL(void) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 577 | jinit_merged_upsampler (j_decompress_ptr cinfo) |
| 578 | { |
| 579 | my_upsample_ptr upsample; |
| 580 | |
| 581 | upsample = (my_upsample_ptr) |
| 582 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
DRC | 5de454b | 2014-05-18 19:04:03 +0000 | [diff] [blame] | 583 | sizeof(my_upsampler)); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 584 | cinfo->upsample = (struct jpeg_upsampler *) upsample; |
| 585 | upsample->pub.start_pass = start_pass_merged_upsample; |
| 586 | upsample->pub.need_context_rows = FALSE; |
| 587 | |
| 588 | upsample->out_row_width = cinfo->output_width * cinfo->out_color_components; |
| 589 | |
| 590 | if (cinfo->max_v_samp_factor == 2) { |
| 591 | upsample->pub.upsample = merged_2v_upsample; |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 592 | if (jsimd_can_h2v2_merged_upsample()) |
| 593 | upsample->upmethod = jsimd_h2v2_merged_upsample; |
| 594 | else |
| 595 | upsample->upmethod = h2v2_merged_upsample; |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 596 | if (cinfo->out_color_space == JCS_RGB565) { |
| 597 | if (cinfo->dither_mode != JDITHER_NONE) { |
| 598 | upsample->upmethod = h2v2_merged_upsample_565D; |
| 599 | } else { |
| 600 | upsample->upmethod = h2v2_merged_upsample_565; |
| 601 | } |
| 602 | } |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 603 | /* Allocate a spare row buffer */ |
| 604 | upsample->spare_row = (JSAMPROW) |
| 605 | (*cinfo->mem->alloc_large) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
DRC | 5de454b | 2014-05-18 19:04:03 +0000 | [diff] [blame] | 606 | (size_t) (upsample->out_row_width * sizeof(JSAMPLE))); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 607 | } else { |
| 608 | upsample->pub.upsample = merged_1v_upsample; |
Pierre Ossman | 59a3938 | 2009-03-09 13:15:56 +0000 | [diff] [blame] | 609 | if (jsimd_can_h2v1_merged_upsample()) |
| 610 | upsample->upmethod = jsimd_h2v1_merged_upsample; |
| 611 | else |
| 612 | upsample->upmethod = h2v1_merged_upsample; |
DRC | 78df2e6 | 2014-05-12 09:23:57 +0000 | [diff] [blame] | 613 | if (cinfo->out_color_space == JCS_RGB565) { |
| 614 | if (cinfo->dither_mode != JDITHER_NONE) { |
| 615 | upsample->upmethod = h2v1_merged_upsample_565D; |
| 616 | } else { |
| 617 | upsample->upmethod = h2v1_merged_upsample_565; |
| 618 | } |
| 619 | } |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 620 | /* No spare row needed */ |
| 621 | upsample->spare_row = NULL; |
| 622 | } |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 623 | |
| 624 | build_ycc_rgb_table(cinfo); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 625 | } |
| 626 | |
| 627 | #endif /* UPSAMPLE_MERGING_SUPPORTED */ |