/* Note that the table is allocated in near data space on PCs; it's small enough and used often enough to justify this.  */
prepare_range_limit_table(j_decompress_ptr cinfo)
/* Note that the table is allocated in near data space on PCs; it's small enough and used often enough to justify this.  */
prepare_range_limit_table(j_decompress_ptr cinfo)
{
  JSAMPLE * table;
  int i;
  table = (JSAMPLE *)
    (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE,
				5 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
  MEMZERO(table, 2 * (MAXJSAMPLE+1) * SIZEOF(JSAMPLE));
  table += 2 * (MAXJSAMPLE+1);
  cinfo->sample_range_limit = table;
  for (i = 0; i <= MAXJSAMPLE; i++)
    table[i] = (JSAMPLE) i;
  for (; i < 3 * (MAXJSAMPLE+1); i++)
    table[i] = MAXJSAMPLE;
}