static void usage(char *progName)
{
  int i;

  printf("USAGE: %s\n", progName);
  printf("       <Inputfile (BMP|PPM)> <Quality> [options]\n\n");
  printf("       %s\n", progName);
  printf("       <Inputfile (JPG)> [options]\n\n");
  printf("Options:\n\n");
  printf("-alloc = Dynamically allocate JPEG image buffers\n");
  printf("-bmp = Generate output images in Windows Bitmap format (default = PPM)\n");
  printf("-bottomup = Test bottom-up compression/decompression\n");
  printf("-tile = Test performance of the codec when the image is encoded as separate\n");
  printf("     tiles of varying sizes.\n");
  printf("-rgb, -bgr, -rgbx, -bgrx, -xbgr, -xrgb =\n");
  printf("     Test the specified color conversion path in the codec (default = BGR)\n");
  printf("-cmyk = Indirectly test YCCK JPEG compression/decompression (the source\n");
  printf("     and destination bitmaps are still RGB.  The conversion is done\n");
  printf("     internally prior to compression or after decompression.)\n");
  printf("-fastupsample = Use the fastest chrominance upsampling algorithm available in\n");
  printf("     the underlying codec\n");
  printf("-fastdct = Use the fastest DCT/IDCT algorithms available in the underlying\n");
  printf("     codec\n");
  printf("-accuratedct = Use the most accurate DCT/IDCT algorithms available in the\n");
  printf("     underlying codec\n");
  printf("-progressive = Use progressive entropy coding in JPEG images generated by\n");
  printf("     compression and transform operations.\n");
  printf("-subsamp 
 = When testing JPEG compression, this option specifies the level\n");
  printf("     of chrominance subsampling to use (
 = 444, 422, 440, 420, 411, or\n");
  printf("     GRAY).  The default is to test Grayscale, 4:2:0, 4:2:2, and 4:4:4 in\n");
  printf("     sequence.\n");
  printf("-quiet = Output results in tabular rather than verbose format\n");
  printf("-yuv = Test YUV encoding/decoding functions\n");
  printf("-yuvpad <p> = If testing YUV encoding/decoding, this specifies the number of\n");
  printf("     bytes to which each row of each plane in the intermediate YUV image is\n");
  printf("     padded (default = 1)\n");
  printf("-scale M/N = Scale down the width/height of the decompressed JPEG image by a\n");
  printf("     factor of M/N (M/N = ");
  for (i = 0; i < nsf; i++) {
    printf("%d/%d", scalingFactors[i].num, scalingFactors[i].denom);
    if (nsf == 2 && i != nsf - 1) printf(" or ");
    else if (nsf > 2) {
      if (i != nsf - 1) printf(", ");
      if (i == nsf - 2) printf("or ");
    }
    if (i % 8 == 0 && i != 0) printf("\n     ");
  }
  printf(")\n");
  printf("-hflip, -vflip, -transpose, -transverse, -rot90, -rot180, -rot270 =\n");
  printf("     Perform the corresponding lossless transform prior to\n");
  printf("     decompression (these options are mutually exclusive)\n");
  printf("-grayscale = Perform lossless grayscale conversion prior to decompression\n");
  printf("     test (can be combined with the other transforms above)\n");
  printf("-copynone = Do not copy any extra markers (including EXIF and ICC profile data)\n");
  printf("     when transforming the image.\n");
  printf("-benchtime <t> = Run each benchmark for at least <t> seconds (default = 5.0)\n");
  printf("-warmup <t> = Run each benchmark for <t> seconds (default = 1.0) prior to\n");
  printf("     starting the timer, in order to prime the caches and thus improve the\n");
  printf("     consistency of the results.\n");
  printf("-componly = Stop after running compression tests.  Do not test decompression.\n");
  printf("-nowrite = Do not write reference or output images (improves consistency of\n");
  printf("     performance measurements.)\n");
  printf("-stoponwarning = Immediately discontinue the current\n");
  printf("     compression/decompression/transform operation if the underlying codec\n");
  printf("     throws a warning (non-fatal error)\n\n");
  printf("NOTE:  If the quality is specified as a range (e.g. 90-100), a separate\n");
  printf("test will be performed for all quality values in the range.\n\n");
  exit(1);
}