Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 1 | /* |
| 2 | * jcmainct.c |
| 3 | * |
DRC | 5033f3e | 2014-05-18 18:33:44 +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. |
DRC | 5033f3e | 2014-05-18 18:33:44 +0000 | [diff] [blame] | 6 | * It was modified by The libjpeg-turbo Project to include only code relevant |
| 7 | * to libjpeg-turbo. |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 8 | * For conditions of distribution and use, see the accompanying README file. |
| 9 | * |
| 10 | * This file contains the main buffer controller for compression. |
| 11 | * The main buffer lies between the pre-processor and the JPEG |
| 12 | * compressor proper; it holds downsampled data in the JPEG colorspace. |
| 13 | */ |
| 14 | |
| 15 | #define JPEG_INTERNALS |
| 16 | #include "jinclude.h" |
| 17 | #include "jpeglib.h" |
| 18 | |
| 19 | |
| 20 | /* Note: currently, there is no operating mode in which a full-image buffer |
| 21 | * is needed at this step. If there were, that mode could not be used with |
| 22 | * "raw data" input, since this module is bypassed in that case. However, |
| 23 | * we've left the code here for possible use in special applications. |
| 24 | */ |
| 25 | #undef FULL_MAIN_BUFFER_SUPPORTED |
| 26 | |
| 27 | |
| 28 | /* Private buffer controller object */ |
| 29 | |
| 30 | typedef struct { |
| 31 | struct jpeg_c_main_controller pub; /* public fields */ |
| 32 | |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 33 | JDIMENSION cur_iMCU_row; /* number of current iMCU row */ |
| 34 | JDIMENSION rowgroup_ctr; /* counts row groups received in iMCU row */ |
| 35 | boolean suspended; /* remember if we suspended output */ |
| 36 | J_BUF_MODE pass_mode; /* current operating mode */ |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 37 | |
| 38 | /* If using just a strip buffer, this points to the entire set of buffers |
| 39 | * (we allocate one for each component). In the full-image case, this |
| 40 | * points to the currently accessible strips of the virtual arrays. |
| 41 | */ |
| 42 | JSAMPARRAY buffer[MAX_COMPONENTS]; |
| 43 | |
| 44 | #ifdef FULL_MAIN_BUFFER_SUPPORTED |
| 45 | /* If using full-image storage, this array holds pointers to virtual-array |
| 46 | * control blocks for each component. Unused if not full-image storage. |
| 47 | */ |
| 48 | jvirt_sarray_ptr whole_image[MAX_COMPONENTS]; |
| 49 | #endif |
| 50 | } my_main_controller; |
| 51 | |
| 52 | typedef my_main_controller * my_main_ptr; |
| 53 | |
| 54 | |
| 55 | /* Forward declarations */ |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 56 | METHODDEF(void) process_data_simple_main |
DRC | bc56b75 | 2014-05-16 10:43:44 +0000 | [diff] [blame] | 57 | (j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, |
| 58 | JDIMENSION in_rows_avail); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 59 | #ifdef FULL_MAIN_BUFFER_SUPPORTED |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 60 | METHODDEF(void) process_data_buffer_main |
DRC | bc56b75 | 2014-05-16 10:43:44 +0000 | [diff] [blame] | 61 | (j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, |
| 62 | JDIMENSION in_rows_avail); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 63 | #endif |
| 64 | |
| 65 | |
| 66 | /* |
| 67 | * Initialize for a processing pass. |
| 68 | */ |
| 69 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 70 | METHODDEF(void) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 71 | start_pass_main (j_compress_ptr cinfo, J_BUF_MODE pass_mode) |
| 72 | { |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 73 | my_main_ptr main_ptr = (my_main_ptr) cinfo->main; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 74 | |
| 75 | /* Do nothing in raw-data mode. */ |
| 76 | if (cinfo->raw_data_in) |
| 77 | return; |
| 78 | |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 79 | main_ptr->cur_iMCU_row = 0; /* initialize counters */ |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 80 | main_ptr->rowgroup_ctr = 0; |
| 81 | main_ptr->suspended = FALSE; |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 82 | main_ptr->pass_mode = pass_mode; /* save mode for use by process_data */ |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 83 | |
| 84 | switch (pass_mode) { |
| 85 | case JBUF_PASS_THRU: |
| 86 | #ifdef FULL_MAIN_BUFFER_SUPPORTED |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 87 | if (main_ptr->whole_image[0] != NULL) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 88 | ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); |
| 89 | #endif |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 90 | main_ptr->pub.process_data = process_data_simple_main; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 91 | break; |
| 92 | #ifdef FULL_MAIN_BUFFER_SUPPORTED |
| 93 | case JBUF_SAVE_SOURCE: |
| 94 | case JBUF_CRANK_DEST: |
| 95 | case JBUF_SAVE_AND_PASS: |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 96 | if (main_ptr->whole_image[0] == NULL) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 97 | ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 98 | main_ptr->pub.process_data = process_data_buffer_main; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 99 | break; |
| 100 | #endif |
| 101 | default: |
| 102 | ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); |
| 103 | break; |
| 104 | } |
| 105 | } |
| 106 | |
| 107 | |
| 108 | /* |
| 109 | * Process some data. |
| 110 | * This routine handles the simple pass-through mode, |
| 111 | * where we have only a strip buffer. |
| 112 | */ |
| 113 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 114 | METHODDEF(void) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 115 | process_data_simple_main (j_compress_ptr cinfo, |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 116 | JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, |
| 117 | JDIMENSION in_rows_avail) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 118 | { |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 119 | my_main_ptr main_ptr = (my_main_ptr) cinfo->main; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 120 | |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 121 | while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) { |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 122 | /* Read input data if we haven't filled the main buffer yet */ |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 123 | if (main_ptr->rowgroup_ctr < DCTSIZE) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 124 | (*cinfo->prep->pre_process_data) (cinfo, |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 125 | input_buf, in_row_ctr, in_rows_avail, |
| 126 | main_ptr->buffer, &main_ptr->rowgroup_ctr, |
| 127 | (JDIMENSION) DCTSIZE); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 128 | |
| 129 | /* If we don't have a full iMCU row buffered, return to application for |
| 130 | * more data. Note that preprocessor will always pad to fill the iMCU row |
| 131 | * at the bottom of the image. |
| 132 | */ |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 133 | if (main_ptr->rowgroup_ctr != DCTSIZE) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 134 | return; |
| 135 | |
| 136 | /* Send the completed row to the compressor */ |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 137 | if (! (*cinfo->coef->compress_data) (cinfo, main_ptr->buffer)) { |
Thomas G. Lane | a8b67c4 | 1995-03-15 00:00:00 +0000 | [diff] [blame] | 138 | /* If compressor did not consume the whole row, then we must need to |
| 139 | * suspend processing and return to the application. In this situation |
| 140 | * we pretend we didn't yet consume the last input row; otherwise, if |
| 141 | * it happened to be the last row of the image, the application would |
| 142 | * think we were done. |
| 143 | */ |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 144 | if (! main_ptr->suspended) { |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 145 | (*in_row_ctr)--; |
| 146 | main_ptr->suspended = TRUE; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 147 | } |
| 148 | return; |
| 149 | } |
| 150 | /* We did finish the row. Undo our little suspension hack if a previous |
| 151 | * call suspended; then mark the main buffer empty. |
| 152 | */ |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 153 | if (main_ptr->suspended) { |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 154 | (*in_row_ctr)++; |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 155 | main_ptr->suspended = FALSE; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 156 | } |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 157 | main_ptr->rowgroup_ctr = 0; |
| 158 | main_ptr->cur_iMCU_row++; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 159 | } |
| 160 | } |
| 161 | |
| 162 | |
| 163 | #ifdef FULL_MAIN_BUFFER_SUPPORTED |
| 164 | |
| 165 | /* |
| 166 | * Process some data. |
| 167 | * This routine handles all of the modes that use a full-size buffer. |
| 168 | */ |
| 169 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 170 | METHODDEF(void) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 171 | process_data_buffer_main (j_compress_ptr cinfo, |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 172 | JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, |
| 173 | JDIMENSION in_rows_avail) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 174 | { |
DRC | 2dcd4b5 | 2012-12-01 22:33:54 +0000 | [diff] [blame] | 175 | my_main_ptr main_ptr = (my_main_ptr) cinfo->main; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 176 | int ci; |
| 177 | jpeg_component_info *compptr; |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 178 | boolean writing = (main_ptr->pass_mode != JBUF_CRANK_DEST); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 179 | |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 180 | while (main_ptr->cur_iMCU_row < cinfo->total_iMCU_rows) { |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 181 | /* Realign the virtual buffers if at the start of an iMCU row. */ |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 182 | if (main_ptr->rowgroup_ctr == 0) { |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 183 | for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 184 | ci++, compptr++) { |
| 185 | main_ptr->buffer[ci] = (*cinfo->mem->access_virt_sarray) |
| 186 | ((j_common_ptr) cinfo, main_ptr->whole_image[ci], |
| 187 | main_ptr->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE), |
| 188 | (JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 189 | } |
| 190 | /* In a read pass, pretend we just read some source data. */ |
| 191 | if (! writing) { |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 192 | *in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE; |
| 193 | main_ptr->rowgroup_ctr = DCTSIZE; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 194 | } |
| 195 | } |
| 196 | |
| 197 | /* If a write pass, read input data until the current iMCU row is full. */ |
| 198 | /* Note: preprocessor will pad if necessary to fill the last iMCU row. */ |
| 199 | if (writing) { |
| 200 | (*cinfo->prep->pre_process_data) (cinfo, |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 201 | input_buf, in_row_ctr, in_rows_avail, |
| 202 | main_ptr->buffer, &main_ptr->rowgroup_ctr, |
| 203 | (JDIMENSION) DCTSIZE); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 204 | /* Return to application if we need more data to fill the iMCU row. */ |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 205 | if (main_ptr->rowgroup_ctr < DCTSIZE) |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 206 | return; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 207 | } |
| 208 | |
| 209 | /* Emit data, unless this is a sink-only pass. */ |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 210 | if (main_ptr->pass_mode != JBUF_SAVE_SOURCE) { |
| 211 | if (! (*cinfo->coef->compress_data) (cinfo, main_ptr->buffer)) { |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 212 | /* If compressor did not consume the whole row, then we must need to |
| 213 | * suspend processing and return to the application. In this situation |
| 214 | * we pretend we didn't yet consume the last input row; otherwise, if |
| 215 | * it happened to be the last row of the image, the application would |
| 216 | * think we were done. |
| 217 | */ |
| 218 | if (! main_ptr->suspended) { |
| 219 | (*in_row_ctr)--; |
| 220 | main_ptr->suspended = TRUE; |
| 221 | } |
| 222 | return; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 223 | } |
| 224 | /* We did finish the row. Undo our little suspension hack if a previous |
| 225 | * call suspended; then mark the main buffer empty. |
| 226 | */ |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 227 | if (main_ptr->suspended) { |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 228 | (*in_row_ctr)++; |
| 229 | main_ptr->suspended = FALSE; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 230 | } |
| 231 | } |
| 232 | |
| 233 | /* If get here, we are done with this iMCU row. Mark buffer empty. */ |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 234 | main_ptr->rowgroup_ctr = 0; |
| 235 | main_ptr->cur_iMCU_row++; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 236 | } |
| 237 | } |
| 238 | |
| 239 | #endif /* FULL_MAIN_BUFFER_SUPPORTED */ |
| 240 | |
| 241 | |
| 242 | /* |
| 243 | * Initialize main buffer controller. |
| 244 | */ |
| 245 | |
Thomas G. Lane | 489583f | 1996-02-07 00:00:00 +0000 | [diff] [blame] | 246 | GLOBAL(void) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 247 | jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) |
| 248 | { |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 249 | my_main_ptr main_ptr; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 250 | int ci; |
| 251 | jpeg_component_info *compptr; |
| 252 | |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 253 | main_ptr = (my_main_ptr) |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 254 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, |
DRC | 5de454b | 2014-05-18 19:04:03 +0000 | [diff] [blame^] | 255 | sizeof(my_main_controller)); |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 256 | cinfo->main = (struct jpeg_c_main_controller *) main_ptr; |
| 257 | main_ptr->pub.start_pass = start_pass_main; |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 258 | |
| 259 | /* We don't need to create a buffer in raw-data mode. */ |
| 260 | if (cinfo->raw_data_in) |
| 261 | return; |
| 262 | |
| 263 | /* Create the buffer. It holds downsampled data, so each component |
| 264 | * may be of a different size. |
| 265 | */ |
| 266 | if (need_full_buffer) { |
| 267 | #ifdef FULL_MAIN_BUFFER_SUPPORTED |
| 268 | /* Allocate a full-image virtual array for each component */ |
Thomas G. Lane | bc79e06 | 1995-08-02 00:00:00 +0000 | [diff] [blame] | 269 | /* Note we pad the bottom to a multiple of the iMCU height */ |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 270 | for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 271 | ci++, compptr++) { |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 272 | main_ptr->whole_image[ci] = (*cinfo->mem->request_virt_sarray) |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 273 | ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, |
| 274 | compptr->width_in_blocks * DCTSIZE, |
| 275 | (JDIMENSION) jround_up((long) compptr->height_in_blocks, |
| 276 | (long) compptr->v_samp_factor) * DCTSIZE, |
| 277 | (JDIMENSION) (compptr->v_samp_factor * DCTSIZE)); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 278 | } |
| 279 | #else |
| 280 | ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); |
| 281 | #endif |
| 282 | } else { |
| 283 | #ifdef FULL_MAIN_BUFFER_SUPPORTED |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 284 | main_ptr->whole_image[0] = NULL; /* flag for no virtual arrays */ |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 285 | #endif |
| 286 | /* Allocate a strip buffer for each component */ |
| 287 | for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 288 | ci++, compptr++) { |
DRC | 7ed7b57 | 2012-02-07 22:51:49 +0000 | [diff] [blame] | 289 | main_ptr->buffer[ci] = (*cinfo->mem->alloc_sarray) |
DRC | e5eaf37 | 2014-05-09 18:00:32 +0000 | [diff] [blame] | 290 | ((j_common_ptr) cinfo, JPOOL_IMAGE, |
| 291 | compptr->width_in_blocks * DCTSIZE, |
| 292 | (JDIMENSION) (compptr->v_samp_factor * DCTSIZE)); |
Thomas G. Lane | 36a4ccc | 1994-09-24 00:00:00 +0000 | [diff] [blame] | 293 | } |
| 294 | } |
| 295 | } |