/* 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, (RANGE_CENTER * 2 + MAXJSAMPLE + 1) * SIZEOF(JSAMPLE));
  MEMZERO(table, RANGE_CENTER * SIZEOF(JSAMPLE));
  table += RANGE_CENTER;
  cinfo->sample_range_limit = table;
  for (i = 0; i <= MAXJSAMPLE; i++)
    table[i] = (JSAMPLE) i;
  for (; i <=  MAXJSAMPLE + RANGE_CENTER; i++)
    table[i] = MAXJSAMPLE;
}