X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2Fjpeg%2Flibijg%2Fjcmainct.c;h=e0cd678a1973884d14ea7bab7e8c51a62cef5037;hb=f54e905ec611e8b342a079355366390bf43fc38b;hp=0b30159f98ef4970688404bb9a9660a9a32a12df;hpb=87a202f23fccef6cdb32e6304cf21ef1b8cd3491;p=gdcm.git diff --git a/src/jpeg/libijg/jcmainct.c b/src/jpeg/libijg/jcmainct.c index 0b30159f..e0cd678a 100644 --- a/src/jpeg/libijg/jcmainct.c +++ b/src/jpeg/libijg/jcmainct.c @@ -1,7 +1,7 @@ /* * jcmainct.c * - * Copyright (C) 1994-1996, Thomas G. Lane. + * Copyright (C) 1994-1998, Thomas G. Lane. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -115,24 +115,25 @@ process_data_simple_main (j_compress_ptr cinfo, JDIMENSION in_rows_avail) { my_main_ptr mainPtr = (my_main_ptr) cinfo->main; + JDIMENSION data_unit = (JDIMENSION)(cinfo->data_unit); while (mainPtr->cur_iMCU_row < cinfo->total_iMCU_rows) { /* Read input data if we haven't filled the main buffer yet */ - if (mainPtr->rowgroup_ctr < DCTSIZE) + if (mainPtr->rowgroup_ctr < data_unit) (*cinfo->prep->pre_process_data) (cinfo, input_buf, in_row_ctr, in_rows_avail, mainPtr->buffer, &mainPtr->rowgroup_ctr, - (JDIMENSION) DCTSIZE); + (JDIMENSION) data_unit); /* If we don't have a full iMCU row buffered, return to application for * more data. Note that preprocessor will always pad to fill the iMCU row * at the bottom of the image. */ - if (mainPtr->rowgroup_ctr != DCTSIZE) + if (mainPtr->rowgroup_ctr != data_unit) return; /* Send the completed row to the compressor */ - if (! (*cinfo->coef->compress_data) (cinfo, mainPtr->buffer)) { + if (! (*cinfo->codec->compress_data) (cinfo, mainPtr->buffer)) { /* If compressor did not consume the whole row, then we must need to * suspend processing and return to the application. In this situation * we pretend we didn't yet consume the last input row; otherwise, if @@ -170,10 +171,11 @@ process_data_buffer_main (j_compress_ptr cinfo, JSAMPARRAY input_buf, JDIMENSION *in_row_ctr, JDIMENSION in_rows_avail) { - my_main_ptr mainPtr = (my_main_ptr) cinfo->main; + my_main_ptr main = (my_main_ptr) cinfo->main; int ci; jpeg_component_info *compptr; boolean writing = (mainPtr->pass_mode != JBUF_CRANK_DEST); + JDIMENSION data_unit = (JDIMENSION)(cinfo->data_unit); while (mainPtr->cur_iMCU_row < cinfo->total_iMCU_rows) { /* Realign the virtual buffers if at the start of an iMCU row. */ @@ -182,13 +184,13 @@ process_data_buffer_main (j_compress_ptr cinfo, ci++, compptr++) { mainPtr->buffer[ci] = (*cinfo->mem->access_virt_sarray) ((j_common_ptr) cinfo, mainPtr->whole_image[ci], - mainPtr->cur_iMCU_row * (compptr->v_samp_factor * DCTSIZE), - (JDIMENSION) (compptr->v_samp_factor * DCTSIZE), writing); + mainPtr->cur_iMCU_row * (compptr->v_samp_factor * data_unit), + (JDIMENSION) (compptr->v_samp_factor * data_unit), writing); } /* In a read pass, pretend we just read some source data. */ if (! writing) { - *in_row_ctr += cinfo->max_v_samp_factor * DCTSIZE; - mainPtr->rowgroup_ctr = DCTSIZE; + *in_row_ctr += cinfo->max_v_samp_factor * data_unit; + mainPtr->rowgroup_ctr = data_unit; } } @@ -198,15 +200,15 @@ process_data_buffer_main (j_compress_ptr cinfo, (*cinfo->prep->pre_process_data) (cinfo, input_buf, in_row_ctr, in_rows_avail, mainPtr->buffer, &mainPtr->rowgroup_ctr, - (JDIMENSION) DCTSIZE); + (JDIMENSION) data_unit); /* Return to application if we need more data to fill the iMCU row. */ - if (mainPtr->rowgroup_ctr < DCTSIZE) + if (mainPtr->rowgroup_ctr < data_unit) return; } /* Emit data, unless this is a sink-only pass. */ if (mainPtr->pass_mode != JBUF_SAVE_SOURCE) { - if (! (*cinfo->coef->compress_data) (cinfo, mainPtr->buffer)) { + if (! (*cinfo->codec->compress_data) (cinfo, mainPtr->buffer)) { /* If compressor did not consume the whole row, then we must need to * suspend processing and return to the application. In this situation * we pretend we didn't yet consume the last input row; otherwise, if @@ -247,6 +249,7 @@ jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) my_main_ptr mainPtr; int ci; jpeg_component_info *compptr; + int data_unit = cinfo->data_unit; mainPtr = (my_main_ptr) (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, @@ -269,10 +272,10 @@ jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) ci++, compptr++) { mainPtr->whole_image[ci] = (*cinfo->mem->request_virt_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE, FALSE, - compptr->width_in_blocks * DCTSIZE, - (JDIMENSION) jround_up((long) compptr->height_in_blocks, - (long) compptr->v_samp_factor) * DCTSIZE, - (JDIMENSION) (compptr->v_samp_factor * DCTSIZE)); + compptr->width_in_data_units * data_unit, + (JDIMENSION) jround_up((long) compptr->height_in_data_units, + (long) compptr->v_samp_factor) * data_unit, + (JDIMENSION) (compptr->v_samp_factor * data_unit)); } #else ERREXIT(cinfo, JERR_BAD_BUFFER_MODE); @@ -286,8 +289,8 @@ jinit_c_main_controller (j_compress_ptr cinfo, boolean need_full_buffer) ci++, compptr++) { mainPtr->buffer[ci] = (*cinfo->mem->alloc_sarray) ((j_common_ptr) cinfo, JPOOL_IMAGE, - compptr->width_in_blocks * DCTSIZE, - (JDIMENSION) (compptr->v_samp_factor * DCTSIZE)); + compptr->width_in_data_units * data_unit, + (JDIMENSION) (compptr->v_samp_factor * data_unit)); } } }