| 178 | */ |
| 179 | |
| 180 | LOCAL(void) |
| 181 | transencode_master_selection (j_compress_ptr cinfo, |
| 182 | jvirt_barray_ptr * coef_arrays) |
| 183 | { |
| 184 | /* Do computations that are needed before master selection phase */ |
| 185 | jpeg_calc_trans_dimensions(cinfo); |
| 186 | |
| 187 | /* Initialize master control (includes parameter checking/processing) */ |
| 188 | jinit_c_master_control(cinfo, TRUE /* transcode only */); |
| 189 | |
| 190 | /* Entropy encoding: either Huffman or arithmetic coding. */ |
| 191 | if (cinfo->arith_code) |
| 192 | jinit_arith_encoder(cinfo); |
| 193 | else { |
| 194 | jinit_huff_encoder(cinfo); |
| 195 | } |
| 196 | |
| 197 | /* We need a special coefficient buffer controller. */ |
| 198 | transencode_coef_controller(cinfo, coef_arrays); |
| 199 | |
| 200 | jinit_marker_writer(cinfo); |
| 201 | |
| 202 | /* We can now tell the memory manager to allocate virtual arrays. */ |
| 203 | (*cinfo->mem->realize_virt_arrays) ((j_common_ptr) cinfo); |
| 204 | |
| 205 | /* Write the datastream header (SOI, JFIF) immediately. |
| 206 | * Frame and scan headers are postponed till later. |
| 207 | * This lets application insert special markers after the SOI. |
| 208 | */ |
| 209 | (*cinfo->marker->write_file_header) (cinfo); |
| 210 | } |
| 211 | |
| 212 | |
| 213 | /* |
no test coverage detected