| 156 | |
| 157 | |
| 158 | LOCAL(void) |
| 159 | alloc_funny_pointers (j_decompress_ptr cinfo) |
| 160 | /* Allocate space for the funny pointer lists. |
| 161 | * This is done only once, not once per pass. |
| 162 | */ |
| 163 | { |
| 164 | my_main_ptr mainp = (my_main_ptr) cinfo->main; |
| 165 | int ci, rgroup; |
| 166 | int M = cinfo->min_DCT_v_scaled_size; |
| 167 | jpeg_component_info *compptr; |
| 168 | JSAMPARRAY xbuf; |
| 169 | |
| 170 | /* Get top-level space for component array pointers. |
| 171 | * We alloc both arrays with one call to save a few cycles. |
| 172 | */ |
| 173 | mainp->xbuffer[0] = (JSAMPIMAGE) (*cinfo->mem->alloc_small) |
| 174 | ((j_common_ptr) cinfo, JPOOL_IMAGE, |
| 175 | cinfo->num_components * 2 * SIZEOF(JSAMPARRAY)); |
| 176 | mainp->xbuffer[1] = mainp->xbuffer[0] + cinfo->num_components; |
| 177 | |
| 178 | for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; |
| 179 | ci++, compptr++) { |
| 180 | if (! compptr->component_needed) |
| 181 | continue; /* skip uninteresting component */ |
| 182 | rgroup = (compptr->v_samp_factor * compptr->DCT_v_scaled_size) / |
| 183 | cinfo->min_DCT_v_scaled_size; /* height of a row group of component */ |
| 184 | /* Get space for pointer lists --- M+4 row groups in each list. |
| 185 | * We alloc both pointer lists with one call to save a few cycles. |
| 186 | */ |
| 187 | xbuf = (JSAMPARRAY) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, |
| 188 | JPOOL_IMAGE, 2 * (rgroup * (M + 4)) * SIZEOF(JSAMPROW)); |
| 189 | xbuf += rgroup; /* want one row group at negative offsets */ |
| 190 | mainp->xbuffer[0][ci] = xbuf; |
| 191 | xbuf += rgroup * (M + 4); |
| 192 | mainp->xbuffer[1][ci] = xbuf; |
| 193 | } |
| 194 | } |
| 195 | |
| 196 | |
| 197 | LOCAL(void) |
no outgoing calls
no test coverage detected