/* Process some data in the one-pass (strip buffer) case. This is used for color precision reduction as well as one-pass quantization.  */
post_process_1pass(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
/* Process some data in the one-pass (strip buffer) case. This is used for color precision reduction as well as one-pass quantization.  */
post_process_1pass(j_decompress_ptr cinfo, JSAMPIMAGE input_buf, JDIMENSION *in_row_group_ctr, JDIMENSION in_row_groups_avail, JSAMPARRAY output_buf, JDIMENSION *out_row_ctr, JDIMENSION out_rows_avail)
{
    my_post_ptr post = (my_post_ptr)cinfo->post;
    JDIMENSION num_rows, max_rows;
    max_rows = out_rows_avail - *out_row_ctr;
    if (max_rows > post->strip_height)
        max_rows = post->strip_height;
    num_rows = 0;
    (*cinfo->upsample->upsample) (cinfo,
        input_buf, in_row_group_ctr, in_row_groups_avail,
        post->buffer, &num_rows, max_rows);
    (*cinfo->cquantize->color_quantize) (cinfo,
        post->buffer, output_buf + *out_row_ctr, (int)num_rows);
    *out_row_ctr += num_rows;
}