LLVMFuzzerTestOneInput:
   38|  5.16k|{
   39|  5.16k|  tjhandle handle = NULL;
   40|  5.16k|  unsigned char *dstBuf = NULL;
   41|  5.16k|  int width = 0, height = 0, jpegSubsamp, jpegColorspace, pfi;
   42|       |  /* TJPF_RGB-TJPF_BGR share the same code paths, as do TJPF_RGBX-TJPF_XRGB and
   43|       |     TJPF_RGBA-TJPF_ARGB.  Thus, the pixel formats below should be the minimum
   44|       |     necessary to achieve full coverage. */
   45|  5.16k|  enum TJPF pixelFormats[NUMPF] =
   46|  5.16k|    { TJPF_RGB, TJPF_BGRX, TJPF_GRAY, TJPF_CMYK };
   47|       |#if defined(__has_feature) && __has_feature(memory_sanitizer)
   48|       |  char env[18] = "JSIMD_FORCENONE=1";
   49|       |
   50|       |  /* The libjpeg-turbo SIMD extensions produce false positives with
   51|       |     MemorySanitizer. */
   52|       |  putenv(env);
   53|       |#endif
   54|       |
   55|  5.16k|  if ((handle = tjInitDecompress()) == NULL)
  ------------------
  |  Branch (55:7): [True: 0, False: 5.16k]
  ------------------
   56|      0|    goto bailout;
   57|       |
   58|       |  /* We ignore the return value of tjDecompressHeader3(), because some JPEG
   59|       |     images may have unusual subsampling configurations that the TurboJPEG API
   60|       |     cannot identify but can still decompress. */
   61|  5.16k|  tjDecompressHeader3(handle, data, size, &width, &height, &jpegSubsamp,
   62|  5.16k|                      &jpegColorspace);
   63|       |
   64|       |  /* Ignore 0-pixel images and images larger than 1 Megapixel, as Google's
   65|       |     OSS-Fuzz target for libjpeg-turbo did.  Casting width to (uint64_t)
   66|       |     prevents integer overflow if width * height > INT_MAX. */
   67|  5.16k|  if (width < 1 || height < 1 || (uint64_t)width * height > 1048576)
  ------------------
  |  Branch (67:7): [True: 1.36k, False: 3.80k]
  |  Branch (67:20): [True: 0, False: 3.80k]
  |  Branch (67:34): [True: 67, False: 3.73k]
  ------------------
   68|  1.42k|    goto bailout;
   69|       |
   70|  5.08k|  for (pfi = 0; pfi < NUMPF; pfi++) {
  ------------------
  |  |   34|  5.08k|#define NUMPF  4
  ------------------
  |  Branch (70:17): [True: 5.08k, False: 0]
  ------------------
   71|  5.08k|    int pf = pixelFormats[pfi], flags = TJFLAG_LIMITSCANS, i, sum = 0;
  ------------------
  |  |  435|  5.08k|#define TJFLAG_LIMITSCANS  32768
  ------------------
   72|  5.08k|    int w = width, h = height;
   73|       |
   74|       |    /* Test non-default decompression options on the first iteration. */
   75|  5.08k|    if (pfi == 0)
  ------------------
  |  Branch (75:9): [True: 3.73k, False: 1.34k]
  ------------------
   76|  3.73k|      flags |= TJFLAG_BOTTOMUP | TJFLAG_FASTUPSAMPLE | TJFLAG_FASTDCT;
  ------------------
  |  |  379|  3.73k|#define TJFLAG_BOTTOMUP  2
  ------------------
                    flags |= TJFLAG_BOTTOMUP | TJFLAG_FASTUPSAMPLE | TJFLAG_FASTDCT;
  ------------------
  |  |  387|  3.73k|#define TJFLAG_FASTUPSAMPLE  256
  ------------------
                    flags |= TJFLAG_BOTTOMUP | TJFLAG_FASTUPSAMPLE | TJFLAG_FASTDCT;
  ------------------
  |  |  403|  3.73k|#define TJFLAG_FASTDCT  2048
  ------------------
   77|       |    /* Test IDCT scaling on the second iteration. */
   78|  1.34k|    else if (pfi == 1) {
  ------------------
  |  Branch (78:14): [True: 453, False: 892]
  ------------------
   79|    453|      w = (width + 1) / 2;
   80|    453|      h = (height + 1) / 2;
   81|    453|    }
   82|       |
   83|  5.08k|    if ((dstBuf = (unsigned char *)malloc(w * h * tjPixelSize[pf])) == NULL)
  ------------------
  |  Branch (83:9): [True: 0, False: 5.08k]
  ------------------
   84|      0|      goto bailout;
   85|       |
   86|  5.08k|    if (tjDecompress2(handle, data, size, dstBuf, w, 0, h, pf, flags) == 0) {
  ------------------
  |  Branch (86:9): [True: 1.34k, False: 3.73k]
  ------------------
   87|       |      /* Touch all of the output pixels in order to catch uninitialized reads
   88|       |         when using MemorySanitizer. */
   89|   338M|      for (i = 0; i < w * h * tjPixelSize[pf]; i++)
  ------------------
  |  Branch (89:19): [True: 338M, False: 1.34k]
  ------------------
   90|   338M|        sum += dstBuf[i];
   91|  1.34k|    } else
   92|  3.73k|      goto bailout;
   93|       |
   94|  1.34k|    free(dstBuf);
   95|  1.34k|    dstBuf = NULL;
   96|       |
   97|       |    /* Prevent the code above from being optimized out.  This test should never
   98|       |       be true, but the compiler doesn't know that. */
   99|  1.34k|    if (sum > 255 * 1048576 * tjPixelSize[pf])
  ------------------
  |  Branch (99:9): [True: 0, False: 1.34k]
  ------------------
  100|      0|      goto bailout;
  101|  1.34k|  }
  102|       |
  103|  5.16k|bailout:
  104|  5.16k|  free(dstBuf);
  105|  5.16k|  if (handle) tjDestroy(handle);
  ------------------
  |  Branch (105:7): [True: 5.16k, False: 0]
  ------------------
  106|  5.16k|  return 0;
  107|  3.73k|}

jpeg_abort:
   33|  8.89k|{
   34|  8.89k|  int pool;
   35|       |
   36|       |  /* Do nothing if called on a not-initialized or destroyed JPEG object. */
   37|  8.89k|  if (cinfo->mem == NULL)
  ------------------
  |  Branch (37:7): [True: 0, False: 8.89k]
  ------------------
   38|      0|    return;
   39|       |
   40|       |  /* Releasing pools in reverse order might help avoid fragmentation
   41|       |   * with some (brain-damaged) malloc libraries.
   42|       |   */
   43|  17.7k|  for (pool = JPOOL_NUMPOOLS - 1; pool > JPOOL_PERMANENT; pool--) {
  ------------------
  |  |  827|  8.89k|#define JPOOL_NUMPOOLS   2
  ------------------
                for (pool = JPOOL_NUMPOOLS - 1; pool > JPOOL_PERMANENT; pool--) {
  ------------------
  |  |  825|  17.7k|#define JPOOL_PERMANENT  0      /* lasts until master record is destroyed */
  ------------------
  |  Branch (43:35): [True: 8.89k, False: 8.89k]
  ------------------
   44|  8.89k|    (*cinfo->mem->free_pool) (cinfo, pool);
   45|  8.89k|  }
   46|       |
   47|       |  /* Reset overall state for possible reuse of object */
   48|  8.89k|  if (cinfo->is_decompressor) {
  ------------------
  |  Branch (48:7): [True: 8.89k, False: 0]
  ------------------
   49|  8.89k|    cinfo->global_state = DSTATE_START;
  ------------------
  |  |   34|  8.89k|#define DSTATE_START     200    /* after create_decompress */
  ------------------
   50|       |    /* Try to keep application from accessing now-deleted marker list.
   51|       |     * A bit kludgy to do it here, but this is the most central place.
   52|       |     */
   53|  8.89k|    ((j_decompress_ptr)cinfo)->marker_list = NULL;
   54|  8.89k|  } else {
   55|      0|    cinfo->global_state = CSTATE_START;
  ------------------
  |  |   30|      0|#define CSTATE_START     100    /* after create_compress */
  ------------------
   56|      0|  }
   57|  8.89k|}
jpeg_destroy:
   73|  5.16k|{
   74|       |  /* We need only tell the memory manager to release everything. */
   75|       |  /* NB: mem pointer is NULL if memory mgr failed to initialize. */
   76|  5.16k|  if (cinfo->mem != NULL)
  ------------------
  |  Branch (76:7): [True: 5.16k, False: 0]
  ------------------
   77|  5.16k|    (*cinfo->mem->self_destruct) (cinfo);
   78|  5.16k|  cinfo->mem = NULL;            /* be safe if jpeg_destroy is called twice */
   79|  5.16k|  cinfo->global_state = 0;      /* mark it destroyed */
   80|  5.16k|}
jpeg_alloc_quant_table:
   90|  3.81k|{
   91|  3.81k|  JQUANT_TBL *tbl;
   92|       |
   93|  3.81k|  tbl = (JQUANT_TBL *)
   94|  3.81k|    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, sizeof(JQUANT_TBL));
  ------------------
  |  |  825|  3.81k|#define JPOOL_PERMANENT  0      /* lasts until master record is destroyed */
  ------------------
   95|  3.81k|  tbl->sent_table = FALSE;      /* make sure this is false in any new table */
  ------------------
  |  |  245|  3.81k|#define FALSE   0               /* values of boolean */
  ------------------
   96|  3.81k|  return tbl;
   97|  3.81k|}
jpeg_alloc_huff_table:
  102|  6.08k|{
  103|  6.08k|  JHUFF_TBL *tbl;
  104|       |
  105|  6.08k|  tbl = (JHUFF_TBL *)
  106|  6.08k|    (*cinfo->mem->alloc_small) (cinfo, JPOOL_PERMANENT, sizeof(JHUFF_TBL));
  ------------------
  |  |  825|  6.08k|#define JPOOL_PERMANENT  0      /* lasts until master record is destroyed */
  ------------------
  107|  6.08k|  tbl->sent_table = FALSE;      /* make sure this is false in any new table */
  ------------------
  |  |  245|  6.08k|#define FALSE   0               /* values of boolean */
  ------------------
  108|  6.08k|  return tbl;
  109|  6.08k|}

jpeg_CreateDecompress:
   36|  5.16k|{
   37|  5.16k|  int i;
   38|       |
   39|       |  /* Guard against version mismatches between library and caller. */
   40|  5.16k|  cinfo->mem = NULL;            /* so jpeg_destroy knows mem mgr not called */
   41|  5.16k|  if (version != JPEG_LIB_VERSION)
  ------------------
  |  |    4|  5.16k|#define JPEG_LIB_VERSION  62
  ------------------
  |  Branch (41:7): [True: 0, False: 5.16k]
  ------------------
   42|      0|    ERREXIT2(cinfo, JERR_BAD_LIB_VERSION, JPEG_LIB_VERSION, version);
  ------------------
  |  |  238|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  239|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  240|      0|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  241|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
   43|  5.16k|  if (structsize != sizeof(struct jpeg_decompress_struct))
  ------------------
  |  Branch (43:7): [True: 0, False: 5.16k]
  ------------------
   44|      0|    ERREXIT2(cinfo, JERR_BAD_STRUCT_SIZE,
  ------------------
  |  |  238|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  239|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  240|      0|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  241|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
   45|  5.16k|             (int)sizeof(struct jpeg_decompress_struct), (int)structsize);
   46|       |
   47|       |  /* For debugging purposes, we zero the whole master structure.
   48|       |   * But the application has already set the err pointer, and may have set
   49|       |   * client_data, so we have to save and restore those fields.
   50|       |   * Note: if application hasn't set client_data, tools like Purify may
   51|       |   * complain here.
   52|       |   */
   53|  5.16k|  {
   54|  5.16k|    struct jpeg_error_mgr *err = cinfo->err;
   55|  5.16k|    void *client_data = cinfo->client_data; /* ignore Purify complaint here */
   56|  5.16k|    MEMZERO(cinfo, sizeof(struct jpeg_decompress_struct));
  ------------------
  |  |   73|  5.16k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
   57|  5.16k|    cinfo->err = err;
   58|  5.16k|    cinfo->client_data = client_data;
   59|  5.16k|  }
   60|  5.16k|  cinfo->is_decompressor = TRUE;
  ------------------
  |  |  248|  5.16k|#define TRUE    1
  ------------------
   61|       |
   62|       |  /* Initialize a memory manager instance for this object */
   63|  5.16k|  jinit_memory_mgr((j_common_ptr)cinfo);
   64|       |
   65|       |  /* Zero out pointers to permanent structures. */
   66|  5.16k|  cinfo->progress = NULL;
   67|  5.16k|  cinfo->src = NULL;
   68|       |
   69|  25.8k|  for (i = 0; i < NUM_QUANT_TBLS; i++)
  ------------------
  |  |   48|  25.8k|#define NUM_QUANT_TBLS      4   /* Quantization tables are numbered 0..3 */
  ------------------
  |  Branch (69:15): [True: 20.6k, False: 5.16k]
  ------------------
   70|  20.6k|    cinfo->quant_tbl_ptrs[i] = NULL;
   71|       |
   72|  25.8k|  for (i = 0; i < NUM_HUFF_TBLS; i++) {
  ------------------
  |  |   49|  25.8k|#define NUM_HUFF_TBLS       4   /* Huffman tables are numbered 0..3 */
  ------------------
  |  Branch (72:15): [True: 20.6k, False: 5.16k]
  ------------------
   73|  20.6k|    cinfo->dc_huff_tbl_ptrs[i] = NULL;
   74|  20.6k|    cinfo->ac_huff_tbl_ptrs[i] = NULL;
   75|  20.6k|  }
   76|       |
   77|       |  /* Initialize marker processor so application can override methods
   78|       |   * for COM, APPn markers before calling jpeg_read_header.
   79|       |   */
   80|  5.16k|  cinfo->marker_list = NULL;
   81|  5.16k|  jinit_marker_reader(cinfo);
   82|       |
   83|       |  /* And initialize the overall input controller. */
   84|  5.16k|  jinit_input_controller(cinfo);
   85|       |
   86|       |  /* OK, I'm ready */
   87|  5.16k|  cinfo->global_state = DSTATE_START;
  ------------------
  |  |   34|  5.16k|#define DSTATE_START     200    /* after create_decompress */
  ------------------
   88|       |
   89|       |  /* The master struct is used to store extension parameters, so we allocate it
   90|       |   * here.
   91|       |   */
   92|  5.16k|  cinfo->master = (struct jpeg_decomp_master *)
   93|  5.16k|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
  ------------------
  |  |  825|  5.16k|#define JPOOL_PERMANENT  0      /* lasts until master record is destroyed */
  ------------------
   94|  5.16k|                                sizeof(my_decomp_master));
   95|  5.16k|  MEMZERO(cinfo->master, sizeof(my_decomp_master));
  ------------------
  |  |   73|  5.16k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
   96|  5.16k|}
jpeg_destroy_decompress:
  105|  5.16k|{
  106|  5.16k|  jpeg_destroy((j_common_ptr)cinfo); /* use common routine */
  107|  5.16k|}
jpeg_abort_decompress:
  117|  5.57k|{
  118|  5.57k|  jpeg_abort((j_common_ptr)cinfo); /* use common routine */
  119|  5.57k|}
jpeg_read_header:
  255|  10.2k|{
  256|  10.2k|  int retcode;
  257|       |
  258|  10.2k|  if (cinfo->global_state != DSTATE_START &&
  ------------------
  |  |   34|  20.5k|#define DSTATE_START     200    /* after create_decompress */
  ------------------
  |  Branch (258:7): [True: 0, False: 10.2k]
  ------------------
  259|  10.2k|      cinfo->global_state != DSTATE_INHEADER)
  ------------------
  |  |   35|      0|#define DSTATE_INHEADER  201    /* reading header markers, no SOS yet */
  ------------------
  |  Branch (259:7): [True: 0, False: 0]
  ------------------
  260|      0|    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  261|       |
  262|  10.2k|  retcode = jpeg_consume_input(cinfo);
  263|       |
  264|  10.2k|  switch (retcode) {
  ------------------
  |  Branch (264:11): [True: 774, False: 9.47k]
  ------------------
  265|  8.89k|  case JPEG_REACHED_SOS:
  ------------------
  |  | 1020|  8.89k|#define JPEG_REACHED_SOS        1 /* Reached start of new scan */
  ------------------
  |  Branch (265:3): [True: 8.89k, False: 1.36k]
  ------------------
  266|  8.89k|    retcode = JPEG_HEADER_OK;
  ------------------
  |  |  988|  8.89k|#define JPEG_HEADER_OK           1 /* Found valid image datastream */
  ------------------
  267|  8.89k|    break;
  268|    587|  case JPEG_REACHED_EOI:
  ------------------
  |  | 1021|    587|#define JPEG_REACHED_EOI        2 /* Reached end of image */
  ------------------
  |  Branch (268:3): [True: 587, False: 9.66k]
  ------------------
  269|    587|    if (require_image)          /* Complain if application wanted an image */
  ------------------
  |  Branch (269:9): [True: 587, False: 0]
  ------------------
  270|    587|      ERREXIT(cinfo, JERR_NO_IMAGE);
  ------------------
  |  |  231|    587|  ((cinfo)->err->msg_code = (code), \
  |  |  232|    587|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  271|       |    /* Reset to start state; it would be safer to require the application to
  272|       |     * call jpeg_abort, but we can't change it now for compatibility reasons.
  273|       |     * A side effect is to free any temporary memory (there shouldn't be any).
  274|       |     */
  275|    587|    jpeg_abort((j_common_ptr)cinfo); /* sets state = DSTATE_START */
  276|    587|    retcode = JPEG_HEADER_TABLES_ONLY;
  ------------------
  |  |  989|    587|#define JPEG_HEADER_TABLES_ONLY  2 /* Found valid table-specs-only datastream */
  ------------------
  277|    587|    break;
  278|      0|  case JPEG_SUSPENDED:
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  |  Branch (278:3): [True: 0, False: 10.2k]
  ------------------
  279|       |    /* no work */
  280|      0|    break;
  281|  10.2k|  }
  282|       |
  283|  8.89k|  return retcode;
  284|  10.2k|}
jpeg_consume_input:
  301|  10.2k|{
  302|  10.2k|  int retcode = JPEG_SUSPENDED;
  ------------------
  |  |  987|  10.2k|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  303|       |
  304|       |  /* NB: every possible DSTATE value should be listed in this switch */
  305|  10.2k|  switch (cinfo->global_state) {
  306|  10.2k|  case DSTATE_START:
  ------------------
  |  |   34|  10.2k|#define DSTATE_START     200    /* after create_decompress */
  ------------------
  |  Branch (306:3): [True: 10.2k, False: 0]
  ------------------
  307|       |    /* Start-of-datastream actions: reset appropriate modules */
  308|  10.2k|    (*cinfo->inputctl->reset_input_controller) (cinfo);
  309|       |    /* Initialize application's data source module */
  310|  10.2k|    (*cinfo->src->init_source) (cinfo);
  311|  10.2k|    cinfo->global_state = DSTATE_INHEADER;
  ------------------
  |  |   35|  10.2k|#define DSTATE_INHEADER  201    /* reading header markers, no SOS yet */
  ------------------
  312|       |    FALLTHROUGH                 /*FALLTHROUGH*/
  ------------------
  |  |   38|  10.2k|#define FALLTHROUGH  __attribute__((fallthrough));
  ------------------
  313|  10.2k|  case DSTATE_INHEADER:
  ------------------
  |  |   35|  10.2k|#define DSTATE_INHEADER  201    /* reading header markers, no SOS yet */
  ------------------
  |  Branch (313:3): [True: 0, False: 10.2k]
  ------------------
  314|  10.2k|    retcode = (*cinfo->inputctl->consume_input) (cinfo);
  315|  10.2k|    if (retcode == JPEG_REACHED_SOS) { /* Found SOS, prepare to decompress */
  ------------------
  |  | 1020|  10.2k|#define JPEG_REACHED_SOS        1 /* Reached start of new scan */
  ------------------
  |  Branch (315:9): [True: 8.89k, False: 1.36k]
  ------------------
  316|       |      /* Set up default parameters based on header data */
  317|  8.89k|      default_decompress_parms(cinfo);
  318|       |      /* Set global state: ready for start_decompress */
  319|  8.89k|      cinfo->global_state = DSTATE_READY;
  ------------------
  |  |   36|  8.89k|#define DSTATE_READY     202    /* found SOS, ready for start_decompress */
  ------------------
  320|  8.89k|    }
  321|  10.2k|    break;
  322|      0|  case DSTATE_READY:
  ------------------
  |  |   36|      0|#define DSTATE_READY     202    /* found SOS, ready for start_decompress */
  ------------------
  |  Branch (322:3): [True: 0, False: 10.2k]
  ------------------
  323|       |    /* Can't advance past first SOS until start_decompress is called */
  324|      0|    retcode = JPEG_REACHED_SOS;
  ------------------
  |  | 1020|      0|#define JPEG_REACHED_SOS        1 /* Reached start of new scan */
  ------------------
  325|      0|    break;
  326|      0|  case DSTATE_PRELOAD:
  ------------------
  |  |   37|      0|#define DSTATE_PRELOAD   203    /* reading multiscan file in start_decompress*/
  ------------------
  |  Branch (326:3): [True: 0, False: 10.2k]
  ------------------
  327|      0|  case DSTATE_PRESCAN:
  ------------------
  |  |   38|      0|#define DSTATE_PRESCAN   204    /* performing dummy pass for 2-pass quant */
  ------------------
  |  Branch (327:3): [True: 0, False: 10.2k]
  ------------------
  328|      0|  case DSTATE_SCANNING:
  ------------------
  |  |   39|      0|#define DSTATE_SCANNING  205    /* start_decompress done, read_scanlines OK */
  ------------------
  |  Branch (328:3): [True: 0, False: 10.2k]
  ------------------
  329|      0|  case DSTATE_RAW_OK:
  ------------------
  |  |   40|      0|#define DSTATE_RAW_OK    206    /* start_decompress done, read_raw_data OK */
  ------------------
  |  Branch (329:3): [True: 0, False: 10.2k]
  ------------------
  330|      0|  case DSTATE_BUFIMAGE:
  ------------------
  |  |   41|      0|#define DSTATE_BUFIMAGE  207    /* expecting jpeg_start_output */
  ------------------
  |  Branch (330:3): [True: 0, False: 10.2k]
  ------------------
  331|      0|  case DSTATE_BUFPOST:
  ------------------
  |  |   42|      0|#define DSTATE_BUFPOST   208    /* looking for SOS/EOI in jpeg_finish_output */
  ------------------
  |  Branch (331:3): [True: 0, False: 10.2k]
  ------------------
  332|      0|  case DSTATE_STOPPING:
  ------------------
  |  |   44|      0|#define DSTATE_STOPPING  210    /* looking for EOI in jpeg_finish_decompress */
  ------------------
  |  Branch (332:3): [True: 0, False: 10.2k]
  ------------------
  333|      0|    retcode = (*cinfo->inputctl->consume_input) (cinfo);
  334|      0|    break;
  335|      0|  default:
  ------------------
  |  Branch (335:3): [True: 0, False: 10.2k]
  ------------------
  336|      0|    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  337|  10.2k|  }
  338|  9.47k|  return retcode;
  339|  10.2k|}
jpeg_finish_decompress:
  383|  3.60k|{
  384|  3.60k|  if ((cinfo->global_state == DSTATE_SCANNING ||
  ------------------
  |  |   39|  7.20k|#define DSTATE_SCANNING  205    /* start_decompress done, read_scanlines OK */
  ------------------
  |  Branch (384:8): [True: 3.60k, False: 0]
  ------------------
  385|  3.60k|       cinfo->global_state == DSTATE_RAW_OK) && !cinfo->buffered_image) {
  ------------------
  |  |   40|      0|#define DSTATE_RAW_OK    206    /* start_decompress done, read_raw_data OK */
  ------------------
  |  Branch (385:8): [True: 0, False: 0]
  |  Branch (385:49): [True: 3.60k, False: 0]
  ------------------
  386|       |    /* Terminate final pass of non-buffered mode */
  387|  3.60k|    if (cinfo->output_scanline < cinfo->output_height)
  ------------------
  |  Branch (387:9): [True: 0, False: 3.60k]
  ------------------
  388|      0|      ERREXIT(cinfo, JERR_TOO_LITTLE_DATA);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  389|  3.60k|    (*cinfo->master->finish_output_pass) (cinfo);
  390|  3.60k|    cinfo->global_state = DSTATE_STOPPING;
  ------------------
  |  |   44|  3.60k|#define DSTATE_STOPPING  210    /* looking for EOI in jpeg_finish_decompress */
  ------------------
  391|  3.60k|  } else if (cinfo->global_state == DSTATE_BUFIMAGE) {
  ------------------
  |  |   41|      0|#define DSTATE_BUFIMAGE  207    /* expecting jpeg_start_output */
  ------------------
  |  Branch (391:14): [True: 0, False: 0]
  ------------------
  392|       |    /* Finishing after a buffered-image operation */
  393|      0|    cinfo->global_state = DSTATE_STOPPING;
  ------------------
  |  |   44|      0|#define DSTATE_STOPPING  210    /* looking for EOI in jpeg_finish_decompress */
  ------------------
  394|      0|  } else if (cinfo->global_state != DSTATE_STOPPING) {
  ------------------
  |  |   44|      0|#define DSTATE_STOPPING  210    /* looking for EOI in jpeg_finish_decompress */
  ------------------
  |  Branch (394:14): [True: 0, False: 0]
  ------------------
  395|       |    /* STOPPING = repeat call after a suspension, anything else is error */
  396|      0|    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  397|      0|  }
  398|       |  /* Read until EOI */
  399|  4.77k|  while (!cinfo->inputctl->eoi_reached) {
  ------------------
  |  Branch (399:10): [True: 1.17k, False: 3.60k]
  ------------------
  400|  1.17k|    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
  ------------------
  |  |  987|  1.17k|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  |  Branch (400:9): [True: 0, False: 1.17k]
  ------------------
  401|      0|      return FALSE;             /* Suspend, come back later */
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  402|  1.17k|  }
  403|       |  /* Do final cleanup */
  404|  3.60k|  (*cinfo->src->term_source) (cinfo);
  405|       |  /* We can use jpeg_abort to release memory and reset global_state */
  406|  3.60k|  jpeg_abort((j_common_ptr)cinfo);
  407|  3.60k|  return TRUE;
  ------------------
  |  |  248|  3.60k|#define TRUE    1
  ------------------
  408|  3.60k|}
jdapimin.c:default_decompress_parms:
  128|  8.89k|{
  129|       |  /* Guess the input colorspace, and set output colorspace accordingly. */
  130|       |  /* (Wish JPEG committee had provided a real way to specify this...) */
  131|       |  /* Note application may override our guesses. */
  132|  8.89k|  switch (cinfo->num_components) {
  133|  4.45k|  case 1:
  ------------------
  |  Branch (133:3): [True: 4.45k, False: 4.43k]
  ------------------
  134|  4.45k|    cinfo->jpeg_color_space = JCS_GRAYSCALE;
  135|  4.45k|    cinfo->out_color_space = JCS_GRAYSCALE;
  136|  4.45k|    break;
  137|       |
  138|  4.36k|  case 3:
  ------------------
  |  Branch (138:3): [True: 4.36k, False: 4.52k]
  ------------------
  139|  4.36k|    if (cinfo->saw_JFIF_marker) {
  ------------------
  |  Branch (139:9): [True: 272, False: 4.09k]
  ------------------
  140|    272|      cinfo->jpeg_color_space = JCS_YCbCr; /* JFIF implies YCbCr */
  141|  4.09k|    } else if (cinfo->saw_Adobe_marker) {
  ------------------
  |  Branch (141:16): [True: 307, False: 3.78k]
  ------------------
  142|    307|      switch (cinfo->Adobe_transform) {
  143|    288|      case 0:
  ------------------
  |  Branch (143:7): [True: 288, False: 19]
  ------------------
  144|    288|        cinfo->jpeg_color_space = JCS_RGB;
  145|    288|        break;
  146|     12|      case 1:
  ------------------
  |  Branch (146:7): [True: 12, False: 295]
  ------------------
  147|     12|        cinfo->jpeg_color_space = JCS_YCbCr;
  148|     12|        break;
  149|      7|      default:
  ------------------
  |  Branch (149:7): [True: 7, False: 300]
  ------------------
  150|      7|        WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
  ------------------
  |  |  268|      7|  ((cinfo)->err->msg_code = (code), \
  |  |  269|      7|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  270|      7|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  151|      7|        cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
  152|      7|        break;
  153|    307|      }
  154|  3.78k|    } else {
  155|       |      /* Saw no special markers, try to guess from the component IDs */
  156|  3.78k|      int cid0 = cinfo->comp_info[0].component_id;
  157|  3.78k|      int cid1 = cinfo->comp_info[1].component_id;
  158|  3.78k|      int cid2 = cinfo->comp_info[2].component_id;
  159|       |
  160|  3.78k|      if (cid0 == 1 && cid1 == 2 && cid2 == 3)
  ------------------
  |  Branch (160:11): [True: 2.81k, False: 971]
  |  Branch (160:24): [True: 2.74k, False: 72]
  |  Branch (160:37): [True: 2.39k, False: 342]
  ------------------
  161|  2.39k|        cinfo->jpeg_color_space = JCS_YCbCr; /* assume JFIF w/out marker */
  162|  1.38k|      else if (cid0 == 82 && cid1 == 71 && cid2 == 66)
  ------------------
  |  Branch (162:16): [True: 35, False: 1.35k]
  |  Branch (162:30): [True: 13, False: 22]
  |  Branch (162:44): [True: 4, False: 9]
  ------------------
  163|      4|        cinfo->jpeg_color_space = JCS_RGB; /* ASCII 'R', 'G', 'B' */
  164|  1.38k|      else {
  165|  1.38k|        TRACEMS3(cinfo, 1, JTRC_UNKNOWN_IDS, cid0, cid1, cid2);
  ------------------
  |  |  291|  1.38k|  MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
  |  |  ------------------
  |  |  |  |  261|  1.38k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  292|  1.38k|           _mp[0] = (p1);  _mp[1] = (p2);  _mp[2] = (p3); \
  |  |  293|  1.38k|           (cinfo)->err->msg_code = (code); \
  |  |  294|  1.38k|           (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
  ------------------
  166|  1.38k|        cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's YCbCr */
  167|  1.38k|      }
  168|  3.78k|    }
  169|       |    /* Always guess RGB is proper output colorspace. */
  170|  4.36k|    cinfo->out_color_space = JCS_RGB;
  171|  4.36k|    break;
  172|       |
  173|     55|  case 4:
  ------------------
  |  Branch (173:3): [True: 55, False: 8.83k]
  ------------------
  174|     55|    if (cinfo->saw_Adobe_marker) {
  ------------------
  |  Branch (174:9): [True: 18, False: 37]
  ------------------
  175|     18|      switch (cinfo->Adobe_transform) {
  176|      3|      case 0:
  ------------------
  |  Branch (176:7): [True: 3, False: 15]
  ------------------
  177|      3|        cinfo->jpeg_color_space = JCS_CMYK;
  178|      3|        break;
  179|      4|      case 2:
  ------------------
  |  Branch (179:7): [True: 4, False: 14]
  ------------------
  180|      4|        cinfo->jpeg_color_space = JCS_YCCK;
  181|      4|        break;
  182|     11|      default:
  ------------------
  |  Branch (182:7): [True: 11, False: 7]
  ------------------
  183|     11|        WARNMS1(cinfo, JWRN_ADOBE_XFORM, cinfo->Adobe_transform);
  ------------------
  |  |  268|     11|  ((cinfo)->err->msg_code = (code), \
  |  |  269|     11|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  270|     11|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  184|     11|        cinfo->jpeg_color_space = JCS_YCCK; /* assume it's YCCK */
  185|     11|        break;
  186|     18|      }
  187|     37|    } else {
  188|       |      /* No special markers, assume straight CMYK. */
  189|     37|      cinfo->jpeg_color_space = JCS_CMYK;
  190|     37|    }
  191|     55|    cinfo->out_color_space = JCS_CMYK;
  192|     55|    break;
  193|       |
  194|     16|  default:
  ------------------
  |  Branch (194:3): [True: 16, False: 8.87k]
  ------------------
  195|     16|    cinfo->jpeg_color_space = JCS_UNKNOWN;
  196|     16|    cinfo->out_color_space = JCS_UNKNOWN;
  197|     16|    break;
  198|  8.89k|  }
  199|       |
  200|       |  /* Set defaults for other decompression parameters. */
  201|  8.89k|  cinfo->scale_num = 1;         /* 1:1 scaling */
  202|  8.89k|  cinfo->scale_denom = 1;
  203|  8.89k|  cinfo->output_gamma = 1.0;
  204|  8.89k|  cinfo->buffered_image = FALSE;
  ------------------
  |  |  245|  8.89k|#define FALSE   0               /* values of boolean */
  ------------------
  205|  8.89k|  cinfo->raw_data_out = FALSE;
  ------------------
  |  |  245|  8.89k|#define FALSE   0               /* values of boolean */
  ------------------
  206|  8.89k|  cinfo->dct_method = JDCT_DEFAULT;
  ------------------
  |  |  253|  8.89k|#define JDCT_DEFAULT  JDCT_ISLOW
  ------------------
  207|  8.89k|  cinfo->do_fancy_upsampling = TRUE;
  ------------------
  |  |  248|  8.89k|#define TRUE    1
  ------------------
  208|  8.89k|  cinfo->do_block_smoothing = TRUE;
  ------------------
  |  |  248|  8.89k|#define TRUE    1
  ------------------
  209|  8.89k|  cinfo->quantize_colors = FALSE;
  ------------------
  |  |  245|  8.89k|#define FALSE   0               /* values of boolean */
  ------------------
  210|       |  /* We set these in case application only sets quantize_colors. */
  211|  8.89k|  cinfo->dither_mode = JDITHER_FS;
  212|  8.89k|#ifdef QUANT_2PASS_SUPPORTED
  213|  8.89k|  cinfo->two_pass_quantize = TRUE;
  ------------------
  |  |  248|  8.89k|#define TRUE    1
  ------------------
  214|       |#else
  215|       |  cinfo->two_pass_quantize = FALSE;
  216|       |#endif
  217|  8.89k|  cinfo->desired_number_of_colors = 256;
  218|  8.89k|  cinfo->colormap = NULL;
  219|       |  /* Initialize for no mode change in buffered-image mode. */
  220|  8.89k|  cinfo->enable_1pass_quant = FALSE;
  ------------------
  |  |  245|  8.89k|#define FALSE   0               /* values of boolean */
  ------------------
  221|  8.89k|  cinfo->enable_external_quant = FALSE;
  ------------------
  |  |  245|  8.89k|#define FALSE   0               /* values of boolean */
  ------------------
  222|  8.89k|  cinfo->enable_2pass_quant = FALSE;
  ------------------
  |  |  245|  8.89k|#define FALSE   0               /* values of boolean */
  ------------------
  223|  8.89k|}

jpeg_start_decompress:
   46|  5.08k|{
   47|  5.08k|  if (cinfo->global_state == DSTATE_READY) {
  ------------------
  |  |   36|  5.08k|#define DSTATE_READY     202    /* found SOS, ready for start_decompress */
  ------------------
  |  Branch (47:7): [True: 5.08k, False: 0]
  ------------------
   48|       |    /* First call: initialize master control, select active modules */
   49|  5.08k|    jinit_master_decompress(cinfo);
   50|  5.08k|    if (cinfo->buffered_image) {
  ------------------
  |  Branch (50:9): [True: 0, False: 5.08k]
  ------------------
   51|       |      /* No more work here; expecting jpeg_start_output next */
   52|      0|      cinfo->global_state = DSTATE_BUFIMAGE;
  ------------------
  |  |   41|      0|#define DSTATE_BUFIMAGE  207    /* expecting jpeg_start_output */
  ------------------
   53|      0|      return TRUE;
  ------------------
  |  |  248|      0|#define TRUE    1
  ------------------
   54|      0|    }
   55|  5.08k|    cinfo->global_state = DSTATE_PRELOAD;
  ------------------
  |  |   37|  5.08k|#define DSTATE_PRELOAD   203    /* reading multiscan file in start_decompress*/
  ------------------
   56|  5.08k|  }
   57|  5.08k|  if (cinfo->global_state == DSTATE_PRELOAD) {
  ------------------
  |  |   37|  5.08k|#define DSTATE_PRELOAD   203    /* reading multiscan file in start_decompress*/
  ------------------
  |  Branch (57:7): [True: 4.07k, False: 1.01k]
  ------------------
   58|       |    /* If file has multiple scans, absorb them all into the coef buffer */
   59|  4.07k|    if (cinfo->inputctl->has_multiple_scans) {
  ------------------
  |  Branch (59:9): [True: 2.89k, False: 1.17k]
  ------------------
   60|  2.89k|#ifdef D_MULTISCAN_FILES_SUPPORTED
   61|  4.42M|      for (;;) {
   62|  4.42M|        int retcode;
   63|       |        /* Call progress monitor hook if present */
   64|  4.42M|        if (cinfo->progress != NULL)
  ------------------
  |  Branch (64:13): [True: 4.42M, False: 0]
  ------------------
   65|  4.42M|          (*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
   66|       |        /* Absorb some more input */
   67|  4.42M|        retcode = (*cinfo->inputctl->consume_input) (cinfo);
   68|  4.42M|        if (retcode == JPEG_SUSPENDED)
  ------------------
  |  |  987|  4.42M|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  |  Branch (68:13): [True: 0, False: 4.42M]
  ------------------
   69|      0|          return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
   70|  4.42M|        if (retcode == JPEG_REACHED_EOI)
  ------------------
  |  | 1021|  4.42M|#define JPEG_REACHED_EOI        2 /* Reached end of image */
  ------------------
  |  Branch (70:13): [True: 2.43k, False: 4.41M]
  ------------------
   71|  2.43k|          break;
   72|       |        /* Advance progress counter if appropriate */
   73|  4.41M|        if (cinfo->progress != NULL &&
  ------------------
  |  Branch (73:13): [True: 4.41M, False: 469]
  ------------------
   74|  4.41M|            (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
  ------------------
  |  | 1022|  8.83M|#define JPEG_ROW_COMPLETED      3 /* Completed one iMCU row */
  ------------------
                          (retcode == JPEG_ROW_COMPLETED || retcode == JPEG_REACHED_SOS)) {
  ------------------
  |  | 1020|  39.6k|#define JPEG_REACHED_SOS        1 /* Reached start of new scan */
  ------------------
  |  Branch (74:14): [True: 4.37M, False: 39.6k]
  |  Branch (74:47): [True: 18.3k, False: 21.2k]
  ------------------
   75|  4.39M|          if (++cinfo->progress->pass_counter >= cinfo->progress->pass_limit) {
  ------------------
  |  Branch (75:15): [True: 16.0k, False: 4.38M]
  ------------------
   76|       |            /* jdmaster underestimated number of scans; ratchet up one scan */
   77|  16.0k|            cinfo->progress->pass_limit += (long)cinfo->total_iMCU_rows;
   78|  16.0k|          }
   79|  4.39M|        }
   80|  4.41M|      }
   81|       |#else
   82|       |      ERREXIT(cinfo, JERR_NOT_COMPILED);
   83|       |#endif /* D_MULTISCAN_FILES_SUPPORTED */
   84|  2.89k|    }
   85|  4.07k|    cinfo->output_scan_number = cinfo->input_scan_number;
   86|  4.07k|  } else if (cinfo->global_state != DSTATE_PRESCAN)
  ------------------
  |  |   38|  1.01k|#define DSTATE_PRESCAN   204    /* performing dummy pass for 2-pass quant */
  ------------------
  |  Branch (86:14): [True: 0, False: 1.01k]
  ------------------
   87|      0|    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
   88|       |  /* Perform any dummy output passes, and set up for the final pass */
   89|  5.08k|  return output_pass_setup(cinfo);
   90|  5.08k|}
jpeg_read_scanlines:
  281|  6.67M|{
  282|  6.67M|  JDIMENSION row_ctr;
  283|       |
  284|  6.67M|  if (cinfo->global_state != DSTATE_SCANNING)
  ------------------
  |  |   39|  6.67M|#define DSTATE_SCANNING  205    /* start_decompress done, read_scanlines OK */
  ------------------
  |  Branch (284:7): [True: 0, False: 6.67M]
  ------------------
  285|      0|    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  286|  6.67M|  if (cinfo->output_scanline >= cinfo->output_height) {
  ------------------
  |  Branch (286:7): [True: 0, False: 6.67M]
  ------------------
  287|      0|    WARNMS(cinfo, JWRN_TOO_MUCH_DATA);
  ------------------
  |  |  265|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  266|      0|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  288|      0|    return 0;
  289|      0|  }
  290|       |
  291|       |  /* Call progress monitor hook if present */
  292|  6.67M|  if (cinfo->progress != NULL) {
  ------------------
  |  Branch (292:7): [True: 6.67M, False: 0]
  ------------------
  293|  6.67M|    cinfo->progress->pass_counter = (long)cinfo->output_scanline;
  294|  6.67M|    cinfo->progress->pass_limit = (long)cinfo->output_height;
  295|  6.67M|    (*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
  296|  6.67M|  }
  297|       |
  298|       |  /* Process some data */
  299|  6.67M|  row_ctr = 0;
  300|  6.67M|  (*cinfo->main->process_data) (cinfo, scanlines, &row_ctr, max_lines);
  301|  6.67M|  cinfo->output_scanline += row_ctr;
  302|  6.67M|  return row_ctr;
  303|  6.67M|}
jdapistd.c:output_pass_setup:
  103|  3.60k|{
  104|  3.60k|  if (cinfo->global_state != DSTATE_PRESCAN) {
  ------------------
  |  |   38|  3.60k|#define DSTATE_PRESCAN   204    /* performing dummy pass for 2-pass quant */
  ------------------
  |  Branch (104:7): [True: 3.60k, False: 0]
  ------------------
  105|       |    /* First call: do pass setup */
  106|  3.60k|    (*cinfo->master->prepare_for_output_pass) (cinfo);
  107|  3.60k|    cinfo->output_scanline = 0;
  108|  3.60k|    cinfo->global_state = DSTATE_PRESCAN;
  ------------------
  |  |   38|  3.60k|#define DSTATE_PRESCAN   204    /* performing dummy pass for 2-pass quant */
  ------------------
  109|  3.60k|  }
  110|       |  /* Loop over any required dummy passes */
  111|  3.60k|  while (cinfo->master->is_dummy_pass) {
  ------------------
  |  Branch (111:10): [True: 0, False: 3.60k]
  ------------------
  112|      0|#ifdef QUANT_2PASS_SUPPORTED
  113|       |    /* Crank through the dummy pass */
  114|      0|    while (cinfo->output_scanline < cinfo->output_height) {
  ------------------
  |  Branch (114:12): [True: 0, False: 0]
  ------------------
  115|      0|      JDIMENSION last_scanline;
  116|       |      /* Call progress monitor hook if present */
  117|      0|      if (cinfo->progress != NULL) {
  ------------------
  |  Branch (117:11): [True: 0, False: 0]
  ------------------
  118|      0|        cinfo->progress->pass_counter = (long)cinfo->output_scanline;
  119|      0|        cinfo->progress->pass_limit = (long)cinfo->output_height;
  120|      0|        (*cinfo->progress->progress_monitor) ((j_common_ptr)cinfo);
  121|      0|      }
  122|       |      /* Process some data */
  123|      0|      last_scanline = cinfo->output_scanline;
  124|      0|      (*cinfo->main->process_data) (cinfo, (JSAMPARRAY)NULL,
  125|      0|                                    &cinfo->output_scanline, (JDIMENSION)0);
  126|      0|      if (cinfo->output_scanline == last_scanline)
  ------------------
  |  Branch (126:11): [True: 0, False: 0]
  ------------------
  127|      0|        return FALSE;           /* No progress made, must suspend */
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  128|      0|    }
  129|       |    /* Finish up dummy pass, and set up for another one */
  130|      0|    (*cinfo->master->finish_output_pass) (cinfo);
  131|      0|    (*cinfo->master->prepare_for_output_pass) (cinfo);
  132|      0|    cinfo->output_scanline = 0;
  133|       |#else
  134|       |    ERREXIT(cinfo, JERR_NOT_COMPILED);
  135|       |#endif /* QUANT_2PASS_SUPPORTED */
  136|      0|  }
  137|       |  /* Ready for application to drive output pass through
  138|       |   * jpeg_read_scanlines or jpeg_read_raw_data.
  139|       |   */
  140|  3.60k|  cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
  ------------------
  |  |   40|      0|#define DSTATE_RAW_OK    206    /* start_decompress done, read_raw_data OK */
  ------------------
                cinfo->global_state = cinfo->raw_data_out ? DSTATE_RAW_OK : DSTATE_SCANNING;
  ------------------
  |  |   39|  7.20k|#define DSTATE_SCANNING  205    /* start_decompress done, read_scanlines OK */
  ------------------
  |  Branch (140:25): [True: 0, False: 3.60k]
  ------------------
  141|  3.60k|  return TRUE;
  ------------------
  |  |  248|  3.60k|#define TRUE    1
  ------------------
  142|  3.60k|}

jinit_arith_decoder:
  742|  1.92k|{
  743|  1.92k|  arith_entropy_ptr entropy;
  744|  1.92k|  int i;
  745|       |
  746|  1.92k|  entropy = (arith_entropy_ptr)
  747|  1.92k|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  1.92k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  748|  1.92k|                                sizeof(arith_entropy_decoder));
  749|  1.92k|  cinfo->entropy = (struct jpeg_entropy_decoder *)entropy;
  750|  1.92k|  entropy->pub.start_pass = start_pass;
  751|       |
  752|       |  /* Mark tables unallocated */
  753|  32.6k|  for (i = 0; i < NUM_ARITH_TBLS; i++) {
  ------------------
  |  |   50|  32.6k|#define NUM_ARITH_TBLS      16  /* Arith-coding tables are numbered 0..15 */
  ------------------
  |  Branch (753:15): [True: 30.7k, False: 1.92k]
  ------------------
  754|  30.7k|    entropy->dc_stats[i] = NULL;
  755|  30.7k|    entropy->ac_stats[i] = NULL;
  756|  30.7k|  }
  757|       |
  758|       |  /* Initialize index for fixed probability estimation */
  759|  1.92k|  entropy->fixed_bin[0] = 113;
  760|       |
  761|  1.92k|  if (cinfo->progressive_mode) {
  ------------------
  |  Branch (761:7): [True: 1.33k, False: 590]
  ------------------
  762|       |    /* Create progression status table */
  763|  1.33k|    int *coef_bit_ptr, ci;
  764|  1.33k|    cinfo->coef_bits = (int (*)[DCTSIZE2])
  765|  1.33k|      (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  1.33k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  766|  1.33k|                                  cinfo->num_components * DCTSIZE2 *
  ------------------
  |  |   47|  1.33k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  767|  1.33k|                                  sizeof(int));
  768|  1.33k|    coef_bit_ptr = &cinfo->coef_bits[0][0];
  769|  3.37k|    for (ci = 0; ci < cinfo->num_components; ci++)
  ------------------
  |  Branch (769:18): [True: 2.04k, False: 1.33k]
  ------------------
  770|   133k|      for (i = 0; i < DCTSIZE2; i++)
  ------------------
  |  |   47|   133k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (770:19): [True: 131k, False: 2.04k]
  ------------------
  771|   131k|        *coef_bit_ptr++ = -1;
  772|  1.33k|  }
  773|  1.92k|}
jdarith.c:start_pass:
  633|  9.49k|{
  634|  9.49k|  arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
  635|  9.49k|  int ci, tbl;
  636|  9.49k|  jpeg_component_info *compptr;
  637|       |
  638|  9.49k|  if (cinfo->progressive_mode) {
  ------------------
  |  Branch (638:7): [True: 6.16k, False: 3.33k]
  ------------------
  639|       |    /* Validate progressive scan parameters */
  640|  6.16k|    if (cinfo->Ss == 0) {
  ------------------
  |  Branch (640:9): [True: 3.99k, False: 2.16k]
  ------------------
  641|  3.99k|      if (cinfo->Se != 0)
  ------------------
  |  Branch (641:11): [True: 2, False: 3.99k]
  ------------------
  642|      2|        goto bad;
  643|  3.99k|    } else {
  644|       |      /* need not check Ss/Se < 0 since they came from unsigned bytes */
  645|  2.16k|      if (cinfo->Se < cinfo->Ss || cinfo->Se > DCTSIZE2 - 1)
  ------------------
  |  |   47|  2.15k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (645:11): [True: 4, False: 2.15k]
  |  Branch (645:36): [True: 17, False: 2.14k]
  ------------------
  646|     21|        goto bad;
  647|       |      /* AC scans may have only one component */
  648|  2.14k|      if (cinfo->comps_in_scan != 1)
  ------------------
  |  Branch (648:11): [True: 1, False: 2.14k]
  ------------------
  649|      1|        goto bad;
  650|  2.14k|    }
  651|  6.13k|    if (cinfo->Ah != 0) {
  ------------------
  |  Branch (651:9): [True: 1.23k, False: 4.90k]
  ------------------
  652|       |      /* Successive approximation refinement scan: must have Al = Ah-1. */
  653|  1.23k|      if (cinfo->Ah - 1 != cinfo->Al)
  ------------------
  |  Branch (653:11): [True: 11, False: 1.22k]
  ------------------
  654|     11|        goto bad;
  655|  1.23k|    }
  656|  6.12k|    if (cinfo->Al > 13) {       /* need not check for < 0 */
  ------------------
  |  Branch (656:9): [True: 3, False: 6.12k]
  ------------------
  657|     38|bad:
  658|     38|      ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
  ------------------
  |  |  249|     38|  ((cinfo)->err->msg_code = (code), \
  |  |  250|     38|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  251|     38|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  252|     38|   (cinfo)->err->msg_parm.i[2] = (p3), \
  |  |  253|     38|   (cinfo)->err->msg_parm.i[3] = (p4), \
  |  |  254|     38|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  659|     38|               cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
  660|     38|    }
  661|       |    /* Update progression status, and verify that scan order is legal.
  662|       |     * Note that inter-scan inconsistencies are treated as warnings
  663|       |     * not fatal errors ... not clear if this is right way to behave.
  664|       |     */
  665|  13.2k|    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  ------------------
  |  Branch (665:18): [True: 7.13k, False: 6.16k]
  ------------------
  666|  7.13k|      int coefi, cindex = cinfo->cur_comp_info[ci]->component_index;
  667|  7.13k|      int *coef_bit_ptr = &cinfo->coef_bits[cindex][0];
  668|  7.13k|      if (cinfo->Ss && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
  ------------------
  |  Branch (668:11): [True: 2.13k, False: 5.00k]
  |  Branch (668:24): [True: 1.21k, False: 914]
  ------------------
  669|  1.21k|        WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
  ------------------
  |  |  272|  1.21k|  ((cinfo)->err->msg_code = (code), \
  |  |  273|  1.21k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  274|  1.21k|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  275|  1.21k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  670|  61.4k|      for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
  ------------------
  |  Branch (670:31): [True: 54.3k, False: 7.13k]
  ------------------
  671|  54.3k|        int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
  ------------------
  |  Branch (671:24): [True: 13.6k, False: 40.6k]
  ------------------
  672|  54.3k|        if (cinfo->Ah != expected)
  ------------------
  |  Branch (672:13): [True: 22.8k, False: 31.4k]
  ------------------
  673|  22.8k|          WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
  ------------------
  |  |  272|  22.8k|  ((cinfo)->err->msg_code = (code), \
  |  |  273|  22.8k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  274|  22.8k|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  275|  22.8k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  674|  54.3k|        coef_bit_ptr[coefi] = cinfo->Al;
  675|  54.3k|      }
  676|  7.13k|    }
  677|       |    /* Select MCU decoding routine */
  678|  6.16k|    if (cinfo->Ah == 0) {
  ------------------
  |  Branch (678:9): [True: 4.90k, False: 1.25k]
  ------------------
  679|  4.90k|      if (cinfo->Ss == 0)
  ------------------
  |  Branch (679:11): [True: 3.55k, False: 1.34k]
  ------------------
  680|  3.55k|        entropy->pub.decode_mcu = decode_mcu_DC_first;
  681|  1.34k|      else
  682|  1.34k|        entropy->pub.decode_mcu = decode_mcu_AC_first;
  683|  4.90k|    } else {
  684|  1.25k|      if (cinfo->Ss == 0)
  ------------------
  |  Branch (684:11): [True: 436, False: 820]
  ------------------
  685|    436|        entropy->pub.decode_mcu = decode_mcu_DC_refine;
  686|    820|      else
  687|    820|        entropy->pub.decode_mcu = decode_mcu_AC_refine;
  688|  1.25k|    }
  689|  6.16k|  } else {
  690|       |    /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
  691|       |     * This ought to be an error condition, but we make it a warning.
  692|       |     */
  693|  3.33k|    if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2 - 1 ||
  ------------------
  |  |   47|  1.86k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (693:9): [True: 1.47k, False: 1.86k]
  |  Branch (693:27): [True: 918, False: 944]
  ------------------
  694|  3.33k|        cinfo->Ah != 0 || cinfo->Al != 0)
  ------------------
  |  Branch (694:9): [True: 435, False: 509]
  |  Branch (694:27): [True: 194, False: 315]
  ------------------
  695|  3.02k|      WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
  ------------------
  |  |  265|  3.02k|  ((cinfo)->err->msg_code = (code), \
  |  |  266|  3.02k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  696|       |    /* Select MCU decoding routine */
  697|  3.33k|    entropy->pub.decode_mcu = decode_mcu;
  698|  3.33k|  }
  699|       |
  700|       |  /* Allocate & initialize requested statistics areas */
  701|  21.6k|  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  ------------------
  |  Branch (701:16): [True: 12.1k, False: 9.49k]
  ------------------
  702|  12.1k|    compptr = cinfo->cur_comp_info[ci];
  703|  12.1k|    if (!cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
  ------------------
  |  Branch (703:9): [True: 4.98k, False: 7.13k]
  |  Branch (703:38): [True: 5.00k, False: 2.13k]
  |  Branch (703:56): [True: 4.00k, False: 996]
  ------------------
  704|  8.99k|      tbl = compptr->dc_tbl_no;
  705|  8.99k|      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
  ------------------
  |  |   50|  8.99k|#define NUM_ARITH_TBLS      16  /* Arith-coding tables are numbered 0..15 */
  ------------------
  |  Branch (705:11): [True: 0, False: 8.99k]
  |  Branch (705:22): [True: 0, False: 8.99k]
  ------------------
  706|      0|        ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  707|  8.99k|      if (entropy->dc_stats[tbl] == NULL)
  ------------------
  |  Branch (707:11): [True: 1.84k, False: 7.15k]
  ------------------
  708|  1.84k|        entropy->dc_stats[tbl] = (unsigned char *)(*cinfo->mem->alloc_small)
  709|  1.84k|          ((j_common_ptr)cinfo, JPOOL_IMAGE, DC_STAT_BINS);
  ------------------
  |  |  826|  1.84k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
                        ((j_common_ptr)cinfo, JPOOL_IMAGE, DC_STAT_BINS);
  ------------------
  |  |   69|  1.84k|#define DC_STAT_BINS  64
  ------------------
  710|  8.99k|      MEMZERO(entropy->dc_stats[tbl], DC_STAT_BINS);
  ------------------
  |  |   73|  8.99k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
  711|       |      /* Initialize DC predictions to 0 */
  712|  8.99k|      entropy->last_dc_val[ci] = 0;
  713|  8.99k|      entropy->dc_context[ci] = 0;
  714|  8.99k|    }
  715|  12.1k|    if (!cinfo->progressive_mode || cinfo->Ss) {
  ------------------
  |  Branch (715:9): [True: 4.98k, False: 7.13k]
  |  Branch (715:37): [True: 2.13k, False: 5.00k]
  ------------------
  716|  7.11k|      tbl = compptr->ac_tbl_no;
  717|  7.11k|      if (tbl < 0 || tbl >= NUM_ARITH_TBLS)
  ------------------
  |  |   50|  7.11k|#define NUM_ARITH_TBLS      16  /* Arith-coding tables are numbered 0..15 */
  ------------------
  |  Branch (717:11): [True: 0, False: 7.11k]
  |  Branch (717:22): [True: 0, False: 7.11k]
  ------------------
  718|      0|        ERREXIT1(cinfo, JERR_NO_ARITH_TABLE, tbl);
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  719|  7.11k|      if (entropy->ac_stats[tbl] == NULL)
  ------------------
  |  Branch (719:11): [True: 1.21k, False: 5.89k]
  ------------------
  720|  1.21k|        entropy->ac_stats[tbl] = (unsigned char *)(*cinfo->mem->alloc_small)
  721|  1.21k|          ((j_common_ptr)cinfo, JPOOL_IMAGE, AC_STAT_BINS);
  ------------------
  |  |  826|  1.21k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
                        ((j_common_ptr)cinfo, JPOOL_IMAGE, AC_STAT_BINS);
  ------------------
  |  |   70|  1.21k|#define AC_STAT_BINS  256
  ------------------
  722|  7.11k|      MEMZERO(entropy->ac_stats[tbl], AC_STAT_BINS);
  ------------------
  |  |   73|  7.11k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
  723|  7.11k|    }
  724|  12.1k|  }
  725|       |
  726|       |  /* Initialize arithmetic decoding variables */
  727|  9.49k|  entropy->c = 0;
  728|  9.49k|  entropy->a = 0;
  729|  9.49k|  entropy->ct = -16;    /* force reading 2 initial bytes to fill C */
  730|       |
  731|       |  /* Initialize restart counter */
  732|  9.49k|  entropy->restarts_to_go = cinfo->restart_interval;
  733|  9.49k|}
jdarith.c:decode_mcu_DC_first:
  251|  43.1M|{
  252|  43.1M|  arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
  253|  43.1M|  JBLOCKROW block;
  254|  43.1M|  unsigned char *st;
  255|  43.1M|  int blkn, ci, tbl, sign;
  256|  43.1M|  int v, m;
  257|       |
  258|       |  /* Process restart marker if needed */
  259|  43.1M|  if (cinfo->restart_interval) {
  ------------------
  |  Branch (259:7): [True: 7.37M, False: 35.7M]
  ------------------
  260|  7.37M|    if (entropy->restarts_to_go == 0)
  ------------------
  |  Branch (260:9): [True: 44.1k, False: 7.33M]
  ------------------
  261|  44.1k|      process_restart(cinfo);
  262|  7.37M|    entropy->restarts_to_go--;
  263|  7.37M|  }
  264|       |
  265|  43.1M|  if (entropy->ct == -1) return TRUE;   /* if error do nothing */
  ------------------
  |  |  248|  53.5k|#define TRUE    1
  ------------------
  |  Branch (265:7): [True: 53.5k, False: 43.0M]
  ------------------
  266|       |
  267|       |  /* Outer loop handles each block in the MCU */
  268|       |
  269|  87.3M|  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  ------------------
  |  Branch (269:18): [True: 44.2M, False: 43.0M]
  ------------------
  270|  44.2M|    block = MCU_data[blkn];
  271|  44.2M|    ci = cinfo->MCU_membership[blkn];
  272|  44.2M|    tbl = cinfo->cur_comp_info[ci]->dc_tbl_no;
  273|       |
  274|       |    /* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */
  275|       |
  276|       |    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */
  277|  44.2M|    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
  278|       |
  279|       |    /* Figure F.19: Decode_DC_DIFF */
  280|  44.2M|    if (arith_decode(cinfo, st) == 0)
  ------------------
  |  Branch (280:9): [True: 21.9M, False: 22.3M]
  ------------------
  281|  21.9M|      entropy->dc_context[ci] = 0;
  282|  22.3M|    else {
  283|       |      /* Figure F.21: Decoding nonzero value v */
  284|       |      /* Figure F.22: Decoding the sign of v */
  285|  22.3M|      sign = arith_decode(cinfo, st + 1);
  286|  22.3M|      st += 2;  st += sign;
  287|       |      /* Figure F.23: Decoding the magnitude category of v */
  288|  22.3M|      if ((m = arith_decode(cinfo, st)) != 0) {
  ------------------
  |  Branch (288:11): [True: 21.4M, False: 923k]
  ------------------
  289|  21.4M|        st = entropy->dc_stats[tbl] + 20;       /* Table F.4: X1 = 20 */
  290|  44.3M|        while (arith_decode(cinfo, st)) {
  ------------------
  |  Branch (290:16): [True: 22.8M, False: 21.4M]
  ------------------
  291|  22.8M|          if ((m <<= 1) == 0x8000) {
  ------------------
  |  Branch (291:15): [True: 583, False: 22.8M]
  ------------------
  292|    583|            WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
  ------------------
  |  |  265|    583|  ((cinfo)->err->msg_code = (code), \
  |  |  266|    583|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  293|    583|            entropy->ct = -1;                   /* magnitude overflow */
  294|    583|            return TRUE;
  ------------------
  |  |  248|    583|#define TRUE    1
  ------------------
  295|    583|          }
  296|  22.8M|          st += 1;
  297|  22.8M|        }
  298|  21.4M|      }
  299|       |      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */
  300|  22.3M|      if (m < (int)((1L << cinfo->arith_dc_L[tbl]) >> 1))
  ------------------
  |  Branch (300:11): [True: 10.0k, False: 22.3M]
  ------------------
  301|  10.0k|        entropy->dc_context[ci] = 0;               /* zero diff category */
  302|  22.3M|      else if (m > (int)((1L << cinfo->arith_dc_U[tbl]) >> 1))
  ------------------
  |  Branch (302:16): [True: 21.0M, False: 1.32M]
  ------------------
  303|  21.0M|        entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */
  304|  1.32M|      else
  305|  1.32M|        entropy->dc_context[ci] = 4 + (sign * 4);  /* small diff category */
  306|  22.3M|      v = m;
  307|       |      /* Figure F.24: Decoding the magnitude bit pattern of v */
  308|  22.3M|      st += 14;
  309|  45.2M|      while (m >>= 1)
  ------------------
  |  Branch (309:14): [True: 22.8M, False: 22.3M]
  ------------------
  310|  22.8M|        if (arith_decode(cinfo, st)) v |= m;
  ------------------
  |  Branch (310:13): [True: 21.7M, False: 1.10M]
  ------------------
  311|  22.3M|      v += 1;  if (sign) v = -v;
  ------------------
  |  Branch (311:20): [True: 21.5M, False: 867k]
  ------------------
  312|  22.3M|      entropy->last_dc_val[ci] = (entropy->last_dc_val[ci] + v) & 0xffff;
  313|  22.3M|    }
  314|       |
  315|       |    /* Scale and output the DC coefficient (assumes jpeg_natural_order[0]=0) */
  316|  44.2M|    (*block)[0] = (JCOEF)LEFT_SHIFT(entropy->last_dc_val[ci], cinfo->Al);
  ------------------
  |  |   56|  44.2M|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
  317|  44.2M|  }
  318|       |
  319|  43.0M|  return TRUE;
  ------------------
  |  |  248|  43.0M|#define TRUE    1
  ------------------
  320|  43.0M|}
jdarith.c:process_restart:
  200|   308k|{
  201|   308k|  arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
  202|   308k|  int ci;
  203|   308k|  jpeg_component_info *compptr;
  204|       |
  205|       |  /* Advance past the RSTn marker */
  206|   308k|  if (!(*cinfo->marker->read_restart_marker) (cinfo))
  ------------------
  |  Branch (206:7): [True: 0, False: 308k]
  ------------------
  207|      0|    ERREXIT(cinfo, JERR_CANT_SUSPEND);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  208|       |
  209|       |  /* Re-initialize statistics areas */
  210|   624k|  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  ------------------
  |  Branch (210:16): [True: 316k, False: 308k]
  ------------------
  211|   316k|    compptr = cinfo->cur_comp_info[ci];
  212|   316k|    if (!cinfo->progressive_mode || (cinfo->Ss == 0 && cinfo->Ah == 0)) {
  ------------------
  |  Branch (212:9): [True: 57.4k, False: 258k]
  |  Branch (212:38): [True: 69.1k, False: 189k]
  |  Branch (212:56): [True: 44.7k, False: 24.4k]
  ------------------
  213|   102k|      MEMZERO(entropy->dc_stats[compptr->dc_tbl_no], DC_STAT_BINS);
  ------------------
  |  |   73|   102k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
  214|       |      /* Reset DC predictions to 0 */
  215|   102k|      entropy->last_dc_val[ci] = 0;
  216|   102k|      entropy->dc_context[ci] = 0;
  217|   102k|    }
  218|   316k|    if (!cinfo->progressive_mode || cinfo->Ss) {
  ------------------
  |  Branch (218:9): [True: 57.4k, False: 258k]
  |  Branch (218:37): [True: 189k, False: 69.1k]
  ------------------
  219|   247k|      MEMZERO(entropy->ac_stats[compptr->ac_tbl_no], AC_STAT_BINS);
  ------------------
  |  |   73|   247k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
  220|   247k|    }
  221|   316k|  }
  222|       |
  223|       |  /* Reset arithmetic decoding variables */
  224|   308k|  entropy->c = 0;
  225|   308k|  entropy->a = 0;
  226|   308k|  entropy->ct = -16;    /* force reading 2 initial bytes to fill C */
  227|       |
  228|       |  /* Reset restart counter */
  229|   308k|  entropy->restarts_to_go = cinfo->restart_interval;
  230|   308k|}
jdarith.c:arith_decode:
  116|   321M|{
  117|   321M|  register arith_entropy_ptr e = (arith_entropy_ptr)cinfo->entropy;
  118|   321M|  register unsigned char nl, nm;
  119|   321M|  register JLONG qe, temp;
  120|   321M|  register int sv, data;
  121|       |
  122|       |  /* Renormalization & data input per section D.2.6 */
  123|   355M|  while (e->a < 0x8000L) {
  ------------------
  |  Branch (123:10): [True: 34.3M, False: 321M]
  ------------------
  124|  34.3M|    if (--e->ct < 0) {
  ------------------
  |  Branch (124:9): [True: 5.01M, False: 29.3M]
  ------------------
  125|       |      /* Need to fetch next data byte */
  126|  5.01M|      if (cinfo->unread_marker)
  ------------------
  |  Branch (126:11): [True: 4.86M, False: 155k]
  ------------------
  127|  4.86M|        data = 0;               /* stuff zero data */
  128|   155k|      else {
  129|   155k|        data = get_byte(cinfo); /* read next input byte */
  130|   155k|        if (data == 0xFF) {     /* zero stuff or marker code */
  ------------------
  |  Branch (130:13): [True: 15.1k, False: 140k]
  ------------------
  131|  26.1k|          do data = get_byte(cinfo);
  132|  26.1k|          while (data == 0xFF); /* swallow extra 0xFF bytes */
  ------------------
  |  Branch (132:18): [True: 10.9k, False: 15.1k]
  ------------------
  133|  15.1k|          if (data == 0)
  ------------------
  |  Branch (133:15): [True: 5.57k, False: 9.60k]
  ------------------
  134|  5.57k|            data = 0xFF;        /* discard stuffed zero byte */
  135|  9.60k|          else {
  136|       |            /* Note: Different from the Huffman decoder, hitting
  137|       |             * a marker while processing the compressed data
  138|       |             * segment is legal in arithmetic coding.
  139|       |             * The convention is to supply zero data
  140|       |             * then until decoding is complete.
  141|       |             */
  142|  9.60k|            cinfo->unread_marker = data;
  143|  9.60k|            data = 0;
  144|  9.60k|          }
  145|  15.1k|        }
  146|   155k|      }
  147|  5.01M|      e->c = (e->c << 8) | data; /* insert data into C register */
  148|  5.01M|      if ((e->ct += 8) < 0)      /* update bit shift counter */
  ------------------
  |  Branch (148:11): [True: 635k, False: 4.38M]
  ------------------
  149|       |        /* Need more initial bytes */
  150|   635k|        if (++e->ct == 0)
  ------------------
  |  Branch (150:13): [True: 317k, False: 317k]
  ------------------
  151|       |          /* Got 2 initial bytes -> re-init A and exit loop */
  152|   317k|          e->a = 0x8000L; /* => e->a = 0x10000L after loop exit */
  153|  5.01M|    }
  154|  34.3M|    e->a <<= 1;
  155|  34.3M|  }
  156|       |
  157|       |  /* Fetch values from our compact representation of Table D.2:
  158|       |   * Qe values and probability estimation state machine
  159|       |   */
  160|   321M|  sv = *st;
  161|   321M|  qe = jpeg_aritab[sv & 0x7F];  /* => Qe_Value */
  162|   321M|  nl = qe & 0xFF;  qe >>= 8;    /* Next_Index_LPS + Switch_MPS */
  163|   321M|  nm = qe & 0xFF;  qe >>= 8;    /* Next_Index_MPS */
  164|       |
  165|       |  /* Decode & estimation procedures per sections D.2.4 & D.2.5 */
  166|   321M|  temp = e->a - qe;
  167|   321M|  e->a = temp;
  168|   321M|  temp <<= e->ct;
  169|   321M|  if (e->c >= temp) {
  ------------------
  |  Branch (169:7): [True: 8.60M, False: 312M]
  ------------------
  170|  8.60M|    e->c -= temp;
  171|       |    /* Conditional LPS (less probable symbol) exchange */
  172|  8.60M|    if (e->a < qe) {
  ------------------
  |  Branch (172:9): [True: 2.53M, False: 6.06M]
  ------------------
  173|  2.53M|      e->a = qe;
  174|  2.53M|      *st = (sv & 0x80) ^ nm;   /* Estimate_after_MPS */
  175|  6.06M|    } else {
  176|  6.06M|      e->a = qe;
  177|  6.06M|      *st = (sv & 0x80) ^ nl;   /* Estimate_after_LPS */
  178|  6.06M|      sv ^= 0x80;               /* Exchange LPS/MPS */
  179|  6.06M|    }
  180|   312M|  } else if (e->a < 0x8000L) {
  ------------------
  |  Branch (180:14): [True: 16.9M, False: 295M]
  ------------------
  181|       |    /* Conditional MPS (more probable symbol) exchange */
  182|  16.9M|    if (e->a < qe) {
  ------------------
  |  Branch (182:9): [True: 6.27M, False: 10.7M]
  ------------------
  183|  6.27M|      *st = (sv & 0x80) ^ nl;   /* Estimate_after_LPS */
  184|  6.27M|      sv ^= 0x80;               /* Exchange LPS/MPS */
  185|  10.7M|    } else {
  186|  10.7M|      *st = (sv & 0x80) ^ nm;   /* Estimate_after_MPS */
  187|  10.7M|    }
  188|  16.9M|  }
  189|       |
  190|   321M|  return sv >> 7;
  191|   321M|}
jdarith.c:get_byte:
   76|   181k|{
   77|   181k|  struct jpeg_source_mgr *src = cinfo->src;
   78|       |
   79|   181k|  if (src->bytes_in_buffer == 0)
  ------------------
  |  Branch (79:7): [True: 857, False: 180k]
  ------------------
   80|    857|    if (!(*src->fill_input_buffer) (cinfo))
  ------------------
  |  Branch (80:9): [True: 0, False: 857]
  ------------------
   81|      0|      ERREXIT(cinfo, JERR_CANT_SUSPEND);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
   82|   181k|  src->bytes_in_buffer--;
   83|   181k|  return GETJOCTET(*src->next_input_byte++);
  ------------------
  |  |  103|   181k|#define GETJOCTET(value)  (value)
  ------------------
   84|   181k|}
jdarith.c:decode_mcu_AC_first:
  330|  9.46M|{
  331|  9.46M|  arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
  332|  9.46M|  JBLOCKROW block;
  333|  9.46M|  unsigned char *st;
  334|  9.46M|  int tbl, sign, k;
  335|  9.46M|  int v, m;
  336|       |
  337|       |  /* Process restart marker if needed */
  338|  9.46M|  if (cinfo->restart_interval) {
  ------------------
  |  Branch (338:7): [True: 1.63M, False: 7.83M]
  ------------------
  339|  1.63M|    if (entropy->restarts_to_go == 0)
  ------------------
  |  Branch (339:9): [True: 139k, False: 1.49M]
  ------------------
  340|   139k|      process_restart(cinfo);
  341|  1.63M|    entropy->restarts_to_go--;
  342|  1.63M|  }
  343|       |
  344|  9.46M|  if (entropy->ct == -1) return TRUE;   /* if error do nothing */
  ------------------
  |  |  248|  5.19M|#define TRUE    1
  ------------------
  |  Branch (344:7): [True: 5.19M, False: 4.27M]
  ------------------
  345|       |
  346|       |  /* There is always only one block per MCU */
  347|  4.27M|  block = MCU_data[0];
  348|  4.27M|  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
  349|       |
  350|       |  /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */
  351|       |
  352|       |  /* Figure F.20: Decode_AC_coefficients */
  353|  6.49M|  for (k = cinfo->Ss; k <= cinfo->Se; k++) {
  ------------------
  |  Branch (353:23): [True: 6.47M, False: 21.6k]
  ------------------
  354|  6.47M|    st = entropy->ac_stats[tbl] + 3 * (k - 1);
  355|  6.47M|    if (arith_decode(cinfo, st)) break;         /* EOB flag */
  ------------------
  |  Branch (355:9): [True: 4.25M, False: 2.22M]
  ------------------
  356|  4.62M|    while (arith_decode(cinfo, st + 1) == 0) {
  ------------------
  |  Branch (356:12): [True: 2.40M, False: 2.22M]
  ------------------
  357|  2.40M|      st += 3;  k++;
  358|  2.40M|      if (k > cinfo->Se) {
  ------------------
  |  Branch (358:11): [True: 590, False: 2.40M]
  ------------------
  359|    590|        WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
  ------------------
  |  |  265|    590|  ((cinfo)->err->msg_code = (code), \
  |  |  266|    590|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  360|    590|        entropy->ct = -1;                       /* spectral overflow */
  361|    590|        return TRUE;
  ------------------
  |  |  248|    590|#define TRUE    1
  ------------------
  362|    590|      }
  363|  2.40M|    }
  364|       |    /* Figure F.21: Decoding nonzero value v */
  365|       |    /* Figure F.22: Decoding the sign of v */
  366|  2.22M|    sign = arith_decode(cinfo, entropy->fixed_bin);
  367|  2.22M|    st += 2;
  368|       |    /* Figure F.23: Decoding the magnitude category of v */
  369|  2.22M|    if ((m = arith_decode(cinfo, st)) != 0) {
  ------------------
  |  Branch (369:9): [True: 1.06M, False: 1.15M]
  ------------------
  370|  1.06M|      if (arith_decode(cinfo, st)) {
  ------------------
  |  Branch (370:11): [True: 909k, False: 153k]
  ------------------
  371|   909k|        m <<= 1;
  372|   909k|        st = entropy->ac_stats[tbl] +
  373|   909k|             (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
  ------------------
  |  Branch (373:15): [True: 357k, False: 551k]
  ------------------
  374|  1.93M|        while (arith_decode(cinfo, st)) {
  ------------------
  |  Branch (374:16): [True: 1.02M, False: 909k]
  ------------------
  375|  1.02M|          if ((m <<= 1) == 0x8000) {
  ------------------
  |  Branch (375:15): [True: 325, False: 1.02M]
  ------------------
  376|    325|            WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
  ------------------
  |  |  265|    325|  ((cinfo)->err->msg_code = (code), \
  |  |  266|    325|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  377|    325|            entropy->ct = -1;                   /* magnitude overflow */
  378|    325|            return TRUE;
  ------------------
  |  |  248|    325|#define TRUE    1
  ------------------
  379|    325|          }
  380|  1.02M|          st += 1;
  381|  1.02M|        }
  382|   909k|      }
  383|  1.06M|    }
  384|  2.22M|    v = m;
  385|       |    /* Figure F.24: Decoding the magnitude bit pattern of v */
  386|  2.22M|    st += 14;
  387|  4.14M|    while (m >>= 1)
  ------------------
  |  Branch (387:12): [True: 1.92M, False: 2.22M]
  ------------------
  388|  1.92M|      if (arith_decode(cinfo, st)) v |= m;
  ------------------
  |  Branch (388:11): [True: 1.05M, False: 870k]
  ------------------
  389|  2.22M|    v += 1;  if (sign) v = -v;
  ------------------
  |  Branch (389:18): [True: 1.09M, False: 1.12M]
  ------------------
  390|       |    /* Scale and output coefficient in natural (dezigzagged) order */
  391|  2.22M|    (*block)[jpeg_natural_order[k]] = (JCOEF)((unsigned)v << cinfo->Al);
  392|  2.22M|  }
  393|       |
  394|  4.27M|  return TRUE;
  ------------------
  |  |  248|  4.27M|#define TRUE    1
  ------------------
  395|  4.27M|}
jdarith.c:decode_mcu_DC_refine:
  404|   576k|{
  405|   576k|  arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
  406|   576k|  unsigned char *st;
  407|   576k|  int p1, blkn;
  408|       |
  409|       |  /* Process restart marker if needed */
  410|   576k|  if (cinfo->restart_interval) {
  ------------------
  |  Branch (410:7): [True: 297k, False: 279k]
  ------------------
  411|   297k|    if (entropy->restarts_to_go == 0)
  ------------------
  |  Branch (411:9): [True: 23.4k, False: 274k]
  ------------------
  412|  23.4k|      process_restart(cinfo);
  413|   297k|    entropy->restarts_to_go--;
  414|   297k|  }
  415|       |
  416|   576k|  st = entropy->fixed_bin;      /* use fixed probability estimation */
  417|   576k|  p1 = 1 << cinfo->Al;          /* 1 in the bit position being coded */
  418|       |
  419|       |  /* Outer loop handles each block in the MCU */
  420|       |
  421|  1.46M|  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  ------------------
  |  Branch (421:18): [True: 889k, False: 576k]
  ------------------
  422|       |    /* Encoded data is simply the next bit of the two's-complement DC value */
  423|   889k|    if (arith_decode(cinfo, st))
  ------------------
  |  Branch (423:9): [True: 473k, False: 415k]
  ------------------
  424|   473k|      MCU_data[blkn][0][0] |= p1;
  425|   889k|  }
  426|       |
  427|   576k|  return TRUE;
  ------------------
  |  |  248|   576k|#define TRUE    1
  ------------------
  428|   576k|}
jdarith.c:decode_mcu_AC_refine:
  437|  4.48M|{
  438|  4.48M|  arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
  439|  4.48M|  JBLOCKROW block;
  440|  4.48M|  JCOEFPTR thiscoef;
  441|  4.48M|  unsigned char *st;
  442|  4.48M|  int tbl, k, kex;
  443|  4.48M|  int p1, m1;
  444|       |
  445|       |  /* Process restart marker if needed */
  446|  4.48M|  if (cinfo->restart_interval) {
  ------------------
  |  Branch (446:7): [True: 2.46M, False: 2.02M]
  ------------------
  447|  2.46M|    if (entropy->restarts_to_go == 0)
  ------------------
  |  Branch (447:9): [True: 50.1k, False: 2.40M]
  ------------------
  448|  50.1k|      process_restart(cinfo);
  449|  2.46M|    entropy->restarts_to_go--;
  450|  2.46M|  }
  451|       |
  452|  4.48M|  if (entropy->ct == -1) return TRUE;   /* if error do nothing */
  ------------------
  |  |  248|  1.39M|#define TRUE    1
  ------------------
  |  Branch (452:7): [True: 1.39M, False: 3.09M]
  ------------------
  453|       |
  454|       |  /* There is always only one block per MCU */
  455|  3.09M|  block = MCU_data[0];
  456|  3.09M|  tbl = cinfo->cur_comp_info[0]->ac_tbl_no;
  457|       |
  458|  3.09M|  p1 = 1 << cinfo->Al;          /* 1 in the bit position being coded */
  459|  3.09M|  m1 = (NEG_1) << cinfo->Al;    /* -1 in the bit position being coded */
  ------------------
  |  |   27|  3.09M|#define NEG_1  ((unsigned int)-1)
  ------------------
  460|       |
  461|       |  /* Establish EOBx (previous stage end-of-block) index */
  462|  66.6M|  for (kex = cinfo->Se; kex > 0; kex--)
  ------------------
  |  Branch (462:25): [True: 65.1M, False: 1.45M]
  ------------------
  463|  65.1M|    if ((*block)[jpeg_natural_order[kex]]) break;
  ------------------
  |  Branch (463:9): [True: 1.63M, False: 63.5M]
  ------------------
  464|       |
  465|  29.1M|  for (k = cinfo->Ss; k <= cinfo->Se; k++) {
  ------------------
  |  Branch (465:23): [True: 28.9M, False: 185k]
  ------------------
  466|  28.9M|    st = entropy->ac_stats[tbl] + 3 * (k - 1);
  467|  28.9M|    if (k > kex)
  ------------------
  |  Branch (467:9): [True: 3.57M, False: 25.4M]
  ------------------
  468|  3.57M|      if (arith_decode(cinfo, st)) break;       /* EOB flag */
  ------------------
  |  Branch (468:11): [True: 2.90M, False: 669k]
  ------------------
  469|  27.6M|    for (;;) {
  470|  27.6M|      thiscoef = *block + jpeg_natural_order[k];
  471|  27.6M|      if (*thiscoef) {                          /* previously nonzero coef */
  ------------------
  |  Branch (471:11): [True: 25.0M, False: 2.53M]
  ------------------
  472|  25.0M|        if (arith_decode(cinfo, st + 2)) {
  ------------------
  |  Branch (472:13): [True: 19.5M, False: 5.52M]
  ------------------
  473|  19.5M|          if (*thiscoef < 0)
  ------------------
  |  Branch (473:15): [True: 10.4M, False: 9.07M]
  ------------------
  474|  10.4M|            *thiscoef += (JCOEF)m1;
  475|  9.07M|          else
  476|  9.07M|            *thiscoef += (JCOEF)p1;
  477|  19.5M|        }
  478|  25.0M|        break;
  479|  25.0M|      }
  480|  2.53M|      if (arith_decode(cinfo, st + 1)) {        /* newly nonzero coef */
  ------------------
  |  Branch (480:11): [True: 997k, False: 1.54M]
  ------------------
  481|   997k|        if (arith_decode(cinfo, entropy->fixed_bin))
  ------------------
  |  Branch (481:13): [True: 464k, False: 532k]
  ------------------
  482|   464k|          *thiscoef = (JCOEF)m1;
  483|   532k|        else
  484|   532k|          *thiscoef = (JCOEF)p1;
  485|   997k|        break;
  486|   997k|      }
  487|  1.54M|      st += 3;  k++;
  488|  1.54M|      if (k > cinfo->Se) {
  ------------------
  |  Branch (488:11): [True: 1.37k, False: 1.54M]
  ------------------
  489|  1.37k|        WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
  ------------------
  |  |  265|  1.37k|  ((cinfo)->err->msg_code = (code), \
  |  |  266|  1.37k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  490|  1.37k|        entropy->ct = -1;                       /* spectral overflow */
  491|  1.37k|        return TRUE;
  ------------------
  |  |  248|  1.37k|#define TRUE    1
  ------------------
  492|  1.37k|      }
  493|  1.54M|    }
  494|  26.0M|  }
  495|       |
  496|  3.09M|  return TRUE;
  ------------------
  |  |  248|  3.09M|#define TRUE    1
  ------------------
  497|  3.09M|}
jdarith.c:decode_mcu:
  506|  5.21M|{
  507|  5.21M|  arith_entropy_ptr entropy = (arith_entropy_ptr)cinfo->entropy;
  508|  5.21M|  jpeg_component_info *compptr;
  509|  5.21M|  JBLOCKROW block;
  510|  5.21M|  unsigned char *st;
  511|  5.21M|  int blkn, ci, tbl, sign, k;
  512|  5.21M|  int v, m;
  513|       |
  514|       |  /* Process restart marker if needed */
  515|  5.21M|  if (cinfo->restart_interval) {
  ------------------
  |  Branch (515:7): [True: 908k, False: 4.30M]
  ------------------
  516|   908k|    if (entropy->restarts_to_go == 0)
  ------------------
  |  Branch (516:9): [True: 51.3k, False: 857k]
  ------------------
  517|  51.3k|      process_restart(cinfo);
  518|   908k|    entropy->restarts_to_go--;
  519|   908k|  }
  520|       |
  521|  5.21M|  if (entropy->ct == -1) return TRUE;   /* if error do nothing */
  ------------------
  |  |  248|   678k|#define TRUE    1
  ------------------
  |  Branch (521:7): [True: 678k, False: 4.53M]
  ------------------
  522|       |
  523|       |  /* Outer loop handles each block in the MCU */
  524|       |
  525|  12.2M|  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  ------------------
  |  Branch (525:18): [True: 7.71M, False: 4.53M]
  ------------------
  526|  7.71M|    block = MCU_data ? MCU_data[blkn] : NULL;
  ------------------
  |  Branch (526:13): [True: 7.71M, False: 0]
  ------------------
  527|  7.71M|    ci = cinfo->MCU_membership[blkn];
  528|  7.71M|    compptr = cinfo->cur_comp_info[ci];
  529|       |
  530|       |    /* Sections F.2.4.1 & F.1.4.4.1: Decoding of DC coefficients */
  531|       |
  532|  7.71M|    tbl = compptr->dc_tbl_no;
  533|       |
  534|       |    /* Table F.4: Point to statistics bin S0 for DC coefficient coding */
  535|  7.71M|    st = entropy->dc_stats[tbl] + entropy->dc_context[ci];
  536|       |
  537|       |    /* Figure F.19: Decode_DC_DIFF */
  538|  7.71M|    if (arith_decode(cinfo, st) == 0)
  ------------------
  |  Branch (538:9): [True: 3.04M, False: 4.67M]
  ------------------
  539|  3.04M|      entropy->dc_context[ci] = 0;
  540|  4.67M|    else {
  541|       |      /* Figure F.21: Decoding nonzero value v */
  542|       |      /* Figure F.22: Decoding the sign of v */
  543|  4.67M|      sign = arith_decode(cinfo, st + 1);
  544|  4.67M|      st += 2;  st += sign;
  545|       |      /* Figure F.23: Decoding the magnitude category of v */
  546|  4.67M|      if ((m = arith_decode(cinfo, st)) != 0) {
  ------------------
  |  Branch (546:11): [True: 3.99M, False: 677k]
  ------------------
  547|  3.99M|        st = entropy->dc_stats[tbl] + 20;       /* Table F.4: X1 = 20 */
  548|  21.1M|        while (arith_decode(cinfo, st)) {
  ------------------
  |  Branch (548:16): [True: 17.1M, False: 3.99M]
  ------------------
  549|  17.1M|          if ((m <<= 1) == 0x8000) {
  ------------------
  |  Branch (549:15): [True: 289, False: 17.1M]
  ------------------
  550|    289|            WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
  ------------------
  |  |  265|    289|  ((cinfo)->err->msg_code = (code), \
  |  |  266|    289|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  551|    289|            entropy->ct = -1;                   /* magnitude overflow */
  552|    289|            return TRUE;
  ------------------
  |  |  248|    289|#define TRUE    1
  ------------------
  553|    289|          }
  554|  17.1M|          st += 1;
  555|  17.1M|        }
  556|  3.99M|      }
  557|       |      /* Section F.1.4.4.1.2: Establish dc_context conditioning category */
  558|  4.67M|      if (m < (int)((1L << cinfo->arith_dc_L[tbl]) >> 1))
  ------------------
  |  Branch (558:11): [True: 751, False: 4.67M]
  ------------------
  559|    751|        entropy->dc_context[ci] = 0;               /* zero diff category */
  560|  4.67M|      else if (m > (int)((1L << cinfo->arith_dc_U[tbl]) >> 1))
  ------------------
  |  Branch (560:16): [True: 3.59M, False: 1.07M]
  ------------------
  561|  3.59M|        entropy->dc_context[ci] = 12 + (sign * 4); /* large diff category */
  562|  1.07M|      else
  563|  1.07M|        entropy->dc_context[ci] = 4 + (sign * 4);  /* small diff category */
  564|  4.67M|      v = m;
  565|       |      /* Figure F.24: Decoding the magnitude bit pattern of v */
  566|  4.67M|      st += 14;
  567|  21.8M|      while (m >>= 1)
  ------------------
  |  Branch (567:14): [True: 17.1M, False: 4.67M]
  ------------------
  568|  17.1M|        if (arith_decode(cinfo, st)) v |= m;
  ------------------
  |  Branch (568:13): [True: 8.57M, False: 8.60M]
  ------------------
  569|  4.67M|      v += 1;  if (sign) v = -v;
  ------------------
  |  Branch (569:20): [True: 3.90M, False: 762k]
  ------------------
  570|  4.67M|      entropy->last_dc_val[ci] = (entropy->last_dc_val[ci] + v) & 0xffff;
  571|  4.67M|    }
  572|       |
  573|  7.71M|    if (block)
  ------------------
  |  Branch (573:9): [True: 7.71M, False: 0]
  ------------------
  574|  7.71M|      (*block)[0] = (JCOEF)entropy->last_dc_val[ci];
  575|       |
  576|       |    /* Sections F.2.4.2 & F.1.4.4.2: Decoding of AC coefficients */
  577|       |
  578|  7.71M|    tbl = compptr->ac_tbl_no;
  579|       |
  580|       |    /* Figure F.20: Decode_AC_coefficients */
  581|  13.8M|    for (k = 1; k <= DCTSIZE2 - 1; k++) {
  ------------------
  |  |   47|  13.8M|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (581:17): [True: 13.8M, False: 196]
  ------------------
  582|  13.8M|      st = entropy->ac_stats[tbl] + 3 * (k - 1);
  583|  13.8M|      if (arith_decode(cinfo, st)) break;       /* EOB flag */
  ------------------
  |  Branch (583:11): [True: 7.71M, False: 6.12M]
  ------------------
  584|  13.1M|      while (arith_decode(cinfo, st + 1) == 0) {
  ------------------
  |  Branch (584:14): [True: 6.99M, False: 6.12M]
  ------------------
  585|  6.99M|        st += 3;  k++;
  586|  6.99M|        if (k > DCTSIZE2 - 1) {
  ------------------
  |  |   47|  6.99M|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (586:13): [True: 231, False: 6.99M]
  ------------------
  587|    231|          WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
  ------------------
  |  |  265|    231|  ((cinfo)->err->msg_code = (code), \
  |  |  266|    231|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  588|    231|          entropy->ct = -1;                     /* spectral overflow */
  589|    231|          return TRUE;
  ------------------
  |  |  248|    231|#define TRUE    1
  ------------------
  590|    231|        }
  591|  6.99M|      }
  592|       |      /* Figure F.21: Decoding nonzero value v */
  593|       |      /* Figure F.22: Decoding the sign of v */
  594|  6.12M|      sign = arith_decode(cinfo, entropy->fixed_bin);
  595|  6.12M|      st += 2;
  596|       |      /* Figure F.23: Decoding the magnitude category of v */
  597|  6.12M|      if ((m = arith_decode(cinfo, st)) != 0) {
  ------------------
  |  Branch (597:11): [True: 3.88M, False: 2.23M]
  ------------------
  598|  3.88M|        if (arith_decode(cinfo, st)) {
  ------------------
  |  Branch (598:13): [True: 3.46M, False: 419k]
  ------------------
  599|  3.46M|          m <<= 1;
  600|  3.46M|          st = entropy->ac_stats[tbl] +
  601|  3.46M|               (k <= cinfo->arith_ac_K[tbl] ? 189 : 217);
  ------------------
  |  Branch (601:17): [True: 2.78M, False: 681k]
  ------------------
  602|  6.52M|          while (arith_decode(cinfo, st)) {
  ------------------
  |  Branch (602:18): [True: 3.06M, False: 3.46M]
  ------------------
  603|  3.06M|            if ((m <<= 1) == 0x8000) {
  ------------------
  |  Branch (603:17): [True: 320, False: 3.06M]
  ------------------
  604|    320|              WARNMS(cinfo, JWRN_ARITH_BAD_CODE);
  ------------------
  |  |  265|    320|  ((cinfo)->err->msg_code = (code), \
  |  |  266|    320|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  605|    320|              entropy->ct = -1;                 /* magnitude overflow */
  606|    320|              return TRUE;
  ------------------
  |  |  248|    320|#define TRUE    1
  ------------------
  607|    320|            }
  608|  3.06M|            st += 1;
  609|  3.06M|          }
  610|  3.46M|        }
  611|  3.88M|      }
  612|  6.12M|      v = m;
  613|       |      /* Figure F.24: Decoding the magnitude bit pattern of v */
  614|  6.12M|      st += 14;
  615|  12.6M|      while (m >>= 1)
  ------------------
  |  Branch (615:14): [True: 6.52M, False: 6.12M]
  ------------------
  616|  6.52M|        if (arith_decode(cinfo, st)) v |= m;
  ------------------
  |  Branch (616:13): [True: 3.54M, False: 2.98M]
  ------------------
  617|  6.12M|      v += 1;  if (sign) v = -v;
  ------------------
  |  Branch (617:20): [True: 2.90M, False: 3.21M]
  ------------------
  618|  6.12M|      if (block)
  ------------------
  |  Branch (618:11): [True: 6.12M, False: 0]
  ------------------
  619|  6.12M|        (*block)[jpeg_natural_order[k]] = (JCOEF)v;
  620|  6.12M|    }
  621|  7.71M|  }
  622|       |
  623|  4.53M|  return TRUE;
  ------------------
  |  |  248|  4.53M|#define TRUE    1
  ------------------
  624|  4.53M|}

jpeg_mem_src_tj:
  165|  15.4k|{
  166|  15.4k|  struct jpeg_source_mgr *src;
  167|       |
  168|  15.4k|  if (inbuffer == NULL || insize == 0)  /* Treat empty input as fatal error */
  ------------------
  |  Branch (168:7): [True: 0, False: 15.4k]
  |  Branch (168:27): [True: 0, False: 15.4k]
  ------------------
  169|      0|    ERREXIT(cinfo, JERR_INPUT_EMPTY);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  170|       |
  171|       |  /* The source object is made permanent so that a series of JPEG images
  172|       |   * can be read from the same buffer by calling jpeg_mem_src only before
  173|       |   * the first one.
  174|       |   */
  175|  15.4k|  if (cinfo->src == NULL) {     /* first time for this JPEG object? */
  ------------------
  |  Branch (175:7): [True: 5.16k, False: 10.2k]
  ------------------
  176|  5.16k|    cinfo->src = (struct jpeg_source_mgr *)
  177|  5.16k|      (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
  ------------------
  |  |  825|  5.16k|#define JPOOL_PERMANENT  0      /* lasts until master record is destroyed */
  ------------------
  178|  5.16k|                                  sizeof(struct jpeg_source_mgr));
  179|  10.2k|  } else if (cinfo->src->init_source != init_mem_source) {
  ------------------
  |  Branch (179:14): [True: 0, False: 10.2k]
  ------------------
  180|       |    /* It is unsafe to reuse the existing source manager unless it was created
  181|       |     * by this function.
  182|       |     */
  183|      0|    ERREXIT(cinfo, JERR_BUFFER_SIZE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  184|      0|  }
  185|       |
  186|  15.4k|  src = cinfo->src;
  187|  15.4k|  src->init_source = init_mem_source;
  188|  15.4k|  src->fill_input_buffer = fill_mem_input_buffer;
  189|  15.4k|  src->skip_input_data = skip_input_data;
  190|  15.4k|  src->resync_to_restart = jpeg_resync_to_restart; /* use default method */
  191|  15.4k|  src->term_source = term_source;
  192|  15.4k|  src->bytes_in_buffer = (size_t)insize;
  193|  15.4k|  src->next_input_byte = (const JOCTET *)inbuffer;
  194|  15.4k|}
jdatasrc-tj.c:init_mem_source:
   37|  10.2k|{
   38|       |  /* no work necessary here */
   39|  10.2k|}
jdatasrc-tj.c:fill_mem_input_buffer:
   77|  6.56M|{
   78|  6.56M|  static const JOCTET mybuffer[4] = {
   79|  6.56M|    (JOCTET)0xFF, (JOCTET)JPEG_EOI, 0, 0
  ------------------
  |  | 1076|  6.56M|#define JPEG_EOI        0xD9    /* EOI marker code */
  ------------------
   80|  6.56M|  };
   81|       |
   82|       |  /* The whole JPEG data is expected to reside in the supplied memory
   83|       |   * buffer, so any request for more data beyond the given buffer size
   84|       |   * is treated as an error.
   85|       |   */
   86|  6.56M|  WARNMS(cinfo, JWRN_JPEG_EOF);
  ------------------
  |  |  265|  6.56M|  ((cinfo)->err->msg_code = (code), \
  |  |  266|  6.56M|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
   87|       |
   88|       |  /* Insert a fake EOI marker */
   89|       |
   90|  6.56M|  cinfo->src->next_input_byte = mybuffer;
   91|  6.56M|  cinfo->src->bytes_in_buffer = 2;
   92|       |
   93|  6.56M|  return TRUE;
  ------------------
  |  |  248|  6.56M|#define TRUE    1
  ------------------
   94|  6.56M|}
jdatasrc-tj.c:skip_input_data:
  111|  4.38k|{
  112|  4.38k|  struct jpeg_source_mgr *src = cinfo->src;
  113|       |
  114|       |  /* Just a dumb implementation for now.  Could use fseek() except
  115|       |   * it doesn't work on pipes.  Not clear that being smart is worth
  116|       |   * any trouble anyway --- large skips are infrequent.
  117|       |   */
  118|  4.38k|  if (num_bytes > 0) {
  ------------------
  |  Branch (118:7): [True: 4.38k, False: 0]
  ------------------
  119|  6.55M|    while (num_bytes > (long)src->bytes_in_buffer) {
  ------------------
  |  Branch (119:12): [True: 6.54M, False: 4.38k]
  ------------------
  120|  6.54M|      num_bytes -= (long)src->bytes_in_buffer;
  121|  6.54M|      (void)(*src->fill_input_buffer) (cinfo);
  122|       |      /* note we assume that fill_input_buffer will never return FALSE,
  123|       |       * so suspension need not be handled.
  124|       |       */
  125|  6.54M|    }
  126|  4.38k|    src->next_input_byte += (size_t)num_bytes;
  127|  4.38k|    src->bytes_in_buffer -= (size_t)num_bytes;
  128|  4.38k|  }
  129|  4.38k|}
jdatasrc-tj.c:term_source:
  152|  3.31k|{
  153|       |  /* no work necessary here */
  154|  3.31k|}

jinit_d_coef_controller:
  630|  4.56k|{
  631|  4.56k|  my_coef_ptr coef;
  632|       |
  633|  4.56k|  coef = (my_coef_ptr)
  634|  4.56k|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  4.56k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  635|  4.56k|                                sizeof(my_coef_controller));
  636|  4.56k|  cinfo->coef = (struct jpeg_d_coef_controller *)coef;
  637|  4.56k|  coef->pub.start_input_pass = start_input_pass;
  638|  4.56k|  coef->pub.start_output_pass = start_output_pass;
  639|  4.56k|#ifdef BLOCK_SMOOTHING_SUPPORTED
  640|  4.56k|  coef->coef_bits_latch = NULL;
  641|  4.56k|#endif
  642|       |
  643|       |  /* Create the coefficient buffer. */
  644|  4.56k|  if (need_full_buffer) {
  ------------------
  |  Branch (644:7): [True: 3.31k, False: 1.25k]
  ------------------
  645|  3.31k|#ifdef D_MULTISCAN_FILES_SUPPORTED
  646|       |    /* Allocate a full-image virtual array for each component, */
  647|       |    /* padded to a multiple of samp_factor DCT blocks in each direction. */
  648|       |    /* Note we ask for a pre-zeroed array. */
  649|  3.31k|    int ci, access_rows;
  650|  3.31k|    jpeg_component_info *compptr;
  651|       |
  652|  9.99k|    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (652:46): [True: 6.68k, False: 3.31k]
  ------------------
  653|  6.68k|         ci++, compptr++) {
  654|  6.68k|      access_rows = compptr->v_samp_factor;
  655|  6.68k|#ifdef BLOCK_SMOOTHING_SUPPORTED
  656|       |      /* If block smoothing could be used, need a bigger window */
  657|  6.68k|      if (cinfo->progressive_mode)
  ------------------
  |  Branch (657:11): [True: 3.37k, False: 3.31k]
  ------------------
  658|  3.37k|        access_rows *= 3;
  659|  6.68k|#endif
  660|  6.68k|      coef->whole_image[ci] = (*cinfo->mem->request_virt_barray)
  661|  6.68k|        ((j_common_ptr)cinfo, JPOOL_IMAGE, TRUE,
  ------------------
  |  |  826|  6.68k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
                      ((j_common_ptr)cinfo, JPOOL_IMAGE, TRUE,
  ------------------
  |  |  248|  6.68k|#define TRUE    1
  ------------------
  662|  6.68k|         (JDIMENSION)jround_up((long)compptr->width_in_blocks,
  663|  6.68k|                               (long)compptr->h_samp_factor),
  664|  6.68k|         (JDIMENSION)jround_up((long)compptr->height_in_blocks,
  665|  6.68k|                               (long)compptr->v_samp_factor),
  666|  6.68k|         (JDIMENSION)access_rows);
  667|  6.68k|    }
  668|  3.31k|    coef->pub.consume_data = consume_data;
  669|  3.31k|    coef->pub.decompress_data = decompress_data;
  670|  3.31k|    coef->pub.coef_arrays = coef->whole_image; /* link to virtual arrays */
  671|       |#else
  672|       |    ERREXIT(cinfo, JERR_NOT_COMPILED);
  673|       |#endif
  674|  3.31k|  } else {
  675|       |    /* We only need a single-MCU buffer. */
  676|  1.25k|    JBLOCKROW buffer;
  677|  1.25k|    int i;
  678|       |
  679|  1.25k|    buffer = (JBLOCKROW)
  680|  1.25k|      (*cinfo->mem->alloc_large) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  1.25k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  681|  1.25k|                                  D_MAX_BLOCKS_IN_MCU * sizeof(JBLOCK));
  ------------------
  |  |   62|  1.25k|#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */
  ------------------
  682|  13.7k|    for (i = 0; i < D_MAX_BLOCKS_IN_MCU; i++) {
  ------------------
  |  |   62|  13.7k|#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */
  ------------------
  |  Branch (682:17): [True: 12.5k, False: 1.25k]
  ------------------
  683|  12.5k|      coef->MCU_buffer[i] = buffer + i;
  684|  12.5k|    }
  685|  1.25k|    coef->pub.consume_data = dummy_consume_data;
  686|  1.25k|    coef->pub.decompress_data = decompress_onepass;
  687|  1.25k|    coef->pub.coef_arrays = NULL; /* flag for no virtual arrays */
  688|  1.25k|  }
  689|       |
  690|       |  /* Allocate the workspace buffer */
  691|  4.56k|  coef->workspace = (JCOEF *)
  692|  4.56k|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  4.56k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  693|  4.56k|                                sizeof(JCOEF) * DCTSIZE2);
  ------------------
  |  |   47|  4.56k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  694|  4.56k|}
jdcoefct.c:start_input_pass:
   46|  22.4k|{
   47|  22.4k|  cinfo->input_iMCU_row = 0;
   48|  22.4k|  start_iMCU_row(cinfo);
   49|  22.4k|}
jdcoefct.c:start_output_pass:
   58|  3.60k|{
   59|  3.60k|#ifdef BLOCK_SMOOTHING_SUPPORTED
   60|  3.60k|  my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
   61|       |
   62|       |  /* If multipass, check to see whether to use block smoothing on this pass */
   63|  3.60k|  if (coef->pub.coef_arrays != NULL) {
  ------------------
  |  Branch (63:7): [True: 2.43k, False: 1.17k]
  ------------------
   64|  2.43k|    if (cinfo->do_block_smoothing && smoothing_ok(cinfo))
  ------------------
  |  Branch (64:9): [True: 2.43k, False: 0]
  |  Branch (64:38): [True: 655, False: 1.77k]
  ------------------
   65|    655|      coef->pub.decompress_data = decompress_smooth_data;
   66|  1.77k|    else
   67|  1.77k|      coef->pub.decompress_data = decompress_data;
   68|  2.43k|  }
   69|  3.60k|#endif
   70|  3.60k|  cinfo->output_iMCU_row = 0;
   71|  3.60k|}
jdcoefct.c:smoothing_ok:
  353|  2.43k|{
  354|  2.43k|  my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
  355|  2.43k|  boolean smoothing_useful = FALSE;
  ------------------
  |  |  245|  2.43k|#define FALSE   0               /* values of boolean */
  ------------------
  356|  2.43k|  int ci, coefi;
  357|  2.43k|  jpeg_component_info *compptr;
  358|  2.43k|  JQUANT_TBL *qtable;
  359|  2.43k|  int *coef_bits;
  360|  2.43k|  int *coef_bits_latch;
  361|       |
  362|  2.43k|  if (!cinfo->progressive_mode || cinfo->coef_bits == NULL)
  ------------------
  |  Branch (362:7): [True: 645, False: 1.78k]
  |  Branch (362:35): [True: 0, False: 1.78k]
  ------------------
  363|    645|    return FALSE;
  ------------------
  |  |  245|    645|#define FALSE   0               /* values of boolean */
  ------------------
  364|       |
  365|       |  /* Allocate latch area if not already done */
  366|  1.78k|  if (coef->coef_bits_latch == NULL)
  ------------------
  |  Branch (366:7): [True: 1.78k, False: 0]
  ------------------
  367|  1.78k|    coef->coef_bits_latch = (int *)
  368|  1.78k|      (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  1.78k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  369|  1.78k|                                  cinfo->num_components *
  370|  1.78k|                                  (SAVED_COEFS * sizeof(int)));
  ------------------
  |  |   54|  1.78k|#define SAVED_COEFS  6          /* we save coef_bits[0..5] */
  ------------------
  371|  1.78k|  coef_bits_latch = coef->coef_bits_latch;
  372|       |
  373|  2.72k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (373:44): [True: 2.05k, False: 667]
  ------------------
  374|  2.05k|       ci++, compptr++) {
  375|       |    /* All components' quantization values must already be latched. */
  376|  2.05k|    if ((qtable = compptr->quant_table) == NULL)
  ------------------
  |  Branch (376:9): [True: 189, False: 1.86k]
  ------------------
  377|    189|      return FALSE;
  ------------------
  |  |  245|    189|#define FALSE   0               /* values of boolean */
  ------------------
  378|       |    /* Verify DC & first 5 AC quantizers are nonzero to avoid zero-divide. */
  379|  1.86k|    if (qtable->quantval[0] == 0 ||
  ------------------
  |  Branch (379:9): [True: 120, False: 1.74k]
  ------------------
  380|  1.86k|        qtable->quantval[Q01_POS] == 0 ||
  ------------------
  |  |  337|  1.74k|#define Q01_POS  1
  ------------------
  |  Branch (380:9): [True: 128, False: 1.62k]
  ------------------
  381|  1.86k|        qtable->quantval[Q10_POS] == 0 ||
  ------------------
  |  |  338|  1.62k|#define Q10_POS  8
  ------------------
  |  Branch (381:9): [True: 196, False: 1.42k]
  ------------------
  382|  1.86k|        qtable->quantval[Q20_POS] == 0 ||
  ------------------
  |  |  339|  1.42k|#define Q20_POS  16
  ------------------
  |  Branch (382:9): [True: 99, False: 1.32k]
  ------------------
  383|  1.86k|        qtable->quantval[Q11_POS] == 0 ||
  ------------------
  |  |  340|  1.32k|#define Q11_POS  9
  ------------------
  |  Branch (383:9): [True: 156, False: 1.17k]
  ------------------
  384|  1.86k|        qtable->quantval[Q02_POS] == 0)
  ------------------
  |  |  341|  1.17k|#define Q02_POS  2
  ------------------
  |  Branch (384:9): [True: 76, False: 1.09k]
  ------------------
  385|    775|      return FALSE;
  ------------------
  |  |  245|    775|#define FALSE   0               /* values of boolean */
  ------------------
  386|       |    /* DC values must be at least partly known for all components. */
  387|  1.09k|    coef_bits = cinfo->coef_bits[ci];
  388|  1.09k|    if (coef_bits[0] < 0)
  ------------------
  |  Branch (388:9): [True: 154, False: 940]
  ------------------
  389|    154|      return FALSE;
  ------------------
  |  |  245|    154|#define FALSE   0               /* values of boolean */
  ------------------
  390|       |    /* Block smoothing is helpful if some AC coefficients remain inaccurate. */
  391|  5.64k|    for (coefi = 1; coefi <= 5; coefi++) {
  ------------------
  |  Branch (391:21): [True: 4.70k, False: 940]
  ------------------
  392|  4.70k|      coef_bits_latch[coefi] = coef_bits[coefi];
  393|  4.70k|      if (coef_bits[coefi] != 0)
  ------------------
  |  Branch (393:11): [True: 4.57k, False: 121]
  ------------------
  394|  4.57k|        smoothing_useful = TRUE;
  ------------------
  |  |  248|  4.57k|#define TRUE    1
  ------------------
  395|  4.70k|    }
  396|    940|    coef_bits_latch += SAVED_COEFS;
  ------------------
  |  |   54|    940|#define SAVED_COEFS  6          /* we save coef_bits[0..5] */
  ------------------
  397|    940|  }
  398|       |
  399|    667|  return smoothing_useful;
  400|  1.78k|}
jdcoefct.c:decompress_smooth_data:
  409|   133k|{
  410|   133k|  my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
  411|   133k|  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
  412|   133k|  JDIMENSION block_num, last_block_column;
  413|   133k|  int ci, block_row, block_rows, access_rows;
  414|   133k|  JBLOCKARRAY buffer;
  415|   133k|  JBLOCKROW buffer_ptr, prev_block_row, next_block_row;
  416|   133k|  JSAMPARRAY output_ptr;
  417|   133k|  JDIMENSION output_col;
  418|   133k|  jpeg_component_info *compptr;
  419|   133k|  inverse_DCT_method_ptr inverse_DCT;
  420|   133k|  boolean first_row, last_row;
  421|   133k|  JCOEF *workspace;
  422|   133k|  int *coef_bits;
  423|   133k|  JQUANT_TBL *quanttbl;
  424|   133k|  JLONG Q00, Q01, Q02, Q10, Q11, Q20, num;
  425|   133k|  int DC1, DC2, DC3, DC4, DC5, DC6, DC7, DC8, DC9;
  426|   133k|  int Al, pred;
  427|       |
  428|       |  /* Keep a local variable to avoid looking it up more than once */
  429|   133k|  workspace = coef->workspace;
  430|       |
  431|       |  /* Force some input to be done if we are getting ahead of the input. */
  432|   133k|  while (cinfo->input_scan_number <= cinfo->output_scan_number &&
  ------------------
  |  Branch (432:10): [True: 133k, False: 0]
  ------------------
  433|   133k|         !cinfo->inputctl->eoi_reached) {
  ------------------
  |  Branch (433:10): [True: 0, False: 133k]
  ------------------
  434|      0|    if (cinfo->input_scan_number == cinfo->output_scan_number) {
  ------------------
  |  Branch (434:9): [True: 0, False: 0]
  ------------------
  435|       |      /* If input is working on current scan, we ordinarily want it to
  436|       |       * have completed the current row.  But if input scan is DC,
  437|       |       * we want it to keep one row ahead so that next block row's DC
  438|       |       * values are up to date.
  439|       |       */
  440|      0|      JDIMENSION delta = (cinfo->Ss == 0) ? 1 : 0;
  ------------------
  |  Branch (440:26): [True: 0, False: 0]
  ------------------
  441|      0|      if (cinfo->input_iMCU_row > cinfo->output_iMCU_row + delta)
  ------------------
  |  Branch (441:11): [True: 0, False: 0]
  ------------------
  442|      0|        break;
  443|      0|    }
  444|      0|    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  |  Branch (444:9): [True: 0, False: 0]
  ------------------
  445|      0|      return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  446|      0|  }
  447|       |
  448|       |  /* OK, output from the virtual arrays. */
  449|   330k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (449:44): [True: 197k, False: 133k]
  ------------------
  450|   197k|       ci++, compptr++) {
  451|       |    /* Don't bother to IDCT an uninteresting component. */
  452|   197k|    if (!compptr->component_needed)
  ------------------
  |  Branch (452:9): [True: 9.97k, False: 187k]
  ------------------
  453|  9.97k|      continue;
  454|       |    /* Count non-dummy DCT block rows in this iMCU row. */
  455|   187k|    if (cinfo->output_iMCU_row < last_iMCU_row) {
  ------------------
  |  Branch (455:9): [True: 186k, False: 789]
  ------------------
  456|   186k|      block_rows = compptr->v_samp_factor;
  457|   186k|      access_rows = block_rows * 2; /* this and next iMCU row */
  458|   186k|      last_row = FALSE;
  ------------------
  |  |  245|   186k|#define FALSE   0               /* values of boolean */
  ------------------
  459|   186k|    } else {
  460|       |      /* NB: can't use last_row_height here; it is input-side-dependent! */
  461|    789|      block_rows = (int)(compptr->height_in_blocks % compptr->v_samp_factor);
  462|    789|      if (block_rows == 0) block_rows = compptr->v_samp_factor;
  ------------------
  |  Branch (462:11): [True: 494, False: 295]
  ------------------
  463|    789|      access_rows = block_rows; /* this iMCU row only */
  464|    789|      last_row = TRUE;
  ------------------
  |  |  248|    789|#define TRUE    1
  ------------------
  465|    789|    }
  466|       |    /* Align the virtual buffer for this component. */
  467|   187k|    if (cinfo->output_iMCU_row > 0) {
  ------------------
  |  Branch (467:9): [True: 186k, False: 789]
  ------------------
  468|   186k|      access_rows += compptr->v_samp_factor; /* prior iMCU row too */
  469|   186k|      buffer = (*cinfo->mem->access_virt_barray)
  470|   186k|        ((j_common_ptr)cinfo, coef->whole_image[ci],
  471|   186k|         (cinfo->output_iMCU_row - 1) * compptr->v_samp_factor,
  472|   186k|         (JDIMENSION)access_rows, FALSE);
  ------------------
  |  |  245|   186k|#define FALSE   0               /* values of boolean */
  ------------------
  473|   186k|      buffer += compptr->v_samp_factor; /* point to current iMCU row */
  474|   186k|      first_row = FALSE;
  ------------------
  |  |  245|   186k|#define FALSE   0               /* values of boolean */
  ------------------
  475|   186k|    } else {
  476|    789|      buffer = (*cinfo->mem->access_virt_barray)
  477|    789|        ((j_common_ptr)cinfo, coef->whole_image[ci],
  478|    789|         (JDIMENSION)0, (JDIMENSION)access_rows, FALSE);
  ------------------
  |  |  245|    789|#define FALSE   0               /* values of boolean */
  ------------------
  479|    789|      first_row = TRUE;
  ------------------
  |  |  248|    789|#define TRUE    1
  ------------------
  480|    789|    }
  481|       |    /* Fetch component-dependent info */
  482|   187k|    coef_bits = coef->coef_bits_latch + (ci * SAVED_COEFS);
  ------------------
  |  |   54|   187k|#define SAVED_COEFS  6          /* we save coef_bits[0..5] */
  ------------------
  483|   187k|    quanttbl = compptr->quant_table;
  484|   187k|    Q00 = quanttbl->quantval[0];
  485|   187k|    Q01 = quanttbl->quantval[Q01_POS];
  ------------------
  |  |  337|   187k|#define Q01_POS  1
  ------------------
  486|   187k|    Q10 = quanttbl->quantval[Q10_POS];
  ------------------
  |  |  338|   187k|#define Q10_POS  8
  ------------------
  487|   187k|    Q20 = quanttbl->quantval[Q20_POS];
  ------------------
  |  |  339|   187k|#define Q20_POS  16
  ------------------
  488|   187k|    Q11 = quanttbl->quantval[Q11_POS];
  ------------------
  |  |  340|   187k|#define Q11_POS  9
  ------------------
  489|   187k|    Q02 = quanttbl->quantval[Q02_POS];
  ------------------
  |  |  341|   187k|#define Q02_POS  2
  ------------------
  490|   187k|    inverse_DCT = cinfo->idct->inverse_DCT[ci];
  491|   187k|    output_ptr = output_buf[ci];
  492|       |    /* Loop over all DCT blocks to be processed. */
  493|   500k|    for (block_row = 0; block_row < block_rows; block_row++) {
  ------------------
  |  Branch (493:25): [True: 312k, False: 187k]
  ------------------
  494|   312k|      buffer_ptr = buffer[block_row] + cinfo->master->first_MCU_col[ci];
  495|   312k|      if (first_row && block_row == 0)
  ------------------
  |  Branch (495:11): [True: 1.49k, False: 311k]
  |  Branch (495:24): [True: 789, False: 707]
  ------------------
  496|    789|        prev_block_row = buffer_ptr;
  497|   312k|      else
  498|   312k|        prev_block_row = buffer[block_row - 1] +
  499|   312k|                         cinfo->master->first_MCU_col[ci];
  500|   312k|      if (last_row && block_row == block_rows - 1)
  ------------------
  |  Branch (500:11): [True: 1.15k, False: 311k]
  |  Branch (500:23): [True: 789, False: 370]
  ------------------
  501|    789|        next_block_row = buffer_ptr;
  502|   312k|      else
  503|   312k|        next_block_row = buffer[block_row + 1] +
  504|   312k|                         cinfo->master->first_MCU_col[ci];
  505|       |      /* We fetch the surrounding DC values using a sliding-register approach.
  506|       |       * Initialize all nine here so as to do the right thing on narrow pics.
  507|       |       */
  508|   312k|      DC1 = DC2 = DC3 = (int)prev_block_row[0][0];
  509|   312k|      DC4 = DC5 = DC6 = (int)buffer_ptr[0][0];
  510|   312k|      DC7 = DC8 = DC9 = (int)next_block_row[0][0];
  511|   312k|      output_col = 0;
  512|   312k|      last_block_column = compptr->width_in_blocks - 1;
  513|   312k|      for (block_num = cinfo->master->first_MCU_col[ci];
  514|  4.47M|           block_num <= cinfo->master->last_MCU_col[ci]; block_num++) {
  ------------------
  |  Branch (514:12): [True: 4.16M, False: 312k]
  ------------------
  515|       |        /* Fetch current DCT block into workspace so we can modify it. */
  516|  4.16M|        jcopy_block_row(buffer_ptr, (JBLOCKROW)workspace, (JDIMENSION)1);
  517|       |        /* Update DC values */
  518|  4.16M|        if (block_num < last_block_column) {
  ------------------
  |  Branch (518:13): [True: 3.84M, False: 312k]
  ------------------
  519|  3.84M|          DC3 = (int)prev_block_row[1][0];
  520|  3.84M|          DC6 = (int)buffer_ptr[1][0];
  521|  3.84M|          DC9 = (int)next_block_row[1][0];
  522|  3.84M|        }
  523|       |        /* Compute coefficient estimates per K.8.
  524|       |         * An estimate is applied only if coefficient is still zero,
  525|       |         * and is not known to be fully accurate.
  526|       |         */
  527|       |        /* AC01 */
  528|  4.16M|        if ((Al = coef_bits[1]) != 0 && workspace[1] == 0) {
  ------------------
  |  Branch (528:13): [True: 4.15M, False: 5.93k]
  |  Branch (528:41): [True: 4.03M, False: 119k]
  ------------------
  529|  4.03M|          num = 36 * Q00 * (DC4 - DC6);
  530|  4.03M|          if (num >= 0) {
  ------------------
  |  Branch (530:15): [True: 3.34M, False: 694k]
  ------------------
  531|  3.34M|            pred = (int)(((Q01 << 7) + num) / (Q01 << 8));
  532|  3.34M|            if (Al > 0 && pred >= (1 << Al))
  ------------------
  |  Branch (532:17): [True: 633k, False: 2.70M]
  |  Branch (532:27): [True: 265k, False: 367k]
  ------------------
  533|   265k|              pred = (1 << Al) - 1;
  534|  3.34M|          } else {
  535|   694k|            pred = (int)(((Q01 << 7) - num) / (Q01 << 8));
  536|   694k|            if (Al > 0 && pred >= (1 << Al))
  ------------------
  |  Branch (536:17): [True: 242k, False: 451k]
  |  Branch (536:27): [True: 141k, False: 101k]
  ------------------
  537|   141k|              pred = (1 << Al) - 1;
  538|   694k|            pred = -pred;
  539|   694k|          }
  540|  4.03M|          workspace[1] = (JCOEF)pred;
  541|  4.03M|        }
  542|       |        /* AC10 */
  543|  4.16M|        if ((Al = coef_bits[2]) != 0 && workspace[8] == 0) {
  ------------------
  |  Branch (543:13): [True: 4.13M, False: 25.6k]
  |  Branch (543:41): [True: 4.04M, False: 94.0k]
  ------------------
  544|  4.04M|          num = 36 * Q00 * (DC2 - DC8);
  545|  4.04M|          if (num >= 0) {
  ------------------
  |  Branch (545:15): [True: 2.77M, False: 1.26M]
  ------------------
  546|  2.77M|            pred = (int)(((Q10 << 7) + num) / (Q10 << 8));
  547|  2.77M|            if (Al > 0 && pred >= (1 << Al))
  ------------------
  |  Branch (547:17): [True: 473k, False: 2.30M]
  |  Branch (547:27): [True: 347k, False: 125k]
  ------------------
  548|   347k|              pred = (1 << Al) - 1;
  549|  2.77M|          } else {
  550|  1.26M|            pred = (int)(((Q10 << 7) - num) / (Q10 << 8));
  551|  1.26M|            if (Al > 0 && pred >= (1 << Al))
  ------------------
  |  Branch (551:17): [True: 485k, False: 784k]
  |  Branch (551:27): [True: 433k, False: 51.6k]
  ------------------
  552|   433k|              pred = (1 << Al) - 1;
  553|  1.26M|            pred = -pred;
  554|  1.26M|          }
  555|  4.04M|          workspace[8] = (JCOEF)pred;
  556|  4.04M|        }
  557|       |        /* AC20 */
  558|  4.16M|        if ((Al = coef_bits[3]) != 0 && workspace[16] == 0) {
  ------------------
  |  Branch (558:13): [True: 4.12M, False: 37.3k]
  |  Branch (558:41): [True: 4.05M, False: 67.0k]
  ------------------
  559|  4.05M|          num = 9 * Q00 * (DC2 + DC8 - 2 * DC5);
  560|  4.05M|          if (num >= 0) {
  ------------------
  |  Branch (560:15): [True: 2.72M, False: 1.33M]
  ------------------
  561|  2.72M|            pred = (int)(((Q20 << 7) + num) / (Q20 << 8));
  562|  2.72M|            if (Al > 0 && pred >= (1 << Al))
  ------------------
  |  Branch (562:17): [True: 525k, False: 2.20M]
  |  Branch (562:27): [True: 369k, False: 155k]
  ------------------
  563|   369k|              pred = (1 << Al) - 1;
  564|  2.72M|          } else {
  565|  1.33M|            pred = (int)(((Q20 << 7) - num) / (Q20 << 8));
  566|  1.33M|            if (Al > 0 && pred >= (1 << Al))
  ------------------
  |  Branch (566:17): [True: 440k, False: 890k]
  |  Branch (566:27): [True: 366k, False: 74.0k]
  ------------------
  567|   366k|              pred = (1 << Al) - 1;
  568|  1.33M|            pred = -pred;
  569|  1.33M|          }
  570|  4.05M|          workspace[16] = (JCOEF)pred;
  571|  4.05M|        }
  572|       |        /* AC11 */
  573|  4.16M|        if ((Al = coef_bits[4]) != 0 && workspace[9] == 0) {
  ------------------
  |  Branch (573:13): [True: 4.12M, False: 37.3k]
  |  Branch (573:41): [True: 4.06M, False: 58.8k]
  ------------------
  574|  4.06M|          num = 5 * Q00 * (DC1 - DC3 - DC7 + DC9);
  575|  4.06M|          if (num >= 0) {
  ------------------
  |  Branch (575:15): [True: 3.39M, False: 675k]
  ------------------
  576|  3.39M|            pred = (int)(((Q11 << 7) + num) / (Q11 << 8));
  577|  3.39M|            if (Al > 0 && pred >= (1 << Al))
  ------------------
  |  Branch (577:17): [True: 719k, False: 2.67M]
  |  Branch (577:27): [True: 116k, False: 602k]
  ------------------
  578|   116k|              pred = (1 << Al) - 1;
  579|  3.39M|          } else {
  580|   675k|            pred = (int)(((Q11 << 7) - num) / (Q11 << 8));
  581|   675k|            if (Al > 0 && pred >= (1 << Al))
  ------------------
  |  Branch (581:17): [True: 237k, False: 438k]
  |  Branch (581:27): [True: 129k, False: 108k]
  ------------------
  582|   129k|              pred = (1 << Al) - 1;
  583|   675k|            pred = -pred;
  584|   675k|          }
  585|  4.06M|          workspace[9] = (JCOEF)pred;
  586|  4.06M|        }
  587|       |        /* AC02 */
  588|  4.16M|        if ((Al = coef_bits[5]) != 0 && workspace[2] == 0) {
  ------------------
  |  Branch (588:13): [True: 4.10M, False: 60.2k]
  |  Branch (588:41): [True: 4.01M, False: 86.2k]
  ------------------
  589|  4.01M|          num = 9 * Q00 * (DC4 + DC6 - 2 * DC5);
  590|  4.01M|          if (num >= 0) {
  ------------------
  |  Branch (590:15): [True: 2.65M, False: 1.35M]
  ------------------
  591|  2.65M|            pred = (int)(((Q02 << 7) + num) / (Q02 << 8));
  592|  2.65M|            if (Al > 0 && pred >= (1 << Al))
  ------------------
  |  Branch (592:17): [True: 536k, False: 2.12M]
  |  Branch (592:27): [True: 148k, False: 388k]
  ------------------
  593|   148k|              pred = (1 << Al) - 1;
  594|  2.65M|          } else {
  595|  1.35M|            pred = (int)(((Q02 << 7) - num) / (Q02 << 8));
  596|  1.35M|            if (Al > 0 && pred >= (1 << Al))
  ------------------
  |  Branch (596:17): [True: 379k, False: 976k]
  |  Branch (596:27): [True: 151k, False: 228k]
  ------------------
  597|   151k|              pred = (1 << Al) - 1;
  598|  1.35M|            pred = -pred;
  599|  1.35M|          }
  600|  4.01M|          workspace[2] = (JCOEF)pred;
  601|  4.01M|        }
  602|       |        /* OK, do the IDCT */
  603|  4.16M|        (*inverse_DCT) (cinfo, compptr, (JCOEFPTR)workspace, output_ptr,
  604|  4.16M|                        output_col);
  605|       |        /* Advance for next column */
  606|  4.16M|        DC1 = DC2;  DC2 = DC3;
  607|  4.16M|        DC4 = DC5;  DC5 = DC6;
  608|  4.16M|        DC7 = DC8;  DC8 = DC9;
  609|  4.16M|        buffer_ptr++, prev_block_row++, next_block_row++;
  610|  4.16M|        output_col += compptr->_DCT_scaled_size;
  ------------------
  |  |   24|  4.16M|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  611|  4.16M|      }
  612|   312k|      output_ptr += compptr->_DCT_scaled_size;
  ------------------
  |  |   24|   312k|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  613|   312k|    }
  614|   187k|  }
  615|       |
  616|   133k|  if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
  ------------------
  |  Branch (616:7): [True: 132k, False: 655]
  ------------------
  617|   132k|    return JPEG_ROW_COMPLETED;
  ------------------
  |  | 1022|   132k|#define JPEG_ROW_COMPLETED      3 /* Completed one iMCU row */
  ------------------
  618|    655|  return JPEG_SCAN_COMPLETED;
  ------------------
  |  | 1023|    655|#define JPEG_SCAN_COMPLETED     4 /* Completed last iMCU row of a scan */
  ------------------
  619|   133k|}
jdcoefct.c:consume_data:
  191|  4.39M|{
  192|  4.39M|  my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
  193|  4.39M|  JDIMENSION MCU_col_num;       /* index of current MCU within row */
  194|  4.39M|  int blkn, ci, xindex, yindex, yoffset;
  195|  4.39M|  JDIMENSION start_col;
  196|  4.39M|  JBLOCKARRAY buffer[MAX_COMPS_IN_SCAN];
  197|  4.39M|  JBLOCKROW buffer_ptr;
  198|  4.39M|  jpeg_component_info *compptr;
  199|       |
  200|       |  /* Align the virtual buffers for the components used in this scan. */
  201|  9.77M|  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  ------------------
  |  Branch (201:16): [True: 5.37M, False: 4.39M]
  ------------------
  202|  5.37M|    compptr = cinfo->cur_comp_info[ci];
  203|  5.37M|    buffer[ci] = (*cinfo->mem->access_virt_barray)
  204|  5.37M|      ((j_common_ptr)cinfo, coef->whole_image[compptr->component_index],
  205|  5.37M|       cinfo->input_iMCU_row * compptr->v_samp_factor,
  206|  5.37M|       (JDIMENSION)compptr->v_samp_factor, TRUE);
  ------------------
  |  |  248|  5.37M|#define TRUE    1
  ------------------
  207|       |    /* Note: entropy decoder expects buffer to be zeroed,
  208|       |     * but this is handled automatically by the memory manager
  209|       |     * because we requested a pre-zeroed array.
  210|       |     */
  211|  5.37M|  }
  212|       |
  213|       |  /* Loop to process one whole iMCU row */
  214|  11.2M|  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
  ------------------
  |  Branch (214:41): [True: 6.88M, False: 4.39M]
  ------------------
  215|  6.88M|       yoffset++) {
  216|  83.4M|    for (MCU_col_num = coef->MCU_ctr; MCU_col_num < cinfo->MCUs_per_row;
  ------------------
  |  Branch (216:39): [True: 76.5M, False: 6.88M]
  ------------------
  217|  76.5M|         MCU_col_num++) {
  218|       |      /* Construct list of pointers to DCT blocks belonging to this MCU */
  219|  76.5M|      blkn = 0;                 /* index of current DCT block within MCU */
  220|   155M|      for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  ------------------
  |  Branch (220:20): [True: 79.2M, False: 76.5M]
  ------------------
  221|  79.2M|        compptr = cinfo->cur_comp_info[ci];
  222|  79.2M|        start_col = MCU_col_num * compptr->MCU_width;
  223|   161M|        for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
  ------------------
  |  Branch (223:26): [True: 82.0M, False: 79.2M]
  ------------------
  224|  82.0M|          buffer_ptr = buffer[ci][yindex + yoffset] + start_col;
  225|   166M|          for (xindex = 0; xindex < compptr->MCU_width; xindex++) {
  ------------------
  |  Branch (225:28): [True: 84.9M, False: 82.0M]
  ------------------
  226|  84.9M|            coef->MCU_buffer[blkn++] = buffer_ptr++;
  227|  84.9M|          }
  228|  82.0M|        }
  229|  79.2M|      }
  230|       |      /* Try to fetch the MCU. */
  231|  76.5M|      if (!(*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
  ------------------
  |  Branch (231:11): [True: 0, False: 76.5M]
  ------------------
  232|       |        /* Suspension forced; update state counters and exit */
  233|      0|        coef->MCU_vert_offset = yoffset;
  234|      0|        coef->MCU_ctr = MCU_col_num;
  235|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  236|      0|      }
  237|  76.5M|    }
  238|       |    /* Completed an MCU row, but perhaps not an iMCU row */
  239|  6.88M|    coef->MCU_ctr = 0;
  240|  6.88M|  }
  241|       |  /* Completed the iMCU row, advance counters for next one */
  242|  4.39M|  if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
  ------------------
  |  Branch (242:7): [True: 4.37M, False: 21.2k]
  ------------------
  243|  4.37M|    start_iMCU_row(cinfo);
  244|  4.37M|    return JPEG_ROW_COMPLETED;
  ------------------
  |  | 1022|  4.37M|#define JPEG_ROW_COMPLETED      3 /* Completed one iMCU row */
  ------------------
  245|  4.37M|  }
  246|       |  /* Completed the scan */
  247|  21.2k|  (*cinfo->inputctl->finish_input_pass) (cinfo);
  248|  21.2k|  return JPEG_SCAN_COMPLETED;
  ------------------
  |  | 1023|  21.2k|#define JPEG_SCAN_COMPLETED     4 /* Completed last iMCU row of a scan */
  ------------------
  249|  4.39M|}
jdcoefct.c:decompress_data:
  262|   425k|{
  263|   425k|  my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
  264|   425k|  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
  265|   425k|  JDIMENSION block_num;
  266|   425k|  int ci, block_row, block_rows;
  267|   425k|  JBLOCKARRAY buffer;
  268|   425k|  JBLOCKROW buffer_ptr;
  269|   425k|  JSAMPARRAY output_ptr;
  270|   425k|  JDIMENSION output_col;
  271|   425k|  jpeg_component_info *compptr;
  272|   425k|  inverse_DCT_method_ptr inverse_DCT;
  273|       |
  274|       |  /* Force some input to be done if we are getting ahead of the input. */
  275|   425k|  while (cinfo->input_scan_number < cinfo->output_scan_number ||
  ------------------
  |  Branch (275:10): [True: 0, False: 425k]
  ------------------
  276|   425k|         (cinfo->input_scan_number == cinfo->output_scan_number &&
  ------------------
  |  Branch (276:11): [True: 425k, False: 0]
  ------------------
  277|   425k|          cinfo->input_iMCU_row <= cinfo->output_iMCU_row)) {
  ------------------
  |  Branch (277:11): [True: 0, False: 425k]
  ------------------
  278|      0|    if ((*cinfo->inputctl->consume_input) (cinfo) == JPEG_SUSPENDED)
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  |  Branch (278:9): [True: 0, False: 0]
  ------------------
  279|      0|      return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  280|      0|  }
  281|       |
  282|       |  /* OK, output from the virtual arrays. */
  283|  1.33M|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (283:44): [True: 908k, False: 425k]
  ------------------
  284|   908k|       ci++, compptr++) {
  285|       |    /* Don't bother to IDCT an uninteresting component. */
  286|   908k|    if (!compptr->component_needed)
  ------------------
  |  Branch (286:9): [True: 50.4k, False: 857k]
  ------------------
  287|  50.4k|      continue;
  288|       |    /* Align the virtual buffer for this component. */
  289|   857k|    buffer = (*cinfo->mem->access_virt_barray)
  290|   857k|      ((j_common_ptr)cinfo, coef->whole_image[ci],
  291|   857k|       cinfo->output_iMCU_row * compptr->v_samp_factor,
  292|   857k|       (JDIMENSION)compptr->v_samp_factor, FALSE);
  ------------------
  |  |  245|   857k|#define FALSE   0               /* values of boolean */
  ------------------
  293|       |    /* Count non-dummy DCT block rows in this iMCU row. */
  294|   857k|    if (cinfo->output_iMCU_row < last_iMCU_row)
  ------------------
  |  Branch (294:9): [True: 854k, False: 3.54k]
  ------------------
  295|   854k|      block_rows = compptr->v_samp_factor;
  296|  3.54k|    else {
  297|       |      /* NB: can't use last_row_height here; it is input-side-dependent! */
  298|  3.54k|      block_rows = (int)(compptr->height_in_blocks % compptr->v_samp_factor);
  299|  3.54k|      if (block_rows == 0) block_rows = compptr->v_samp_factor;
  ------------------
  |  Branch (299:11): [True: 2.06k, False: 1.48k]
  ------------------
  300|  3.54k|    }
  301|   857k|    inverse_DCT = cinfo->idct->inverse_DCT[ci];
  302|   857k|    output_ptr = output_buf[ci];
  303|       |    /* Loop over all DCT blocks to be processed. */
  304|  2.25M|    for (block_row = 0; block_row < block_rows; block_row++) {
  ------------------
  |  Branch (304:25): [True: 1.40M, False: 857k]
  ------------------
  305|  1.40M|      buffer_ptr = buffer[block_row] + cinfo->master->first_MCU_col[ci];
  306|  1.40M|      output_col = 0;
  307|  1.40M|      for (block_num = cinfo->master->first_MCU_col[ci];
  308|  10.7M|           block_num <= cinfo->master->last_MCU_col[ci]; block_num++) {
  ------------------
  |  Branch (308:12): [True: 9.37M, False: 1.40M]
  ------------------
  309|  9.37M|        (*inverse_DCT) (cinfo, compptr, (JCOEFPTR)buffer_ptr, output_ptr,
  310|  9.37M|                        output_col);
  311|  9.37M|        buffer_ptr++;
  312|  9.37M|        output_col += compptr->_DCT_scaled_size;
  ------------------
  |  |   24|  9.37M|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  313|  9.37M|      }
  314|  1.40M|      output_ptr += compptr->_DCT_scaled_size;
  ------------------
  |  |   24|  1.40M|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  315|  1.40M|    }
  316|   857k|  }
  317|       |
  318|   425k|  if (++(cinfo->output_iMCU_row) < cinfo->total_iMCU_rows)
  ------------------
  |  Branch (318:7): [True: 424k, False: 1.77k]
  ------------------
  319|   424k|    return JPEG_ROW_COMPLETED;
  ------------------
  |  | 1022|   424k|#define JPEG_ROW_COMPLETED      3 /* Completed one iMCU row */
  ------------------
  320|  1.77k|  return JPEG_SCAN_COMPLETED;
  ------------------
  |  | 1023|  1.77k|#define JPEG_SCAN_COMPLETED     4 /* Completed last iMCU row of a scan */
  ------------------
  321|   425k|}
jdcoefct.c:decompress_onepass:
   86|   306k|{
   87|   306k|  my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
   88|   306k|  JDIMENSION MCU_col_num;       /* index of current MCU within row */
   89|   306k|  JDIMENSION last_MCU_col = cinfo->MCUs_per_row - 1;
   90|   306k|  JDIMENSION last_iMCU_row = cinfo->total_iMCU_rows - 1;
   91|   306k|  int blkn, ci, xindex, yindex, yoffset, useful_width;
   92|   306k|  JSAMPARRAY output_ptr;
   93|   306k|  JDIMENSION start_col, output_col;
   94|   306k|  jpeg_component_info *compptr;
   95|   306k|  inverse_DCT_method_ptr inverse_DCT;
   96|       |
   97|       |  /* Loop to process as much as one whole iMCU row */
   98|   791k|  for (yoffset = coef->MCU_vert_offset; yoffset < coef->MCU_rows_per_iMCU_row;
  ------------------
  |  Branch (98:41): [True: 484k, False: 306k]
  ------------------
   99|   484k|       yoffset++) {
  100|  2.94M|    for (MCU_col_num = coef->MCU_ctr; MCU_col_num <= last_MCU_col;
  ------------------
  |  Branch (100:39): [True: 2.46M, False: 484k]
  ------------------
  101|  2.46M|         MCU_col_num++) {
  102|       |      /* Try to fetch an MCU.  Entropy decoder expects buffer to be zeroed. */
  103|  2.46M|      jzero_far((void *)coef->MCU_buffer[0],
  104|  2.46M|                (size_t)(cinfo->blocks_in_MCU * sizeof(JBLOCK)));
  105|  2.46M|      if (!(*cinfo->entropy->decode_mcu) (cinfo, coef->MCU_buffer)) {
  ------------------
  |  Branch (105:11): [True: 0, False: 2.46M]
  ------------------
  106|       |        /* Suspension forced; update state counters and exit */
  107|      0|        coef->MCU_vert_offset = yoffset;
  108|      0|        coef->MCU_ctr = MCU_col_num;
  109|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  110|      0|      }
  111|       |
  112|       |      /* Only perform the IDCT on blocks that are contained within the desired
  113|       |       * cropping region.
  114|       |       */
  115|  2.46M|      if (MCU_col_num >= cinfo->master->first_iMCU_col &&
  ------------------
  |  Branch (115:11): [True: 2.46M, False: 0]
  ------------------
  116|  2.46M|          MCU_col_num <= cinfo->master->last_iMCU_col) {
  ------------------
  |  Branch (116:11): [True: 2.46M, False: 0]
  ------------------
  117|       |        /* Determine where data should go in output_buf and do the IDCT thing.
  118|       |         * We skip dummy blocks at the right and bottom edges (but blkn gets
  119|       |         * incremented past them!).  Note the inner loop relies on having
  120|       |         * allocated the MCU_buffer[] blocks sequentially.
  121|       |         */
  122|  2.46M|        blkn = 0;               /* index of current DCT block within MCU */
  123|  5.02M|        for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  ------------------
  |  Branch (123:22): [True: 2.56M, False: 2.46M]
  ------------------
  124|  2.56M|          compptr = cinfo->cur_comp_info[ci];
  125|       |          /* Don't bother to IDCT an uninteresting component. */
  126|  2.56M|          if (!compptr->component_needed) {
  ------------------
  |  Branch (126:15): [True: 20.0k, False: 2.54M]
  ------------------
  127|  20.0k|            blkn += compptr->MCU_blocks;
  128|  20.0k|            continue;
  129|  20.0k|          }
  130|  2.54M|          inverse_DCT = cinfo->idct->inverse_DCT[compptr->component_index];
  131|  2.54M|          useful_width = (MCU_col_num < last_MCU_col) ?
  ------------------
  |  Branch (131:26): [True: 2.03M, False: 508k]
  ------------------
  132|  2.03M|                         compptr->MCU_width : compptr->last_col_width;
  133|  2.54M|          output_ptr = output_buf[compptr->component_index] +
  134|  2.54M|                       yoffset * compptr->_DCT_scaled_size;
  ------------------
  |  |   24|  2.54M|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  135|  2.54M|          start_col = (MCU_col_num - cinfo->master->first_iMCU_col) *
  136|  2.54M|                      compptr->MCU_sample_width;
  137|  5.14M|          for (yindex = 0; yindex < compptr->MCU_height; yindex++) {
  ------------------
  |  Branch (137:28): [True: 2.59M, False: 2.54M]
  ------------------
  138|  2.59M|            if (cinfo->input_iMCU_row < last_iMCU_row ||
  ------------------
  |  Branch (138:17): [True: 2.12M, False: 473k]
  ------------------
  139|  2.59M|                yoffset + yindex < compptr->last_row_height) {
  ------------------
  |  Branch (139:17): [True: 467k, False: 6.30k]
  ------------------
  140|  2.59M|              output_col = start_col;
  141|  5.27M|              for (xindex = 0; xindex < useful_width; xindex++) {
  ------------------
  |  Branch (141:32): [True: 2.68M, False: 2.59M]
  ------------------
  142|  2.68M|                (*inverse_DCT) (cinfo, compptr,
  143|  2.68M|                                (JCOEFPTR)coef->MCU_buffer[blkn + xindex],
  144|  2.68M|                                output_ptr, output_col);
  145|  2.68M|                output_col += compptr->_DCT_scaled_size;
  ------------------
  |  |   24|  2.68M|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  146|  2.68M|              }
  147|  2.59M|            }
  148|  2.59M|            blkn += compptr->MCU_width;
  149|  2.59M|            output_ptr += compptr->_DCT_scaled_size;
  ------------------
  |  |   24|  2.59M|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  150|  2.59M|          }
  151|  2.54M|        }
  152|  2.46M|      }
  153|  2.46M|    }
  154|       |    /* Completed an MCU row, but perhaps not an iMCU row */
  155|   484k|    coef->MCU_ctr = 0;
  156|   484k|  }
  157|       |  /* Completed the iMCU row, advance counters for next one */
  158|   306k|  cinfo->output_iMCU_row++;
  159|   306k|  if (++(cinfo->input_iMCU_row) < cinfo->total_iMCU_rows) {
  ------------------
  |  Branch (159:7): [True: 305k, False: 1.17k]
  ------------------
  160|   305k|    start_iMCU_row(cinfo);
  161|   305k|    return JPEG_ROW_COMPLETED;
  ------------------
  |  | 1022|   305k|#define JPEG_ROW_COMPLETED      3 /* Completed one iMCU row */
  ------------------
  162|   305k|  }
  163|       |  /* Completed the scan */
  164|  1.17k|  (*cinfo->inputctl->finish_input_pass) (cinfo);
  165|  1.17k|  return JPEG_SCAN_COMPLETED;
  ------------------
  |  | 1023|  1.17k|#define JPEG_SCAN_COMPLETED     4 /* Completed last iMCU row of a scan */
  ------------------
  166|   306k|}

jdcoefct.c:start_iMCU_row:
   64|  4.70M|{
   65|  4.70M|  my_coef_ptr coef = (my_coef_ptr)cinfo->coef;
   66|       |
   67|       |  /* In an interleaved scan, an MCU row is the same as an iMCU row.
   68|       |   * In a noninterleaved scan, an iMCU row has v_samp_factor MCU rows.
   69|       |   * But at the bottom of the image, process only what's left.
   70|       |   */
   71|  4.70M|  if (cinfo->comps_in_scan > 1) {
  ------------------
  |  Branch (71:7): [True: 581k, False: 4.12M]
  ------------------
   72|   581k|    coef->MCU_rows_per_iMCU_row = 1;
   73|  4.12M|  } else {
   74|  4.12M|    if (cinfo->input_iMCU_row < (cinfo->total_iMCU_rows - 1))
  ------------------
  |  Branch (74:9): [True: 4.10M, False: 16.7k]
  ------------------
   75|  4.10M|      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->v_samp_factor;
   76|  16.7k|    else
   77|  16.7k|      coef->MCU_rows_per_iMCU_row = cinfo->cur_comp_info[0]->last_row_height;
   78|  4.12M|  }
   79|       |
   80|  4.70M|  coef->MCU_ctr = 0;
   81|  4.70M|  coef->MCU_vert_offset = 0;
   82|  4.70M|}

jdcolor.c:gray_extrgb_convert_internal:
   87|  4.45M|{
   88|  4.45M|  register JSAMPROW inptr, outptr;
   89|  4.45M|  register JDIMENSION col;
   90|  4.45M|  JDIMENSION num_cols = cinfo->output_width;
   91|       |
   92|  11.9M|  while (--num_rows >= 0) {
  ------------------
  |  Branch (92:10): [True: 7.53M, False: 4.45M]
  ------------------
   93|  7.53M|    inptr = input_buf[0][input_row++];
   94|  7.53M|    outptr = *output_buf++;
   95|   512M|    for (col = 0; col < num_cols; col++) {
  ------------------
  |  Branch (95:19): [True: 505M, False: 7.53M]
  ------------------
   96|       |      /* We can dispense with GETJSAMPLE() here */
   97|   505M|      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
  ------------------
  |  |  101|   505M|#define RGB_RED  EXT_RGB_RED
  |  |  ------------------
  |  |  |  |  338|   505M|#define EXT_RGB_RED         0
  |  |  ------------------
  ------------------
                    outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
  ------------------
  |  |  102|   505M|#define RGB_GREEN  EXT_RGB_GREEN
  |  |  ------------------
  |  |  |  |  339|   505M|#define EXT_RGB_GREEN       1
  |  |  ------------------
  ------------------
                    outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
  ------------------
  |  |  103|   505M|#define RGB_BLUE  EXT_RGB_BLUE
  |  |  ------------------
  |  |  |  |  340|   505M|#define EXT_RGB_BLUE        2
  |  |  ------------------
  ------------------
   98|       |      /* Set unused byte to MAXJSAMPLE so it can be interpreted as an opaque */
   99|       |      /* alpha channel value */
  100|       |#ifdef RGB_ALPHA
  101|       |      outptr[RGB_ALPHA] = MAXJSAMPLE;
  102|       |#endif
  103|   505M|      outptr += RGB_PIXELSIZE;
  ------------------
  |  |  104|   505M|#define RGB_PIXELSIZE  EXT_RGB_PIXELSIZE
  |  |  ------------------
  |  |  |  |  341|   505M|#define EXT_RGB_PIXELSIZE   3
  |  |  ------------------
  ------------------
  104|   505M|    }
  105|  7.53M|  }
  106|  4.45M|}
jdcolor.c:gray_extbgrx_convert_internal:
   87|  40.8k|{
   88|  40.8k|  register JSAMPROW inptr, outptr;
   89|  40.8k|  register JDIMENSION col;
   90|  40.8k|  JDIMENSION num_cols = cinfo->output_width;
   91|       |
   92|   138k|  while (--num_rows >= 0) {
  ------------------
  |  Branch (92:10): [True: 98.0k, False: 40.8k]
  ------------------
   93|  98.0k|    inptr = input_buf[0][input_row++];
   94|  98.0k|    outptr = *output_buf++;
   95|  9.20M|    for (col = 0; col < num_cols; col++) {
  ------------------
  |  Branch (95:19): [True: 9.11M, False: 98.0k]
  ------------------
   96|       |      /* We can dispense with GETJSAMPLE() here */
   97|  9.11M|      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
  ------------------
  |  |  151|  9.11M|#define RGB_RED  EXT_BGRX_RED
  |  |  ------------------
  |  |  |  |  353|  9.11M|#define EXT_BGRX_RED        2
  |  |  ------------------
  ------------------
                    outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
  ------------------
  |  |  152|  9.11M|#define RGB_GREEN  EXT_BGRX_GREEN
  |  |  ------------------
  |  |  |  |  354|  9.11M|#define EXT_BGRX_GREEN      1
  |  |  ------------------
  ------------------
                    outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
  ------------------
  |  |  153|  9.11M|#define RGB_BLUE  EXT_BGRX_BLUE
  |  |  ------------------
  |  |  |  |  355|  9.11M|#define EXT_BGRX_BLUE       0
  |  |  ------------------
  ------------------
   98|       |      /* Set unused byte to MAXJSAMPLE so it can be interpreted as an opaque */
   99|       |      /* alpha channel value */
  100|  9.11M|#ifdef RGB_ALPHA
  101|  9.11M|      outptr[RGB_ALPHA] = MAXJSAMPLE;
  ------------------
  |  |  154|  9.11M|#define RGB_ALPHA  3
  ------------------
                    outptr[RGB_ALPHA] = MAXJSAMPLE;
  ------------------
  |  |   65|  9.11M|#define MAXJSAMPLE      255
  ------------------
  102|  9.11M|#endif
  103|  9.11M|      outptr += RGB_PIXELSIZE;
  ------------------
  |  |  155|  9.11M|#define RGB_PIXELSIZE  EXT_BGRX_PIXELSIZE
  |  |  ------------------
  |  |  |  |  356|  9.11M|#define EXT_BGRX_PIXELSIZE  4
  |  |  ------------------
  ------------------
  104|  9.11M|    }
  105|  98.0k|  }
  106|  40.8k|}
jdcolor.c:rgb_extbgrx_convert_internal:
  118|  19.1k|{
  119|  19.1k|  register JSAMPROW inptr0, inptr1, inptr2;
  120|  19.1k|  register JSAMPROW outptr;
  121|  19.1k|  register JDIMENSION col;
  122|  19.1k|  JDIMENSION num_cols = cinfo->output_width;
  123|       |
  124|  57.2k|  while (--num_rows >= 0) {
  ------------------
  |  Branch (124:10): [True: 38.1k, False: 19.1k]
  ------------------
  125|  38.1k|    inptr0 = input_buf[0][input_row];
  126|  38.1k|    inptr1 = input_buf[1][input_row];
  127|  38.1k|    inptr2 = input_buf[2][input_row];
  128|  38.1k|    input_row++;
  129|  38.1k|    outptr = *output_buf++;
  130|  1.83M|    for (col = 0; col < num_cols; col++) {
  ------------------
  |  Branch (130:19): [True: 1.79M, False: 38.1k]
  ------------------
  131|       |      /* We can dispense with GETJSAMPLE() here */
  132|  1.79M|      outptr[RGB_RED] = inptr0[col];
  ------------------
  |  |  151|  1.79M|#define RGB_RED  EXT_BGRX_RED
  |  |  ------------------
  |  |  |  |  353|  1.79M|#define EXT_BGRX_RED        2
  |  |  ------------------
  ------------------
  133|  1.79M|      outptr[RGB_GREEN] = inptr1[col];
  ------------------
  |  |  152|  1.79M|#define RGB_GREEN  EXT_BGRX_GREEN
  |  |  ------------------
  |  |  |  |  354|  1.79M|#define EXT_BGRX_GREEN      1
  |  |  ------------------
  ------------------
  134|  1.79M|      outptr[RGB_BLUE] = inptr2[col];
  ------------------
  |  |  153|  1.79M|#define RGB_BLUE  EXT_BGRX_BLUE
  |  |  ------------------
  |  |  |  |  355|  1.79M|#define EXT_BGRX_BLUE       0
  |  |  ------------------
  ------------------
  135|       |      /* Set unused byte to MAXJSAMPLE so it can be interpreted as an opaque */
  136|       |      /* alpha channel value */
  137|  1.79M|#ifdef RGB_ALPHA
  138|  1.79M|      outptr[RGB_ALPHA] = MAXJSAMPLE;
  ------------------
  |  |  154|  1.79M|#define RGB_ALPHA  3
  ------------------
                    outptr[RGB_ALPHA] = MAXJSAMPLE;
  ------------------
  |  |   65|  1.79M|#define MAXJSAMPLE      255
  ------------------
  139|  1.79M|#endif
  140|  1.79M|      outptr += RGB_PIXELSIZE;
  ------------------
  |  |  155|  1.79M|#define RGB_PIXELSIZE  EXT_BGRX_PIXELSIZE
  |  |  ------------------
  |  |  |  |  356|  1.79M|#define EXT_BGRX_PIXELSIZE  4
  |  |  ------------------
  ------------------
  141|  1.79M|    }
  142|  38.1k|  }
  143|  19.1k|}

jinit_color_deconverter:
  738|  4.91k|{
  739|  4.91k|  my_cconvert_ptr cconvert;
  740|  4.91k|  int ci;
  741|       |
  742|  4.91k|  cconvert = (my_cconvert_ptr)
  743|  4.91k|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  4.91k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  744|  4.91k|                                sizeof(my_color_deconverter));
  745|  4.91k|  cinfo->cconvert = (struct jpeg_color_deconverter *)cconvert;
  746|  4.91k|  cconvert->pub.start_pass = start_pass_dcolor;
  747|       |
  748|       |  /* Make sure num_components agrees with jpeg_color_space */
  749|  4.91k|  switch (cinfo->jpeg_color_space) {
  750|  2.35k|  case JCS_GRAYSCALE:
  ------------------
  |  Branch (750:3): [True: 2.35k, False: 2.56k]
  ------------------
  751|  2.35k|    if (cinfo->num_components != 1)
  ------------------
  |  Branch (751:9): [True: 0, False: 2.35k]
  ------------------
  752|      0|      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  753|  2.35k|    break;
  754|       |
  755|    202|  case JCS_RGB:
  ------------------
  |  Branch (755:3): [True: 202, False: 4.71k]
  ------------------
  756|  2.53k|  case JCS_YCbCr:
  ------------------
  |  Branch (756:3): [True: 2.33k, False: 2.58k]
  ------------------
  757|  2.53k|    if (cinfo->num_components != 3)
  ------------------
  |  Branch (757:9): [True: 0, False: 2.53k]
  ------------------
  758|      0|      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  759|  2.53k|    break;
  760|       |
  761|     16|  case JCS_CMYK:
  ------------------
  |  Branch (761:3): [True: 16, False: 4.89k]
  ------------------
  762|     22|  case JCS_YCCK:
  ------------------
  |  Branch (762:3): [True: 6, False: 4.90k]
  ------------------
  763|     22|    if (cinfo->num_components != 4)
  ------------------
  |  Branch (763:9): [True: 0, False: 22]
  ------------------
  764|      0|      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  765|     22|    break;
  766|       |
  767|      7|  default:                      /* JCS_UNKNOWN can be anything */
  ------------------
  |  Branch (767:3): [True: 7, False: 4.90k]
  ------------------
  768|      7|    if (cinfo->num_components < 1)
  ------------------
  |  Branch (768:9): [True: 0, False: 7]
  ------------------
  769|      0|      ERREXIT(cinfo, JERR_BAD_J_COLORSPACE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  770|      7|    break;
  771|  4.91k|  }
  772|       |
  773|       |  /* Set out_color_components and conversion method based on requested space.
  774|       |   * Also clear the component_needed flags for any unused components,
  775|       |   * so that earlier pipeline stages can avoid useless computation.
  776|       |   */
  777|       |
  778|  4.91k|  switch (cinfo->out_color_space) {
  779|    446|  case JCS_GRAYSCALE:
  ------------------
  |  Branch (779:3): [True: 446, False: 4.46k]
  ------------------
  780|    446|    cinfo->out_color_components = 1;
  781|    446|    if (cinfo->jpeg_color_space == JCS_GRAYSCALE ||
  ------------------
  |  Branch (781:9): [True: 87, False: 359]
  ------------------
  782|    446|        cinfo->jpeg_color_space == JCS_YCbCr) {
  ------------------
  |  Branch (782:9): [True: 321, False: 38]
  ------------------
  783|    408|      cconvert->pub.color_convert = grayscale_convert;
  784|       |      /* For color->grayscale conversion, only the Y (0) component is needed */
  785|  1.05k|      for (ci = 1; ci < cinfo->num_components; ci++)
  ------------------
  |  Branch (785:20): [True: 642, False: 408]
  ------------------
  786|    642|        cinfo->comp_info[ci].component_needed = FALSE;
  ------------------
  |  |  245|    642|#define FALSE   0               /* values of boolean */
  ------------------
  787|    408|    } else if (cinfo->jpeg_color_space == JCS_RGB) {
  ------------------
  |  Branch (787:16): [True: 38, False: 0]
  ------------------
  788|     38|      cconvert->pub.color_convert = rgb_gray_convert;
  789|     38|      build_rgb_y_table(cinfo);
  790|     38|    } else
  791|      0|      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  792|    446|    break;
  793|       |
  794|      0|  case JCS_RGB:
  ------------------
  |  Branch (794:3): [True: 0, False: 4.91k]
  ------------------
  795|  3.56k|  case JCS_EXT_RGB:
  ------------------
  |  Branch (795:3): [True: 3.56k, False: 1.34k]
  ------------------
  796|  3.56k|  case JCS_EXT_RGBX:
  ------------------
  |  Branch (796:3): [True: 0, False: 4.91k]
  ------------------
  797|  3.56k|  case JCS_EXT_BGR:
  ------------------
  |  Branch (797:3): [True: 0, False: 4.91k]
  ------------------
  798|  4.02k|  case JCS_EXT_BGRX:
  ------------------
  |  Branch (798:3): [True: 453, False: 4.46k]
  ------------------
  799|  4.02k|  case JCS_EXT_XBGR:
  ------------------
  |  Branch (799:3): [True: 0, False: 4.91k]
  ------------------
  800|  4.02k|  case JCS_EXT_XRGB:
  ------------------
  |  Branch (800:3): [True: 0, False: 4.91k]
  ------------------
  801|  4.02k|  case JCS_EXT_RGBA:
  ------------------
  |  Branch (801:3): [True: 0, False: 4.91k]
  ------------------
  802|  4.02k|  case JCS_EXT_BGRA:
  ------------------
  |  Branch (802:3): [True: 0, False: 4.91k]
  ------------------
  803|  4.02k|  case JCS_EXT_ABGR:
  ------------------
  |  Branch (803:3): [True: 0, False: 4.91k]
  ------------------
  804|  4.02k|  case JCS_EXT_ARGB:
  ------------------
  |  Branch (804:3): [True: 0, False: 4.91k]
  ------------------
  805|  4.02k|    cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];
  806|  4.02k|    if (cinfo->jpeg_color_space == JCS_YCbCr) {
  ------------------
  |  Branch (806:9): [True: 1.68k, False: 2.33k]
  ------------------
  807|  1.68k|      if (jsimd_can_ycc_rgb())
  ------------------
  |  Branch (807:11): [True: 1.68k, False: 0]
  ------------------
  808|  1.68k|        cconvert->pub.color_convert = jsimd_ycc_rgb_convert;
  809|      0|      else {
  810|      0|        cconvert->pub.color_convert = ycc_rgb_convert;
  811|      0|        build_ycc_rgb_table(cinfo);
  812|      0|      }
  813|  2.33k|    } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
  ------------------
  |  Branch (813:16): [True: 2.17k, False: 155]
  ------------------
  814|  2.17k|      cconvert->pub.color_convert = gray_rgb_convert;
  815|  2.17k|    } else if (cinfo->jpeg_color_space == JCS_RGB) {
  ------------------
  |  Branch (815:16): [True: 126, False: 29]
  ------------------
  816|    126|      if (rgb_red[cinfo->out_color_space] == 0 &&
  ------------------
  |  Branch (816:11): [True: 87, False: 39]
  ------------------
  817|    126|          rgb_green[cinfo->out_color_space] == 1 &&
  ------------------
  |  Branch (817:11): [True: 87, False: 0]
  ------------------
  818|    126|          rgb_blue[cinfo->out_color_space] == 2 &&
  ------------------
  |  Branch (818:11): [True: 87, False: 0]
  ------------------
  819|    126|          rgb_pixelsize[cinfo->out_color_space] == 3)
  ------------------
  |  Branch (819:11): [True: 87, False: 0]
  ------------------
  820|     87|        cconvert->pub.color_convert = null_convert;
  821|     39|      else
  822|     39|        cconvert->pub.color_convert = rgb_rgb_convert;
  823|    126|    } else
  824|     29|      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  ------------------
  |  |  231|     29|  ((cinfo)->err->msg_code = (code), \
  |  |  232|     29|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  825|  4.02k|    break;
  826|       |
  827|      0|  case JCS_RGB565:
  ------------------
  |  Branch (827:3): [True: 0, False: 4.91k]
  ------------------
  828|      0|    cinfo->out_color_components = 3;
  829|      0|    if (cinfo->dither_mode == JDITHER_NONE) {
  ------------------
  |  Branch (829:9): [True: 0, False: 0]
  ------------------
  830|      0|      if (cinfo->jpeg_color_space == JCS_YCbCr) {
  ------------------
  |  Branch (830:11): [True: 0, False: 0]
  ------------------
  831|      0|        if (jsimd_can_ycc_rgb565())
  ------------------
  |  Branch (831:13): [True: 0, False: 0]
  ------------------
  832|      0|          cconvert->pub.color_convert = jsimd_ycc_rgb565_convert;
  833|      0|        else {
  834|      0|          cconvert->pub.color_convert = ycc_rgb565_convert;
  835|      0|          build_ycc_rgb_table(cinfo);
  836|      0|        }
  837|      0|      } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
  ------------------
  |  Branch (837:18): [True: 0, False: 0]
  ------------------
  838|      0|        cconvert->pub.color_convert = gray_rgb565_convert;
  839|      0|      } else if (cinfo->jpeg_color_space == JCS_RGB) {
  ------------------
  |  Branch (839:18): [True: 0, False: 0]
  ------------------
  840|      0|        cconvert->pub.color_convert = rgb_rgb565_convert;
  841|      0|      } else
  842|      0|        ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  843|      0|    } else {
  844|       |      /* only ordered dithering is supported */
  845|      0|      if (cinfo->jpeg_color_space == JCS_YCbCr) {
  ------------------
  |  Branch (845:11): [True: 0, False: 0]
  ------------------
  846|      0|        cconvert->pub.color_convert = ycc_rgb565D_convert;
  847|      0|        build_ycc_rgb_table(cinfo);
  848|      0|      } else if (cinfo->jpeg_color_space == JCS_GRAYSCALE) {
  ------------------
  |  Branch (848:18): [True: 0, False: 0]
  ------------------
  849|      0|        cconvert->pub.color_convert = gray_rgb565D_convert;
  850|      0|      } else if (cinfo->jpeg_color_space == JCS_RGB) {
  ------------------
  |  Branch (850:18): [True: 0, False: 0]
  ------------------
  851|      0|        cconvert->pub.color_convert = rgb_rgb565D_convert;
  852|      0|      } else
  853|      0|        ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  854|      0|    }
  855|      0|    break;
  856|       |
  857|    446|  case JCS_CMYK:
  ------------------
  |  Branch (857:3): [True: 446, False: 4.46k]
  ------------------
  858|    446|    cinfo->out_color_components = 4;
  859|    446|    if (cinfo->jpeg_color_space == JCS_YCCK) {
  ------------------
  |  Branch (859:9): [True: 0, False: 446]
  ------------------
  860|      0|      cconvert->pub.color_convert = ycck_cmyk_convert;
  861|      0|      build_ycc_rgb_table(cinfo);
  862|    446|    } else if (cinfo->jpeg_color_space == JCS_CMYK) {
  ------------------
  |  Branch (862:16): [True: 0, False: 446]
  ------------------
  863|      0|      cconvert->pub.color_convert = null_convert;
  864|      0|    } else
  865|    446|      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  ------------------
  |  |  231|    446|  ((cinfo)->err->msg_code = (code), \
  |  |  232|    446|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  866|    446|    break;
  867|       |
  868|      0|  default:
  ------------------
  |  Branch (868:3): [True: 0, False: 4.91k]
  ------------------
  869|       |    /* Permit null conversion to same output space */
  870|      0|    if (cinfo->out_color_space == cinfo->jpeg_color_space) {
  ------------------
  |  Branch (870:9): [True: 0, False: 0]
  ------------------
  871|      0|      cinfo->out_color_components = cinfo->num_components;
  872|      0|      cconvert->pub.color_convert = null_convert;
  873|      0|    } else                      /* unsupported non-null conversion */
  874|      0|      ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  875|      0|    break;
  876|  4.91k|  }
  877|       |
  878|  4.43k|  if (cinfo->quantize_colors)
  ------------------
  |  Branch (878:7): [True: 0, False: 4.43k]
  ------------------
  879|      0|    cinfo->output_components = 1; /* single colormapped output component */
  880|  4.43k|  else
  881|  4.43k|    cinfo->output_components = cinfo->out_color_components;
  882|  4.43k|}
jdcolor.c:start_pass_dcolor:
  727|  3.52k|{
  728|       |  /* no work needed */
  729|  3.52k|}
jdcolor.c:grayscale_convert:
  424|   345k|{
  425|   345k|  jcopy_sample_rows(input_buf[0], (int)input_row, output_buf, 0, num_rows,
  426|   345k|                    cinfo->output_width);
  427|   345k|}
jdcolor.c:rgb_gray_convert:
  328|  38.2k|{
  329|  38.2k|  my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
  330|  38.2k|  register int r, g, b;
  331|  38.2k|  register JLONG *ctab = cconvert->rgb_y_tab;
  332|  38.2k|  register JSAMPROW outptr;
  333|  38.2k|  register JSAMPROW inptr0, inptr1, inptr2;
  334|  38.2k|  register JDIMENSION col;
  335|  38.2k|  JDIMENSION num_cols = cinfo->output_width;
  336|       |
  337|   114k|  while (--num_rows >= 0) {
  ------------------
  |  Branch (337:10): [True: 76.2k, False: 38.2k]
  ------------------
  338|  76.2k|    inptr0 = input_buf[0][input_row];
  339|  76.2k|    inptr1 = input_buf[1][input_row];
  340|  76.2k|    inptr2 = input_buf[2][input_row];
  341|  76.2k|    input_row++;
  342|  76.2k|    outptr = *output_buf++;
  343|  6.90M|    for (col = 0; col < num_cols; col++) {
  ------------------
  |  Branch (343:19): [True: 6.82M, False: 76.2k]
  ------------------
  344|  6.82M|      r = GETJSAMPLE(inptr0[col]);
  ------------------
  |  |   52|  6.82M|#define GETJSAMPLE(value)  ((int)(value))
  ------------------
  345|  6.82M|      g = GETJSAMPLE(inptr1[col]);
  ------------------
  |  |   52|  6.82M|#define GETJSAMPLE(value)  ((int)(value))
  ------------------
  346|  6.82M|      b = GETJSAMPLE(inptr2[col]);
  ------------------
  |  |   52|  6.82M|#define GETJSAMPLE(value)  ((int)(value))
  ------------------
  347|       |      /* Y */
  348|  6.82M|      outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
  ------------------
  |  |   87|  6.82M|#define R_Y_OFF         0                       /* offset to R => Y section */
  ------------------
                    outptr[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] +
  ------------------
  |  |   88|  6.82M|#define G_Y_OFF         (1 * (MAXJSAMPLE + 1))  /* offset to G => Y section */
  |  |  ------------------
  |  |  |  |   65|  6.82M|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
  349|  6.82M|                               ctab[b + B_Y_OFF]) >> SCALEBITS);
  ------------------
  |  |   89|  6.82M|#define B_Y_OFF         (2 * (MAXJSAMPLE + 1))  /* etc. */
  |  |  ------------------
  |  |  |  |   65|  6.82M|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
                                             ctab[b + B_Y_OFF]) >> SCALEBITS);
  ------------------
  |  |   76|  6.82M|#define SCALEBITS       16      /* speediest right-shift on some machines */
  ------------------
  350|  6.82M|    }
  351|  76.2k|  }
  352|  38.2k|}
jdcolor.c:build_rgb_y_table:
  303|     38|{
  304|     38|  my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
  305|     38|  JLONG *rgb_y_tab;
  306|     38|  JLONG i;
  307|       |
  308|       |  /* Allocate and fill in the conversion tables. */
  309|     38|  cconvert->rgb_y_tab = rgb_y_tab = (JLONG *)
  310|     38|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|     38|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  311|     38|                                (TABLE_SIZE * sizeof(JLONG)));
  ------------------
  |  |   90|     38|#define TABLE_SIZE      (3 * (MAXJSAMPLE + 1))
  |  |  ------------------
  |  |  |  |   65|     38|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
  312|       |
  313|  9.76k|  for (i = 0; i <= MAXJSAMPLE; i++) {
  ------------------
  |  |   65|  9.76k|#define MAXJSAMPLE      255
  ------------------
  |  Branch (313:15): [True: 9.72k, False: 38]
  ------------------
  314|  9.72k|    rgb_y_tab[i + R_Y_OFF] = FIX(0.29900) * i;
  ------------------
  |  |   87|  9.72k|#define R_Y_OFF         0                       /* offset to R => Y section */
  ------------------
                  rgb_y_tab[i + R_Y_OFF] = FIX(0.29900) * i;
  ------------------
  |  |   78|  9.72k|#define FIX(x)          ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
  |  |  ------------------
  |  |  |  |   76|  9.72k|#define SCALEBITS       16      /* speediest right-shift on some machines */
  |  |  ------------------
  ------------------
  315|  9.72k|    rgb_y_tab[i + G_Y_OFF] = FIX(0.58700) * i;
  ------------------
  |  |   88|  9.72k|#define G_Y_OFF         (1 * (MAXJSAMPLE + 1))  /* offset to G => Y section */
  |  |  ------------------
  |  |  |  |   65|  9.72k|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
                  rgb_y_tab[i + G_Y_OFF] = FIX(0.58700) * i;
  ------------------
  |  |   78|  9.72k|#define FIX(x)          ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
  |  |  ------------------
  |  |  |  |   76|  9.72k|#define SCALEBITS       16      /* speediest right-shift on some machines */
  |  |  ------------------
  ------------------
  316|  9.72k|    rgb_y_tab[i + B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
  ------------------
  |  |   89|  9.72k|#define B_Y_OFF         (2 * (MAXJSAMPLE + 1))  /* etc. */
  |  |  ------------------
  |  |  |  |   65|  9.72k|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
                  rgb_y_tab[i + B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
  ------------------
  |  |   78|  9.72k|#define FIX(x)          ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
  |  |  ------------------
  |  |  |  |   76|  9.72k|#define SCALEBITS       16      /* speediest right-shift on some machines */
  |  |  ------------------
  ------------------
                  rgb_y_tab[i + B_Y_OFF] = FIX(0.11400) * i + ONE_HALF;
  ------------------
  |  |   77|  9.72k|#define ONE_HALF        ((JLONG)1 << (SCALEBITS - 1))
  |  |  ------------------
  |  |  |  |   76|  9.72k|#define SCALEBITS       16      /* speediest right-shift on some machines */
  |  |  ------------------
  ------------------
  317|  9.72k|  }
  318|     38|}
jdcolor.c:gray_rgb_convert:
  437|  4.49M|{
  438|  4.49M|  switch (cinfo->out_color_space) {
  439|  4.45M|  case JCS_EXT_RGB:
  ------------------
  |  Branch (439:3): [True: 4.45M, False: 40.8k]
  ------------------
  440|  4.45M|    gray_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
  441|  4.45M|                                 num_rows);
  442|  4.45M|    break;
  443|      0|  case JCS_EXT_RGBX:
  ------------------
  |  Branch (443:3): [True: 0, False: 4.49M]
  ------------------
  444|      0|  case JCS_EXT_RGBA:
  ------------------
  |  Branch (444:3): [True: 0, False: 4.49M]
  ------------------
  445|      0|    gray_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
  446|      0|                                  num_rows);
  447|      0|    break;
  448|      0|  case JCS_EXT_BGR:
  ------------------
  |  Branch (448:3): [True: 0, False: 4.49M]
  ------------------
  449|      0|    gray_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
  450|      0|                                 num_rows);
  451|      0|    break;
  452|  40.8k|  case JCS_EXT_BGRX:
  ------------------
  |  Branch (452:3): [True: 40.8k, False: 4.45M]
  ------------------
  453|  40.8k|  case JCS_EXT_BGRA:
  ------------------
  |  Branch (453:3): [True: 0, False: 4.49M]
  ------------------
  454|  40.8k|    gray_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
  455|  40.8k|                                  num_rows);
  456|  40.8k|    break;
  457|      0|  case JCS_EXT_XBGR:
  ------------------
  |  Branch (457:3): [True: 0, False: 4.49M]
  ------------------
  458|      0|  case JCS_EXT_ABGR:
  ------------------
  |  Branch (458:3): [True: 0, False: 4.49M]
  ------------------
  459|      0|    gray_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
  460|      0|                                  num_rows);
  461|      0|    break;
  462|      0|  case JCS_EXT_XRGB:
  ------------------
  |  Branch (462:3): [True: 0, False: 4.49M]
  ------------------
  463|      0|  case JCS_EXT_ARGB:
  ------------------
  |  Branch (463:3): [True: 0, False: 4.49M]
  ------------------
  464|      0|    gray_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
  465|      0|                                  num_rows);
  466|      0|    break;
  467|      0|  default:
  ------------------
  |  Branch (467:3): [True: 0, False: 4.49M]
  ------------------
  468|      0|    gray_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,
  469|      0|                              num_rows);
  470|      0|    break;
  471|  4.49M|  }
  472|  4.49M|}
jdcolor.c:null_convert:
  363|  66.4k|{
  364|  66.4k|  register JSAMPROW inptr, inptr0, inptr1, inptr2, inptr3, outptr;
  365|  66.4k|  register JDIMENSION col;
  366|  66.4k|  register int num_components = cinfo->num_components;
  367|  66.4k|  JDIMENSION num_cols = cinfo->output_width;
  368|  66.4k|  int ci;
  369|       |
  370|  66.4k|  if (num_components == 3) {
  ------------------
  |  Branch (370:7): [True: 66.4k, False: 0]
  ------------------
  371|   226k|    while (--num_rows >= 0) {
  ------------------
  |  Branch (371:12): [True: 160k, False: 66.4k]
  ------------------
  372|   160k|      inptr0 = input_buf[0][input_row];
  373|   160k|      inptr1 = input_buf[1][input_row];
  374|   160k|      inptr2 = input_buf[2][input_row];
  375|   160k|      input_row++;
  376|   160k|      outptr = *output_buf++;
  377|  10.4M|      for (col = 0; col < num_cols; col++) {
  ------------------
  |  Branch (377:21): [True: 10.2M, False: 160k]
  ------------------
  378|  10.2M|        *outptr++ = inptr0[col];
  379|  10.2M|        *outptr++ = inptr1[col];
  380|  10.2M|        *outptr++ = inptr2[col];
  381|  10.2M|      }
  382|   160k|    }
  383|  66.4k|  } else if (num_components == 4) {
  ------------------
  |  Branch (383:14): [True: 0, False: 0]
  ------------------
  384|      0|    while (--num_rows >= 0) {
  ------------------
  |  Branch (384:12): [True: 0, False: 0]
  ------------------
  385|      0|      inptr0 = input_buf[0][input_row];
  386|      0|      inptr1 = input_buf[1][input_row];
  387|      0|      inptr2 = input_buf[2][input_row];
  388|      0|      inptr3 = input_buf[3][input_row];
  389|      0|      input_row++;
  390|      0|      outptr = *output_buf++;
  391|      0|      for (col = 0; col < num_cols; col++) {
  ------------------
  |  Branch (391:21): [True: 0, False: 0]
  ------------------
  392|      0|        *outptr++ = inptr0[col];
  393|      0|        *outptr++ = inptr1[col];
  394|      0|        *outptr++ = inptr2[col];
  395|      0|        *outptr++ = inptr3[col];
  396|      0|      }
  397|      0|    }
  398|      0|  } else {
  399|      0|    while (--num_rows >= 0) {
  ------------------
  |  Branch (399:12): [True: 0, False: 0]
  ------------------
  400|      0|      for (ci = 0; ci < num_components; ci++) {
  ------------------
  |  Branch (400:20): [True: 0, False: 0]
  ------------------
  401|      0|        inptr = input_buf[ci][input_row];
  402|      0|        outptr = *output_buf;
  403|      0|        for (col = 0; col < num_cols; col++) {
  ------------------
  |  Branch (403:23): [True: 0, False: 0]
  ------------------
  404|      0|          outptr[ci] = inptr[col];
  405|      0|          outptr += num_components;
  406|      0|        }
  407|      0|      }
  408|      0|      output_buf++;
  409|      0|      input_row++;
  410|      0|    }
  411|      0|  }
  412|  66.4k|}
jdcolor.c:rgb_rgb_convert:
  482|  19.1k|{
  483|  19.1k|  switch (cinfo->out_color_space) {
  484|      0|  case JCS_EXT_RGB:
  ------------------
  |  Branch (484:3): [True: 0, False: 19.1k]
  ------------------
  485|      0|    rgb_extrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
  486|      0|                                num_rows);
  487|      0|    break;
  488|      0|  case JCS_EXT_RGBX:
  ------------------
  |  Branch (488:3): [True: 0, False: 19.1k]
  ------------------
  489|      0|  case JCS_EXT_RGBA:
  ------------------
  |  Branch (489:3): [True: 0, False: 19.1k]
  ------------------
  490|      0|    rgb_extrgbx_convert_internal(cinfo, input_buf, input_row, output_buf,
  491|      0|                                 num_rows);
  492|      0|    break;
  493|      0|  case JCS_EXT_BGR:
  ------------------
  |  Branch (493:3): [True: 0, False: 19.1k]
  ------------------
  494|      0|    rgb_extbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
  495|      0|                                num_rows);
  496|      0|    break;
  497|  19.1k|  case JCS_EXT_BGRX:
  ------------------
  |  Branch (497:3): [True: 19.1k, False: 0]
  ------------------
  498|  19.1k|  case JCS_EXT_BGRA:
  ------------------
  |  Branch (498:3): [True: 0, False: 19.1k]
  ------------------
  499|  19.1k|    rgb_extbgrx_convert_internal(cinfo, input_buf, input_row, output_buf,
  500|  19.1k|                                 num_rows);
  501|  19.1k|    break;
  502|      0|  case JCS_EXT_XBGR:
  ------------------
  |  Branch (502:3): [True: 0, False: 19.1k]
  ------------------
  503|      0|  case JCS_EXT_ABGR:
  ------------------
  |  Branch (503:3): [True: 0, False: 19.1k]
  ------------------
  504|      0|    rgb_extxbgr_convert_internal(cinfo, input_buf, input_row, output_buf,
  505|      0|                                 num_rows);
  506|      0|    break;
  507|      0|  case JCS_EXT_XRGB:
  ------------------
  |  Branch (507:3): [True: 0, False: 19.1k]
  ------------------
  508|      0|  case JCS_EXT_ARGB:
  ------------------
  |  Branch (508:3): [True: 0, False: 19.1k]
  ------------------
  509|      0|    rgb_extxrgb_convert_internal(cinfo, input_buf, input_row, output_buf,
  510|      0|                                 num_rows);
  511|      0|    break;
  512|      0|  default:
  ------------------
  |  Branch (512:3): [True: 0, False: 19.1k]
  ------------------
  513|      0|    rgb_rgb_convert_internal(cinfo, input_buf, input_row, output_buf,
  514|      0|                             num_rows);
  515|      0|    break;
  516|  19.1k|  }
  517|  19.1k|}

jinit_inverse_dct:
  331|  4.56k|{
  332|  4.56k|  my_idct_ptr idct;
  333|  4.56k|  int ci;
  334|  4.56k|  jpeg_component_info *compptr;
  335|       |
  336|  4.56k|  idct = (my_idct_ptr)
  337|  4.56k|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  4.56k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  338|  4.56k|                                sizeof(my_idct_controller));
  339|  4.56k|  cinfo->idct = (struct jpeg_inverse_dct *)idct;
  340|  4.56k|  idct->pub.start_pass = start_pass;
  341|       |
  342|  13.7k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (342:44): [True: 9.16k, False: 4.56k]
  ------------------
  343|  9.16k|       ci++, compptr++) {
  344|       |    /* Allocate and pre-zero a multiplier table for each component */
  345|  9.16k|    compptr->dct_table =
  346|  9.16k|      (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  9.16k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  347|  9.16k|                                  sizeof(multiplier_table));
  348|  9.16k|    MEMZERO(compptr->dct_table, sizeof(multiplier_table));
  ------------------
  |  |   73|  9.16k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
  349|       |    /* Mark multiplier table not yet set up for any method */
  350|  9.16k|    idct->cur_method[ci] = -1;
  351|  9.16k|  }
  352|  4.56k|}
jddctmgr.c:start_pass:
   98|  3.60k|{
   99|  3.60k|  my_idct_ptr idct = (my_idct_ptr)cinfo->idct;
  100|  3.60k|  int ci, i;
  101|  3.60k|  jpeg_component_info *compptr;
  102|  3.60k|  int method = 0;
  103|  3.60k|  inverse_DCT_method_ptr method_ptr = NULL;
  104|  3.60k|  JQUANT_TBL *qtbl;
  105|       |
  106|  10.5k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (106:44): [True: 6.97k, False: 3.60k]
  ------------------
  107|  6.97k|       ci++, compptr++) {
  108|       |    /* Select the proper IDCT routine for this component's scaling */
  109|  6.97k|    switch (compptr->_DCT_scaled_size) {
  ------------------
  |  |   24|  6.97k|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  110|      0|#ifdef IDCT_SCALING_SUPPORTED
  111|      0|    case 1:
  ------------------
  |  Branch (111:5): [True: 0, False: 6.97k]
  ------------------
  112|      0|      method_ptr = jpeg_idct_1x1;
  113|      0|      method = JDCT_ISLOW;      /* jidctred uses islow-style table */
  114|      0|      break;
  115|      0|    case 2:
  ------------------
  |  Branch (115:5): [True: 0, False: 6.97k]
  ------------------
  116|      0|      if (jsimd_can_idct_2x2())
  ------------------
  |  Branch (116:11): [True: 0, False: 0]
  ------------------
  117|      0|        method_ptr = jsimd_idct_2x2;
  118|      0|      else
  119|      0|        method_ptr = jpeg_idct_2x2;
  120|      0|      method = JDCT_ISLOW;      /* jidctred uses islow-style table */
  121|      0|      break;
  122|      0|    case 3:
  ------------------
  |  Branch (122:5): [True: 0, False: 6.97k]
  ------------------
  123|      0|      method_ptr = jpeg_idct_3x3;
  124|      0|      method = JDCT_ISLOW;      /* jidctint uses islow-style table */
  125|      0|      break;
  126|    973|    case 4:
  ------------------
  |  Branch (126:5): [True: 973, False: 5.99k]
  ------------------
  127|    973|      if (jsimd_can_idct_4x4())
  ------------------
  |  Branch (127:11): [True: 973, False: 0]
  ------------------
  128|    973|        method_ptr = jsimd_idct_4x4;
  129|      0|      else
  130|      0|        method_ptr = jpeg_idct_4x4;
  131|    973|      method = JDCT_ISLOW;      /* jidctred uses islow-style table */
  132|    973|      break;
  133|     21|    case 5:
  ------------------
  |  Branch (133:5): [True: 21, False: 6.94k]
  ------------------
  134|     21|      method_ptr = jpeg_idct_5x5;
  135|     21|      method = JDCT_ISLOW;      /* jidctint uses islow-style table */
  136|     21|      break;
  137|      0|    case 6:
  ------------------
  |  Branch (137:5): [True: 0, False: 6.97k]
  ------------------
  138|       |#if defined(__mips__)
  139|       |      if (jsimd_can_idct_6x6())
  140|       |        method_ptr = jsimd_idct_6x6;
  141|       |      else
  142|       |#endif
  143|      0|      method_ptr = jpeg_idct_6x6;
  144|      0|      method = JDCT_ISLOW;      /* jidctint uses islow-style table */
  145|      0|      break;
  146|      0|    case 7:
  ------------------
  |  Branch (146:5): [True: 0, False: 6.97k]
  ------------------
  147|      0|      method_ptr = jpeg_idct_7x7;
  148|      0|      method = JDCT_ISLOW;      /* jidctint uses islow-style table */
  149|      0|      break;
  150|      0|#endif
  151|  5.96k|    case DCTSIZE:
  ------------------
  |  |   46|  5.96k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (151:5): [True: 5.96k, False: 1.00k]
  ------------------
  152|  5.96k|      switch (cinfo->dct_method) {
  153|      0|#ifdef DCT_ISLOW_SUPPORTED
  154|  1.32k|      case JDCT_ISLOW:
  ------------------
  |  Branch (154:7): [True: 1.32k, False: 4.63k]
  ------------------
  155|  1.32k|        if (jsimd_can_idct_islow())
  ------------------
  |  Branch (155:13): [True: 1.32k, False: 0]
  ------------------
  156|  1.32k|          method_ptr = jsimd_idct_islow;
  157|      0|        else
  158|      0|          method_ptr = jpeg_idct_islow;
  159|  1.32k|        method = JDCT_ISLOW;
  160|  1.32k|        break;
  161|      0|#endif
  162|      0|#ifdef DCT_IFAST_SUPPORTED
  163|  4.63k|      case JDCT_IFAST:
  ------------------
  |  Branch (163:7): [True: 4.63k, False: 1.32k]
  ------------------
  164|  4.63k|        if (jsimd_can_idct_ifast())
  ------------------
  |  Branch (164:13): [True: 4.63k, False: 0]
  ------------------
  165|  4.63k|          method_ptr = jsimd_idct_ifast;
  166|      0|        else
  167|      0|          method_ptr = jpeg_idct_ifast;
  168|  4.63k|        method = JDCT_IFAST;
  169|  4.63k|        break;
  170|      0|#endif
  171|      0|#ifdef DCT_FLOAT_SUPPORTED
  172|      0|      case JDCT_FLOAT:
  ------------------
  |  Branch (172:7): [True: 0, False: 5.96k]
  ------------------
  173|      0|        if (jsimd_can_idct_float())
  ------------------
  |  Branch (173:13): [True: 0, False: 0]
  ------------------
  174|      0|          method_ptr = jsimd_idct_float;
  175|      0|        else
  176|      0|          method_ptr = jpeg_idct_float;
  177|      0|        method = JDCT_FLOAT;
  178|      0|        break;
  179|      0|#endif
  180|      0|      default:
  ------------------
  |  Branch (180:7): [True: 0, False: 5.96k]
  ------------------
  181|      0|        ERREXIT(cinfo, JERR_NOT_COMPILED);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  182|      0|        break;
  183|  5.96k|      }
  184|  5.96k|      break;
  185|  5.96k|#ifdef IDCT_SCALING_SUPPORTED
  186|  5.96k|    case 9:
  ------------------
  |  Branch (186:5): [True: 0, False: 6.97k]
  ------------------
  187|      0|      method_ptr = jpeg_idct_9x9;
  188|      0|      method = JDCT_ISLOW;      /* jidctint uses islow-style table */
  189|      0|      break;
  190|     14|    case 10:
  ------------------
  |  Branch (190:5): [True: 14, False: 6.95k]
  ------------------
  191|     14|      method_ptr = jpeg_idct_10x10;
  192|     14|      method = JDCT_ISLOW;      /* jidctint uses islow-style table */
  193|     14|      break;
  194|      0|    case 11:
  ------------------
  |  Branch (194:5): [True: 0, False: 6.97k]
  ------------------
  195|      0|      method_ptr = jpeg_idct_11x11;
  196|      0|      method = JDCT_ISLOW;      /* jidctint uses islow-style table */
  197|      0|      break;
  198|      0|    case 12:
  ------------------
  |  Branch (198:5): [True: 0, False: 6.97k]
  ------------------
  199|       |#if defined(__mips__)
  200|       |      if (jsimd_can_idct_12x12())
  201|       |        method_ptr = jsimd_idct_12x12;
  202|       |      else
  203|       |#endif
  204|      0|      method_ptr = jpeg_idct_12x12;
  205|      0|      method = JDCT_ISLOW;      /* jidctint uses islow-style table */
  206|      0|      break;
  207|      0|    case 13:
  ------------------
  |  Branch (207:5): [True: 0, False: 6.97k]
  ------------------
  208|      0|      method_ptr = jpeg_idct_13x13;
  209|      0|      method = JDCT_ISLOW;      /* jidctint uses islow-style table */
  210|      0|      break;
  211|      0|    case 14:
  ------------------
  |  Branch (211:5): [True: 0, False: 6.97k]
  ------------------
  212|      0|      method_ptr = jpeg_idct_14x14;
  213|      0|      method = JDCT_ISLOW;      /* jidctint uses islow-style table */
  214|      0|      break;
  215|      0|    case 15:
  ------------------
  |  Branch (215:5): [True: 0, False: 6.97k]
  ------------------
  216|      0|      method_ptr = jpeg_idct_15x15;
  217|      0|      method = JDCT_ISLOW;      /* jidctint uses islow-style table */
  218|      0|      break;
  219|      0|    case 16:
  ------------------
  |  Branch (219:5): [True: 0, False: 6.97k]
  ------------------
  220|      0|      method_ptr = jpeg_idct_16x16;
  221|      0|      method = JDCT_ISLOW;      /* jidctint uses islow-style table */
  222|      0|      break;
  223|      0|#endif
  224|      0|    default:
  ------------------
  |  Branch (224:5): [True: 0, False: 6.97k]
  ------------------
  225|      0|      ERREXIT1(cinfo, JERR_BAD_DCTSIZE, compptr->_DCT_scaled_size);
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  226|      0|      break;
  227|  6.97k|    }
  228|  6.97k|    idct->pub.inverse_DCT[ci] = method_ptr;
  229|       |    /* Create multiplier table from quant table.
  230|       |     * However, we can skip this if the component is uninteresting
  231|       |     * or if we already built the table.  Also, if no quant table
  232|       |     * has yet been saved for the component, we leave the
  233|       |     * multiplier table all-zero; we'll be reading zeroes from the
  234|       |     * coefficient controller's buffer anyway.
  235|       |     */
  236|  6.97k|    if (!compptr->component_needed || idct->cur_method[ci] == method)
  ------------------
  |  Branch (236:9): [True: 642, False: 6.32k]
  |  Branch (236:39): [True: 0, False: 6.32k]
  ------------------
  237|    642|      continue;
  238|  6.32k|    qtbl = compptr->quant_table;
  239|  6.32k|    if (qtbl == NULL)           /* happens if no data yet for component */
  ------------------
  |  Branch (239:9): [True: 1.46k, False: 4.86k]
  ------------------
  240|  1.46k|      continue;
  241|  4.86k|    idct->cur_method[ci] = method;
  242|  4.86k|    switch (method) {
  243|      0|#ifdef PROVIDE_ISLOW_TABLES
  244|  1.34k|    case JDCT_ISLOW:
  ------------------
  |  Branch (244:5): [True: 1.34k, False: 3.52k]
  ------------------
  245|  1.34k|      {
  246|       |        /* For LL&M IDCT method, multipliers are equal to raw quantization
  247|       |         * coefficients, but are stored as ints to ensure access efficiency.
  248|       |         */
  249|  1.34k|        ISLOW_MULT_TYPE *ismtbl = (ISLOW_MULT_TYPE *)compptr->dct_table;
  250|  87.4k|        for (i = 0; i < DCTSIZE2; i++) {
  ------------------
  |  |   47|  87.4k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (250:21): [True: 86.0k, False: 1.34k]
  ------------------
  251|  86.0k|          ismtbl[i] = (ISLOW_MULT_TYPE)qtbl->quantval[i];
  252|  86.0k|        }
  253|  1.34k|      }
  254|  1.34k|      break;
  255|      0|#endif
  256|      0|#ifdef DCT_IFAST_SUPPORTED
  257|  3.52k|    case JDCT_IFAST:
  ------------------
  |  Branch (257:5): [True: 3.52k, False: 1.34k]
  ------------------
  258|  3.52k|      {
  259|       |        /* For AA&N IDCT method, multipliers are equal to quantization
  260|       |         * coefficients scaled by scalefactor[row]*scalefactor[col], where
  261|       |         *   scalefactor[0] = 1
  262|       |         *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7
  263|       |         * For integer operation, the multiplier table is to be scaled by
  264|       |         * IFAST_SCALE_BITS.
  265|       |         */
  266|  3.52k|        IFAST_MULT_TYPE *ifmtbl = (IFAST_MULT_TYPE *)compptr->dct_table;
  267|  3.52k|#define CONST_BITS  14
  268|  3.52k|        static const INT16 aanscales[DCTSIZE2] = {
  269|       |          /* precomputed values scaled up by 14 bits */
  270|  3.52k|          16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,
  271|  3.52k|          22725, 31521, 29692, 26722, 22725, 17855, 12299,  6270,
  272|  3.52k|          21407, 29692, 27969, 25172, 21407, 16819, 11585,  5906,
  273|  3.52k|          19266, 26722, 25172, 22654, 19266, 15137, 10426,  5315,
  274|  3.52k|          16384, 22725, 21407, 19266, 16384, 12873,  8867,  4520,
  275|  3.52k|          12873, 17855, 16819, 15137, 12873, 10114,  6967,  3552,
  276|  3.52k|           8867, 12299, 11585, 10426,  8867,  6967,  4799,  2446,
  277|  3.52k|           4520,  6270,  5906,  5315,  4520,  3552,  2446,  1247
  278|  3.52k|        };
  279|  3.52k|        SHIFT_TEMPS
  280|       |
  281|   228k|        for (i = 0; i < DCTSIZE2; i++) {
  ------------------
  |  |   47|   228k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (281:21): [True: 225k, False: 3.52k]
  ------------------
  282|   225k|          ifmtbl[i] = (IFAST_MULT_TYPE)
  283|   225k|            DESCALE(MULTIPLY16V16((JLONG)qtbl->quantval[i],
  ------------------
  |  |  178|   225k|#define DESCALE(x, n)  RIGHT_SHIFT((x) + (ONE << ((n) - 1)), n)
  |  |  ------------------
  |  |  |  |  300|   225k|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  |  |  ------------------
  ------------------
  284|   225k|                                  (JLONG)aanscales[i]),
  285|   225k|                    CONST_BITS - IFAST_SCALE_BITS);
  286|   225k|        }
  287|  3.52k|      }
  288|  3.52k|      break;
  289|      0|#endif
  290|      0|#ifdef DCT_FLOAT_SUPPORTED
  291|      0|    case JDCT_FLOAT:
  ------------------
  |  Branch (291:5): [True: 0, False: 4.86k]
  ------------------
  292|      0|      {
  293|       |        /* For float AA&N IDCT method, multipliers are equal to quantization
  294|       |         * coefficients scaled by scalefactor[row]*scalefactor[col], where
  295|       |         *   scalefactor[0] = 1
  296|       |         *   scalefactor[k] = cos(k*PI/16) * sqrt(2)    for k=1..7
  297|       |         */
  298|      0|        FLOAT_MULT_TYPE *fmtbl = (FLOAT_MULT_TYPE *)compptr->dct_table;
  299|      0|        int row, col;
  300|      0|        static const double aanscalefactor[DCTSIZE] = {
  301|      0|          1.0, 1.387039845, 1.306562965, 1.175875602,
  302|      0|          1.0, 0.785694958, 0.541196100, 0.275899379
  303|      0|        };
  304|       |
  305|      0|        i = 0;
  306|      0|        for (row = 0; row < DCTSIZE; row++) {
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (306:23): [True: 0, False: 0]
  ------------------
  307|      0|          for (col = 0; col < DCTSIZE; col++) {
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (307:25): [True: 0, False: 0]
  ------------------
  308|      0|            fmtbl[i] = (FLOAT_MULT_TYPE)
  309|      0|              ((double)qtbl->quantval[i] *
  310|      0|               aanscalefactor[row] * aanscalefactor[col]);
  311|      0|            i++;
  312|      0|          }
  313|      0|        }
  314|      0|      }
  315|      0|      break;
  316|      0|#endif
  317|      0|    default:
  ------------------
  |  Branch (317:5): [True: 0, False: 4.86k]
  ------------------
  318|      0|      ERREXIT(cinfo, JERR_NOT_COMPILED);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  319|      0|      break;
  320|  4.86k|    }
  321|  4.86k|  }
  322|  3.60k|}

jpeg_make_d_derived_tbl:
  160|  30.2k|{
  161|  30.2k|  JHUFF_TBL *htbl;
  162|  30.2k|  d_derived_tbl *dtbl;
  163|  30.2k|  int p, i, l, si, numsymbols;
  164|  30.2k|  int lookbits, ctr;
  165|  30.2k|  char huffsize[257];
  166|  30.2k|  unsigned int huffcode[257];
  167|  30.2k|  unsigned int code;
  168|       |
  169|       |  /* Note that huffsize[] and huffcode[] are filled in code-length order,
  170|       |   * paralleling the order of the symbols themselves in htbl->huffval[].
  171|       |   */
  172|       |
  173|       |  /* Find the input Huffman table */
  174|  30.2k|  if (tblno < 0 || tblno >= NUM_HUFF_TBLS)
  ------------------
  |  |   49|  30.2k|#define NUM_HUFF_TBLS       4   /* Huffman tables are numbered 0..3 */
  ------------------
  |  Branch (174:7): [True: 0, False: 30.2k]
  |  Branch (174:20): [True: 47, False: 30.2k]
  ------------------
  175|     47|    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
  ------------------
  |  |  234|     47|  ((cinfo)->err->msg_code = (code), \
  |  |  235|     47|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|     47|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  176|  30.2k|  htbl =
  177|  30.2k|    isDC ? cinfo->dc_huff_tbl_ptrs[tblno] : cinfo->ac_huff_tbl_ptrs[tblno];
  ------------------
  |  Branch (177:5): [True: 16.3k, False: 13.9k]
  ------------------
  178|  30.2k|  if (htbl == NULL)
  ------------------
  |  Branch (178:7): [True: 18, False: 30.2k]
  ------------------
  179|     18|    ERREXIT1(cinfo, JERR_NO_HUFF_TABLE, tblno);
  ------------------
  |  |  234|     18|  ((cinfo)->err->msg_code = (code), \
  |  |  235|     18|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|     18|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  180|       |
  181|       |  /* Allocate a workspace if we haven't already done so. */
  182|  30.2k|  if (*pdtbl == NULL)
  ------------------
  |  Branch (182:7): [True: 5.35k, False: 24.9k]
  ------------------
  183|  5.35k|    *pdtbl = (d_derived_tbl *)
  184|  5.35k|      (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  5.35k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  185|  5.35k|                                  sizeof(d_derived_tbl));
  186|  30.2k|  dtbl = *pdtbl;
  187|  30.2k|  dtbl->pub = htbl;             /* fill in back link */
  188|       |
  189|       |  /* Figure C.1: make table of Huffman code length for each symbol */
  190|       |
  191|  30.2k|  p = 0;
  192|   513k|  for (l = 1; l <= 16; l++) {
  ------------------
  |  Branch (192:15): [True: 483k, False: 30.2k]
  ------------------
  193|   483k|    i = (int)htbl->bits[l];
  194|   483k|    if (i < 0 || p + i > 256)   /* protect against table overrun */
  ------------------
  |  Branch (194:9): [True: 0, False: 483k]
  |  Branch (194:18): [True: 0, False: 483k]
  ------------------
  195|      0|      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  196|  1.80M|    while (i--)
  ------------------
  |  Branch (196:12): [True: 1.32M, False: 483k]
  ------------------
  197|  1.32M|      huffsize[p++] = (char)l;
  198|   483k|  }
  199|  30.2k|  huffsize[p] = 0;
  200|  30.2k|  numsymbols = p;
  201|       |
  202|       |  /* Figure C.2: generate the codes themselves */
  203|       |  /* We also validate that the counts represent a legal Huffman code tree. */
  204|       |
  205|  30.2k|  code = 0;
  206|  30.2k|  si = huffsize[0];
  207|  30.2k|  p = 0;
  208|   275k|  while (huffsize[p]) {
  ------------------
  |  Branch (208:10): [True: 245k, False: 30.2k]
  ------------------
  209|  1.56M|    while (((int)huffsize[p]) == si) {
  ------------------
  |  Branch (209:12): [True: 1.32M, False: 245k]
  ------------------
  210|  1.32M|      huffcode[p++] = code;
  211|  1.32M|      code++;
  212|  1.32M|    }
  213|       |    /* code is now 1 more than the last code used for codelength si; but
  214|       |     * it must still fit in si bits, since no code is allowed to be all ones.
  215|       |     */
  216|   245k|    if (((JLONG)code) >= (((JLONG)1) << si))
  ------------------
  |  Branch (216:9): [True: 7, False: 245k]
  ------------------
  217|      7|      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  ------------------
  |  |  231|      7|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      7|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  218|   245k|    code <<= 1;
  219|   245k|    si++;
  220|   245k|  }
  221|       |
  222|       |  /* Figure F.15: generate decoding tables for bit-sequential decoding */
  223|       |
  224|  30.2k|  p = 0;
  225|   513k|  for (l = 1; l <= 16; l++) {
  ------------------
  |  Branch (225:15): [True: 483k, False: 30.2k]
  ------------------
  226|   483k|    if (htbl->bits[l]) {
  ------------------
  |  Branch (226:9): [True: 224k, False: 259k]
  ------------------
  227|       |      /* valoffset[l] = huffval[] index of 1st symbol of code length l,
  228|       |       * minus the minimum code of length l
  229|       |       */
  230|   224k|      dtbl->valoffset[l] = (JLONG)p - (JLONG)huffcode[p];
  231|   224k|      p += htbl->bits[l];
  232|   224k|      dtbl->maxcode[l] = huffcode[p - 1]; /* maximum code of length l */
  233|   259k|    } else {
  234|   259k|      dtbl->maxcode[l] = -1;    /* -1 if no codes of this length */
  235|   259k|    }
  236|   483k|  }
  237|  30.2k|  dtbl->valoffset[17] = 0;
  238|  30.2k|  dtbl->maxcode[17] = 0xFFFFFL; /* ensures jpeg_huff_decode terminates */
  239|       |
  240|       |  /* Compute lookahead tables to speed up decoding.
  241|       |   * First we set all the table entries to 0, indicating "too long";
  242|       |   * then we iterate through the Huffman codes that are short enough and
  243|       |   * fill in all the entries that correspond to bit sequences starting
  244|       |   * with that code.
  245|       |   */
  246|       |
  247|  7.76M|  for (i = 0; i < (1 << HUFF_LOOKAHEAD); i++)
  ------------------
  |  |   21|  7.76M|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  ------------------
  |  Branch (247:15): [True: 7.73M, False: 30.2k]
  ------------------
  248|  7.73M|    dtbl->lookup[i] = (HUFF_LOOKAHEAD + 1) << HUFF_LOOKAHEAD;
  ------------------
  |  |   21|  7.73M|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  ------------------
                  dtbl->lookup[i] = (HUFF_LOOKAHEAD + 1) << HUFF_LOOKAHEAD;
  ------------------
  |  |   21|  7.73M|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  ------------------
  249|       |
  250|  30.2k|  p = 0;
  251|   272k|  for (l = 1; l <= HUFF_LOOKAHEAD; l++) {
  ------------------
  |  |   21|   272k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  ------------------
  |  Branch (251:15): [True: 241k, False: 30.2k]
  ------------------
  252|   575k|    for (i = 1; i <= (int)htbl->bits[l]; i++, p++) {
  ------------------
  |  Branch (252:17): [True: 334k, False: 241k]
  ------------------
  253|       |      /* l = current code's length, p = its index in huffcode[] & huffval[]. */
  254|       |      /* Generate left-justified code followed by all possible bit sequences */
  255|   334k|      lookbits = huffcode[p] << (HUFF_LOOKAHEAD - l);
  ------------------
  |  |   21|   334k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  ------------------
  256|  7.58M|      for (ctr = 1 << (HUFF_LOOKAHEAD - l); ctr > 0; ctr--) {
  ------------------
  |  |   21|   334k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  ------------------
  |  Branch (256:45): [True: 7.25M, False: 334k]
  ------------------
  257|  7.25M|        dtbl->lookup[lookbits] = (l << HUFF_LOOKAHEAD) | htbl->huffval[p];
  ------------------
  |  |   21|  7.25M|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  ------------------
  258|  7.25M|        lookbits++;
  259|  7.25M|      }
  260|   334k|    }
  261|   241k|  }
  262|       |
  263|       |  /* Validate symbols as being reasonable.
  264|       |   * For AC tables, we make no check, but accept all byte values 0..255.
  265|       |   * For DC tables, we require the symbols to be in range 0..15.
  266|       |   * (Tighter bounds could be applied depending on the data depth and mode,
  267|       |   * but this is sufficient to ensure safe decoding.)
  268|       |   */
  269|  30.2k|  if (isDC) {
  ------------------
  |  Branch (269:7): [True: 16.2k, False: 13.9k]
  ------------------
  270|   140k|    for (i = 0; i < numsymbols; i++) {
  ------------------
  |  Branch (270:17): [True: 124k, False: 16.2k]
  ------------------
  271|   124k|      int sym = htbl->huffval[i];
  272|   124k|      if (sym < 0 || sym > 15)
  ------------------
  |  Branch (272:11): [True: 0, False: 124k]
  |  Branch (272:22): [True: 12, False: 124k]
  ------------------
  273|     12|        ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  ------------------
  |  |  231|     12|  ((cinfo)->err->msg_code = (code), \
  |  |  232|     12|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  274|   124k|    }
  275|  16.2k|  }
  276|  30.2k|}
jpeg_fill_bit_buffer:
  306|   285k|{
  307|       |  /* Copy heavily used state fields into locals (hopefully registers) */
  308|   285k|  register const JOCTET *next_input_byte = state->next_input_byte;
  309|   285k|  register size_t bytes_in_buffer = state->bytes_in_buffer;
  310|   285k|  j_decompress_ptr cinfo = state->cinfo;
  311|       |
  312|       |  /* Attempt to load at least MIN_GET_BITS bits into get_buffer. */
  313|       |  /* (It is assumed that no request will be for more than that many bits.) */
  314|       |  /* We fail to do so only if we hit a marker or are forced to suspend. */
  315|       |
  316|   285k|  if (cinfo->unread_marker == 0) {      /* cannot advance past a marker */
  ------------------
  |  Branch (316:7): [True: 70.8k, False: 214k]
  ------------------
  317|   483k|    while (bits_left < MIN_GET_BITS) {
  ------------------
  |  |  297|   483k|#define MIN_GET_BITS  (BIT_BUF_SIZE - 7)
  |  |  ------------------
  |  |  |  |   79|   483k|#define BIT_BUF_SIZE  64                /* size of buffer in bits */
  |  |  ------------------
  ------------------
  |  Branch (317:12): [True: 430k, False: 52.7k]
  ------------------
  318|   430k|      register int c;
  319|       |
  320|       |      /* Attempt to read a byte */
  321|   430k|      if (bytes_in_buffer == 0) {
  ------------------
  |  Branch (321:11): [True: 947, False: 429k]
  ------------------
  322|    947|        if (!(*cinfo->src->fill_input_buffer) (cinfo))
  ------------------
  |  Branch (322:13): [True: 0, False: 947]
  ------------------
  323|      0|          return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  324|    947|        next_input_byte = cinfo->src->next_input_byte;
  325|    947|        bytes_in_buffer = cinfo->src->bytes_in_buffer;
  326|    947|      }
  327|   430k|      bytes_in_buffer--;
  328|   430k|      c = GETJOCTET(*next_input_byte++);
  ------------------
  |  |  103|   430k|#define GETJOCTET(value)  (value)
  ------------------
  329|       |
  330|       |      /* If it's 0xFF, check and discard stuffed zero byte */
  331|   430k|      if (c == 0xFF) {
  ------------------
  |  Branch (331:11): [True: 24.6k, False: 405k]
  ------------------
  332|       |        /* Loop here to discard any padding FF's on terminating marker,
  333|       |         * so that we can save a valid unread_marker value.  NOTE: we will
  334|       |         * accept multiple FF's followed by a 0 as meaning a single FF data
  335|       |         * byte.  This data pattern is not valid according to the standard.
  336|       |         */
  337|  44.1k|        do {
  338|  44.1k|          if (bytes_in_buffer == 0) {
  ------------------
  |  Branch (338:15): [True: 36, False: 44.0k]
  ------------------
  339|     36|            if (!(*cinfo->src->fill_input_buffer) (cinfo))
  ------------------
  |  Branch (339:17): [True: 0, False: 36]
  ------------------
  340|      0|              return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  341|     36|            next_input_byte = cinfo->src->next_input_byte;
  342|     36|            bytes_in_buffer = cinfo->src->bytes_in_buffer;
  343|     36|          }
  344|  44.1k|          bytes_in_buffer--;
  345|  44.1k|          c = GETJOCTET(*next_input_byte++);
  ------------------
  |  |  103|  44.1k|#define GETJOCTET(value)  (value)
  ------------------
  346|  44.1k|        } while (c == 0xFF);
  ------------------
  |  Branch (346:18): [True: 19.4k, False: 24.6k]
  ------------------
  347|       |
  348|  24.6k|        if (c == 0) {
  ------------------
  |  Branch (348:13): [True: 6.58k, False: 18.0k]
  ------------------
  349|       |          /* Found FF/00, which represents an FF data byte */
  350|  6.58k|          c = 0xFF;
  351|  18.0k|        } else {
  352|       |          /* Oops, it's actually a marker indicating end of compressed data.
  353|       |           * Save the marker code for later use.
  354|       |           * Fine point: it might appear that we should save the marker into
  355|       |           * bitread working state, not straight into permanent state.  But
  356|       |           * once we have hit a marker, we cannot need to suspend within the
  357|       |           * current MCU, because we will read no more bytes from the data
  358|       |           * source.  So it is OK to update permanent state right away.
  359|       |           */
  360|  18.0k|          cinfo->unread_marker = c;
  361|       |          /* See if we need to insert some fake zero bits. */
  362|  18.0k|          goto no_more_bytes;
  363|  18.0k|        }
  364|  24.6k|      }
  365|       |
  366|       |      /* OK, load c into get_buffer */
  367|   412k|      get_buffer = (get_buffer << 8) | c;
  368|   412k|      bits_left += 8;
  369|   412k|    } /* end while */
  370|   214k|  } else {
  371|   232k|no_more_bytes:
  372|       |    /* We get here if we've read the marker that terminates the compressed
  373|       |     * data segment.  There should be enough bits in the buffer register
  374|       |     * to satisfy the request; if so, no problem.
  375|       |     */
  376|   232k|    if (nbits > bits_left) {
  ------------------
  |  Branch (376:9): [True: 139k, False: 93.3k]
  ------------------
  377|       |      /* Uh-oh.  Report corrupted data to user and stuff zeroes into
  378|       |       * the data stream, so that we can produce some kind of image.
  379|       |       * We use a nonvolatile flag to ensure that only one warning message
  380|       |       * appears per data segment.
  381|       |       */
  382|   139k|      if (!cinfo->entropy->insufficient_data) {
  ------------------
  |  Branch (382:11): [True: 18.2k, False: 120k]
  ------------------
  383|  18.2k|        WARNMS(cinfo, JWRN_HIT_MARKER);
  ------------------
  |  |  265|  18.2k|  ((cinfo)->err->msg_code = (code), \
  |  |  266|  18.2k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  384|  18.2k|        cinfo->entropy->insufficient_data = TRUE;
  ------------------
  |  |  248|  18.2k|#define TRUE    1
  ------------------
  385|  18.2k|      }
  386|       |      /* Fill the buffer with zero bits */
  387|   139k|      get_buffer <<= MIN_GET_BITS - bits_left;
  ------------------
  |  |  297|   139k|#define MIN_GET_BITS  (BIT_BUF_SIZE - 7)
  |  |  ------------------
  |  |  |  |   79|   139k|#define BIT_BUF_SIZE  64                /* size of buffer in bits */
  |  |  ------------------
  ------------------
  388|   139k|      bits_left = MIN_GET_BITS;
  ------------------
  |  |  297|   139k|#define MIN_GET_BITS  (BIT_BUF_SIZE - 7)
  |  |  ------------------
  |  |  |  |   79|   139k|#define BIT_BUF_SIZE  64                /* size of buffer in bits */
  |  |  ------------------
  ------------------
  389|   139k|    }
  390|   232k|  }
  391|       |
  392|       |  /* Unload the local registers */
  393|   285k|  state->next_input_byte = next_input_byte;
  394|   285k|  state->bytes_in_buffer = bytes_in_buffer;
  395|   285k|  state->get_buffer = get_buffer;
  396|   285k|  state->bits_left = bits_left;
  397|       |
  398|   285k|  return TRUE;
  ------------------
  |  |  248|   285k|#define TRUE    1
  ------------------
  399|   285k|}
jpeg_huff_decode:
  454|  98.0k|{
  455|  98.0k|  register int l = min_bits;
  456|  98.0k|  register JLONG code;
  457|       |
  458|       |  /* HUFF_DECODE has determined that the code is at least min_bits */
  459|       |  /* bits long, so fetch that many bits in one swoop. */
  460|       |
  461|  98.0k|  CHECK_BIT_BUFFER(*state, l, return -1);
  ------------------
  |  |  151|  98.0k|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|  98.0k|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 14.7k, False: 83.3k]
  |  |  ------------------
  |  |  153|  14.7k|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 14.7k]
  |  |  ------------------
  |  |  154|  14.7k|      { action; } \
  |  |  155|  14.7k|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|  14.7k|  } \
  |  |  157|  98.0k|}
  ------------------
  462|  98.0k|  code = GET_BITS(l);
  ------------------
  |  |  160|  98.0k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  ------------------
  463|       |
  464|       |  /* Collect the rest of the Huffman code one bit at a time. */
  465|       |  /* This is per Figure F.16. */
  466|       |
  467|   286k|  while (code > htbl->maxcode[l]) {
  ------------------
  |  Branch (467:10): [True: 188k, False: 98.0k]
  ------------------
  468|   188k|    code <<= 1;
  469|   188k|    CHECK_BIT_BUFFER(*state, 1, return -1);
  ------------------
  |  |  151|   188k|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|   188k|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 14.8k, False: 173k]
  |  |  ------------------
  |  |  153|  14.8k|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 14.8k]
  |  |  ------------------
  |  |  154|  14.8k|      { action; } \
  |  |  155|  14.8k|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|  14.8k|  } \
  |  |  157|   188k|}
  ------------------
  470|   188k|    code |= GET_BITS(1);
  ------------------
  |  |  160|   188k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  ------------------
  471|   188k|    l++;
  472|   188k|  }
  473|       |
  474|       |  /* Unload the local registers */
  475|  98.0k|  state->get_buffer = get_buffer;
  476|  98.0k|  state->bits_left = bits_left;
  477|       |
  478|       |  /* With garbage input we may reach the sentinel value l = 17. */
  479|       |
  480|  98.0k|  if (l > 16) {
  ------------------
  |  Branch (480:7): [True: 8.60k, False: 89.4k]
  ------------------
  481|  8.60k|    WARNMS(state->cinfo, JWRN_HUFF_BAD_CODE);
  ------------------
  |  |  265|  8.60k|  ((cinfo)->err->msg_code = (code), \
  |  |  266|  8.60k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  482|  8.60k|    return 0;                   /* fake a zero as the safest result */
  483|  8.60k|  }
  484|       |
  485|  89.4k|  return htbl->pub->huffval[(int)(code + htbl->valoffset[l])];
  486|  98.0k|}
jinit_huff_decoder:
  830|  1.76k|{
  831|  1.76k|  huff_entropy_ptr entropy;
  832|  1.76k|  int i;
  833|       |
  834|       |  /* Motion JPEG frames typically do not include the Huffman tables if they
  835|       |     are the default tables.  Thus, if the tables are not set by the time
  836|       |     the Huffman decoder is initialized (usually within the body of
  837|       |     jpeg_start_decompress()), we set them to default values. */
  838|  1.76k|  std_huff_tables((j_common_ptr)cinfo);
  839|       |
  840|  1.76k|  entropy = (huff_entropy_ptr)
  841|  1.76k|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  1.76k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  842|  1.76k|                                sizeof(huff_entropy_decoder));
  843|  1.76k|  cinfo->entropy = (struct jpeg_entropy_decoder *)entropy;
  844|  1.76k|  entropy->pub.start_pass = start_pass_huff_decoder;
  845|  1.76k|  entropy->pub.decode_mcu = decode_mcu;
  846|       |
  847|       |  /* Mark tables unallocated */
  848|  8.82k|  for (i = 0; i < NUM_HUFF_TBLS; i++) {
  ------------------
  |  |   49|  8.82k|#define NUM_HUFF_TBLS       4   /* Huffman tables are numbered 0..3 */
  ------------------
  |  Branch (848:15): [True: 7.06k, False: 1.76k]
  ------------------
  849|  7.06k|    entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
  850|  7.06k|  }
  851|  1.76k|}
jdhuff.c:start_pass_huff_decoder:
   95|  7.51k|{
   96|  7.51k|  huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
   97|  7.51k|  int ci, blkn, dctbl, actbl;
   98|  7.51k|  d_derived_tbl **pdtbl;
   99|  7.51k|  jpeg_component_info *compptr;
  100|       |
  101|       |  /* Check that the scan parameters Ss, Se, Ah/Al are OK for sequential JPEG.
  102|       |   * This ought to be an error condition, but we make it a warning because
  103|       |   * there are some baseline files out there with all zeroes in these bytes.
  104|       |   */
  105|  7.51k|  if (cinfo->Ss != 0 || cinfo->Se != DCTSIZE2 - 1 ||
  ------------------
  |  |   47|  4.39k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (105:7): [True: 3.12k, False: 4.39k]
  |  Branch (105:25): [True: 2.70k, False: 1.68k]
  ------------------
  106|  7.51k|      cinfo->Ah != 0 || cinfo->Al != 0)
  ------------------
  |  Branch (106:7): [True: 257, False: 1.42k]
  |  Branch (106:25): [True: 270, False: 1.15k]
  ------------------
  107|  6.35k|    WARNMS(cinfo, JWRN_NOT_SEQUENTIAL);
  ------------------
  |  |  265|  6.35k|  ((cinfo)->err->msg_code = (code), \
  |  |  266|  6.35k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  108|       |
  109|  18.5k|  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  ------------------
  |  Branch (109:16): [True: 11.0k, False: 7.51k]
  ------------------
  110|  11.0k|    compptr = cinfo->cur_comp_info[ci];
  111|  11.0k|    dctbl = compptr->dc_tbl_no;
  112|  11.0k|    actbl = compptr->ac_tbl_no;
  113|       |    /* Compute derived values for Huffman tables */
  114|       |    /* We may do this more than once for a table, but it's not expensive */
  115|  11.0k|    pdtbl = (d_derived_tbl **)(entropy->dc_derived_tbls) + dctbl;
  116|  11.0k|    jpeg_make_d_derived_tbl(cinfo, TRUE, dctbl, pdtbl);
  ------------------
  |  |  248|  11.0k|#define TRUE    1
  ------------------
  117|  11.0k|    pdtbl = (d_derived_tbl **)(entropy->ac_derived_tbls) + actbl;
  118|  11.0k|    jpeg_make_d_derived_tbl(cinfo, FALSE, actbl, pdtbl);
  ------------------
  |  |  245|  11.0k|#define FALSE   0               /* values of boolean */
  ------------------
  119|       |    /* Initialize DC predictions to 0 */
  120|  11.0k|    entropy->saved.last_dc_val[ci] = 0;
  121|  11.0k|  }
  122|       |
  123|       |  /* Precalculate decoding info for each block in an MCU of this scan */
  124|  24.6k|  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  ------------------
  |  Branch (124:18): [True: 17.1k, False: 7.51k]
  ------------------
  125|  17.1k|    ci = cinfo->MCU_membership[blkn];
  126|  17.1k|    compptr = cinfo->cur_comp_info[ci];
  127|       |    /* Precalculate which table to use for each block */
  128|  17.1k|    entropy->dc_cur_tbls[blkn] = entropy->dc_derived_tbls[compptr->dc_tbl_no];
  129|  17.1k|    entropy->ac_cur_tbls[blkn] = entropy->ac_derived_tbls[compptr->ac_tbl_no];
  130|       |    /* Decide whether we really care about the coefficient values */
  131|  17.1k|    if (compptr->component_needed) {
  ------------------
  |  Branch (131:9): [True: 16.6k, False: 448]
  ------------------
  132|  16.6k|      entropy->dc_needed[blkn] = TRUE;
  ------------------
  |  |  248|  16.6k|#define TRUE    1
  ------------------
  133|       |      /* we don't need the ACs if producing a 1/8th-size image */
  134|  16.6k|      entropy->ac_needed[blkn] = (compptr->_DCT_scaled_size > 1);
  ------------------
  |  |   24|  16.6k|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  135|  16.6k|    } else {
  136|    448|      entropy->dc_needed[blkn] = entropy->ac_needed[blkn] = FALSE;
  ------------------
  |  |  245|    448|#define FALSE   0               /* values of boolean */
  ------------------
  137|    448|    }
  138|  17.1k|  }
  139|       |
  140|       |  /* Initialize bitread state variables */
  141|  7.51k|  entropy->bitstate.bits_left = 0;
  142|  7.51k|  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
  143|  7.51k|  entropy->pub.insufficient_data = FALSE;
  ------------------
  |  |  245|  7.51k|#define FALSE   0               /* values of boolean */
  ------------------
  144|       |
  145|       |  /* Initialize restart counter */
  146|  7.51k|  entropy->restarts_to_go = cinfo->restart_interval;
  147|  7.51k|}
jdhuff.c:decode_mcu:
  786|  10.5M|{
  787|  10.5M|  huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
  788|  10.5M|  int usefast = 1;
  789|       |
  790|       |  /* Process restart marker if needed; may have to suspend */
  791|  10.5M|  if (cinfo->restart_interval) {
  ------------------
  |  Branch (791:7): [True: 6.45M, False: 4.13M]
  ------------------
  792|  6.45M|    if (entropy->restarts_to_go == 0)
  ------------------
  |  Branch (792:9): [True: 516k, False: 5.94M]
  ------------------
  793|   516k|      if (!process_restart(cinfo))
  ------------------
  |  Branch (793:11): [True: 0, False: 516k]
  ------------------
  794|      0|        return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  795|  6.45M|    usefast = 0;
  796|  6.45M|  }
  797|       |
  798|  10.5M|  if (cinfo->src->bytes_in_buffer < BUFSIZE * (size_t)cinfo->blocks_in_MCU ||
  ------------------
  |  |  782|  10.5M|#define BUFSIZE  (DCTSIZE2 * 8)
  |  |  ------------------
  |  |  |  |   47|  10.5M|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  |  |  ------------------
  ------------------
  |  Branch (798:7): [True: 3.83M, False: 6.75M]
  ------------------
  799|  10.5M|      cinfo->unread_marker != 0)
  ------------------
  |  Branch (799:7): [True: 6.64M, False: 112k]
  ------------------
  800|  10.4M|    usefast = 0;
  801|       |
  802|       |  /* If we've run out of data, just leave the MCU set to zeroes.
  803|       |   * This way, we return uniform gray for the remainder of the segment.
  804|       |   */
  805|  10.5M|  if (!entropy->pub.insufficient_data) {
  ------------------
  |  Branch (805:7): [True: 147k, False: 10.4M]
  ------------------
  806|       |
  807|   147k|    if (usefast) {
  ------------------
  |  Branch (807:9): [True: 107k, False: 39.9k]
  ------------------
  808|   107k|      if (!decode_mcu_fast(cinfo, MCU_data)) goto use_slow;
  ------------------
  |  Branch (808:11): [True: 5.47k, False: 102k]
  ------------------
  809|   107k|    } else {
  810|  45.4k|use_slow:
  811|  45.4k|      if (!decode_mcu_slow(cinfo, MCU_data)) return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  |  Branch (811:11): [True: 0, False: 45.4k]
  ------------------
  812|  45.4k|    }
  813|       |
  814|   147k|  }
  815|       |
  816|       |  /* Account for restart interval (no-op if not using restarts) */
  817|  10.5M|  if (cinfo->restart_interval)
  ------------------
  |  Branch (817:7): [True: 6.45M, False: 4.13M]
  ------------------
  818|  6.45M|    entropy->restarts_to_go--;
  819|       |
  820|  10.5M|  return TRUE;
  ------------------
  |  |  248|  10.5M|#define TRUE    1
  ------------------
  821|  10.5M|}
jdhuff.c:process_restart:
  528|   516k|{
  529|   516k|  huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
  530|   516k|  int ci;
  531|       |
  532|       |  /* Throw away any unused bits remaining in bit buffer; */
  533|       |  /* include any full bytes in next_marker's count of discarded bytes */
  534|   516k|  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
  535|   516k|  entropy->bitstate.bits_left = 0;
  536|       |
  537|       |  /* Advance past the RSTn marker */
  538|   516k|  if (!(*cinfo->marker->read_restart_marker) (cinfo))
  ------------------
  |  Branch (538:7): [True: 0, False: 516k]
  ------------------
  539|      0|    return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  540|       |
  541|       |  /* Re-initialize DC predictions to 0 */
  542|  1.04M|  for (ci = 0; ci < cinfo->comps_in_scan; ci++)
  ------------------
  |  Branch (542:16): [True: 527k, False: 516k]
  ------------------
  543|   527k|    entropy->saved.last_dc_val[ci] = 0;
  544|       |
  545|       |  /* Reset restart counter */
  546|   516k|  entropy->restarts_to_go = cinfo->restart_interval;
  547|       |
  548|       |  /* Reset out-of-data flag, unless read_restart_marker left us smack up
  549|       |   * against a marker.  In that case we will end up treating the next data
  550|       |   * segment as empty, and we can avoid producing bogus output pixels by
  551|       |   * leaving the flag set.
  552|       |   */
  553|   516k|  if (cinfo->unread_marker == 0)
  ------------------
  |  Branch (553:7): [True: 2.07k, False: 514k]
  ------------------
  554|  2.07k|    entropy->pub.insufficient_data = FALSE;
  ------------------
  |  |  245|  2.07k|#define FALSE   0               /* values of boolean */
  ------------------
  555|       |
  556|   516k|  return TRUE;
  ------------------
  |  |  248|   516k|#define TRUE    1
  ------------------
  557|   516k|}
jdhuff.c:decode_mcu_fast:
  679|   107k|{
  680|   107k|  huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
  681|   107k|  BITREAD_STATE_VARS;
  ------------------
  |  |  116|   107k|  register bit_buf_type get_buffer; \
  |  |  117|   107k|  register int bits_left; \
  |  |  118|   107k|  bitread_working_state br_state
  ------------------
  682|   107k|  JOCTET *buffer;
  683|   107k|  int blkn;
  684|   107k|  savable_state state;
  685|       |  /* Outer loop handles each block in the MCU */
  686|       |
  687|       |  /* Load up working state */
  688|   107k|  BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
  ------------------
  |  |  121|   107k|  br_state.cinfo = cinfop; \
  |  |  122|   107k|  br_state.next_input_byte = cinfop->src->next_input_byte; \
  |  |  123|   107k|  br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
  |  |  124|   107k|  get_buffer = permstate.get_buffer; \
  |  |  125|   107k|  bits_left = permstate.bits_left;
  ------------------
  689|   107k|  buffer = (JOCTET *)br_state.next_input_byte;
  690|   107k|  ASSIGN_STATE(state, entropy->saved);
  ------------------
  |  |   48|   107k|#define ASSIGN_STATE(dest, src)  ((dest) = (src))
  ------------------
  691|       |
  692|   224k|  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  ------------------
  |  Branch (692:18): [True: 116k, False: 107k]
  ------------------
  693|   116k|    JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL;
  ------------------
  |  Branch (693:23): [True: 116k, False: 0]
  ------------------
  694|   116k|    d_derived_tbl *dctbl = entropy->dc_cur_tbls[blkn];
  695|   116k|    d_derived_tbl *actbl = entropy->ac_cur_tbls[blkn];
  696|   116k|    register int s, k, r, l;
  697|       |
  698|   116k|    HUFF_DECODE_FAST(s, l, dctbl);
  ------------------
  |  |  215|   116k|  FILL_BIT_BUFFER_FAST; \
  |  |  ------------------
  |  |  |  |  430|   116k|  if (bits_left <= 16) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (430:7): [True: 11.8k, False: 104k]
  |  |  |  |  ------------------
  |  |  |  |  431|  11.8k|    GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|  11.8k|#define GET_BYTE { \
  |  |  |  |  |  |  407|  11.8k|  register int c0, c1; \
  |  |  |  |  |  |  408|  11.8k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  11.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|  11.8k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  11.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|  11.8k|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|  11.8k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|  11.8k|  bits_left += 8; \
  |  |  |  |  |  |  413|  11.8k|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 1.56k, False: 10.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|  1.56k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|  1.56k|    buffer++; \
  |  |  |  |  |  |  416|  1.56k|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 892, False: 673]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|    892|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|    892|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|    892|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|    892|      buffer -= 2; \
  |  |  |  |  |  |  421|    892|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|    892|    } \
  |  |  |  |  |  |  423|  1.56k|  } \
  |  |  |  |  |  |  424|  11.8k|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|  11.8k|#define GET_BYTE { \
  |  |  |  |  |  |  407|  11.8k|  register int c0, c1; \
  |  |  |  |  |  |  408|  11.8k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  11.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|  11.8k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  11.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|  11.8k|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|  11.8k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|  11.8k|  bits_left += 8; \
  |  |  |  |  |  |  413|  11.8k|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 2.11k, False: 9.74k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|  2.11k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|  2.11k|    buffer++; \
  |  |  |  |  |  |  416|  2.11k|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 1.59k, False: 518]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|  1.59k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|  1.59k|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|  1.59k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|  1.59k|      buffer -= 2; \
  |  |  |  |  |  |  421|  1.59k|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|  1.59k|    } \
  |  |  |  |  |  |  423|  2.11k|  } \
  |  |  |  |  |  |  424|  11.8k|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|  11.8k|#define GET_BYTE { \
  |  |  |  |  |  |  407|  11.8k|  register int c0, c1; \
  |  |  |  |  |  |  408|  11.8k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  11.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|  11.8k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  11.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|  11.8k|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|  11.8k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|  11.8k|  bits_left += 8; \
  |  |  |  |  |  |  413|  11.8k|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 3.20k, False: 8.66k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|  3.20k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|  3.20k|    buffer++; \
  |  |  |  |  |  |  416|  3.20k|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 2.17k, False: 1.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|  2.17k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|  2.17k|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|  2.17k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|  2.17k|      buffer -= 2; \
  |  |  |  |  |  |  421|  2.17k|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|  2.17k|    } \
  |  |  |  |  |  |  423|  3.20k|  } \
  |  |  |  |  |  |  424|  11.8k|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|  11.8k|#define GET_BYTE { \
  |  |  |  |  |  |  407|  11.8k|  register int c0, c1; \
  |  |  |  |  |  |  408|  11.8k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  11.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|  11.8k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  11.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|  11.8k|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|  11.8k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|  11.8k|  bits_left += 8; \
  |  |  |  |  |  |  413|  11.8k|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 3.59k, False: 8.26k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|  3.59k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|  3.59k|    buffer++; \
  |  |  |  |  |  |  416|  3.59k|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 2.70k, False: 890]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|  2.70k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|  2.70k|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|  2.70k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|  2.70k|      buffer -= 2; \
  |  |  |  |  |  |  421|  2.70k|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|  2.70k|    } \
  |  |  |  |  |  |  423|  3.59k|  } \
  |  |  |  |  |  |  424|  11.8k|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|  11.8k|#define GET_BYTE { \
  |  |  |  |  |  |  407|  11.8k|  register int c0, c1; \
  |  |  |  |  |  |  408|  11.8k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  11.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|  11.8k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  11.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|  11.8k|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|  11.8k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|  11.8k|  bits_left += 8; \
  |  |  |  |  |  |  413|  11.8k|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 3.73k, False: 8.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|  3.73k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|  3.73k|    buffer++; \
  |  |  |  |  |  |  416|  3.73k|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 3.15k, False: 573]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|  3.15k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|  3.15k|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|  3.15k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|  3.15k|      buffer -= 2; \
  |  |  |  |  |  |  421|  3.15k|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|  3.15k|    } \
  |  |  |  |  |  |  423|  3.73k|  } \
  |  |  |  |  |  |  424|  11.8k|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|  11.8k|#define GET_BYTE { \
  |  |  |  |  |  |  407|  11.8k|  register int c0, c1; \
  |  |  |  |  |  |  408|  11.8k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  11.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|  11.8k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  11.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|  11.8k|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|  11.8k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|  11.8k|  bits_left += 8; \
  |  |  |  |  |  |  413|  11.8k|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 4.19k, False: 7.66k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|  4.19k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|  4.19k|    buffer++; \
  |  |  |  |  |  |  416|  4.19k|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 3.46k, False: 730]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|  3.46k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|  3.46k|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|  3.46k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|  3.46k|      buffer -= 2; \
  |  |  |  |  |  |  421|  3.46k|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|  3.46k|    } \
  |  |  |  |  |  |  423|  4.19k|  } \
  |  |  |  |  |  |  424|  11.8k|}
  |  |  |  |  ------------------
  |  |  |  |  432|  11.8k|  }
  |  |  ------------------
  |  |  216|   116k|  s = PEEK_BITS(HUFF_LOOKAHEAD); \
  |  |  ------------------
  |  |  |  |  163|   116k|  (((int)(get_buffer >> (bits_left -  (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  217|   116k|  s = htbl->lookup[s]; \
  |  |  218|   116k|  nb = s >> HUFF_LOOKAHEAD; \
  |  |  ------------------
  |  |  |  |   21|   116k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  219|   116k|  /* Pre-execute the common case of nb <= HUFF_LOOKAHEAD */ \
  |  |  220|   116k|  DROP_BITS(nb); \
  |  |  ------------------
  |  |  |  |  166|   116k|  (bits_left -= (nbits))
  |  |  ------------------
  |  |  221|   116k|  s = s & ((1 << HUFF_LOOKAHEAD) - 1); \
  |  |  ------------------
  |  |  |  |   21|   116k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  222|   116k|  if (nb > HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|   233k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (222:7): [True: 4.86k, False: 111k]
  |  |  ------------------
  |  |  223|  4.86k|    /* Equivalent of jpeg_huff_decode() */ \
  |  |  224|  4.86k|    /* Don't use GET_BITS() here because we don't want to modify bits_left */ \
  |  |  225|  4.86k|    s = (get_buffer >> bits_left) & ((1 << (nb)) - 1); \
  |  |  226|  34.3k|    while (s > htbl->maxcode[nb]) { \
  |  |  ------------------
  |  |  |  Branch (226:12): [True: 29.5k, False: 4.86k]
  |  |  ------------------
  |  |  227|  29.5k|      s <<= 1; \
  |  |  228|  29.5k|      s |= GET_BITS(1); \
  |  |  ------------------
  |  |  |  |  160|  29.5k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  229|  29.5k|      nb++; \
  |  |  230|  29.5k|    } \
  |  |  231|  4.86k|    if (nb > 16) \
  |  |  ------------------
  |  |  |  Branch (231:9): [True: 3.66k, False: 1.20k]
  |  |  ------------------
  |  |  232|  4.86k|      s = 0; \
  |  |  233|  4.86k|    else \
  |  |  234|  4.86k|      s = htbl->pub->huffval[(int)(s + htbl->valoffset[nb]) & 0xFF]; \
  |  |  235|  4.86k|  }
  ------------------
  699|   116k|    if (s) {
  ------------------
  |  Branch (699:9): [True: 42.7k, False: 74.0k]
  ------------------
  700|  42.7k|      FILL_BIT_BUFFER_FAST
  ------------------
  |  |  430|  42.7k|  if (bits_left <= 16) { \
  |  |  ------------------
  |  |  |  Branch (430:7): [True: 3.47k, False: 39.2k]
  |  |  ------------------
  |  |  431|  3.47k|    GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|  3.47k|#define GET_BYTE { \
  |  |  |  |  407|  3.47k|  register int c0, c1; \
  |  |  |  |  408|  3.47k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  3.47k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|  3.47k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  3.47k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|  3.47k|  /* Pre-execute most common case */ \
  |  |  |  |  411|  3.47k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|  3.47k|  bits_left += 8; \
  |  |  |  |  413|  3.47k|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 698, False: 2.78k]
  |  |  |  |  ------------------
  |  |  |  |  414|    698|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|    698|    buffer++; \
  |  |  |  |  416|    698|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 222, False: 476]
  |  |  |  |  ------------------
  |  |  |  |  417|    222|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|    222|      cinfo->unread_marker = c1; \
  |  |  |  |  419|    222|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|    222|      buffer -= 2; \
  |  |  |  |  421|    222|      get_buffer &= ~0xFF; \
  |  |  |  |  422|    222|    } \
  |  |  |  |  423|    698|  } \
  |  |  |  |  424|  3.47k|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|  3.47k|#define GET_BYTE { \
  |  |  |  |  407|  3.47k|  register int c0, c1; \
  |  |  |  |  408|  3.47k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  3.47k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|  3.47k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  3.47k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|  3.47k|  /* Pre-execute most common case */ \
  |  |  |  |  411|  3.47k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|  3.47k|  bits_left += 8; \
  |  |  |  |  413|  3.47k|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 619, False: 2.85k]
  |  |  |  |  ------------------
  |  |  |  |  414|    619|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|    619|    buffer++; \
  |  |  |  |  416|    619|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 255, False: 364]
  |  |  |  |  ------------------
  |  |  |  |  417|    255|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|    255|      cinfo->unread_marker = c1; \
  |  |  |  |  419|    255|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|    255|      buffer -= 2; \
  |  |  |  |  421|    255|      get_buffer &= ~0xFF; \
  |  |  |  |  422|    255|    } \
  |  |  |  |  423|    619|  } \
  |  |  |  |  424|  3.47k|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|  3.47k|#define GET_BYTE { \
  |  |  |  |  407|  3.47k|  register int c0, c1; \
  |  |  |  |  408|  3.47k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  3.47k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|  3.47k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  3.47k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|  3.47k|  /* Pre-execute most common case */ \
  |  |  |  |  411|  3.47k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|  3.47k|  bits_left += 8; \
  |  |  |  |  413|  3.47k|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 613, False: 2.86k]
  |  |  |  |  ------------------
  |  |  |  |  414|    613|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|    613|    buffer++; \
  |  |  |  |  416|    613|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 341, False: 272]
  |  |  |  |  ------------------
  |  |  |  |  417|    341|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|    341|      cinfo->unread_marker = c1; \
  |  |  |  |  419|    341|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|    341|      buffer -= 2; \
  |  |  |  |  421|    341|      get_buffer &= ~0xFF; \
  |  |  |  |  422|    341|    } \
  |  |  |  |  423|    613|  } \
  |  |  |  |  424|  3.47k|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|  3.47k|#define GET_BYTE { \
  |  |  |  |  407|  3.47k|  register int c0, c1; \
  |  |  |  |  408|  3.47k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  3.47k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|  3.47k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  3.47k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|  3.47k|  /* Pre-execute most common case */ \
  |  |  |  |  411|  3.47k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|  3.47k|  bits_left += 8; \
  |  |  |  |  413|  3.47k|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 658, False: 2.82k]
  |  |  |  |  ------------------
  |  |  |  |  414|    658|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|    658|    buffer++; \
  |  |  |  |  416|    658|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 371, False: 287]
  |  |  |  |  ------------------
  |  |  |  |  417|    371|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|    371|      cinfo->unread_marker = c1; \
  |  |  |  |  419|    371|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|    371|      buffer -= 2; \
  |  |  |  |  421|    371|      get_buffer &= ~0xFF; \
  |  |  |  |  422|    371|    } \
  |  |  |  |  423|    658|  } \
  |  |  |  |  424|  3.47k|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|  3.47k|#define GET_BYTE { \
  |  |  |  |  407|  3.47k|  register int c0, c1; \
  |  |  |  |  408|  3.47k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  3.47k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|  3.47k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  3.47k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|  3.47k|  /* Pre-execute most common case */ \
  |  |  |  |  411|  3.47k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|  3.47k|  bits_left += 8; \
  |  |  |  |  413|  3.47k|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 773, False: 2.70k]
  |  |  |  |  ------------------
  |  |  |  |  414|    773|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|    773|    buffer++; \
  |  |  |  |  416|    773|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 400, False: 373]
  |  |  |  |  ------------------
  |  |  |  |  417|    400|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|    400|      cinfo->unread_marker = c1; \
  |  |  |  |  419|    400|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|    400|      buffer -= 2; \
  |  |  |  |  421|    400|      get_buffer &= ~0xFF; \
  |  |  |  |  422|    400|    } \
  |  |  |  |  423|    773|  } \
  |  |  |  |  424|  3.47k|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|  3.47k|#define GET_BYTE { \
  |  |  |  |  407|  3.47k|  register int c0, c1; \
  |  |  |  |  408|  3.47k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  3.47k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|  3.47k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  3.47k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|  3.47k|  /* Pre-execute most common case */ \
  |  |  |  |  411|  3.47k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|  3.47k|  bits_left += 8; \
  |  |  |  |  413|  3.47k|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 709, False: 2.76k]
  |  |  |  |  ------------------
  |  |  |  |  414|    709|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|    709|    buffer++; \
  |  |  |  |  416|    709|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 416, False: 293]
  |  |  |  |  ------------------
  |  |  |  |  417|    416|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|    416|      cinfo->unread_marker = c1; \
  |  |  |  |  419|    416|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|    416|      buffer -= 2; \
  |  |  |  |  421|    416|      get_buffer &= ~0xFF; \
  |  |  |  |  422|    416|    } \
  |  |  |  |  423|    709|  } \
  |  |  |  |  424|  3.47k|}
  |  |  ------------------
  |  |  432|  3.47k|  }
  ------------------
  701|  42.7k|      r = GET_BITS(s);
  ------------------
  |  |  160|  42.7k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  ------------------
  702|  42.7k|      s = HUFF_EXTEND(r, s);
  ------------------
  |  |  499|  42.7k|  ((x) + ((((x) - (1 << ((s) - 1))) >> 31) & (((NEG_1) << (s)) + 1)))
  |  |  ------------------
  |  |  |  |  497|  42.7k|#define NEG_1  ((unsigned int)-1)
  |  |  ------------------
  ------------------
  703|  42.7k|    }
  704|       |
  705|   116k|    if (entropy->dc_needed[blkn]) {
  ------------------
  |  Branch (705:9): [True: 114k, False: 1.81k]
  ------------------
  706|   114k|      int ci = cinfo->MCU_membership[blkn];
  707|       |      /* Refer to the comment in decode_mcu_slow() regarding the supression of
  708|       |       * a UBSan integer overflow error in this line of code.
  709|       |       */
  710|   114k|      s += state.last_dc_val[ci];
  711|   114k|      state.last_dc_val[ci] = s;
  712|   114k|      if (block)
  ------------------
  |  Branch (712:11): [True: 114k, False: 0]
  ------------------
  713|   114k|        (*block)[0] = (JCOEF)s;
  714|   114k|    }
  715|       |
  716|   116k|    if (entropy->ac_needed[blkn] && block) {
  ------------------
  |  Branch (716:9): [True: 114k, False: 1.81k]
  |  Branch (716:37): [True: 114k, False: 0]
  ------------------
  717|       |
  718|   454k|      for (k = 1; k < DCTSIZE2; k++) {
  ------------------
  |  |   47|   454k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (718:19): [True: 448k, False: 5.23k]
  ------------------
  719|   448k|        HUFF_DECODE_FAST(s, l, actbl);
  ------------------
  |  |  215|   448k|  FILL_BIT_BUFFER_FAST; \
  |  |  ------------------
  |  |  |  |  430|   448k|  if (bits_left <= 16) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (430:7): [True: 19.3k, False: 429k]
  |  |  |  |  ------------------
  |  |  |  |  431|  19.3k|    GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|  19.3k|#define GET_BYTE { \
  |  |  |  |  |  |  407|  19.3k|  register int c0, c1; \
  |  |  |  |  |  |  408|  19.3k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  19.3k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|  19.3k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  19.3k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|  19.3k|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|  19.3k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|  19.3k|  bits_left += 8; \
  |  |  |  |  |  |  413|  19.3k|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 4.70k, False: 14.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|  4.70k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|  4.70k|    buffer++; \
  |  |  |  |  |  |  416|  4.70k|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 3.71k, False: 986]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|  3.71k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|  3.71k|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|  3.71k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|  3.71k|      buffer -= 2; \
  |  |  |  |  |  |  421|  3.71k|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|  3.71k|    } \
  |  |  |  |  |  |  423|  4.70k|  } \
  |  |  |  |  |  |  424|  19.3k|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|  19.3k|#define GET_BYTE { \
  |  |  |  |  |  |  407|  19.3k|  register int c0, c1; \
  |  |  |  |  |  |  408|  19.3k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  19.3k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|  19.3k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  19.3k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|  19.3k|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|  19.3k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|  19.3k|  bits_left += 8; \
  |  |  |  |  |  |  413|  19.3k|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 5.25k, False: 14.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|  5.25k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|  5.25k|    buffer++; \
  |  |  |  |  |  |  416|  5.25k|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 3.89k, False: 1.35k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|  3.89k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|  3.89k|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|  3.89k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|  3.89k|      buffer -= 2; \
  |  |  |  |  |  |  421|  3.89k|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|  3.89k|    } \
  |  |  |  |  |  |  423|  5.25k|  } \
  |  |  |  |  |  |  424|  19.3k|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|  19.3k|#define GET_BYTE { \
  |  |  |  |  |  |  407|  19.3k|  register int c0, c1; \
  |  |  |  |  |  |  408|  19.3k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  19.3k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|  19.3k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  19.3k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|  19.3k|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|  19.3k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|  19.3k|  bits_left += 8; \
  |  |  |  |  |  |  413|  19.3k|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 5.14k, False: 14.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|  5.14k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|  5.14k|    buffer++; \
  |  |  |  |  |  |  416|  5.14k|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 4.00k, False: 1.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|  4.00k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|  4.00k|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|  4.00k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|  4.00k|      buffer -= 2; \
  |  |  |  |  |  |  421|  4.00k|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|  4.00k|    } \
  |  |  |  |  |  |  423|  5.14k|  } \
  |  |  |  |  |  |  424|  19.3k|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|  19.3k|#define GET_BYTE { \
  |  |  |  |  |  |  407|  19.3k|  register int c0, c1; \
  |  |  |  |  |  |  408|  19.3k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  19.3k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|  19.3k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  19.3k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|  19.3k|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|  19.3k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|  19.3k|  bits_left += 8; \
  |  |  |  |  |  |  413|  19.3k|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 5.12k, False: 14.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|  5.12k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|  5.12k|    buffer++; \
  |  |  |  |  |  |  416|  5.12k|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 4.17k, False: 954]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|  4.17k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|  4.17k|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|  4.17k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|  4.17k|      buffer -= 2; \
  |  |  |  |  |  |  421|  4.17k|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|  4.17k|    } \
  |  |  |  |  |  |  423|  5.12k|  } \
  |  |  |  |  |  |  424|  19.3k|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|  19.3k|#define GET_BYTE { \
  |  |  |  |  |  |  407|  19.3k|  register int c0, c1; \
  |  |  |  |  |  |  408|  19.3k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  19.3k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|  19.3k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  19.3k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|  19.3k|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|  19.3k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|  19.3k|  bits_left += 8; \
  |  |  |  |  |  |  413|  19.3k|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 5.41k, False: 13.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|  5.41k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|  5.41k|    buffer++; \
  |  |  |  |  |  |  416|  5.41k|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 4.27k, False: 1.13k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|  4.27k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|  4.27k|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|  4.27k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|  4.27k|      buffer -= 2; \
  |  |  |  |  |  |  421|  4.27k|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|  4.27k|    } \
  |  |  |  |  |  |  423|  5.41k|  } \
  |  |  |  |  |  |  424|  19.3k|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|  19.3k|#define GET_BYTE { \
  |  |  |  |  |  |  407|  19.3k|  register int c0, c1; \
  |  |  |  |  |  |  408|  19.3k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  19.3k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|  19.3k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|  19.3k|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|  19.3k|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|  19.3k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|  19.3k|  bits_left += 8; \
  |  |  |  |  |  |  413|  19.3k|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 5.12k, False: 14.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|  5.12k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|  5.12k|    buffer++; \
  |  |  |  |  |  |  416|  5.12k|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 4.42k, False: 702]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|  4.42k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|  4.42k|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|  4.42k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|  4.42k|      buffer -= 2; \
  |  |  |  |  |  |  421|  4.42k|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|  4.42k|    } \
  |  |  |  |  |  |  423|  5.12k|  } \
  |  |  |  |  |  |  424|  19.3k|}
  |  |  |  |  ------------------
  |  |  |  |  432|  19.3k|  }
  |  |  ------------------
  |  |  216|   448k|  s = PEEK_BITS(HUFF_LOOKAHEAD); \
  |  |  ------------------
  |  |  |  |  163|   448k|  (((int)(get_buffer >> (bits_left -  (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  217|   448k|  s = htbl->lookup[s]; \
  |  |  218|   448k|  nb = s >> HUFF_LOOKAHEAD; \
  |  |  ------------------
  |  |  |  |   21|   448k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  219|   448k|  /* Pre-execute the common case of nb <= HUFF_LOOKAHEAD */ \
  |  |  220|   448k|  DROP_BITS(nb); \
  |  |  ------------------
  |  |  |  |  166|   448k|  (bits_left -= (nbits))
  |  |  ------------------
  |  |  221|   448k|  s = s & ((1 << HUFF_LOOKAHEAD) - 1); \
  |  |  ------------------
  |  |  |  |   21|   448k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  222|   448k|  if (nb > HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|   897k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (222:7): [True: 13.3k, False: 435k]
  |  |  ------------------
  |  |  223|  13.3k|    /* Equivalent of jpeg_huff_decode() */ \
  |  |  224|  13.3k|    /* Don't use GET_BITS() here because we don't want to modify bits_left */ \
  |  |  225|  13.3k|    s = (get_buffer >> bits_left) & ((1 << (nb)) - 1); \
  |  |  226|  83.6k|    while (s > htbl->maxcode[nb]) { \
  |  |  ------------------
  |  |  |  Branch (226:12): [True: 70.2k, False: 13.3k]
  |  |  ------------------
  |  |  227|  70.2k|      s <<= 1; \
  |  |  228|  70.2k|      s |= GET_BITS(1); \
  |  |  ------------------
  |  |  |  |  160|  70.2k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  229|  70.2k|      nb++; \
  |  |  230|  70.2k|    } \
  |  |  231|  13.3k|    if (nb > 16) \
  |  |  ------------------
  |  |  |  Branch (231:9): [True: 6.58k, False: 6.76k]
  |  |  ------------------
  |  |  232|  13.3k|      s = 0; \
  |  |  233|  13.3k|    else \
  |  |  234|  13.3k|      s = htbl->pub->huffval[(int)(s + htbl->valoffset[nb]) & 0xFF]; \
  |  |  235|  13.3k|  }
  ------------------
  720|   448k|        r = s >> 4;
  721|   448k|        s &= 15;
  722|       |
  723|   448k|        if (s) {
  ------------------
  |  Branch (723:13): [True: 334k, False: 114k]
  ------------------
  724|   334k|          k += r;
  725|   334k|          FILL_BIT_BUFFER_FAST
  ------------------
  |  |  430|   334k|  if (bits_left <= 16) { \
  |  |  ------------------
  |  |  |  Branch (430:7): [True: 18.8k, False: 315k]
  |  |  ------------------
  |  |  431|  18.8k|    GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|  18.8k|#define GET_BYTE { \
  |  |  |  |  407|  18.8k|  register int c0, c1; \
  |  |  |  |  408|  18.8k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  18.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|  18.8k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  18.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|  18.8k|  /* Pre-execute most common case */ \
  |  |  |  |  411|  18.8k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|  18.8k|  bits_left += 8; \
  |  |  |  |  413|  18.8k|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 4.60k, False: 14.2k]
  |  |  |  |  ------------------
  |  |  |  |  414|  4.60k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|  4.60k|    buffer++; \
  |  |  |  |  416|  4.60k|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 3.57k, False: 1.03k]
  |  |  |  |  ------------------
  |  |  |  |  417|  3.57k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|  3.57k|      cinfo->unread_marker = c1; \
  |  |  |  |  419|  3.57k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|  3.57k|      buffer -= 2; \
  |  |  |  |  421|  3.57k|      get_buffer &= ~0xFF; \
  |  |  |  |  422|  3.57k|    } \
  |  |  |  |  423|  4.60k|  } \
  |  |  |  |  424|  18.8k|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|  18.8k|#define GET_BYTE { \
  |  |  |  |  407|  18.8k|  register int c0, c1; \
  |  |  |  |  408|  18.8k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  18.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|  18.8k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  18.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|  18.8k|  /* Pre-execute most common case */ \
  |  |  |  |  411|  18.8k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|  18.8k|  bits_left += 8; \
  |  |  |  |  413|  18.8k|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 4.70k, False: 14.1k]
  |  |  |  |  ------------------
  |  |  |  |  414|  4.70k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|  4.70k|    buffer++; \
  |  |  |  |  416|  4.70k|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 3.68k, False: 1.02k]
  |  |  |  |  ------------------
  |  |  |  |  417|  3.68k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|  3.68k|      cinfo->unread_marker = c1; \
  |  |  |  |  419|  3.68k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|  3.68k|      buffer -= 2; \
  |  |  |  |  421|  3.68k|      get_buffer &= ~0xFF; \
  |  |  |  |  422|  3.68k|    } \
  |  |  |  |  423|  4.70k|  } \
  |  |  |  |  424|  18.8k|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|  18.8k|#define GET_BYTE { \
  |  |  |  |  407|  18.8k|  register int c0, c1; \
  |  |  |  |  408|  18.8k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  18.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|  18.8k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  18.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|  18.8k|  /* Pre-execute most common case */ \
  |  |  |  |  411|  18.8k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|  18.8k|  bits_left += 8; \
  |  |  |  |  413|  18.8k|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 4.54k, False: 14.2k]
  |  |  |  |  ------------------
  |  |  |  |  414|  4.54k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|  4.54k|    buffer++; \
  |  |  |  |  416|  4.54k|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 3.76k, False: 784]
  |  |  |  |  ------------------
  |  |  |  |  417|  3.76k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|  3.76k|      cinfo->unread_marker = c1; \
  |  |  |  |  419|  3.76k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|  3.76k|      buffer -= 2; \
  |  |  |  |  421|  3.76k|      get_buffer &= ~0xFF; \
  |  |  |  |  422|  3.76k|    } \
  |  |  |  |  423|  4.54k|  } \
  |  |  |  |  424|  18.8k|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|  18.8k|#define GET_BYTE { \
  |  |  |  |  407|  18.8k|  register int c0, c1; \
  |  |  |  |  408|  18.8k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  18.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|  18.8k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  18.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|  18.8k|  /* Pre-execute most common case */ \
  |  |  |  |  411|  18.8k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|  18.8k|  bits_left += 8; \
  |  |  |  |  413|  18.8k|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 4.45k, False: 14.3k]
  |  |  |  |  ------------------
  |  |  |  |  414|  4.45k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|  4.45k|    buffer++; \
  |  |  |  |  416|  4.45k|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 3.85k, False: 599]
  |  |  |  |  ------------------
  |  |  |  |  417|  3.85k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|  3.85k|      cinfo->unread_marker = c1; \
  |  |  |  |  419|  3.85k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|  3.85k|      buffer -= 2; \
  |  |  |  |  421|  3.85k|      get_buffer &= ~0xFF; \
  |  |  |  |  422|  3.85k|    } \
  |  |  |  |  423|  4.45k|  } \
  |  |  |  |  424|  18.8k|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|  18.8k|#define GET_BYTE { \
  |  |  |  |  407|  18.8k|  register int c0, c1; \
  |  |  |  |  408|  18.8k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  18.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|  18.8k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  18.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|  18.8k|  /* Pre-execute most common case */ \
  |  |  |  |  411|  18.8k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|  18.8k|  bits_left += 8; \
  |  |  |  |  413|  18.8k|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 4.78k, False: 14.0k]
  |  |  |  |  ------------------
  |  |  |  |  414|  4.78k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|  4.78k|    buffer++; \
  |  |  |  |  416|  4.78k|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 3.95k, False: 825]
  |  |  |  |  ------------------
  |  |  |  |  417|  3.95k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|  3.95k|      cinfo->unread_marker = c1; \
  |  |  |  |  419|  3.95k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|  3.95k|      buffer -= 2; \
  |  |  |  |  421|  3.95k|      get_buffer &= ~0xFF; \
  |  |  |  |  422|  3.95k|    } \
  |  |  |  |  423|  4.78k|  } \
  |  |  |  |  424|  18.8k|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|  18.8k|#define GET_BYTE { \
  |  |  |  |  407|  18.8k|  register int c0, c1; \
  |  |  |  |  408|  18.8k|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  18.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|  18.8k|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|  18.8k|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|  18.8k|  /* Pre-execute most common case */ \
  |  |  |  |  411|  18.8k|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|  18.8k|  bits_left += 8; \
  |  |  |  |  413|  18.8k|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 4.88k, False: 13.9k]
  |  |  |  |  ------------------
  |  |  |  |  414|  4.88k|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|  4.88k|    buffer++; \
  |  |  |  |  416|  4.88k|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 4.08k, False: 804]
  |  |  |  |  ------------------
  |  |  |  |  417|  4.08k|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|  4.08k|      cinfo->unread_marker = c1; \
  |  |  |  |  419|  4.08k|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|  4.08k|      buffer -= 2; \
  |  |  |  |  421|  4.08k|      get_buffer &= ~0xFF; \
  |  |  |  |  422|  4.08k|    } \
  |  |  |  |  423|  4.88k|  } \
  |  |  |  |  424|  18.8k|}
  |  |  ------------------
  |  |  432|  18.8k|  }
  ------------------
  726|   334k|          r = GET_BITS(s);
  ------------------
  |  |  160|   334k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  ------------------
  727|   334k|          s = HUFF_EXTEND(r, s);
  ------------------
  |  |  499|   334k|  ((x) + ((((x) - (1 << ((s) - 1))) >> 31) & (((NEG_1) << (s)) + 1)))
  |  |  ------------------
  |  |  |  |  497|   334k|#define NEG_1  ((unsigned int)-1)
  |  |  ------------------
  ------------------
  728|   334k|          (*block)[jpeg_natural_order[k]] = (JCOEF)s;
  729|   334k|        } else {
  730|   114k|          if (r != 15) break;
  ------------------
  |  Branch (730:15): [True: 109k, False: 4.95k]
  ------------------
  731|  4.95k|          k += 15;
  732|  4.95k|        }
  733|   448k|      }
  734|       |
  735|   114k|    } else {
  736|       |
  737|  18.3k|      for (k = 1; k < DCTSIZE2; k++) {
  ------------------
  |  |   47|  18.3k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (737:19): [True: 18.1k, False: 226]
  ------------------
  738|  18.1k|        HUFF_DECODE_FAST(s, l, actbl);
  ------------------
  |  |  215|  18.1k|  FILL_BIT_BUFFER_FAST; \
  |  |  ------------------
  |  |  |  |  430|  18.1k|  if (bits_left <= 16) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (430:7): [True: 722, False: 17.4k]
  |  |  |  |  ------------------
  |  |  |  |  431|    722|    GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|    722|#define GET_BYTE { \
  |  |  |  |  |  |  407|    722|  register int c0, c1; \
  |  |  |  |  |  |  408|    722|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    722|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|    722|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    722|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|    722|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|    722|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|    722|  bits_left += 8; \
  |  |  |  |  |  |  413|    722|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 115, False: 607]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|    115|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|    115|    buffer++; \
  |  |  |  |  |  |  416|    115|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 80, False: 35]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|     80|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|     80|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|     80|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|     80|      buffer -= 2; \
  |  |  |  |  |  |  421|     80|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|     80|    } \
  |  |  |  |  |  |  423|    115|  } \
  |  |  |  |  |  |  424|    722|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|    722|#define GET_BYTE { \
  |  |  |  |  |  |  407|    722|  register int c0, c1; \
  |  |  |  |  |  |  408|    722|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    722|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|    722|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    722|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|    722|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|    722|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|    722|  bits_left += 8; \
  |  |  |  |  |  |  413|    722|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 127, False: 595]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|    127|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|    127|    buffer++; \
  |  |  |  |  |  |  416|    127|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 81, False: 46]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|     81|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|     81|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|     81|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|     81|      buffer -= 2; \
  |  |  |  |  |  |  421|     81|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|     81|    } \
  |  |  |  |  |  |  423|    127|  } \
  |  |  |  |  |  |  424|    722|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|    722|#define GET_BYTE { \
  |  |  |  |  |  |  407|    722|  register int c0, c1; \
  |  |  |  |  |  |  408|    722|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    722|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|    722|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    722|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|    722|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|    722|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|    722|  bits_left += 8; \
  |  |  |  |  |  |  413|    722|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 127, False: 595]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|    127|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|    127|    buffer++; \
  |  |  |  |  |  |  416|    127|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 85, False: 42]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|     85|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|     85|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|     85|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|     85|      buffer -= 2; \
  |  |  |  |  |  |  421|     85|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|     85|    } \
  |  |  |  |  |  |  423|    127|  } \
  |  |  |  |  |  |  424|    722|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|    722|#define GET_BYTE { \
  |  |  |  |  |  |  407|    722|  register int c0, c1; \
  |  |  |  |  |  |  408|    722|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    722|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|    722|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    722|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|    722|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|    722|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|    722|  bits_left += 8; \
  |  |  |  |  |  |  413|    722|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 107, False: 615]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|    107|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|    107|    buffer++; \
  |  |  |  |  |  |  416|    107|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 86, False: 21]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|     86|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|     86|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|     86|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|     86|      buffer -= 2; \
  |  |  |  |  |  |  421|     86|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|     86|    } \
  |  |  |  |  |  |  423|    107|  } \
  |  |  |  |  |  |  424|    722|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|    722|#define GET_BYTE { \
  |  |  |  |  |  |  407|    722|  register int c0, c1; \
  |  |  |  |  |  |  408|    722|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    722|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|    722|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    722|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|    722|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|    722|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|    722|  bits_left += 8; \
  |  |  |  |  |  |  413|    722|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 122, False: 600]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|    122|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|    122|    buffer++; \
  |  |  |  |  |  |  416|    122|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 88, False: 34]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|     88|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|     88|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|     88|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|     88|      buffer -= 2; \
  |  |  |  |  |  |  421|     88|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|     88|    } \
  |  |  |  |  |  |  423|    122|  } \
  |  |  |  |  |  |  424|    722|}
  |  |  |  |  ------------------
  |  |  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|    722|#define GET_BYTE { \
  |  |  |  |  |  |  407|    722|  register int c0, c1; \
  |  |  |  |  |  |  408|    722|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    722|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  409|    722|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    722|#define GETJOCTET(value)  (value)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  410|    722|  /* Pre-execute most common case */ \
  |  |  |  |  |  |  411|    722|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  |  |  412|    722|  bits_left += 8; \
  |  |  |  |  |  |  413|    722|  if (c0 == 0xFF) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (413:7): [True: 119, False: 603]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  414|    119|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  |  |  415|    119|    buffer++; \
  |  |  |  |  |  |  416|    119|    if (c1 != 0) { \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (416:9): [True: 91, False: 28]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  417|     91|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  |  |  418|     91|      cinfo->unread_marker = c1; \
  |  |  |  |  |  |  419|     91|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  |  |  420|     91|      buffer -= 2; \
  |  |  |  |  |  |  421|     91|      get_buffer &= ~0xFF; \
  |  |  |  |  |  |  422|     91|    } \
  |  |  |  |  |  |  423|    119|  } \
  |  |  |  |  |  |  424|    722|}
  |  |  |  |  ------------------
  |  |  |  |  432|    722|  }
  |  |  ------------------
  |  |  216|  18.1k|  s = PEEK_BITS(HUFF_LOOKAHEAD); \
  |  |  ------------------
  |  |  |  |  163|  18.1k|  (((int)(get_buffer >> (bits_left -  (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  217|  18.1k|  s = htbl->lookup[s]; \
  |  |  218|  18.1k|  nb = s >> HUFF_LOOKAHEAD; \
  |  |  ------------------
  |  |  |  |   21|  18.1k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  219|  18.1k|  /* Pre-execute the common case of nb <= HUFF_LOOKAHEAD */ \
  |  |  220|  18.1k|  DROP_BITS(nb); \
  |  |  ------------------
  |  |  |  |  166|  18.1k|  (bits_left -= (nbits))
  |  |  ------------------
  |  |  221|  18.1k|  s = s & ((1 << HUFF_LOOKAHEAD) - 1); \
  |  |  ------------------
  |  |  |  |   21|  18.1k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  222|  18.1k|  if (nb > HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  36.3k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (222:7): [True: 442, False: 17.7k]
  |  |  ------------------
  |  |  223|    442|    /* Equivalent of jpeg_huff_decode() */ \
  |  |  224|    442|    /* Don't use GET_BITS() here because we don't want to modify bits_left */ \
  |  |  225|    442|    s = (get_buffer >> bits_left) & ((1 << (nb)) - 1); \
  |  |  226|  2.94k|    while (s > htbl->maxcode[nb]) { \
  |  |  ------------------
  |  |  |  Branch (226:12): [True: 2.50k, False: 442]
  |  |  ------------------
  |  |  227|  2.50k|      s <<= 1; \
  |  |  228|  2.50k|      s |= GET_BITS(1); \
  |  |  ------------------
  |  |  |  |  160|  2.50k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  229|  2.50k|      nb++; \
  |  |  230|  2.50k|    } \
  |  |  231|    442|    if (nb > 16) \
  |  |  ------------------
  |  |  |  Branch (231:9): [True: 301, False: 141]
  |  |  ------------------
  |  |  232|    442|      s = 0; \
  |  |  233|    442|    else \
  |  |  234|    442|      s = htbl->pub->huffval[(int)(s + htbl->valoffset[nb]) & 0xFF]; \
  |  |  235|    442|  }
  ------------------
  739|  18.1k|        r = s >> 4;
  740|  18.1k|        s &= 15;
  741|       |
  742|  18.1k|        if (s) {
  ------------------
  |  Branch (742:13): [True: 16.1k, False: 2.02k]
  ------------------
  743|  16.1k|          k += r;
  744|  16.1k|          FILL_BIT_BUFFER_FAST
  ------------------
  |  |  430|  16.1k|  if (bits_left <= 16) { \
  |  |  ------------------
  |  |  |  Branch (430:7): [True: 923, False: 15.2k]
  |  |  ------------------
  |  |  431|    923|    GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|    923|#define GET_BYTE { \
  |  |  |  |  407|    923|  register int c0, c1; \
  |  |  |  |  408|    923|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    923|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|    923|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    923|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|    923|  /* Pre-execute most common case */ \
  |  |  |  |  411|    923|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|    923|  bits_left += 8; \
  |  |  |  |  413|    923|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 108, False: 815]
  |  |  |  |  ------------------
  |  |  |  |  414|    108|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|    108|    buffer++; \
  |  |  |  |  416|    108|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 61, False: 47]
  |  |  |  |  ------------------
  |  |  |  |  417|     61|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|     61|      cinfo->unread_marker = c1; \
  |  |  |  |  419|     61|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|     61|      buffer -= 2; \
  |  |  |  |  421|     61|      get_buffer &= ~0xFF; \
  |  |  |  |  422|     61|    } \
  |  |  |  |  423|    108|  } \
  |  |  |  |  424|    923|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|    923|#define GET_BYTE { \
  |  |  |  |  407|    923|  register int c0, c1; \
  |  |  |  |  408|    923|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    923|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|    923|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    923|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|    923|  /* Pre-execute most common case */ \
  |  |  |  |  411|    923|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|    923|  bits_left += 8; \
  |  |  |  |  413|    923|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 113, False: 810]
  |  |  |  |  ------------------
  |  |  |  |  414|    113|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|    113|    buffer++; \
  |  |  |  |  416|    113|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 65, False: 48]
  |  |  |  |  ------------------
  |  |  |  |  417|     65|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|     65|      cinfo->unread_marker = c1; \
  |  |  |  |  419|     65|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|     65|      buffer -= 2; \
  |  |  |  |  421|     65|      get_buffer &= ~0xFF; \
  |  |  |  |  422|     65|    } \
  |  |  |  |  423|    113|  } \
  |  |  |  |  424|    923|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|    923|#define GET_BYTE { \
  |  |  |  |  407|    923|  register int c0, c1; \
  |  |  |  |  408|    923|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    923|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|    923|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    923|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|    923|  /* Pre-execute most common case */ \
  |  |  |  |  411|    923|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|    923|  bits_left += 8; \
  |  |  |  |  413|    923|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 106, False: 817]
  |  |  |  |  ------------------
  |  |  |  |  414|    106|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|    106|    buffer++; \
  |  |  |  |  416|    106|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 65, False: 41]
  |  |  |  |  ------------------
  |  |  |  |  417|     65|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|     65|      cinfo->unread_marker = c1; \
  |  |  |  |  419|     65|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|     65|      buffer -= 2; \
  |  |  |  |  421|     65|      get_buffer &= ~0xFF; \
  |  |  |  |  422|     65|    } \
  |  |  |  |  423|    106|  } \
  |  |  |  |  424|    923|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|    923|#define GET_BYTE { \
  |  |  |  |  407|    923|  register int c0, c1; \
  |  |  |  |  408|    923|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    923|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|    923|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    923|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|    923|  /* Pre-execute most common case */ \
  |  |  |  |  411|    923|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|    923|  bits_left += 8; \
  |  |  |  |  413|    923|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 107, False: 816]
  |  |  |  |  ------------------
  |  |  |  |  414|    107|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|    107|    buffer++; \
  |  |  |  |  416|    107|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 67, False: 40]
  |  |  |  |  ------------------
  |  |  |  |  417|     67|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|     67|      cinfo->unread_marker = c1; \
  |  |  |  |  419|     67|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|     67|      buffer -= 2; \
  |  |  |  |  421|     67|      get_buffer &= ~0xFF; \
  |  |  |  |  422|     67|    } \
  |  |  |  |  423|    107|  } \
  |  |  |  |  424|    923|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|    923|#define GET_BYTE { \
  |  |  |  |  407|    923|  register int c0, c1; \
  |  |  |  |  408|    923|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    923|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|    923|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    923|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|    923|  /* Pre-execute most common case */ \
  |  |  |  |  411|    923|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|    923|  bits_left += 8; \
  |  |  |  |  413|    923|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 113, False: 810]
  |  |  |  |  ------------------
  |  |  |  |  414|    113|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|    113|    buffer++; \
  |  |  |  |  416|    113|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 70, False: 43]
  |  |  |  |  ------------------
  |  |  |  |  417|     70|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|     70|      cinfo->unread_marker = c1; \
  |  |  |  |  419|     70|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|     70|      buffer -= 2; \
  |  |  |  |  421|     70|      get_buffer &= ~0xFF; \
  |  |  |  |  422|     70|    } \
  |  |  |  |  423|    113|  } \
  |  |  |  |  424|    923|}
  |  |  ------------------
  |  |                   GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE GET_BYTE \
  |  |  ------------------
  |  |  |  |  406|    923|#define GET_BYTE { \
  |  |  |  |  407|    923|  register int c0, c1; \
  |  |  |  |  408|    923|  c0 = GETJOCTET(*buffer++); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    923|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  409|    923|  c1 = GETJOCTET(*buffer); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    923|#define GETJOCTET(value)  (value)
  |  |  |  |  ------------------
  |  |  |  |  410|    923|  /* Pre-execute most common case */ \
  |  |  |  |  411|    923|  get_buffer = (get_buffer << 8) | c0; \
  |  |  |  |  412|    923|  bits_left += 8; \
  |  |  |  |  413|    923|  if (c0 == 0xFF) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (413:7): [True: 111, False: 812]
  |  |  |  |  ------------------
  |  |  |  |  414|    111|    /* Pre-execute case of FF/00, which represents an FF data byte */ \
  |  |  |  |  415|    111|    buffer++; \
  |  |  |  |  416|    111|    if (c1 != 0) { \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (416:9): [True: 71, False: 40]
  |  |  |  |  ------------------
  |  |  |  |  417|     71|      /* Oops, it's actually a marker indicating end of compressed data. */ \
  |  |  |  |  418|     71|      cinfo->unread_marker = c1; \
  |  |  |  |  419|     71|      /* Back out pre-execution and fill the buffer with zero bits */ \
  |  |  |  |  420|     71|      buffer -= 2; \
  |  |  |  |  421|     71|      get_buffer &= ~0xFF; \
  |  |  |  |  422|     71|    } \
  |  |  |  |  423|    111|  } \
  |  |  |  |  424|    923|}
  |  |  ------------------
  |  |  432|    923|  }
  ------------------
  745|  16.1k|          DROP_BITS(s);
  ------------------
  |  |  166|  16.1k|  (bits_left -= (nbits))
  ------------------
  746|  16.1k|        } else {
  747|  2.02k|          if (r != 15) break;
  ------------------
  |  Branch (747:15): [True: 1.58k, False: 437]
  ------------------
  748|    437|          k += 15;
  749|    437|        }
  750|  18.1k|      }
  751|  1.81k|    }
  752|   116k|  }
  753|       |
  754|   107k|  if (cinfo->unread_marker != 0) {
  ------------------
  |  Branch (754:7): [True: 5.47k, False: 102k]
  ------------------
  755|  5.47k|    cinfo->unread_marker = 0;
  756|  5.47k|    return FALSE;
  ------------------
  |  |  245|  5.47k|#define FALSE   0               /* values of boolean */
  ------------------
  757|  5.47k|  }
  758|       |
  759|   102k|  br_state.bytes_in_buffer -= (buffer - br_state.next_input_byte);
  760|   102k|  br_state.next_input_byte = buffer;
  761|   102k|  BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
  ------------------
  |  |  128|   102k|  cinfop->src->next_input_byte = br_state.next_input_byte; \
  |  |  129|   102k|  cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
  |  |  130|   102k|  permstate.get_buffer = get_buffer; \
  |  |  131|   102k|  permstate.bits_left = bits_left
  ------------------
  762|   102k|  ASSIGN_STATE(entropy->saved, state);
  ------------------
  |  |   48|   102k|#define ASSIGN_STATE(dest, src)  ((dest) = (src))
  ------------------
  763|   102k|  return TRUE;
  ------------------
  |  |  248|   102k|#define TRUE    1
  ------------------
  764|   107k|}
jdhuff.c:decode_mcu_slow:
  568|  45.4k|{
  569|  45.4k|  huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
  570|  45.4k|  BITREAD_STATE_VARS;
  ------------------
  |  |  116|  45.4k|  register bit_buf_type get_buffer; \
  |  |  117|  45.4k|  register int bits_left; \
  |  |  118|  45.4k|  bitread_working_state br_state
  ------------------
  571|  45.4k|  int blkn;
  572|  45.4k|  savable_state state;
  573|       |  /* Outer loop handles each block in the MCU */
  574|       |
  575|       |  /* Load up working state */
  576|  45.4k|  BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
  ------------------
  |  |  121|  45.4k|  br_state.cinfo = cinfop; \
  |  |  122|  45.4k|  br_state.next_input_byte = cinfop->src->next_input_byte; \
  |  |  123|  45.4k|  br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
  |  |  124|  45.4k|  get_buffer = permstate.get_buffer; \
  |  |  125|  45.4k|  bits_left = permstate.bits_left;
  ------------------
  577|  45.4k|  ASSIGN_STATE(state, entropy->saved);
  ------------------
  |  |   48|  45.4k|#define ASSIGN_STATE(dest, src)  ((dest) = (src))
  ------------------
  578|       |
  579|   117k|  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  ------------------
  |  Branch (579:18): [True: 71.6k, False: 45.4k]
  ------------------
  580|  71.6k|    JBLOCKROW block = MCU_data ? MCU_data[blkn] : NULL;
  ------------------
  |  Branch (580:23): [True: 71.6k, False: 0]
  ------------------
  581|  71.6k|    d_derived_tbl *dctbl = entropy->dc_cur_tbls[blkn];
  582|  71.6k|    d_derived_tbl *actbl = entropy->ac_cur_tbls[blkn];
  583|  71.6k|    register int s, k, r;
  584|       |
  585|       |    /* Decode a single block's worth of coefficients */
  586|       |
  587|       |    /* Section F.2.2.1: decode the DC coefficient difference */
  588|  71.6k|    HUFF_DECODE(s, br_state, dctbl, return FALSE, label1);
  ------------------
  |  |  191|  71.6k|#define HUFF_DECODE(result, state, htbl, failaction, slowlabel) { \
  |  |  192|  71.6k|  register int nb, look; \
  |  |  193|  71.6k|  if (bits_left < HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  71.6k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (193:7): [True: 13.6k, False: 57.9k]
  |  |  ------------------
  |  |  194|  13.6k|    if (!jpeg_fill_bit_buffer(&state, get_buffer, bits_left, 0)) \
  |  |  ------------------
  |  |  |  Branch (194:9): [True: 0, False: 13.6k]
  |  |  ------------------
  |  |  195|  13.6k|      { failaction; } \
  |  |  196|  13.6k|    get_buffer = state.get_buffer;  bits_left = state.bits_left; \
  |  |  197|  13.6k|    if (bits_left < HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  13.6k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (197:9): [True: 6.34k, False: 7.31k]
  |  |  ------------------
  |  |  198|  6.34k|      nb = 1;  goto slowlabel; \
  |  |  199|  6.34k|    } \
  |  |  200|  13.6k|  } \
  |  |  201|  71.6k|  look = PEEK_BITS(HUFF_LOOKAHEAD); \
  |  |  ------------------
  |  |  |  |  163|  65.3k|  (((int)(get_buffer >> (bits_left -  (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  202|  65.3k|  if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  65.3k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |                 if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  65.3k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (202:7): [True: 62.6k, False: 2.62k]
  |  |  ------------------
  |  |  203|  62.6k|    DROP_BITS(nb); \
  |  |  ------------------
  |  |  |  |  166|  62.6k|  (bits_left -= (nbits))
  |  |  ------------------
  |  |  204|  62.6k|    result = htbl->lookup[look] & ((1 << HUFF_LOOKAHEAD) - 1); \
  |  |  ------------------
  |  |  |  |   21|  62.6k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  205|  62.6k|  } else { \
  |  |  206|  8.97k|slowlabel: \
  |  |  207|  8.97k|    if ((result = \
  |  |  ------------------
  |  |  |  Branch (207:9): [True: 0, False: 8.97k]
  |  |  ------------------
  |  |  208|  8.97k|         jpeg_huff_decode(&state, get_buffer, bits_left, htbl, nb)) < 0) \
  |  |  209|  8.97k|      { failaction; } \
  |  |  210|  8.97k|    get_buffer = state.get_buffer;  bits_left = state.bits_left; \
  |  |  211|  8.97k|  } \
  |  |  212|  65.3k|}
  ------------------
  589|  71.6k|    if (s) {
  ------------------
  |  Branch (589:9): [True: 29.9k, False: 41.7k]
  ------------------
  590|  29.9k|      CHECK_BIT_BUFFER(br_state, s, return FALSE);
  ------------------
  |  |  151|  29.9k|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|  29.9k|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 1.08k, False: 28.8k]
  |  |  ------------------
  |  |  153|  1.08k|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 1.08k]
  |  |  ------------------
  |  |  154|  1.08k|      { action; } \
  |  |  155|  1.08k|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|  1.08k|  } \
  |  |  157|  29.9k|}
  ------------------
  591|  29.9k|      r = GET_BITS(s);
  ------------------
  |  |  160|  29.9k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  ------------------
  592|  29.9k|      s = HUFF_EXTEND(r, s);
  ------------------
  |  |  499|  29.9k|  ((x) + ((((x) - (1 << ((s) - 1))) >> 31) & (((NEG_1) << (s)) + 1)))
  |  |  ------------------
  |  |  |  |  497|  29.9k|#define NEG_1  ((unsigned int)-1)
  |  |  ------------------
  ------------------
  593|  29.9k|    }
  594|       |
  595|  71.6k|    if (entropy->dc_needed[blkn]) {
  ------------------
  |  Branch (595:9): [True: 66.4k, False: 5.19k]
  ------------------
  596|       |      /* Convert DC difference to actual value, update last_dc_val */
  597|  66.4k|      int ci = cinfo->MCU_membership[blkn];
  598|       |      /* Certain malformed JPEG images produce repeated DC coefficient
  599|       |       * differences of 2047 or -2047, which causes state.last_dc_val[ci] to
  600|       |       * grow until it overflows or underflows a 32-bit signed integer.  This
  601|       |       * behavior is, to the best of our understanding, innocuous, and it is
  602|       |       * unclear how to work around it without potentially affecting
  603|       |       * performance.  Thus, we (hopefully temporarily) suppress UBSan integer
  604|       |       * overflow errors for this function and decode_mcu_fast().
  605|       |       */
  606|  66.4k|      s += state.last_dc_val[ci];
  607|  66.4k|      state.last_dc_val[ci] = s;
  608|  66.4k|      if (block) {
  ------------------
  |  Branch (608:11): [True: 66.4k, False: 0]
  ------------------
  609|       |        /* Output the DC coefficient (assumes jpeg_natural_order[0] = 0) */
  610|  66.4k|        (*block)[0] = (JCOEF)s;
  611|  66.4k|      }
  612|  66.4k|    }
  613|       |
  614|  71.6k|    if (entropy->ac_needed[blkn] && block) {
  ------------------
  |  Branch (614:9): [True: 66.4k, False: 5.19k]
  |  Branch (614:37): [True: 66.4k, False: 0]
  ------------------
  615|       |
  616|       |      /* Section F.2.2.2: decode the AC coefficients */
  617|       |      /* Since zeroes are skipped, output area must be cleared beforehand */
  618|   700k|      for (k = 1; k < DCTSIZE2; k++) {
  ------------------
  |  |   47|   700k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (618:19): [True: 688k, False: 11.9k]
  ------------------
  619|   688k|        HUFF_DECODE(s, br_state, actbl, return FALSE, label2);
  ------------------
  |  |  191|   688k|#define HUFF_DECODE(result, state, htbl, failaction, slowlabel) { \
  |  |  192|   688k|  register int nb, look; \
  |  |  193|   688k|  if (bits_left < HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|   688k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (193:7): [True: 80.9k, False: 607k]
  |  |  ------------------
  |  |  194|  80.9k|    if (!jpeg_fill_bit_buffer(&state, get_buffer, bits_left, 0)) \
  |  |  ------------------
  |  |  |  Branch (194:9): [True: 0, False: 80.9k]
  |  |  ------------------
  |  |  195|  80.9k|      { failaction; } \
  |  |  196|  80.9k|    get_buffer = state.get_buffer;  bits_left = state.bits_left; \
  |  |  197|  80.9k|    if (bits_left < HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  80.9k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (197:9): [True: 60.9k, False: 20.0k]
  |  |  ------------------
  |  |  198|  60.9k|      nb = 1;  goto slowlabel; \
  |  |  199|  60.9k|    } \
  |  |  200|  80.9k|  } \
  |  |  201|   688k|  look = PEEK_BITS(HUFF_LOOKAHEAD); \
  |  |  ------------------
  |  |  |  |  163|   627k|  (((int)(get_buffer >> (bits_left -  (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  202|   627k|  if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|   627k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |                 if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|   627k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (202:7): [True: 618k, False: 8.90k]
  |  |  ------------------
  |  |  203|   618k|    DROP_BITS(nb); \
  |  |  ------------------
  |  |  |  |  166|   618k|  (bits_left -= (nbits))
  |  |  ------------------
  |  |  204|   618k|    result = htbl->lookup[look] & ((1 << HUFF_LOOKAHEAD) - 1); \
  |  |  ------------------
  |  |  |  |   21|   618k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  205|   618k|  } else { \
  |  |  206|  69.8k|slowlabel: \
  |  |  207|  69.8k|    if ((result = \
  |  |  ------------------
  |  |  |  Branch (207:9): [True: 0, False: 69.8k]
  |  |  ------------------
  |  |  208|  69.8k|         jpeg_huff_decode(&state, get_buffer, bits_left, htbl, nb)) < 0) \
  |  |  209|  69.8k|      { failaction; } \
  |  |  210|  69.8k|    get_buffer = state.get_buffer;  bits_left = state.bits_left; \
  |  |  211|  69.8k|  } \
  |  |  212|   627k|}
  ------------------
  620|       |
  621|   688k|        r = s >> 4;
  622|   688k|        s &= 15;
  623|       |
  624|   688k|        if (s) {
  ------------------
  |  Branch (624:13): [True: 623k, False: 65.1k]
  ------------------
  625|   623k|          k += r;
  626|   623k|          CHECK_BIT_BUFFER(br_state, s, return FALSE);
  ------------------
  |  |  151|   623k|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|   623k|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 8.98k, False: 614k]
  |  |  ------------------
  |  |  153|  8.98k|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 8.98k]
  |  |  ------------------
  |  |  154|  8.98k|      { action; } \
  |  |  155|  8.98k|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|  8.98k|  } \
  |  |  157|   623k|}
  ------------------
  627|   623k|          r = GET_BITS(s);
  ------------------
  |  |  160|   623k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  ------------------
  628|   623k|          s = HUFF_EXTEND(r, s);
  ------------------
  |  |  499|   623k|  ((x) + ((((x) - (1 << ((s) - 1))) >> 31) & (((NEG_1) << (s)) + 1)))
  |  |  ------------------
  |  |  |  |  497|   623k|#define NEG_1  ((unsigned int)-1)
  |  |  ------------------
  ------------------
  629|       |          /* Output coefficient in natural (dezigzagged) order.
  630|       |           * Note: the extra entries in jpeg_natural_order[] will save us
  631|       |           * if k >= DCTSIZE2, which could happen if the data is corrupted.
  632|       |           */
  633|   623k|          (*block)[jpeg_natural_order[k]] = (JCOEF)s;
  634|   623k|        } else {
  635|  65.1k|          if (r != 15)
  ------------------
  |  Branch (635:15): [True: 54.5k, False: 10.6k]
  ------------------
  636|  54.5k|            break;
  637|  10.6k|          k += 15;
  638|  10.6k|        }
  639|   688k|      }
  640|       |
  641|  66.4k|    } else {
  642|       |
  643|       |      /* Section F.2.2.2: decode the AC coefficients */
  644|       |      /* In this path we just discard the values */
  645|  39.5k|      for (k = 1; k < DCTSIZE2; k++) {
  ------------------
  |  |   47|  39.5k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (645:19): [True: 38.4k, False: 1.12k]
  ------------------
  646|  38.4k|        HUFF_DECODE(s, br_state, actbl, return FALSE, label3);
  ------------------
  |  |  191|  38.4k|#define HUFF_DECODE(result, state, htbl, failaction, slowlabel) { \
  |  |  192|  38.4k|  register int nb, look; \
  |  |  193|  38.4k|  if (bits_left < HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  38.4k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (193:7): [True: 2.74k, False: 35.6k]
  |  |  ------------------
  |  |  194|  2.74k|    if (!jpeg_fill_bit_buffer(&state, get_buffer, bits_left, 0)) \
  |  |  ------------------
  |  |  |  Branch (194:9): [True: 0, False: 2.74k]
  |  |  ------------------
  |  |  195|  2.74k|      { failaction; } \
  |  |  196|  2.74k|    get_buffer = state.get_buffer;  bits_left = state.bits_left; \
  |  |  197|  2.74k|    if (bits_left < HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  2.74k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (197:9): [True: 191, False: 2.55k]
  |  |  ------------------
  |  |  198|    191|      nb = 1;  goto slowlabel; \
  |  |  199|    191|    } \
  |  |  200|  2.74k|  } \
  |  |  201|  38.4k|  look = PEEK_BITS(HUFF_LOOKAHEAD); \
  |  |  ------------------
  |  |  |  |  163|  38.2k|  (((int)(get_buffer >> (bits_left -  (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  202|  38.2k|  if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  38.2k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |                 if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  38.2k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (202:7): [True: 38.0k, False: 221]
  |  |  ------------------
  |  |  203|  38.0k|    DROP_BITS(nb); \
  |  |  ------------------
  |  |  |  |  166|  38.0k|  (bits_left -= (nbits))
  |  |  ------------------
  |  |  204|  38.0k|    result = htbl->lookup[look] & ((1 << HUFF_LOOKAHEAD) - 1); \
  |  |  ------------------
  |  |  |  |   21|  38.0k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  205|  38.0k|  } else { \
  |  |  206|    412|slowlabel: \
  |  |  207|    412|    if ((result = \
  |  |  ------------------
  |  |  |  Branch (207:9): [True: 0, False: 412]
  |  |  ------------------
  |  |  208|    412|         jpeg_huff_decode(&state, get_buffer, bits_left, htbl, nb)) < 0) \
  |  |  209|    412|      { failaction; } \
  |  |  210|    412|    get_buffer = state.get_buffer;  bits_left = state.bits_left; \
  |  |  211|    412|  } \
  |  |  212|  38.2k|}
  ------------------
  647|       |
  648|  38.4k|        r = s >> 4;
  649|  38.4k|        s &= 15;
  650|       |
  651|  38.4k|        if (s) {
  ------------------
  |  Branch (651:13): [True: 30.9k, False: 7.43k]
  ------------------
  652|  30.9k|          k += r;
  653|  30.9k|          CHECK_BIT_BUFFER(br_state, s, return FALSE);
  ------------------
  |  |  151|  30.9k|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|  30.9k|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 176, False: 30.8k]
  |  |  ------------------
  |  |  153|    176|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 176]
  |  |  ------------------
  |  |  154|    176|      { action; } \
  |  |  155|    176|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|    176|  } \
  |  |  157|  30.9k|}
  ------------------
  654|  30.9k|          DROP_BITS(s);
  ------------------
  |  |  166|  30.9k|  (bits_left -= (nbits))
  ------------------
  655|  30.9k|        } else {
  656|  7.43k|          if (r != 15)
  ------------------
  |  Branch (656:15): [True: 4.06k, False: 3.36k]
  ------------------
  657|  4.06k|            break;
  658|  3.36k|          k += 15;
  659|  3.36k|        }
  660|  38.4k|      }
  661|  5.19k|    }
  662|  71.6k|  }
  663|       |
  664|       |  /* Completed MCU, so update state */
  665|  45.4k|  BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
  ------------------
  |  |  128|  45.4k|  cinfop->src->next_input_byte = br_state.next_input_byte; \
  |  |  129|  45.4k|  cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
  |  |  130|  45.4k|  permstate.get_buffer = get_buffer; \
  |  |  131|  45.4k|  permstate.bits_left = bits_left
  ------------------
  666|  45.4k|  ASSIGN_STATE(entropy->saved, state);
  ------------------
  |  |   48|  45.4k|#define ASSIGN_STATE(dest, src)  ((dest) = (src))
  ------------------
  667|  45.4k|  return TRUE;
  ------------------
  |  |  248|  45.4k|#define TRUE    1
  ------------------
  668|  45.4k|}

jinit_input_controller:
  389|  5.16k|{
  390|  5.16k|  my_inputctl_ptr inputctl;
  391|       |
  392|       |  /* Create subobject in permanent pool */
  393|  5.16k|  inputctl = (my_inputctl_ptr)
  394|  5.16k|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
  ------------------
  |  |  825|  5.16k|#define JPOOL_PERMANENT  0      /* lasts until master record is destroyed */
  ------------------
  395|  5.16k|                                sizeof(my_input_controller));
  396|  5.16k|  cinfo->inputctl = (struct jpeg_input_controller *)inputctl;
  397|       |  /* Initialize method pointers */
  398|  5.16k|  inputctl->pub.consume_input = consume_markers;
  399|  5.16k|  inputctl->pub.reset_input_controller = reset_input_controller;
  400|  5.16k|  inputctl->pub.start_input_pass = start_input_pass;
  401|  5.16k|  inputctl->pub.finish_input_pass = finish_input_pass;
  402|       |  /* Initialize state: can't use reset_input_controller since we don't
  403|       |   * want to try to reset other modules yet.
  404|       |   */
  405|  5.16k|  inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
  ------------------
  |  |  245|  5.16k|#define FALSE   0               /* values of boolean */
  ------------------
  406|  5.16k|  inputctl->pub.eoi_reached = FALSE;
  ------------------
  |  |  245|  5.16k|#define FALSE   0               /* values of boolean */
  ------------------
  407|  5.16k|  inputctl->inheaders = TRUE;
  ------------------
  |  |  248|  5.16k|#define TRUE    1
  ------------------
  408|  5.16k|}
jdinput.c:consume_markers:
  316|  32.6k|{
  317|  32.6k|  my_inputctl_ptr inputctl = (my_inputctl_ptr)cinfo->inputctl;
  318|  32.6k|  int val;
  319|       |
  320|  32.6k|  if (inputctl->pub.eoi_reached) /* After hitting EOI, read no further */
  ------------------
  |  Branch (320:7): [True: 0, False: 32.6k]
  ------------------
  321|      0|    return JPEG_REACHED_EOI;
  ------------------
  |  | 1021|      0|#define JPEG_REACHED_EOI        2 /* Reached end of image */
  ------------------
  322|       |
  323|  32.6k|  val = (*cinfo->marker->read_markers) (cinfo);
  324|       |
  325|  32.6k|  switch (val) {
  ------------------
  |  Branch (325:11): [True: 1.36k, False: 31.3k]
  ------------------
  326|  27.4k|  case JPEG_REACHED_SOS:        /* Found SOS */
  ------------------
  |  | 1020|  27.4k|#define JPEG_REACHED_SOS        1 /* Reached start of new scan */
  ------------------
  |  Branch (326:3): [True: 27.4k, False: 5.29k]
  ------------------
  327|  27.4k|    if (inputctl->inheaders) {  /* 1st SOS */
  ------------------
  |  Branch (327:9): [True: 8.93k, False: 18.4k]
  ------------------
  328|  8.93k|      initial_setup(cinfo);
  329|  8.93k|      inputctl->inheaders = FALSE;
  ------------------
  |  |  245|  8.93k|#define FALSE   0               /* values of boolean */
  ------------------
  330|       |      /* Note: start_input_pass must be called by jdmaster.c
  331|       |       * before any more input can be consumed.  jdapimin.c is
  332|       |       * responsible for enforcing this sequencing.
  333|       |       */
  334|  18.4k|    } else {                    /* 2nd or later SOS marker */
  335|  18.4k|      if (!inputctl->pub.has_multiple_scans)
  ------------------
  |  Branch (335:11): [True: 18, False: 18.4k]
  ------------------
  336|     18|        ERREXIT(cinfo, JERR_EOI_EXPECTED); /* Oops, I wasn't expecting this! */
  ------------------
  |  |  231|     18|  ((cinfo)->err->msg_code = (code), \
  |  |  232|     18|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  337|  18.4k|      start_input_pass(cinfo);
  338|  18.4k|    }
  339|  27.4k|    break;
  340|  3.93k|  case JPEG_REACHED_EOI:        /* Found EOI */
  ------------------
  |  | 1021|  3.93k|#define JPEG_REACHED_EOI        2 /* Reached end of image */
  ------------------
  |  Branch (340:3): [True: 3.93k, False: 28.7k]
  ------------------
  341|  3.93k|    inputctl->pub.eoi_reached = TRUE;
  ------------------
  |  |  248|  3.93k|#define TRUE    1
  ------------------
  342|  3.93k|    if (inputctl->inheaders) {  /* Tables-only datastream, apparently */
  ------------------
  |  Branch (342:9): [True: 619, False: 3.31k]
  ------------------
  343|    619|      if (cinfo->marker->saw_SOF)
  ------------------
  |  Branch (343:11): [True: 32, False: 587]
  ------------------
  344|     32|        ERREXIT(cinfo, JERR_SOF_NO_SOS);
  ------------------
  |  |  231|     32|  ((cinfo)->err->msg_code = (code), \
  |  |  232|     32|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  345|  3.31k|    } else {
  346|       |      /* Prevent infinite loop in coef ctlr's decompress_data routine
  347|       |       * if user set output_scan_number larger than number of scans.
  348|       |       */
  349|  3.31k|      if (cinfo->output_scan_number > cinfo->input_scan_number)
  ------------------
  |  Branch (349:11): [True: 0, False: 3.31k]
  ------------------
  350|      0|        cinfo->output_scan_number = cinfo->input_scan_number;
  351|  3.31k|    }
  352|  3.93k|    break;
  353|      0|  case JPEG_SUSPENDED:
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  |  Branch (353:3): [True: 0, False: 32.6k]
  ------------------
  354|      0|    break;
  355|  32.6k|  }
  356|       |
  357|  31.1k|  return val;
  358|  32.6k|}
jdinput.c:initial_setup:
   46|  8.93k|{
   47|  8.93k|  int ci;
   48|  8.93k|  jpeg_component_info *compptr;
   49|       |
   50|       |  /* Make sure image isn't bigger than I can handle */
   51|  8.93k|  if ((long)cinfo->image_height > (long)JPEG_MAX_DIMENSION ||
  ------------------
  |  |  196|  17.8k|#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */
  ------------------
  |  Branch (51:7): [True: 5, False: 8.93k]
  ------------------
   52|  8.93k|      (long)cinfo->image_width > (long)JPEG_MAX_DIMENSION)
  ------------------
  |  |  196|  8.93k|#define JPEG_MAX_DIMENSION  65500L  /* a tad under 64K to prevent overflows */
  ------------------
  |  Branch (52:7): [True: 1, False: 8.93k]
  ------------------
   53|      6|    ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int)JPEG_MAX_DIMENSION);
  ------------------
  |  |  234|      6|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      6|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      6|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
   54|       |
   55|       |  /* For now, precision must match compiled-in value... */
   56|  8.93k|  if (cinfo->data_precision != BITS_IN_JSAMPLE)
  ------------------
  |  |   33|  8.93k|#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */
  ------------------
  |  Branch (56:7): [True: 13, False: 8.92k]
  ------------------
   57|     13|    ERREXIT1(cinfo, JERR_BAD_PRECISION, cinfo->data_precision);
  ------------------
  |  |  234|     13|  ((cinfo)->err->msg_code = (code), \
  |  |  235|     13|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|     13|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
   58|       |
   59|       |  /* Check that number of components won't exceed internal array sizes */
   60|  8.93k|  if (cinfo->num_components > MAX_COMPONENTS)
  ------------------
  |  |   27|  8.93k|#define MAX_COMPONENTS  10      /* maximum number of image components */
  ------------------
  |  Branch (60:7): [True: 2, False: 8.93k]
  ------------------
   61|      2|    ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->num_components,
  ------------------
  |  |  238|      2|  ((cinfo)->err->msg_code = (code), \
  |  |  239|      2|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  240|      2|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  241|      2|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
   62|  8.93k|             MAX_COMPONENTS);
   63|       |
   64|       |  /* Compute maximum sampling factors; check factor validity */
   65|  8.93k|  cinfo->max_h_samp_factor = 1;
   66|  8.93k|  cinfo->max_v_samp_factor = 1;
   67|  26.8k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (67:44): [True: 17.9k, False: 8.93k]
  ------------------
   68|  17.9k|       ci++, compptr++) {
   69|  17.9k|    if (compptr->h_samp_factor <= 0 ||
  ------------------
  |  Branch (69:9): [True: 2, False: 17.9k]
  ------------------
   70|  17.9k|        compptr->h_samp_factor > MAX_SAMP_FACTOR ||
  ------------------
  |  |   52|  35.8k|#define MAX_SAMP_FACTOR     4   /* JPEG limit on sampling factors */
  ------------------
  |  Branch (70:9): [True: 14, False: 17.9k]
  ------------------
   71|  17.9k|        compptr->v_samp_factor <= 0 ||
  ------------------
  |  Branch (71:9): [True: 2, False: 17.8k]
  ------------------
   72|  17.9k|        compptr->v_samp_factor > MAX_SAMP_FACTOR)
  ------------------
  |  |   52|  17.8k|#define MAX_SAMP_FACTOR     4   /* JPEG limit on sampling factors */
  ------------------
  |  Branch (72:9): [True: 7, False: 17.8k]
  ------------------
   73|     25|      ERREXIT(cinfo, JERR_BAD_SAMPLING);
  ------------------
  |  |  231|     25|  ((cinfo)->err->msg_code = (code), \
  |  |  232|     25|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
   74|  17.9k|    cinfo->max_h_samp_factor = MAX(cinfo->max_h_samp_factor,
  ------------------
  |  |  277|  17.9k|#define MAX(a, b)       ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (277:26): [True: 5.06k, False: 12.8k]
  |  |  ------------------
  ------------------
   75|  17.9k|                                   compptr->h_samp_factor);
   76|  17.9k|    cinfo->max_v_samp_factor = MAX(cinfo->max_v_samp_factor,
  ------------------
  |  |  277|  17.9k|#define MAX(a, b)       ((a) > (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (277:26): [True: 3.64k, False: 14.2k]
  |  |  ------------------
  ------------------
   77|  17.9k|                                   compptr->v_samp_factor);
   78|  17.9k|  }
   79|       |
   80|       |#if JPEG_LIB_VERSION >= 80
   81|       |  cinfo->block_size = DCTSIZE;
   82|       |  cinfo->natural_order = jpeg_natural_order;
   83|       |  cinfo->lim_Se = DCTSIZE2 - 1;
   84|       |#endif
   85|       |
   86|       |  /* We initialize DCT_scaled_size and min_DCT_scaled_size to DCTSIZE.
   87|       |   * In the full decompressor, this will be overridden by jdmaster.c;
   88|       |   * but in the transcoder, jdmaster.c is not used, so we must do it here.
   89|       |   */
   90|       |#if JPEG_LIB_VERSION >= 70
   91|       |  cinfo->min_DCT_h_scaled_size = cinfo->min_DCT_v_scaled_size = DCTSIZE;
   92|       |#else
   93|  8.93k|  cinfo->min_DCT_scaled_size = DCTSIZE;
  ------------------
  |  |   46|  8.93k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
   94|  8.93k|#endif
   95|       |
   96|       |  /* Compute dimensions of components */
   97|  26.8k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (97:44): [True: 17.8k, False: 8.93k]
  ------------------
   98|  17.8k|       ci++, compptr++) {
   99|       |#if JPEG_LIB_VERSION >= 70
  100|       |    compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size = DCTSIZE;
  101|       |#else
  102|  17.8k|    compptr->DCT_scaled_size = DCTSIZE;
  ------------------
  |  |   46|  17.8k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  103|  17.8k|#endif
  104|       |    /* Size in DCT blocks */
  105|  17.8k|    compptr->width_in_blocks = (JDIMENSION)
  106|  17.8k|      jdiv_round_up((long)cinfo->image_width * (long)compptr->h_samp_factor,
  107|  17.8k|                    (long)(cinfo->max_h_samp_factor * DCTSIZE));
  ------------------
  |  |   46|  17.8k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  108|  17.8k|    compptr->height_in_blocks = (JDIMENSION)
  109|  17.8k|      jdiv_round_up((long)cinfo->image_height * (long)compptr->v_samp_factor,
  110|  17.8k|                    (long)(cinfo->max_v_samp_factor * DCTSIZE));
  ------------------
  |  |   46|  17.8k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  111|       |    /* Set the first and last MCU columns to decompress from multi-scan images.
  112|       |     * By default, decompress all of the MCU columns.
  113|       |     */
  114|  17.8k|    cinfo->master->first_MCU_col[ci] = 0;
  115|  17.8k|    cinfo->master->last_MCU_col[ci] = compptr->width_in_blocks - 1;
  116|       |    /* downsampled_width and downsampled_height will also be overridden by
  117|       |     * jdmaster.c if we are doing full decompression.  The transcoder library
  118|       |     * doesn't use these values, but the calling application might.
  119|       |     */
  120|       |    /* Size in samples */
  121|  17.8k|    compptr->downsampled_width = (JDIMENSION)
  122|  17.8k|      jdiv_round_up((long)cinfo->image_width * (long)compptr->h_samp_factor,
  123|  17.8k|                    (long)cinfo->max_h_samp_factor);
  124|  17.8k|    compptr->downsampled_height = (JDIMENSION)
  125|  17.8k|      jdiv_round_up((long)cinfo->image_height * (long)compptr->v_samp_factor,
  126|  17.8k|                    (long)cinfo->max_v_samp_factor);
  127|       |    /* Mark component needed, until color conversion says otherwise */
  128|  17.8k|    compptr->component_needed = TRUE;
  ------------------
  |  |  248|  17.8k|#define TRUE    1
  ------------------
  129|       |    /* Mark no quantization table yet saved for component */
  130|  17.8k|    compptr->quant_table = NULL;
  131|  17.8k|  }
  132|       |
  133|       |  /* Compute number of fully interleaved MCU rows. */
  134|  8.93k|  cinfo->total_iMCU_rows = (JDIMENSION)
  135|  8.93k|    jdiv_round_up((long)cinfo->image_height,
  136|  8.93k|                  (long)(cinfo->max_v_samp_factor * DCTSIZE));
  ------------------
  |  |   46|  8.93k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  137|       |
  138|       |  /* Decide whether file contains multiple scans */
  139|  8.93k|  if (cinfo->comps_in_scan < cinfo->num_components || cinfo->progressive_mode)
  ------------------
  |  Branch (139:7): [True: 3.10k, False: 5.83k]
  |  Branch (139:55): [True: 3.51k, False: 2.31k]
  ------------------
  140|  6.57k|    cinfo->inputctl->has_multiple_scans = TRUE;
  ------------------
  |  |  248|  6.57k|#define TRUE    1
  ------------------
  141|  2.36k|  else
  142|  2.36k|    cinfo->inputctl->has_multiple_scans = FALSE;
  ------------------
  |  |  245|  2.36k|#define FALSE   0               /* values of boolean */
  ------------------
  143|  8.93k|}
jdinput.c:reset_input_controller:
  367|  10.2k|{
  368|  10.2k|  my_inputctl_ptr inputctl = (my_inputctl_ptr)cinfo->inputctl;
  369|       |
  370|  10.2k|  inputctl->pub.consume_input = consume_markers;
  371|  10.2k|  inputctl->pub.has_multiple_scans = FALSE; /* "unknown" would be better */
  ------------------
  |  |  245|  10.2k|#define FALSE   0               /* values of boolean */
  ------------------
  372|  10.2k|  inputctl->pub.eoi_reached = FALSE;
  ------------------
  |  |  245|  10.2k|#define FALSE   0               /* values of boolean */
  ------------------
  373|  10.2k|  inputctl->inheaders = TRUE;
  ------------------
  |  |  248|  10.2k|#define TRUE    1
  ------------------
  374|       |  /* Reset other modules */
  375|  10.2k|  (*cinfo->err->reset_error_mgr) ((j_common_ptr)cinfo);
  376|  10.2k|  (*cinfo->marker->reset_marker_reader) (cinfo);
  377|       |  /* Reset progression state -- would be cleaner if entropy decoder did this */
  378|  10.2k|  cinfo->coef_bits = NULL;
  379|  10.2k|}
jdinput.c:start_input_pass:
  282|  23.0k|{
  283|  23.0k|  per_scan_setup(cinfo);
  284|  23.0k|  latch_quant_tables(cinfo);
  285|  23.0k|  (*cinfo->entropy->start_pass) (cinfo);
  286|  23.0k|  (*cinfo->coef->start_input_pass) (cinfo);
  287|  23.0k|  cinfo->inputctl->consume_input = cinfo->coef->consume_data;
  288|  23.0k|}
jdinput.c:per_scan_setup:
  150|  23.0k|{
  151|  23.0k|  int ci, mcublks, tmp;
  152|  23.0k|  jpeg_component_info *compptr;
  153|       |
  154|  23.0k|  if (cinfo->comps_in_scan == 1) {
  ------------------
  |  Branch (154:7): [True: 17.2k, False: 5.77k]
  ------------------
  155|       |
  156|       |    /* Noninterleaved (single-component) scan */
  157|  17.2k|    compptr = cinfo->cur_comp_info[0];
  158|       |
  159|       |    /* Overall image size in MCUs */
  160|  17.2k|    cinfo->MCUs_per_row = compptr->width_in_blocks;
  161|  17.2k|    cinfo->MCU_rows_in_scan = compptr->height_in_blocks;
  162|       |
  163|       |    /* For noninterleaved scan, always one block per MCU */
  164|  17.2k|    compptr->MCU_width = 1;
  165|  17.2k|    compptr->MCU_height = 1;
  166|  17.2k|    compptr->MCU_blocks = 1;
  167|  17.2k|    compptr->MCU_sample_width = compptr->_DCT_scaled_size;
  ------------------
  |  |   24|  17.2k|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  168|  17.2k|    compptr->last_col_width = 1;
  169|       |    /* For noninterleaved scans, it is convenient to define last_row_height
  170|       |     * as the number of block rows present in the last iMCU row.
  171|       |     */
  172|  17.2k|    tmp = (int)(compptr->height_in_blocks % compptr->v_samp_factor);
  173|  17.2k|    if (tmp == 0) tmp = compptr->v_samp_factor;
  ------------------
  |  Branch (173:9): [True: 10.6k, False: 6.58k]
  ------------------
  174|  17.2k|    compptr->last_row_height = tmp;
  175|       |
  176|       |    /* Prepare array describing MCU composition */
  177|  17.2k|    cinfo->blocks_in_MCU = 1;
  178|  17.2k|    cinfo->MCU_membership[0] = 0;
  179|       |
  180|  17.2k|  } else {
  181|       |
  182|       |    /* Interleaved (multi-component) scan */
  183|  5.77k|    if (cinfo->comps_in_scan <= 0 || cinfo->comps_in_scan > MAX_COMPS_IN_SCAN)
  ------------------
  |  |   51|  5.77k|#define MAX_COMPS_IN_SCAN   4   /* JPEG limit on # of components in one scan */
  ------------------
  |  Branch (183:9): [True: 0, False: 5.77k]
  |  Branch (183:38): [True: 0, False: 5.77k]
  ------------------
  184|      0|      ERREXIT2(cinfo, JERR_COMPONENT_COUNT, cinfo->comps_in_scan,
  ------------------
  |  |  238|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  239|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  240|      0|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  241|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  185|  5.77k|               MAX_COMPS_IN_SCAN);
  186|       |
  187|       |    /* Overall image size in MCUs */
  188|  5.77k|    cinfo->MCUs_per_row = (JDIMENSION)
  189|  5.77k|      jdiv_round_up((long)cinfo->image_width,
  190|  5.77k|                    (long)(cinfo->max_h_samp_factor * DCTSIZE));
  ------------------
  |  |   46|  5.77k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  191|  5.77k|    cinfo->MCU_rows_in_scan = (JDIMENSION)
  192|  5.77k|      jdiv_round_up((long)cinfo->image_height,
  193|  5.77k|                    (long)(cinfo->max_v_samp_factor * DCTSIZE));
  ------------------
  |  |   46|  5.77k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  194|       |
  195|  5.77k|    cinfo->blocks_in_MCU = 0;
  196|       |
  197|  21.8k|    for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  ------------------
  |  Branch (197:18): [True: 16.1k, False: 5.77k]
  ------------------
  198|  16.1k|      compptr = cinfo->cur_comp_info[ci];
  199|       |      /* Sampling factors give # of blocks of component in each MCU */
  200|  16.1k|      compptr->MCU_width = compptr->h_samp_factor;
  201|  16.1k|      compptr->MCU_height = compptr->v_samp_factor;
  202|  16.1k|      compptr->MCU_blocks = compptr->MCU_width * compptr->MCU_height;
  203|  16.1k|      compptr->MCU_sample_width = compptr->MCU_width *
  204|  16.1k|                                  compptr->_DCT_scaled_size;
  ------------------
  |  |   24|  16.1k|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  205|       |      /* Figure number of non-dummy blocks in last MCU column & row */
  206|  16.1k|      tmp = (int)(compptr->width_in_blocks % compptr->MCU_width);
  207|  16.1k|      if (tmp == 0) tmp = compptr->MCU_width;
  ------------------
  |  Branch (207:11): [True: 10.9k, False: 5.18k]
  ------------------
  208|  16.1k|      compptr->last_col_width = tmp;
  209|  16.1k|      tmp = (int)(compptr->height_in_blocks % compptr->MCU_height);
  210|  16.1k|      if (tmp == 0) tmp = compptr->MCU_height;
  ------------------
  |  Branch (210:11): [True: 13.5k, False: 2.54k]
  ------------------
  211|  16.1k|      compptr->last_row_height = tmp;
  212|       |      /* Prepare array describing MCU composition */
  213|  16.1k|      mcublks = compptr->MCU_blocks;
  214|  16.1k|      if (cinfo->blocks_in_MCU + mcublks > D_MAX_BLOCKS_IN_MCU)
  ------------------
  |  |   62|  16.1k|#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */
  ------------------
  |  Branch (214:11): [True: 3, False: 16.1k]
  ------------------
  215|      3|        ERREXIT(cinfo, JERR_BAD_MCU_SIZE);
  ------------------
  |  |  231|      3|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      3|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  216|  53.0k|      while (mcublks-- > 0) {
  ------------------
  |  Branch (216:14): [True: 36.9k, False: 16.1k]
  ------------------
  217|  36.9k|        cinfo->MCU_membership[cinfo->blocks_in_MCU++] = ci;
  218|  36.9k|      }
  219|  16.1k|    }
  220|       |
  221|  5.77k|  }
  222|  23.0k|}
jdinput.c:latch_quant_tables:
  248|  23.0k|{
  249|  23.0k|  int ci, qtblno;
  250|  23.0k|  jpeg_component_info *compptr;
  251|  23.0k|  JQUANT_TBL *qtbl;
  252|       |
  253|  56.2k|  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  ------------------
  |  Branch (253:16): [True: 33.2k, False: 23.0k]
  ------------------
  254|  33.2k|    compptr = cinfo->cur_comp_info[ci];
  255|       |    /* No work if we already saved Q-table for this component */
  256|  33.2k|    if (compptr->quant_table != NULL)
  ------------------
  |  Branch (256:9): [True: 26.7k, False: 6.49k]
  ------------------
  257|  26.7k|      continue;
  258|       |    /* Make sure specified quantization table is present */
  259|  6.49k|    qtblno = compptr->quant_tbl_no;
  260|  6.49k|    if (qtblno < 0 || qtblno >= NUM_QUANT_TBLS ||
  ------------------
  |  |   48|  12.9k|#define NUM_QUANT_TBLS      4   /* Quantization tables are numbered 0..3 */
  ------------------
  |  Branch (260:9): [True: 0, False: 6.49k]
  |  Branch (260:23): [True: 135, False: 6.36k]
  ------------------
  261|  6.49k|        cinfo->quant_tbl_ptrs[qtblno] == NULL)
  ------------------
  |  Branch (261:9): [True: 269, False: 6.09k]
  ------------------
  262|    404|      ERREXIT1(cinfo, JERR_NO_QUANT_TABLE, qtblno);
  ------------------
  |  |  234|    404|  ((cinfo)->err->msg_code = (code), \
  |  |  235|    404|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|    404|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  263|       |    /* OK, save away the quantization table */
  264|  6.49k|    qtbl = (JQUANT_TBL *)
  265|  6.49k|      (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  6.49k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  266|  6.49k|                                  sizeof(JQUANT_TBL));
  267|  6.49k|    MEMCOPY(qtbl, cinfo->quant_tbl_ptrs[qtblno], sizeof(JQUANT_TBL));
  ------------------
  |  |   75|  6.49k|  memcpy((void *)(dest), (const void *)(src), (size_t)(size))
  ------------------
  268|  6.49k|    compptr->quant_table = qtbl;
  269|  6.49k|  }
  270|  23.0k|}
jdinput.c:finish_input_pass:
  299|  22.4k|{
  300|  22.4k|  cinfo->inputctl->consume_input = consume_markers;
  301|  22.4k|}

jinit_d_main_controller:
  426|  4.56k|{
  427|  4.56k|  my_main_ptr main_ptr;
  428|  4.56k|  int ci, rgroup, ngroups;
  429|  4.56k|  jpeg_component_info *compptr;
  430|       |
  431|  4.56k|  main_ptr = (my_main_ptr)
  432|  4.56k|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  4.56k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  433|  4.56k|                                sizeof(my_main_controller));
  434|  4.56k|  cinfo->main = (struct jpeg_d_main_controller *)main_ptr;
  435|  4.56k|  main_ptr->pub.start_pass = start_pass_main;
  436|       |
  437|  4.56k|  if (need_full_buffer)         /* shouldn't happen */
  ------------------
  |  Branch (437:7): [True: 0, False: 4.56k]
  ------------------
  438|      0|    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  439|       |
  440|       |  /* Allocate the workspace.
  441|       |   * ngroups is the number of row groups we need.
  442|       |   */
  443|  4.56k|  if (cinfo->upsample->need_context_rows) {
  ------------------
  |  Branch (443:7): [True: 262, False: 4.30k]
  ------------------
  444|    262|    if (cinfo->_min_DCT_scaled_size < 2) /* unsupported, see comments above */
  ------------------
  |  |   27|    262|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  |  Branch (444:9): [True: 0, False: 262]
  ------------------
  445|      0|      ERREXIT(cinfo, JERR_NOTIMPL);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  446|    262|    alloc_funny_pointers(cinfo); /* Alloc space for xbuffer[] lists */
  447|    262|    ngroups = cinfo->_min_DCT_scaled_size + 2;
  ------------------
  |  |   27|    262|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  448|  4.30k|  } else {
  449|  4.30k|    ngroups = cinfo->_min_DCT_scaled_size;
  ------------------
  |  |   27|  4.30k|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  450|  4.30k|  }
  451|       |
  452|  13.7k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (452:44): [True: 9.16k, False: 4.56k]
  ------------------
  453|  9.16k|       ci++, compptr++) {
  454|  9.16k|    rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /
  ------------------
  |  |   24|  9.16k|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  455|  9.16k|      cinfo->_min_DCT_scaled_size; /* height of a row group of component */
  ------------------
  |  |   27|  9.16k|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  456|  9.16k|    main_ptr->buffer[ci] = (*cinfo->mem->alloc_sarray)
  457|  9.16k|                        ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  9.16k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  458|  9.16k|                         compptr->width_in_blocks * compptr->_DCT_scaled_size,
  ------------------
  |  |   24|  9.16k|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  459|  9.16k|                         (JDIMENSION)(rgroup * ngroups));
  460|  9.16k|  }
  461|  4.56k|}
jdmainct.c:start_pass_main:
  256|  3.60k|{
  257|  3.60k|  my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
  258|       |
  259|  3.60k|  switch (pass_mode) {
  260|  3.60k|  case JBUF_PASS_THRU:
  ------------------
  |  Branch (260:3): [True: 3.60k, False: 0]
  ------------------
  261|  3.60k|    if (cinfo->upsample->need_context_rows) {
  ------------------
  |  Branch (261:9): [True: 258, False: 3.34k]
  ------------------
  262|    258|      main_ptr->pub.process_data = process_data_context_main;
  263|    258|      make_funny_pointers(cinfo); /* Create the xbuffer[] lists */
  264|    258|      main_ptr->whichptr = 0;   /* Read first iMCU row into xbuffer[0] */
  265|    258|      main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
  ------------------
  |  |   41|    258|#define CTX_PREPARE_FOR_IMCU    0       /* need to prepare for MCU row */
  ------------------
  266|    258|      main_ptr->iMCU_row_ctr = 0;
  267|  3.34k|    } else {
  268|       |      /* Simple case with no context needed */
  269|  3.34k|      main_ptr->pub.process_data = process_data_simple_main;
  270|  3.34k|    }
  271|  3.60k|    main_ptr->buffer_full = FALSE;      /* Mark buffer empty */
  ------------------
  |  |  245|  3.60k|#define FALSE   0               /* values of boolean */
  ------------------
  272|  3.60k|    main_ptr->rowgroup_ctr = 0;
  273|  3.60k|    break;
  274|      0|#ifdef QUANT_2PASS_SUPPORTED
  275|      0|  case JBUF_CRANK_DEST:
  ------------------
  |  Branch (275:3): [True: 0, False: 3.60k]
  ------------------
  276|       |    /* For last pass of 2-pass quantization, just crank the postprocessor */
  277|      0|    main_ptr->pub.process_data = process_data_crank_post;
  278|      0|    break;
  279|      0|#endif
  280|      0|  default:
  ------------------
  |  Branch (280:3): [True: 0, False: 3.60k]
  ------------------
  281|      0|    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  282|      0|    break;
  283|  3.60k|  }
  284|  3.60k|}
jdmainct.c:process_data_context_main:
  334|   259k|{
  335|   259k|  my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
  336|       |
  337|       |  /* Read input data if we haven't filled the main buffer yet */
  338|   259k|  if (!main_ptr->buffer_full) {
  ------------------
  |  Branch (338:7): [True: 56.0k, False: 203k]
  ------------------
  339|  56.0k|    if (!(*cinfo->coef->decompress_data) (cinfo,
  ------------------
  |  Branch (339:9): [True: 0, False: 56.0k]
  ------------------
  340|  56.0k|                                          main_ptr->xbuffer[main_ptr->whichptr]))
  341|      0|      return;                   /* suspension forced, can do nothing more */
  342|  56.0k|    main_ptr->buffer_full = TRUE;       /* OK, we have an iMCU row to work with */
  ------------------
  |  |  248|  56.0k|#define TRUE    1
  ------------------
  343|  56.0k|    main_ptr->iMCU_row_ctr++;   /* count rows received */
  344|  56.0k|  }
  345|       |
  346|       |  /* Postprocessor typically will not swallow all the input data it is handed
  347|       |   * in one call (due to filling the output buffer first).  Must be prepared
  348|       |   * to exit and restart.  This switch lets us keep track of how far we got.
  349|       |   * Note that each case falls through to the next on successful completion.
  350|       |   */
  351|   259k|  switch (main_ptr->context_state) {
  ------------------
  |  Branch (351:11): [True: 0, False: 259k]
  ------------------
  352|  55.7k|  case CTX_POSTPONED_ROW:
  ------------------
  |  |   43|  55.7k|#define CTX_POSTPONED_ROW       2       /* feeding postponed row group */
  ------------------
  |  Branch (352:3): [True: 55.7k, False: 203k]
  ------------------
  353|       |    /* Call postprocessor using previously set pointers for postponed row */
  354|  55.7k|    (*cinfo->post->post_process_data) (cinfo,
  355|  55.7k|                                       main_ptr->xbuffer[main_ptr->whichptr],
  356|  55.7k|                                       &main_ptr->rowgroup_ctr,
  357|  55.7k|                                       main_ptr->rowgroups_avail, output_buf,
  358|  55.7k|                                       out_row_ctr, out_rows_avail);
  359|  55.7k|    if (main_ptr->rowgroup_ctr < main_ptr->rowgroups_avail)
  ------------------
  |  Branch (359:9): [True: 0, False: 55.7k]
  ------------------
  360|      0|      return;                   /* Need to suspend */
  361|  55.7k|    main_ptr->context_state = CTX_PREPARE_FOR_IMCU;
  ------------------
  |  |   41|  55.7k|#define CTX_PREPARE_FOR_IMCU    0       /* need to prepare for MCU row */
  ------------------
  362|  55.7k|    if (*out_row_ctr >= out_rows_avail)
  ------------------
  |  Branch (362:9): [True: 0, False: 55.7k]
  ------------------
  363|      0|      return;                   /* Postprocessor exactly filled output buf */
  364|       |    FALLTHROUGH                 /*FALLTHROUGH*/
  ------------------
  |  |   38|  55.7k|#define FALLTHROUGH  __attribute__((fallthrough));
  ------------------
  365|  56.0k|  case CTX_PREPARE_FOR_IMCU:
  ------------------
  |  |   41|  56.0k|#define CTX_PREPARE_FOR_IMCU    0       /* need to prepare for MCU row */
  ------------------
  |  Branch (365:3): [True: 258, False: 258k]
  ------------------
  366|       |    /* Prepare to process first M-1 row groups of this iMCU row */
  367|  56.0k|    main_ptr->rowgroup_ctr = 0;
  368|  56.0k|    main_ptr->rowgroups_avail = (JDIMENSION)(cinfo->_min_DCT_scaled_size - 1);
  ------------------
  |  |   27|  56.0k|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  369|       |    /* Check for bottom of image: if so, tweak pointers to "duplicate"
  370|       |     * the last sample row, and adjust rowgroups_avail to ignore padding rows.
  371|       |     */
  372|  56.0k|    if (main_ptr->iMCU_row_ctr == cinfo->total_iMCU_rows)
  ------------------
  |  Branch (372:9): [True: 258, False: 55.7k]
  ------------------
  373|    258|      set_bottom_pointers(cinfo);
  374|  56.0k|    main_ptr->context_state = CTX_PROCESS_IMCU;
  ------------------
  |  |   42|  56.0k|#define CTX_PROCESS_IMCU        1       /* feeding iMCU to postprocessor */
  ------------------
  375|       |    FALLTHROUGH                 /*FALLTHROUGH*/
  ------------------
  |  |   38|  56.0k|#define FALLTHROUGH  __attribute__((fallthrough));
  ------------------
  376|   259k|  case CTX_PROCESS_IMCU:
  ------------------
  |  |   42|   259k|#define CTX_PROCESS_IMCU        1       /* feeding iMCU to postprocessor */
  ------------------
  |  Branch (376:3): [True: 203k, False: 56.0k]
  ------------------
  377|       |    /* Call postprocessor using previously set pointers */
  378|   259k|    (*cinfo->post->post_process_data) (cinfo,
  379|   259k|                                       main_ptr->xbuffer[main_ptr->whichptr],
  380|   259k|                                       &main_ptr->rowgroup_ctr,
  381|   259k|                                       main_ptr->rowgroups_avail, output_buf,
  382|   259k|                                       out_row_ctr, out_rows_avail);
  383|   259k|    if (main_ptr->rowgroup_ctr < main_ptr->rowgroups_avail)
  ------------------
  |  Branch (383:9): [True: 203k, False: 55.8k]
  ------------------
  384|   203k|      return;                   /* Need to suspend */
  385|       |    /* After the first iMCU, change wraparound pointers to normal state */
  386|  55.8k|    if (main_ptr->iMCU_row_ctr == 1)
  ------------------
  |  Branch (386:9): [True: 134, False: 55.6k]
  ------------------
  387|    134|      set_wraparound_pointers(cinfo);
  388|       |    /* Prepare to load new iMCU row using other xbuffer list */
  389|  55.8k|    main_ptr->whichptr ^= 1;    /* 0=>1 or 1=>0 */
  390|  55.8k|    main_ptr->buffer_full = FALSE;
  ------------------
  |  |  245|  55.8k|#define FALSE   0               /* values of boolean */
  ------------------
  391|       |    /* Still need to process last row group of this iMCU row, */
  392|       |    /* which is saved at index M+1 of the other xbuffer */
  393|  55.8k|    main_ptr->rowgroup_ctr = (JDIMENSION)(cinfo->_min_DCT_scaled_size + 1);
  ------------------
  |  |   27|  55.8k|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  394|  55.8k|    main_ptr->rowgroups_avail = (JDIMENSION)(cinfo->_min_DCT_scaled_size + 2);
  ------------------
  |  |   27|  55.8k|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  395|  55.8k|    main_ptr->context_state = CTX_POSTPONED_ROW;
  ------------------
  |  |   43|  55.8k|#define CTX_POSTPONED_ROW       2       /* feeding postponed row group */
  ------------------
  396|   259k|  }
  397|   259k|}
jdmainct.c:set_bottom_pointers:
  219|    258|{
  220|    258|  my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
  221|    258|  int ci, i, rgroup, iMCUheight, rows_left;
  222|    258|  jpeg_component_info *compptr;
  223|    258|  JSAMPARRAY xbuf;
  224|       |
  225|  1.03k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (225:44): [True: 774, False: 258]
  ------------------
  226|    774|       ci++, compptr++) {
  227|       |    /* Count sample rows in one iMCU row and in one row group */
  228|    774|    iMCUheight = compptr->v_samp_factor * compptr->_DCT_scaled_size;
  ------------------
  |  |   24|    774|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  229|    774|    rgroup = iMCUheight / cinfo->_min_DCT_scaled_size;
  ------------------
  |  |   27|    774|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  230|       |    /* Count nondummy sample rows remaining for this component */
  231|    774|    rows_left = (int)(compptr->downsampled_height % (JDIMENSION)iMCUheight);
  232|    774|    if (rows_left == 0) rows_left = iMCUheight;
  ------------------
  |  Branch (232:9): [True: 82, False: 692]
  ------------------
  233|       |    /* Count nondummy row groups.  Should get same answer for each component,
  234|       |     * so we need only do it once.
  235|       |     */
  236|    774|    if (ci == 0) {
  ------------------
  |  Branch (236:9): [True: 258, False: 516]
  ------------------
  237|    258|      main_ptr->rowgroups_avail = (JDIMENSION)((rows_left - 1) / rgroup + 1);
  238|    258|    }
  239|       |    /* Duplicate the last real sample row rgroup*2 times; this pads out the
  240|       |     * last partial rowgroup and ensures at least one full rowgroup of context.
  241|       |     */
  242|    774|    xbuf = main_ptr->xbuffer[main_ptr->whichptr][ci];
  243|  4.58k|    for (i = 0; i < rgroup * 2; i++) {
  ------------------
  |  Branch (243:17): [True: 3.81k, False: 774]
  ------------------
  244|  3.81k|      xbuf[rows_left + i] = xbuf[rows_left - 1];
  245|  3.81k|    }
  246|    774|  }
  247|    258|}
jdmainct.c:make_funny_pointers:
  178|    258|{
  179|    258|  my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
  180|    258|  int ci, i, rgroup;
  181|    258|  int M = cinfo->_min_DCT_scaled_size;
  ------------------
  |  |   27|    258|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  182|    258|  jpeg_component_info *compptr;
  183|    258|  JSAMPARRAY buf, xbuf0, xbuf1;
  184|       |
  185|  1.03k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (185:44): [True: 774, False: 258]
  ------------------
  186|    774|       ci++, compptr++) {
  187|    774|    rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /
  ------------------
  |  |   24|    774|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  188|    774|      cinfo->_min_DCT_scaled_size; /* height of a row group of component */
  ------------------
  |  |   27|    774|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  189|    774|    xbuf0 = main_ptr->xbuffer[0][ci];
  190|    774|    xbuf1 = main_ptr->xbuffer[1][ci];
  191|       |    /* First copy the workspace pointers as-is */
  192|    774|    buf = main_ptr->buffer[ci];
  193|  15.1k|    for (i = 0; i < rgroup * (M + 2); i++) {
  ------------------
  |  Branch (193:17): [True: 14.4k, False: 774]
  ------------------
  194|  14.4k|      xbuf0[i] = xbuf1[i] = buf[i];
  195|  14.4k|    }
  196|       |    /* In the second list, put the last four row groups in swapped order */
  197|  4.58k|    for (i = 0; i < rgroup * 2; i++) {
  ------------------
  |  Branch (197:17): [True: 3.81k, False: 774]
  ------------------
  198|  3.81k|      xbuf1[rgroup * (M - 2) + i] = buf[rgroup * M + i];
  199|  3.81k|      xbuf1[rgroup * M + i] = buf[rgroup * (M - 2) + i];
  200|  3.81k|    }
  201|       |    /* The wraparound pointers at top and bottom will be filled later
  202|       |     * (see set_wraparound_pointers, below).  Initially we want the "above"
  203|       |     * pointers to duplicate the first actual data line.  This only needs
  204|       |     * to happen in xbuffer[0].
  205|       |     */
  206|  2.68k|    for (i = 0; i < rgroup; i++) {
  ------------------
  |  Branch (206:17): [True: 1.90k, False: 774]
  ------------------
  207|  1.90k|      xbuf0[i - rgroup] = xbuf0[0];
  208|  1.90k|    }
  209|    774|  }
  210|    258|}
jdmainct.c:process_data_simple_main:
  295|  6.41M|{
  296|  6.41M|  my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
  297|  6.41M|  JDIMENSION rowgroups_avail;
  298|       |
  299|       |  /* Read input data if we haven't filled the main buffer yet */
  300|  6.41M|  if (!main_ptr->buffer_full) {
  ------------------
  |  Branch (300:7): [True: 810k, False: 5.60M]
  ------------------
  301|   810k|    if (!(*cinfo->coef->decompress_data) (cinfo, main_ptr->buffer))
  ------------------
  |  Branch (301:9): [True: 0, False: 810k]
  ------------------
  302|      0|      return;                   /* suspension forced, can do nothing more */
  303|   810k|    main_ptr->buffer_full = TRUE;       /* OK, we have an iMCU row to work with */
  ------------------
  |  |  248|   810k|#define TRUE    1
  ------------------
  304|   810k|  }
  305|       |
  306|       |  /* There are always min_DCT_scaled_size row groups in an iMCU row. */
  307|  6.41M|  rowgroups_avail = (JDIMENSION)cinfo->_min_DCT_scaled_size;
  ------------------
  |  |   27|  6.41M|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  308|       |  /* Note: at the bottom of the image, we may pass extra garbage row groups
  309|       |   * to the postprocessor.  The postprocessor has to check for bottom
  310|       |   * of image anyway (at row resolution), so no point in us doing it too.
  311|       |   */
  312|       |
  313|       |  /* Feed the postprocessor */
  314|  6.41M|  (*cinfo->post->post_process_data) (cinfo, main_ptr->buffer,
  315|  6.41M|                                     &main_ptr->rowgroup_ctr, rowgroups_avail,
  316|  6.41M|                                     output_buf, out_row_ctr, out_rows_avail);
  317|       |
  318|       |  /* Has postprocessor consumed all the data yet? If so, mark buffer empty */
  319|  6.41M|  if (main_ptr->rowgroup_ctr >= rowgroups_avail) {
  ------------------
  |  Branch (319:7): [True: 808k, False: 5.60M]
  ------------------
  320|   808k|    main_ptr->buffer_full = FALSE;
  ------------------
  |  |  245|   808k|#define FALSE   0               /* values of boolean */
  ------------------
  321|   808k|    main_ptr->rowgroup_ctr = 0;
  322|   808k|  }
  323|  6.41M|}
jdmainct.c:alloc_funny_pointers:
  137|    262|{
  138|    262|  my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
  139|    262|  int ci, rgroup;
  140|    262|  int M = cinfo->_min_DCT_scaled_size;
  ------------------
  |  |   27|    262|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  141|    262|  jpeg_component_info *compptr;
  142|    262|  JSAMPARRAY xbuf;
  143|       |
  144|       |  /* Get top-level space for component array pointers.
  145|       |   * We alloc both arrays with one call to save a few cycles.
  146|       |   */
  147|    262|  main_ptr->xbuffer[0] = (JSAMPIMAGE)
  148|    262|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|    262|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  149|    262|                                cinfo->num_components * 2 * sizeof(JSAMPARRAY));
  150|    262|  main_ptr->xbuffer[1] = main_ptr->xbuffer[0] + cinfo->num_components;
  151|       |
  152|  1.04k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (152:44): [True: 786, False: 262]
  ------------------
  153|    786|       ci++, compptr++) {
  154|    786|    rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /
  ------------------
  |  |   24|    786|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  155|    786|      cinfo->_min_DCT_scaled_size; /* height of a row group of component */
  ------------------
  |  |   27|    786|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  156|       |    /* Get space for pointer lists --- M+4 row groups in each list.
  157|       |     * We alloc both pointer lists with one call to save a few cycles.
  158|       |     */
  159|    786|    xbuf = (JSAMPARRAY)
  160|    786|      (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|    786|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  161|    786|                                  2 * (rgroup * (M + 4)) * sizeof(JSAMPROW));
  162|    786|    xbuf += rgroup;             /* want one row group at negative offsets */
  163|    786|    main_ptr->xbuffer[0][ci] = xbuf;
  164|    786|    xbuf += rgroup * (M + 4);
  165|    786|    main_ptr->xbuffer[1][ci] = xbuf;
  166|    786|  }
  167|    262|}

jdmainct.c:set_wraparound_pointers:
   51|    134|{
   52|    134|  my_main_ptr main_ptr = (my_main_ptr)cinfo->main;
   53|    134|  int ci, i, rgroup;
   54|    134|  int M = cinfo->_min_DCT_scaled_size;
  ------------------
  |  |   27|    134|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
   55|    134|  jpeg_component_info *compptr;
   56|    134|  JSAMPARRAY xbuf0, xbuf1;
   57|       |
   58|    536|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (58:44): [True: 402, False: 134]
  ------------------
   59|    402|       ci++, compptr++) {
   60|    402|    rgroup = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /
  ------------------
  |  |   24|    402|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
   61|    402|      cinfo->_min_DCT_scaled_size; /* height of a row group of component */
  ------------------
  |  |   27|    402|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
   62|    402|    xbuf0 = main_ptr->xbuffer[0][ci];
   63|    402|    xbuf1 = main_ptr->xbuffer[1][ci];
   64|  1.31k|    for (i = 0; i < rgroup; i++) {
  ------------------
  |  Branch (64:17): [True: 909, False: 402]
  ------------------
   65|    909|      xbuf0[i - rgroup] = xbuf0[rgroup * (M + 1) + i];
   66|    909|      xbuf1[i - rgroup] = xbuf1[rgroup * (M + 1) + i];
   67|    909|      xbuf0[rgroup * (M + 2) + i] = xbuf0[i];
   68|    909|      xbuf1[rgroup * (M + 2) + i] = xbuf1[i];
   69|    909|    }
   70|    402|  }
   71|    134|}

jpeg_resync_to_restart:
 1210|  1.07M|{
 1211|  1.07M|  int marker = cinfo->unread_marker;
 1212|  1.07M|  int action = 1;
 1213|       |
 1214|       |  /* Always put up a warning. */
 1215|  1.07M|  WARNMS2(cinfo, JWRN_MUST_RESYNC, marker, desired);
  ------------------
  |  |  272|  1.07M|  ((cinfo)->err->msg_code = (code), \
  |  |  273|  1.07M|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  274|  1.07M|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  275|  1.07M|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
 1216|       |
 1217|       |  /* Outer loop handles repeated decision after scanning forward. */
 1218|  1.08M|  for (;;) {
 1219|  1.08M|    if (marker < (int)M_SOF0)
  ------------------
  |  Branch (1219:9): [True: 1.04k, False: 1.07M]
  ------------------
 1220|  1.04k|      action = 2;               /* invalid marker */
 1221|  1.07M|    else if (marker < (int)M_RST0 || marker > (int)M_RST7)
  ------------------
  |  Branch (1221:14): [True: 37.3k, False: 1.04M]
  |  Branch (1221:38): [True: 1.03M, False: 8.86k]
  ------------------
 1222|  1.07M|      action = 3;               /* valid non-restart marker */
 1223|  8.86k|    else {
 1224|  8.86k|      if (marker == ((int)M_RST0 + ((desired + 1) & 7)) ||
  ------------------
  |  Branch (1224:11): [True: 1.95k, False: 6.91k]
  ------------------
 1225|  8.86k|          marker == ((int)M_RST0 + ((desired + 2) & 7)))
  ------------------
  |  Branch (1225:11): [True: 1.14k, False: 5.76k]
  ------------------
 1226|  3.09k|        action = 3;             /* one of the next two expected restarts */
 1227|  5.76k|      else if (marker == ((int)M_RST0 + ((desired - 1) & 7)) ||
  ------------------
  |  Branch (1227:16): [True: 386, False: 5.38k]
  ------------------
 1228|  5.76k|               marker == ((int)M_RST0 + ((desired - 2) & 7)))
  ------------------
  |  Branch (1228:16): [True: 747, False: 4.63k]
  ------------------
 1229|  1.13k|        action = 2;             /* a prior restart, so advance */
 1230|  4.63k|      else
 1231|  4.63k|        action = 1;             /* desired restart or too far away */
 1232|  8.86k|    }
 1233|  1.08M|    TRACEMS2(cinfo, 4, JTRC_RECOVERY_ACTION, marker, action);
  ------------------
  |  |  286|  1.08M|  ((cinfo)->err->msg_code = (code), \
  |  |  287|  1.08M|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  288|  1.08M|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  289|  1.08M|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
 1234|  1.08M|    switch (action) {
  ------------------
  |  Branch (1234:13): [True: 0, False: 1.08M]
  ------------------
 1235|  4.63k|    case 1:
  ------------------
  |  Branch (1235:5): [True: 4.63k, False: 1.07M]
  ------------------
 1236|       |      /* Discard marker and let entropy decoder resume processing. */
 1237|  4.63k|      cinfo->unread_marker = 0;
 1238|  4.63k|      return TRUE;
  ------------------
  |  |  248|  4.63k|#define TRUE    1
  ------------------
 1239|  2.17k|    case 2:
  ------------------
  |  Branch (1239:5): [True: 2.17k, False: 1.07M]
  ------------------
 1240|       |      /* Scan to the next marker, and repeat the decision loop. */
 1241|  2.17k|      if (!next_marker(cinfo))
  ------------------
  |  Branch (1241:11): [True: 0, False: 2.17k]
  ------------------
 1242|      0|        return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
 1243|  2.17k|      marker = cinfo->unread_marker;
 1244|  2.17k|      break;
 1245|  1.07M|    case 3:
  ------------------
  |  Branch (1245:5): [True: 1.07M, False: 6.81k]
  ------------------
 1246|       |      /* Return without advancing past this marker. */
 1247|       |      /* Entropy decoder will be forced to process an empty segment. */
 1248|  1.07M|      return TRUE;
  ------------------
  |  |  248|  1.07M|#define TRUE    1
  ------------------
 1249|  1.08M|    }
 1250|  1.08M|  } /* end loop */
 1251|  1.07M|}
jinit_marker_reader:
 1280|  5.16k|{
 1281|  5.16k|  my_marker_ptr marker;
 1282|  5.16k|  int i;
 1283|       |
 1284|       |  /* Create subobject in permanent pool */
 1285|  5.16k|  marker = (my_marker_ptr)
 1286|  5.16k|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_PERMANENT,
  ------------------
  |  |  825|  5.16k|#define JPOOL_PERMANENT  0      /* lasts until master record is destroyed */
  ------------------
 1287|  5.16k|                                sizeof(my_marker_reader));
 1288|  5.16k|  cinfo->marker = (struct jpeg_marker_reader *)marker;
 1289|       |  /* Initialize public method pointers */
 1290|  5.16k|  marker->pub.reset_marker_reader = reset_marker_reader;
 1291|  5.16k|  marker->pub.read_markers = read_markers;
 1292|  5.16k|  marker->pub.read_restart_marker = read_restart_marker;
 1293|       |  /* Initialize COM/APPn processing.
 1294|       |   * By default, we examine and then discard APP0 and APP14,
 1295|       |   * but simply discard COM and all other APPn.
 1296|       |   */
 1297|  5.16k|  marker->process_COM = skip_variable;
 1298|  5.16k|  marker->length_limit_COM = 0;
 1299|  87.8k|  for (i = 0; i < 16; i++) {
  ------------------
  |  Branch (1299:15): [True: 82.6k, False: 5.16k]
  ------------------
 1300|  82.6k|    marker->process_APPn[i] = skip_variable;
 1301|  82.6k|    marker->length_limit_APPn[i] = 0;
 1302|  82.6k|  }
 1303|  5.16k|  marker->process_APPn[0] = get_interesting_appn;
 1304|  5.16k|  marker->process_APPn[14] = get_interesting_appn;
 1305|       |  /* Reset marker processing state */
 1306|  5.16k|  reset_marker_reader(cinfo);
 1307|  5.16k|}
jdmarker.c:next_marker:
  892|  65.1k|{
  893|  65.1k|  int c;
  894|  65.1k|  INPUT_VARS(cinfo);
  ------------------
  |  |  123|  65.1k|  struct jpeg_source_mgr *datasrc = (cinfo)->src; \
  |  |  124|  65.1k|  const JOCTET *next_input_byte = datasrc->next_input_byte; \
  |  |  125|  65.1k|  size_t bytes_in_buffer = datasrc->bytes_in_buffer
  ------------------
  895|       |
  896|  90.9k|  for (;;) {
  897|  90.9k|    INPUT_BYTE(cinfo, c, return FALSE);
  ------------------
  |  |  152|  90.9k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  92.0k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 371]
  |  |  |  |  |  Branch (261:38): [True: 371, False: 90.6k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  90.9k|            bytes_in_buffer--; \
  |  |  154|  90.9k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  898|       |    /* Skip any non-FF bytes.
  899|       |     * This may look a bit inefficient, but it will not occur in a valid file.
  900|       |     * We sync after each discarded byte so that a suspending data source
  901|       |     * can discard the byte from its buffer.
  902|       |     */
  903|  3.06M|    while (c != 0xFF) {
  ------------------
  |  Branch (903:12): [True: 2.97M, False: 90.9k]
  ------------------
  904|  2.97M|      cinfo->marker->discarded_bytes++;
  905|  2.97M|      INPUT_SYNC(cinfo);
  ------------------
  |  |  129|  2.97M|  ( datasrc->next_input_byte = next_input_byte, \
  |  |  130|  2.97M|    datasrc->bytes_in_buffer = bytes_in_buffer )
  ------------------
  906|  2.97M|      INPUT_BYTE(cinfo, c, return FALSE);
  ------------------
  |  |  152|  2.97M|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  2.97M|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 346]
  |  |  |  |  |  Branch (261:38): [True: 346, False: 2.97M]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  2.97M|            bytes_in_buffer--; \
  |  |  154|  2.97M|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  907|  2.97M|    }
  908|       |    /* This loop swallows any duplicate FF bytes.  Extra FFs are legal as
  909|       |     * pad bytes, so don't count them in discarded_bytes.  We assume there
  910|       |     * will not be so many consecutive FF bytes as to overflow a suspending
  911|       |     * data source's input buffer.
  912|       |     */
  913|   105k|    do {
  914|   105k|      INPUT_BYTE(cinfo, c, return FALSE);
  ------------------
  |  |  152|   105k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|   105k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 16]
  |  |  |  |  |  Branch (261:38): [True: 16, False: 105k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|   105k|            bytes_in_buffer--; \
  |  |  154|   105k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  915|   105k|    } while (c == 0xFF);
  ------------------
  |  Branch (915:14): [True: 14.7k, False: 90.9k]
  ------------------
  916|  90.9k|    if (c != 0)
  ------------------
  |  Branch (916:9): [True: 65.1k, False: 25.8k]
  ------------------
  917|  65.1k|      break;                    /* found a valid marker, exit loop */
  918|       |    /* Reach here if we found a stuffed-zero data sequence (FF/00).
  919|       |     * Discard it and loop back to try again.
  920|       |     */
  921|  25.8k|    cinfo->marker->discarded_bytes += 2;
  922|  25.8k|    INPUT_SYNC(cinfo);
  ------------------
  |  |  129|  25.8k|  ( datasrc->next_input_byte = next_input_byte, \
  |  |  130|  25.8k|    datasrc->bytes_in_buffer = bytes_in_buffer )
  ------------------
  923|  25.8k|  }
  924|       |
  925|  65.1k|  if (cinfo->marker->discarded_bytes != 0) {
  ------------------
  |  Branch (925:7): [True: 19.5k, False: 45.5k]
  ------------------
  926|  19.5k|    WARNMS2(cinfo, JWRN_EXTRANEOUS_DATA, cinfo->marker->discarded_bytes, c);
  ------------------
  |  |  272|  19.5k|  ((cinfo)->err->msg_code = (code), \
  |  |  273|  19.5k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  274|  19.5k|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  275|  19.5k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  927|  19.5k|    cinfo->marker->discarded_bytes = 0;
  928|  19.5k|  }
  929|       |
  930|  65.1k|  cinfo->unread_marker = c;
  931|       |
  932|  65.1k|  INPUT_SYNC(cinfo);
  ------------------
  |  |  129|  65.1k|  ( datasrc->next_input_byte = next_input_byte, \
  |  |  130|  65.1k|    datasrc->bytes_in_buffer = bytes_in_buffer )
  ------------------
  933|  65.1k|  return TRUE;
  ------------------
  |  |  248|  65.1k|#define TRUE    1
  ------------------
  934|  65.1k|}
jdmarker.c:reset_marker_reader:
 1260|  15.4k|{
 1261|  15.4k|  my_marker_ptr marker = (my_marker_ptr)cinfo->marker;
 1262|       |
 1263|  15.4k|  cinfo->comp_info = NULL;              /* until allocated by get_sof */
 1264|  15.4k|  cinfo->input_scan_number = 0;         /* no SOS seen yet */
 1265|  15.4k|  cinfo->unread_marker = 0;             /* no pending marker */
 1266|  15.4k|  marker->pub.saw_SOI = FALSE;          /* set internal state too */
  ------------------
  |  |  245|  15.4k|#define FALSE   0               /* values of boolean */
  ------------------
 1267|  15.4k|  marker->pub.saw_SOF = FALSE;
  ------------------
  |  |  245|  15.4k|#define FALSE   0               /* values of boolean */
  ------------------
 1268|  15.4k|  marker->pub.discarded_bytes = 0;
 1269|  15.4k|  marker->cur_marker = NULL;
 1270|  15.4k|}
jdmarker.c:read_markers:
  970|  32.6k|{
  971|       |  /* Outer loop repeats once for each marker. */
  972|  92.7k|  for (;;) {
  973|       |    /* Collect the marker proper, unless we already did. */
  974|       |    /* NB: first_marker() enforces the requirement that SOI appear first. */
  975|  92.7k|    if (cinfo->unread_marker == 0) {
  ------------------
  |  Branch (975:9): [True: 70.9k, False: 21.7k]
  ------------------
  976|  70.9k|      if (!cinfo->marker->saw_SOI) {
  ------------------
  |  Branch (976:11): [True: 10.2k, False: 60.7k]
  ------------------
  977|  10.2k|        if (!first_marker(cinfo))
  ------------------
  |  Branch (977:13): [True: 0, False: 10.2k]
  ------------------
  978|      0|          return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  979|  60.7k|      } else {
  980|  60.7k|        if (!next_marker(cinfo))
  ------------------
  |  Branch (980:13): [True: 0, False: 60.7k]
  ------------------
  981|      0|          return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  982|  60.7k|      }
  983|  70.9k|    }
  984|       |    /* At this point cinfo->unread_marker contains the marker code and the
  985|       |     * input point is just past the marker proper, but before any parameters.
  986|       |     * A suspension will cause us to return with this state still true.
  987|       |     */
  988|  92.7k|    switch (cinfo->unread_marker) {
  989|  10.3k|    case M_SOI:
  ------------------
  |  Branch (989:5): [True: 10.3k, False: 82.3k]
  ------------------
  990|  10.3k|      if (!get_soi(cinfo))
  ------------------
  |  Branch (990:11): [True: 0, False: 10.3k]
  ------------------
  991|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  992|  10.3k|      break;
  993|       |
  994|  10.3k|    case M_SOF0:                /* Baseline */
  ------------------
  |  Branch (994:5): [True: 2.03k, False: 90.7k]
  ------------------
  995|  3.45k|    case M_SOF1:                /* Extended sequential, Huffman */
  ------------------
  |  Branch (995:5): [True: 1.42k, False: 91.3k]
  ------------------
  996|  3.45k|      if (!get_sof(cinfo, FALSE, FALSE))
  ------------------
  |  |  245|  3.45k|#define FALSE   0               /* values of boolean */
  ------------------
                    if (!get_sof(cinfo, FALSE, FALSE))
  ------------------
  |  |  245|  3.45k|#define FALSE   0               /* values of boolean */
  ------------------
  |  Branch (996:11): [True: 0, False: 3.45k]
  ------------------
  997|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
  998|  3.45k|      break;
  999|       |
 1000|  3.45k|    case M_SOF2:                /* Progressive, Huffman */
  ------------------
  |  Branch (1000:5): [True: 1.87k, False: 90.8k]
  ------------------
 1001|  1.87k|      if (!get_sof(cinfo, TRUE, FALSE))
  ------------------
  |  |  248|  1.87k|#define TRUE    1
  ------------------
                    if (!get_sof(cinfo, TRUE, FALSE))
  ------------------
  |  |  245|  1.87k|#define FALSE   0               /* values of boolean */
  ------------------
  |  Branch (1001:11): [True: 0, False: 1.87k]
  ------------------
 1002|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
 1003|  1.87k|      break;
 1004|       |
 1005|  1.87k|    case M_SOF9:                /* Extended sequential, arithmetic */
  ------------------
  |  Branch (1005:5): [True: 1.23k, False: 91.5k]
  ------------------
 1006|  1.23k|      if (!get_sof(cinfo, FALSE, TRUE))
  ------------------
  |  |  245|  1.23k|#define FALSE   0               /* values of boolean */
  ------------------
                    if (!get_sof(cinfo, FALSE, TRUE))
  ------------------
  |  |  248|  1.23k|#define TRUE    1
  ------------------
  |  Branch (1006:11): [True: 0, False: 1.23k]
  ------------------
 1007|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
 1008|  1.23k|      break;
 1009|       |
 1010|  2.70k|    case M_SOF10:               /* Progressive, arithmetic */
  ------------------
  |  Branch (1010:5): [True: 2.70k, False: 90.0k]
  ------------------
 1011|  2.70k|      if (!get_sof(cinfo, TRUE, TRUE))
  ------------------
  |  |  248|  2.70k|#define TRUE    1
  ------------------
                    if (!get_sof(cinfo, TRUE, TRUE))
  ------------------
  |  |  248|  2.70k|#define TRUE    1
  ------------------
  |  Branch (1011:11): [True: 0, False: 2.70k]
  ------------------
 1012|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
 1013|  2.70k|      break;
 1014|       |
 1015|       |    /* Currently unsupported SOFn types */
 1016|  2.70k|    case M_SOF3:                /* Lossless, Huffman */
  ------------------
  |  Branch (1016:5): [True: 3, False: 92.7k]
  ------------------
 1017|     10|    case M_SOF5:                /* Differential sequential, Huffman */
  ------------------
  |  Branch (1017:5): [True: 7, False: 92.7k]
  ------------------
 1018|     11|    case M_SOF6:                /* Differential progressive, Huffman */
  ------------------
  |  Branch (1018:5): [True: 1, False: 92.7k]
  ------------------
 1019|     12|    case M_SOF7:                /* Differential lossless, Huffman */
  ------------------
  |  Branch (1019:5): [True: 1, False: 92.7k]
  ------------------
 1020|     16|    case M_JPG:                 /* Reserved for JPEG extensions */
  ------------------
  |  Branch (1020:5): [True: 4, False: 92.7k]
  ------------------
 1021|     20|    case M_SOF11:               /* Lossless, arithmetic */
  ------------------
  |  Branch (1021:5): [True: 4, False: 92.7k]
  ------------------
 1022|     23|    case M_SOF13:               /* Differential sequential, arithmetic */
  ------------------
  |  Branch (1022:5): [True: 3, False: 92.7k]
  ------------------
 1023|     24|    case M_SOF14:               /* Differential progressive, arithmetic */
  ------------------
  |  Branch (1023:5): [True: 1, False: 92.7k]
  ------------------
 1024|     26|    case M_SOF15:               /* Differential lossless, arithmetic */
  ------------------
  |  Branch (1024:5): [True: 2, False: 92.7k]
  ------------------
 1025|     26|      ERREXIT1(cinfo, JERR_SOF_UNSUPPORTED, cinfo->unread_marker);
  ------------------
  |  |  234|     26|  ((cinfo)->err->msg_code = (code), \
  |  |  235|     26|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|     26|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
 1026|     26|      break;
 1027|       |
 1028|  27.5k|    case M_SOS:
  ------------------
  |  Branch (1028:5): [True: 27.5k, False: 65.1k]
  ------------------
 1029|  27.5k|      if (!get_sos(cinfo))
  ------------------
  |  Branch (1029:11): [True: 0, False: 27.5k]
  ------------------
 1030|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
 1031|  27.5k|      cinfo->unread_marker = 0; /* processed the marker */
 1032|  27.5k|      return JPEG_REACHED_SOS;
  ------------------
  |  | 1020|  27.5k|#define JPEG_REACHED_SOS        1 /* Reached start of new scan */
  ------------------
 1033|       |
 1034|  3.93k|    case M_EOI:
  ------------------
  |  Branch (1034:5): [True: 3.93k, False: 88.8k]
  ------------------
 1035|  3.93k|      TRACEMS(cinfo, 1, JTRC_EOI);
  ------------------
  |  |  279|  3.93k|  ((cinfo)->err->msg_code = (code), \
  |  |  280|  3.93k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
 1036|  3.93k|      cinfo->unread_marker = 0; /* processed the marker */
 1037|  3.93k|      return JPEG_REACHED_EOI;
  ------------------
  |  | 1021|  3.93k|#define JPEG_REACHED_EOI        2 /* Reached end of image */
  ------------------
 1038|       |
 1039|    735|    case M_DAC:
  ------------------
  |  Branch (1039:5): [True: 735, False: 92.0k]
  ------------------
 1040|    735|      if (!get_dac(cinfo))
  ------------------
  |  Branch (1040:11): [True: 0, False: 735]
  ------------------
 1041|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
 1042|    735|      break;
 1043|       |
 1044|  8.49k|    case M_DHT:
  ------------------
  |  Branch (1044:5): [True: 8.49k, False: 84.2k]
  ------------------
 1045|  8.49k|      if (!get_dht(cinfo))
  ------------------
  |  Branch (1045:11): [True: 0, False: 8.49k]
  ------------------
 1046|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
 1047|  8.49k|      break;
 1048|       |
 1049|  10.7k|    case M_DQT:
  ------------------
  |  Branch (1049:5): [True: 10.7k, False: 82.0k]
  ------------------
 1050|  10.7k|      if (!get_dqt(cinfo))
  ------------------
  |  Branch (1050:11): [True: 0, False: 10.7k]
  ------------------
 1051|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
 1052|  10.7k|      break;
 1053|       |
 1054|  10.7k|    case M_DRI:
  ------------------
  |  Branch (1054:5): [True: 1.83k, False: 90.9k]
  ------------------
 1055|  1.83k|      if (!get_dri(cinfo))
  ------------------
  |  Branch (1055:11): [True: 0, False: 1.83k]
  ------------------
 1056|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
 1057|  1.83k|      break;
 1058|       |
 1059|  5.48k|    case M_APP0:
  ------------------
  |  Branch (1059:5): [True: 5.48k, False: 87.2k]
  ------------------
 1060|  5.91k|    case M_APP1:
  ------------------
  |  Branch (1060:5): [True: 430, False: 92.3k]
  ------------------
 1061|  6.14k|    case M_APP2:
  ------------------
  |  Branch (1061:5): [True: 227, False: 92.5k]
  ------------------
 1062|  6.40k|    case M_APP3:
  ------------------
  |  Branch (1062:5): [True: 262, False: 92.5k]
  ------------------
 1063|  6.82k|    case M_APP4:
  ------------------
  |  Branch (1063:5): [True: 424, False: 92.3k]
  ------------------
 1064|  7.62k|    case M_APP5:
  ------------------
  |  Branch (1064:5): [True: 791, False: 91.9k]
  ------------------
 1065|  8.23k|    case M_APP6:
  ------------------
  |  Branch (1065:5): [True: 611, False: 92.1k]
  ------------------
 1066|  9.30k|    case M_APP7:
  ------------------
  |  Branch (1066:5): [True: 1.07k, False: 91.6k]
  ------------------
 1067|  9.75k|    case M_APP8:
  ------------------
  |  Branch (1067:5): [True: 453, False: 92.3k]
  ------------------
 1068|  9.96k|    case M_APP9:
  ------------------
  |  Branch (1068:5): [True: 209, False: 92.5k]
  ------------------
 1069|  10.5k|    case M_APP10:
  ------------------
  |  Branch (1069:5): [True: 613, False: 92.1k]
  ------------------
 1070|  10.8k|    case M_APP11:
  ------------------
  |  Branch (1070:5): [True: 234, False: 92.5k]
  ------------------
 1071|  11.0k|    case M_APP12:
  ------------------
  |  Branch (1071:5): [True: 266, False: 92.5k]
  ------------------
 1072|  11.5k|    case M_APP13:
  ------------------
  |  Branch (1072:5): [True: 440, False: 92.3k]
  ------------------
 1073|  14.4k|    case M_APP14:
  ------------------
  |  Branch (1073:5): [True: 2.89k, False: 89.8k]
  ------------------
 1074|  14.8k|    case M_APP15:
  ------------------
  |  Branch (1074:5): [True: 474, False: 92.2k]
  ------------------
 1075|  14.8k|      if (!(*((my_marker_ptr)cinfo->marker)->process_APPn[
  ------------------
  |  Branch (1075:11): [True: 0, False: 14.8k]
  ------------------
 1076|  14.8k|               cinfo->unread_marker - (int)M_APP0]) (cinfo))
 1077|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
 1078|  14.8k|      break;
 1079|       |
 1080|  14.8k|    case M_COM:
  ------------------
  |  Branch (1080:5): [True: 237, False: 92.5k]
  ------------------
 1081|    237|      if (!(*((my_marker_ptr)cinfo->marker)->process_COM) (cinfo))
  ------------------
  |  Branch (1081:11): [True: 0, False: 237]
  ------------------
 1082|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
 1083|    237|      break;
 1084|       |
 1085|    393|    case M_RST0:                /* these are all parameterless */
  ------------------
  |  Branch (1085:5): [True: 393, False: 92.3k]
  ------------------
 1086|    895|    case M_RST1:
  ------------------
  |  Branch (1086:5): [True: 502, False: 92.2k]
  ------------------
 1087|  1.17k|    case M_RST2:
  ------------------
  |  Branch (1087:5): [True: 282, False: 92.4k]
  ------------------
 1088|  1.57k|    case M_RST3:
  ------------------
  |  Branch (1088:5): [True: 401, False: 92.3k]
  ------------------
 1089|  2.11k|    case M_RST4:
  ------------------
  |  Branch (1089:5): [True: 537, False: 92.2k]
  ------------------
 1090|  2.45k|    case M_RST5:
  ------------------
  |  Branch (1090:5): [True: 337, False: 92.4k]
  ------------------
 1091|  2.85k|    case M_RST6:
  ------------------
  |  Branch (1091:5): [True: 404, False: 92.3k]
  ------------------
 1092|  3.17k|    case M_RST7:
  ------------------
  |  Branch (1092:5): [True: 323, False: 92.4k]
  ------------------
 1093|  3.71k|    case M_TEM:
  ------------------
  |  Branch (1093:5): [True: 539, False: 92.2k]
  ------------------
 1094|  3.71k|      TRACEMS1(cinfo, 1, JTRC_PARMLESS_MARKER, cinfo->unread_marker);
  ------------------
  |  |  282|  3.71k|  ((cinfo)->err->msg_code = (code), \
  |  |  283|  3.71k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  284|  3.71k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
 1095|  3.71k|      break;
 1096|       |
 1097|    623|    case M_DNL:                 /* Ignore DNL ... perhaps the wrong thing */
  ------------------
  |  Branch (1097:5): [True: 623, False: 92.1k]
  ------------------
 1098|    623|      if (!skip_variable(cinfo))
  ------------------
  |  Branch (1098:11): [True: 0, False: 623]
  ------------------
 1099|      0|        return JPEG_SUSPENDED;
  ------------------
  |  |  987|      0|#define JPEG_SUSPENDED           0 /* Suspended due to lack of input data */
  ------------------
 1100|    623|      break;
 1101|       |
 1102|    623|    default:                    /* must be DHP, EXP, JPGn, or RESn */
  ------------------
  |  Branch (1102:5): [True: 287, False: 92.4k]
  ------------------
 1103|       |      /* For now, we treat the reserved markers as fatal errors since they are
 1104|       |       * likely to be used to signal incompatible JPEG Part 3 extensions.
 1105|       |       * Once the JPEG 3 version-number marker is well defined, this code
 1106|       |       * ought to change!
 1107|       |       */
 1108|    287|      ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
  ------------------
  |  |  234|    287|  ((cinfo)->err->msg_code = (code), \
  |  |  235|    287|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|    287|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
 1109|    287|      break;
 1110|  92.7k|    }
 1111|       |    /* Successfully processed marker, so reset state variable */
 1112|  60.0k|    cinfo->unread_marker = 0;
 1113|  60.0k|  } /* end loop */
 1114|  32.6k|}
jdmarker.c:first_marker:
  945|  10.2k|{
  946|  10.2k|  int c, c2;
  947|  10.2k|  INPUT_VARS(cinfo);
  ------------------
  |  |  123|  10.2k|  struct jpeg_source_mgr *datasrc = (cinfo)->src; \
  |  |  124|  10.2k|  const JOCTET *next_input_byte = datasrc->next_input_byte; \
  |  |  125|  10.2k|  size_t bytes_in_buffer = datasrc->bytes_in_buffer
  ------------------
  948|       |
  949|  10.2k|  INPUT_BYTE(cinfo, c, return FALSE);
  ------------------
  |  |  152|  10.2k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  10.2k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 0]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 10.2k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  10.2k|            bytes_in_buffer--; \
  |  |  154|  10.2k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  950|  10.2k|  INPUT_BYTE(cinfo, c2, return FALSE);
  ------------------
  |  |  152|  10.2k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  10.2k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 12]
  |  |  |  |  |  Branch (261:38): [True: 12, False: 10.2k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  10.2k|            bytes_in_buffer--; \
  |  |  154|  10.2k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  951|  10.2k|  if (c != 0xFF || c2 != (int)M_SOI)
  ------------------
  |  Branch (951:7): [True: 14, False: 10.2k]
  |  Branch (951:20): [True: 12, False: 10.2k]
  ------------------
  952|     26|    ERREXIT2(cinfo, JERR_NO_SOI, c, c2);
  ------------------
  |  |  238|     26|  ((cinfo)->err->msg_code = (code), \
  |  |  239|     26|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  240|     26|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  241|     26|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  953|       |
  954|  10.2k|  cinfo->unread_marker = c2;
  955|       |
  956|  10.2k|  INPUT_SYNC(cinfo);
  ------------------
  |  |  129|  10.2k|  ( datasrc->next_input_byte = next_input_byte, \
  |  |  130|  10.2k|    datasrc->bytes_in_buffer = bytes_in_buffer )
  ------------------
  957|  10.2k|  return TRUE;
  ------------------
  |  |  248|  10.2k|#define TRUE    1
  ------------------
  958|  10.2k|}
jdmarker.c:get_soi:
  202|  10.3k|{
  203|  10.3k|  int i;
  204|       |
  205|  10.3k|  TRACEMS(cinfo, 1, JTRC_SOI);
  ------------------
  |  |  279|  10.3k|  ((cinfo)->err->msg_code = (code), \
  |  |  280|  10.3k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  206|       |
  207|  10.3k|  if (cinfo->marker->saw_SOI)
  ------------------
  |  Branch (207:7): [True: 153, False: 10.2k]
  ------------------
  208|    153|    ERREXIT(cinfo, JERR_SOI_DUPLICATE);
  ------------------
  |  |  231|    153|  ((cinfo)->err->msg_code = (code), \
  |  |  232|    153|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  209|       |
  210|       |  /* Reset all parameters that are defined to be reset by SOI */
  211|       |
  212|   173k|  for (i = 0; i < NUM_ARITH_TBLS; i++) {
  ------------------
  |  |   50|   173k|#define NUM_ARITH_TBLS      16  /* Arith-coding tables are numbered 0..15 */
  ------------------
  |  Branch (212:15): [True: 163k, False: 10.3k]
  ------------------
  213|   163k|    cinfo->arith_dc_L[i] = 0;
  214|   163k|    cinfo->arith_dc_U[i] = 1;
  215|   163k|    cinfo->arith_ac_K[i] = 5;
  216|   163k|  }
  217|  10.3k|  cinfo->restart_interval = 0;
  218|       |
  219|       |  /* Set initial assumptions for colorspace etc */
  220|       |
  221|  10.3k|  cinfo->jpeg_color_space = JCS_UNKNOWN;
  222|  10.3k|  cinfo->CCIR601_sampling = FALSE; /* Assume non-CCIR sampling??? */
  ------------------
  |  |  245|  10.3k|#define FALSE   0               /* values of boolean */
  ------------------
  223|       |
  224|  10.3k|  cinfo->saw_JFIF_marker = FALSE;
  ------------------
  |  |  245|  10.3k|#define FALSE   0               /* values of boolean */
  ------------------
  225|  10.3k|  cinfo->JFIF_major_version = 1; /* set default JFIF APP0 values */
  226|  10.3k|  cinfo->JFIF_minor_version = 1;
  227|  10.3k|  cinfo->density_unit = 0;
  228|  10.3k|  cinfo->X_density = 1;
  229|  10.3k|  cinfo->Y_density = 1;
  230|  10.3k|  cinfo->saw_Adobe_marker = FALSE;
  ------------------
  |  |  245|  10.3k|#define FALSE   0               /* values of boolean */
  ------------------
  231|  10.3k|  cinfo->Adobe_transform = 0;
  232|       |
  233|  10.3k|  cinfo->marker->saw_SOI = TRUE;
  ------------------
  |  |  248|  10.3k|#define TRUE    1
  ------------------
  234|       |
  235|  10.3k|  return TRUE;
  ------------------
  |  |  248|  10.3k|#define TRUE    1
  ------------------
  236|  10.3k|}
jdmarker.c:get_sof:
  242|  9.27k|{
  243|  9.27k|  JLONG length;
  244|  9.27k|  int c, ci;
  245|  9.27k|  jpeg_component_info *compptr;
  246|  9.27k|  INPUT_VARS(cinfo);
  ------------------
  |  |  123|  9.27k|  struct jpeg_source_mgr *datasrc = (cinfo)->src; \
  |  |  124|  9.27k|  const JOCTET *next_input_byte = datasrc->next_input_byte; \
  |  |  125|  9.27k|  size_t bytes_in_buffer = datasrc->bytes_in_buffer
  ------------------
  247|       |
  248|  9.27k|  cinfo->progressive_mode = is_prog;
  249|  9.27k|  cinfo->arith_code = is_arith;
  250|       |
  251|  9.27k|  INPUT_2BYTES(cinfo, length, return FALSE);
  ------------------
  |  |  160|  9.27k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  18.6k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 13]
  |  |  |  |  |  Branch (261:38): [True: 13, False: 9.26k]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 14]
  |  |  |  |  |  Branch (261:38): [True: 14, False: 9.26k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  161|  9.27k|            bytes_in_buffer--; \
  |  |  162|  9.27k|            V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
  |  |  163|  9.27k|            MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  164|  9.27k|            bytes_in_buffer--; \
  |  |  165|  9.27k|            V += GETJOCTET(*next_input_byte++); )
  ------------------
  252|       |
  253|  9.27k|  INPUT_BYTE(cinfo, cinfo->data_precision, return FALSE);
  ------------------
  |  |  152|  9.27k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  9.34k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 21]
  |  |  |  |  |  Branch (261:38): [True: 21, False: 9.25k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  9.27k|            bytes_in_buffer--; \
  |  |  154|  9.27k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  254|  9.27k|  INPUT_2BYTES(cinfo, cinfo->image_height, return FALSE);
  ------------------
  |  |  160|  9.27k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  18.7k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 25]
  |  |  |  |  |  Branch (261:38): [True: 25, False: 9.25k]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 29]
  |  |  |  |  |  Branch (261:38): [True: 29, False: 9.24k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  161|  9.27k|            bytes_in_buffer--; \
  |  |  162|  9.27k|            V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
  |  |  163|  9.27k|            MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  164|  9.27k|            bytes_in_buffer--; \
  |  |  165|  9.27k|            V += GETJOCTET(*next_input_byte++); )
  ------------------
  255|  9.27k|  INPUT_2BYTES(cinfo, cinfo->image_width, return FALSE);
  ------------------
  |  |  160|  9.27k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  18.7k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 32]
  |  |  |  |  |  Branch (261:38): [True: 32, False: 9.24k]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 38]
  |  |  |  |  |  Branch (261:38): [True: 38, False: 9.23k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  161|  9.27k|            bytes_in_buffer--; \
  |  |  162|  9.27k|            V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
  |  |  163|  9.27k|            MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  164|  9.27k|            bytes_in_buffer--; \
  |  |  165|  9.27k|            V += GETJOCTET(*next_input_byte++); )
  ------------------
  256|  9.27k|  INPUT_BYTE(cinfo, cinfo->num_components, return FALSE);
  ------------------
  |  |  152|  9.27k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  9.40k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 41]
  |  |  |  |  |  Branch (261:38): [True: 41, False: 9.23k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  9.27k|            bytes_in_buffer--; \
  |  |  154|  9.27k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  257|       |
  258|  9.27k|  length -= 8;
  259|       |
  260|  9.27k|  TRACEMS4(cinfo, 1, JTRC_SOF, cinfo->unread_marker,
  ------------------
  |  |  296|  9.27k|  MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
  |  |  ------------------
  |  |  |  |  261|  9.27k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  297|  9.27k|           _mp[0] = (p1);  _mp[1] = (p2);  _mp[2] = (p3);  _mp[3] = (p4); \
  |  |  298|  9.27k|           (cinfo)->err->msg_code = (code); \
  |  |  299|  9.27k|           (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
  ------------------
  261|  9.27k|           (int)cinfo->image_width, (int)cinfo->image_height,
  262|  9.27k|           cinfo->num_components);
  263|       |
  264|  9.27k|  if (cinfo->marker->saw_SOF)
  ------------------
  |  Branch (264:7): [True: 85, False: 9.19k]
  ------------------
  265|     85|    ERREXIT(cinfo, JERR_SOF_DUPLICATE);
  ------------------
  |  |  231|     85|  ((cinfo)->err->msg_code = (code), \
  |  |  232|     85|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  266|       |
  267|       |  /* We don't support files in which the image height is initially specified */
  268|       |  /* as 0 and is later redefined by DNL.  As long as we have to check that,  */
  269|       |  /* might as well have a general sanity check. */
  270|  9.27k|  if (cinfo->image_height <= 0 || cinfo->image_width <= 0 ||
  ------------------
  |  Branch (270:7): [True: 89, False: 9.18k]
  |  Branch (270:35): [True: 2, False: 9.18k]
  ------------------
  271|  9.27k|      cinfo->num_components <= 0)
  ------------------
  |  Branch (271:7): [True: 12, False: 9.17k]
  ------------------
  272|     18|    ERREXIT(cinfo, JERR_EMPTY_IMAGE);
  ------------------
  |  |  231|     18|  ((cinfo)->err->msg_code = (code), \
  |  |  232|     18|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  273|       |
  274|  9.27k|  if (length != (cinfo->num_components * 3))
  ------------------
  |  Branch (274:7): [True: 78, False: 9.19k]
  ------------------
  275|     78|    ERREXIT(cinfo, JERR_BAD_LENGTH);
  ------------------
  |  |  231|     78|  ((cinfo)->err->msg_code = (code), \
  |  |  232|     78|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  276|       |
  277|  9.27k|  if (cinfo->comp_info == NULL) /* do only once, even if suspend */
  ------------------
  |  Branch (277:7): [True: 9.09k, False: 181]
  ------------------
  278|  9.09k|    cinfo->comp_info = (jpeg_component_info *)(*cinfo->mem->alloc_small)
  279|  9.09k|                        ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  9.09k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  280|  9.09k|                         cinfo->num_components * sizeof(jpeg_component_info));
  281|       |
  282|  29.2k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (282:44): [True: 19.9k, False: 9.27k]
  ------------------
  283|  19.9k|       ci++, compptr++) {
  284|  19.9k|    compptr->component_index = ci;
  285|  19.9k|    INPUT_BYTE(cinfo, compptr->component_id, return FALSE);
  ------------------
  |  |  152|  19.9k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  22.2k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 759]
  |  |  |  |  |  Branch (261:38): [True: 759, False: 19.1k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  19.9k|            bytes_in_buffer--; \
  |  |  154|  19.9k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  286|  19.9k|    INPUT_BYTE(cinfo, c, return FALSE);
  ------------------
  |  |  152|  19.9k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  22.2k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 755]
  |  |  |  |  |  Branch (261:38): [True: 755, False: 19.1k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  19.9k|            bytes_in_buffer--; \
  |  |  154|  19.9k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  287|  19.9k|    compptr->h_samp_factor = (c >> 4) & 15;
  288|  19.9k|    compptr->v_samp_factor = (c     ) & 15;
  289|  19.9k|    INPUT_BYTE(cinfo, compptr->quant_tbl_no, return FALSE);
  ------------------
  |  |  152|  19.9k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  22.2k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 761]
  |  |  |  |  |  Branch (261:38): [True: 761, False: 19.1k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  19.9k|            bytes_in_buffer--; \
  |  |  154|  19.9k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  290|       |
  291|  19.9k|    TRACEMS4(cinfo, 1, JTRC_SOF_COMPONENT,
  ------------------
  |  |  296|  19.9k|  MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
  |  |  ------------------
  |  |  |  |  261|  19.9k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  297|  19.9k|           _mp[0] = (p1);  _mp[1] = (p2);  _mp[2] = (p3);  _mp[3] = (p4); \
  |  |  298|  19.9k|           (cinfo)->err->msg_code = (code); \
  |  |  299|  19.9k|           (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
  ------------------
  292|  19.9k|             compptr->component_id, compptr->h_samp_factor,
  293|  19.9k|             compptr->v_samp_factor, compptr->quant_tbl_no);
  294|  19.9k|  }
  295|       |
  296|  9.27k|  cinfo->marker->saw_SOF = TRUE;
  ------------------
  |  |  248|  9.27k|#define TRUE    1
  ------------------
  297|       |
  298|  9.27k|  INPUT_SYNC(cinfo);
  ------------------
  |  |  129|  9.27k|  ( datasrc->next_input_byte = next_input_byte, \
  |  |  130|  9.27k|    datasrc->bytes_in_buffer = bytes_in_buffer )
  ------------------
  299|  9.27k|  return TRUE;
  ------------------
  |  |  248|  9.27k|#define TRUE    1
  ------------------
  300|  9.27k|}
jdmarker.c:get_sos:
  306|  27.5k|{
  307|  27.5k|  JLONG length;
  308|  27.5k|  int i, ci, n, c, cc, pi;
  309|  27.5k|  jpeg_component_info *compptr;
  310|  27.5k|  INPUT_VARS(cinfo);
  ------------------
  |  |  123|  27.5k|  struct jpeg_source_mgr *datasrc = (cinfo)->src; \
  |  |  124|  27.5k|  const JOCTET *next_input_byte = datasrc->next_input_byte; \
  |  |  125|  27.5k|  size_t bytes_in_buffer = datasrc->bytes_in_buffer
  ------------------
  311|       |
  312|  27.5k|  if (!cinfo->marker->saw_SOF)
  ------------------
  |  Branch (312:7): [True: 7, False: 27.5k]
  ------------------
  313|      7|    ERREXIT(cinfo, JERR_SOS_NO_SOF);
  ------------------
  |  |  231|      7|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      7|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  314|       |
  315|  27.5k|  INPUT_2BYTES(cinfo, length, return FALSE);
  ------------------
  |  |  160|  27.5k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  55.2k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 8]
  |  |  |  |  |  Branch (261:38): [True: 8, False: 27.5k]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 16]
  |  |  |  |  |  Branch (261:38): [True: 16, False: 27.5k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  161|  27.5k|            bytes_in_buffer--; \
  |  |  162|  27.5k|            V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
  |  |  163|  27.5k|            MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  164|  27.5k|            bytes_in_buffer--; \
  |  |  165|  27.5k|            V += GETJOCTET(*next_input_byte++); )
  ------------------
  316|       |
  317|  27.5k|  INPUT_BYTE(cinfo, n, return FALSE); /* Number of components */
  ------------------
  |  |  152|  27.5k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  27.6k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 18]
  |  |  |  |  |  Branch (261:38): [True: 18, False: 27.5k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  27.5k|            bytes_in_buffer--; \
  |  |  154|  27.5k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  318|       |
  319|  27.5k|  TRACEMS1(cinfo, 1, JTRC_SOS, n);
  ------------------
  |  |  282|  27.5k|  ((cinfo)->err->msg_code = (code), \
  |  |  283|  27.5k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  284|  27.5k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  320|       |
  321|  27.5k|  if (length != (n * 2 + 6) || n < 1 || n > MAX_COMPS_IN_SCAN)
  ------------------
  |  |   51|  27.4k|#define MAX_COMPS_IN_SCAN   4   /* JPEG limit on # of components in one scan */
  ------------------
  |  Branch (321:7): [True: 106, False: 27.4k]
  |  Branch (321:32): [True: 2, False: 27.4k]
  |  Branch (321:41): [True: 5, False: 27.4k]
  ------------------
  322|    106|    ERREXIT(cinfo, JERR_BAD_LENGTH);
  ------------------
  |  |  231|    106|  ((cinfo)->err->msg_code = (code), \
  |  |  232|    106|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  323|       |
  324|  27.5k|  cinfo->comps_in_scan = n;
  325|       |
  326|       |  /* Collect the component-spec parameters */
  327|       |
  328|   137k|  for (i = 0; i < MAX_COMPS_IN_SCAN; i++)
  ------------------
  |  |   51|   137k|#define MAX_COMPS_IN_SCAN   4   /* JPEG limit on # of components in one scan */
  ------------------
  |  Branch (328:15): [True: 109k, False: 27.5k]
  ------------------
  329|   109k|    cinfo->cur_comp_info[i] = NULL;
  330|       |
  331|  66.7k|  for (i = 0; i < n; i++) {
  ------------------
  |  Branch (331:15): [True: 39.2k, False: 27.5k]
  ------------------
  332|  39.2k|    INPUT_BYTE(cinfo, cc, return FALSE);
  ------------------
  |  |  152|  39.2k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  39.7k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 158]
  |  |  |  |  |  Branch (261:38): [True: 158, False: 39.1k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  39.2k|            bytes_in_buffer--; \
  |  |  154|  39.2k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  333|  39.2k|    INPUT_BYTE(cinfo, c, return FALSE);
  ------------------
  |  |  152|  39.2k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  42.0k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 925]
  |  |  |  |  |  Branch (261:38): [True: 925, False: 38.3k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  39.2k|            bytes_in_buffer--; \
  |  |  154|  39.2k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  334|       |
  335|  39.2k|    for (ci = 0, compptr = cinfo->comp_info;
  336|  70.0k|         ci < cinfo->num_components && ci < MAX_COMPS_IN_SCAN;
  ------------------
  |  |   51|  69.9k|#define MAX_COMPS_IN_SCAN   4   /* JPEG limit on # of components in one scan */
  ------------------
  |  Branch (336:10): [True: 69.9k, False: 64]
  |  Branch (336:40): [True: 69.9k, False: 1]
  ------------------
  337|  69.9k|         ci++, compptr++) {
  338|  69.9k|      if (cc == compptr->component_id && !cinfo->cur_comp_info[ci])
  ------------------
  |  Branch (338:11): [True: 39.9k, False: 30.0k]
  |  Branch (338:42): [True: 39.2k, False: 770]
  ------------------
  339|  39.2k|        goto id_found;
  340|  69.9k|    }
  341|       |
  342|     65|    ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
  ------------------
  |  |  234|     65|  ((cinfo)->err->msg_code = (code), \
  |  |  235|     65|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|     65|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  343|       |
  344|  39.2k|id_found:
  345|       |
  346|  39.2k|    cinfo->cur_comp_info[i] = compptr;
  347|  39.2k|    compptr->dc_tbl_no = (c >> 4) & 15;
  348|  39.2k|    compptr->ac_tbl_no = (c     ) & 15;
  349|       |
  350|  39.2k|    TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
  ------------------
  |  |  291|  39.2k|  MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
  |  |  ------------------
  |  |  |  |  261|  39.2k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  292|  39.2k|           _mp[0] = (p1);  _mp[1] = (p2);  _mp[2] = (p3); \
  |  |  293|  39.2k|           (cinfo)->err->msg_code = (code); \
  |  |  294|  39.2k|           (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
  ------------------
  351|  39.2k|             compptr->dc_tbl_no, compptr->ac_tbl_no);
  352|       |
  353|       |    /* This CSi (cc) should differ from the previous CSi */
  354|  56.1k|    for (pi = 0; pi < i; pi++) {
  ------------------
  |  Branch (354:18): [True: 16.9k, False: 39.2k]
  ------------------
  355|  16.9k|      if (cinfo->cur_comp_info[pi] == compptr) {
  ------------------
  |  Branch (355:11): [True: 1, False: 16.9k]
  ------------------
  356|      1|        ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
  ------------------
  |  |  234|      1|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      1|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      1|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  357|      1|      }
  358|  16.9k|    }
  359|  39.2k|  }
  360|       |
  361|       |  /* Collect the additional scan parameters Ss, Se, Ah/Al. */
  362|  27.5k|  INPUT_BYTE(cinfo, c, return FALSE);
  ------------------
  |  |  152|  27.5k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  28.9k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 464]
  |  |  |  |  |  Branch (261:38): [True: 464, False: 27.0k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  27.5k|            bytes_in_buffer--; \
  |  |  154|  27.5k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  363|  27.5k|  cinfo->Ss = c;
  364|  27.5k|  INPUT_BYTE(cinfo, c, return FALSE);
  ------------------
  |  |  152|  27.5k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  30.5k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 1.00k]
  |  |  |  |  |  Branch (261:38): [True: 1.00k, False: 26.5k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  27.5k|            bytes_in_buffer--; \
  |  |  154|  27.5k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  365|  27.5k|  cinfo->Se = c;
  366|  27.5k|  INPUT_BYTE(cinfo, c, return FALSE);
  ------------------
  |  |  152|  27.5k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  29.1k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 554]
  |  |  |  |  |  Branch (261:38): [True: 554, False: 26.9k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  27.5k|            bytes_in_buffer--; \
  |  |  154|  27.5k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  367|  27.5k|  cinfo->Ah = (c >> 4) & 15;
  368|  27.5k|  cinfo->Al = (c     ) & 15;
  369|       |
  370|  27.5k|  TRACEMS4(cinfo, 1, JTRC_SOS_PARAMS, cinfo->Ss, cinfo->Se,
  ------------------
  |  |  296|  27.5k|  MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
  |  |  ------------------
  |  |  |  |  261|  27.5k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  297|  27.5k|           _mp[0] = (p1);  _mp[1] = (p2);  _mp[2] = (p3);  _mp[3] = (p4); \
  |  |  298|  27.5k|           (cinfo)->err->msg_code = (code); \
  |  |  299|  27.5k|           (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
  ------------------
  371|  27.5k|           cinfo->Ah, cinfo->Al);
  372|       |
  373|       |  /* Prepare to scan data & restart markers */
  374|  27.5k|  cinfo->marker->next_restart_num = 0;
  375|       |
  376|       |  /* Count another SOS marker */
  377|  27.5k|  cinfo->input_scan_number++;
  378|       |
  379|  27.5k|  INPUT_SYNC(cinfo);
  ------------------
  |  |  129|  27.5k|  ( datasrc->next_input_byte = next_input_byte, \
  |  |  130|  27.5k|    datasrc->bytes_in_buffer = bytes_in_buffer )
  ------------------
  380|  27.5k|  return TRUE;
  ------------------
  |  |  248|  27.5k|#define TRUE    1
  ------------------
  381|  27.5k|}
jdmarker.c:get_dac:
  389|    735|{
  390|    735|  JLONG length;
  391|    735|  int index, val;
  392|    735|  INPUT_VARS(cinfo);
  ------------------
  |  |  123|    735|  struct jpeg_source_mgr *datasrc = (cinfo)->src; \
  |  |  124|    735|  const JOCTET *next_input_byte = datasrc->next_input_byte; \
  |  |  125|    735|  size_t bytes_in_buffer = datasrc->bytes_in_buffer
  ------------------
  393|       |
  394|    735|  INPUT_2BYTES(cinfo, length, return FALSE);
  ------------------
  |  |  160|    735|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  1.52k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 6]
  |  |  |  |  |  Branch (261:38): [True: 6, False: 729]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 11]
  |  |  |  |  |  Branch (261:38): [True: 11, False: 724]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  161|    735|            bytes_in_buffer--; \
  |  |  162|    735|            V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
  |  |  163|    735|            MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  164|    735|            bytes_in_buffer--; \
  |  |  165|    735|            V += GETJOCTET(*next_input_byte++); )
  ------------------
  395|    735|  length -= 2;
  396|       |
  397|  2.74k|  while (length > 0) {
  ------------------
  |  Branch (397:10): [True: 2.01k, False: 735]
  ------------------
  398|  2.01k|    INPUT_BYTE(cinfo, index, return FALSE);
  ------------------
  |  |  152|  2.01k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  2.07k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 22]
  |  |  |  |  |  Branch (261:38): [True: 22, False: 1.99k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  2.01k|            bytes_in_buffer--; \
  |  |  154|  2.01k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  399|  2.01k|    INPUT_BYTE(cinfo, val, return FALSE);
  ------------------
  |  |  152|  2.01k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  2.23k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 74]
  |  |  |  |  |  Branch (261:38): [True: 74, False: 1.93k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  2.01k|            bytes_in_buffer--; \
  |  |  154|  2.01k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  400|       |
  401|  2.01k|    length -= 2;
  402|       |
  403|  2.01k|    TRACEMS2(cinfo, 1, JTRC_DAC, index, val);
  ------------------
  |  |  286|  2.01k|  ((cinfo)->err->msg_code = (code), \
  |  |  287|  2.01k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  288|  2.01k|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  289|  2.01k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  404|       |
  405|  2.01k|    if (index < 0 || index >= (2 * NUM_ARITH_TBLS))
  ------------------
  |  |   50|  2.01k|#define NUM_ARITH_TBLS      16  /* Arith-coding tables are numbered 0..15 */
  ------------------
  |  Branch (405:9): [True: 0, False: 2.01k]
  |  Branch (405:22): [True: 101, False: 1.91k]
  ------------------
  406|    101|      ERREXIT1(cinfo, JERR_DAC_INDEX, index);
  ------------------
  |  |  234|    101|  ((cinfo)->err->msg_code = (code), \
  |  |  235|    101|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|    101|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  407|       |
  408|  2.01k|    if (index >= NUM_ARITH_TBLS) { /* define AC table */
  ------------------
  |  |   50|  2.01k|#define NUM_ARITH_TBLS      16  /* Arith-coding tables are numbered 0..15 */
  ------------------
  |  Branch (408:9): [True: 605, False: 1.40k]
  ------------------
  409|    605|      cinfo->arith_ac_K[index - NUM_ARITH_TBLS] = (UINT8)val;
  ------------------
  |  |   50|    605|#define NUM_ARITH_TBLS      16  /* Arith-coding tables are numbered 0..15 */
  ------------------
  410|  1.40k|    } else {                    /* define DC table */
  411|  1.40k|      cinfo->arith_dc_L[index] = (UINT8)(val & 0x0F);
  412|  1.40k|      cinfo->arith_dc_U[index] = (UINT8)(val >> 4);
  413|  1.40k|      if (cinfo->arith_dc_L[index] > cinfo->arith_dc_U[index])
  ------------------
  |  Branch (413:11): [True: 31, False: 1.37k]
  ------------------
  414|     31|        ERREXIT1(cinfo, JERR_DAC_VALUE, val);
  ------------------
  |  |  234|     31|  ((cinfo)->err->msg_code = (code), \
  |  |  235|     31|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|     31|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  415|  1.40k|    }
  416|  2.01k|  }
  417|       |
  418|    735|  if (length != 0)
  ------------------
  |  Branch (418:7): [True: 2, False: 733]
  ------------------
  419|      2|    ERREXIT(cinfo, JERR_BAD_LENGTH);
  ------------------
  |  |  231|      2|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      2|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  420|       |
  421|    735|  INPUT_SYNC(cinfo);
  ------------------
  |  |  129|    735|  ( datasrc->next_input_byte = next_input_byte, \
  |  |  130|    735|    datasrc->bytes_in_buffer = bytes_in_buffer )
  ------------------
  422|    735|  return TRUE;
  ------------------
  |  |  248|    735|#define TRUE    1
  ------------------
  423|    735|}
jdmarker.c:get_dht:
  435|  8.49k|{
  436|  8.49k|  JLONG length;
  437|  8.49k|  UINT8 bits[17];
  438|  8.49k|  UINT8 huffval[256];
  439|  8.49k|  int i, index, count;
  440|  8.49k|  JHUFF_TBL **htblptr;
  441|  8.49k|  INPUT_VARS(cinfo);
  ------------------
  |  |  123|  8.49k|  struct jpeg_source_mgr *datasrc = (cinfo)->src; \
  |  |  124|  8.49k|  const JOCTET *next_input_byte = datasrc->next_input_byte; \
  |  |  125|  8.49k|  size_t bytes_in_buffer = datasrc->bytes_in_buffer
  ------------------
  442|       |
  443|  8.49k|  INPUT_2BYTES(cinfo, length, return FALSE);
  ------------------
  |  |  160|  8.49k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  17.0k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 12]
  |  |  |  |  |  Branch (261:38): [True: 12, False: 8.47k]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 12]
  |  |  |  |  |  Branch (261:38): [True: 12, False: 8.47k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  161|  8.49k|            bytes_in_buffer--; \
  |  |  162|  8.49k|            V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
  |  |  163|  8.49k|            MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  164|  8.49k|            bytes_in_buffer--; \
  |  |  165|  8.49k|            V += GETJOCTET(*next_input_byte++); )
  ------------------
  444|  8.49k|  length -= 2;
  445|       |
  446|  19.1k|  while (length > 16) {
  ------------------
  |  Branch (446:10): [True: 10.6k, False: 8.49k]
  ------------------
  447|  10.6k|    INPUT_BYTE(cinfo, index, return FALSE);
  ------------------
  |  |  152|  10.6k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  10.7k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 36]
  |  |  |  |  |  Branch (261:38): [True: 36, False: 10.5k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  10.6k|            bytes_in_buffer--; \
  |  |  154|  10.6k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  448|       |
  449|  10.6k|    TRACEMS1(cinfo, 1, JTRC_DHT, index);
  ------------------
  |  |  282|  10.6k|  ((cinfo)->err->msg_code = (code), \
  |  |  283|  10.6k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  284|  10.6k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  450|       |
  451|  10.6k|    bits[0] = 0;
  452|  10.6k|    count = 0;
  453|   180k|    for (i = 1; i <= 16; i++) {
  ------------------
  |  Branch (453:17): [True: 169k, False: 10.6k]
  ------------------
  454|   169k|      INPUT_BYTE(cinfo, bits[i], return FALSE);
  ------------------
  |  |  152|   169k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|   172k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 775]
  |  |  |  |  |  Branch (261:38): [True: 775, False: 169k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|   169k|            bytes_in_buffer--; \
  |  |  154|   169k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  455|   169k|      count += bits[i];
  456|   169k|    }
  457|       |
  458|  10.6k|    length -= 1 + 16;
  459|       |
  460|  10.6k|    TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
  ------------------
  |  |  307|  10.6k|  MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
  |  |  ------------------
  |  |  |  |  261|  10.6k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  308|  10.6k|           _mp[0] = (p1);  _mp[1] = (p2);  _mp[2] = (p3);  _mp[3] = (p4); \
  |  |  309|  10.6k|           _mp[4] = (p5);  _mp[5] = (p6);  _mp[6] = (p7);  _mp[7] = (p8); \
  |  |  310|  10.6k|           (cinfo)->err->msg_code = (code); \
  |  |  311|  10.6k|           (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
  ------------------
  461|  10.6k|             bits[1], bits[2], bits[3], bits[4],
  462|  10.6k|             bits[5], bits[6], bits[7], bits[8]);
  463|  10.6k|    TRACEMS8(cinfo, 2, JTRC_HUFFBITS,
  ------------------
  |  |  307|  10.6k|  MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
  |  |  ------------------
  |  |  |  |  261|  10.6k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  308|  10.6k|           _mp[0] = (p1);  _mp[1] = (p2);  _mp[2] = (p3);  _mp[3] = (p4); \
  |  |  309|  10.6k|           _mp[4] = (p5);  _mp[5] = (p6);  _mp[6] = (p7);  _mp[7] = (p8); \
  |  |  310|  10.6k|           (cinfo)->err->msg_code = (code); \
  |  |  311|  10.6k|           (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
  ------------------
  464|  10.6k|             bits[9], bits[10], bits[11], bits[12],
  465|  10.6k|             bits[13], bits[14], bits[15], bits[16]);
  466|       |
  467|       |    /* Here we just do minimal validation of the counts to avoid walking
  468|       |     * off the end of our table space.  jdhuff.c will check more carefully.
  469|       |     */
  470|  10.6k|    if (count > 256 || ((JLONG)count) > length)
  ------------------
  |  Branch (470:9): [True: 158, False: 10.4k]
  |  Branch (470:24): [True: 16, False: 10.4k]
  ------------------
  471|    174|      ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  ------------------
  |  |  231|    174|  ((cinfo)->err->msg_code = (code), \
  |  |  232|    174|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  472|       |
  473|  99.5k|    for (i = 0; i < count; i++)
  ------------------
  |  Branch (473:17): [True: 88.9k, False: 10.6k]
  ------------------
  474|  88.9k|      INPUT_BYTE(cinfo, huffval[i], return FALSE);
  ------------------
  |  |  152|  88.9k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|   106k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 5.91k]
  |  |  |  |  |  Branch (261:38): [True: 5.91k, False: 83.0k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  10.6k|            bytes_in_buffer--; \
  |  |  154|  10.6k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  475|       |
  476|  10.6k|    MEMZERO(&huffval[count], (256 - count) * sizeof(UINT8));
  ------------------
  |  |   73|  10.6k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
  477|       |
  478|  10.6k|    length -= count;
  479|       |
  480|  10.6k|    if (index & 0x10) {         /* AC table definition */
  ------------------
  |  Branch (480:9): [True: 4.43k, False: 6.18k]
  ------------------
  481|  4.43k|      index -= 0x10;
  482|  4.43k|      if (index < 0 || index >= NUM_HUFF_TBLS)
  ------------------
  |  |   49|  4.43k|#define NUM_HUFF_TBLS       4   /* Huffman tables are numbered 0..3 */
  ------------------
  |  Branch (482:11): [True: 0, False: 4.43k]
  |  Branch (482:24): [True: 14, False: 4.41k]
  ------------------
  483|     14|        ERREXIT1(cinfo, JERR_DHT_INDEX, index);
  ------------------
  |  |  234|     14|  ((cinfo)->err->msg_code = (code), \
  |  |  235|     14|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|     14|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  484|  4.43k|      htblptr = &cinfo->ac_huff_tbl_ptrs[index];
  485|  6.18k|    } else {                    /* DC table definition */
  486|  6.18k|      if (index < 0 || index >= NUM_HUFF_TBLS)
  ------------------
  |  |   49|  6.01k|#define NUM_HUFF_TBLS       4   /* Huffman tables are numbered 0..3 */
  ------------------
  |  Branch (486:11): [True: 174, False: 6.01k]
  |  Branch (486:24): [True: 20, False: 5.99k]
  ------------------
  487|     20|        ERREXIT1(cinfo, JERR_DHT_INDEX, index);
  ------------------
  |  |  234|     20|  ((cinfo)->err->msg_code = (code), \
  |  |  235|     20|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|     20|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  488|  6.18k|      htblptr = &cinfo->dc_huff_tbl_ptrs[index];
  489|  6.18k|    }
  490|       |
  491|  10.6k|    if (*htblptr == NULL)
  ------------------
  |  Branch (491:9): [True: 1.97k, False: 8.63k]
  ------------------
  492|  1.97k|      *htblptr = jpeg_alloc_huff_table((j_common_ptr)cinfo);
  493|       |
  494|  10.6k|    MEMCOPY((*htblptr)->bits, bits, sizeof((*htblptr)->bits));
  ------------------
  |  |   75|  10.6k|  memcpy((void *)(dest), (const void *)(src), (size_t)(size))
  ------------------
  495|  10.6k|    MEMCOPY((*htblptr)->huffval, huffval, sizeof((*htblptr)->huffval));
  ------------------
  |  |   75|  10.6k|  memcpy((void *)(dest), (const void *)(src), (size_t)(size))
  ------------------
  496|  10.6k|  }
  497|       |
  498|  8.49k|  if (length != 0)
  ------------------
  |  Branch (498:7): [True: 19, False: 8.47k]
  ------------------
  499|     19|    ERREXIT(cinfo, JERR_BAD_LENGTH);
  ------------------
  |  |  231|     19|  ((cinfo)->err->msg_code = (code), \
  |  |  232|     19|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  500|       |
  501|  8.49k|  INPUT_SYNC(cinfo);
  ------------------
  |  |  129|  8.49k|  ( datasrc->next_input_byte = next_input_byte, \
  |  |  130|  8.49k|    datasrc->bytes_in_buffer = bytes_in_buffer )
  ------------------
  502|  8.49k|  return TRUE;
  ------------------
  |  |  248|  8.49k|#define TRUE    1
  ------------------
  503|  8.49k|}
jdmarker.c:get_dqt:
  509|  10.7k|{
  510|  10.7k|  JLONG length;
  511|  10.7k|  int n, i, prec;
  512|  10.7k|  unsigned int tmp;
  513|  10.7k|  JQUANT_TBL *quant_ptr;
  514|  10.7k|  INPUT_VARS(cinfo);
  ------------------
  |  |  123|  10.7k|  struct jpeg_source_mgr *datasrc = (cinfo)->src; \
  |  |  124|  10.7k|  const JOCTET *next_input_byte = datasrc->next_input_byte; \
  |  |  125|  10.7k|  size_t bytes_in_buffer = datasrc->bytes_in_buffer
  ------------------
  515|       |
  516|  10.7k|  INPUT_2BYTES(cinfo, length, return FALSE);
  ------------------
  |  |  160|  10.7k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  21.5k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 8]
  |  |  |  |  |  Branch (261:38): [True: 8, False: 10.7k]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 12]
  |  |  |  |  |  Branch (261:38): [True: 12, False: 10.7k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  161|  10.7k|            bytes_in_buffer--; \
  |  |  162|  10.7k|            V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
  |  |  163|  10.7k|            MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  164|  10.7k|            bytes_in_buffer--; \
  |  |  165|  10.7k|            V += GETJOCTET(*next_input_byte++); )
  ------------------
  517|  10.7k|  length -= 2;
  518|       |
  519|  21.8k|  while (length > 0) {
  ------------------
  |  Branch (519:10): [True: 11.1k, False: 10.7k]
  ------------------
  520|  11.1k|    INPUT_BYTE(cinfo, n, return FALSE);
  ------------------
  |  |  152|  11.1k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  11.2k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 38]
  |  |  |  |  |  Branch (261:38): [True: 38, False: 11.0k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  11.1k|            bytes_in_buffer--; \
  |  |  154|  11.1k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  521|  11.1k|    prec = n >> 4;
  522|  11.1k|    n &= 0x0F;
  523|       |
  524|  11.1k|    TRACEMS2(cinfo, 1, JTRC_DQT, n, prec);
  ------------------
  |  |  286|  11.1k|  ((cinfo)->err->msg_code = (code), \
  |  |  287|  11.1k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  288|  11.1k|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  289|  11.1k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  525|       |
  526|  11.1k|    if (n >= NUM_QUANT_TBLS)
  ------------------
  |  |   48|  11.1k|#define NUM_QUANT_TBLS      4   /* Quantization tables are numbered 0..3 */
  ------------------
  |  Branch (526:9): [True: 86, False: 11.0k]
  ------------------
  527|     86|      ERREXIT1(cinfo, JERR_DQT_INDEX, n);
  ------------------
  |  |  234|     86|  ((cinfo)->err->msg_code = (code), \
  |  |  235|     86|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|     86|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  528|       |
  529|  11.1k|    if (cinfo->quant_tbl_ptrs[n] == NULL)
  ------------------
  |  Branch (529:9): [True: 3.81k, False: 7.30k]
  ------------------
  530|  3.81k|      cinfo->quant_tbl_ptrs[n] = jpeg_alloc_quant_table((j_common_ptr)cinfo);
  531|  11.1k|    quant_ptr = cinfo->quant_tbl_ptrs[n];
  532|       |
  533|   717k|    for (i = 0; i < DCTSIZE2; i++) {
  ------------------
  |  |   47|   717k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (533:17): [True: 706k, False: 11.1k]
  ------------------
  534|   706k|      if (prec)
  ------------------
  |  Branch (534:11): [True: 33.0k, False: 672k]
  ------------------
  535|   706k|        INPUT_2BYTES(cinfo, tmp, return FALSE);
  ------------------
  |  |  160|  33.0k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  74.0k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 1.66k]
  |  |  |  |  |  Branch (261:38): [True: 1.66k, False: 31.4k]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 971]
  |  |  |  |  |  Branch (261:38): [True: 971, False: 32.1k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  161|   706k|            bytes_in_buffer--; \
  |  |  162|   706k|            V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
  |  |  163|   706k|            MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  164|   706k|            bytes_in_buffer--; \
  |  |  165|   706k|            V += GETJOCTET(*next_input_byte++); )
  ------------------
  536|   672k|      else
  537|   706k|        INPUT_BYTE(cinfo, tmp, return FALSE);
  ------------------
  |  |  152|   672k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|   675k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 698]
  |  |  |  |  |  Branch (261:38): [True: 698, False: 672k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|   706k|            bytes_in_buffer--; \
  |  |  154|   706k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  538|       |      /* We convert the zigzag-order table to natural array order. */
  539|   706k|      quant_ptr->quantval[jpeg_natural_order[i]] = (UINT16)tmp;
  540|   706k|    }
  541|       |
  542|  11.1k|    if (cinfo->err->trace_level >= 2) {
  ------------------
  |  Branch (542:9): [True: 0, False: 11.1k]
  ------------------
  543|      0|      for (i = 0; i < DCTSIZE2; i += 8) {
  ------------------
  |  |   47|      0|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (543:19): [True: 0, False: 0]
  ------------------
  544|      0|        TRACEMS8(cinfo, 2, JTRC_QUANTVALS,
  ------------------
  |  |  307|      0|  MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
  |  |  ------------------
  |  |  |  |  261|      0|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  308|      0|           _mp[0] = (p1);  _mp[1] = (p2);  _mp[2] = (p3);  _mp[3] = (p4); \
  |  |  309|      0|           _mp[4] = (p5);  _mp[5] = (p6);  _mp[6] = (p7);  _mp[7] = (p8); \
  |  |  310|      0|           (cinfo)->err->msg_code = (code); \
  |  |  311|      0|           (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
  ------------------
  545|      0|                 quant_ptr->quantval[i],     quant_ptr->quantval[i + 1],
  546|      0|                 quant_ptr->quantval[i + 2], quant_ptr->quantval[i + 3],
  547|      0|                 quant_ptr->quantval[i + 4], quant_ptr->quantval[i + 5],
  548|      0|                 quant_ptr->quantval[i + 6], quant_ptr->quantval[i + 7]);
  549|      0|      }
  550|      0|    }
  551|       |
  552|  11.1k|    length -= DCTSIZE2 + 1;
  ------------------
  |  |   47|  11.1k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  553|  11.1k|    if (prec) length -= DCTSIZE2;
  ------------------
  |  |   47|    517|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (553:9): [True: 517, False: 10.6k]
  ------------------
  554|  11.1k|  }
  555|       |
  556|  10.7k|  if (length != 0)
  ------------------
  |  Branch (556:7): [True: 34, False: 10.7k]
  ------------------
  557|     34|    ERREXIT(cinfo, JERR_BAD_LENGTH);
  ------------------
  |  |  231|     34|  ((cinfo)->err->msg_code = (code), \
  |  |  232|     34|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  558|       |
  559|  10.7k|  INPUT_SYNC(cinfo);
  ------------------
  |  |  129|  10.7k|  ( datasrc->next_input_byte = next_input_byte, \
  |  |  130|  10.7k|    datasrc->bytes_in_buffer = bytes_in_buffer )
  ------------------
  560|  10.7k|  return TRUE;
  ------------------
  |  |  248|  10.7k|#define TRUE    1
  ------------------
  561|  10.7k|}
jdmarker.c:get_dri:
  567|  1.83k|{
  568|  1.83k|  JLONG length;
  569|  1.83k|  unsigned int tmp;
  570|  1.83k|  INPUT_VARS(cinfo);
  ------------------
  |  |  123|  1.83k|  struct jpeg_source_mgr *datasrc = (cinfo)->src; \
  |  |  124|  1.83k|  const JOCTET *next_input_byte = datasrc->next_input_byte; \
  |  |  125|  1.83k|  size_t bytes_in_buffer = datasrc->bytes_in_buffer
  ------------------
  571|       |
  572|  1.83k|  INPUT_2BYTES(cinfo, length, return FALSE);
  ------------------
  |  |  160|  1.83k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  3.71k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 5]
  |  |  |  |  |  Branch (261:38): [True: 5, False: 1.82k]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 11]
  |  |  |  |  |  Branch (261:38): [True: 11, False: 1.82k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  161|  1.83k|            bytes_in_buffer--; \
  |  |  162|  1.83k|            V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
  |  |  163|  1.83k|            MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  164|  1.83k|            bytes_in_buffer--; \
  |  |  165|  1.83k|            V += GETJOCTET(*next_input_byte++); )
  ------------------
  573|       |
  574|  1.83k|  if (length != 4)
  ------------------
  |  Branch (574:7): [True: 30, False: 1.80k]
  ------------------
  575|     30|    ERREXIT(cinfo, JERR_BAD_LENGTH);
  ------------------
  |  |  231|     30|  ((cinfo)->err->msg_code = (code), \
  |  |  232|     30|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  576|       |
  577|  1.83k|  INPUT_2BYTES(cinfo, tmp, return FALSE);
  ------------------
  |  |  160|  1.83k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  3.70k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 4]
  |  |  |  |  |  Branch (261:38): [True: 4, False: 1.83k]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 7]
  |  |  |  |  |  Branch (261:38): [True: 7, False: 1.82k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  161|  1.83k|            bytes_in_buffer--; \
  |  |  162|  1.83k|            V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
  |  |  163|  1.83k|            MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  164|  1.83k|            bytes_in_buffer--; \
  |  |  165|  1.83k|            V += GETJOCTET(*next_input_byte++); )
  ------------------
  578|       |
  579|  1.83k|  TRACEMS1(cinfo, 1, JTRC_DRI, tmp);
  ------------------
  |  |  282|  1.83k|  ((cinfo)->err->msg_code = (code), \
  |  |  283|  1.83k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  284|  1.83k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  580|       |
  581|  1.83k|  cinfo->restart_interval = tmp;
  582|       |
  583|  1.83k|  INPUT_SYNC(cinfo);
  ------------------
  |  |  129|  1.83k|  ( datasrc->next_input_byte = next_input_byte, \
  |  |  130|  1.83k|    datasrc->bytes_in_buffer = bytes_in_buffer )
  ------------------
  584|  1.83k|  return TRUE;
  ------------------
  |  |  248|  1.83k|#define TRUE    1
  ------------------
  585|  1.83k|}
jdmarker.c:read_restart_marker:
 1131|  1.08M|{
 1132|       |  /* Obtain a marker unless we already did. */
 1133|       |  /* Note that next_marker will complain if it skips any data. */
 1134|  1.08M|  if (cinfo->unread_marker == 0) {
  ------------------
  |  Branch (1134:7): [True: 2.27k, False: 1.07M]
  ------------------
 1135|  2.27k|    if (!next_marker(cinfo))
  ------------------
  |  Branch (1135:9): [True: 0, False: 2.27k]
  ------------------
 1136|      0|      return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
 1137|  2.27k|  }
 1138|       |
 1139|  1.08M|  if (cinfo->unread_marker ==
  ------------------
  |  Branch (1139:7): [True: 3.53k, False: 1.07M]
  ------------------
 1140|  1.08M|      ((int)M_RST0 + cinfo->marker->next_restart_num)) {
 1141|       |    /* Normal case --- swallow the marker and let entropy decoder continue */
 1142|  3.53k|    TRACEMS1(cinfo, 3, JTRC_RST, cinfo->marker->next_restart_num);
  ------------------
  |  |  282|  3.53k|  ((cinfo)->err->msg_code = (code), \
  |  |  283|  3.53k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  284|  3.53k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
 1143|  3.53k|    cinfo->unread_marker = 0;
 1144|  1.07M|  } else {
 1145|       |    /* Uh-oh, the restart markers have been messed up. */
 1146|       |    /* Let the data source manager determine how to resync. */
 1147|  1.07M|    if (!(*cinfo->src->resync_to_restart) (cinfo,
  ------------------
  |  Branch (1147:9): [True: 0, False: 1.07M]
  ------------------
 1148|  1.07M|                                           cinfo->marker->next_restart_num))
 1149|      0|      return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
 1150|  1.07M|  }
 1151|       |
 1152|       |  /* Update next-restart state */
 1153|  1.08M|  cinfo->marker->next_restart_num = (cinfo->marker->next_restart_num + 1) & 7;
 1154|       |
 1155|  1.08M|  return TRUE;
  ------------------
  |  |  248|  1.08M|#define TRUE    1
  ------------------
 1156|  1.08M|}
jdmarker.c:skip_variable:
  864|  7.36k|{
  865|  7.36k|  JLONG length;
  866|  7.36k|  INPUT_VARS(cinfo);
  ------------------
  |  |  123|  7.36k|  struct jpeg_source_mgr *datasrc = (cinfo)->src; \
  |  |  124|  7.36k|  const JOCTET *next_input_byte = datasrc->next_input_byte; \
  |  |  125|  7.36k|  size_t bytes_in_buffer = datasrc->bytes_in_buffer
  ------------------
  867|       |
  868|  7.36k|  INPUT_2BYTES(cinfo, length, return FALSE);
  ------------------
  |  |  160|  7.36k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  15.0k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 98]
  |  |  |  |  |  Branch (261:38): [True: 98, False: 7.26k]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 19]
  |  |  |  |  |  Branch (261:38): [True: 19, False: 7.34k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  161|  7.36k|            bytes_in_buffer--; \
  |  |  162|  7.36k|            V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
  |  |  163|  7.36k|            MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  164|  7.36k|            bytes_in_buffer--; \
  |  |  165|  7.36k|            V += GETJOCTET(*next_input_byte++); )
  ------------------
  869|  7.36k|  length -= 2;
  870|       |
  871|  7.36k|  TRACEMS2(cinfo, 1, JTRC_MISC_MARKER, cinfo->unread_marker, (int)length);
  ------------------
  |  |  286|  7.36k|  ((cinfo)->err->msg_code = (code), \
  |  |  287|  7.36k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  288|  7.36k|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  289|  7.36k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  872|       |
  873|  7.36k|  INPUT_SYNC(cinfo);            /* do before skip_input_data */
  ------------------
  |  |  129|  7.36k|  ( datasrc->next_input_byte = next_input_byte, \
  |  |  130|  7.36k|    datasrc->bytes_in_buffer = bytes_in_buffer )
  ------------------
  874|  7.36k|  if (length > 0)
  ------------------
  |  Branch (874:7): [True: 3.85k, False: 3.51k]
  ------------------
  875|  3.85k|    (*cinfo->src->skip_input_data) (cinfo, (long)length);
  876|       |
  877|  7.36k|  return TRUE;
  ------------------
  |  |  248|  7.36k|#define TRUE    1
  ------------------
  878|  7.36k|}
jdmarker.c:get_interesting_appn:
  710|  8.38k|{
  711|  8.38k|  JLONG length;
  712|  8.38k|  JOCTET b[APPN_DATA_LEN];
  713|  8.38k|  unsigned int i, numtoread;
  714|  8.38k|  INPUT_VARS(cinfo);
  ------------------
  |  |  123|  8.38k|  struct jpeg_source_mgr *datasrc = (cinfo)->src; \
  |  |  124|  8.38k|  const JOCTET *next_input_byte = datasrc->next_input_byte; \
  |  |  125|  8.38k|  size_t bytes_in_buffer = datasrc->bytes_in_buffer
  ------------------
  715|       |
  716|  8.38k|  INPUT_2BYTES(cinfo, length, return FALSE);
  ------------------
  |  |  160|  8.38k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|  16.8k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 25]
  |  |  |  |  |  Branch (261:38): [True: 25, False: 8.35k]
  |  |  |  |  |  Branch (261:38): [True: 0, False: 13]
  |  |  |  |  |  Branch (261:38): [True: 13, False: 8.36k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  161|  8.38k|            bytes_in_buffer--; \
  |  |  162|  8.38k|            V = ((unsigned int)GETJOCTET(*next_input_byte++)) << 8; \
  |  |  163|  8.38k|            MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  164|  8.38k|            bytes_in_buffer--; \
  |  |  165|  8.38k|            V += GETJOCTET(*next_input_byte++); )
  ------------------
  717|  8.38k|  length -= 2;
  718|       |
  719|       |  /* get the interesting part of the marker data */
  720|  8.38k|  if (length >= APPN_DATA_LEN)
  ------------------
  |  |  597|  8.38k|#define APPN_DATA_LEN   14      /* Must be the largest of the above!! */
  ------------------
  |  Branch (720:7): [True: 6.70k, False: 1.67k]
  ------------------
  721|  6.70k|    numtoread = APPN_DATA_LEN;
  ------------------
  |  |  597|  6.70k|#define APPN_DATA_LEN   14      /* Must be the largest of the above!! */
  ------------------
  722|  1.67k|  else if (length > 0)
  ------------------
  |  Branch (722:12): [True: 1.20k, False: 472]
  ------------------
  723|  1.20k|    numtoread = (unsigned int)length;
  724|    472|  else
  725|    472|    numtoread = 0;
  726|   110k|  for (i = 0; i < numtoread; i++)
  ------------------
  |  Branch (726:15): [True: 102k, False: 8.38k]
  ------------------
  727|   102k|    INPUT_BYTE(cinfo, b[i], return FALSE);
  ------------------
  |  |  152|   102k|  MAKESTMT( MAKE_BYTE_AVAIL(cinfo, action); \
  |  |  ------------------
  |  |  |  |  261|   110k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:38): [True: 0, False: 1.36k]
  |  |  |  |  |  Branch (261:38): [True: 1.36k, False: 100k]
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  153|  8.38k|            bytes_in_buffer--; \
  |  |  154|  8.38k|            V = GETJOCTET(*next_input_byte++); )
  ------------------
  728|  8.38k|  length -= numtoread;
  729|       |
  730|       |  /* process it */
  731|  8.38k|  switch (cinfo->unread_marker) {
  732|  5.48k|  case M_APP0:
  ------------------
  |  Branch (732:3): [True: 5.48k, False: 2.89k]
  ------------------
  733|  5.48k|    examine_app0(cinfo, (JOCTET *)b, numtoread, length);
  734|  5.48k|    break;
  735|  2.89k|  case M_APP14:
  ------------------
  |  Branch (735:3): [True: 2.89k, False: 5.48k]
  ------------------
  736|  2.89k|    examine_app14(cinfo, (JOCTET *)b, numtoread, length);
  737|  2.89k|    break;
  738|      0|  default:
  ------------------
  |  Branch (738:3): [True: 0, False: 8.38k]
  ------------------
  739|       |    /* can't get here unless jpeg_save_markers chooses wrong processor */
  740|      0|    ERREXIT1(cinfo, JERR_UNKNOWN_MARKER, cinfo->unread_marker);
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  741|      0|    break;
  742|  8.38k|  }
  743|       |
  744|       |  /* skip any remaining data -- could be lots */
  745|  8.38k|  INPUT_SYNC(cinfo);
  ------------------
  |  |  129|  8.38k|  ( datasrc->next_input_byte = next_input_byte, \
  |  |  130|  8.38k|    datasrc->bytes_in_buffer = bytes_in_buffer )
  ------------------
  746|  8.38k|  if (length > 0)
  ------------------
  |  Branch (746:7): [True: 534, False: 7.84k]
  ------------------
  747|    534|    (*cinfo->src->skip_input_data) (cinfo, (long)length);
  748|       |
  749|  8.38k|  return TRUE;
  ------------------
  |  |  248|  8.38k|#define TRUE    1
  ------------------
  750|  8.38k|}
jdmarker.c:examine_app0:
  607|  5.48k|{
  608|  5.48k|  JLONG totallen = (JLONG)datalen + remaining;
  609|       |
  610|  5.48k|  if (datalen >= APP0_DATA_LEN &&
  ------------------
  |  |  595|  10.9k|#define APP0_DATA_LEN   14      /* Length of interesting data in APP0 */
  ------------------
  |  Branch (610:7): [True: 4.33k, False: 1.15k]
  ------------------
  611|  5.48k|      GETJOCTET(data[0]) == 0x4A &&
  ------------------
  |  |  103|  4.33k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (611:7): [True: 3.87k, False: 460]
  ------------------
  612|  5.48k|      GETJOCTET(data[1]) == 0x46 &&
  ------------------
  |  |  103|  3.87k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (612:7): [True: 3.61k, False: 257]
  ------------------
  613|  5.48k|      GETJOCTET(data[2]) == 0x49 &&
  ------------------
  |  |  103|  3.61k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (613:7): [True: 1.97k, False: 1.64k]
  ------------------
  614|  5.48k|      GETJOCTET(data[3]) == 0x46 &&
  ------------------
  |  |  103|  1.97k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (614:7): [True: 1.30k, False: 667]
  ------------------
  615|  5.48k|      GETJOCTET(data[4]) == 0) {
  ------------------
  |  |  103|  1.30k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (615:7): [True: 1.08k, False: 227]
  ------------------
  616|       |    /* Found JFIF APP0 marker: save info */
  617|  1.08k|    cinfo->saw_JFIF_marker = TRUE;
  ------------------
  |  |  248|  1.08k|#define TRUE    1
  ------------------
  618|  1.08k|    cinfo->JFIF_major_version = GETJOCTET(data[5]);
  ------------------
  |  |  103|  1.08k|#define GETJOCTET(value)  (value)
  ------------------
  619|  1.08k|    cinfo->JFIF_minor_version = GETJOCTET(data[6]);
  ------------------
  |  |  103|  1.08k|#define GETJOCTET(value)  (value)
  ------------------
  620|  1.08k|    cinfo->density_unit = GETJOCTET(data[7]);
  ------------------
  |  |  103|  1.08k|#define GETJOCTET(value)  (value)
  ------------------
  621|  1.08k|    cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);
  ------------------
  |  |  103|  1.08k|#define GETJOCTET(value)  (value)
  ------------------
                  cinfo->X_density = (GETJOCTET(data[8]) << 8) + GETJOCTET(data[9]);
  ------------------
  |  |  103|  1.08k|#define GETJOCTET(value)  (value)
  ------------------
  622|  1.08k|    cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);
  ------------------
  |  |  103|  1.08k|#define GETJOCTET(value)  (value)
  ------------------
                  cinfo->Y_density = (GETJOCTET(data[10]) << 8) + GETJOCTET(data[11]);
  ------------------
  |  |  103|  1.08k|#define GETJOCTET(value)  (value)
  ------------------
  623|       |    /* Check version.
  624|       |     * Major version must be 1, anything else signals an incompatible change.
  625|       |     * (We used to treat this as an error, but now it's a nonfatal warning,
  626|       |     * because some bozo at Hijaak couldn't read the spec.)
  627|       |     * Minor version should be 0..2, but process anyway if newer.
  628|       |     */
  629|  1.08k|    if (cinfo->JFIF_major_version != 1)
  ------------------
  |  Branch (629:9): [True: 331, False: 751]
  ------------------
  630|    331|      WARNMS2(cinfo, JWRN_JFIF_MAJOR,
  ------------------
  |  |  272|    331|  ((cinfo)->err->msg_code = (code), \
  |  |  273|    331|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  274|    331|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  275|    331|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  631|  1.08k|              cinfo->JFIF_major_version, cinfo->JFIF_minor_version);
  632|       |    /* Generate trace messages */
  633|  1.08k|    TRACEMS5(cinfo, 1, JTRC_JFIF,
  ------------------
  |  |  301|  1.08k|  MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
  |  |  ------------------
  |  |  |  |  261|  1.08k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  302|  1.08k|           _mp[0] = (p1);  _mp[1] = (p2);  _mp[2] = (p3);  _mp[3] = (p4); \
  |  |  303|  1.08k|           _mp[4] = (p5); \
  |  |  304|  1.08k|           (cinfo)->err->msg_code = (code); \
  |  |  305|  1.08k|           (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
  ------------------
  634|  1.08k|             cinfo->JFIF_major_version, cinfo->JFIF_minor_version,
  635|  1.08k|             cinfo->X_density, cinfo->Y_density, cinfo->density_unit);
  636|       |    /* Validate thumbnail dimensions and issue appropriate messages */
  637|  1.08k|    if (GETJOCTET(data[12]) | GETJOCTET(data[13]))
  ------------------
  |  |  103|  1.08k|#define GETJOCTET(value)  (value)
  ------------------
                  if (GETJOCTET(data[12]) | GETJOCTET(data[13]))
  ------------------
  |  |  103|  1.08k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (637:9): [True: 551, False: 531]
  ------------------
  638|    551|      TRACEMS2(cinfo, 1, JTRC_JFIF_THUMBNAIL,
  ------------------
  |  |  286|    551|  ((cinfo)->err->msg_code = (code), \
  |  |  287|    551|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  288|    551|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  289|    551|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  639|  1.08k|               GETJOCTET(data[12]), GETJOCTET(data[13]));
  640|  1.08k|    totallen -= APP0_DATA_LEN;
  ------------------
  |  |  595|  1.08k|#define APP0_DATA_LEN   14      /* Length of interesting data in APP0 */
  ------------------
  641|  1.08k|    if (totallen !=
  ------------------
  |  Branch (641:9): [True: 339, False: 743]
  ------------------
  642|  1.08k|        ((JLONG)GETJOCTET(data[12]) * (JLONG)GETJOCTET(data[13]) * (JLONG)3))
  ------------------
  |  |  103|  1.08k|#define GETJOCTET(value)  (value)
  ------------------
                      ((JLONG)GETJOCTET(data[12]) * (JLONG)GETJOCTET(data[13]) * (JLONG)3))
  ------------------
  |  |  103|  1.08k|#define GETJOCTET(value)  (value)
  ------------------
  643|    339|      TRACEMS1(cinfo, 1, JTRC_JFIF_BADTHUMBNAILSIZE, (int)totallen);
  ------------------
  |  |  282|    339|  ((cinfo)->err->msg_code = (code), \
  |  |  283|    339|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  284|    339|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  644|  4.40k|  } else if (datalen >= 6 &&
  ------------------
  |  Branch (644:14): [True: 3.96k, False: 438]
  ------------------
  645|  4.40k|             GETJOCTET(data[0]) == 0x4A &&
  ------------------
  |  |  103|  3.96k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (645:14): [True: 3.46k, False: 497]
  ------------------
  646|  4.40k|             GETJOCTET(data[1]) == 0x46 &&
  ------------------
  |  |  103|  3.46k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (646:14): [True: 2.74k, False: 725]
  ------------------
  647|  4.40k|             GETJOCTET(data[2]) == 0x58 &&
  ------------------
  |  |  103|  2.74k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (647:14): [True: 1.79k, False: 951]
  ------------------
  648|  4.40k|             GETJOCTET(data[3]) == 0x58 &&
  ------------------
  |  |  103|  1.79k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (648:14): [True: 1.55k, False: 242]
  ------------------
  649|  4.40k|             GETJOCTET(data[4]) == 0) {
  ------------------
  |  |  103|  1.55k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (649:14): [True: 1.19k, False: 359]
  ------------------
  650|       |    /* Found JFIF "JFXX" extension APP0 marker */
  651|       |    /* The library doesn't actually do anything with these,
  652|       |     * but we try to produce a helpful trace message.
  653|       |     */
  654|  1.19k|    switch (GETJOCTET(data[5])) {
  ------------------
  |  |  103|  1.19k|#define GETJOCTET(value)  (value)
  ------------------
  655|    195|    case 0x10:
  ------------------
  |  Branch (655:5): [True: 195, False: 997]
  ------------------
  656|    195|      TRACEMS1(cinfo, 1, JTRC_THUMB_JPEG, (int)totallen);
  ------------------
  |  |  282|    195|  ((cinfo)->err->msg_code = (code), \
  |  |  283|    195|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  284|    195|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  657|    195|      break;
  658|    194|    case 0x11:
  ------------------
  |  Branch (658:5): [True: 194, False: 998]
  ------------------
  659|    194|      TRACEMS1(cinfo, 1, JTRC_THUMB_PALETTE, (int)totallen);
  ------------------
  |  |  282|    194|  ((cinfo)->err->msg_code = (code), \
  |  |  283|    194|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  284|    194|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  660|    194|      break;
  661|    194|    case 0x13:
  ------------------
  |  Branch (661:5): [True: 194, False: 998]
  ------------------
  662|    194|      TRACEMS1(cinfo, 1, JTRC_THUMB_RGB, (int)totallen);
  ------------------
  |  |  282|    194|  ((cinfo)->err->msg_code = (code), \
  |  |  283|    194|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  284|    194|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  663|    194|      break;
  664|    609|    default:
  ------------------
  |  Branch (664:5): [True: 609, False: 583]
  ------------------
  665|    609|      TRACEMS2(cinfo, 1, JTRC_JFIF_EXTENSION,
  ------------------
  |  |  286|    609|  ((cinfo)->err->msg_code = (code), \
  |  |  287|    609|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  288|    609|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  289|    609|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  666|    609|               GETJOCTET(data[5]), (int)totallen);
  667|    609|      break;
  668|  1.19k|    }
  669|  3.21k|  } else {
  670|       |    /* Start of APP0 does not match "JFIF" or "JFXX", or too short */
  671|  3.21k|    TRACEMS1(cinfo, 1, JTRC_APP0, (int)totallen);
  ------------------
  |  |  282|  3.21k|  ((cinfo)->err->msg_code = (code), \
  |  |  283|  3.21k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  284|  3.21k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  672|  3.21k|  }
  673|  5.48k|}
jdmarker.c:examine_app14:
  683|  2.89k|{
  684|  2.89k|  unsigned int version, flags0, flags1, transform;
  685|       |
  686|  2.89k|  if (datalen >= APP14_DATA_LEN &&
  ------------------
  |  |  596|  5.79k|#define APP14_DATA_LEN  12      /* Length of interesting data in APP14 */
  ------------------
  |  Branch (686:7): [True: 2.64k, False: 251]
  ------------------
  687|  2.89k|      GETJOCTET(data[0]) == 0x41 &&
  ------------------
  |  |  103|  2.64k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (687:7): [True: 2.33k, False: 312]
  ------------------
  688|  2.89k|      GETJOCTET(data[1]) == 0x64 &&
  ------------------
  |  |  103|  2.33k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (688:7): [True: 2.10k, False: 232]
  ------------------
  689|  2.89k|      GETJOCTET(data[2]) == 0x6F &&
  ------------------
  |  |  103|  2.10k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (689:7): [True: 1.89k, False: 207]
  ------------------
  690|  2.89k|      GETJOCTET(data[3]) == 0x62 &&
  ------------------
  |  |  103|  1.89k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (690:7): [True: 1.64k, False: 247]
  ------------------
  691|  2.89k|      GETJOCTET(data[4]) == 0x65) {
  ------------------
  |  |  103|  1.64k|#define GETJOCTET(value)  (value)
  ------------------
  |  Branch (691:7): [True: 1.43k, False: 208]
  ------------------
  692|       |    /* Found Adobe APP14 marker */
  693|  1.43k|    version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);
  ------------------
  |  |  103|  1.43k|#define GETJOCTET(value)  (value)
  ------------------
                  version = (GETJOCTET(data[5]) << 8) + GETJOCTET(data[6]);
  ------------------
  |  |  103|  1.43k|#define GETJOCTET(value)  (value)
  ------------------
  694|  1.43k|    flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);
  ------------------
  |  |  103|  1.43k|#define GETJOCTET(value)  (value)
  ------------------
                  flags0 = (GETJOCTET(data[7]) << 8) + GETJOCTET(data[8]);
  ------------------
  |  |  103|  1.43k|#define GETJOCTET(value)  (value)
  ------------------
  695|  1.43k|    flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);
  ------------------
  |  |  103|  1.43k|#define GETJOCTET(value)  (value)
  ------------------
                  flags1 = (GETJOCTET(data[9]) << 8) + GETJOCTET(data[10]);
  ------------------
  |  |  103|  1.43k|#define GETJOCTET(value)  (value)
  ------------------
  696|  1.43k|    transform = GETJOCTET(data[11]);
  ------------------
  |  |  103|  1.43k|#define GETJOCTET(value)  (value)
  ------------------
  697|  1.43k|    TRACEMS4(cinfo, 1, JTRC_ADOBE, version, flags0, flags1, transform);
  ------------------
  |  |  296|  1.43k|  MAKESTMT(int *_mp = (cinfo)->err->msg_parm.i; \
  |  |  ------------------
  |  |  |  |  261|  1.43k|#define MAKESTMT(stuff)         do { stuff } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (261:53): [Folded - Ignored]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  297|  1.43k|           _mp[0] = (p1);  _mp[1] = (p2);  _mp[2] = (p3);  _mp[3] = (p4); \
  |  |  298|  1.43k|           (cinfo)->err->msg_code = (code); \
  |  |  299|  1.43k|           (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)); )
  ------------------
  698|  1.43k|    cinfo->saw_Adobe_marker = TRUE;
  ------------------
  |  |  248|  1.43k|#define TRUE    1
  ------------------
  699|  1.43k|    cinfo->Adobe_transform = (UINT8)transform;
  700|  1.45k|  } else {
  701|       |    /* Start of APP14 does not match "Adobe", or too short */
  702|  1.45k|    TRACEMS1(cinfo, 1, JTRC_APP14, (int)(datalen + remaining));
  ------------------
  |  |  282|  1.45k|  ((cinfo)->err->msg_code = (code), \
  |  |  283|  1.45k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  284|  1.45k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), (lvl)))
  ------------------
  703|  1.45k|  }
  704|  2.89k|}

jpeg_calc_output_dimensions:
  273|  5.08k|{
  274|  5.08k|#ifdef IDCT_SCALING_SUPPORTED
  275|  5.08k|  int ci;
  276|  5.08k|  jpeg_component_info *compptr;
  277|  5.08k|#endif
  278|       |
  279|       |  /* Prevent application from calling me at wrong times */
  280|  5.08k|  if (cinfo->global_state != DSTATE_READY)
  ------------------
  |  |   36|  5.08k|#define DSTATE_READY     202    /* found SOS, ready for start_decompress */
  ------------------
  |  Branch (280:7): [True: 0, False: 5.08k]
  ------------------
  281|      0|    ERREXIT1(cinfo, JERR_BAD_STATE, cinfo->global_state);
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  282|       |
  283|       |  /* Compute core output image dimensions and DCT scaling choices. */
  284|  5.08k|  jpeg_core_output_dimensions(cinfo);
  285|       |
  286|  5.08k|#ifdef IDCT_SCALING_SUPPORTED
  287|       |
  288|       |  /* In selecting the actual DCT scaling for each component, we try to
  289|       |   * scale up the chroma components via IDCT scaling rather than upsampling.
  290|       |   * This saves time if the upsampler gets to use 1:1 scaling.
  291|       |   * Note this code adapts subsampling ratios which are powers of 2.
  292|       |   */
  293|  15.6k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (293:44): [True: 10.5k, False: 5.08k]
  ------------------
  294|  10.5k|       ci++, compptr++) {
  295|  10.5k|    int ssize = cinfo->_min_DCT_scaled_size;
  ------------------
  |  |   27|  10.5k|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  296|  10.7k|    while (ssize < DCTSIZE &&
  ------------------
  |  |   46|  21.5k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (296:12): [True: 1.16k, False: 9.59k]
  ------------------
  297|  10.7k|           ((cinfo->max_h_samp_factor * cinfo->_min_DCT_scaled_size) %
  ------------------
  |  |   27|  1.16k|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  |  Branch (297:12): [True: 355, False: 811]
  ------------------
  298|  1.16k|            (compptr->h_samp_factor * ssize * 2) == 0) &&
  299|  10.7k|           ((cinfo->max_v_samp_factor * cinfo->_min_DCT_scaled_size) %
  ------------------
  |  |   27|    355|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  |  Branch (299:12): [True: 168, False: 187]
  ------------------
  300|    355|            (compptr->v_samp_factor * ssize * 2) == 0)) {
  301|    168|      ssize = ssize * 2;
  302|    168|    }
  303|       |#if JPEG_LIB_VERSION >= 70
  304|       |    compptr->DCT_h_scaled_size = compptr->DCT_v_scaled_size = ssize;
  305|       |#else
  306|  10.5k|    compptr->DCT_scaled_size = ssize;
  307|  10.5k|#endif
  308|  10.5k|  }
  309|       |
  310|       |  /* Recompute downsampled dimensions of components;
  311|       |   * application needs to know these if using raw downsampled data.
  312|       |   */
  313|  15.6k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (313:44): [True: 10.5k, False: 5.08k]
  ------------------
  314|  10.5k|       ci++, compptr++) {
  315|       |    /* Size in samples, after IDCT scaling */
  316|  10.5k|    compptr->downsampled_width = (JDIMENSION)
  317|  10.5k|      jdiv_round_up((long)cinfo->image_width *
  318|  10.5k|                    (long)(compptr->h_samp_factor * compptr->_DCT_scaled_size),
  ------------------
  |  |   24|  10.5k|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  319|  10.5k|                    (long)(cinfo->max_h_samp_factor * DCTSIZE));
  ------------------
  |  |   46|  10.5k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  320|  10.5k|    compptr->downsampled_height = (JDIMENSION)
  321|  10.5k|      jdiv_round_up((long)cinfo->image_height *
  322|  10.5k|                    (long)(compptr->v_samp_factor * compptr->_DCT_scaled_size),
  ------------------
  |  |   24|  10.5k|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  323|  10.5k|                    (long)(cinfo->max_v_samp_factor * DCTSIZE));
  ------------------
  |  |   46|  10.5k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  324|  10.5k|  }
  325|       |
  326|       |#else /* !IDCT_SCALING_SUPPORTED */
  327|       |
  328|       |  /* Hardwire it to "no scaling" */
  329|       |  cinfo->output_width = cinfo->image_width;
  330|       |  cinfo->output_height = cinfo->image_height;
  331|       |  /* jdinput.c has already initialized DCT_scaled_size to DCTSIZE,
  332|       |   * and has computed unscaled downsampled_width and downsampled_height.
  333|       |   */
  334|       |
  335|       |#endif /* IDCT_SCALING_SUPPORTED */
  336|       |
  337|       |  /* Report number of components in selected colorspace. */
  338|       |  /* Probably this should be in the color conversion module... */
  339|  5.08k|  switch (cinfo->out_color_space) {
  340|    446|  case JCS_GRAYSCALE:
  ------------------
  |  Branch (340:3): [True: 446, False: 4.63k]
  ------------------
  341|    446|    cinfo->out_color_components = 1;
  342|    446|    break;
  343|      0|  case JCS_RGB:
  ------------------
  |  Branch (343:3): [True: 0, False: 5.08k]
  ------------------
  344|  3.73k|  case JCS_EXT_RGB:
  ------------------
  |  Branch (344:3): [True: 3.73k, False: 1.34k]
  ------------------
  345|  3.73k|  case JCS_EXT_RGBX:
  ------------------
  |  Branch (345:3): [True: 0, False: 5.08k]
  ------------------
  346|  3.73k|  case JCS_EXT_BGR:
  ------------------
  |  Branch (346:3): [True: 0, False: 5.08k]
  ------------------
  347|  4.19k|  case JCS_EXT_BGRX:
  ------------------
  |  Branch (347:3): [True: 453, False: 4.63k]
  ------------------
  348|  4.19k|  case JCS_EXT_XBGR:
  ------------------
  |  Branch (348:3): [True: 0, False: 5.08k]
  ------------------
  349|  4.19k|  case JCS_EXT_XRGB:
  ------------------
  |  Branch (349:3): [True: 0, False: 5.08k]
  ------------------
  350|  4.19k|  case JCS_EXT_RGBA:
  ------------------
  |  Branch (350:3): [True: 0, False: 5.08k]
  ------------------
  351|  4.19k|  case JCS_EXT_BGRA:
  ------------------
  |  Branch (351:3): [True: 0, False: 5.08k]
  ------------------
  352|  4.19k|  case JCS_EXT_ABGR:
  ------------------
  |  Branch (352:3): [True: 0, False: 5.08k]
  ------------------
  353|  4.19k|  case JCS_EXT_ARGB:
  ------------------
  |  Branch (353:3): [True: 0, False: 5.08k]
  ------------------
  354|  4.19k|    cinfo->out_color_components = rgb_pixelsize[cinfo->out_color_space];
  355|  4.19k|    break;
  356|      0|  case JCS_YCbCr:
  ------------------
  |  Branch (356:3): [True: 0, False: 5.08k]
  ------------------
  357|      0|  case JCS_RGB565:
  ------------------
  |  Branch (357:3): [True: 0, False: 5.08k]
  ------------------
  358|      0|    cinfo->out_color_components = 3;
  359|      0|    break;
  360|    446|  case JCS_CMYK:
  ------------------
  |  Branch (360:3): [True: 446, False: 4.63k]
  ------------------
  361|    446|  case JCS_YCCK:
  ------------------
  |  Branch (361:3): [True: 0, False: 5.08k]
  ------------------
  362|    446|    cinfo->out_color_components = 4;
  363|    446|    break;
  364|      0|  default:                      /* else must be same colorspace as in file */
  ------------------
  |  Branch (364:3): [True: 0, False: 5.08k]
  ------------------
  365|      0|    cinfo->out_color_components = cinfo->num_components;
  366|      0|    break;
  367|  5.08k|  }
  368|  5.08k|  cinfo->output_components = (cinfo->quantize_colors ? 1 :
  ------------------
  |  Branch (368:31): [True: 0, False: 5.08k]
  ------------------
  369|  5.08k|                              cinfo->out_color_components);
  370|       |
  371|       |  /* See if upsampler will want to emit more than one row at a time */
  372|  5.08k|  if (use_merged_upsample(cinfo))
  ------------------
  |  Branch (372:7): [True: 170, False: 4.91k]
  ------------------
  373|    170|    cinfo->rec_outbuf_height = cinfo->max_v_samp_factor;
  374|  4.91k|  else
  375|  4.91k|    cinfo->rec_outbuf_height = 1;
  376|  5.08k|}
jinit_master_decompress:
  728|  5.08k|{
  729|  5.08k|  my_master_ptr master = (my_master_ptr)cinfo->master;
  730|       |
  731|  5.08k|  master->pub.prepare_for_output_pass = prepare_for_output_pass;
  732|  5.08k|  master->pub.finish_output_pass = finish_output_pass;
  733|       |
  734|  5.08k|  master->pub.is_dummy_pass = FALSE;
  ------------------
  |  |  245|  5.08k|#define FALSE   0               /* values of boolean */
  ------------------
  735|  5.08k|  master->pub.jinit_upsampler_no_alloc = FALSE;
  ------------------
  |  |  245|  5.08k|#define FALSE   0               /* values of boolean */
  ------------------
  736|       |
  737|  5.08k|  master_selection(cinfo);
  738|  5.08k|}
jdmaster.c:jpeg_core_output_dimensions:
  107|  5.08k|{
  108|  5.08k|#ifdef IDCT_SCALING_SUPPORTED
  109|  5.08k|  int ci;
  110|  5.08k|  jpeg_component_info *compptr;
  111|       |
  112|       |  /* Compute actual output image dimensions and DCT scaling choices. */
  113|  5.08k|  if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom) {
  ------------------
  |  |   46|  5.08k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (113:7): [True: 0, False: 5.08k]
  ------------------
  114|       |    /* Provide 1/block_size scaling */
  115|      0|    cinfo->output_width = (JDIMENSION)
  116|      0|      jdiv_round_up((long)cinfo->image_width, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  117|      0|    cinfo->output_height = (JDIMENSION)
  118|      0|      jdiv_round_up((long)cinfo->image_height, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  119|      0|    cinfo->_min_DCT_h_scaled_size = 1;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  120|      0|    cinfo->_min_DCT_v_scaled_size = 1;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  121|  5.08k|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 2) {
  ------------------
  |  |   46|  5.08k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (121:14): [True: 0, False: 5.08k]
  ------------------
  122|       |    /* Provide 2/block_size scaling */
  123|      0|    cinfo->output_width = (JDIMENSION)
  124|      0|      jdiv_round_up((long)cinfo->image_width * 2L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  125|      0|    cinfo->output_height = (JDIMENSION)
  126|      0|      jdiv_round_up((long)cinfo->image_height * 2L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  127|      0|    cinfo->_min_DCT_h_scaled_size = 2;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  128|      0|    cinfo->_min_DCT_v_scaled_size = 2;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  129|  5.08k|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 3) {
  ------------------
  |  |   46|  5.08k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (129:14): [True: 0, False: 5.08k]
  ------------------
  130|       |    /* Provide 3/block_size scaling */
  131|      0|    cinfo->output_width = (JDIMENSION)
  132|      0|      jdiv_round_up((long)cinfo->image_width * 3L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  133|      0|    cinfo->output_height = (JDIMENSION)
  134|      0|      jdiv_round_up((long)cinfo->image_height * 3L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  135|      0|    cinfo->_min_DCT_h_scaled_size = 3;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  136|      0|    cinfo->_min_DCT_v_scaled_size = 3;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  137|  5.08k|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 4) {
  ------------------
  |  |   46|  5.08k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (137:14): [True: 433, False: 4.65k]
  ------------------
  138|       |    /* Provide 4/block_size scaling */
  139|    433|    cinfo->output_width = (JDIMENSION)
  140|    433|      jdiv_round_up((long)cinfo->image_width * 4L, (long)DCTSIZE);
  ------------------
  |  |   46|    433|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  141|    433|    cinfo->output_height = (JDIMENSION)
  142|    433|      jdiv_round_up((long)cinfo->image_height * 4L, (long)DCTSIZE);
  ------------------
  |  |   46|    433|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  143|    433|    cinfo->_min_DCT_h_scaled_size = 4;
  ------------------
  |  |   28|    433|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  144|    433|    cinfo->_min_DCT_v_scaled_size = 4;
  ------------------
  |  |   29|    433|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  145|  4.65k|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 5) {
  ------------------
  |  |   46|  4.65k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (145:14): [True: 13, False: 4.63k]
  ------------------
  146|       |    /* Provide 5/block_size scaling */
  147|     13|    cinfo->output_width = (JDIMENSION)
  148|     13|      jdiv_round_up((long)cinfo->image_width * 5L, (long)DCTSIZE);
  ------------------
  |  |   46|     13|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  149|     13|    cinfo->output_height = (JDIMENSION)
  150|     13|      jdiv_round_up((long)cinfo->image_height * 5L, (long)DCTSIZE);
  ------------------
  |  |   46|     13|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  151|     13|    cinfo->_min_DCT_h_scaled_size = 5;
  ------------------
  |  |   28|     13|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  152|     13|    cinfo->_min_DCT_v_scaled_size = 5;
  ------------------
  |  |   29|     13|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  153|  4.63k|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 6) {
  ------------------
  |  |   46|  4.63k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (153:14): [True: 0, False: 4.63k]
  ------------------
  154|       |    /* Provide 6/block_size scaling */
  155|      0|    cinfo->output_width = (JDIMENSION)
  156|      0|      jdiv_round_up((long)cinfo->image_width * 6L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  157|      0|    cinfo->output_height = (JDIMENSION)
  158|      0|      jdiv_round_up((long)cinfo->image_height * 6L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  159|      0|    cinfo->_min_DCT_h_scaled_size = 6;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  160|      0|    cinfo->_min_DCT_v_scaled_size = 6;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  161|  4.63k|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 7) {
  ------------------
  |  |   46|  4.63k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (161:14): [True: 0, False: 4.63k]
  ------------------
  162|       |    /* Provide 7/block_size scaling */
  163|      0|    cinfo->output_width = (JDIMENSION)
  164|      0|      jdiv_round_up((long)cinfo->image_width * 7L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  165|      0|    cinfo->output_height = (JDIMENSION)
  166|      0|      jdiv_round_up((long)cinfo->image_height * 7L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  167|      0|    cinfo->_min_DCT_h_scaled_size = 7;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  168|      0|    cinfo->_min_DCT_v_scaled_size = 7;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  169|  4.63k|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 8) {
  ------------------
  |  |   46|  4.63k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (169:14): [True: 4.63k, False: 0]
  ------------------
  170|       |    /* Provide 8/block_size scaling */
  171|  4.63k|    cinfo->output_width = (JDIMENSION)
  172|  4.63k|      jdiv_round_up((long)cinfo->image_width * 8L, (long)DCTSIZE);
  ------------------
  |  |   46|  4.63k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  173|  4.63k|    cinfo->output_height = (JDIMENSION)
  174|  4.63k|      jdiv_round_up((long)cinfo->image_height * 8L, (long)DCTSIZE);
  ------------------
  |  |   46|  4.63k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  175|  4.63k|    cinfo->_min_DCT_h_scaled_size = 8;
  ------------------
  |  |   28|  4.63k|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  176|  4.63k|    cinfo->_min_DCT_v_scaled_size = 8;
  ------------------
  |  |   29|  4.63k|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  177|  4.63k|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 9) {
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (177:14): [True: 0, False: 0]
  ------------------
  178|       |    /* Provide 9/block_size scaling */
  179|      0|    cinfo->output_width = (JDIMENSION)
  180|      0|      jdiv_round_up((long)cinfo->image_width * 9L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  181|      0|    cinfo->output_height = (JDIMENSION)
  182|      0|      jdiv_round_up((long)cinfo->image_height * 9L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  183|      0|    cinfo->_min_DCT_h_scaled_size = 9;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  184|      0|    cinfo->_min_DCT_v_scaled_size = 9;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  185|      0|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 10) {
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (185:14): [True: 0, False: 0]
  ------------------
  186|       |    /* Provide 10/block_size scaling */
  187|      0|    cinfo->output_width = (JDIMENSION)
  188|      0|      jdiv_round_up((long)cinfo->image_width * 10L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  189|      0|    cinfo->output_height = (JDIMENSION)
  190|      0|      jdiv_round_up((long)cinfo->image_height * 10L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  191|      0|    cinfo->_min_DCT_h_scaled_size = 10;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  192|      0|    cinfo->_min_DCT_v_scaled_size = 10;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  193|      0|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 11) {
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (193:14): [True: 0, False: 0]
  ------------------
  194|       |    /* Provide 11/block_size scaling */
  195|      0|    cinfo->output_width = (JDIMENSION)
  196|      0|      jdiv_round_up((long)cinfo->image_width * 11L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  197|      0|    cinfo->output_height = (JDIMENSION)
  198|      0|      jdiv_round_up((long)cinfo->image_height * 11L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  199|      0|    cinfo->_min_DCT_h_scaled_size = 11;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  200|      0|    cinfo->_min_DCT_v_scaled_size = 11;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  201|      0|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 12) {
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (201:14): [True: 0, False: 0]
  ------------------
  202|       |    /* Provide 12/block_size scaling */
  203|      0|    cinfo->output_width = (JDIMENSION)
  204|      0|      jdiv_round_up((long)cinfo->image_width * 12L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  205|      0|    cinfo->output_height = (JDIMENSION)
  206|      0|      jdiv_round_up((long)cinfo->image_height * 12L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  207|      0|    cinfo->_min_DCT_h_scaled_size = 12;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  208|      0|    cinfo->_min_DCT_v_scaled_size = 12;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  209|      0|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 13) {
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (209:14): [True: 0, False: 0]
  ------------------
  210|       |    /* Provide 13/block_size scaling */
  211|      0|    cinfo->output_width = (JDIMENSION)
  212|      0|      jdiv_round_up((long)cinfo->image_width * 13L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  213|      0|    cinfo->output_height = (JDIMENSION)
  214|      0|      jdiv_round_up((long)cinfo->image_height * 13L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  215|      0|    cinfo->_min_DCT_h_scaled_size = 13;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  216|      0|    cinfo->_min_DCT_v_scaled_size = 13;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  217|      0|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 14) {
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (217:14): [True: 0, False: 0]
  ------------------
  218|       |    /* Provide 14/block_size scaling */
  219|      0|    cinfo->output_width = (JDIMENSION)
  220|      0|      jdiv_round_up((long)cinfo->image_width * 14L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  221|      0|    cinfo->output_height = (JDIMENSION)
  222|      0|      jdiv_round_up((long)cinfo->image_height * 14L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  223|      0|    cinfo->_min_DCT_h_scaled_size = 14;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  224|      0|    cinfo->_min_DCT_v_scaled_size = 14;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  225|      0|  } else if (cinfo->scale_num * DCTSIZE <= cinfo->scale_denom * 15) {
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (225:14): [True: 0, False: 0]
  ------------------
  226|       |    /* Provide 15/block_size scaling */
  227|      0|    cinfo->output_width = (JDIMENSION)
  228|      0|      jdiv_round_up((long)cinfo->image_width * 15L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  229|      0|    cinfo->output_height = (JDIMENSION)
  230|      0|      jdiv_round_up((long)cinfo->image_height * 15L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  231|      0|    cinfo->_min_DCT_h_scaled_size = 15;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  232|      0|    cinfo->_min_DCT_v_scaled_size = 15;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  233|      0|  } else {
  234|       |    /* Provide 16/block_size scaling */
  235|      0|    cinfo->output_width = (JDIMENSION)
  236|      0|      jdiv_round_up((long)cinfo->image_width * 16L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  237|      0|    cinfo->output_height = (JDIMENSION)
  238|      0|      jdiv_round_up((long)cinfo->image_height * 16L, (long)DCTSIZE);
  ------------------
  |  |   46|      0|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  239|      0|    cinfo->_min_DCT_h_scaled_size = 16;
  ------------------
  |  |   28|      0|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  240|      0|    cinfo->_min_DCT_v_scaled_size = 16;
  ------------------
  |  |   29|      0|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  241|      0|  }
  242|       |
  243|       |  /* Recompute dimensions of components */
  244|  15.6k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (244:44): [True: 10.5k, False: 5.08k]
  ------------------
  245|  10.5k|       ci++, compptr++) {
  246|  10.5k|    compptr->_DCT_h_scaled_size = cinfo->_min_DCT_h_scaled_size;
  ------------------
  |  |   25|  10.5k|#define _DCT_h_scaled_size  DCT_scaled_size
  ------------------
                  compptr->_DCT_h_scaled_size = cinfo->_min_DCT_h_scaled_size;
  ------------------
  |  |   28|  10.5k|#define _min_DCT_h_scaled_size  min_DCT_scaled_size
  ------------------
  247|  10.5k|    compptr->_DCT_v_scaled_size = cinfo->_min_DCT_v_scaled_size;
  ------------------
  |  |   26|  10.5k|#define _DCT_v_scaled_size  DCT_scaled_size
  ------------------
                  compptr->_DCT_v_scaled_size = cinfo->_min_DCT_v_scaled_size;
  ------------------
  |  |   29|  10.5k|#define _min_DCT_v_scaled_size  min_DCT_scaled_size
  ------------------
  248|  10.5k|  }
  249|       |
  250|       |#else /* !IDCT_SCALING_SUPPORTED */
  251|       |
  252|       |  /* Hardwire it to "no scaling" */
  253|       |  cinfo->output_width = cinfo->image_width;
  254|       |  cinfo->output_height = cinfo->image_height;
  255|       |  /* jdinput.c has already initialized DCT_scaled_size,
  256|       |   * and has computed unscaled downsampled_width and downsampled_height.
  257|       |   */
  258|       |
  259|       |#endif /* IDCT_SCALING_SUPPORTED */
  260|  5.08k|}
jdmaster.c:use_merged_upsample:
   35|  10.1k|{
   36|  10.1k|#ifdef UPSAMPLE_MERGING_SUPPORTED
   37|       |  /* Merging is the equivalent of plain box-filter upsampling */
   38|  10.1k|  if (cinfo->do_fancy_upsampling || cinfo->CCIR601_sampling)
  ------------------
  |  Branch (38:7): [True: 2.69k, False: 7.47k]
  |  Branch (38:37): [True: 0, False: 7.47k]
  ------------------
   39|  2.69k|    return FALSE;
  ------------------
  |  |  245|  2.69k|#define FALSE   0               /* values of boolean */
  ------------------
   40|       |  /* jdmerge.c only supports YCC=>RGB and YCC=>RGB565 color conversion */
   41|  7.47k|  if (cinfo->jpeg_color_space != JCS_YCbCr || cinfo->num_components != 3 ||
  ------------------
  |  Branch (41:7): [True: 4.41k, False: 3.06k]
  |  Branch (41:47): [True: 0, False: 3.06k]
  ------------------
   42|  7.47k|      (cinfo->out_color_space != JCS_RGB &&
  ------------------
  |  Branch (42:8): [True: 3.06k, False: 0]
  ------------------
   43|  3.06k|       cinfo->out_color_space != JCS_RGB565 &&
  ------------------
  |  Branch (43:8): [True: 3.06k, False: 0]
  ------------------
   44|  3.06k|       cinfo->out_color_space != JCS_EXT_RGB &&
  ------------------
  |  Branch (44:8): [True: 0, False: 3.06k]
  ------------------
   45|  3.06k|       cinfo->out_color_space != JCS_EXT_RGBX &&
  ------------------
  |  Branch (45:8): [True: 0, False: 0]
  ------------------
   46|  3.06k|       cinfo->out_color_space != JCS_EXT_BGR &&
  ------------------
  |  Branch (46:8): [True: 0, False: 0]
  ------------------
   47|  3.06k|       cinfo->out_color_space != JCS_EXT_BGRX &&
  ------------------
  |  Branch (47:8): [True: 0, False: 0]
  ------------------
   48|  3.06k|       cinfo->out_color_space != JCS_EXT_XBGR &&
  ------------------
  |  Branch (48:8): [True: 0, False: 0]
  ------------------
   49|  3.06k|       cinfo->out_color_space != JCS_EXT_XRGB &&
  ------------------
  |  Branch (49:8): [True: 0, False: 0]
  ------------------
   50|  3.06k|       cinfo->out_color_space != JCS_EXT_RGBA &&
  ------------------
  |  Branch (50:8): [True: 0, False: 0]
  ------------------
   51|  3.06k|       cinfo->out_color_space != JCS_EXT_BGRA &&
  ------------------
  |  Branch (51:8): [True: 0, False: 0]
  ------------------
   52|  3.06k|       cinfo->out_color_space != JCS_EXT_ABGR &&
  ------------------
  |  Branch (52:8): [True: 0, False: 0]
  ------------------
   53|  3.06k|       cinfo->out_color_space != JCS_EXT_ARGB))
  ------------------
  |  Branch (53:8): [True: 0, False: 0]
  ------------------
   54|  4.41k|    return FALSE;
  ------------------
  |  |  245|  4.41k|#define FALSE   0               /* values of boolean */
  ------------------
   55|  3.06k|  if ((cinfo->out_color_space == JCS_RGB565 &&
  ------------------
  |  Branch (55:8): [True: 0, False: 3.06k]
  ------------------
   56|  3.06k|       cinfo->out_color_components != 3) ||
  ------------------
  |  Branch (56:8): [True: 0, False: 0]
  ------------------
   57|  3.06k|      (cinfo->out_color_space != JCS_RGB565 &&
  ------------------
  |  Branch (57:8): [True: 3.06k, False: 0]
  ------------------
   58|  3.06k|       cinfo->out_color_components != rgb_pixelsize[cinfo->out_color_space]))
  ------------------
  |  Branch (58:8): [True: 0, False: 3.06k]
  ------------------
   59|      0|    return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
   60|       |  /* and it only handles 2h1v or 2h2v sampling ratios */
   61|  3.06k|  if (cinfo->comp_info[0].h_samp_factor != 2 ||
  ------------------
  |  Branch (61:7): [True: 1.42k, False: 1.64k]
  ------------------
   62|  3.06k|      cinfo->comp_info[1].h_samp_factor != 1 ||
  ------------------
  |  Branch (62:7): [True: 154, False: 1.48k]
  ------------------
   63|  3.06k|      cinfo->comp_info[2].h_samp_factor != 1 ||
  ------------------
  |  Branch (63:7): [True: 402, False: 1.08k]
  ------------------
   64|  3.06k|      cinfo->comp_info[0].v_samp_factor >  2 ||
  ------------------
  |  Branch (64:7): [True: 38, False: 1.04k]
  ------------------
   65|  3.06k|      cinfo->comp_info[1].v_samp_factor != 1 ||
  ------------------
  |  Branch (65:7): [True: 642, False: 406]
  ------------------
   66|  3.06k|      cinfo->comp_info[2].v_samp_factor != 1)
  ------------------
  |  Branch (66:7): [True: 66, False: 340]
  ------------------
   67|  2.72k|    return FALSE;
  ------------------
  |  |  245|  2.72k|#define FALSE   0               /* values of boolean */
  ------------------
   68|       |  /* furthermore, it doesn't work if we've scaled the IDCTs differently */
   69|    340|  if (cinfo->comp_info[0]._DCT_scaled_size != cinfo->_min_DCT_scaled_size ||
  ------------------
  |  |   24|    340|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
                if (cinfo->comp_info[0]._DCT_scaled_size != cinfo->_min_DCT_scaled_size ||
  ------------------
  |  |   27|    680|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  |  Branch (69:7): [True: 0, False: 340]
  ------------------
   70|    340|      cinfo->comp_info[1]._DCT_scaled_size != cinfo->_min_DCT_scaled_size ||
  ------------------
  |  |   24|    340|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
                    cinfo->comp_info[1]._DCT_scaled_size != cinfo->_min_DCT_scaled_size ||
  ------------------
  |  |   27|    680|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  |  Branch (70:7): [True: 0, False: 340]
  ------------------
   71|    340|      cinfo->comp_info[2]._DCT_scaled_size != cinfo->_min_DCT_scaled_size)
  ------------------
  |  |   24|    340|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
                    cinfo->comp_info[2]._DCT_scaled_size != cinfo->_min_DCT_scaled_size)
  ------------------
  |  |   27|    340|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  |  Branch (71:7): [True: 0, False: 340]
  ------------------
   72|      0|    return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
   73|    340|#ifdef WITH_SIMD
   74|       |  /* If YCbCr-to-RGB color conversion is SIMD-accelerated but merged upsampling
   75|       |     isn't, then disabling merged upsampling is likely to be faster when
   76|       |     decompressing YCbCr JPEG images. */
   77|    340|  if (!jsimd_can_h2v2_merged_upsample() && !jsimd_can_h2v1_merged_upsample() &&
  ------------------
  |  Branch (77:7): [True: 0, False: 340]
  |  Branch (77:44): [True: 0, False: 0]
  ------------------
   78|    340|      jsimd_can_ycc_rgb() && cinfo->jpeg_color_space == JCS_YCbCr &&
  ------------------
  |  Branch (78:7): [True: 0, False: 0]
  |  Branch (78:30): [True: 0, False: 0]
  ------------------
   79|    340|      (cinfo->out_color_space == JCS_RGB ||
  ------------------
  |  Branch (79:8): [True: 0, False: 0]
  ------------------
   80|      0|       (cinfo->out_color_space >= JCS_EXT_RGB &&
  ------------------
  |  Branch (80:9): [True: 0, False: 0]
  ------------------
   81|      0|        cinfo->out_color_space <= JCS_EXT_ARGB)))
  ------------------
  |  Branch (81:9): [True: 0, False: 0]
  ------------------
   82|      0|    return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
   83|    340|#endif
   84|       |  /* ??? also need to test for upsample-time rescaling, when & if supported */
   85|    340|  return TRUE;                  /* by golly, it'll work... */
  ------------------
  |  |  248|    340|#define TRUE    1
  ------------------
   86|       |#else
   87|       |  return FALSE;
   88|       |#endif
   89|    340|}
jdmaster.c:prepare_for_output_pass:
  623|  3.60k|{
  624|  3.60k|  my_master_ptr master = (my_master_ptr)cinfo->master;
  625|       |
  626|  3.60k|  if (master->pub.is_dummy_pass) {
  ------------------
  |  Branch (626:7): [True: 0, False: 3.60k]
  ------------------
  627|      0|#ifdef QUANT_2PASS_SUPPORTED
  628|       |    /* Final pass of 2-pass quantization */
  629|      0|    master->pub.is_dummy_pass = FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  630|      0|    (*cinfo->cquantize->start_pass) (cinfo, FALSE);
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  631|      0|    (*cinfo->post->start_pass) (cinfo, JBUF_CRANK_DEST);
  632|      0|    (*cinfo->main->start_pass) (cinfo, JBUF_CRANK_DEST);
  633|       |#else
  634|       |    ERREXIT(cinfo, JERR_NOT_COMPILED);
  635|       |#endif /* QUANT_2PASS_SUPPORTED */
  636|  3.60k|  } else {
  637|  3.60k|    if (cinfo->quantize_colors && cinfo->colormap == NULL) {
  ------------------
  |  Branch (637:9): [True: 0, False: 3.60k]
  |  Branch (637:35): [True: 0, False: 0]
  ------------------
  638|       |      /* Select new quantization method */
  639|      0|      if (cinfo->two_pass_quantize && cinfo->enable_2pass_quant) {
  ------------------
  |  Branch (639:11): [True: 0, False: 0]
  |  Branch (639:39): [True: 0, False: 0]
  ------------------
  640|      0|        cinfo->cquantize = master->quantizer_2pass;
  641|      0|        master->pub.is_dummy_pass = TRUE;
  ------------------
  |  |  248|      0|#define TRUE    1
  ------------------
  642|      0|      } else if (cinfo->enable_1pass_quant) {
  ------------------
  |  Branch (642:18): [True: 0, False: 0]
  ------------------
  643|      0|        cinfo->cquantize = master->quantizer_1pass;
  644|      0|      } else {
  645|      0|        ERREXIT(cinfo, JERR_MODE_CHANGE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  646|      0|      }
  647|      0|    }
  648|  3.60k|    (*cinfo->idct->start_pass) (cinfo);
  649|  3.60k|    (*cinfo->coef->start_output_pass) (cinfo);
  650|  3.60k|    if (!cinfo->raw_data_out) {
  ------------------
  |  Branch (650:9): [True: 3.60k, False: 0]
  ------------------
  651|  3.60k|      if (!master->using_merged_upsample)
  ------------------
  |  Branch (651:11): [True: 3.52k, False: 77]
  ------------------
  652|  3.52k|        (*cinfo->cconvert->start_pass) (cinfo);
  653|  3.60k|      (*cinfo->upsample->start_pass) (cinfo);
  654|  3.60k|      if (cinfo->quantize_colors)
  ------------------
  |  Branch (654:11): [True: 0, False: 3.60k]
  ------------------
  655|      0|        (*cinfo->cquantize->start_pass) (cinfo, master->pub.is_dummy_pass);
  656|  3.60k|      (*cinfo->post->start_pass) (cinfo,
  657|  3.60k|            (master->pub.is_dummy_pass ? JBUF_SAVE_AND_PASS : JBUF_PASS_THRU));
  ------------------
  |  Branch (657:14): [True: 0, False: 3.60k]
  ------------------
  658|  3.60k|      (*cinfo->main->start_pass) (cinfo, JBUF_PASS_THRU);
  659|  3.60k|    }
  660|  3.60k|  }
  661|       |
  662|       |  /* Set up progress monitor's pass info if present */
  663|  3.60k|  if (cinfo->progress != NULL) {
  ------------------
  |  Branch (663:7): [True: 3.60k, False: 0]
  ------------------
  664|  3.60k|    cinfo->progress->completed_passes = master->pass_number;
  665|  3.60k|    cinfo->progress->total_passes = master->pass_number +
  666|  3.60k|                                    (master->pub.is_dummy_pass ? 2 : 1);
  ------------------
  |  Branch (666:38): [True: 0, False: 3.60k]
  ------------------
  667|       |    /* In buffered-image mode, we assume one more output pass if EOI not
  668|       |     * yet reached, but no more passes if EOI has been reached.
  669|       |     */
  670|  3.60k|    if (cinfo->buffered_image && !cinfo->inputctl->eoi_reached) {
  ------------------
  |  Branch (670:9): [True: 0, False: 3.60k]
  |  Branch (670:34): [True: 0, False: 0]
  ------------------
  671|      0|      cinfo->progress->total_passes += (cinfo->enable_2pass_quant ? 2 : 1);
  ------------------
  |  Branch (671:41): [True: 0, False: 0]
  ------------------
  672|      0|    }
  673|  3.60k|  }
  674|  3.60k|}
jdmaster.c:finish_output_pass:
  683|  3.60k|{
  684|  3.60k|  my_master_ptr master = (my_master_ptr)cinfo->master;
  685|       |
  686|  3.60k|  if (cinfo->quantize_colors)
  ------------------
  |  Branch (686:7): [True: 0, False: 3.60k]
  ------------------
  687|      0|    (*cinfo->cquantize->finish_pass) (cinfo);
  688|  3.60k|  master->pass_number++;
  689|  3.60k|}
jdmaster.c:master_selection:
  461|  5.08k|{
  462|  5.08k|  my_master_ptr master = (my_master_ptr)cinfo->master;
  463|  5.08k|  boolean use_c_buffer;
  464|  5.08k|  long samplesperrow;
  465|  5.08k|  JDIMENSION jd_samplesperrow;
  466|       |
  467|       |  /* Initialize dimensions and other stuff */
  468|  5.08k|  jpeg_calc_output_dimensions(cinfo);
  469|  5.08k|  prepare_range_limit_table(cinfo);
  470|       |
  471|       |  /* Width of an output scanline must be representable as JDIMENSION. */
  472|  5.08k|  samplesperrow = (long)cinfo->output_width *
  473|  5.08k|                  (long)cinfo->out_color_components;
  474|  5.08k|  jd_samplesperrow = (JDIMENSION)samplesperrow;
  475|  5.08k|  if ((long)jd_samplesperrow != samplesperrow)
  ------------------
  |  Branch (475:7): [True: 0, False: 5.08k]
  ------------------
  476|      0|    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  477|       |
  478|       |  /* Initialize my private state */
  479|  5.08k|  master->pass_number = 0;
  480|  5.08k|  master->using_merged_upsample = use_merged_upsample(cinfo);
  481|       |
  482|       |  /* Color quantizer selection */
  483|  5.08k|  master->quantizer_1pass = NULL;
  484|  5.08k|  master->quantizer_2pass = NULL;
  485|       |  /* No mode changes if not using buffered-image mode. */
  486|  5.08k|  if (!cinfo->quantize_colors || !cinfo->buffered_image) {
  ------------------
  |  Branch (486:7): [True: 5.08k, False: 0]
  |  Branch (486:34): [True: 0, False: 0]
  ------------------
  487|  5.08k|    cinfo->enable_1pass_quant = FALSE;
  ------------------
  |  |  245|  5.08k|#define FALSE   0               /* values of boolean */
  ------------------
  488|  5.08k|    cinfo->enable_external_quant = FALSE;
  ------------------
  |  |  245|  5.08k|#define FALSE   0               /* values of boolean */
  ------------------
  489|  5.08k|    cinfo->enable_2pass_quant = FALSE;
  ------------------
  |  |  245|  5.08k|#define FALSE   0               /* values of boolean */
  ------------------
  490|  5.08k|  }
  491|  5.08k|  if (cinfo->quantize_colors) {
  ------------------
  |  Branch (491:7): [True: 0, False: 5.08k]
  ------------------
  492|      0|    if (cinfo->raw_data_out)
  ------------------
  |  Branch (492:9): [True: 0, False: 0]
  ------------------
  493|      0|      ERREXIT(cinfo, JERR_NOTIMPL);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  494|       |    /* 2-pass quantizer only works in 3-component color space. */
  495|      0|    if (cinfo->out_color_components != 3 ||
  ------------------
  |  Branch (495:9): [True: 0, False: 0]
  ------------------
  496|      0|        cinfo->out_color_space == JCS_RGB565) {
  ------------------
  |  Branch (496:9): [True: 0, False: 0]
  ------------------
  497|      0|      cinfo->enable_1pass_quant = TRUE;
  ------------------
  |  |  248|      0|#define TRUE    1
  ------------------
  498|      0|      cinfo->enable_external_quant = FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  499|      0|      cinfo->enable_2pass_quant = FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  500|      0|      cinfo->colormap = NULL;
  501|      0|    } else if (cinfo->colormap != NULL) {
  ------------------
  |  Branch (501:16): [True: 0, False: 0]
  ------------------
  502|      0|      cinfo->enable_external_quant = TRUE;
  ------------------
  |  |  248|      0|#define TRUE    1
  ------------------
  503|      0|    } else if (cinfo->two_pass_quantize) {
  ------------------
  |  Branch (503:16): [True: 0, False: 0]
  ------------------
  504|      0|      cinfo->enable_2pass_quant = TRUE;
  ------------------
  |  |  248|      0|#define TRUE    1
  ------------------
  505|      0|    } else {
  506|      0|      cinfo->enable_1pass_quant = TRUE;
  ------------------
  |  |  248|      0|#define TRUE    1
  ------------------
  507|      0|    }
  508|       |
  509|      0|    if (cinfo->enable_1pass_quant) {
  ------------------
  |  Branch (509:9): [True: 0, False: 0]
  ------------------
  510|      0|#ifdef QUANT_1PASS_SUPPORTED
  511|      0|      jinit_1pass_quantizer(cinfo);
  512|      0|      master->quantizer_1pass = cinfo->cquantize;
  513|       |#else
  514|       |      ERREXIT(cinfo, JERR_NOT_COMPILED);
  515|       |#endif
  516|      0|    }
  517|       |
  518|       |    /* We use the 2-pass code to map to external colormaps. */
  519|      0|    if (cinfo->enable_2pass_quant || cinfo->enable_external_quant) {
  ------------------
  |  Branch (519:9): [True: 0, False: 0]
  |  Branch (519:38): [True: 0, False: 0]
  ------------------
  520|      0|#ifdef QUANT_2PASS_SUPPORTED
  521|      0|      jinit_2pass_quantizer(cinfo);
  522|      0|      master->quantizer_2pass = cinfo->cquantize;
  523|       |#else
  524|       |      ERREXIT(cinfo, JERR_NOT_COMPILED);
  525|       |#endif
  526|      0|    }
  527|       |    /* If both quantizers are initialized, the 2-pass one is left active;
  528|       |     * this is necessary for starting with quantization to an external map.
  529|       |     */
  530|      0|  }
  531|       |
  532|       |  /* Post-processing: in particular, color conversion first */
  533|  5.08k|  if (!cinfo->raw_data_out) {
  ------------------
  |  Branch (533:7): [True: 5.08k, False: 0]
  ------------------
  534|  5.08k|    if (master->using_merged_upsample) {
  ------------------
  |  Branch (534:9): [True: 170, False: 4.91k]
  ------------------
  535|    170|#ifdef UPSAMPLE_MERGING_SUPPORTED
  536|    170|      jinit_merged_upsampler(cinfo); /* does color conversion too */
  537|       |#else
  538|       |      ERREXIT(cinfo, JERR_NOT_COMPILED);
  539|       |#endif
  540|  4.91k|    } else {
  541|  4.91k|      jinit_color_deconverter(cinfo);
  542|  4.91k|      jinit_upsampler(cinfo);
  543|  4.91k|    }
  544|  5.08k|    jinit_d_post_controller(cinfo, cinfo->enable_2pass_quant);
  545|  5.08k|  }
  546|       |  /* Inverse DCT */
  547|  5.08k|  jinit_inverse_dct(cinfo);
  548|       |  /* Entropy decoding: either Huffman or arithmetic coding. */
  549|  5.08k|  if (cinfo->arith_code) {
  ------------------
  |  Branch (549:7): [True: 1.92k, False: 3.16k]
  ------------------
  550|  1.92k|#ifdef D_ARITH_CODING_SUPPORTED
  551|  1.92k|    jinit_arith_decoder(cinfo);
  552|       |#else
  553|       |    ERREXIT(cinfo, JERR_ARITH_NOTIMPL);
  554|       |#endif
  555|  3.16k|  } else {
  556|  3.16k|    if (cinfo->progressive_mode) {
  ------------------
  |  Branch (556:9): [True: 879, False: 2.28k]
  ------------------
  557|    879|#ifdef D_PROGRESSIVE_SUPPORTED
  558|    879|      jinit_phuff_decoder(cinfo);
  559|       |#else
  560|       |      ERREXIT(cinfo, JERR_NOT_COMPILED);
  561|       |#endif
  562|    879|    } else
  563|  2.28k|      jinit_huff_decoder(cinfo);
  564|  3.16k|  }
  565|       |
  566|       |  /* Initialize principal buffer controllers. */
  567|  5.08k|  use_c_buffer = cinfo->inputctl->has_multiple_scans || cinfo->buffered_image;
  ------------------
  |  Branch (567:18): [True: 3.83k, False: 1.25k]
  |  Branch (567:57): [True: 0, False: 1.25k]
  ------------------
  568|  5.08k|  jinit_d_coef_controller(cinfo, use_c_buffer);
  569|       |
  570|  5.08k|  if (!cinfo->raw_data_out)
  ------------------
  |  Branch (570:7): [True: 4.56k, False: 520]
  ------------------
  571|  4.56k|    jinit_d_main_controller(cinfo, FALSE /* never need full buffer here */);
  ------------------
  |  |  245|  4.56k|#define FALSE   0               /* values of boolean */
  ------------------
  572|       |
  573|       |  /* We can now tell the memory manager to allocate virtual arrays. */
  574|  5.08k|  (*cinfo->mem->realize_virt_arrays) ((j_common_ptr)cinfo);
  575|       |
  576|       |  /* Initialize input side of decompressor to consume first scan. */
  577|  5.08k|  (*cinfo->inputctl->start_input_pass) (cinfo);
  578|       |
  579|       |  /* Set the first and last iMCU columns to decompress from single-scan images.
  580|       |   * By default, decompress all of the iMCU columns.
  581|       |   */
  582|  5.08k|  cinfo->master->first_iMCU_col = 0;
  583|  5.08k|  cinfo->master->last_iMCU_col = cinfo->MCUs_per_row - 1;
  584|       |
  585|  5.08k|#ifdef D_MULTISCAN_FILES_SUPPORTED
  586|       |  /* If jpeg_start_decompress will read the whole file, initialize
  587|       |   * progress monitoring appropriately.  The input step is counted
  588|       |   * as one pass.
  589|       |   */
  590|  5.08k|  if (cinfo->progress != NULL && !cinfo->buffered_image &&
  ------------------
  |  Branch (590:7): [True: 4.07k, False: 1.01k]
  |  Branch (590:34): [True: 4.07k, False: 0]
  ------------------
  591|  5.08k|      cinfo->inputctl->has_multiple_scans) {
  ------------------
  |  Branch (591:7): [True: 2.89k, False: 1.17k]
  ------------------
  592|  2.89k|    int nscans;
  593|       |    /* Estimate number of scans to set pass_limit. */
  594|  2.89k|    if (cinfo->progressive_mode) {
  ------------------
  |  Branch (594:9): [True: 1.93k, False: 964]
  ------------------
  595|       |      /* Arbitrarily estimate 2 interleaved DC scans + 3 AC scans/component. */
  596|  1.93k|      nscans = 2 + 3 * cinfo->num_components;
  597|  1.93k|    } else {
  598|       |      /* For a nonprogressive multiscan file, estimate 1 scan per component. */
  599|    964|      nscans = cinfo->num_components;
  600|    964|    }
  601|  2.89k|    cinfo->progress->pass_counter = 0L;
  602|  2.89k|    cinfo->progress->pass_limit = (long)cinfo->total_iMCU_rows * nscans;
  603|  2.89k|    cinfo->progress->completed_passes = 0;
  604|  2.89k|    cinfo->progress->total_passes = (cinfo->enable_2pass_quant ? 3 : 2);
  ------------------
  |  Branch (604:38): [True: 0, False: 2.89k]
  ------------------
  605|       |    /* Count the input pass as done */
  606|  2.89k|    master->pass_number++;
  607|  2.89k|  }
  608|  5.08k|#endif /* D_MULTISCAN_FILES_SUPPORTED */
  609|  5.08k|}
jdmaster.c:prepare_range_limit_table:
  422|  5.08k|{
  423|  5.08k|  JSAMPLE *table;
  424|  5.08k|  int i;
  425|       |
  426|  5.08k|  table = (JSAMPLE *)
  427|  5.08k|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  5.08k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  428|  5.08k|                (5 * (MAXJSAMPLE + 1) + CENTERJSAMPLE) * sizeof(JSAMPLE));
  ------------------
  |  |   65|  5.08k|#define MAXJSAMPLE      255
  ------------------
                              (5 * (MAXJSAMPLE + 1) + CENTERJSAMPLE) * sizeof(JSAMPLE));
  ------------------
  |  |   66|  5.08k|#define CENTERJSAMPLE   128
  ------------------
  429|  5.08k|  table += (MAXJSAMPLE + 1);    /* allow negative subscripts of simple table */
  ------------------
  |  |   65|  5.08k|#define MAXJSAMPLE      255
  ------------------
  430|  5.08k|  cinfo->sample_range_limit = table;
  431|       |  /* First segment of "simple" table: limit[x] = 0 for x < 0 */
  432|  5.08k|  MEMZERO(table - (MAXJSAMPLE + 1), (MAXJSAMPLE + 1) * sizeof(JSAMPLE));
  ------------------
  |  |   73|  5.08k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
  433|       |  /* Main part of "simple" table: limit[x] = x */
  434|  1.30M|  for (i = 0; i <= MAXJSAMPLE; i++)
  ------------------
  |  |   65|  1.30M|#define MAXJSAMPLE      255
  ------------------
  |  Branch (434:15): [True: 1.30M, False: 5.08k]
  ------------------
  435|  1.30M|    table[i] = (JSAMPLE)i;
  436|  5.08k|  table += CENTERJSAMPLE;       /* Point to where post-IDCT table starts */
  ------------------
  |  |   66|  5.08k|#define CENTERJSAMPLE   128
  ------------------
  437|       |  /* End of simple table, rest of first half of post-IDCT table */
  438|  1.95M|  for (i = CENTERJSAMPLE; i < 2 * (MAXJSAMPLE + 1); i++)
  ------------------
  |  |   66|  5.08k|#define CENTERJSAMPLE   128
  ------------------
                for (i = CENTERJSAMPLE; i < 2 * (MAXJSAMPLE + 1); i++)
  ------------------
  |  |   65|  1.95M|#define MAXJSAMPLE      255
  ------------------
  |  Branch (438:27): [True: 1.95M, False: 5.08k]
  ------------------
  439|  1.95M|    table[i] = MAXJSAMPLE;
  ------------------
  |  |   65|  1.95M|#define MAXJSAMPLE      255
  ------------------
  440|       |  /* Second half of post-IDCT table */
  441|  5.08k|  MEMZERO(table + (2 * (MAXJSAMPLE + 1)),
  ------------------
  |  |   73|  5.08k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
  442|  5.08k|          (2 * (MAXJSAMPLE + 1) - CENTERJSAMPLE) * sizeof(JSAMPLE));
  443|  5.08k|  MEMCOPY(table + (4 * (MAXJSAMPLE + 1) - CENTERJSAMPLE),
  ------------------
  |  |   75|  5.08k|  memcpy((void *)(dest), (const void *)(src), (size_t)(size))
  ------------------
  444|  5.08k|          cinfo->sample_range_limit, CENTERJSAMPLE * sizeof(JSAMPLE));
  445|  5.08k|}

jinit_merged_upsampler:
  539|    170|{
  540|    170|  my_merged_upsample_ptr upsample;
  541|       |
  542|    170|  upsample = (my_merged_upsample_ptr)
  543|    170|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|    170|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  544|    170|                                sizeof(my_merged_upsampler));
  545|    170|  cinfo->upsample = (struct jpeg_upsampler *)upsample;
  546|    170|  upsample->pub.start_pass = start_pass_merged_upsample;
  547|    170|  upsample->pub.need_context_rows = FALSE;
  ------------------
  |  |  245|    170|#define FALSE   0               /* values of boolean */
  ------------------
  548|       |
  549|    170|  upsample->out_row_width = cinfo->output_width * cinfo->out_color_components;
  550|       |
  551|    170|  if (cinfo->max_v_samp_factor == 2) {
  ------------------
  |  Branch (551:7): [True: 121, False: 49]
  ------------------
  552|    121|    upsample->pub.upsample = merged_2v_upsample;
  553|    121|    if (jsimd_can_h2v2_merged_upsample())
  ------------------
  |  Branch (553:9): [True: 121, False: 0]
  ------------------
  554|    121|      upsample->upmethod = jsimd_h2v2_merged_upsample;
  555|      0|    else
  556|      0|      upsample->upmethod = h2v2_merged_upsample;
  557|    121|    if (cinfo->out_color_space == JCS_RGB565) {
  ------------------
  |  Branch (557:9): [True: 0, False: 121]
  ------------------
  558|      0|      if (cinfo->dither_mode != JDITHER_NONE) {
  ------------------
  |  Branch (558:11): [True: 0, False: 0]
  ------------------
  559|      0|        upsample->upmethod = h2v2_merged_upsample_565D;
  560|      0|      } else {
  561|      0|        upsample->upmethod = h2v2_merged_upsample_565;
  562|      0|      }
  563|      0|    }
  564|       |    /* Allocate a spare row buffer */
  565|    121|    upsample->spare_row = (JSAMPROW)
  566|    121|      (*cinfo->mem->alloc_large) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|    121|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  567|    121|                (size_t)(upsample->out_row_width * sizeof(JSAMPLE)));
  568|    121|  } else {
  569|     49|    upsample->pub.upsample = merged_1v_upsample;
  570|     49|    if (jsimd_can_h2v1_merged_upsample())
  ------------------
  |  Branch (570:9): [True: 49, False: 0]
  ------------------
  571|     49|      upsample->upmethod = jsimd_h2v1_merged_upsample;
  572|      0|    else
  573|      0|      upsample->upmethod = h2v1_merged_upsample;
  574|     49|    if (cinfo->out_color_space == JCS_RGB565) {
  ------------------
  |  Branch (574:9): [True: 0, False: 49]
  ------------------
  575|      0|      if (cinfo->dither_mode != JDITHER_NONE) {
  ------------------
  |  Branch (575:11): [True: 0, False: 0]
  ------------------
  576|      0|        upsample->upmethod = h2v1_merged_upsample_565D;
  577|      0|      } else {
  578|      0|        upsample->upmethod = h2v1_merged_upsample_565;
  579|      0|      }
  580|      0|    }
  581|       |    /* No spare row needed */
  582|     49|    upsample->spare_row = NULL;
  583|     49|  }
  584|       |
  585|    170|  build_ycc_rgb_table(cinfo);
  586|    170|}
jdmerge.c:start_pass_merged_upsample:
  206|     77|{
  207|     77|  my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
  208|       |
  209|       |  /* Mark the spare buffer empty */
  210|     77|  upsample->spare_full = FALSE;
  ------------------
  |  |  245|     77|#define FALSE   0               /* values of boolean */
  ------------------
  211|       |  /* Initialize total-height counter for detecting bottom of image */
  212|     77|  upsample->rows_to_go = cinfo->output_height;
  213|     77|}
jdmerge.c:merged_2v_upsample:
  228|   256k|{
  229|   256k|  my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
  230|   256k|  JSAMPROW work_ptrs[2];
  231|   256k|  JDIMENSION num_rows;          /* number of rows returned to caller */
  232|       |
  233|   256k|  if (upsample->spare_full) {
  ------------------
  |  Branch (233:7): [True: 0, False: 256k]
  ------------------
  234|       |    /* If we have a spare row saved from a previous cycle, just return it. */
  235|      0|    JDIMENSION size = upsample->out_row_width;
  236|      0|    if (cinfo->out_color_space == JCS_RGB565)
  ------------------
  |  Branch (236:9): [True: 0, False: 0]
  ------------------
  237|      0|      size = cinfo->output_width * 2;
  238|      0|    jcopy_sample_rows(&upsample->spare_row, 0, output_buf + *out_row_ctr, 0, 1,
  239|      0|                      size);
  240|      0|    num_rows = 1;
  241|      0|    upsample->spare_full = FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  242|   256k|  } else {
  243|       |    /* Figure number of rows to return to caller. */
  244|   256k|    num_rows = 2;
  245|       |    /* Not more than the distance to the end of the image. */
  246|   256k|    if (num_rows > upsample->rows_to_go)
  ------------------
  |  Branch (246:9): [True: 30, False: 256k]
  ------------------
  247|     30|      num_rows = upsample->rows_to_go;
  248|       |    /* And not more than what the client can accept: */
  249|   256k|    out_rows_avail -= *out_row_ctr;
  250|   256k|    if (num_rows > out_rows_avail)
  ------------------
  |  Branch (250:9): [True: 0, False: 256k]
  ------------------
  251|      0|      num_rows = out_rows_avail;
  252|       |    /* Create output pointer array for upsampler. */
  253|   256k|    work_ptrs[0] = output_buf[*out_row_ctr];
  254|   256k|    if (num_rows > 1) {
  ------------------
  |  Branch (254:9): [True: 256k, False: 30]
  ------------------
  255|   256k|      work_ptrs[1] = output_buf[*out_row_ctr + 1];
  256|   256k|    } else {
  257|     30|      work_ptrs[1] = upsample->spare_row;
  258|     30|      upsample->spare_full = TRUE;
  ------------------
  |  |  248|     30|#define TRUE    1
  ------------------
  259|     30|    }
  260|       |    /* Now do the upsampling. */
  261|   256k|    (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr, work_ptrs);
  262|   256k|  }
  263|       |
  264|       |  /* Adjust counts */
  265|   256k|  *out_row_ctr += num_rows;
  266|   256k|  upsample->rows_to_go -= num_rows;
  267|       |  /* When the buffer is emptied, declare this input row group consumed */
  268|   256k|  if (!upsample->spare_full)
  ------------------
  |  Branch (268:7): [True: 256k, False: 30]
  ------------------
  269|   256k|    (*in_row_group_ctr)++;
  270|   256k|}
jdmerge.c:merged_1v_upsample:
  279|   270k|{
  280|   270k|  my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
  281|       |
  282|       |  /* Just do the upsampling. */
  283|   270k|  (*upsample->upmethod) (cinfo, input_buf, *in_row_group_ctr,
  284|   270k|                         output_buf + *out_row_ctr);
  285|       |  /* Adjust counts */
  286|   270k|  (*out_row_ctr)++;
  287|   270k|  (*in_row_group_ctr)++;
  288|   270k|}
jdmerge.c:build_ycc_rgb_table:
  163|    170|{
  164|    170|  my_merged_upsample_ptr upsample = (my_merged_upsample_ptr)cinfo->upsample;
  165|    170|  int i;
  166|    170|  JLONG x;
  167|    170|  SHIFT_TEMPS
  168|       |
  169|    170|  upsample->Cr_r_tab = (int *)
  170|    170|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|    170|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  171|    170|                                (MAXJSAMPLE + 1) * sizeof(int));
  ------------------
  |  |   65|    170|#define MAXJSAMPLE      255
  ------------------
  172|    170|  upsample->Cb_b_tab = (int *)
  173|    170|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|    170|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  174|    170|                                (MAXJSAMPLE + 1) * sizeof(int));
  ------------------
  |  |   65|    170|#define MAXJSAMPLE      255
  ------------------
  175|    170|  upsample->Cr_g_tab = (JLONG *)
  176|    170|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|    170|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  177|    170|                                (MAXJSAMPLE + 1) * sizeof(JLONG));
  ------------------
  |  |   65|    170|#define MAXJSAMPLE      255
  ------------------
  178|    170|  upsample->Cb_g_tab = (JLONG *)
  179|    170|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|    170|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  180|    170|                                (MAXJSAMPLE + 1) * sizeof(JLONG));
  ------------------
  |  |   65|    170|#define MAXJSAMPLE      255
  ------------------
  181|       |
  182|  43.6k|  for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
  ------------------
  |  |   66|    170|#define CENTERJSAMPLE   128
  ------------------
                for (i = 0, x = -CENTERJSAMPLE; i <= MAXJSAMPLE; i++, x++) {
  ------------------
  |  |   65|  43.6k|#define MAXJSAMPLE      255
  ------------------
  |  Branch (182:35): [True: 43.5k, False: 170]
  ------------------
  183|       |    /* i is the actual input pixel value, in the range 0..MAXJSAMPLE */
  184|       |    /* The Cb or Cr value we are thinking of is x = i - CENTERJSAMPLE */
  185|       |    /* Cr=>R value is nearest int to 1.40200 * x */
  186|  43.5k|    upsample->Cr_r_tab[i] = (int)
  187|  43.5k|                    RIGHT_SHIFT(FIX(1.40200) * x + ONE_HALF, SCALEBITS);
  ------------------
  |  |  300|  43.5k|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
  188|       |    /* Cb=>B value is nearest int to 1.77200 * x */
  189|  43.5k|    upsample->Cb_b_tab[i] = (int)
  190|  43.5k|                    RIGHT_SHIFT(FIX(1.77200) * x + ONE_HALF, SCALEBITS);
  ------------------
  |  |  300|  43.5k|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
  191|       |    /* Cr=>G value is scaled-up -0.71414 * x */
  192|  43.5k|    upsample->Cr_g_tab[i] = (-FIX(0.71414)) * x;
  ------------------
  |  |   52|  43.5k|#define FIX(x)          ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
  |  |  ------------------
  |  |  |  |   50|  43.5k|#define SCALEBITS       16      /* speediest right-shift on some machines */
  |  |  ------------------
  ------------------
  193|       |    /* Cb=>G value is scaled-up -0.34414 * x */
  194|       |    /* We also add in ONE_HALF so that need not do it in inner loop */
  195|  43.5k|    upsample->Cb_g_tab[i] = (-FIX(0.34414)) * x + ONE_HALF;
  ------------------
  |  |   52|  43.5k|#define FIX(x)          ((JLONG)((x) * (1L << SCALEBITS) + 0.5))
  |  |  ------------------
  |  |  |  |   50|  43.5k|#define SCALEBITS       16      /* speediest right-shift on some machines */
  |  |  ------------------
  ------------------
                  upsample->Cb_g_tab[i] = (-FIX(0.34414)) * x + ONE_HALF;
  ------------------
  |  |   51|  43.5k|#define ONE_HALF        ((JLONG)1 << (SCALEBITS - 1))
  |  |  ------------------
  |  |  |  |   50|  43.5k|#define SCALEBITS       16      /* speediest right-shift on some machines */
  |  |  ------------------
  ------------------
  196|  43.5k|  }
  197|    170|}

jinit_phuff_decoder:
  664|    879|{
  665|    879|  phuff_entropy_ptr entropy;
  666|    879|  int *coef_bit_ptr;
  667|    879|  int ci, i;
  668|       |
  669|    879|  entropy = (phuff_entropy_ptr)
  670|    879|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|    879|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  671|    879|                                sizeof(phuff_entropy_decoder));
  672|    879|  cinfo->entropy = (struct jpeg_entropy_decoder *)entropy;
  673|    879|  entropy->pub.start_pass = start_pass_phuff_decoder;
  674|       |
  675|       |  /* Mark derived tables unallocated */
  676|  4.39k|  for (i = 0; i < NUM_HUFF_TBLS; i++) {
  ------------------
  |  |   49|  4.39k|#define NUM_HUFF_TBLS       4   /* Huffman tables are numbered 0..3 */
  ------------------
  |  Branch (676:15): [True: 3.51k, False: 879]
  ------------------
  677|  3.51k|    entropy->derived_tbls[i] = NULL;
  678|  3.51k|  }
  679|       |
  680|       |  /* Create progression status table */
  681|    879|  cinfo->coef_bits = (int (*)[DCTSIZE2])
  682|    879|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|    879|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  683|    879|                                cinfo->num_components * DCTSIZE2 *
  ------------------
  |  |   47|    879|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  684|    879|                                sizeof(int));
  685|    879|  coef_bit_ptr = &cinfo->coef_bits[0][0];
  686|  2.20k|  for (ci = 0; ci < cinfo->num_components; ci++)
  ------------------
  |  Branch (686:16): [True: 1.32k, False: 879]
  ------------------
  687|  86.1k|    for (i = 0; i < DCTSIZE2; i++)
  ------------------
  |  |   47|  86.1k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (687:17): [True: 84.8k, False: 1.32k]
  ------------------
  688|  84.8k|      *coef_bit_ptr++ = -1;
  689|    879|}
jdphuff.c:start_pass_phuff_decoder:
  100|  5.59k|{
  101|  5.59k|  phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
  102|  5.59k|  boolean is_DC_band, bad;
  103|  5.59k|  int ci, coefi, tbl;
  104|  5.59k|  d_derived_tbl **pdtbl;
  105|  5.59k|  int *coef_bit_ptr;
  106|  5.59k|  jpeg_component_info *compptr;
  107|       |
  108|  5.59k|  is_DC_band = (cinfo->Ss == 0);
  109|       |
  110|       |  /* Validate scan parameters */
  111|  5.59k|  bad = FALSE;
  ------------------
  |  |  245|  5.59k|#define FALSE   0               /* values of boolean */
  ------------------
  112|  5.59k|  if (is_DC_band) {
  ------------------
  |  Branch (112:7): [True: 2.58k, False: 3.01k]
  ------------------
  113|  2.58k|    if (cinfo->Se != 0)
  ------------------
  |  Branch (113:9): [True: 8, False: 2.57k]
  ------------------
  114|      8|      bad = TRUE;
  ------------------
  |  |  248|      8|#define TRUE    1
  ------------------
  115|  3.01k|  } else {
  116|       |    /* need not check Ss/Se < 0 since they came from unsigned bytes */
  117|  3.01k|    if (cinfo->Ss > cinfo->Se || cinfo->Se >= DCTSIZE2)
  ------------------
  |  |   47|  3.00k|#define DCTSIZE2            64  /* DCTSIZE squared; # of elements in a block */
  ------------------
  |  Branch (117:9): [True: 9, False: 3.00k]
  |  Branch (117:34): [True: 17, False: 2.98k]
  ------------------
  118|     26|      bad = TRUE;
  ------------------
  |  |  248|     26|#define TRUE    1
  ------------------
  119|       |    /* AC scans may have only one component */
  120|  3.01k|    if (cinfo->comps_in_scan != 1)
  ------------------
  |  Branch (120:9): [True: 5, False: 3.00k]
  ------------------
  121|      5|      bad = TRUE;
  ------------------
  |  |  248|      5|#define TRUE    1
  ------------------
  122|  3.01k|  }
  123|  5.59k|  if (cinfo->Ah != 0) {
  ------------------
  |  Branch (123:7): [True: 1.93k, False: 3.66k]
  ------------------
  124|       |    /* Successive approximation refinement scan: must have Al = Ah-1. */
  125|  1.93k|    if (cinfo->Al != cinfo->Ah - 1)
  ------------------
  |  Branch (125:9): [True: 34, False: 1.89k]
  ------------------
  126|     34|      bad = TRUE;
  ------------------
  |  |  248|     34|#define TRUE    1
  ------------------
  127|  1.93k|  }
  128|  5.59k|  if (cinfo->Al > 13)           /* need not check for < 0 */
  ------------------
  |  Branch (128:7): [True: 14, False: 5.58k]
  ------------------
  129|     14|    bad = TRUE;
  ------------------
  |  |  248|     14|#define TRUE    1
  ------------------
  130|       |  /* Arguably the maximum Al value should be less than 13 for 8-bit precision,
  131|       |   * but the spec doesn't say so, and we try to be liberal about what we
  132|       |   * accept.  Note: large Al values could result in out-of-range DC
  133|       |   * coefficients during early scans, leading to bizarre displays due to
  134|       |   * overflows in the IDCT math.  But we won't crash.
  135|       |   */
  136|  5.59k|  if (bad)
  ------------------
  |  Branch (136:7): [True: 36, False: 5.56k]
  ------------------
  137|     36|    ERREXIT4(cinfo, JERR_BAD_PROGRESSION,
  ------------------
  |  |  249|     36|  ((cinfo)->err->msg_code = (code), \
  |  |  250|     36|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  251|     36|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  252|     36|   (cinfo)->err->msg_parm.i[2] = (p3), \
  |  |  253|     36|   (cinfo)->err->msg_parm.i[3] = (p4), \
  |  |  254|     36|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  138|  5.59k|             cinfo->Ss, cinfo->Se, cinfo->Ah, cinfo->Al);
  139|       |  /* Update progression status, and verify that scan order is legal.
  140|       |   * Note that inter-scan inconsistencies are treated as warnings
  141|       |   * not fatal errors ... not clear if this is right way to behave.
  142|       |   */
  143|  15.2k|  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  ------------------
  |  Branch (143:16): [True: 9.63k, False: 5.59k]
  ------------------
  144|  9.63k|    int cindex = cinfo->cur_comp_info[ci]->component_index;
  145|  9.63k|    coef_bit_ptr = &cinfo->coef_bits[cindex][0];
  146|  9.63k|    if (!is_DC_band && coef_bit_ptr[0] < 0) /* AC without prior DC scan */
  ------------------
  |  Branch (146:9): [True: 2.98k, False: 6.64k]
  |  Branch (146:24): [True: 1.27k, False: 1.70k]
  ------------------
  147|  1.27k|      WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, 0);
  ------------------
  |  |  272|  1.27k|  ((cinfo)->err->msg_code = (code), \
  |  |  273|  1.27k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  274|  1.27k|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  275|  1.27k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  148|  93.6k|    for (coefi = cinfo->Ss; coefi <= cinfo->Se; coefi++) {
  ------------------
  |  Branch (148:29): [True: 83.9k, False: 9.63k]
  ------------------
  149|  83.9k|      int expected = (coef_bit_ptr[coefi] < 0) ? 0 : coef_bit_ptr[coefi];
  ------------------
  |  Branch (149:22): [True: 14.5k, False: 69.4k]
  ------------------
  150|  83.9k|      if (cinfo->Ah != expected)
  ------------------
  |  Branch (150:11): [True: 39.8k, False: 44.1k]
  ------------------
  151|  39.8k|        WARNMS2(cinfo, JWRN_BOGUS_PROGRESSION, cindex, coefi);
  ------------------
  |  |  272|  39.8k|  ((cinfo)->err->msg_code = (code), \
  |  |  273|  39.8k|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  274|  39.8k|   (cinfo)->err->msg_parm.i[1] = (p2), \
  |  |  275|  39.8k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  152|  83.9k|      coef_bit_ptr[coefi] = cinfo->Al;
  153|  83.9k|    }
  154|  9.63k|  }
  155|       |
  156|       |  /* Select MCU decoding routine */
  157|  5.59k|  if (cinfo->Ah == 0) {
  ------------------
  |  Branch (157:7): [True: 3.66k, False: 1.93k]
  ------------------
  158|  3.66k|    if (is_DC_band)
  ------------------
  |  Branch (158:9): [True: 2.03k, False: 1.62k]
  ------------------
  159|  2.03k|      entropy->pub.decode_mcu = decode_mcu_DC_first;
  160|  1.62k|    else
  161|  1.62k|      entropy->pub.decode_mcu = decode_mcu_AC_first;
  162|  3.66k|  } else {
  163|  1.93k|    if (is_DC_band)
  ------------------
  |  Branch (163:9): [True: 537, False: 1.39k]
  ------------------
  164|    537|      entropy->pub.decode_mcu = decode_mcu_DC_refine;
  165|  1.39k|    else
  166|  1.39k|      entropy->pub.decode_mcu = decode_mcu_AC_refine;
  167|  1.93k|  }
  168|       |
  169|  15.2k|  for (ci = 0; ci < cinfo->comps_in_scan; ci++) {
  ------------------
  |  Branch (169:16): [True: 9.63k, False: 5.59k]
  ------------------
  170|  9.63k|    compptr = cinfo->cur_comp_info[ci];
  171|       |    /* Make sure requested tables are present, and compute derived tables.
  172|       |     * We may build same derived table more than once, but it's not expensive.
  173|       |     */
  174|  9.63k|    if (is_DC_band) {
  ------------------
  |  Branch (174:9): [True: 6.64k, False: 2.98k]
  ------------------
  175|  6.64k|      if (cinfo->Ah == 0) {     /* DC refinement needs no table */
  ------------------
  |  Branch (175:11): [True: 5.31k, False: 1.33k]
  ------------------
  176|  5.31k|        tbl = compptr->dc_tbl_no;
  177|  5.31k|        pdtbl = (d_derived_tbl **)(entropy->derived_tbls) + tbl;
  178|  5.31k|        jpeg_make_d_derived_tbl(cinfo, TRUE, tbl, pdtbl);
  ------------------
  |  |  248|  5.31k|#define TRUE    1
  ------------------
  179|  5.31k|      }
  180|  6.64k|    } else {
  181|  2.98k|      tbl = compptr->ac_tbl_no;
  182|  2.98k|      pdtbl = (d_derived_tbl **)(entropy->derived_tbls) + tbl;
  183|  2.98k|      jpeg_make_d_derived_tbl(cinfo, FALSE, tbl, pdtbl);
  ------------------
  |  |  245|  2.98k|#define FALSE   0               /* values of boolean */
  ------------------
  184|       |      /* remember the single active table */
  185|  2.98k|      entropy->ac_derived_tbl = entropy->derived_tbls[tbl];
  186|  2.98k|    }
  187|       |    /* Initialize DC predictions to 0 */
  188|  9.63k|    entropy->saved.last_dc_val[ci] = 0;
  189|  9.63k|  }
  190|       |
  191|       |  /* Initialize bitread state variables */
  192|  5.59k|  entropy->bitstate.bits_left = 0;
  193|  5.59k|  entropy->bitstate.get_buffer = 0; /* unnecessary, but keeps Purify quiet */
  194|  5.59k|  entropy->pub.insufficient_data = FALSE;
  ------------------
  |  |  245|  5.59k|#define FALSE   0               /* values of boolean */
  ------------------
  195|       |
  196|       |  /* Initialize private state variables */
  197|  5.59k|  entropy->saved.EOBRUN = 0;
  198|       |
  199|       |  /* Initialize restart counter */
  200|  5.59k|  entropy->restarts_to_go = cinfo->restart_interval;
  201|  5.59k|}
jdphuff.c:decode_mcu_DC_first:
  301|  2.28M|{
  302|  2.28M|  phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
  303|  2.28M|  int Al = cinfo->Al;
  304|  2.28M|  register int s, r;
  305|  2.28M|  int blkn, ci;
  306|  2.28M|  JBLOCKROW block;
  307|  2.28M|  BITREAD_STATE_VARS;
  ------------------
  |  |  116|  2.28M|  register bit_buf_type get_buffer; \
  |  |  117|  2.28M|  register int bits_left; \
  |  |  118|  2.28M|  bitread_working_state br_state
  ------------------
  308|  2.28M|  savable_state state;
  309|  2.28M|  d_derived_tbl *tbl;
  310|  2.28M|  jpeg_component_info *compptr;
  311|       |
  312|       |  /* Process restart marker if needed; may have to suspend */
  313|  2.28M|  if (cinfo->restart_interval) {
  ------------------
  |  Branch (313:7): [True: 416k, False: 1.86M]
  ------------------
  314|   416k|    if (entropy->restarts_to_go == 0)
  ------------------
  |  Branch (314:9): [True: 152k, False: 263k]
  ------------------
  315|   152k|      if (!process_restart(cinfo))
  ------------------
  |  Branch (315:11): [True: 0, False: 152k]
  ------------------
  316|      0|        return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  317|   416k|  }
  318|       |
  319|       |  /* If we've run out of data, just leave the MCU set to zeroes.
  320|       |   * This way, we return uniform gray for the remainder of the segment.
  321|       |   */
  322|  2.28M|  if (!entropy->pub.insufficient_data) {
  ------------------
  |  Branch (322:7): [True: 33.7k, False: 2.25M]
  ------------------
  323|       |
  324|       |    /* Load up working state */
  325|  33.7k|    BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
  ------------------
  |  |  121|  33.7k|  br_state.cinfo = cinfop; \
  |  |  122|  33.7k|  br_state.next_input_byte = cinfop->src->next_input_byte; \
  |  |  123|  33.7k|  br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
  |  |  124|  33.7k|  get_buffer = permstate.get_buffer; \
  |  |  125|  33.7k|  bits_left = permstate.bits_left;
  ------------------
  326|  33.7k|    ASSIGN_STATE(state, entropy->saved);
  ------------------
  |  |   50|  33.7k|#define ASSIGN_STATE(dest, src)  ((dest) = (src))
  ------------------
  327|       |
  328|       |    /* Outer loop handles each block in the MCU */
  329|       |
  330|   138k|    for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  ------------------
  |  Branch (330:20): [True: 104k, False: 33.7k]
  ------------------
  331|   104k|      block = MCU_data[blkn];
  332|   104k|      ci = cinfo->MCU_membership[blkn];
  333|   104k|      compptr = cinfo->cur_comp_info[ci];
  334|   104k|      tbl = entropy->derived_tbls[compptr->dc_tbl_no];
  335|       |
  336|       |      /* Decode a single block's worth of coefficients */
  337|       |
  338|       |      /* Section F.2.2.1: decode the DC coefficient difference */
  339|   104k|      HUFF_DECODE(s, br_state, tbl, return FALSE, label1);
  ------------------
  |  |  191|   104k|#define HUFF_DECODE(result, state, htbl, failaction, slowlabel) { \
  |  |  192|   104k|  register int nb, look; \
  |  |  193|   104k|  if (bits_left < HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|   104k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (193:7): [True: 11.3k, False: 92.9k]
  |  |  ------------------
  |  |  194|  11.3k|    if (!jpeg_fill_bit_buffer(&state, get_buffer, bits_left, 0)) \
  |  |  ------------------
  |  |  |  Branch (194:9): [True: 0, False: 11.3k]
  |  |  ------------------
  |  |  195|  11.3k|      { failaction; } \
  |  |  196|  11.3k|    get_buffer = state.get_buffer;  bits_left = state.bits_left; \
  |  |  197|  11.3k|    if (bits_left < HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  11.3k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (197:9): [True: 4.04k, False: 7.34k]
  |  |  ------------------
  |  |  198|  4.04k|      nb = 1;  goto slowlabel; \
  |  |  199|  4.04k|    } \
  |  |  200|  11.3k|  } \
  |  |  201|   104k|  look = PEEK_BITS(HUFF_LOOKAHEAD); \
  |  |  ------------------
  |  |  |  |  163|   100k|  (((int)(get_buffer >> (bits_left -  (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  202|   100k|  if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|   100k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |                 if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|   100k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (202:7): [True: 96.7k, False: 3.53k]
  |  |  ------------------
  |  |  203|  96.7k|    DROP_BITS(nb); \
  |  |  ------------------
  |  |  |  |  166|  96.7k|  (bits_left -= (nbits))
  |  |  ------------------
  |  |  204|  96.7k|    result = htbl->lookup[look] & ((1 << HUFF_LOOKAHEAD) - 1); \
  |  |  ------------------
  |  |  |  |   21|  96.7k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  205|  96.7k|  } else { \
  |  |  206|  7.57k|slowlabel: \
  |  |  207|  7.57k|    if ((result = \
  |  |  ------------------
  |  |  |  Branch (207:9): [True: 0, False: 7.57k]
  |  |  ------------------
  |  |  208|  7.57k|         jpeg_huff_decode(&state, get_buffer, bits_left, htbl, nb)) < 0) \
  |  |  209|  7.57k|      { failaction; } \
  |  |  210|  7.57k|    get_buffer = state.get_buffer;  bits_left = state.bits_left; \
  |  |  211|  7.57k|  } \
  |  |  212|   100k|}
  ------------------
  340|   104k|      if (s) {
  ------------------
  |  Branch (340:11): [True: 87.8k, False: 16.4k]
  ------------------
  341|  87.8k|        CHECK_BIT_BUFFER(br_state, s, return FALSE);
  ------------------
  |  |  151|  87.8k|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|  87.8k|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 6.85k, False: 81.0k]
  |  |  ------------------
  |  |  153|  6.85k|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 6.85k]
  |  |  ------------------
  |  |  154|  6.85k|      { action; } \
  |  |  155|  6.85k|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|  6.85k|  } \
  |  |  157|  87.8k|}
  ------------------
  342|  87.8k|        r = GET_BITS(s);
  ------------------
  |  |  160|  87.8k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  ------------------
  343|  87.8k|        s = HUFF_EXTEND(r, s);
  ------------------
  |  |  214|  87.8k|  ((x) < (1 << ((s) - 1)) ? (x) + (((NEG_1) << (s)) + 1) : (x))
  |  |  ------------------
  |  |  |  |  212|  66.3k|#define NEG_1  ((unsigned)-1)
  |  |  ------------------
  |  |  |  Branch (214:4): [True: 66.3k, False: 21.5k]
  |  |  ------------------
  ------------------
  344|  87.8k|      }
  345|       |
  346|       |      /* Convert DC difference to actual value, update last_dc_val */
  347|   104k|      if ((state.last_dc_val[ci] >= 0 &&
  ------------------
  |  Branch (347:12): [True: 42.4k, False: 61.9k]
  ------------------
  348|   104k|           s > INT_MAX - state.last_dc_val[ci]) ||
  ------------------
  |  Branch (348:12): [True: 0, False: 42.4k]
  ------------------
  349|   104k|          (state.last_dc_val[ci] < 0 && s < INT_MIN - state.last_dc_val[ci]))
  ------------------
  |  Branch (349:12): [True: 61.9k, False: 42.4k]
  |  Branch (349:41): [True: 0, False: 61.9k]
  ------------------
  350|      0|        ERREXIT(cinfo, JERR_BAD_DCT_COEF);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  351|   104k|      s += state.last_dc_val[ci];
  352|   104k|      state.last_dc_val[ci] = s;
  353|       |      /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
  354|   104k|      (*block)[0] = (JCOEF)LEFT_SHIFT(s, Al);
  ------------------
  |  |   56|   104k|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
  355|   104k|    }
  356|       |
  357|       |    /* Completed MCU, so update state */
  358|  33.7k|    BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
  ------------------
  |  |  128|  33.7k|  cinfop->src->next_input_byte = br_state.next_input_byte; \
  |  |  129|  33.7k|  cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
  |  |  130|  33.7k|  permstate.get_buffer = get_buffer; \
  |  |  131|  33.7k|  permstate.bits_left = bits_left
  ------------------
  359|  33.7k|    ASSIGN_STATE(entropy->saved, state);
  ------------------
  |  |   50|  33.7k|#define ASSIGN_STATE(dest, src)  ((dest) = (src))
  ------------------
  360|  33.7k|  }
  361|       |
  362|       |  /* Account for restart interval (no-op if not using restarts) */
  363|  2.28M|  if (cinfo->restart_interval)
  ------------------
  |  Branch (363:7): [True: 416k, False: 1.86M]
  ------------------
  364|   416k|    entropy->restarts_to_go--;
  365|       |
  366|  2.28M|  return TRUE;
  ------------------
  |  |  248|  2.28M|#define TRUE    1
  ------------------
  367|  2.28M|}
jdphuff.c:process_restart:
  243|   256k|{
  244|   256k|  phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
  245|   256k|  int ci;
  246|       |
  247|       |  /* Throw away any unused bits remaining in bit buffer; */
  248|       |  /* include any full bytes in next_marker's count of discarded bytes */
  249|   256k|  cinfo->marker->discarded_bytes += entropy->bitstate.bits_left / 8;
  250|   256k|  entropy->bitstate.bits_left = 0;
  251|       |
  252|       |  /* Advance past the RSTn marker */
  253|   256k|  if (!(*cinfo->marker->read_restart_marker) (cinfo))
  ------------------
  |  Branch (253:7): [True: 0, False: 256k]
  ------------------
  254|      0|    return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  255|       |
  256|       |  /* Re-initialize DC predictions to 0 */
  257|   543k|  for (ci = 0; ci < cinfo->comps_in_scan; ci++)
  ------------------
  |  Branch (257:16): [True: 286k, False: 256k]
  ------------------
  258|   286k|    entropy->saved.last_dc_val[ci] = 0;
  259|       |  /* Re-init EOB run count, too */
  260|   256k|  entropy->saved.EOBRUN = 0;
  261|       |
  262|       |  /* Reset restart counter */
  263|   256k|  entropy->restarts_to_go = cinfo->restart_interval;
  264|       |
  265|       |  /* Reset out-of-data flag, unless read_restart_marker left us smack up
  266|       |   * against a marker.  In that case we will end up treating the next data
  267|       |   * segment as empty, and we can avoid producing bogus output pixels by
  268|       |   * leaving the flag set.
  269|       |   */
  270|   256k|  if (cinfo->unread_marker == 0)
  ------------------
  |  Branch (270:7): [True: 4.82k, False: 252k]
  ------------------
  271|  4.82k|    entropy->pub.insufficient_data = FALSE;
  ------------------
  |  |  245|  4.82k|#define FALSE   0               /* values of boolean */
  ------------------
  272|       |
  273|   256k|  return TRUE;
  ------------------
  |  |  248|   256k|#define TRUE    1
  ------------------
  274|   256k|}
jdphuff.c:decode_mcu_AC_first:
  377|  1.03M|{
  378|  1.03M|  phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
  379|  1.03M|  int Se = cinfo->Se;
  380|  1.03M|  int Al = cinfo->Al;
  381|  1.03M|  register int s, k, r;
  382|  1.03M|  unsigned int EOBRUN;
  383|  1.03M|  JBLOCKROW block;
  384|  1.03M|  BITREAD_STATE_VARS;
  ------------------
  |  |  116|  1.03M|  register bit_buf_type get_buffer; \
  |  |  117|  1.03M|  register int bits_left; \
  |  |  118|  1.03M|  bitread_working_state br_state
  ------------------
  385|  1.03M|  d_derived_tbl *tbl;
  386|       |
  387|       |  /* Process restart marker if needed; may have to suspend */
  388|  1.03M|  if (cinfo->restart_interval) {
  ------------------
  |  Branch (388:7): [True: 522k, False: 516k]
  ------------------
  389|   522k|    if (entropy->restarts_to_go == 0)
  ------------------
  |  Branch (389:9): [True: 8.46k, False: 513k]
  ------------------
  390|  8.46k|      if (!process_restart(cinfo))
  ------------------
  |  Branch (390:11): [True: 0, False: 8.46k]
  ------------------
  391|      0|        return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  392|   522k|  }
  393|       |
  394|       |  /* If we've run out of data, just leave the MCU set to zeroes.
  395|       |   * This way, we return uniform gray for the remainder of the segment.
  396|       |   */
  397|  1.03M|  if (!entropy->pub.insufficient_data) {
  ------------------
  |  Branch (397:7): [True: 43.3k, False: 995k]
  ------------------
  398|       |
  399|       |    /* Load up working state.
  400|       |     * We can avoid loading/saving bitread state if in an EOB run.
  401|       |     */
  402|  43.3k|    EOBRUN = entropy->saved.EOBRUN;     /* only part of saved state we need */
  403|       |
  404|       |    /* There is always only one block per MCU */
  405|       |
  406|  43.3k|    if (EOBRUN > 0)             /* if it's a band of zeroes... */
  ------------------
  |  Branch (406:9): [True: 21.0k, False: 22.3k]
  ------------------
  407|  21.0k|      EOBRUN--;                 /* ...process it now (we do nothing) */
  408|  22.3k|    else {
  409|  22.3k|      BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
  ------------------
  |  |  121|  22.3k|  br_state.cinfo = cinfop; \
  |  |  122|  22.3k|  br_state.next_input_byte = cinfop->src->next_input_byte; \
  |  |  123|  22.3k|  br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
  |  |  124|  22.3k|  get_buffer = permstate.get_buffer; \
  |  |  125|  22.3k|  bits_left = permstate.bits_left;
  ------------------
  410|  22.3k|      block = MCU_data[0];
  411|  22.3k|      tbl = entropy->ac_derived_tbl;
  412|       |
  413|   103k|      for (k = cinfo->Ss; k <= Se; k++) {
  ------------------
  |  Branch (413:27): [True: 86.7k, False: 17.1k]
  ------------------
  414|  86.7k|        HUFF_DECODE(s, br_state, tbl, return FALSE, label2);
  ------------------
  |  |  191|  86.7k|#define HUFF_DECODE(result, state, htbl, failaction, slowlabel) { \
  |  |  192|  86.7k|  register int nb, look; \
  |  |  193|  86.7k|  if (bits_left < HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  86.7k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (193:7): [True: 12.2k, False: 74.4k]
  |  |  ------------------
  |  |  194|  12.2k|    if (!jpeg_fill_bit_buffer(&state, get_buffer, bits_left, 0)) \
  |  |  ------------------
  |  |  |  Branch (194:9): [True: 0, False: 12.2k]
  |  |  ------------------
  |  |  195|  12.2k|      { failaction; } \
  |  |  196|  12.2k|    get_buffer = state.get_buffer;  bits_left = state.bits_left; \
  |  |  197|  12.2k|    if (bits_left < HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  12.2k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (197:9): [True: 4.35k, False: 7.88k]
  |  |  ------------------
  |  |  198|  4.35k|      nb = 1;  goto slowlabel; \
  |  |  199|  4.35k|    } \
  |  |  200|  12.2k|  } \
  |  |  201|  86.7k|  look = PEEK_BITS(HUFF_LOOKAHEAD); \
  |  |  ------------------
  |  |  |  |  163|  82.3k|  (((int)(get_buffer >> (bits_left -  (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  202|  82.3k|  if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  82.3k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |                 if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  82.3k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (202:7): [True: 81.4k, False: 972]
  |  |  ------------------
  |  |  203|  81.4k|    DROP_BITS(nb); \
  |  |  ------------------
  |  |  |  |  166|  81.4k|  (bits_left -= (nbits))
  |  |  ------------------
  |  |  204|  81.4k|    result = htbl->lookup[look] & ((1 << HUFF_LOOKAHEAD) - 1); \
  |  |  ------------------
  |  |  |  |   21|  81.4k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  205|  81.4k|  } else { \
  |  |  206|  5.32k|slowlabel: \
  |  |  207|  5.32k|    if ((result = \
  |  |  ------------------
  |  |  |  Branch (207:9): [True: 0, False: 5.32k]
  |  |  ------------------
  |  |  208|  5.32k|         jpeg_huff_decode(&state, get_buffer, bits_left, htbl, nb)) < 0) \
  |  |  209|  5.32k|      { failaction; } \
  |  |  210|  5.32k|    get_buffer = state.get_buffer;  bits_left = state.bits_left; \
  |  |  211|  5.32k|  } \
  |  |  212|  82.3k|}
  ------------------
  415|  86.7k|        r = s >> 4;
  416|  86.7k|        s &= 15;
  417|  86.7k|        if (s) {
  ------------------
  |  Branch (417:13): [True: 77.3k, False: 9.35k]
  ------------------
  418|  77.3k|          k += r;
  419|  77.3k|          CHECK_BIT_BUFFER(br_state, s, return FALSE);
  ------------------
  |  |  151|  77.3k|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|  77.3k|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 2.20k, False: 75.1k]
  |  |  ------------------
  |  |  153|  2.20k|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 2.20k]
  |  |  ------------------
  |  |  154|  2.20k|      { action; } \
  |  |  155|  2.20k|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|  2.20k|  } \
  |  |  157|  77.3k|}
  ------------------
  420|  77.3k|          r = GET_BITS(s);
  ------------------
  |  |  160|  77.3k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  ------------------
  421|  77.3k|          s = HUFF_EXTEND(r, s);
  ------------------
  |  |  214|  77.3k|  ((x) < (1 << ((s) - 1)) ? (x) + (((NEG_1) << (s)) + 1) : (x))
  |  |  ------------------
  |  |  |  |  212|  33.8k|#define NEG_1  ((unsigned)-1)
  |  |  ------------------
  |  |  |  Branch (214:4): [True: 33.8k, False: 43.5k]
  |  |  ------------------
  ------------------
  422|       |          /* Scale and output coefficient in natural (dezigzagged) order */
  423|  77.3k|          (*block)[jpeg_natural_order[k]] = (JCOEF)LEFT_SHIFT(s, Al);
  ------------------
  |  |   56|  77.3k|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
  424|  77.3k|        } else {
  425|  9.35k|          if (r == 15) {        /* ZRL */
  ------------------
  |  Branch (425:15): [True: 4.12k, False: 5.23k]
  ------------------
  426|  4.12k|            k += 15;            /* skip 15 zeroes in band */
  427|  5.23k|          } else {              /* EOBr, run length is 2^r + appended bits */
  428|  5.23k|            EOBRUN = 1 << r;
  429|  5.23k|            if (r) {            /* EOBr, r > 0 */
  ------------------
  |  Branch (429:17): [True: 759, False: 4.47k]
  ------------------
  430|    759|              CHECK_BIT_BUFFER(br_state, r, return FALSE);
  ------------------
  |  |  151|    759|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|    759|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 229, False: 530]
  |  |  ------------------
  |  |  153|    229|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 229]
  |  |  ------------------
  |  |  154|    229|      { action; } \
  |  |  155|    229|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|    229|  } \
  |  |  157|    759|}
  ------------------
  431|    759|              r = GET_BITS(r);
  ------------------
  |  |  160|    759|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  ------------------
  432|    759|              EOBRUN += r;
  433|    759|            }
  434|  5.23k|            EOBRUN--;           /* this band is processed at this moment */
  435|  5.23k|            break;              /* force end-of-band */
  436|  5.23k|          }
  437|  9.35k|        }
  438|  86.7k|      }
  439|       |
  440|  22.3k|      BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
  ------------------
  |  |  128|  22.3k|  cinfop->src->next_input_byte = br_state.next_input_byte; \
  |  |  129|  22.3k|  cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
  |  |  130|  22.3k|  permstate.get_buffer = get_buffer; \
  |  |  131|  22.3k|  permstate.bits_left = bits_left
  ------------------
  441|  22.3k|    }
  442|       |
  443|       |    /* Completed MCU, so update state */
  444|  43.3k|    entropy->saved.EOBRUN = EOBRUN;     /* only part of saved state we need */
  445|  43.3k|  }
  446|       |
  447|       |  /* Account for restart interval (no-op if not using restarts) */
  448|  1.03M|  if (cinfo->restart_interval)
  ------------------
  |  Branch (448:7): [True: 522k, False: 516k]
  ------------------
  449|   522k|    entropy->restarts_to_go--;
  450|       |
  451|  1.03M|  return TRUE;
  ------------------
  |  |  248|  1.03M|#define TRUE    1
  ------------------
  452|  1.03M|}
jdphuff.c:decode_mcu_DC_refine:
  463|   694k|{
  464|   694k|  phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
  465|   694k|  int p1 = 1 << cinfo->Al;      /* 1 in the bit position being coded */
  466|   694k|  int blkn;
  467|   694k|  JBLOCKROW block;
  468|   694k|  BITREAD_STATE_VARS;
  ------------------
  |  |  116|   694k|  register bit_buf_type get_buffer; \
  |  |  117|   694k|  register int bits_left; \
  |  |  118|   694k|  bitread_working_state br_state
  ------------------
  469|       |
  470|       |  /* Process restart marker if needed; may have to suspend */
  471|   694k|  if (cinfo->restart_interval) {
  ------------------
  |  Branch (471:7): [True: 219k, False: 475k]
  ------------------
  472|   219k|    if (entropy->restarts_to_go == 0)
  ------------------
  |  Branch (472:9): [True: 84.7k, False: 134k]
  ------------------
  473|  84.7k|      if (!process_restart(cinfo))
  ------------------
  |  Branch (473:11): [True: 0, False: 84.7k]
  ------------------
  474|      0|        return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  475|   219k|  }
  476|       |
  477|       |  /* Not worth the cycles to check insufficient_data here,
  478|       |   * since we will not change the data anyway if we read zeroes.
  479|       |   */
  480|       |
  481|       |  /* Load up working state */
  482|   694k|  BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
  ------------------
  |  |  121|   694k|  br_state.cinfo = cinfop; \
  |  |  122|   694k|  br_state.next_input_byte = cinfop->src->next_input_byte; \
  |  |  123|   694k|  br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
  |  |  124|   694k|  get_buffer = permstate.get_buffer; \
  |  |  125|   694k|  bits_left = permstate.bits_left;
  ------------------
  483|       |
  484|       |  /* Outer loop handles each block in the MCU */
  485|       |
  486|  1.64M|  for (blkn = 0; blkn < cinfo->blocks_in_MCU; blkn++) {
  ------------------
  |  Branch (486:18): [True: 952k, False: 694k]
  ------------------
  487|   952k|    block = MCU_data[blkn];
  488|       |
  489|       |    /* Encoded data is simply the next bit of the two's-complement DC value */
  490|   952k|    CHECK_BIT_BUFFER(br_state, 1, return FALSE);
  ------------------
  |  |  151|   952k|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|   952k|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 98.3k, False: 854k]
  |  |  ------------------
  |  |  153|  98.3k|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 98.3k]
  |  |  ------------------
  |  |  154|  98.3k|      { action; } \
  |  |  155|  98.3k|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|  98.3k|  } \
  |  |  157|   952k|}
  ------------------
  491|   952k|    if (GET_BITS(1))
  ------------------
  |  |  160|   952k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  |  Branch (160:3): [True: 14.9k, False: 937k]
  |  |  ------------------
  ------------------
  492|  14.9k|      (*block)[0] |= p1;
  493|       |    /* Note: since we use |=, repeating the assignment later is safe */
  494|   952k|  }
  495|       |
  496|       |  /* Completed MCU, so update state */
  497|   694k|  BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
  ------------------
  |  |  128|   694k|  cinfop->src->next_input_byte = br_state.next_input_byte; \
  |  |  129|   694k|  cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
  |  |  130|   694k|  permstate.get_buffer = get_buffer; \
  |  |  131|   694k|  permstate.bits_left = bits_left
  ------------------
  498|       |
  499|       |  /* Account for restart interval (no-op if not using restarts) */
  500|   694k|  if (cinfo->restart_interval)
  ------------------
  |  Branch (500:7): [True: 219k, False: 475k]
  ------------------
  501|   219k|    entropy->restarts_to_go--;
  502|       |
  503|   694k|  return TRUE;
  ------------------
  |  |  248|   694k|#define TRUE    1
  ------------------
  504|   694k|}
jdphuff.c:decode_mcu_AC_refine:
  513|  1.55M|{
  514|  1.55M|  phuff_entropy_ptr entropy = (phuff_entropy_ptr)cinfo->entropy;
  515|  1.55M|  int Se = cinfo->Se;
  516|  1.55M|  int p1 = 1 << cinfo->Al;        /* 1 in the bit position being coded */
  517|  1.55M|  int m1 = (NEG_1) << cinfo->Al;  /* -1 in the bit position being coded */
  ------------------
  |  |  212|  1.55M|#define NEG_1  ((unsigned)-1)
  ------------------
  518|  1.55M|  register int s, k, r;
  519|  1.55M|  unsigned int EOBRUN;
  520|  1.55M|  JBLOCKROW block;
  521|  1.55M|  JCOEFPTR thiscoef;
  522|  1.55M|  BITREAD_STATE_VARS;
  ------------------
  |  |  116|  1.55M|  register bit_buf_type get_buffer; \
  |  |  117|  1.55M|  register int bits_left; \
  |  |  118|  1.55M|  bitread_working_state br_state
  ------------------
  523|  1.55M|  d_derived_tbl *tbl;
  524|  1.55M|  int num_newnz;
  525|  1.55M|  int newnz_pos[DCTSIZE2];
  526|       |
  527|       |  /* Process restart marker if needed; may have to suspend */
  528|  1.55M|  if (cinfo->restart_interval) {
  ------------------
  |  Branch (528:7): [True: 664k, False: 891k]
  ------------------
  529|   664k|    if (entropy->restarts_to_go == 0)
  ------------------
  |  Branch (529:9): [True: 11.2k, False: 653k]
  ------------------
  530|  11.2k|      if (!process_restart(cinfo))
  ------------------
  |  Branch (530:11): [True: 0, False: 11.2k]
  ------------------
  531|      0|        return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  532|   664k|  }
  533|       |
  534|       |  /* If we've run out of data, don't modify the MCU.
  535|       |   */
  536|  1.55M|  if (!entropy->pub.insufficient_data) {
  ------------------
  |  Branch (536:7): [True: 47.8k, False: 1.50M]
  ------------------
  537|       |
  538|       |    /* Load up working state */
  539|  47.8k|    BITREAD_LOAD_STATE(cinfo, entropy->bitstate);
  ------------------
  |  |  121|  47.8k|  br_state.cinfo = cinfop; \
  |  |  122|  47.8k|  br_state.next_input_byte = cinfop->src->next_input_byte; \
  |  |  123|  47.8k|  br_state.bytes_in_buffer = cinfop->src->bytes_in_buffer; \
  |  |  124|  47.8k|  get_buffer = permstate.get_buffer; \
  |  |  125|  47.8k|  bits_left = permstate.bits_left;
  ------------------
  540|  47.8k|    EOBRUN = entropy->saved.EOBRUN; /* only part of saved state we need */
  541|       |
  542|       |    /* There is always only one block per MCU */
  543|  47.8k|    block = MCU_data[0];
  544|  47.8k|    tbl = entropy->ac_derived_tbl;
  545|       |
  546|       |    /* If we are forced to suspend, we must undo the assignments to any newly
  547|       |     * nonzero coefficients in the block, because otherwise we'd get confused
  548|       |     * next time about which coefficients were already nonzero.
  549|       |     * But we need not undo addition of bits to already-nonzero coefficients;
  550|       |     * instead, we can test the current bit to see if we already did it.
  551|       |     */
  552|  47.8k|    num_newnz = 0;
  553|       |
  554|       |    /* initialize coefficient loop counter to start of band */
  555|  47.8k|    k = cinfo->Ss;
  556|       |
  557|  47.8k|    if (EOBRUN == 0) {
  ------------------
  |  Branch (557:9): [True: 25.2k, False: 22.5k]
  ------------------
  558|  82.1k|      for (; k <= Se; k++) {
  ------------------
  |  Branch (558:14): [True: 70.5k, False: 11.6k]
  ------------------
  559|  70.5k|        HUFF_DECODE(s, br_state, tbl, goto undoit, label3);
  ------------------
  |  |  191|  70.5k|#define HUFF_DECODE(result, state, htbl, failaction, slowlabel) { \
  |  |  192|  70.5k|  register int nb, look; \
  |  |  193|  70.5k|  if (bits_left < HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  70.5k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (193:7): [True: 11.2k, False: 59.2k]
  |  |  ------------------
  |  |  194|  11.2k|    if (!jpeg_fill_bit_buffer(&state, get_buffer, bits_left, 0)) \
  |  |  ------------------
  |  |  |  Branch (194:9): [True: 0, False: 11.2k]
  |  |  ------------------
  |  |  195|  11.2k|      { failaction; } \
  |  |  196|  11.2k|    get_buffer = state.get_buffer;  bits_left = state.bits_left; \
  |  |  197|  11.2k|    if (bits_left < HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  11.2k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (197:9): [True: 4.72k, False: 6.55k]
  |  |  ------------------
  |  |  198|  4.72k|      nb = 1;  goto slowlabel; \
  |  |  199|  4.72k|    } \
  |  |  200|  11.2k|  } \
  |  |  201|  70.5k|  look = PEEK_BITS(HUFF_LOOKAHEAD); \
  |  |  ------------------
  |  |  |  |  163|  65.8k|  (((int)(get_buffer >> (bits_left -  (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  202|  65.8k|  if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  65.8k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |                 if ((nb = (htbl->lookup[look] >> HUFF_LOOKAHEAD)) <= HUFF_LOOKAHEAD) { \
  |  |  ------------------
  |  |  |  |   21|  65.8k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  |  Branch (202:7): [True: 64.5k, False: 1.23k]
  |  |  ------------------
  |  |  203|  64.5k|    DROP_BITS(nb); \
  |  |  ------------------
  |  |  |  |  166|  64.5k|  (bits_left -= (nbits))
  |  |  ------------------
  |  |  204|  64.5k|    result = htbl->lookup[look] & ((1 << HUFF_LOOKAHEAD) - 1); \
  |  |  ------------------
  |  |  |  |   21|  64.5k|#define HUFF_LOOKAHEAD  8       /* # of bits of lookahead */
  |  |  ------------------
  |  |  205|  64.5k|  } else { \
  |  |  206|  5.95k|slowlabel: \
  |  |  207|  5.95k|    if ((result = \
  |  |  ------------------
  |  |  |  Branch (207:9): [True: 0, False: 5.95k]
  |  |  ------------------
  |  |  208|  5.95k|         jpeg_huff_decode(&state, get_buffer, bits_left, htbl, nb)) < 0) \
  |  |  209|  5.95k|      { failaction; } \
  |  |  210|  5.95k|    get_buffer = state.get_buffer;  bits_left = state.bits_left; \
  |  |  211|  5.95k|  } \
  |  |  212|  65.8k|}
  ------------------
  560|  70.5k|        r = s >> 4;
  561|  70.5k|        s &= 15;
  562|  70.5k|        if (s) {
  ------------------
  |  Branch (562:13): [True: 54.6k, False: 15.8k]
  ------------------
  563|  54.6k|          if (s != 1)           /* size of new coef should always be 1 */
  ------------------
  |  Branch (563:15): [True: 33.1k, False: 21.5k]
  ------------------
  564|  33.1k|            WARNMS(cinfo, JWRN_HUFF_BAD_CODE);
  ------------------
  |  |  265|  33.1k|  ((cinfo)->err->msg_code = (code), \
  |  |  266|  33.1k|   (*(cinfo)->err->emit_message) ((j_common_ptr)(cinfo), -1))
  ------------------
  565|  54.6k|          CHECK_BIT_BUFFER(br_state, 1, goto undoit);
  ------------------
  |  |  151|  54.6k|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|  54.6k|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 696, False: 53.9k]
  |  |  ------------------
  |  |  153|    696|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 696]
  |  |  ------------------
  |  |  154|    696|      { action; } \
  |  |  155|    696|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|    696|  } \
  |  |  157|  54.6k|}
  ------------------
  566|  54.6k|          if (GET_BITS(1))
  ------------------
  |  |  160|  54.6k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  |  Branch (160:3): [True: 18.2k, False: 36.4k]
  |  |  ------------------
  ------------------
  567|  18.2k|            s = p1;             /* newly nonzero coef is positive */
  568|  36.4k|          else
  569|  36.4k|            s = m1;             /* newly nonzero coef is negative */
  570|  54.6k|        } else {
  571|  15.8k|          if (r != 15) {
  ------------------
  |  Branch (571:15): [True: 13.6k, False: 2.25k]
  ------------------
  572|  13.6k|            EOBRUN = 1 << r;    /* EOBr, run length is 2^r + appended bits */
  573|  13.6k|            if (r) {
  ------------------
  |  Branch (573:17): [True: 3.88k, False: 9.75k]
  ------------------
  574|  3.88k|              CHECK_BIT_BUFFER(br_state, r, goto undoit);
  ------------------
  |  |  151|  3.88k|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|  3.88k|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 371, False: 3.51k]
  |  |  ------------------
  |  |  153|    371|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 371]
  |  |  ------------------
  |  |  154|    371|      { action; } \
  |  |  155|    371|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|    371|  } \
  |  |  157|  3.88k|}
  ------------------
  575|  3.88k|              r = GET_BITS(r);
  ------------------
  |  |  160|  3.88k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  ------------------
  576|  3.88k|              EOBRUN += r;
  577|  3.88k|            }
  578|  13.6k|            break;              /* rest of block is handled by EOB logic */
  579|  13.6k|          }
  580|       |          /* note s = 0 for processing ZRL */
  581|  15.8k|        }
  582|       |        /* Advance over already-nonzero coefs and r still-zero coefs,
  583|       |         * appending correction bits to the nonzeroes.  A correction bit is 1
  584|       |         * if the absolute value of the coefficient must be increased.
  585|       |         */
  586|   308k|        do {
  587|   308k|          thiscoef = *block + jpeg_natural_order[k];
  588|   308k|          if (*thiscoef != 0) {
  ------------------
  |  Branch (588:15): [True: 124k, False: 183k]
  ------------------
  589|   124k|            CHECK_BIT_BUFFER(br_state, 1, goto undoit);
  ------------------
  |  |  151|   124k|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|   124k|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 1.61k, False: 123k]
  |  |  ------------------
  |  |  153|  1.61k|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 1.61k]
  |  |  ------------------
  |  |  154|  1.61k|      { action; } \
  |  |  155|  1.61k|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|  1.61k|  } \
  |  |  157|   124k|}
  ------------------
  590|   124k|            if (GET_BITS(1)) {
  ------------------
  |  |  160|   124k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  |  Branch (160:3): [True: 38.3k, False: 86.5k]
  |  |  ------------------
  ------------------
  591|  38.3k|              if ((*thiscoef & p1) == 0) { /* do nothing if already set it */
  ------------------
  |  Branch (591:19): [True: 6.90k, False: 31.4k]
  ------------------
  592|  6.90k|                if (*thiscoef >= 0)
  ------------------
  |  Branch (592:21): [True: 5.49k, False: 1.40k]
  ------------------
  593|  5.49k|                  *thiscoef += (JCOEF)p1;
  594|  1.40k|                else
  595|  1.40k|                  *thiscoef += (JCOEF)m1;
  596|  6.90k|              }
  597|  38.3k|            }
  598|   183k|          } else {
  599|   183k|            if (--r < 0)
  ------------------
  |  Branch (599:17): [True: 48.6k, False: 134k]
  ------------------
  600|  48.6k|              break;            /* reached target zero coefficient */
  601|   183k|          }
  602|   259k|          k++;
  603|   259k|        } while (k <= Se);
  ------------------
  |  Branch (603:18): [True: 251k, False: 8.26k]
  ------------------
  604|  56.9k|        if (s) {
  ------------------
  |  Branch (604:13): [True: 54.6k, False: 2.25k]
  ------------------
  605|  54.6k|          int pos = jpeg_natural_order[k];
  606|       |          /* Output newly nonzero coefficient */
  607|  54.6k|          (*block)[pos] = (JCOEF)s;
  608|       |          /* Remember its position in case we have to suspend */
  609|  54.6k|          newnz_pos[num_newnz++] = pos;
  610|  54.6k|        }
  611|  56.9k|      }
  612|  25.2k|    }
  613|       |
  614|  47.8k|    if (EOBRUN > 0) {
  ------------------
  |  Branch (614:9): [True: 36.2k, False: 11.6k]
  ------------------
  615|       |      /* Scan any remaining coefficient positions after the end-of-band
  616|       |       * (the last newly nonzero coefficient, if any).  Append a correction
  617|       |       * bit to each already-nonzero coefficient.  A correction bit is 1
  618|       |       * if the absolute value of the coefficient must be increased.
  619|       |       */
  620|   907k|      for (; k <= Se; k++) {
  ------------------
  |  Branch (620:14): [True: 871k, False: 36.2k]
  ------------------
  621|   871k|        thiscoef = *block + jpeg_natural_order[k];
  622|   871k|        if (*thiscoef != 0) {
  ------------------
  |  Branch (622:13): [True: 184k, False: 687k]
  ------------------
  623|   184k|          CHECK_BIT_BUFFER(br_state, 1, goto undoit);
  ------------------
  |  |  151|   184k|#define CHECK_BIT_BUFFER(state, nbits, action) { \
  |  |  152|   184k|  if (bits_left < (nbits)) { \
  |  |  ------------------
  |  |  |  Branch (152:7): [True: 2.75k, False: 181k]
  |  |  ------------------
  |  |  153|  2.75k|    if (!jpeg_fill_bit_buffer(&(state), get_buffer, bits_left, nbits)) \
  |  |  ------------------
  |  |  |  Branch (153:9): [True: 0, False: 2.75k]
  |  |  ------------------
  |  |  154|  2.75k|      { action; } \
  |  |  155|  2.75k|    get_buffer = (state).get_buffer;  bits_left = (state).bits_left; \
  |  |  156|  2.75k|  } \
  |  |  157|   184k|}
  ------------------
  624|   184k|          if (GET_BITS(1)) {
  ------------------
  |  |  160|   184k|  (((int)(get_buffer >> (bits_left -= (nbits)))) & ((1 << (nbits)) - 1))
  |  |  ------------------
  |  |  |  Branch (160:3): [True: 69.6k, False: 114k]
  |  |  ------------------
  ------------------
  625|  69.6k|            if ((*thiscoef & p1) == 0) { /* do nothing if already changed it */
  ------------------
  |  Branch (625:17): [True: 3.99k, False: 65.6k]
  ------------------
  626|  3.99k|              if (*thiscoef >= 0)
  ------------------
  |  Branch (626:19): [True: 2.60k, False: 1.38k]
  ------------------
  627|  2.60k|                *thiscoef += (JCOEF)p1;
  628|  1.38k|              else
  629|  1.38k|                *thiscoef += (JCOEF)m1;
  630|  3.99k|            }
  631|  69.6k|          }
  632|   184k|        }
  633|   871k|      }
  634|       |      /* Count one block completed in EOB run */
  635|  36.2k|      EOBRUN--;
  636|  36.2k|    }
  637|       |
  638|       |    /* Completed MCU, so update state */
  639|  47.8k|    BITREAD_SAVE_STATE(cinfo, entropy->bitstate);
  ------------------
  |  |  128|  47.8k|  cinfop->src->next_input_byte = br_state.next_input_byte; \
  |  |  129|  47.8k|  cinfop->src->bytes_in_buffer = br_state.bytes_in_buffer; \
  |  |  130|  47.8k|  permstate.get_buffer = get_buffer; \
  |  |  131|  47.8k|  permstate.bits_left = bits_left
  ------------------
  640|  47.8k|    entropy->saved.EOBRUN = EOBRUN; /* only part of saved state we need */
  641|  47.8k|  }
  642|       |
  643|       |  /* Account for restart interval (no-op if not using restarts) */
  644|  1.55M|  if (cinfo->restart_interval)
  ------------------
  |  Branch (644:7): [True: 664k, False: 891k]
  ------------------
  645|   664k|    entropy->restarts_to_go--;
  646|       |
  647|  1.55M|  return TRUE;
  ------------------
  |  |  248|  1.55M|#define TRUE    1
  ------------------
  648|       |
  649|      0|undoit:
  650|       |  /* Re-zero any output coefficients that we made newly nonzero */
  651|      0|  while (num_newnz > 0)
  ------------------
  |  Branch (651:10): [True: 0, False: 0]
  ------------------
  652|      0|    (*block)[newnz_pos[--num_newnz]] = 0;
  653|       |
  654|      0|  return FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  655|  1.55M|}

jinit_d_post_controller:
  255|  4.56k|{
  256|  4.56k|  my_post_ptr post;
  257|       |
  258|  4.56k|  post = (my_post_ptr)
  259|  4.56k|    (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  4.56k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  260|  4.56k|                                sizeof(my_post_controller));
  261|  4.56k|  cinfo->post = (struct jpeg_d_post_controller *)post;
  262|  4.56k|  post->pub.start_pass = start_pass_dpost;
  263|  4.56k|  post->whole_image = NULL;     /* flag for no virtual arrays */
  264|  4.56k|  post->buffer = NULL;          /* flag for no strip buffer */
  265|       |
  266|       |  /* Create the quantization buffer, if needed */
  267|  4.56k|  if (cinfo->quantize_colors) {
  ------------------
  |  Branch (267:7): [True: 0, False: 4.56k]
  ------------------
  268|       |    /* The buffer strip height is max_v_samp_factor, which is typically
  269|       |     * an efficient number of rows for upsampling to return.
  270|       |     * (In the presence of output rescaling, we might want to be smarter?)
  271|       |     */
  272|      0|    post->strip_height = (JDIMENSION)cinfo->max_v_samp_factor;
  273|      0|    if (need_full_buffer) {
  ------------------
  |  Branch (273:9): [True: 0, False: 0]
  ------------------
  274|       |      /* Two-pass color quantization: need full-image storage. */
  275|       |      /* We round up the number of rows to a multiple of the strip height. */
  276|      0|#ifdef QUANT_2PASS_SUPPORTED
  277|      0|      post->whole_image = (*cinfo->mem->request_virt_sarray)
  278|      0|        ((j_common_ptr)cinfo, JPOOL_IMAGE, FALSE,
  ------------------
  |  |  826|      0|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
                      ((j_common_ptr)cinfo, JPOOL_IMAGE, FALSE,
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  279|      0|         cinfo->output_width * cinfo->out_color_components,
  280|      0|         (JDIMENSION)jround_up((long)cinfo->output_height,
  281|      0|                               (long)post->strip_height),
  282|      0|         post->strip_height);
  283|       |#else
  284|       |      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  285|       |#endif /* QUANT_2PASS_SUPPORTED */
  286|      0|    } else {
  287|       |      /* One-pass color quantization: just make a strip buffer. */
  288|      0|      post->buffer = (*cinfo->mem->alloc_sarray)
  289|      0|        ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|      0|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  290|      0|         cinfo->output_width * cinfo->out_color_components,
  291|      0|         post->strip_height);
  292|      0|    }
  293|      0|  }
  294|  4.56k|}
jdpostct.c:start_pass_dpost:
   80|  3.60k|{
   81|  3.60k|  my_post_ptr post = (my_post_ptr)cinfo->post;
   82|       |
   83|  3.60k|  switch (pass_mode) {
   84|  3.60k|  case JBUF_PASS_THRU:
  ------------------
  |  Branch (84:3): [True: 3.60k, False: 0]
  ------------------
   85|  3.60k|    if (cinfo->quantize_colors) {
  ------------------
  |  Branch (85:9): [True: 0, False: 3.60k]
  ------------------
   86|       |      /* Single-pass processing with color quantization. */
   87|      0|      post->pub.post_process_data = post_process_1pass;
   88|       |      /* We could be doing buffered-image output before starting a 2-pass
   89|       |       * color quantization; in that case, jinit_d_post_controller did not
   90|       |       * allocate a strip buffer.  Use the virtual-array buffer as workspace.
   91|       |       */
   92|      0|      if (post->buffer == NULL) {
  ------------------
  |  Branch (92:11): [True: 0, False: 0]
  ------------------
   93|      0|        post->buffer = (*cinfo->mem->access_virt_sarray)
   94|      0|          ((j_common_ptr)cinfo, post->whole_image,
   95|      0|           (JDIMENSION)0, post->strip_height, TRUE);
  ------------------
  |  |  248|      0|#define TRUE    1
  ------------------
   96|      0|      }
   97|  3.60k|    } else {
   98|       |      /* For single-pass processing without color quantization,
   99|       |       * I have no work to do; just call the upsampler directly.
  100|       |       */
  101|  3.60k|      post->pub.post_process_data = cinfo->upsample->upsample;
  102|  3.60k|    }
  103|  3.60k|    break;
  104|      0|#ifdef QUANT_2PASS_SUPPORTED
  105|      0|  case JBUF_SAVE_AND_PASS:
  ------------------
  |  Branch (105:3): [True: 0, False: 3.60k]
  ------------------
  106|       |    /* First pass of 2-pass quantization */
  107|      0|    if (post->whole_image == NULL)
  ------------------
  |  Branch (107:9): [True: 0, False: 0]
  ------------------
  108|      0|      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  109|      0|    post->pub.post_process_data = post_process_prepass;
  110|      0|    break;
  111|      0|  case JBUF_CRANK_DEST:
  ------------------
  |  Branch (111:3): [True: 0, False: 3.60k]
  ------------------
  112|       |    /* Second pass of 2-pass quantization */
  113|      0|    if (post->whole_image == NULL)
  ------------------
  |  Branch (113:9): [True: 0, False: 0]
  ------------------
  114|      0|      ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  115|      0|    post->pub.post_process_data = post_process_2pass;
  116|      0|    break;
  117|      0|#endif /* QUANT_2PASS_SUPPORTED */
  118|      0|  default:
  ------------------
  |  Branch (118:3): [True: 0, False: 3.60k]
  ------------------
  119|      0|    ERREXIT(cinfo, JERR_BAD_BUFFER_MODE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  120|      0|    break;
  121|  3.60k|  }
  122|  3.60k|  post->starting_row = post->next_row = 0;
  123|  3.60k|}

jinit_upsampler:
  414|  4.43k|{
  415|  4.43k|  my_upsample_ptr upsample;
  416|  4.43k|  int ci;
  417|  4.43k|  jpeg_component_info *compptr;
  418|  4.43k|  boolean need_buffer, do_fancy;
  419|  4.43k|  int h_in_group, v_in_group, h_out_group, v_out_group;
  420|       |
  421|  4.43k|  if (!cinfo->master->jinit_upsampler_no_alloc) {
  ------------------
  |  Branch (421:7): [True: 4.43k, False: 0]
  ------------------
  422|  4.43k|    upsample = (my_upsample_ptr)
  423|  4.43k|      (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  4.43k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  424|  4.43k|                                  sizeof(my_upsampler));
  425|  4.43k|    cinfo->upsample = (struct jpeg_upsampler *)upsample;
  426|  4.43k|    upsample->pub.start_pass = start_pass_upsample;
  427|  4.43k|    upsample->pub.upsample = sep_upsample;
  428|  4.43k|    upsample->pub.need_context_rows = FALSE; /* until we find out differently */
  ------------------
  |  |  245|  4.43k|#define FALSE   0               /* values of boolean */
  ------------------
  429|  4.43k|  } else
  430|      0|    upsample = (my_upsample_ptr)cinfo->upsample;
  431|       |
  432|  4.43k|  if (cinfo->CCIR601_sampling)  /* this isn't supported */
  ------------------
  |  Branch (432:7): [True: 0, False: 4.43k]
  ------------------
  433|      0|    ERREXIT(cinfo, JERR_CCIR601_NOTIMPL);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  434|       |
  435|       |  /* jdmainct.c doesn't support context rows when min_DCT_scaled_size = 1,
  436|       |   * so don't ask for it.
  437|       |   */
  438|  4.43k|  do_fancy = cinfo->do_fancy_upsampling && cinfo->_min_DCT_scaled_size > 1;
  ------------------
  |  |   27|    899|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  |  Branch (438:14): [True: 899, False: 3.54k]
  |  Branch (438:44): [True: 899, False: 0]
  ------------------
  439|       |
  440|       |  /* Verify we can handle the sampling factors, select per-component methods,
  441|       |   * and create storage as needed.
  442|       |   */
  443|  13.1k|  for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (443:44): [True: 8.76k, False: 4.43k]
  ------------------
  444|  8.76k|       ci++, compptr++) {
  445|       |    /* Compute size of an "input group" after IDCT scaling.  This many samples
  446|       |     * are to be converted to max_h_samp_factor * max_v_samp_factor pixels.
  447|       |     */
  448|  8.76k|    h_in_group = (compptr->h_samp_factor * compptr->_DCT_scaled_size) /
  ------------------
  |  |   24|  8.76k|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  449|  8.76k|                 cinfo->_min_DCT_scaled_size;
  ------------------
  |  |   27|  8.76k|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  450|  8.76k|    v_in_group = (compptr->v_samp_factor * compptr->_DCT_scaled_size) /
  ------------------
  |  |   24|  8.76k|#define _DCT_scaled_size  DCT_scaled_size
  ------------------
  451|  8.76k|                 cinfo->_min_DCT_scaled_size;
  ------------------
  |  |   27|  8.76k|#define _min_DCT_scaled_size  min_DCT_scaled_size
  ------------------
  452|  8.76k|    h_out_group = cinfo->max_h_samp_factor;
  453|  8.76k|    v_out_group = cinfo->max_v_samp_factor;
  454|  8.76k|    upsample->rowgroup_height[ci] = v_in_group; /* save for use later */
  455|  8.76k|    need_buffer = TRUE;
  ------------------
  |  |  248|  8.76k|#define TRUE    1
  ------------------
  456|  8.76k|    if (!compptr->component_needed) {
  ------------------
  |  Branch (456:9): [True: 642, False: 8.11k]
  ------------------
  457|       |      /* Don't bother to upsample an uninteresting component. */
  458|    642|      upsample->methods[ci] = noop_upsample;
  459|    642|      need_buffer = FALSE;
  ------------------
  |  |  245|    642|#define FALSE   0               /* values of boolean */
  ------------------
  460|  8.11k|    } else if (h_in_group == h_out_group && v_in_group == v_out_group) {
  ------------------
  |  Branch (460:16): [True: 5.67k, False: 2.44k]
  |  Branch (460:45): [True: 4.25k, False: 1.41k]
  ------------------
  461|       |      /* Fullsize components can be processed without any work. */
  462|  4.25k|      upsample->methods[ci] = fullsize_upsample;
  463|  4.25k|      need_buffer = FALSE;
  ------------------
  |  |  245|  4.25k|#define FALSE   0               /* values of boolean */
  ------------------
  464|  4.25k|    } else if (h_in_group * 2 == h_out_group && v_in_group == v_out_group) {
  ------------------
  |  Branch (464:16): [True: 1.47k, False: 2.38k]
  |  Branch (464:49): [True: 737, False: 735]
  ------------------
  465|       |      /* Special cases for 2h1v upsampling */
  466|    737|      if (do_fancy && compptr->downsampled_width > 2) {
  ------------------
  |  Branch (466:11): [True: 160, False: 577]
  |  Branch (466:23): [True: 131, False: 29]
  ------------------
  467|    131|        if (jsimd_can_h2v1_fancy_upsample())
  ------------------
  |  Branch (467:13): [True: 131, False: 0]
  ------------------
  468|    131|          upsample->methods[ci] = jsimd_h2v1_fancy_upsample;
  469|      0|        else
  470|      0|          upsample->methods[ci] = h2v1_fancy_upsample;
  471|    606|      } else {
  472|    606|        if (jsimd_can_h2v1_upsample())
  ------------------
  |  Branch (472:13): [True: 606, False: 0]
  ------------------
  473|    606|          upsample->methods[ci] = jsimd_h2v1_upsample;
  474|      0|        else
  475|      0|          upsample->methods[ci] = h2v1_upsample;
  476|    606|      }
  477|  3.12k|    } else if (h_in_group == h_out_group &&
  ------------------
  |  Branch (477:16): [True: 1.41k, False: 1.71k]
  ------------------
  478|  3.12k|               v_in_group * 2 == v_out_group && do_fancy) {
  ------------------
  |  Branch (478:16): [True: 678, False: 733]
  |  Branch (478:49): [True: 225, False: 453]
  ------------------
  479|       |      /* Non-fancy upsampling is handled by the generic method */
  480|    225|      upsample->methods[ci] = h1v2_fancy_upsample;
  481|    225|      upsample->pub.need_context_rows = TRUE;
  ------------------
  |  |  248|    225|#define TRUE    1
  ------------------
  482|  2.89k|    } else if (h_in_group * 2 == h_out_group &&
  ------------------
  |  Branch (482:16): [True: 735, False: 2.16k]
  ------------------
  483|  2.89k|               v_in_group * 2 == v_out_group) {
  ------------------
  |  Branch (483:16): [True: 359, False: 376]
  ------------------
  484|       |      /* Special cases for 2h2v upsampling */
  485|    359|      if (do_fancy && compptr->downsampled_width > 2) {
  ------------------
  |  Branch (485:11): [True: 94, False: 265]
  |  Branch (485:23): [True: 75, False: 19]
  ------------------
  486|     75|        if (jsimd_can_h2v2_fancy_upsample())
  ------------------
  |  Branch (486:13): [True: 75, False: 0]
  ------------------
  487|     75|          upsample->methods[ci] = jsimd_h2v2_fancy_upsample;
  488|      0|        else
  489|      0|          upsample->methods[ci] = h2v2_fancy_upsample;
  490|     75|        upsample->pub.need_context_rows = TRUE;
  ------------------
  |  |  248|     75|#define TRUE    1
  ------------------
  491|    284|      } else {
  492|    284|        if (jsimd_can_h2v2_upsample())
  ------------------
  |  Branch (492:13): [True: 284, False: 0]
  ------------------
  493|    284|          upsample->methods[ci] = jsimd_h2v2_upsample;
  494|      0|        else
  495|      0|          upsample->methods[ci] = h2v2_upsample;
  496|    284|      }
  497|  2.53k|    } else if ((h_out_group % h_in_group) == 0 &&
  ------------------
  |  Branch (497:16): [True: 2.52k, False: 11]
  ------------------
  498|  2.53k|               (v_out_group % v_in_group) == 0) {
  ------------------
  |  Branch (498:16): [True: 2.49k, False: 34]
  ------------------
  499|       |      /* Generic integral-factors upsampling method */
  500|       |#if defined(__mips__)
  501|       |      if (jsimd_can_int_upsample())
  502|       |        upsample->methods[ci] = jsimd_int_upsample;
  503|       |      else
  504|       |#endif
  505|  2.49k|        upsample->methods[ci] = int_upsample;
  506|  2.49k|      upsample->h_expand[ci] = (UINT8)(h_out_group / h_in_group);
  507|  2.49k|      upsample->v_expand[ci] = (UINT8)(v_out_group / v_in_group);
  508|  2.49k|    } else
  509|     45|      ERREXIT(cinfo, JERR_FRACT_SAMPLE_NOTIMPL);
  ------------------
  |  |  231|     45|  ((cinfo)->err->msg_code = (code), \
  |  |  232|     45|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  510|  8.76k|    if (need_buffer && !cinfo->master->jinit_upsampler_no_alloc) {
  ------------------
  |  Branch (510:9): [True: 3.81k, False: 4.94k]
  |  Branch (510:24): [True: 3.81k, False: 0]
  ------------------
  511|  3.81k|      upsample->color_buf[ci] = (*cinfo->mem->alloc_sarray)
  512|  3.81k|        ((j_common_ptr)cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  3.81k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  513|  3.81k|         (JDIMENSION)jround_up((long)cinfo->output_width,
  514|  3.81k|                               (long)cinfo->max_h_samp_factor),
  515|  3.81k|         (JDIMENSION)cinfo->max_v_samp_factor);
  516|  3.81k|    }
  517|  8.76k|  }
  518|  4.43k|}
jdsample.c:start_pass_upsample:
   41|  3.52k|{
   42|  3.52k|  my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
   43|       |
   44|       |  /* Mark the conversion buffer empty */
   45|  3.52k|  upsample->next_row_out = cinfo->max_v_samp_factor;
   46|       |  /* Initialize total-height counter for detecting bottom of image */
   47|  3.52k|  upsample->rows_to_go = cinfo->output_height;
   48|  3.52k|}
jdsample.c:sep_upsample:
   64|  6.20M|{
   65|  6.20M|  my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
   66|  6.20M|  int ci;
   67|  6.20M|  jpeg_component_info *compptr;
   68|  6.20M|  JDIMENSION num_rows;
   69|       |
   70|       |  /* Fill the conversion buffer, if it's empty */
   71|  6.20M|  if (upsample->next_row_out >= cinfo->max_v_samp_factor) {
  ------------------
  |  Branch (71:7): [True: 6.20M, False: 0]
  ------------------
   72|  15.6M|    for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components;
  ------------------
  |  Branch (72:46): [True: 9.44M, False: 6.20M]
  ------------------
   73|  9.44M|         ci++, compptr++) {
   74|       |      /* Invoke per-component upsample method.  Notice we pass a POINTER
   75|       |       * to color_buf[ci], so that fullsize_upsample can change it.
   76|       |       */
   77|  9.44M|      (*upsample->methods[ci]) (cinfo, compptr,
   78|  9.44M|        input_buf[ci] + (*in_row_group_ctr * upsample->rowgroup_height[ci]),
   79|  9.44M|        upsample->color_buf + ci);
   80|  9.44M|    }
   81|  6.20M|    upsample->next_row_out = 0;
   82|  6.20M|  }
   83|       |
   84|       |  /* Color-convert and emit rows */
   85|       |
   86|       |  /* How many we have in the buffer: */
   87|  6.20M|  num_rows = (JDIMENSION)(cinfo->max_v_samp_factor - upsample->next_row_out);
   88|       |  /* Not more than the distance to the end of the image.  Need this test
   89|       |   * in case the image height is not a multiple of max_v_samp_factor:
   90|       |   */
   91|  6.20M|  if (num_rows > upsample->rows_to_go)
  ------------------
  |  Branch (91:7): [True: 1.37k, False: 6.20M]
  ------------------
   92|  1.37k|    num_rows = upsample->rows_to_go;
   93|       |  /* And not more than what the client can accept: */
   94|  6.20M|  out_rows_avail -= *out_row_ctr;
   95|  6.20M|  if (num_rows > out_rows_avail)
  ------------------
  |  Branch (95:7): [True: 0, False: 6.20M]
  ------------------
   96|      0|    num_rows = out_rows_avail;
   97|       |
   98|  6.20M|  (*cinfo->cconvert->color_convert) (cinfo, upsample->color_buf,
   99|  6.20M|                                     (JDIMENSION)upsample->next_row_out,
  100|  6.20M|                                     output_buf + *out_row_ctr, (int)num_rows);
  101|       |
  102|       |  /* Adjust counts */
  103|  6.20M|  *out_row_ctr += num_rows;
  104|  6.20M|  upsample->rows_to_go -= num_rows;
  105|  6.20M|  upsample->next_row_out += num_rows;
  106|       |  /* When the buffer is emptied, declare this input row group consumed */
  107|  6.20M|  if (upsample->next_row_out >= cinfo->max_v_samp_factor)
  ------------------
  |  Branch (107:7): [True: 6.20M, False: 1.37k]
  ------------------
  108|  6.20M|    (*in_row_group_ctr)++;
  109|  6.20M|}
jdsample.c:noop_upsample:
  141|   526k|{
  142|   526k|  *output_data_ptr = NULL;      /* safety check */
  143|   526k|}
jdsample.c:fullsize_upsample:
  128|  5.48M|{
  129|  5.48M|  *output_data_ptr = input_data;
  130|  5.48M|}
jdsample.c:h1v2_fancy_upsample:
  315|   324k|{
  316|   324k|  JSAMPARRAY output_data = *output_data_ptr;
  317|   324k|  JSAMPROW inptr0, inptr1, outptr;
  318|   324k|#if BITS_IN_JSAMPLE == 8
  319|   324k|  int thiscolsum, bias;
  320|       |#else
  321|       |  JLONG thiscolsum, bias;
  322|       |#endif
  323|   324k|  JDIMENSION colctr;
  324|   324k|  int inrow, outrow, v;
  325|       |
  326|   324k|  inrow = outrow = 0;
  327|   822k|  while (outrow < cinfo->max_v_samp_factor) {
  ------------------
  |  Branch (327:10): [True: 498k, False: 324k]
  ------------------
  328|  1.49M|    for (v = 0; v < 2; v++) {
  ------------------
  |  Branch (328:17): [True: 996k, False: 498k]
  ------------------
  329|       |      /* inptr0 points to nearest input row, inptr1 points to next nearest */
  330|   996k|      inptr0 = input_data[inrow];
  331|   996k|      if (v == 0) {             /* next nearest is row above */
  ------------------
  |  Branch (331:11): [True: 498k, False: 498k]
  ------------------
  332|   498k|        inptr1 = input_data[inrow - 1];
  333|   498k|        bias = 1;
  334|   498k|      } else {                  /* next nearest is row below */
  335|   498k|        inptr1 = input_data[inrow + 1];
  336|   498k|        bias = 2;
  337|   498k|      }
  338|   996k|      outptr = output_data[outrow++];
  339|       |
  340|  18.1M|      for (colctr = 0; colctr < compptr->downsampled_width; colctr++) {
  ------------------
  |  Branch (340:24): [True: 17.1M, False: 996k]
  ------------------
  341|  17.1M|        thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
  ------------------
  |  |   52|  17.1M|#define GETJSAMPLE(value)  ((int)(value))
  ------------------
                      thiscolsum = GETJSAMPLE(*inptr0++) * 3 + GETJSAMPLE(*inptr1++);
  ------------------
  |  |   52|  17.1M|#define GETJSAMPLE(value)  ((int)(value))
  ------------------
  342|  17.1M|        *outptr++ = (JSAMPLE)((thiscolsum + bias) >> 2);
  343|  17.1M|      }
  344|   996k|    }
  345|   498k|    inrow++;
  346|   498k|  }
  347|   324k|}
jdsample.c:int_upsample:
  160|  1.98M|{
  161|  1.98M|  my_upsample_ptr upsample = (my_upsample_ptr)cinfo->upsample;
  162|  1.98M|  JSAMPARRAY output_data = *output_data_ptr;
  163|  1.98M|  register JSAMPROW inptr, outptr;
  164|  1.98M|  register JSAMPLE invalue;
  165|  1.98M|  register int h;
  166|  1.98M|  JSAMPROW outend;
  167|  1.98M|  int h_expand, v_expand;
  168|  1.98M|  int inrow, outrow;
  169|       |
  170|  1.98M|  h_expand = upsample->h_expand[compptr->component_index];
  171|  1.98M|  v_expand = upsample->v_expand[compptr->component_index];
  172|       |
  173|  1.98M|  inrow = outrow = 0;
  174|  4.74M|  while (outrow < cinfo->max_v_samp_factor) {
  ------------------
  |  Branch (174:10): [True: 2.75M, False: 1.98M]
  ------------------
  175|       |    /* Generate one output row with proper horizontal expansion */
  176|  2.75M|    inptr = input_data[inrow];
  177|  2.75M|    outptr = output_data[outrow];
  178|  2.75M|    outend = outptr + cinfo->output_width;
  179|  86.2M|    while (outptr < outend) {
  ------------------
  |  Branch (179:12): [True: 83.4M, False: 2.75M]
  ------------------
  180|  83.4M|      invalue = *inptr++;       /* don't need GETJSAMPLE() here */
  181|   231M|      for (h = h_expand; h > 0; h--) {
  ------------------
  |  Branch (181:26): [True: 148M, False: 83.4M]
  ------------------
  182|   148M|        *outptr++ = invalue;
  183|   148M|      }
  184|  83.4M|    }
  185|       |    /* Generate any additional output rows by duplicating the first one */
  186|  2.75M|    if (v_expand > 1) {
  ------------------
  |  Branch (186:9): [True: 1.61M, False: 1.14M]
  ------------------
  187|  1.61M|      jcopy_sample_rows(output_data, outrow, output_data, outrow + 1,
  188|  1.61M|                        v_expand - 1, cinfo->output_width);
  189|  1.61M|    }
  190|  2.75M|    inrow++;
  191|  2.75M|    outrow += v_expand;
  192|  2.75M|  }
  193|  1.98M|}

jpeg_std_error:
  231|  5.16k|{
  232|  5.16k|  err->error_exit = error_exit;
  233|  5.16k|  err->emit_message = emit_message;
  234|  5.16k|  err->output_message = output_message;
  235|  5.16k|  err->format_message = format_message;
  236|  5.16k|  err->reset_error_mgr = reset_error_mgr;
  237|       |
  238|  5.16k|  err->trace_level = 0;         /* default = no tracing */
  239|  5.16k|  err->num_warnings = 0;        /* no warnings emitted yet */
  240|  5.16k|  err->msg_code = 0;            /* may be useful as a flag for "no error" */
  241|       |
  242|       |  /* Initialize message table pointers */
  243|  5.16k|  err->jpeg_message_table = jpeg_std_message_table;
  244|  5.16k|  err->last_jpeg_message = (int)JMSG_LASTMSGCODE - 1;
  245|       |
  246|  5.16k|  err->addon_message_table = NULL;
  247|  5.16k|  err->first_addon_message = 0; /* for safety */
  248|  5.16k|  err->last_addon_message = 0;
  249|       |
  250|  5.16k|  return err;
  251|  5.16k|}
jerror.c:emit_message:
  128|  9.09M|{
  129|  9.09M|  struct jpeg_error_mgr *err = cinfo->err;
  130|       |
  131|  9.09M|  if (msg_level < 0) {
  ------------------
  |  Branch (131:7): [True: 7.80M, False: 1.28M]
  ------------------
  132|       |    /* It's a warning message.  Since corrupt files may generate many warnings,
  133|       |     * the policy implemented here is to show only the first warning,
  134|       |     * unless trace_level >= 3.
  135|       |     */
  136|  7.80M|    if (err->num_warnings == 0 || err->trace_level >= 3)
  ------------------
  |  Branch (136:9): [True: 6.18k, False: 7.79M]
  |  Branch (136:35): [True: 0, False: 7.79M]
  ------------------
  137|  6.18k|      (*err->output_message) (cinfo);
  138|       |    /* Always count warnings in num_warnings. */
  139|  7.80M|    err->num_warnings++;
  140|  7.80M|  } else {
  141|       |    /* It's a trace message.  Show it if trace_level >= msg_level. */
  142|  1.28M|    if (err->trace_level >= msg_level)
  ------------------
  |  Branch (142:9): [True: 0, False: 1.28M]
  ------------------
  143|      0|      (*err->output_message) (cinfo);
  144|  1.28M|  }
  145|  9.09M|}
jerror.c:format_message:
  157|  9.31k|{
  158|  9.31k|  struct jpeg_error_mgr *err = cinfo->err;
  159|  9.31k|  int msg_code = err->msg_code;
  160|  9.31k|  const char *msgtext = NULL;
  161|  9.31k|  const char *msgptr;
  162|  9.31k|  char ch;
  163|  9.31k|  boolean isstring;
  164|       |
  165|       |  /* Look up message string in proper table */
  166|  9.31k|  if (msg_code > 0 && msg_code <= err->last_jpeg_message) {
  ------------------
  |  Branch (166:7): [True: 9.31k, False: 0]
  |  Branch (166:23): [True: 9.31k, False: 0]
  ------------------
  167|  9.31k|    msgtext = err->jpeg_message_table[msg_code];
  168|  9.31k|  } else if (err->addon_message_table != NULL &&
  ------------------
  |  Branch (168:14): [True: 0, False: 0]
  ------------------
  169|      0|             msg_code >= err->first_addon_message &&
  ------------------
  |  Branch (169:14): [True: 0, False: 0]
  ------------------
  170|      0|             msg_code <= err->last_addon_message) {
  ------------------
  |  Branch (170:14): [True: 0, False: 0]
  ------------------
  171|      0|    msgtext = err->addon_message_table[msg_code - err->first_addon_message];
  172|      0|  }
  173|       |
  174|       |  /* Defend against bogus message number */
  175|  9.31k|  if (msgtext == NULL) {
  ------------------
  |  Branch (175:7): [True: 0, False: 9.31k]
  ------------------
  176|      0|    err->msg_parm.i[0] = msg_code;
  177|      0|    msgtext = err->jpeg_message_table[0];
  178|      0|  }
  179|       |
  180|       |  /* Check for string parameter, as indicated by %s in the message text */
  181|  9.31k|  isstring = FALSE;
  ------------------
  |  |  245|  9.31k|#define FALSE   0               /* values of boolean */
  ------------------
  182|  9.31k|  msgptr = msgtext;
  183|   266k|  while ((ch = *msgptr++) != '\0') {
  ------------------
  |  Branch (183:10): [True: 261k, False: 4.92k]
  ------------------
  184|   261k|    if (ch == '%') {
  ------------------
  |  Branch (184:9): [True: 4.38k, False: 257k]
  ------------------
  185|  4.38k|      if (*msgptr == 's') isstring = TRUE;
  ------------------
  |  |  248|      0|#define TRUE    1
  ------------------
  |  Branch (185:11): [True: 0, False: 4.38k]
  ------------------
  186|  4.38k|      break;
  187|  4.38k|    }
  188|   261k|  }
  189|       |
  190|       |  /* Format the message into the passed buffer */
  191|  9.31k|  if (isstring)
  ------------------
  |  Branch (191:7): [True: 0, False: 9.31k]
  ------------------
  192|      0|    sprintf(buffer, msgtext, err->msg_parm.s);
  193|  9.31k|  else
  194|  9.31k|    sprintf(buffer, msgtext,
  195|  9.31k|            err->msg_parm.i[0], err->msg_parm.i[1],
  196|  9.31k|            err->msg_parm.i[2], err->msg_parm.i[3],
  197|  9.31k|            err->msg_parm.i[4], err->msg_parm.i[5],
  198|  9.31k|            err->msg_parm.i[6], err->msg_parm.i[7]);
  199|  9.31k|}
jerror.c:reset_error_mgr:
  212|  10.2k|{
  213|  10.2k|  cinfo->err->num_warnings = 0;
  214|       |  /* trace_level is not reset since it is an application-supplied parameter */
  215|  10.2k|  cinfo->err->msg_code = 0;     /* may be useful as a flag for "no error" */
  216|  10.2k|}

jpeg_idct_5x5:
  700|     21|{
  701|     21|  JLONG tmp0, tmp1, tmp10, tmp11, tmp12;
  702|     21|  JLONG z1, z2, z3;
  703|     21|  JCOEFPTR inptr;
  704|     21|  ISLOW_MULT_TYPE *quantptr;
  705|     21|  int *wsptr;
  706|     21|  JSAMPROW outptr;
  707|     21|  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
  ------------------
  |  |   86|     21|#define IDCT_range_limit(cinfo)  ((cinfo)->sample_range_limit + CENTERJSAMPLE)
  |  |  ------------------
  |  |  |  |   66|     21|#define CENTERJSAMPLE   128
  |  |  ------------------
  ------------------
  708|     21|  int ctr;
  709|     21|  int workspace[5 * 5];         /* buffers data between passes */
  710|       |  SHIFT_TEMPS
  711|       |
  712|       |  /* Pass 1: process columns from input, store into work array. */
  713|       |
  714|     21|  inptr = coef_block;
  715|     21|  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
  716|     21|  wsptr = workspace;
  717|    126|  for (ctr = 0; ctr < 5; ctr++, inptr++, quantptr++, wsptr++) {
  ------------------
  |  Branch (717:17): [True: 105, False: 21]
  ------------------
  718|       |    /* Even part */
  719|       |
  720|    105|    tmp12 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
  ------------------
  |  |  165|    105|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
  721|    105|    tmp12 = LEFT_SHIFT(tmp12, CONST_BITS);
  ------------------
  |  |   56|    105|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
  722|       |    /* Add fudge factor here for final descale. */
  723|    105|    tmp12 += ONE << (CONST_BITS - PASS1_BITS - 1);
  ------------------
  |  |  163|    105|#define ONE          ((JLONG)1)
  ------------------
                  tmp12 += ONE << (CONST_BITS - PASS1_BITS - 1);
  ------------------
  |  |  103|    105|#define CONST_BITS  13
  ------------------
                  tmp12 += ONE << (CONST_BITS - PASS1_BITS - 1);
  ------------------
  |  |  104|    105|#define PASS1_BITS  2
  ------------------
  724|    105|    tmp0 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
  ------------------
  |  |  165|    105|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
  725|    105|    tmp1 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
  ------------------
  |  |  165|    105|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
  726|    105|    z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */
  ------------------
  |  |  154|    105|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    105|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
  727|    105|    z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */
  ------------------
  |  |  154|    105|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    105|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
  728|    105|    z3 = tmp12 + z2;
  729|    105|    tmp10 = z3 + z1;
  730|    105|    tmp11 = z3 - z1;
  731|    105|    tmp12 -= LEFT_SHIFT(z2, 2);
  ------------------
  |  |   56|    105|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
  732|       |
  733|       |    /* Odd part */
  734|       |
  735|    105|    z2 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
  ------------------
  |  |  165|    105|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
  736|    105|    z3 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
  ------------------
  |  |  165|    105|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
  737|       |
  738|    105|    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));     /* c3 */
  ------------------
  |  |  154|    105|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    105|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
  739|    105|    tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148));   /* c1-c3 */
  ------------------
  |  |  154|    105|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    105|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
  740|    105|    tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899));   /* c1+c3 */
  ------------------
  |  |  154|    105|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    105|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
  741|       |
  742|       |    /* Final output stage */
  743|       |
  744|    105|    wsptr[5 * 0] = (int)RIGHT_SHIFT(tmp10 + tmp0, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    105|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
  745|    105|    wsptr[5 * 4] = (int)RIGHT_SHIFT(tmp10 - tmp0, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    105|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
  746|    105|    wsptr[5 * 1] = (int)RIGHT_SHIFT(tmp11 + tmp1, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    105|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
  747|    105|    wsptr[5 * 3] = (int)RIGHT_SHIFT(tmp11 - tmp1, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    105|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
  748|    105|    wsptr[5 * 2] = (int)RIGHT_SHIFT(tmp12, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    105|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
  749|    105|  }
  750|       |
  751|       |  /* Pass 2: process 5 rows from work array, store into output array. */
  752|       |
  753|     21|  wsptr = workspace;
  754|    126|  for (ctr = 0; ctr < 5; ctr++) {
  ------------------
  |  Branch (754:17): [True: 105, False: 21]
  ------------------
  755|    105|    outptr = output_buf[ctr] + output_col;
  756|       |
  757|       |    /* Even part */
  758|       |
  759|       |    /* Add fudge factor here for final descale. */
  760|    105|    tmp12 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
  ------------------
  |  |  163|    105|#define ONE          ((JLONG)1)
  ------------------
                  tmp12 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
  ------------------
  |  |  104|    105|#define PASS1_BITS  2
  ------------------
  761|    105|    tmp12 = LEFT_SHIFT(tmp12, CONST_BITS);
  ------------------
  |  |   56|    105|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
  762|    105|    tmp0 = (JLONG)wsptr[2];
  763|    105|    tmp1 = (JLONG)wsptr[4];
  764|    105|    z1 = MULTIPLY(tmp0 + tmp1, FIX(0.790569415)); /* (c2+c4)/2 */
  ------------------
  |  |  154|    105|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    105|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
  765|    105|    z2 = MULTIPLY(tmp0 - tmp1, FIX(0.353553391)); /* (c2-c4)/2 */
  ------------------
  |  |  154|    105|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    105|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
  766|    105|    z3 = tmp12 + z2;
  767|    105|    tmp10 = z3 + z1;
  768|    105|    tmp11 = z3 - z1;
  769|    105|    tmp12 -= LEFT_SHIFT(z2, 2);
  ------------------
  |  |   56|    105|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
  770|       |
  771|       |    /* Odd part */
  772|       |
  773|    105|    z2 = (JLONG)wsptr[1];
  774|    105|    z3 = (JLONG)wsptr[3];
  775|       |
  776|    105|    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));     /* c3 */
  ------------------
  |  |  154|    105|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    105|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
  777|    105|    tmp0 = z1 + MULTIPLY(z2, FIX(0.513743148));   /* c1-c3 */
  ------------------
  |  |  154|    105|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    105|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
  778|    105|    tmp1 = z1 - MULTIPLY(z3, FIX(2.176250899));   /* c1+c3 */
  ------------------
  |  |  154|    105|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    105|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
  779|       |
  780|       |    /* Final output stage */
  781|       |
  782|    105|    outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp10 + tmp0,
  ------------------
  |  |  300|    105|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
  783|    105|                                             CONST_BITS + PASS1_BITS + 3) &
  784|    105|                            RANGE_MASK];
  ------------------
  |  |   88|    105|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    105|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
  785|    105|    outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp10 - tmp0,
  ------------------
  |  |  300|    105|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
  786|    105|                                             CONST_BITS + PASS1_BITS + 3) &
  787|    105|                            RANGE_MASK];
  ------------------
  |  |   88|    105|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    105|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
  788|    105|    outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp11 + tmp1,
  ------------------
  |  |  300|    105|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
  789|    105|                                             CONST_BITS + PASS1_BITS + 3) &
  790|    105|                            RANGE_MASK];
  ------------------
  |  |   88|    105|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    105|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
  791|    105|    outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp11 - tmp1,
  ------------------
  |  |  300|    105|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
  792|    105|                                             CONST_BITS + PASS1_BITS + 3) &
  793|    105|                            RANGE_MASK];
  ------------------
  |  |   88|    105|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    105|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
  794|    105|    outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp12,
  ------------------
  |  |  300|    105|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
  795|    105|                                             CONST_BITS + PASS1_BITS + 3) &
  796|    105|                            RANGE_MASK];
  ------------------
  |  |   88|    105|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    105|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
  797|       |
  798|    105|    wsptr += 5;         /* advance pointer to next row */
  799|    105|  }
  800|     21|}
jpeg_idct_10x10:
 1076|     14|{
 1077|     14|  JLONG tmp10, tmp11, tmp12, tmp13, tmp14;
 1078|     14|  JLONG tmp20, tmp21, tmp22, tmp23, tmp24;
 1079|     14|  JLONG z1, z2, z3, z4, z5;
 1080|     14|  JCOEFPTR inptr;
 1081|     14|  ISLOW_MULT_TYPE *quantptr;
 1082|     14|  int *wsptr;
 1083|     14|  JSAMPROW outptr;
 1084|     14|  JSAMPLE *range_limit = IDCT_range_limit(cinfo);
  ------------------
  |  |   86|     14|#define IDCT_range_limit(cinfo)  ((cinfo)->sample_range_limit + CENTERJSAMPLE)
  |  |  ------------------
  |  |  |  |   66|     14|#define CENTERJSAMPLE   128
  |  |  ------------------
  ------------------
 1085|     14|  int ctr;
 1086|     14|  int workspace[8 * 10];        /* buffers data between passes */
 1087|       |  SHIFT_TEMPS
 1088|       |
 1089|       |  /* Pass 1: process columns from input, store into work array. */
 1090|       |
 1091|     14|  inptr = coef_block;
 1092|     14|  quantptr = (ISLOW_MULT_TYPE *)compptr->dct_table;
 1093|     14|  wsptr = workspace;
 1094|    126|  for (ctr = 0; ctr < 8; ctr++, inptr++, quantptr++, wsptr++) {
  ------------------
  |  Branch (1094:17): [True: 112, False: 14]
  ------------------
 1095|       |    /* Even part */
 1096|       |
 1097|    112|    z3 = DEQUANTIZE(inptr[DCTSIZE * 0], quantptr[DCTSIZE * 0]);
  ------------------
  |  |  165|    112|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
 1098|    112|    z3 = LEFT_SHIFT(z3, CONST_BITS);
  ------------------
  |  |   56|    112|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
 1099|       |    /* Add fudge factor here for final descale. */
 1100|    112|    z3 += ONE << (CONST_BITS - PASS1_BITS - 1);
  ------------------
  |  |  163|    112|#define ONE          ((JLONG)1)
  ------------------
                  z3 += ONE << (CONST_BITS - PASS1_BITS - 1);
  ------------------
  |  |  103|    112|#define CONST_BITS  13
  ------------------
                  z3 += ONE << (CONST_BITS - PASS1_BITS - 1);
  ------------------
  |  |  104|    112|#define PASS1_BITS  2
  ------------------
 1101|    112|    z4 = DEQUANTIZE(inptr[DCTSIZE * 4], quantptr[DCTSIZE * 4]);
  ------------------
  |  |  165|    112|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
 1102|    112|    z1 = MULTIPLY(z4, FIX(1.144122806));         /* c4 */
  ------------------
  |  |  154|    112|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    112|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1103|    112|    z2 = MULTIPLY(z4, FIX(0.437016024));         /* c8 */
  ------------------
  |  |  154|    112|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    112|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1104|    112|    tmp10 = z3 + z1;
 1105|    112|    tmp11 = z3 - z2;
 1106|       |
 1107|    112|    tmp22 = RIGHT_SHIFT(z3 - LEFT_SHIFT(z1 - z2, 1),
  ------------------
  |  |  300|    112|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1108|    112|                        CONST_BITS - PASS1_BITS); /* c0 = (c4-c8)*2 */
 1109|       |
 1110|    112|    z2 = DEQUANTIZE(inptr[DCTSIZE * 2], quantptr[DCTSIZE * 2]);
  ------------------
  |  |  165|    112|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
 1111|    112|    z3 = DEQUANTIZE(inptr[DCTSIZE * 6], quantptr[DCTSIZE * 6]);
  ------------------
  |  |  165|    112|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
 1112|       |
 1113|    112|    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));    /* c6 */
  ------------------
  |  |  154|    112|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    112|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1114|    112|    tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */
  ------------------
  |  |  154|    112|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    112|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1115|    112|    tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */
  ------------------
  |  |  154|    112|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    112|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1116|       |
 1117|    112|    tmp20 = tmp10 + tmp12;
 1118|    112|    tmp24 = tmp10 - tmp12;
 1119|    112|    tmp21 = tmp11 + tmp13;
 1120|    112|    tmp23 = tmp11 - tmp13;
 1121|       |
 1122|       |    /* Odd part */
 1123|       |
 1124|    112|    z1 = DEQUANTIZE(inptr[DCTSIZE * 1], quantptr[DCTSIZE * 1]);
  ------------------
  |  |  165|    112|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
 1125|    112|    z2 = DEQUANTIZE(inptr[DCTSIZE * 3], quantptr[DCTSIZE * 3]);
  ------------------
  |  |  165|    112|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
 1126|    112|    z3 = DEQUANTIZE(inptr[DCTSIZE * 5], quantptr[DCTSIZE * 5]);
  ------------------
  |  |  165|    112|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
 1127|    112|    z4 = DEQUANTIZE(inptr[DCTSIZE * 7], quantptr[DCTSIZE * 7]);
  ------------------
  |  |  165|    112|#define DEQUANTIZE(coef, quantval)  (((ISLOW_MULT_TYPE)(coef)) * (quantval))
  ------------------
 1128|       |
 1129|    112|    tmp11 = z2 + z4;
 1130|    112|    tmp13 = z2 - z4;
 1131|       |
 1132|    112|    tmp12 = MULTIPLY(tmp13, FIX(0.309016994));        /* (c3-c7)/2 */
  ------------------
  |  |  154|    112|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    112|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1133|    112|    z5 = LEFT_SHIFT(z3, CONST_BITS);
  ------------------
  |  |   56|    112|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
 1134|       |
 1135|    112|    z2 = MULTIPLY(tmp11, FIX(0.951056516));           /* (c3+c7)/2 */
  ------------------
  |  |  154|    112|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    112|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1136|    112|    z4 = z5 + tmp12;
 1137|       |
 1138|    112|    tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */
  ------------------
  |  |  154|    112|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    112|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1139|    112|    tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */
  ------------------
  |  |  154|    112|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    112|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1140|       |
 1141|    112|    z2 = MULTIPLY(tmp11, FIX(0.587785252));           /* (c1-c9)/2 */
  ------------------
  |  |  154|    112|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    112|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1142|    112|    z4 = z5 - tmp12 - LEFT_SHIFT(tmp13, CONST_BITS - 1);
  ------------------
  |  |   56|    112|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
 1143|       |
 1144|    112|    tmp12 = LEFT_SHIFT(z1 - tmp13 - z3, PASS1_BITS);
  ------------------
  |  |   56|    112|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
 1145|       |
 1146|    112|    tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */
  ------------------
  |  |  154|    112|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    112|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1147|    112|    tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */
  ------------------
  |  |  154|    112|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    112|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1148|       |
 1149|       |    /* Final output stage */
 1150|       |
 1151|    112|    wsptr[8 * 0] = (int)RIGHT_SHIFT(tmp20 + tmp10, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    112|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1152|    112|    wsptr[8 * 9] = (int)RIGHT_SHIFT(tmp20 - tmp10, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    112|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1153|    112|    wsptr[8 * 1] = (int)RIGHT_SHIFT(tmp21 + tmp11, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    112|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1154|    112|    wsptr[8 * 8] = (int)RIGHT_SHIFT(tmp21 - tmp11, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    112|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1155|    112|    wsptr[8 * 2] = (int)(tmp22 + tmp12);
 1156|    112|    wsptr[8 * 7] = (int)(tmp22 - tmp12);
 1157|    112|    wsptr[8 * 3] = (int)RIGHT_SHIFT(tmp23 + tmp13, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    112|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1158|    112|    wsptr[8 * 6] = (int)RIGHT_SHIFT(tmp23 - tmp13, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    112|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1159|    112|    wsptr[8 * 4] = (int)RIGHT_SHIFT(tmp24 + tmp14, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    112|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1160|    112|    wsptr[8 * 5] = (int)RIGHT_SHIFT(tmp24 - tmp14, CONST_BITS - PASS1_BITS);
  ------------------
  |  |  300|    112|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1161|    112|  }
 1162|       |
 1163|       |  /* Pass 2: process 10 rows from work array, store into output array. */
 1164|       |
 1165|     14|  wsptr = workspace;
 1166|    154|  for (ctr = 0; ctr < 10; ctr++) {
  ------------------
  |  Branch (1166:17): [True: 140, False: 14]
  ------------------
 1167|    140|    outptr = output_buf[ctr] + output_col;
 1168|       |
 1169|       |    /* Even part */
 1170|       |
 1171|       |    /* Add fudge factor here for final descale. */
 1172|    140|    z3 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
  ------------------
  |  |  163|    140|#define ONE          ((JLONG)1)
  ------------------
                  z3 = (JLONG)wsptr[0] + (ONE << (PASS1_BITS + 2));
  ------------------
  |  |  104|    140|#define PASS1_BITS  2
  ------------------
 1173|    140|    z3 = LEFT_SHIFT(z3, CONST_BITS);
  ------------------
  |  |   56|    140|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
 1174|    140|    z4 = (JLONG)wsptr[4];
 1175|    140|    z1 = MULTIPLY(z4, FIX(1.144122806));         /* c4 */
  ------------------
  |  |  154|    140|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    140|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1176|    140|    z2 = MULTIPLY(z4, FIX(0.437016024));         /* c8 */
  ------------------
  |  |  154|    140|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    140|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1177|    140|    tmp10 = z3 + z1;
 1178|    140|    tmp11 = z3 - z2;
 1179|       |
 1180|    140|    tmp22 = z3 - LEFT_SHIFT(z1 - z2, 1);         /* c0 = (c4-c8)*2 */
  ------------------
  |  |   56|    140|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
 1181|       |
 1182|    140|    z2 = (JLONG)wsptr[2];
 1183|    140|    z3 = (JLONG)wsptr[6];
 1184|       |
 1185|    140|    z1 = MULTIPLY(z2 + z3, FIX(0.831253876));    /* c6 */
  ------------------
  |  |  154|    140|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    140|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1186|    140|    tmp12 = z1 + MULTIPLY(z2, FIX(0.513743148)); /* c2-c6 */
  ------------------
  |  |  154|    140|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    140|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1187|    140|    tmp13 = z1 - MULTIPLY(z3, FIX(2.176250899)); /* c2+c6 */
  ------------------
  |  |  154|    140|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    140|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1188|       |
 1189|    140|    tmp20 = tmp10 + tmp12;
 1190|    140|    tmp24 = tmp10 - tmp12;
 1191|    140|    tmp21 = tmp11 + tmp13;
 1192|    140|    tmp23 = tmp11 - tmp13;
 1193|       |
 1194|       |    /* Odd part */
 1195|       |
 1196|    140|    z1 = (JLONG)wsptr[1];
 1197|    140|    z2 = (JLONG)wsptr[3];
 1198|    140|    z3 = (JLONG)wsptr[5];
 1199|    140|    z3 = LEFT_SHIFT(z3, CONST_BITS);
  ------------------
  |  |   56|    140|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
 1200|    140|    z4 = (JLONG)wsptr[7];
 1201|       |
 1202|    140|    tmp11 = z2 + z4;
 1203|    140|    tmp13 = z2 - z4;
 1204|       |
 1205|    140|    tmp12 = MULTIPLY(tmp13, FIX(0.309016994));        /* (c3-c7)/2 */
  ------------------
  |  |  154|    140|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    140|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1206|       |
 1207|    140|    z2 = MULTIPLY(tmp11, FIX(0.951056516));           /* (c3+c7)/2 */
  ------------------
  |  |  154|    140|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    140|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1208|    140|    z4 = z3 + tmp12;
 1209|       |
 1210|    140|    tmp10 = MULTIPLY(z1, FIX(1.396802247)) + z2 + z4; /* c1 */
  ------------------
  |  |  154|    140|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    140|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1211|    140|    tmp14 = MULTIPLY(z1, FIX(0.221231742)) - z2 + z4; /* c9 */
  ------------------
  |  |  154|    140|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    140|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1212|       |
 1213|    140|    z2 = MULTIPLY(tmp11, FIX(0.587785252));           /* (c1-c9)/2 */
  ------------------
  |  |  154|    140|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    140|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1214|    140|    z4 = z3 - tmp12 - LEFT_SHIFT(tmp13, CONST_BITS - 1);
  ------------------
  |  |   56|    140|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
 1215|       |
 1216|    140|    tmp12 = LEFT_SHIFT(z1 - tmp13, CONST_BITS) - z3;
  ------------------
  |  |   56|    140|#define LEFT_SHIFT(a, b)  ((JLONG)((unsigned long)(a) << (b)))
  ------------------
 1217|       |
 1218|    140|    tmp11 = MULTIPLY(z1, FIX(1.260073511)) - z2 - z4; /* c3 */
  ------------------
  |  |  154|    140|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    140|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1219|    140|    tmp13 = MULTIPLY(z1, FIX(0.642039522)) - z2 + z4; /* c7 */
  ------------------
  |  |  154|    140|#define MULTIPLY(var, const)  MULTIPLY16C16(var, const)
  |  |  ------------------
  |  |  |  |  197|    140|#define MULTIPLY16C16(var, const)  ((var) * (const))
  |  |  ------------------
  ------------------
 1220|       |
 1221|       |    /* Final output stage */
 1222|       |
 1223|    140|    outptr[0] = range_limit[(int)RIGHT_SHIFT(tmp20 + tmp10,
  ------------------
  |  |  300|    140|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1224|    140|                                             CONST_BITS + PASS1_BITS + 3) &
 1225|    140|                            RANGE_MASK];
  ------------------
  |  |   88|    140|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    140|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
 1226|    140|    outptr[9] = range_limit[(int)RIGHT_SHIFT(tmp20 - tmp10,
  ------------------
  |  |  300|    140|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1227|    140|                                             CONST_BITS + PASS1_BITS + 3) &
 1228|    140|                            RANGE_MASK];
  ------------------
  |  |   88|    140|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    140|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
 1229|    140|    outptr[1] = range_limit[(int)RIGHT_SHIFT(tmp21 + tmp11,
  ------------------
  |  |  300|    140|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1230|    140|                                             CONST_BITS + PASS1_BITS + 3) &
 1231|    140|                            RANGE_MASK];
  ------------------
  |  |   88|    140|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    140|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
 1232|    140|    outptr[8] = range_limit[(int)RIGHT_SHIFT(tmp21 - tmp11,
  ------------------
  |  |  300|    140|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1233|    140|                                             CONST_BITS + PASS1_BITS + 3) &
 1234|    140|                            RANGE_MASK];
  ------------------
  |  |   88|    140|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    140|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
 1235|    140|    outptr[2] = range_limit[(int)RIGHT_SHIFT(tmp22 + tmp12,
  ------------------
  |  |  300|    140|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1236|    140|                                             CONST_BITS + PASS1_BITS + 3) &
 1237|    140|                            RANGE_MASK];
  ------------------
  |  |   88|    140|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    140|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
 1238|    140|    outptr[7] = range_limit[(int)RIGHT_SHIFT(tmp22 - tmp12,
  ------------------
  |  |  300|    140|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1239|    140|                                             CONST_BITS + PASS1_BITS + 3) &
 1240|    140|                            RANGE_MASK];
  ------------------
  |  |   88|    140|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    140|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
 1241|    140|    outptr[3] = range_limit[(int)RIGHT_SHIFT(tmp23 + tmp13,
  ------------------
  |  |  300|    140|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1242|    140|                                             CONST_BITS + PASS1_BITS + 3) &
 1243|    140|                            RANGE_MASK];
  ------------------
  |  |   88|    140|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    140|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
 1244|    140|    outptr[6] = range_limit[(int)RIGHT_SHIFT(tmp23 - tmp13,
  ------------------
  |  |  300|    140|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1245|    140|                                             CONST_BITS + PASS1_BITS + 3) &
 1246|    140|                            RANGE_MASK];
  ------------------
  |  |   88|    140|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    140|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
 1247|    140|    outptr[4] = range_limit[(int)RIGHT_SHIFT(tmp24 + tmp14,
  ------------------
  |  |  300|    140|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1248|    140|                                             CONST_BITS + PASS1_BITS + 3) &
 1249|    140|                            RANGE_MASK];
  ------------------
  |  |   88|    140|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    140|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
 1250|    140|    outptr[5] = range_limit[(int)RIGHT_SHIFT(tmp24 - tmp14,
  ------------------
  |  |  300|    140|#define RIGHT_SHIFT(x, shft)    ((x) >> (shft))
  ------------------
 1251|    140|                                             CONST_BITS + PASS1_BITS + 3) &
 1252|    140|                            RANGE_MASK];
  ------------------
  |  |   88|    140|#define RANGE_MASK  (MAXJSAMPLE * 4 + 3) /* 2 bits wider than legal samples */
  |  |  ------------------
  |  |  |  |   65|    140|#define MAXJSAMPLE      255
  |  |  ------------------
  ------------------
 1253|       |
 1254|    140|    wsptr += 8;         /* advance pointer to next row */
 1255|    140|  }
 1256|     14|}

jinit_memory_mgr:
 1089|  5.16k|{
 1090|  5.16k|  my_mem_ptr mem;
 1091|  5.16k|  long max_to_use;
 1092|  5.16k|  int pool;
 1093|  5.16k|  size_t test_mac;
 1094|       |
 1095|  5.16k|  cinfo->mem = NULL;            /* for safety if init fails */
 1096|       |
 1097|       |  /* Check for configuration errors.
 1098|       |   * sizeof(ALIGN_TYPE) should be a power of 2; otherwise, it probably
 1099|       |   * doesn't reflect any real hardware alignment requirement.
 1100|       |   * The test is a little tricky: for X>0, X and X-1 have no one-bits
 1101|       |   * in common if and only if X is a power of 2, ie has only one one-bit.
 1102|       |   * Some compilers may give an "unreachable code" warning here; ignore it.
 1103|       |   */
 1104|  5.16k|  if ((ALIGN_SIZE & (ALIGN_SIZE - 1)) != 0)
  ------------------
  |  |   92|  5.16k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
                if ((ALIGN_SIZE & (ALIGN_SIZE - 1)) != 0)
  ------------------
  |  |   92|  5.16k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  |  Branch (1104:7): [Folded - Ignored]
  ------------------
 1105|      0|    ERREXIT(cinfo, JERR_BAD_ALIGN_TYPE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
 1106|       |  /* MAX_ALLOC_CHUNK must be representable as type size_t, and must be
 1107|       |   * a multiple of ALIGN_SIZE.
 1108|       |   * Again, an "unreachable code" warning may be ignored here.
 1109|       |   * But a "constant too large" warning means you need to fix MAX_ALLOC_CHUNK.
 1110|       |   */
 1111|  5.16k|  test_mac = (size_t)MAX_ALLOC_CHUNK;
  ------------------
  |  |   62|  5.16k|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
 1112|  5.16k|  if ((long)test_mac != MAX_ALLOC_CHUNK ||
  ------------------
  |  |   62|  10.3k|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
  |  Branch (1112:7): [True: 0, False: 5.16k]
  ------------------
 1113|  5.16k|      (MAX_ALLOC_CHUNK % ALIGN_SIZE) != 0)
  ------------------
  |  |   62|  5.16k|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
                    (MAX_ALLOC_CHUNK % ALIGN_SIZE) != 0)
  ------------------
  |  |   92|  5.16k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  |  Branch (1113:7): [Folded - Ignored]
  ------------------
 1114|      0|    ERREXIT(cinfo, JERR_BAD_ALLOC_CHUNK);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
 1115|       |
 1116|  5.16k|  max_to_use = jpeg_mem_init(cinfo); /* system-dependent initialization */
 1117|       |
 1118|       |  /* Attempt to allocate memory manager's control block */
 1119|  5.16k|  mem = (my_mem_ptr)jpeg_get_small(cinfo, sizeof(my_memory_mgr));
 1120|       |
 1121|  5.16k|  if (mem == NULL) {
  ------------------
  |  Branch (1121:7): [True: 0, False: 5.16k]
  ------------------
 1122|      0|    jpeg_mem_term(cinfo);       /* system-dependent cleanup */
 1123|      0|    ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 0);
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
 1124|      0|  }
 1125|       |
 1126|       |  /* OK, fill in the method pointers */
 1127|  5.16k|  mem->pub.alloc_small = alloc_small;
 1128|  5.16k|  mem->pub.alloc_large = alloc_large;
 1129|  5.16k|  mem->pub.alloc_sarray = alloc_sarray;
 1130|  5.16k|  mem->pub.alloc_barray = alloc_barray;
 1131|  5.16k|  mem->pub.request_virt_sarray = request_virt_sarray;
 1132|  5.16k|  mem->pub.request_virt_barray = request_virt_barray;
 1133|  5.16k|  mem->pub.realize_virt_arrays = realize_virt_arrays;
 1134|  5.16k|  mem->pub.access_virt_sarray = access_virt_sarray;
 1135|  5.16k|  mem->pub.access_virt_barray = access_virt_barray;
 1136|  5.16k|  mem->pub.free_pool = free_pool;
 1137|  5.16k|  mem->pub.self_destruct = self_destruct;
 1138|       |
 1139|       |  /* Make MAX_ALLOC_CHUNK accessible to other modules */
 1140|  5.16k|  mem->pub.max_alloc_chunk = MAX_ALLOC_CHUNK;
  ------------------
  |  |   62|  5.16k|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
 1141|       |
 1142|       |  /* Initialize working state */
 1143|  5.16k|  mem->pub.max_memory_to_use = max_to_use;
 1144|       |
 1145|  15.5k|  for (pool = JPOOL_NUMPOOLS - 1; pool >= JPOOL_PERMANENT; pool--) {
  ------------------
  |  |  827|  5.16k|#define JPOOL_NUMPOOLS   2
  ------------------
                for (pool = JPOOL_NUMPOOLS - 1; pool >= JPOOL_PERMANENT; pool--) {
  ------------------
  |  |  825|  15.5k|#define JPOOL_PERMANENT  0      /* lasts until master record is destroyed */
  ------------------
  |  Branch (1145:35): [True: 10.3k, False: 5.16k]
  ------------------
 1146|  10.3k|    mem->small_list[pool] = NULL;
 1147|  10.3k|    mem->large_list[pool] = NULL;
 1148|  10.3k|  }
 1149|  5.16k|  mem->virt_sarray_list = NULL;
 1150|  5.16k|  mem->virt_barray_list = NULL;
 1151|       |
 1152|  5.16k|  mem->total_space_allocated = sizeof(my_memory_mgr);
 1153|       |
 1154|       |  /* Declare ourselves open for business */
 1155|  5.16k|  cinfo->mem = &mem->pub;
 1156|       |
 1157|       |  /* Check for an environment variable JPEGMEM; if found, override the
 1158|       |   * default max_memory setting from jpeg_mem_init.  Note that the
 1159|       |   * surrounding application may again override this value.
 1160|       |   * If your system doesn't support getenv(), define NO_GETENV to disable
 1161|       |   * this feature.
 1162|       |   */
 1163|  5.16k|#ifndef NO_GETENV
 1164|  5.16k|  {
 1165|  5.16k|    char *memenv;
 1166|       |
 1167|  5.16k|    if ((memenv = getenv("JPEGMEM")) != NULL) {
  ------------------
  |  Branch (1167:9): [True: 0, False: 5.16k]
  ------------------
 1168|      0|      char ch = 'x';
 1169|       |
 1170|      0|      if (sscanf(memenv, "%ld%c", &max_to_use, &ch) > 0) {
  ------------------
  |  Branch (1170:11): [True: 0, False: 0]
  ------------------
 1171|      0|        if (ch == 'm' || ch == 'M')
  ------------------
  |  Branch (1171:13): [True: 0, False: 0]
  |  Branch (1171:26): [True: 0, False: 0]
  ------------------
 1172|      0|          max_to_use *= 1000L;
 1173|      0|        mem->pub.max_memory_to_use = max_to_use * 1000L;
 1174|      0|      }
 1175|      0|    }
 1176|  5.16k|  }
 1177|  5.16k|#endif
 1178|       |
 1179|  5.16k|}
jmemmgr.c:alloc_small:
  269|   137k|{
  270|   137k|  my_mem_ptr mem = (my_mem_ptr)cinfo->mem;
  271|   137k|  small_pool_ptr hdr_ptr, prev_hdr_ptr;
  272|   137k|  char *data_ptr;
  273|   137k|  size_t min_request, slop;
  274|       |
  275|       |  /*
  276|       |   * Round up the requested size to a multiple of ALIGN_SIZE in order
  277|       |   * to assure alignment for the next object allocated in the same pool
  278|       |   * and so that algorithms can straddle outside the proper area up
  279|       |   * to the next alignment.
  280|       |   */
  281|   137k|  if (sizeofobject > MAX_ALLOC_CHUNK) {
  ------------------
  |  |   62|   137k|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
  |  Branch (281:7): [True: 0, False: 137k]
  ------------------
  282|       |    /* This prevents overflow/wrap-around in round_up_pow2() if sizeofobject
  283|       |       is close to SIZE_MAX. */
  284|      0|    out_of_memory(cinfo, 7);
  285|      0|  }
  286|   137k|  sizeofobject = round_up_pow2(sizeofobject, ALIGN_SIZE);
  ------------------
  |  |   92|   137k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  287|       |
  288|       |  /* Check for unsatisfiable request (do now to ensure no overflow below) */
  289|   137k|  if ((sizeof(small_pool_hdr) + sizeofobject + ALIGN_SIZE - 1) >
  ------------------
  |  |   92|   137k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  |  Branch (289:7): [True: 0, False: 137k]
  ------------------
  290|   137k|      MAX_ALLOC_CHUNK)
  ------------------
  |  |   62|   137k|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
  291|      0|    out_of_memory(cinfo, 1);    /* request exceeds malloc's ability */
  292|       |
  293|       |  /* See if space is available in any existing pool */
  294|   137k|  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
  ------------------
  |  |  827|   137k|#define JPOOL_NUMPOOLS   2
  ------------------
  |  Branch (294:7): [True: 0, False: 137k]
  |  Branch (294:22): [True: 0, False: 137k]
  ------------------
  295|      0|    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  296|   137k|  prev_hdr_ptr = NULL;
  297|   137k|  hdr_ptr = mem->small_list[pool_id];
  298|   139k|  while (hdr_ptr != NULL) {
  ------------------
  |  Branch (298:10): [True: 123k, False: 15.4k]
  ------------------
  299|   123k|    if (hdr_ptr->bytes_left >= sizeofobject)
  ------------------
  |  Branch (299:9): [True: 121k, False: 1.81k]
  ------------------
  300|   121k|      break;                    /* found pool with enough space */
  301|  1.81k|    prev_hdr_ptr = hdr_ptr;
  302|  1.81k|    hdr_ptr = hdr_ptr->next;
  303|  1.81k|  }
  304|       |
  305|       |  /* Time to make a new pool? */
  306|   137k|  if (hdr_ptr == NULL) {
  ------------------
  |  Branch (306:7): [True: 15.4k, False: 121k]
  ------------------
  307|       |    /* min_request is what we need now, slop is what will be leftover */
  308|  15.4k|    min_request = sizeof(small_pool_hdr) + sizeofobject + ALIGN_SIZE - 1;
  ------------------
  |  |   92|  15.4k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  309|  15.4k|    if (prev_hdr_ptr == NULL)   /* first pool in class? */
  ------------------
  |  Branch (309:9): [True: 14.2k, False: 1.22k]
  ------------------
  310|  14.2k|      slop = first_pool_slop[pool_id];
  311|  1.22k|    else
  312|  1.22k|      slop = extra_pool_slop[pool_id];
  313|       |    /* Don't ask for more than MAX_ALLOC_CHUNK */
  314|  15.4k|    if (slop > (size_t)(MAX_ALLOC_CHUNK - min_request))
  ------------------
  |  |   62|  15.4k|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
  |  Branch (314:9): [True: 0, False: 15.4k]
  ------------------
  315|      0|      slop = (size_t)(MAX_ALLOC_CHUNK - min_request);
  ------------------
  |  |   62|      0|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
  316|       |    /* Try to get space, if fail reduce slop and try again */
  317|  15.4k|    for (;;) {
  318|  15.4k|      hdr_ptr = (small_pool_ptr)jpeg_get_small(cinfo, min_request + slop);
  319|  15.4k|      if (hdr_ptr != NULL)
  ------------------
  |  Branch (319:11): [True: 15.4k, False: 0]
  ------------------
  320|  15.4k|        break;
  321|      0|      slop /= 2;
  322|      0|      if (slop < MIN_SLOP)      /* give up when it gets real small */
  ------------------
  |  |  263|      0|#define MIN_SLOP  50            /* greater than 0 to avoid futile looping */
  ------------------
  |  Branch (322:11): [True: 0, False: 0]
  ------------------
  323|      0|        out_of_memory(cinfo, 2); /* jpeg_get_small failed */
  324|      0|    }
  325|  15.4k|    mem->total_space_allocated += min_request + slop;
  326|       |    /* Success, initialize the new pool header and add to end of list */
  327|  15.4k|    hdr_ptr->next = NULL;
  328|  15.4k|    hdr_ptr->bytes_used = 0;
  329|  15.4k|    hdr_ptr->bytes_left = sizeofobject + slop;
  330|  15.4k|    if (prev_hdr_ptr == NULL)   /* first pool in class? */
  ------------------
  |  Branch (330:9): [True: 14.2k, False: 1.22k]
  ------------------
  331|  14.2k|      mem->small_list[pool_id] = hdr_ptr;
  332|  1.22k|    else
  333|  1.22k|      prev_hdr_ptr->next = hdr_ptr;
  334|  15.4k|  }
  335|       |
  336|       |  /* OK, allocate the object from the current pool */
  337|   137k|  data_ptr = (char *)hdr_ptr; /* point to first data byte in pool... */
  338|   137k|  data_ptr += sizeof(small_pool_hdr); /* ...by skipping the header... */
  339|   137k|  if ((size_t)data_ptr % ALIGN_SIZE) /* ...and adjust for alignment */
  ------------------
  |  |   92|   137k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  |  Branch (339:7): [True: 137k, False: 0]
  ------------------
  340|   137k|    data_ptr += ALIGN_SIZE - (size_t)data_ptr % ALIGN_SIZE;
  ------------------
  |  |   92|   137k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
                  data_ptr += ALIGN_SIZE - (size_t)data_ptr % ALIGN_SIZE;
  ------------------
  |  |   92|   137k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  341|   137k|  data_ptr += hdr_ptr->bytes_used; /* point to place for object */
  342|   137k|  hdr_ptr->bytes_used += sizeofobject;
  343|   137k|  hdr_ptr->bytes_left -= sizeofobject;
  344|       |
  345|   137k|  return (void *)data_ptr;
  346|   137k|}
jmemmgr.c:round_up_pow2:
   51|   171k|{
   52|   171k|  return ((a + b - 1) & (~(b - 1)));
   53|   171k|}
jmemmgr.c:alloc_large:
  365|  21.0k|{
  366|  21.0k|  my_mem_ptr mem = (my_mem_ptr)cinfo->mem;
  367|  21.0k|  large_pool_ptr hdr_ptr;
  368|  21.0k|  char *data_ptr;
  369|       |
  370|       |  /*
  371|       |   * Round up the requested size to a multiple of ALIGN_SIZE so that
  372|       |   * algorithms can straddle outside the proper area up to the next
  373|       |   * alignment.
  374|       |   */
  375|  21.0k|  if (sizeofobject > MAX_ALLOC_CHUNK) {
  ------------------
  |  |   62|  21.0k|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
  |  Branch (375:7): [True: 0, False: 21.0k]
  ------------------
  376|       |    /* This prevents overflow/wrap-around in round_up_pow2() if sizeofobject
  377|       |       is close to SIZE_MAX. */
  378|      0|    out_of_memory(cinfo, 8);
  379|      0|  }
  380|  21.0k|  sizeofobject = round_up_pow2(sizeofobject, ALIGN_SIZE);
  ------------------
  |  |   92|  21.0k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  381|       |
  382|       |  /* Check for unsatisfiable request (do now to ensure no overflow below) */
  383|  21.0k|  if ((sizeof(large_pool_hdr) + sizeofobject + ALIGN_SIZE - 1) >
  ------------------
  |  |   92|  21.0k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  |  Branch (383:7): [True: 0, False: 21.0k]
  ------------------
  384|  21.0k|      MAX_ALLOC_CHUNK)
  ------------------
  |  |   62|  21.0k|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
  385|      0|    out_of_memory(cinfo, 3);    /* request exceeds malloc's ability */
  386|       |
  387|       |  /* Always make a new pool */
  388|  21.0k|  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
  ------------------
  |  |  827|  21.0k|#define JPOOL_NUMPOOLS   2
  ------------------
  |  Branch (388:7): [True: 0, False: 21.0k]
  |  Branch (388:22): [True: 0, False: 21.0k]
  ------------------
  389|      0|    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  390|       |
  391|  21.0k|  hdr_ptr = (large_pool_ptr)jpeg_get_large(cinfo, sizeofobject +
  392|  21.0k|                                           sizeof(large_pool_hdr) +
  393|  21.0k|                                           ALIGN_SIZE - 1);
  ------------------
  |  |   92|  21.0k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  394|  21.0k|  if (hdr_ptr == NULL)
  ------------------
  |  Branch (394:7): [True: 0, False: 21.0k]
  ------------------
  395|      0|    out_of_memory(cinfo, 4);    /* jpeg_get_large failed */
  396|  21.0k|  mem->total_space_allocated += sizeofobject + sizeof(large_pool_hdr) +
  397|  21.0k|                                ALIGN_SIZE - 1;
  ------------------
  |  |   92|  21.0k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  398|       |
  399|       |  /* Success, initialize the new pool header and add to list */
  400|  21.0k|  hdr_ptr->next = mem->large_list[pool_id];
  401|       |  /* We maintain space counts in each pool header for statistical purposes,
  402|       |   * even though they are not needed for allocation.
  403|       |   */
  404|  21.0k|  hdr_ptr->bytes_used = sizeofobject;
  405|  21.0k|  hdr_ptr->bytes_left = 0;
  406|  21.0k|  mem->large_list[pool_id] = hdr_ptr;
  407|       |
  408|  21.0k|  data_ptr = (char *)hdr_ptr; /* point to first data byte in pool... */
  409|  21.0k|  data_ptr += sizeof(small_pool_hdr); /* ...by skipping the header... */
  410|  21.0k|  if ((size_t)data_ptr % ALIGN_SIZE) /* ...and adjust for alignment */
  ------------------
  |  |   92|  21.0k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  |  Branch (410:7): [True: 21.0k, False: 0]
  ------------------
  411|  21.0k|    data_ptr += ALIGN_SIZE - (size_t)data_ptr % ALIGN_SIZE;
  ------------------
  |  |   92|  21.0k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
                  data_ptr += ALIGN_SIZE - (size_t)data_ptr % ALIGN_SIZE;
  ------------------
  |  |   92|  21.0k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  412|       |
  413|  21.0k|  return (void *)data_ptr;
  414|  21.0k|}
jmemmgr.c:alloc_sarray:
  437|  12.9k|{
  438|  12.9k|  my_mem_ptr mem = (my_mem_ptr)cinfo->mem;
  439|  12.9k|  JSAMPARRAY result;
  440|  12.9k|  JSAMPROW workspace;
  441|  12.9k|  JDIMENSION rowsperchunk, currow, i;
  442|  12.9k|  long ltemp;
  443|       |
  444|       |  /* Make sure each row is properly aligned */
  445|  12.9k|  if ((ALIGN_SIZE % sizeof(JSAMPLE)) != 0)
  ------------------
  |  |   92|  12.9k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  |  Branch (445:7): [Folded - Ignored]
  ------------------
  446|      0|    out_of_memory(cinfo, 5);    /* safety check */
  447|       |
  448|  12.9k|  if (samplesperrow > MAX_ALLOC_CHUNK) {
  ------------------
  |  |   62|  12.9k|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
  |  Branch (448:7): [True: 0, False: 12.9k]
  ------------------
  449|       |    /* This prevents overflow/wrap-around in round_up_pow2() if sizeofobject
  450|       |       is close to SIZE_MAX. */
  451|      0|    out_of_memory(cinfo, 9);
  452|      0|  }
  453|  12.9k|  samplesperrow = (JDIMENSION)round_up_pow2(samplesperrow, (2 * ALIGN_SIZE) /
  ------------------
  |  |   92|  12.9k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  454|  12.9k|                                                           sizeof(JSAMPLE));
  455|       |
  456|       |  /* Calculate max # of rows allowed in one allocation chunk */
  457|  12.9k|  ltemp = (MAX_ALLOC_CHUNK - sizeof(large_pool_hdr)) /
  ------------------
  |  |   62|  12.9k|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
  458|  12.9k|          ((long)samplesperrow * sizeof(JSAMPLE));
  459|  12.9k|  if (ltemp <= 0)
  ------------------
  |  Branch (459:7): [True: 0, False: 12.9k]
  ------------------
  460|      0|    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  461|  12.9k|  if (ltemp < (long)numrows)
  ------------------
  |  Branch (461:7): [True: 0, False: 12.9k]
  ------------------
  462|      0|    rowsperchunk = (JDIMENSION)ltemp;
  463|  12.9k|  else
  464|  12.9k|    rowsperchunk = numrows;
  465|  12.9k|  mem->last_rowsperchunk = rowsperchunk;
  466|       |
  467|       |  /* Get space for row pointers (small object) */
  468|  12.9k|  result = (JSAMPARRAY)alloc_small(cinfo, pool_id,
  469|  12.9k|                                   (size_t)(numrows * sizeof(JSAMPROW)));
  470|       |
  471|       |  /* Get the rows themselves (large objects) */
  472|  12.9k|  currow = 0;
  473|  25.9k|  while (currow < numrows) {
  ------------------
  |  Branch (473:10): [True: 12.9k, False: 12.9k]
  ------------------
  474|  12.9k|    rowsperchunk = MIN(rowsperchunk, numrows - currow);
  ------------------
  |  |  279|  12.9k|#define MIN(a, b)       ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (279:26): [True: 0, False: 12.9k]
  |  |  ------------------
  ------------------
  475|  12.9k|    workspace = (JSAMPROW)alloc_large(cinfo, pool_id,
  476|  12.9k|      (size_t)((size_t)rowsperchunk * (size_t)samplesperrow *
  477|  12.9k|               sizeof(JSAMPLE)));
  478|   160k|    for (i = rowsperchunk; i > 0; i--) {
  ------------------
  |  Branch (478:28): [True: 147k, False: 12.9k]
  ------------------
  479|   147k|      result[currow++] = workspace;
  480|   147k|      workspace += samplesperrow;
  481|   147k|    }
  482|  12.9k|  }
  483|       |
  484|  12.9k|  return result;
  485|  12.9k|}
jmemmgr.c:alloc_barray:
  497|  6.68k|{
  498|  6.68k|  my_mem_ptr mem = (my_mem_ptr)cinfo->mem;
  499|  6.68k|  JBLOCKARRAY result;
  500|  6.68k|  JBLOCKROW workspace;
  501|  6.68k|  JDIMENSION rowsperchunk, currow, i;
  502|  6.68k|  long ltemp;
  503|       |
  504|       |  /* Make sure each row is properly aligned */
  505|  6.68k|  if ((sizeof(JBLOCK) % ALIGN_SIZE) != 0)
  ------------------
  |  |   92|  6.68k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
  |  Branch (505:7): [Folded - Ignored]
  ------------------
  506|      0|    out_of_memory(cinfo, 6);    /* safety check */
  507|       |
  508|       |  /* Calculate max # of rows allowed in one allocation chunk */
  509|  6.68k|  ltemp = (MAX_ALLOC_CHUNK - sizeof(large_pool_hdr)) /
  ------------------
  |  |   62|  6.68k|#define MAX_ALLOC_CHUNK  1000000000L
  ------------------
  510|  6.68k|          ((long)blocksperrow * sizeof(JBLOCK));
  511|  6.68k|  if (ltemp <= 0)
  ------------------
  |  Branch (511:7): [True: 0, False: 6.68k]
  ------------------
  512|      0|    ERREXIT(cinfo, JERR_WIDTH_OVERFLOW);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  513|  6.68k|  if (ltemp < (long)numrows)
  ------------------
  |  Branch (513:7): [True: 0, False: 6.68k]
  ------------------
  514|      0|    rowsperchunk = (JDIMENSION)ltemp;
  515|  6.68k|  else
  516|  6.68k|    rowsperchunk = numrows;
  517|  6.68k|  mem->last_rowsperchunk = rowsperchunk;
  518|       |
  519|       |  /* Get space for row pointers (small object) */
  520|  6.68k|  result = (JBLOCKARRAY)alloc_small(cinfo, pool_id,
  521|  6.68k|                                    (size_t)(numrows * sizeof(JBLOCKROW)));
  522|       |
  523|       |  /* Get the rows themselves (large objects) */
  524|  6.68k|  currow = 0;
  525|  13.3k|  while (currow < numrows) {
  ------------------
  |  Branch (525:10): [True: 6.68k, False: 6.68k]
  ------------------
  526|  6.68k|    rowsperchunk = MIN(rowsperchunk, numrows - currow);
  ------------------
  |  |  279|  6.68k|#define MIN(a, b)       ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (279:26): [True: 0, False: 6.68k]
  |  |  ------------------
  ------------------
  527|  6.68k|    workspace = (JBLOCKROW)alloc_large(cinfo, pool_id,
  528|  6.68k|        (size_t)((size_t)rowsperchunk * (size_t)blocksperrow *
  529|  6.68k|                  sizeof(JBLOCK)));
  530|  2.79M|    for (i = rowsperchunk; i > 0; i--) {
  ------------------
  |  Branch (530:28): [True: 2.79M, False: 6.68k]
  ------------------
  531|  2.79M|      result[currow++] = workspace;
  532|  2.79M|      workspace += blocksperrow;
  533|  2.79M|    }
  534|  6.68k|  }
  535|       |
  536|  6.68k|  return result;
  537|  6.68k|}
jmemmgr.c:request_virt_barray:
  612|  6.68k|{
  613|  6.68k|  my_mem_ptr mem = (my_mem_ptr)cinfo->mem;
  614|  6.68k|  jvirt_barray_ptr result;
  615|       |
  616|       |  /* Only IMAGE-lifetime virtual arrays are currently supported */
  617|  6.68k|  if (pool_id != JPOOL_IMAGE)
  ------------------
  |  |  826|  6.68k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  |  Branch (617:7): [True: 0, False: 6.68k]
  ------------------
  618|      0|    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  619|       |
  620|       |  /* get control block */
  621|  6.68k|  result = (jvirt_barray_ptr)alloc_small(cinfo, pool_id,
  622|  6.68k|                                         sizeof(struct jvirt_barray_control));
  623|       |
  624|  6.68k|  result->mem_buffer = NULL;    /* marks array not yet realized */
  625|  6.68k|  result->rows_in_array = numrows;
  626|  6.68k|  result->blocksperrow = blocksperrow;
  627|  6.68k|  result->maxaccess = maxaccess;
  628|  6.68k|  result->pre_zero = pre_zero;
  629|  6.68k|  result->b_s_open = FALSE;     /* no associated backing-store object */
  ------------------
  |  |  245|  6.68k|#define FALSE   0               /* values of boolean */
  ------------------
  630|  6.68k|  result->next = mem->virt_barray_list; /* add to list of virtual arrays */
  631|  6.68k|  mem->virt_barray_list = result;
  632|       |
  633|  6.68k|  return result;
  634|  6.68k|}
jmemmgr.c:realize_virt_arrays:
  640|  4.56k|{
  641|  4.56k|  my_mem_ptr mem = (my_mem_ptr)cinfo->mem;
  642|  4.56k|  size_t space_per_minheight, maximum_space, avail_mem;
  643|  4.56k|  size_t minheights, max_minheights;
  644|  4.56k|  jvirt_sarray_ptr sptr;
  645|  4.56k|  jvirt_barray_ptr bptr;
  646|       |
  647|       |  /* Compute the minimum space needed (maxaccess rows in each buffer)
  648|       |   * and the maximum space needed (full image height in each buffer).
  649|       |   * These may be of use to the system-dependent jpeg_mem_available routine.
  650|       |   */
  651|  4.56k|  space_per_minheight = 0;
  652|  4.56k|  maximum_space = 0;
  653|  4.56k|  for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
  ------------------
  |  Branch (653:38): [True: 0, False: 4.56k]
  ------------------
  654|      0|    if (sptr->mem_buffer == NULL) { /* if not realized yet */
  ------------------
  |  Branch (654:9): [True: 0, False: 0]
  ------------------
  655|      0|      size_t new_space = (long)sptr->rows_in_array *
  656|      0|                         (long)sptr->samplesperrow * sizeof(JSAMPLE);
  657|       |
  658|      0|      space_per_minheight += (long)sptr->maxaccess *
  659|      0|                             (long)sptr->samplesperrow * sizeof(JSAMPLE);
  660|      0|      if (SIZE_MAX - maximum_space < new_space)
  ------------------
  |  Branch (660:11): [True: 0, False: 0]
  ------------------
  661|      0|        out_of_memory(cinfo, 10);
  662|      0|      maximum_space += new_space;
  663|      0|    }
  664|      0|  }
  665|  11.2k|  for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
  ------------------
  |  Branch (665:38): [True: 6.68k, False: 4.56k]
  ------------------
  666|  6.68k|    if (bptr->mem_buffer == NULL) { /* if not realized yet */
  ------------------
  |  Branch (666:9): [True: 6.68k, False: 0]
  ------------------
  667|  6.68k|      size_t new_space = (long)bptr->rows_in_array *
  668|  6.68k|                         (long)bptr->blocksperrow * sizeof(JBLOCK);
  669|       |
  670|  6.68k|      space_per_minheight += (long)bptr->maxaccess *
  671|  6.68k|                             (long)bptr->blocksperrow * sizeof(JBLOCK);
  672|  6.68k|      if (SIZE_MAX - maximum_space < new_space)
  ------------------
  |  Branch (672:11): [True: 0, False: 6.68k]
  ------------------
  673|      0|        out_of_memory(cinfo, 11);
  674|  6.68k|      maximum_space += new_space;
  675|  6.68k|    }
  676|  6.68k|  }
  677|       |
  678|  4.56k|  if (space_per_minheight <= 0)
  ------------------
  |  Branch (678:7): [True: 1.25k, False: 3.31k]
  ------------------
  679|  1.25k|    return;                     /* no unrealized arrays, no work */
  680|       |
  681|       |  /* Determine amount of memory to actually use; this is system-dependent. */
  682|  3.31k|  avail_mem = jpeg_mem_available(cinfo, space_per_minheight, maximum_space,
  683|  3.31k|                                 mem->total_space_allocated);
  684|       |
  685|       |  /* If the maximum space needed is available, make all the buffers full
  686|       |   * height; otherwise parcel it out with the same number of minheights
  687|       |   * in each buffer.
  688|       |   */
  689|  3.31k|  if (avail_mem >= maximum_space)
  ------------------
  |  Branch (689:7): [True: 3.31k, False: 0]
  ------------------
  690|  3.31k|    max_minheights = 1000000000L;
  691|      0|  else {
  692|      0|    max_minheights = avail_mem / space_per_minheight;
  693|       |    /* If there doesn't seem to be enough space, try to get the minimum
  694|       |     * anyway.  This allows a "stub" implementation of jpeg_mem_available().
  695|       |     */
  696|      0|    if (max_minheights <= 0)
  ------------------
  |  Branch (696:9): [True: 0, False: 0]
  ------------------
  697|      0|      max_minheights = 1;
  698|      0|  }
  699|       |
  700|       |  /* Allocate the in-memory buffers and initialize backing store as needed. */
  701|       |
  702|  3.31k|  for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
  ------------------
  |  Branch (702:38): [True: 0, False: 3.31k]
  ------------------
  703|      0|    if (sptr->mem_buffer == NULL) { /* if not realized yet */
  ------------------
  |  Branch (703:9): [True: 0, False: 0]
  ------------------
  704|      0|      minheights = ((long)sptr->rows_in_array - 1L) / sptr->maxaccess + 1L;
  705|      0|      if (minheights <= max_minheights) {
  ------------------
  |  Branch (705:11): [True: 0, False: 0]
  ------------------
  706|       |        /* This buffer fits in memory */
  707|      0|        sptr->rows_in_mem = sptr->rows_in_array;
  708|      0|      } else {
  709|       |        /* It doesn't fit in memory, create backing store. */
  710|      0|        sptr->rows_in_mem = (JDIMENSION)(max_minheights * sptr->maxaccess);
  711|      0|        jpeg_open_backing_store(cinfo, &sptr->b_s_info,
  712|      0|                                (long)sptr->rows_in_array *
  713|      0|                                (long)sptr->samplesperrow *
  714|      0|                                (long)sizeof(JSAMPLE));
  715|      0|        sptr->b_s_open = TRUE;
  ------------------
  |  |  248|      0|#define TRUE    1
  ------------------
  716|      0|      }
  717|      0|      sptr->mem_buffer = alloc_sarray(cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|      0|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  718|      0|                                      sptr->samplesperrow, sptr->rows_in_mem);
  719|      0|      sptr->rowsperchunk = mem->last_rowsperchunk;
  720|      0|      sptr->cur_start_row = 0;
  721|      0|      sptr->first_undef_row = 0;
  722|      0|      sptr->dirty = FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  723|      0|    }
  724|      0|  }
  725|       |
  726|  9.99k|  for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
  ------------------
  |  Branch (726:38): [True: 6.68k, False: 3.31k]
  ------------------
  727|  6.68k|    if (bptr->mem_buffer == NULL) { /* if not realized yet */
  ------------------
  |  Branch (727:9): [True: 6.68k, False: 0]
  ------------------
  728|  6.68k|      minheights = ((long)bptr->rows_in_array - 1L) / bptr->maxaccess + 1L;
  729|  6.68k|      if (minheights <= max_minheights) {
  ------------------
  |  Branch (729:11): [True: 6.68k, False: 0]
  ------------------
  730|       |        /* This buffer fits in memory */
  731|  6.68k|        bptr->rows_in_mem = bptr->rows_in_array;
  732|  6.68k|      } else {
  733|       |        /* It doesn't fit in memory, create backing store. */
  734|      0|        bptr->rows_in_mem = (JDIMENSION)(max_minheights * bptr->maxaccess);
  735|      0|        jpeg_open_backing_store(cinfo, &bptr->b_s_info,
  736|      0|                                (long)bptr->rows_in_array *
  737|      0|                                (long)bptr->blocksperrow *
  738|      0|                                (long)sizeof(JBLOCK));
  739|      0|        bptr->b_s_open = TRUE;
  ------------------
  |  |  248|      0|#define TRUE    1
  ------------------
  740|      0|      }
  741|  6.68k|      bptr->mem_buffer = alloc_barray(cinfo, JPOOL_IMAGE,
  ------------------
  |  |  826|  6.68k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  742|  6.68k|                                      bptr->blocksperrow, bptr->rows_in_mem);
  743|  6.68k|      bptr->rowsperchunk = mem->last_rowsperchunk;
  744|  6.68k|      bptr->cur_start_row = 0;
  745|  6.68k|      bptr->first_undef_row = 0;
  746|  6.68k|      bptr->dirty = FALSE;
  ------------------
  |  |  245|  6.68k|#define FALSE   0               /* values of boolean */
  ------------------
  747|  6.68k|    }
  748|  6.68k|  }
  749|  3.31k|}
jmemmgr.c:access_virt_barray:
  908|  6.42M|{
  909|  6.42M|  JDIMENSION end_row = start_row + num_rows;
  910|  6.42M|  JDIMENSION undef_row;
  911|       |
  912|       |  /* debugging check */
  913|  6.42M|  if (end_row > ptr->rows_in_array || num_rows > ptr->maxaccess ||
  ------------------
  |  Branch (913:7): [True: 0, False: 6.42M]
  |  Branch (913:39): [True: 0, False: 6.42M]
  ------------------
  914|  6.42M|      ptr->mem_buffer == NULL)
  ------------------
  |  Branch (914:7): [True: 0, False: 6.42M]
  ------------------
  915|      0|    ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  916|       |
  917|       |  /* Make the desired part of the virtual array accessible */
  918|  6.42M|  if (start_row < ptr->cur_start_row ||
  ------------------
  |  Branch (918:7): [True: 0, False: 6.42M]
  ------------------
  919|  6.42M|      end_row > ptr->cur_start_row + ptr->rows_in_mem) {
  ------------------
  |  Branch (919:7): [True: 0, False: 6.42M]
  ------------------
  920|      0|    if (!ptr->b_s_open)
  ------------------
  |  Branch (920:9): [True: 0, False: 0]
  ------------------
  921|      0|      ERREXIT(cinfo, JERR_VIRTUAL_BUG);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  922|       |    /* Flush old buffer contents if necessary */
  923|      0|    if (ptr->dirty) {
  ------------------
  |  Branch (923:9): [True: 0, False: 0]
  ------------------
  924|      0|      do_barray_io(cinfo, ptr, TRUE);
  ------------------
  |  |  248|      0|#define TRUE    1
  ------------------
  925|      0|      ptr->dirty = FALSE;
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  926|      0|    }
  927|       |    /* Decide what part of virtual array to access.
  928|       |     * Algorithm: if target address > current window, assume forward scan,
  929|       |     * load starting at target address.  If target address < current window,
  930|       |     * assume backward scan, load so that target area is top of window.
  931|       |     * Note that when switching from forward write to forward read, will have
  932|       |     * start_row = 0, so the limiting case applies and we load from 0 anyway.
  933|       |     */
  934|      0|    if (start_row > ptr->cur_start_row) {
  ------------------
  |  Branch (934:9): [True: 0, False: 0]
  ------------------
  935|      0|      ptr->cur_start_row = start_row;
  936|      0|    } else {
  937|       |      /* use long arithmetic here to avoid overflow & unsigned problems */
  938|      0|      long ltemp;
  939|       |
  940|      0|      ltemp = (long)end_row - (long)ptr->rows_in_mem;
  941|      0|      if (ltemp < 0)
  ------------------
  |  Branch (941:11): [True: 0, False: 0]
  ------------------
  942|      0|        ltemp = 0;              /* don't fall off front end of file */
  943|      0|      ptr->cur_start_row = (JDIMENSION)ltemp;
  944|      0|    }
  945|       |    /* Read in the selected part of the array.
  946|       |     * During the initial write pass, we will do no actual read
  947|       |     * because the selected part is all undefined.
  948|       |     */
  949|      0|    do_barray_io(cinfo, ptr, FALSE);
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
  950|      0|  }
  951|       |  /* Ensure the accessed part of the array is defined; prezero if needed.
  952|       |   * To improve locality of access, we only prezero the part of the array
  953|       |   * that the caller is about to access, not the entire in-memory array.
  954|       |   */
  955|  6.42M|  if (ptr->first_undef_row < end_row) {
  ------------------
  |  Branch (955:7): [True: 1.15M, False: 5.26M]
  ------------------
  956|  1.15M|    if (ptr->first_undef_row < start_row) {
  ------------------
  |  Branch (956:9): [True: 380k, False: 774k]
  ------------------
  957|   380k|      if (writable)             /* writer skipped over a section of array */
  ------------------
  |  Branch (957:11): [True: 0, False: 380k]
  ------------------
  958|      0|        ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  959|   380k|      undef_row = start_row;    /* but reader is allowed to read ahead */
  960|   774k|    } else {
  961|   774k|      undef_row = ptr->first_undef_row;
  962|   774k|    }
  963|  1.15M|    if (writable)
  ------------------
  |  Branch (963:9): [True: 773k, False: 382k]
  ------------------
  964|   773k|      ptr->first_undef_row = end_row;
  965|  1.15M|    if (ptr->pre_zero) {
  ------------------
  |  Branch (965:9): [True: 1.15M, False: 0]
  ------------------
  966|  1.15M|      size_t bytesperrow = (size_t)ptr->blocksperrow * sizeof(JBLOCK);
  967|  1.15M|      undef_row -= ptr->cur_start_row; /* make indexes relative to buffer */
  968|  1.15M|      end_row -= ptr->cur_start_row;
  969|  3.08M|      while (undef_row < end_row) {
  ------------------
  |  Branch (969:14): [True: 1.92M, False: 1.15M]
  ------------------
  970|  1.92M|        jzero_far((void *)ptr->mem_buffer[undef_row], bytesperrow);
  971|  1.92M|        undef_row++;
  972|  1.92M|      }
  973|  1.15M|    } else {
  974|      0|      if (!writable)            /* reader looking at undefined data */
  ------------------
  |  Branch (974:11): [True: 0, False: 0]
  ------------------
  975|      0|        ERREXIT(cinfo, JERR_BAD_VIRTUAL_ACCESS);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
  976|      0|    }
  977|  1.15M|  }
  978|       |  /* Flag the buffer dirty if caller will write in it */
  979|  6.42M|  if (writable)
  ------------------
  |  Branch (979:7): [True: 5.37M, False: 1.04M]
  ------------------
  980|  5.37M|    ptr->dirty = TRUE;
  ------------------
  |  |  248|  5.37M|#define TRUE    1
  ------------------
  981|       |  /* Return address of proper part of the buffer */
  982|  6.42M|  return ptr->mem_buffer + (start_row - ptr->cur_start_row);
  983|  6.42M|}
jmemmgr.c:free_pool:
  992|  19.2k|{
  993|  19.2k|  my_mem_ptr mem = (my_mem_ptr)cinfo->mem;
  994|  19.2k|  small_pool_ptr shdr_ptr;
  995|  19.2k|  large_pool_ptr lhdr_ptr;
  996|  19.2k|  size_t space_freed;
  997|       |
  998|  19.2k|  if (pool_id < 0 || pool_id >= JPOOL_NUMPOOLS)
  ------------------
  |  |  827|  19.2k|#define JPOOL_NUMPOOLS   2
  ------------------
  |  Branch (998:7): [True: 0, False: 19.2k]
  |  Branch (998:22): [True: 0, False: 19.2k]
  ------------------
  999|      0|    ERREXIT1(cinfo, JERR_BAD_POOL_ID, pool_id); /* safety check */
  ------------------
  |  |  234|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  235|      0|   (cinfo)->err->msg_parm.i[0] = (p1), \
  |  |  236|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
 1000|       |
 1001|       |#ifdef MEM_STATS
 1002|       |  if (cinfo->err->trace_level > 1)
 1003|       |    print_mem_stats(cinfo, pool_id); /* print pool's memory usage statistics */
 1004|       |#endif
 1005|       |
 1006|       |  /* If freeing IMAGE pool, close any virtual arrays first */
 1007|  19.2k|  if (pool_id == JPOOL_IMAGE) {
  ------------------
  |  |  826|  19.2k|#define JPOOL_IMAGE      1      /* lasts until done with image/datastream */
  ------------------
  |  Branch (1007:7): [True: 14.0k, False: 5.16k]
  ------------------
 1008|  14.0k|    jvirt_sarray_ptr sptr;
 1009|  14.0k|    jvirt_barray_ptr bptr;
 1010|       |
 1011|  14.0k|    for (sptr = mem->virt_sarray_list; sptr != NULL; sptr = sptr->next) {
  ------------------
  |  Branch (1011:40): [True: 0, False: 14.0k]
  ------------------
 1012|      0|      if (sptr->b_s_open) {     /* there may be no backing store */
  ------------------
  |  Branch (1012:11): [True: 0, False: 0]
  ------------------
 1013|      0|        sptr->b_s_open = FALSE; /* prevent recursive close if error */
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
 1014|      0|        (*sptr->b_s_info.close_backing_store) (cinfo, &sptr->b_s_info);
 1015|      0|      }
 1016|      0|    }
 1017|  14.0k|    mem->virt_sarray_list = NULL;
 1018|  20.7k|    for (bptr = mem->virt_barray_list; bptr != NULL; bptr = bptr->next) {
  ------------------
  |  Branch (1018:40): [True: 6.68k, False: 14.0k]
  ------------------
 1019|  6.68k|      if (bptr->b_s_open) {     /* there may be no backing store */
  ------------------
  |  Branch (1019:11): [True: 0, False: 6.68k]
  ------------------
 1020|      0|        bptr->b_s_open = FALSE; /* prevent recursive close if error */
  ------------------
  |  |  245|      0|#define FALSE   0               /* values of boolean */
  ------------------
 1021|      0|        (*bptr->b_s_info.close_backing_store) (cinfo, &bptr->b_s_info);
 1022|      0|      }
 1023|  6.68k|    }
 1024|  14.0k|    mem->virt_barray_list = NULL;
 1025|  14.0k|  }
 1026|       |
 1027|       |  /* Release large objects */
 1028|  19.2k|  lhdr_ptr = mem->large_list[pool_id];
 1029|  19.2k|  mem->large_list[pool_id] = NULL;
 1030|       |
 1031|  40.2k|  while (lhdr_ptr != NULL) {
  ------------------
  |  Branch (1031:10): [True: 21.0k, False: 19.2k]
  ------------------
 1032|  21.0k|    large_pool_ptr next_lhdr_ptr = lhdr_ptr->next;
 1033|  21.0k|    space_freed = lhdr_ptr->bytes_used +
 1034|  21.0k|                  lhdr_ptr->bytes_left +
 1035|  21.0k|                  sizeof(large_pool_hdr) + ALIGN_SIZE - 1;
  ------------------
  |  |   92|  21.0k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
 1036|  21.0k|    jpeg_free_large(cinfo, (void *)lhdr_ptr, space_freed);
 1037|  21.0k|    mem->total_space_allocated -= space_freed;
 1038|  21.0k|    lhdr_ptr = next_lhdr_ptr;
 1039|  21.0k|  }
 1040|       |
 1041|       |  /* Release small objects */
 1042|  19.2k|  shdr_ptr = mem->small_list[pool_id];
 1043|  19.2k|  mem->small_list[pool_id] = NULL;
 1044|       |
 1045|  34.7k|  while (shdr_ptr != NULL) {
  ------------------
  |  Branch (1045:10): [True: 15.4k, False: 19.2k]
  ------------------
 1046|  15.4k|    small_pool_ptr next_shdr_ptr = shdr_ptr->next;
 1047|  15.4k|    space_freed = shdr_ptr->bytes_used + shdr_ptr->bytes_left +
 1048|  15.4k|                  sizeof(small_pool_hdr) + ALIGN_SIZE - 1;
  ------------------
  |  |   92|  15.4k|#define ALIGN_SIZE  32 /* Most of the SIMD instructions we support require
  ------------------
 1049|  15.4k|    jpeg_free_small(cinfo, (void *)shdr_ptr, space_freed);
 1050|  15.4k|    mem->total_space_allocated -= space_freed;
 1051|  15.4k|    shdr_ptr = next_shdr_ptr;
 1052|  15.4k|  }
 1053|  19.2k|}
jmemmgr.c:self_destruct:
 1063|  5.16k|{
 1064|  5.16k|  int pool;
 1065|       |
 1066|       |  /* Close all backing store, release all memory.
 1067|       |   * Releasing pools in reverse order might help avoid fragmentation
 1068|       |   * with some (brain-damaged) malloc libraries.
 1069|       |   */
 1070|  15.5k|  for (pool = JPOOL_NUMPOOLS - 1; pool >= JPOOL_PERMANENT; pool--) {
  ------------------
  |  |  827|  5.16k|#define JPOOL_NUMPOOLS   2
  ------------------
                for (pool = JPOOL_NUMPOOLS - 1; pool >= JPOOL_PERMANENT; pool--) {
  ------------------
  |  |  825|  15.5k|#define JPOOL_PERMANENT  0      /* lasts until master record is destroyed */
  ------------------
  |  Branch (1070:35): [True: 10.3k, False: 5.16k]
  ------------------
 1071|  10.3k|    free_pool(cinfo, pool);
 1072|  10.3k|  }
 1073|       |
 1074|       |  /* Release the memory manager control block too. */
 1075|  5.16k|  jpeg_free_small(cinfo, (void *)cinfo->mem, sizeof(my_memory_mgr));
 1076|  5.16k|  cinfo->mem = NULL;            /* ensures I will be called only once */
 1077|       |
 1078|  5.16k|  jpeg_mem_term(cinfo);         /* system-dependent cleanup */
 1079|  5.16k|}

jpeg_get_small:
   38|  20.6k|{
   39|  20.6k|  return (void *)malloc(sizeofobject);
   40|  20.6k|}
jpeg_free_small:
   44|  20.6k|{
   45|  20.6k|  free(object);
   46|  20.6k|}
jpeg_get_large:
   55|  21.0k|{
   56|  21.0k|  return (void *)malloc(sizeofobject);
   57|  21.0k|}
jpeg_free_large:
   61|  21.0k|{
   62|  21.0k|  free(object);
   63|  21.0k|}
jpeg_mem_available:
   73|  3.31k|{
   74|  3.31k|  if (cinfo->mem->max_memory_to_use) {
  ------------------
  |  Branch (74:7): [True: 0, False: 3.31k]
  ------------------
   75|      0|    if ((size_t)cinfo->mem->max_memory_to_use > already_allocated)
  ------------------
  |  Branch (75:9): [True: 0, False: 0]
  ------------------
   76|      0|      return cinfo->mem->max_memory_to_use - already_allocated;
   77|      0|    else
   78|      0|      return 0;
   79|  3.31k|  } else {
   80|       |    /* Here we always say, "we got all you want bud!" */
   81|  3.31k|    return max_bytes_needed;
   82|  3.31k|  }
   83|  3.31k|}
jpeg_mem_init:
  107|  5.16k|{
  108|  5.16k|  return 0;                     /* just set max_memory_to_use to 0 */
  109|  5.16k|}
jpeg_mem_term:
  113|  5.16k|{
  114|       |  /* no work */
  115|  5.16k|}

jdhuff.c:std_huff_tables:
   56|  1.76k|{
   57|  1.76k|  JHUFF_TBL **dc_huff_tbl_ptrs, **ac_huff_tbl_ptrs;
   58|       |
   59|  1.76k|  static const UINT8 bits_dc_luminance[17] = {
   60|  1.76k|    /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0
   61|  1.76k|  };
   62|  1.76k|  static const UINT8 val_dc_luminance[] = {
   63|  1.76k|    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
   64|  1.76k|  };
   65|       |
   66|  1.76k|  static const UINT8 bits_dc_chrominance[17] = {
   67|  1.76k|    /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0
   68|  1.76k|  };
   69|  1.76k|  static const UINT8 val_dc_chrominance[] = {
   70|  1.76k|    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
   71|  1.76k|  };
   72|       |
   73|  1.76k|  static const UINT8 bits_ac_luminance[17] = {
   74|  1.76k|    /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d
   75|  1.76k|  };
   76|  1.76k|  static const UINT8 val_ac_luminance[] = {
   77|  1.76k|    0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
   78|  1.76k|    0x21, 0x31, 0x41, 0x06, 0x13, 0x51, 0x61, 0x07,
   79|  1.76k|    0x22, 0x71, 0x14, 0x32, 0x81, 0x91, 0xa1, 0x08,
   80|  1.76k|    0x23, 0x42, 0xb1, 0xc1, 0x15, 0x52, 0xd1, 0xf0,
   81|  1.76k|    0x24, 0x33, 0x62, 0x72, 0x82, 0x09, 0x0a, 0x16,
   82|  1.76k|    0x17, 0x18, 0x19, 0x1a, 0x25, 0x26, 0x27, 0x28,
   83|  1.76k|    0x29, 0x2a, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
   84|  1.76k|    0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49,
   85|  1.76k|    0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59,
   86|  1.76k|    0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69,
   87|  1.76k|    0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79,
   88|  1.76k|    0x7a, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89,
   89|  1.76k|    0x8a, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
   90|  1.76k|    0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
   91|  1.76k|    0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
   92|  1.76k|    0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3, 0xc4, 0xc5,
   93|  1.76k|    0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2, 0xd3, 0xd4,
   94|  1.76k|    0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xe1, 0xe2,
   95|  1.76k|    0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea,
   96|  1.76k|    0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
   97|  1.76k|    0xf9, 0xfa
   98|  1.76k|  };
   99|       |
  100|  1.76k|  static const UINT8 bits_ac_chrominance[17] = {
  101|  1.76k|    /* 0-base */ 0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 0x77
  102|  1.76k|  };
  103|  1.76k|  static const UINT8 val_ac_chrominance[] = {
  104|  1.76k|    0x00, 0x01, 0x02, 0x03, 0x11, 0x04, 0x05, 0x21,
  105|  1.76k|    0x31, 0x06, 0x12, 0x41, 0x51, 0x07, 0x61, 0x71,
  106|  1.76k|    0x13, 0x22, 0x32, 0x81, 0x08, 0x14, 0x42, 0x91,
  107|  1.76k|    0xa1, 0xb1, 0xc1, 0x09, 0x23, 0x33, 0x52, 0xf0,
  108|  1.76k|    0x15, 0x62, 0x72, 0xd1, 0x0a, 0x16, 0x24, 0x34,
  109|  1.76k|    0xe1, 0x25, 0xf1, 0x17, 0x18, 0x19, 0x1a, 0x26,
  110|  1.76k|    0x27, 0x28, 0x29, 0x2a, 0x35, 0x36, 0x37, 0x38,
  111|  1.76k|    0x39, 0x3a, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
  112|  1.76k|    0x49, 0x4a, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58,
  113|  1.76k|    0x59, 0x5a, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68,
  114|  1.76k|    0x69, 0x6a, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78,
  115|  1.76k|    0x79, 0x7a, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87,
  116|  1.76k|    0x88, 0x89, 0x8a, 0x92, 0x93, 0x94, 0x95, 0x96,
  117|  1.76k|    0x97, 0x98, 0x99, 0x9a, 0xa2, 0xa3, 0xa4, 0xa5,
  118|  1.76k|    0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xb2, 0xb3, 0xb4,
  119|  1.76k|    0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xc2, 0xc3,
  120|  1.76k|    0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xd2,
  121|  1.76k|    0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda,
  122|  1.76k|    0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9,
  123|  1.76k|    0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
  124|  1.76k|    0xf9, 0xfa
  125|  1.76k|  };
  126|       |
  127|  1.76k|  if (cinfo->is_decompressor) {
  ------------------
  |  Branch (127:7): [True: 1.76k, False: 0]
  ------------------
  128|  1.76k|    dc_huff_tbl_ptrs = ((j_decompress_ptr)cinfo)->dc_huff_tbl_ptrs;
  129|  1.76k|    ac_huff_tbl_ptrs = ((j_decompress_ptr)cinfo)->ac_huff_tbl_ptrs;
  130|  1.76k|  } else {
  131|      0|    dc_huff_tbl_ptrs = ((j_compress_ptr)cinfo)->dc_huff_tbl_ptrs;
  132|      0|    ac_huff_tbl_ptrs = ((j_compress_ptr)cinfo)->ac_huff_tbl_ptrs;
  133|      0|  }
  134|       |
  135|  1.76k|  add_huff_table(cinfo, &dc_huff_tbl_ptrs[0], bits_dc_luminance,
  136|  1.76k|                 val_dc_luminance);
  137|  1.76k|  add_huff_table(cinfo, &ac_huff_tbl_ptrs[0], bits_ac_luminance,
  138|  1.76k|                 val_ac_luminance);
  139|  1.76k|  add_huff_table(cinfo, &dc_huff_tbl_ptrs[1], bits_dc_chrominance,
  140|  1.76k|                 val_dc_chrominance);
  141|  1.76k|  add_huff_table(cinfo, &ac_huff_tbl_ptrs[1], bits_ac_chrominance,
  142|  1.76k|                 val_ac_chrominance);
  143|  1.76k|}
jdhuff.c:add_huff_table:
   23|  7.06k|{
   24|  7.06k|  int nsymbols, len;
   25|       |
   26|  7.06k|  if (*htblptr == NULL)
  ------------------
  |  Branch (26:7): [True: 4.10k, False: 2.95k]
  ------------------
   27|  4.10k|    *htblptr = jpeg_alloc_huff_table(cinfo);
   28|  2.95k|  else
   29|  2.95k|    return;
   30|       |
   31|       |  /* Copy the number-of-symbols-of-each-code-length counts */
   32|  4.10k|  MEMCOPY((*htblptr)->bits, bits, sizeof((*htblptr)->bits));
  ------------------
  |  |   75|  4.10k|  memcpy((void *)(dest), (const void *)(src), (size_t)(size))
  ------------------
   33|       |
   34|       |  /* Validate the counts.  We do this here mainly so we can copy the right
   35|       |   * number of symbols from the val[] array, without risking marching off
   36|       |   * the end of memory.  jchuff.c will do a more thorough test later.
   37|       |   */
   38|  4.10k|  nsymbols = 0;
   39|  69.8k|  for (len = 1; len <= 16; len++)
  ------------------
  |  Branch (39:17): [True: 65.7k, False: 4.10k]
  ------------------
   40|  65.7k|    nsymbols += bits[len];
   41|  4.10k|  if (nsymbols < 1 || nsymbols > 256)
  ------------------
  |  Branch (41:7): [True: 0, False: 4.10k]
  |  Branch (41:23): [True: 0, False: 4.10k]
  ------------------
   42|      0|    ERREXIT(cinfo, JERR_BAD_HUFF_TABLE);
  ------------------
  |  |  231|      0|  ((cinfo)->err->msg_code = (code), \
  |  |  232|      0|   (*(cinfo)->err->error_exit) ((j_common_ptr)(cinfo)))
  ------------------
   43|       |
   44|  4.10k|  MEMCOPY((*htblptr)->huffval, val, nsymbols * sizeof(UINT8));
  ------------------
  |  |   75|  4.10k|  memcpy((void *)(dest), (const void *)(src), (size_t)(size))
  ------------------
   45|  4.10k|  MEMZERO(&((*htblptr)->huffval[nsymbols]), (256 - nsymbols) * sizeof(UINT8));
  ------------------
  |  |   73|  4.10k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
   46|       |
   47|       |  /* Initialize sent_table FALSE so table will be written to JPEG file. */
   48|  4.10k|  (*htblptr)->sent_table = FALSE;
  ------------------
  |  |  245|  4.10k|#define FALSE   0               /* values of boolean */
  ------------------
   49|  4.10k|}

jdiv_round_up:
   78|   123k|{
   79|   123k|  return (a + b - 1L) / b;
   80|   123k|}
jround_up:
   87|  17.1k|{
   88|  17.1k|  a += b - 1L;
   89|  17.1k|  return a - (a % b);
   90|  17.1k|}
jcopy_sample_rows:
  102|  1.96M|{
  103|  1.96M|  register JSAMPROW inptr, outptr;
  104|  1.96M|  register size_t count = (size_t)(num_cols * sizeof(JSAMPLE));
  105|  1.96M|  register int row;
  106|       |
  107|  1.96M|  input_array += source_row;
  108|  1.96M|  output_array += dest_row;
  109|       |
  110|  6.14M|  for (row = num_rows; row > 0; row--) {
  ------------------
  |  Branch (110:24): [True: 4.18M, False: 1.96M]
  ------------------
  111|  4.18M|    inptr = *input_array++;
  112|  4.18M|    outptr = *output_array++;
  113|  4.18M|    MEMCOPY(outptr, inptr, count);
  ------------------
  |  |   75|  4.18M|  memcpy((void *)(dest), (const void *)(src), (size_t)(size))
  ------------------
  114|  4.18M|  }
  115|  1.96M|}
jcopy_block_row:
  122|  4.16M|{
  123|  4.16M|  MEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * sizeof(JCOEF)));
  ------------------
  |  |   75|  4.16M|  memcpy((void *)(dest), (const void *)(src), (size_t)(size))
  ------------------
  124|  4.16M|}
jzero_far:
  131|  4.39M|{
  132|  4.39M|  MEMZERO(target, bytestozero);
  ------------------
  |  |   73|  4.39M|  memset((void *)(target), 0, (size_t)(size))
  ------------------
  133|  4.39M|}

jsimd_can_ycc_rgb:
  118|  1.68k|{
  119|  1.68k|  init_simd();
  120|       |
  121|       |  /* The code is optimised for these values only */
  122|  1.68k|  if (BITS_IN_JSAMPLE != 8)
  ------------------
  |  |   33|  1.68k|#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */
  ------------------
  |  Branch (122:7): [Folded - Ignored]
  ------------------
  123|      0|    return 0;
  124|  1.68k|  if (sizeof(JDIMENSION) != 4)
  ------------------
  |  Branch (124:7): [Folded - Ignored]
  ------------------
  125|      0|    return 0;
  126|  1.68k|  if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
  ------------------
  |  |  334|  1.68k|#define RGB_PIXELSIZE   3       /* JSAMPLEs per RGB scanline element */
  ------------------
                if ((RGB_PIXELSIZE != 3) && (RGB_PIXELSIZE != 4))
  ------------------
  |  |  334|      0|#define RGB_PIXELSIZE   3       /* JSAMPLEs per RGB scanline element */
  ------------------
  |  Branch (126:7): [Folded - Ignored]
  |  Branch (126:31): [Folded - Ignored]
  ------------------
  127|      0|    return 0;
  128|       |
  129|  1.68k|  if ((simd_support & JSIMD_AVX2) &&
  ------------------
  |  |   27|  1.68k|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (129:7): [True: 1.68k, False: 0]
  ------------------
  130|  1.68k|      IS_ALIGNED_AVX(jconst_ycc_rgb_convert_avx2))
  ------------------
  |  |   33|  1.68k|#define IS_ALIGNED_AVX(ptr)  (IS_ALIGNED(ptr, 5)) /* 32 byte alignment */
  |  |  ------------------
  |  |  |  |   30|  1.68k|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (33:30): [True: 1.68k, False: 0]
  |  |  ------------------
  ------------------
  131|  1.68k|    return 1;
  132|      0|  if ((simd_support & JSIMD_SSE2) &&
  ------------------
  |  |   23|      0|#define JSIMD_SSE2     0x08
  ------------------
  |  Branch (132:7): [True: 0, False: 0]
  ------------------
  133|      0|      IS_ALIGNED_SSE(jconst_ycc_rgb_convert_sse2))
  ------------------
  |  |   32|      0|#define IS_ALIGNED_SSE(ptr)  (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */
  |  |  ------------------
  |  |  |  |   30|      0|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (32:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  134|      0|    return 1;
  135|       |
  136|      0|  return 0;
  137|      0|}
jsimd_ycc_rgb_convert:
  253|  1.23M|{
  254|  1.23M|  void (*avx2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
  255|  1.23M|  void (*sse2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY, int);
  256|       |
  257|  1.23M|  if (simd_support == ~0U)
  ------------------
  |  Branch (257:7): [True: 0, False: 1.23M]
  ------------------
  258|      0|    init_simd();
  259|       |
  260|  1.23M|  switch (cinfo->out_color_space) {
  261|  1.10M|  case JCS_EXT_RGB:
  ------------------
  |  Branch (261:3): [True: 1.10M, False: 131k]
  ------------------
  262|  1.10M|    avx2fct = jsimd_ycc_extrgb_convert_avx2;
  263|  1.10M|    sse2fct = jsimd_ycc_extrgb_convert_sse2;
  264|  1.10M|    break;
  265|      0|  case JCS_EXT_RGBX:
  ------------------
  |  Branch (265:3): [True: 0, False: 1.23M]
  ------------------
  266|      0|  case JCS_EXT_RGBA:
  ------------------
  |  Branch (266:3): [True: 0, False: 1.23M]
  ------------------
  267|      0|    avx2fct = jsimd_ycc_extrgbx_convert_avx2;
  268|      0|    sse2fct = jsimd_ycc_extrgbx_convert_sse2;
  269|      0|    break;
  270|      0|  case JCS_EXT_BGR:
  ------------------
  |  Branch (270:3): [True: 0, False: 1.23M]
  ------------------
  271|      0|    avx2fct = jsimd_ycc_extbgr_convert_avx2;
  272|      0|    sse2fct = jsimd_ycc_extbgr_convert_sse2;
  273|      0|    break;
  274|   131k|  case JCS_EXT_BGRX:
  ------------------
  |  Branch (274:3): [True: 131k, False: 1.10M]
  ------------------
  275|   131k|  case JCS_EXT_BGRA:
  ------------------
  |  Branch (275:3): [True: 0, False: 1.23M]
  ------------------
  276|   131k|    avx2fct = jsimd_ycc_extbgrx_convert_avx2;
  277|   131k|    sse2fct = jsimd_ycc_extbgrx_convert_sse2;
  278|   131k|    break;
  279|      0|  case JCS_EXT_XBGR:
  ------------------
  |  Branch (279:3): [True: 0, False: 1.23M]
  ------------------
  280|      0|  case JCS_EXT_ABGR:
  ------------------
  |  Branch (280:3): [True: 0, False: 1.23M]
  ------------------
  281|      0|    avx2fct = jsimd_ycc_extxbgr_convert_avx2;
  282|      0|    sse2fct = jsimd_ycc_extxbgr_convert_sse2;
  283|      0|    break;
  284|      0|  case JCS_EXT_XRGB:
  ------------------
  |  Branch (284:3): [True: 0, False: 1.23M]
  ------------------
  285|      0|  case JCS_EXT_ARGB:
  ------------------
  |  Branch (285:3): [True: 0, False: 1.23M]
  ------------------
  286|      0|    avx2fct = jsimd_ycc_extxrgb_convert_avx2;
  287|      0|    sse2fct = jsimd_ycc_extxrgb_convert_sse2;
  288|      0|    break;
  289|      0|  default:
  ------------------
  |  Branch (289:3): [True: 0, False: 1.23M]
  ------------------
  290|      0|    avx2fct = jsimd_ycc_rgb_convert_avx2;
  291|      0|    sse2fct = jsimd_ycc_rgb_convert_sse2;
  292|      0|    break;
  293|  1.23M|  }
  294|       |
  295|  1.23M|  if (simd_support & JSIMD_AVX2)
  ------------------
  |  |   27|  1.23M|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (295:7): [True: 1.23M, False: 0]
  ------------------
  296|  1.23M|    avx2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
  297|      0|  else
  298|      0|    sse2fct(cinfo->output_width, input_buf, input_row, output_buf, num_rows);
  299|  1.23M|}
jsimd_can_h2v2_upsample:
  386|    284|{
  387|    284|  init_simd();
  388|       |
  389|       |  /* The code is optimised for these values only */
  390|    284|  if (BITS_IN_JSAMPLE != 8)
  ------------------
  |  |   33|    284|#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */
  ------------------
  |  Branch (390:7): [Folded - Ignored]
  ------------------
  391|      0|    return 0;
  392|    284|  if (sizeof(JDIMENSION) != 4)
  ------------------
  |  Branch (392:7): [Folded - Ignored]
  ------------------
  393|      0|    return 0;
  394|       |
  395|    284|  if (simd_support & JSIMD_AVX2)
  ------------------
  |  |   27|    284|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (395:7): [True: 284, False: 0]
  ------------------
  396|    284|    return 1;
  397|      0|  if (simd_support & JSIMD_SSE2)
  ------------------
  |  |   23|      0|#define JSIMD_SSE2     0x08
  ------------------
  |  Branch (397:7): [True: 0, False: 0]
  ------------------
  398|      0|    return 1;
  399|       |
  400|      0|  return 0;
  401|      0|}
jsimd_can_h2v1_upsample:
  405|    606|{
  406|    606|  init_simd();
  407|       |
  408|       |  /* The code is optimised for these values only */
  409|    606|  if (BITS_IN_JSAMPLE != 8)
  ------------------
  |  |   33|    606|#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */
  ------------------
  |  Branch (409:7): [Folded - Ignored]
  ------------------
  410|      0|    return 0;
  411|    606|  if (sizeof(JDIMENSION) != 4)
  ------------------
  |  Branch (411:7): [Folded - Ignored]
  ------------------
  412|      0|    return 0;
  413|       |
  414|    606|  if (simd_support & JSIMD_AVX2)
  ------------------
  |  |   27|    606|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (414:7): [True: 606, False: 0]
  ------------------
  415|    606|    return 1;
  416|      0|  if (simd_support & JSIMD_SSE2)
  ------------------
  |  |   23|      0|#define JSIMD_SSE2     0x08
  ------------------
  |  Branch (416:7): [True: 0, False: 0]
  ------------------
  417|      0|    return 1;
  418|       |
  419|      0|  return 0;
  420|      0|}
jsimd_h2v2_upsample:
  425|   234k|{
  426|   234k|  if (simd_support == ~0U)
  ------------------
  |  Branch (426:7): [True: 0, False: 234k]
  ------------------
  427|      0|    init_simd();
  428|       |
  429|   234k|  if (simd_support & JSIMD_AVX2)
  ------------------
  |  |   27|   234k|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (429:7): [True: 234k, False: 0]
  ------------------
  430|   234k|    jsimd_h2v2_upsample_avx2(cinfo->max_v_samp_factor, cinfo->output_width,
  431|   234k|                             input_data, output_data_ptr);
  432|      0|  else
  433|      0|    jsimd_h2v2_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width,
  434|      0|                             input_data, output_data_ptr);
  435|   234k|}
jsimd_h2v1_upsample:
  440|   710k|{
  441|   710k|  if (simd_support == ~0U)
  ------------------
  |  Branch (441:7): [True: 0, False: 710k]
  ------------------
  442|      0|    init_simd();
  443|       |
  444|   710k|  if (simd_support & JSIMD_AVX2)
  ------------------
  |  |   27|   710k|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (444:7): [True: 710k, False: 0]
  ------------------
  445|   710k|    jsimd_h2v1_upsample_avx2(cinfo->max_v_samp_factor, cinfo->output_width,
  446|   710k|                             input_data, output_data_ptr);
  447|      0|  else
  448|      0|    jsimd_h2v1_upsample_sse2(cinfo->max_v_samp_factor, cinfo->output_width,
  449|      0|                             input_data, output_data_ptr);
  450|   710k|}
jsimd_can_h2v2_fancy_upsample:
  454|     75|{
  455|     75|  init_simd();
  456|       |
  457|       |  /* The code is optimised for these values only */
  458|     75|  if (BITS_IN_JSAMPLE != 8)
  ------------------
  |  |   33|     75|#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */
  ------------------
  |  Branch (458:7): [Folded - Ignored]
  ------------------
  459|      0|    return 0;
  460|     75|  if (sizeof(JDIMENSION) != 4)
  ------------------
  |  Branch (460:7): [Folded - Ignored]
  ------------------
  461|      0|    return 0;
  462|       |
  463|     75|  if ((simd_support & JSIMD_AVX2) &&
  ------------------
  |  |   27|     75|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (463:7): [True: 75, False: 0]
  ------------------
  464|     75|      IS_ALIGNED_AVX(jconst_fancy_upsample_avx2))
  ------------------
  |  |   33|     75|#define IS_ALIGNED_AVX(ptr)  (IS_ALIGNED(ptr, 5)) /* 32 byte alignment */
  |  |  ------------------
  |  |  |  |   30|     75|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (33:30): [True: 75, False: 0]
  |  |  ------------------
  ------------------
  465|     75|    return 1;
  466|      0|  if ((simd_support & JSIMD_SSE2) &&
  ------------------
  |  |   23|      0|#define JSIMD_SSE2     0x08
  ------------------
  |  Branch (466:7): [True: 0, False: 0]
  ------------------
  467|      0|      IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))
  ------------------
  |  |   32|      0|#define IS_ALIGNED_SSE(ptr)  (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */
  |  |  ------------------
  |  |  |  |   30|      0|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (32:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  468|      0|    return 1;
  469|       |
  470|      0|  return 0;
  471|      0|}
jsimd_can_h2v1_fancy_upsample:
  475|    131|{
  476|    131|  init_simd();
  477|       |
  478|       |  /* The code is optimised for these values only */
  479|    131|  if (BITS_IN_JSAMPLE != 8)
  ------------------
  |  |   33|    131|#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */
  ------------------
  |  Branch (479:7): [Folded - Ignored]
  ------------------
  480|      0|    return 0;
  481|    131|  if (sizeof(JDIMENSION) != 4)
  ------------------
  |  Branch (481:7): [Folded - Ignored]
  ------------------
  482|      0|    return 0;
  483|       |
  484|    131|  if ((simd_support & JSIMD_AVX2) &&
  ------------------
  |  |   27|    131|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (484:7): [True: 131, False: 0]
  ------------------
  485|    131|      IS_ALIGNED_AVX(jconst_fancy_upsample_avx2))
  ------------------
  |  |   33|    131|#define IS_ALIGNED_AVX(ptr)  (IS_ALIGNED(ptr, 5)) /* 32 byte alignment */
  |  |  ------------------
  |  |  |  |   30|    131|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (33:30): [True: 131, False: 0]
  |  |  ------------------
  ------------------
  486|    131|    return 1;
  487|      0|  if ((simd_support & JSIMD_SSE2) &&
  ------------------
  |  |   23|      0|#define JSIMD_SSE2     0x08
  ------------------
  |  Branch (487:7): [True: 0, False: 0]
  ------------------
  488|      0|      IS_ALIGNED_SSE(jconst_fancy_upsample_sse2))
  ------------------
  |  |   32|      0|#define IS_ALIGNED_SSE(ptr)  (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */
  |  |  ------------------
  |  |  |  |   30|      0|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (32:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  489|      0|    return 1;
  490|       |
  491|      0|  return 0;
  492|      0|}
jsimd_h2v2_fancy_upsample:
  497|  56.9k|{
  498|  56.9k|  if (simd_support == ~0U)
  ------------------
  |  Branch (498:7): [True: 0, False: 56.9k]
  ------------------
  499|      0|    init_simd();
  500|       |
  501|  56.9k|  if (simd_support & JSIMD_AVX2)
  ------------------
  |  |   27|  56.9k|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (501:7): [True: 56.9k, False: 0]
  ------------------
  502|  56.9k|    jsimd_h2v2_fancy_upsample_avx2(cinfo->max_v_samp_factor,
  503|  56.9k|                                   compptr->downsampled_width, input_data,
  504|  56.9k|                                   output_data_ptr);
  505|      0|  else
  506|      0|    jsimd_h2v2_fancy_upsample_sse2(cinfo->max_v_samp_factor,
  507|      0|                                   compptr->downsampled_width, input_data,
  508|      0|                                   output_data_ptr);
  509|  56.9k|}
jsimd_h2v1_fancy_upsample:
  514|   115k|{
  515|   115k|  if (simd_support == ~0U)
  ------------------
  |  Branch (515:7): [True: 0, False: 115k]
  ------------------
  516|      0|    init_simd();
  517|       |
  518|   115k|  if (simd_support & JSIMD_AVX2)
  ------------------
  |  |   27|   115k|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (518:7): [True: 115k, False: 0]
  ------------------
  519|   115k|    jsimd_h2v1_fancy_upsample_avx2(cinfo->max_v_samp_factor,
  520|   115k|                                   compptr->downsampled_width, input_data,
  521|   115k|                                   output_data_ptr);
  522|      0|  else
  523|      0|    jsimd_h2v1_fancy_upsample_sse2(cinfo->max_v_samp_factor,
  524|      0|                                   compptr->downsampled_width, input_data,
  525|      0|                                   output_data_ptr);
  526|   115k|}
jsimd_can_h2v2_merged_upsample:
  530|    461|{
  531|    461|  init_simd();
  532|       |
  533|       |  /* The code is optimised for these values only */
  534|    461|  if (BITS_IN_JSAMPLE != 8)
  ------------------
  |  |   33|    461|#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */
  ------------------
  |  Branch (534:7): [Folded - Ignored]
  ------------------
  535|      0|    return 0;
  536|    461|  if (sizeof(JDIMENSION) != 4)
  ------------------
  |  Branch (536:7): [Folded - Ignored]
  ------------------
  537|      0|    return 0;
  538|       |
  539|    461|  if ((simd_support & JSIMD_AVX2) &&
  ------------------
  |  |   27|    461|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (539:7): [True: 461, False: 0]
  ------------------
  540|    461|      IS_ALIGNED_AVX(jconst_merged_upsample_avx2))
  ------------------
  |  |   33|    461|#define IS_ALIGNED_AVX(ptr)  (IS_ALIGNED(ptr, 5)) /* 32 byte alignment */
  |  |  ------------------
  |  |  |  |   30|    461|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (33:30): [True: 461, False: 0]
  |  |  ------------------
  ------------------
  541|    461|    return 1;
  542|      0|  if ((simd_support & JSIMD_SSE2) &&
  ------------------
  |  |   23|      0|#define JSIMD_SSE2     0x08
  ------------------
  |  Branch (542:7): [True: 0, False: 0]
  ------------------
  543|      0|      IS_ALIGNED_SSE(jconst_merged_upsample_sse2))
  ------------------
  |  |   32|      0|#define IS_ALIGNED_SSE(ptr)  (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */
  |  |  ------------------
  |  |  |  |   30|      0|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (32:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  544|      0|    return 1;
  545|       |
  546|      0|  return 0;
  547|      0|}
jsimd_can_h2v1_merged_upsample:
  551|     49|{
  552|     49|  init_simd();
  553|       |
  554|       |  /* The code is optimised for these values only */
  555|     49|  if (BITS_IN_JSAMPLE != 8)
  ------------------
  |  |   33|     49|#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */
  ------------------
  |  Branch (555:7): [Folded - Ignored]
  ------------------
  556|      0|    return 0;
  557|     49|  if (sizeof(JDIMENSION) != 4)
  ------------------
  |  Branch (557:7): [Folded - Ignored]
  ------------------
  558|      0|    return 0;
  559|       |
  560|     49|  if ((simd_support & JSIMD_AVX2) &&
  ------------------
  |  |   27|     49|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (560:7): [True: 49, False: 0]
  ------------------
  561|     49|      IS_ALIGNED_AVX(jconst_merged_upsample_avx2))
  ------------------
  |  |   33|     49|#define IS_ALIGNED_AVX(ptr)  (IS_ALIGNED(ptr, 5)) /* 32 byte alignment */
  |  |  ------------------
  |  |  |  |   30|     49|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (33:30): [True: 49, False: 0]
  |  |  ------------------
  ------------------
  562|     49|    return 1;
  563|      0|  if ((simd_support & JSIMD_SSE2) &&
  ------------------
  |  |   23|      0|#define JSIMD_SSE2     0x08
  ------------------
  |  Branch (563:7): [True: 0, False: 0]
  ------------------
  564|      0|      IS_ALIGNED_SSE(jconst_merged_upsample_sse2))
  ------------------
  |  |   32|      0|#define IS_ALIGNED_SSE(ptr)  (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */
  |  |  ------------------
  |  |  |  |   30|      0|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (32:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  565|      0|    return 1;
  566|       |
  567|      0|  return 0;
  568|      0|}
jsimd_h2v2_merged_upsample:
  573|   256k|{
  574|   256k|  void (*avx2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
  575|   256k|  void (*sse2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
  576|       |
  577|   256k|  if (simd_support == ~0U)
  ------------------
  |  Branch (577:7): [True: 0, False: 256k]
  ------------------
  578|      0|    init_simd();
  579|       |
  580|   256k|  switch (cinfo->out_color_space) {
  581|   256k|  case JCS_EXT_RGB:
  ------------------
  |  Branch (581:3): [True: 256k, False: 0]
  ------------------
  582|   256k|    avx2fct = jsimd_h2v2_extrgb_merged_upsample_avx2;
  583|   256k|    sse2fct = jsimd_h2v2_extrgb_merged_upsample_sse2;
  584|   256k|    break;
  585|      0|  case JCS_EXT_RGBX:
  ------------------
  |  Branch (585:3): [True: 0, False: 256k]
  ------------------
  586|      0|  case JCS_EXT_RGBA:
  ------------------
  |  Branch (586:3): [True: 0, False: 256k]
  ------------------
  587|      0|    avx2fct = jsimd_h2v2_extrgbx_merged_upsample_avx2;
  588|      0|    sse2fct = jsimd_h2v2_extrgbx_merged_upsample_sse2;
  589|      0|    break;
  590|      0|  case JCS_EXT_BGR:
  ------------------
  |  Branch (590:3): [True: 0, False: 256k]
  ------------------
  591|      0|    avx2fct = jsimd_h2v2_extbgr_merged_upsample_avx2;
  592|      0|    sse2fct = jsimd_h2v2_extbgr_merged_upsample_sse2;
  593|      0|    break;
  594|      0|  case JCS_EXT_BGRX:
  ------------------
  |  Branch (594:3): [True: 0, False: 256k]
  ------------------
  595|      0|  case JCS_EXT_BGRA:
  ------------------
  |  Branch (595:3): [True: 0, False: 256k]
  ------------------
  596|      0|    avx2fct = jsimd_h2v2_extbgrx_merged_upsample_avx2;
  597|      0|    sse2fct = jsimd_h2v2_extbgrx_merged_upsample_sse2;
  598|      0|    break;
  599|      0|  case JCS_EXT_XBGR:
  ------------------
  |  Branch (599:3): [True: 0, False: 256k]
  ------------------
  600|      0|  case JCS_EXT_ABGR:
  ------------------
  |  Branch (600:3): [True: 0, False: 256k]
  ------------------
  601|      0|    avx2fct = jsimd_h2v2_extxbgr_merged_upsample_avx2;
  602|      0|    sse2fct = jsimd_h2v2_extxbgr_merged_upsample_sse2;
  603|      0|    break;
  604|      0|  case JCS_EXT_XRGB:
  ------------------
  |  Branch (604:3): [True: 0, False: 256k]
  ------------------
  605|      0|  case JCS_EXT_ARGB:
  ------------------
  |  Branch (605:3): [True: 0, False: 256k]
  ------------------
  606|      0|    avx2fct = jsimd_h2v2_extxrgb_merged_upsample_avx2;
  607|      0|    sse2fct = jsimd_h2v2_extxrgb_merged_upsample_sse2;
  608|      0|    break;
  609|      0|  default:
  ------------------
  |  Branch (609:3): [True: 0, False: 256k]
  ------------------
  610|      0|    avx2fct = jsimd_h2v2_merged_upsample_avx2;
  611|      0|    sse2fct = jsimd_h2v2_merged_upsample_sse2;
  612|      0|    break;
  613|   256k|  }
  614|       |
  615|   256k|  if (simd_support & JSIMD_AVX2)
  ------------------
  |  |   27|   256k|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (615:7): [True: 256k, False: 0]
  ------------------
  616|   256k|    avx2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
  617|      0|  else
  618|      0|    sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
  619|   256k|}
jsimd_h2v1_merged_upsample:
  624|   270k|{
  625|   270k|  void (*avx2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
  626|   270k|  void (*sse2fct) (JDIMENSION, JSAMPIMAGE, JDIMENSION, JSAMPARRAY);
  627|       |
  628|   270k|  if (simd_support == ~0U)
  ------------------
  |  Branch (628:7): [True: 0, False: 270k]
  ------------------
  629|      0|    init_simd();
  630|       |
  631|   270k|  switch (cinfo->out_color_space) {
  632|   270k|  case JCS_EXT_RGB:
  ------------------
  |  Branch (632:3): [True: 270k, False: 0]
  ------------------
  633|   270k|    avx2fct = jsimd_h2v1_extrgb_merged_upsample_avx2;
  634|   270k|    sse2fct = jsimd_h2v1_extrgb_merged_upsample_sse2;
  635|   270k|    break;
  636|      0|  case JCS_EXT_RGBX:
  ------------------
  |  Branch (636:3): [True: 0, False: 270k]
  ------------------
  637|      0|  case JCS_EXT_RGBA:
  ------------------
  |  Branch (637:3): [True: 0, False: 270k]
  ------------------
  638|      0|    avx2fct = jsimd_h2v1_extrgbx_merged_upsample_avx2;
  639|      0|    sse2fct = jsimd_h2v1_extrgbx_merged_upsample_sse2;
  640|      0|    break;
  641|      0|  case JCS_EXT_BGR:
  ------------------
  |  Branch (641:3): [True: 0, False: 270k]
  ------------------
  642|      0|    avx2fct = jsimd_h2v1_extbgr_merged_upsample_avx2;
  643|      0|    sse2fct = jsimd_h2v1_extbgr_merged_upsample_sse2;
  644|      0|    break;
  645|      0|  case JCS_EXT_BGRX:
  ------------------
  |  Branch (645:3): [True: 0, False: 270k]
  ------------------
  646|      0|  case JCS_EXT_BGRA:
  ------------------
  |  Branch (646:3): [True: 0, False: 270k]
  ------------------
  647|      0|    avx2fct = jsimd_h2v1_extbgrx_merged_upsample_avx2;
  648|      0|    sse2fct = jsimd_h2v1_extbgrx_merged_upsample_sse2;
  649|      0|    break;
  650|      0|  case JCS_EXT_XBGR:
  ------------------
  |  Branch (650:3): [True: 0, False: 270k]
  ------------------
  651|      0|  case JCS_EXT_ABGR:
  ------------------
  |  Branch (651:3): [True: 0, False: 270k]
  ------------------
  652|      0|    avx2fct = jsimd_h2v1_extxbgr_merged_upsample_avx2;
  653|      0|    sse2fct = jsimd_h2v1_extxbgr_merged_upsample_sse2;
  654|      0|    break;
  655|      0|  case JCS_EXT_XRGB:
  ------------------
  |  Branch (655:3): [True: 0, False: 270k]
  ------------------
  656|      0|  case JCS_EXT_ARGB:
  ------------------
  |  Branch (656:3): [True: 0, False: 270k]
  ------------------
  657|      0|    avx2fct = jsimd_h2v1_extxrgb_merged_upsample_avx2;
  658|      0|    sse2fct = jsimd_h2v1_extxrgb_merged_upsample_sse2;
  659|      0|    break;
  660|      0|  default:
  ------------------
  |  Branch (660:3): [True: 0, False: 270k]
  ------------------
  661|      0|    avx2fct = jsimd_h2v1_merged_upsample_avx2;
  662|      0|    sse2fct = jsimd_h2v1_merged_upsample_sse2;
  663|      0|    break;
  664|   270k|  }
  665|       |
  666|   270k|  if (simd_support & JSIMD_AVX2)
  ------------------
  |  |   27|   270k|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (666:7): [True: 270k, False: 0]
  ------------------
  667|   270k|    avx2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
  668|      0|  else
  669|      0|    sse2fct(cinfo->output_width, input_buf, in_row_group_ctr, output_buf);
  670|   270k|}
jsimd_can_idct_4x4:
  897|    973|{
  898|    973|  init_simd();
  899|       |
  900|       |  /* The code is optimised for these values only */
  901|    973|  if (DCTSIZE != 8)
  ------------------
  |  |   46|    973|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (901:7): [Folded - Ignored]
  ------------------
  902|      0|    return 0;
  903|    973|  if (sizeof(JCOEF) != 2)
  ------------------
  |  Branch (903:7): [Folded - Ignored]
  ------------------
  904|      0|    return 0;
  905|    973|  if (BITS_IN_JSAMPLE != 8)
  ------------------
  |  |   33|    973|#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */
  ------------------
  |  Branch (905:7): [Folded - Ignored]
  ------------------
  906|      0|    return 0;
  907|    973|  if (sizeof(JDIMENSION) != 4)
  ------------------
  |  Branch (907:7): [Folded - Ignored]
  ------------------
  908|      0|    return 0;
  909|    973|  if (sizeof(ISLOW_MULT_TYPE) != 2)
  ------------------
  |  Branch (909:7): [Folded - Ignored]
  ------------------
  910|      0|    return 0;
  911|       |
  912|    973|  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))
  ------------------
  |  |   23|    973|#define JSIMD_SSE2     0x08
  ------------------
                if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_red_sse2))
  ------------------
  |  |   32|    973|#define IS_ALIGNED_SSE(ptr)  (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */
  |  |  ------------------
  |  |  |  |   30|    973|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (32:30): [True: 973, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (912:7): [True: 973, False: 0]
  ------------------
  913|    973|    return 1;
  914|       |
  915|      0|  return 0;
  916|    973|}
jsimd_idct_4x4:
  930|  1.35M|{
  931|  1.35M|  jsimd_idct_4x4_sse2(compptr->dct_table, coef_block, output_buf, output_col);
  932|  1.35M|}
jsimd_can_idct_islow:
  936|  1.32k|{
  937|  1.32k|  init_simd();
  938|       |
  939|       |  /* The code is optimised for these values only */
  940|  1.32k|  if (DCTSIZE != 8)
  ------------------
  |  |   46|  1.32k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (940:7): [Folded - Ignored]
  ------------------
  941|      0|    return 0;
  942|  1.32k|  if (sizeof(JCOEF) != 2)
  ------------------
  |  Branch (942:7): [Folded - Ignored]
  ------------------
  943|      0|    return 0;
  944|  1.32k|  if (BITS_IN_JSAMPLE != 8)
  ------------------
  |  |   33|  1.32k|#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */
  ------------------
  |  Branch (944:7): [Folded - Ignored]
  ------------------
  945|      0|    return 0;
  946|  1.32k|  if (sizeof(JDIMENSION) != 4)
  ------------------
  |  Branch (946:7): [Folded - Ignored]
  ------------------
  947|      0|    return 0;
  948|  1.32k|  if (sizeof(ISLOW_MULT_TYPE) != 2)
  ------------------
  |  Branch (948:7): [Folded - Ignored]
  ------------------
  949|      0|    return 0;
  950|       |
  951|  1.32k|  if ((simd_support & JSIMD_AVX2) && IS_ALIGNED_AVX(jconst_idct_islow_avx2))
  ------------------
  |  |   27|  1.32k|#define JSIMD_AVX2     0x80
  ------------------
                if ((simd_support & JSIMD_AVX2) && IS_ALIGNED_AVX(jconst_idct_islow_avx2))
  ------------------
  |  |   33|  1.32k|#define IS_ALIGNED_AVX(ptr)  (IS_ALIGNED(ptr, 5)) /* 32 byte alignment */
  |  |  ------------------
  |  |  |  |   30|  1.32k|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (33:30): [True: 1.32k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (951:7): [True: 1.32k, False: 0]
  ------------------
  952|  1.32k|    return 1;
  953|      0|  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2))
  ------------------
  |  |   23|      0|#define JSIMD_SSE2     0x08
  ------------------
                if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_islow_sse2))
  ------------------
  |  |   32|      0|#define IS_ALIGNED_SSE(ptr)  (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */
  |  |  ------------------
  |  |  |  |   30|      0|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (32:30): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (953:7): [True: 0, False: 0]
  ------------------
  954|      0|    return 1;
  955|       |
  956|      0|  return 0;
  957|      0|}
jsimd_can_idct_ifast:
  961|  4.63k|{
  962|  4.63k|  init_simd();
  963|       |
  964|       |  /* The code is optimised for these values only */
  965|  4.63k|  if (DCTSIZE != 8)
  ------------------
  |  |   46|  4.63k|#define DCTSIZE             8   /* The basic DCT block is 8x8 samples */
  ------------------
  |  Branch (965:7): [Folded - Ignored]
  ------------------
  966|      0|    return 0;
  967|  4.63k|  if (sizeof(JCOEF) != 2)
  ------------------
  |  Branch (967:7): [Folded - Ignored]
  ------------------
  968|      0|    return 0;
  969|  4.63k|  if (BITS_IN_JSAMPLE != 8)
  ------------------
  |  |   33|  4.63k|#define BITS_IN_JSAMPLE  8      /* use 8 or 12 */
  ------------------
  |  Branch (969:7): [Folded - Ignored]
  ------------------
  970|      0|    return 0;
  971|  4.63k|  if (sizeof(JDIMENSION) != 4)
  ------------------
  |  Branch (971:7): [Folded - Ignored]
  ------------------
  972|      0|    return 0;
  973|  4.63k|  if (sizeof(IFAST_MULT_TYPE) != 2)
  ------------------
  |  Branch (973:7): [Folded - Ignored]
  ------------------
  974|      0|    return 0;
  975|  4.63k|  if (IFAST_SCALE_BITS != 2)
  ------------------
  |  |   69|  4.63k|#define IFAST_SCALE_BITS  2          /* fractional bits in scale factors */
  ------------------
  |  Branch (975:7): [Folded - Ignored]
  ------------------
  976|      0|    return 0;
  977|       |
  978|  4.63k|  if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2))
  ------------------
  |  |   23|  4.63k|#define JSIMD_SSE2     0x08
  ------------------
                if ((simd_support & JSIMD_SSE2) && IS_ALIGNED_SSE(jconst_idct_ifast_sse2))
  ------------------
  |  |   32|  4.63k|#define IS_ALIGNED_SSE(ptr)  (IS_ALIGNED(ptr, 4)) /* 16 byte alignment */
  |  |  ------------------
  |  |  |  |   30|  4.63k|#define IS_ALIGNED(ptr, order)  (((size_t)ptr & ((1 << order) - 1)) == 0)
  |  |  ------------------
  |  |  |  Branch (32:30): [True: 4.63k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (978:7): [True: 4.63k, False: 0]
  ------------------
  979|  4.63k|    return 1;
  980|       |
  981|      0|  return 0;
  982|  4.63k|}
jsimd_idct_islow:
 1012|  1.18M|{
 1013|  1.18M|  if (simd_support == ~0U)
  ------------------
  |  Branch (1013:7): [True: 0, False: 1.18M]
  ------------------
 1014|      0|    init_simd();
 1015|       |
 1016|  1.18M|  if (simd_support & JSIMD_AVX2)
  ------------------
  |  |   27|  1.18M|#define JSIMD_AVX2     0x80
  ------------------
  |  Branch (1016:7): [True: 1.18M, False: 0]
  ------------------
 1017|  1.18M|    jsimd_idct_islow_avx2(compptr->dct_table, coef_block, output_buf,
 1018|  1.18M|                          output_col);
 1019|      0|  else
 1020|      0|    jsimd_idct_islow_sse2(compptr->dct_table, coef_block, output_buf,
 1021|      0|                          output_col);
 1022|  1.18M|}
jsimd_idct_ifast:
 1028|  13.6M|{
 1029|  13.6M|  jsimd_idct_ifast_sse2(compptr->dct_table, coef_block, output_buf,
 1030|  13.6M|                        output_col);
 1031|  13.6M|}
jsimd.c:init_simd:
   43|  10.2k|{
   44|  10.2k|#ifndef NO_GETENV
   45|  10.2k|  char *env = NULL;
   46|  10.2k|#endif
   47|       |
   48|  10.2k|  if (simd_support != ~0U)
  ------------------
  |  Branch (48:7): [True: 10.2k, False: 1]
  ------------------
   49|  10.2k|    return;
   50|       |
   51|      1|  simd_support = jpeg_simd_cpu_support();
   52|       |
   53|      1|#ifndef NO_GETENV
   54|       |  /* Force different settings through environment variables */
   55|      1|  env = getenv("JSIMD_FORCESSE2");
   56|      1|  if ((env != NULL) && (strcmp(env, "1") == 0))
  ------------------
  |  Branch (56:7): [True: 0, False: 1]
  |  Branch (56:24): [True: 0, False: 0]
  ------------------
   57|      0|    simd_support &= JSIMD_SSE2;
  ------------------
  |  |   23|      0|#define JSIMD_SSE2     0x08
  ------------------
   58|      1|  env = getenv("JSIMD_FORCEAVX2");
   59|      1|  if ((env != NULL) && (strcmp(env, "1") == 0))
  ------------------
  |  Branch (59:7): [True: 0, False: 1]
  |  Branch (59:24): [True: 0, False: 0]
  ------------------
   60|      0|    simd_support &= JSIMD_AVX2;
  ------------------
  |  |   27|      0|#define JSIMD_AVX2     0x80
  ------------------
   61|      1|  env = getenv("JSIMD_FORCENONE");
   62|      1|  if ((env != NULL) && (strcmp(env, "1") == 0))
  ------------------
  |  Branch (62:7): [True: 0, False: 1]
  |  Branch (62:24): [True: 0, False: 0]
  ------------------
   63|      0|    simd_support = 0;
   64|      1|  env = getenv("JSIMD_NOHUFFENC");
   65|      1|  if ((env != NULL) && (strcmp(env, "1") == 0))
  ------------------
  |  Branch (65:7): [True: 0, False: 1]
  |  Branch (65:24): [True: 0, False: 0]
  ------------------
   66|      0|    simd_huffman = 0;
   67|      1|#endif
   68|      1|}

tjDestroy:
  454|  5.16k|{
  455|  5.16k|  GET_INSTANCE(handle);
  ------------------
  |  |  214|  5.16k|  tjinstance *this = (tjinstance *)handle; \
  |  |  215|  5.16k|  j_compress_ptr cinfo = NULL; \
  |  |  216|  5.16k|  j_decompress_ptr dinfo = NULL; \
  |  |  217|  5.16k|  \
  |  |  218|  5.16k|  if (!this) { \
  |  |  ------------------
  |  |  |  Branch (218:7): [True: 0, False: 5.16k]
  |  |  ------------------
  |  |  219|      0|    snprintf(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \
  |  |  ------------------
  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  ------------------
  |  |  220|      0|    return -1; \
  |  |  221|      0|  } \
  |  |  222|  5.16k|  cinfo = &this->cinfo;  dinfo = &this->dinfo; \
  |  |  223|  5.16k|  this->jerr.warning = FALSE; \
  |  |  ------------------
  |  |  |  |  245|  5.16k|#define FALSE   0               /* values of boolean */
  |  |  ------------------
  |  |  224|  5.16k|  this->isInstanceError = FALSE;
  |  |  ------------------
  |  |  |  |  245|  5.16k|#define FALSE   0               /* values of boolean */
  |  |  ------------------
  ------------------
  456|       |
  457|  5.16k|  if (setjmp(this->jerr.setjmp_buffer)) return -1;
  458|  5.16k|  if (this->init & COMPRESS) jpeg_destroy_compress(cinfo);
  ------------------
  |  Branch (458:7): [True: 0, False: 5.16k]
  ------------------
  459|  5.16k|  if (this->init & DECOMPRESS) jpeg_destroy_decompress(dinfo);
  ------------------
  |  Branch (459:7): [True: 5.16k, False: 0]
  ------------------
  460|  5.16k|  free(this);
  461|  5.16k|  return 0;
  462|  5.16k|}
tjInitDecompress:
 1217|  5.16k|{
 1218|  5.16k|  tjinstance *this;
 1219|       |
 1220|  5.16k|  if ((this = (tjinstance *)malloc(sizeof(tjinstance))) == NULL) {
  ------------------
  |  Branch (1220:7): [True: 0, False: 5.16k]
  ------------------
 1221|      0|    snprintf(errStr, JMSG_LENGTH_MAX,
  ------------------
  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  ------------------
 1222|      0|             "tjInitDecompress(): Memory allocation failure");
 1223|      0|    return NULL;
 1224|      0|  }
 1225|  5.16k|  MEMZERO(this, sizeof(tjinstance));
  ------------------
  |  |   73|  5.16k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
 1226|  5.16k|  snprintf(this->errStr, JMSG_LENGTH_MAX, "No error");
  ------------------
  |  |  729|  5.16k|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  ------------------
 1227|  5.16k|  return _tjInitDecompress(this);
 1228|  5.16k|}
tjDecompressHeader3:
 1237|  5.16k|{
 1238|  5.16k|  int retval = 0;
 1239|       |
 1240|  5.16k|  GET_DINSTANCE(handle);
  ------------------
  |  |  239|  5.16k|  tjinstance *this = (tjinstance *)handle; \
  |  |  240|  5.16k|  j_decompress_ptr dinfo = NULL; \
  |  |  241|  5.16k|  \
  |  |  242|  5.16k|  if (!this) { \
  |  |  ------------------
  |  |  |  Branch (242:7): [True: 0, False: 5.16k]
  |  |  ------------------
  |  |  243|      0|    snprintf(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \
  |  |  ------------------
  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  ------------------
  |  |  244|      0|    return -1; \
  |  |  245|      0|  } \
  |  |  246|  5.16k|  dinfo = &this->dinfo; \
  |  |  247|  5.16k|  this->jerr.warning = FALSE; \
  |  |  ------------------
  |  |  |  |  245|  5.16k|#define FALSE   0               /* values of boolean */
  |  |  ------------------
  |  |  248|  5.16k|  this->isInstanceError = FALSE;
  |  |  ------------------
  |  |  |  |  245|  5.16k|#define FALSE   0               /* values of boolean */
  |  |  ------------------
  ------------------
 1241|  5.16k|  if ((this->init & DECOMPRESS) == 0)
  ------------------
  |  Branch (1241:7): [True: 0, False: 5.16k]
  ------------------
 1242|  5.16k|    THROW("tjDecompressHeader3(): Instance has not been initialized for decompression");
  ------------------
  |  |  203|      0|#define THROW(m) { \
  |  |  204|      0|  snprintf(this->errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  ------------------
  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  ------------------
  |  |  205|      0|  this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  248|      0|#define TRUE    1
  |  |  ------------------
  |  |                 this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  195|      0|#define THROWG(m) { \
  |  |  |  |  196|      0|  snprintf(errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  |  |  ------------------
  |  |  |  |  197|      0|  retval = -1;  goto bailout; \
  |  |  |  |  198|      0|}
  |  |  ------------------
  |  |  206|      0|}
  ------------------
 1243|       |
 1244|  5.16k|  if (jpegBuf == NULL || jpegSize <= 0 || width == NULL || height == NULL ||
  ------------------
  |  Branch (1244:7): [True: 0, False: 5.16k]
  |  Branch (1244:26): [True: 0, False: 5.16k]
  |  Branch (1244:43): [True: 0, False: 5.16k]
  |  Branch (1244:60): [True: 0, False: 5.16k]
  ------------------
 1245|  5.16k|      jpegSubsamp == NULL || jpegColorspace == NULL)
  ------------------
  |  Branch (1245:7): [True: 0, False: 5.16k]
  |  Branch (1245:30): [True: 0, False: 5.16k]
  ------------------
 1246|  5.16k|    THROW("tjDecompressHeader3(): Invalid argument");
  ------------------
  |  |  203|      0|#define THROW(m) { \
  |  |  204|      0|  snprintf(this->errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  ------------------
  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  ------------------
  |  |  205|      0|  this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  248|      0|#define TRUE    1
  |  |  ------------------
  |  |                 this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  195|      0|#define THROWG(m) { \
  |  |  |  |  196|      0|  snprintf(errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  |  |  ------------------
  |  |  |  |  197|      0|  retval = -1;  goto bailout; \
  |  |  |  |  198|      0|}
  |  |  ------------------
  |  |  206|      0|}
  ------------------
 1247|       |
 1248|  5.16k|  if (setjmp(this->jerr.setjmp_buffer)) {
 1249|       |    /* If we get here, the JPEG code has signaled an error. */
 1250|  1.36k|    return -1;
 1251|  1.36k|  }
 1252|       |
 1253|  3.80k|  jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
 1254|  3.80k|  jpeg_read_header(dinfo, TRUE);
  ------------------
  |  |  248|  3.80k|#define TRUE    1
  ------------------
 1255|       |
 1256|  3.80k|  *width = dinfo->image_width;
 1257|  3.80k|  *height = dinfo->image_height;
 1258|  3.80k|  *jpegSubsamp = getSubsamp(dinfo);
 1259|  3.80k|  switch (dinfo->jpeg_color_space) {
 1260|  2.10k|  case JCS_GRAYSCALE:  *jpegColorspace = TJCS_GRAY;  break;
  ------------------
  |  Branch (1260:3): [True: 2.10k, False: 1.70k]
  ------------------
 1261|     90|  case JCS_RGB:        *jpegColorspace = TJCS_RGB;  break;
  ------------------
  |  Branch (1261:3): [True: 90, False: 3.71k]
  ------------------
 1262|  1.57k|  case JCS_YCbCr:      *jpegColorspace = TJCS_YCbCr;  break;
  ------------------
  |  Branch (1262:3): [True: 1.57k, False: 2.23k]
  ------------------
 1263|     24|  case JCS_CMYK:       *jpegColorspace = TJCS_CMYK;  break;
  ------------------
  |  Branch (1263:3): [True: 24, False: 3.78k]
  ------------------
 1264|      9|  case JCS_YCCK:       *jpegColorspace = TJCS_YCCK;  break;
  ------------------
  |  Branch (1264:3): [True: 9, False: 3.79k]
  ------------------
 1265|      9|  default:             *jpegColorspace = -1;  break;
  ------------------
  |  Branch (1265:3): [True: 9, False: 3.79k]
  ------------------
 1266|  3.80k|  }
 1267|       |
 1268|  3.80k|  jpeg_abort_decompress(dinfo);
 1269|       |
 1270|  3.80k|  if (*jpegSubsamp < 0)
  ------------------
  |  Branch (1270:7): [True: 1.29k, False: 2.51k]
  ------------------
 1271|  2.51k|    THROW("tjDecompressHeader3(): Could not determine subsampling type for JPEG image");
  ------------------
  |  |  203|  1.29k|#define THROW(m) { \
  |  |  204|  1.29k|  snprintf(this->errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  ------------------
  |  |  |  |  729|  1.29k|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  ------------------
  |  |  205|  1.29k|  this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  248|  1.29k|#define TRUE    1
  |  |  ------------------
  |  |                 this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  195|  1.29k|#define THROWG(m) { \
  |  |  |  |  196|  1.29k|  snprintf(errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  729|  1.29k|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  |  |  ------------------
  |  |  |  |  197|  1.29k|  retval = -1;  goto bailout; \
  |  |  |  |  198|  1.29k|}
  |  |  ------------------
  |  |  206|  1.29k|}
  ------------------
 1272|  2.51k|  if (*jpegColorspace < 0)
  ------------------
  |  Branch (1272:7): [True: 0, False: 2.51k]
  ------------------
 1273|  2.51k|    THROW("tjDecompressHeader3(): Could not determine colorspace of JPEG image");
  ------------------
  |  |  203|      0|#define THROW(m) { \
  |  |  204|      0|  snprintf(this->errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  ------------------
  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  ------------------
  |  |  205|      0|  this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  248|      0|#define TRUE    1
  |  |  ------------------
  |  |                 this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  195|      0|#define THROWG(m) { \
  |  |  |  |  196|      0|  snprintf(errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  |  |  ------------------
  |  |  |  |  197|      0|  retval = -1;  goto bailout; \
  |  |  |  |  198|      0|}
  |  |  ------------------
  |  |  206|      0|}
  ------------------
 1274|  2.51k|  if (*width < 1 || *height < 1)
  ------------------
  |  Branch (1274:7): [True: 0, False: 2.51k]
  |  Branch (1274:21): [True: 0, False: 2.51k]
  ------------------
 1275|  2.51k|    THROW("tjDecompressHeader3(): Invalid data returned in header");
  ------------------
  |  |  203|      0|#define THROW(m) { \
  |  |  204|      0|  snprintf(this->errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  ------------------
  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  ------------------
  |  |  205|      0|  this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  248|      0|#define TRUE    1
  |  |  ------------------
  |  |                 this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  195|      0|#define THROWG(m) { \
  |  |  |  |  196|      0|  snprintf(errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  |  |  ------------------
  |  |  |  |  197|      0|  retval = -1;  goto bailout; \
  |  |  |  |  198|      0|}
  |  |  ------------------
  |  |  206|      0|}
  ------------------
 1276|       |
 1277|  3.80k|bailout:
 1278|  3.80k|  if (this->jerr.warning) retval = -1;
  ------------------
  |  Branch (1278:7): [True: 1.77k, False: 2.03k]
  ------------------
 1279|  3.80k|  return retval;
 1280|  2.51k|}
tjDecompress2:
 1324|  5.08k|{
 1325|  5.08k|  JSAMPROW *row_pointer = NULL;
 1326|  5.08k|  int i, retval = 0, jpegwidth, jpegheight, scaledw, scaledh;
 1327|  5.08k|  struct my_progress_mgr progress;
 1328|       |
 1329|  5.08k|  GET_DINSTANCE(handle);
  ------------------
  |  |  239|  5.08k|  tjinstance *this = (tjinstance *)handle; \
  |  |  240|  5.08k|  j_decompress_ptr dinfo = NULL; \
  |  |  241|  5.08k|  \
  |  |  242|  5.08k|  if (!this) { \
  |  |  ------------------
  |  |  |  Branch (242:7): [True: 0, False: 5.08k]
  |  |  ------------------
  |  |  243|      0|    snprintf(errStr, JMSG_LENGTH_MAX, "Invalid handle"); \
  |  |  ------------------
  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  ------------------
  |  |  244|      0|    return -1; \
  |  |  245|      0|  } \
  |  |  246|  5.08k|  dinfo = &this->dinfo; \
  |  |  247|  5.08k|  this->jerr.warning = FALSE; \
  |  |  ------------------
  |  |  |  |  245|  5.08k|#define FALSE   0               /* values of boolean */
  |  |  ------------------
  |  |  248|  5.08k|  this->isInstanceError = FALSE;
  |  |  ------------------
  |  |  |  |  245|  5.08k|#define FALSE   0               /* values of boolean */
  |  |  ------------------
  ------------------
 1330|  5.08k|  this->jerr.stopOnWarning = (flags & TJFLAG_STOPONWARNING) ? TRUE : FALSE;
  ------------------
  |  |  418|  5.08k|#define TJFLAG_STOPONWARNING  8192
  ------------------
                this->jerr.stopOnWarning = (flags & TJFLAG_STOPONWARNING) ? TRUE : FALSE;
  ------------------
  |  |  248|      0|#define TRUE    1
  ------------------
                this->jerr.stopOnWarning = (flags & TJFLAG_STOPONWARNING) ? TRUE : FALSE;
  ------------------
  |  |  245|  10.1k|#define FALSE   0               /* values of boolean */
  ------------------
  |  Branch (1330:30): [True: 0, False: 5.08k]
  ------------------
 1331|  5.08k|  if ((this->init & DECOMPRESS) == 0)
  ------------------
  |  Branch (1331:7): [True: 0, False: 5.08k]
  ------------------
 1332|  5.08k|    THROW("tjDecompress2(): Instance has not been initialized for decompression");
  ------------------
  |  |  203|      0|#define THROW(m) { \
  |  |  204|      0|  snprintf(this->errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  ------------------
  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  ------------------
  |  |  205|      0|  this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  248|      0|#define TRUE    1
  |  |  ------------------
  |  |                 this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  195|      0|#define THROWG(m) { \
  |  |  |  |  196|      0|  snprintf(errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  |  |  ------------------
  |  |  |  |  197|      0|  retval = -1;  goto bailout; \
  |  |  |  |  198|      0|}
  |  |  ------------------
  |  |  206|      0|}
  ------------------
 1333|       |
 1334|  5.08k|  if (jpegBuf == NULL || jpegSize <= 0 || dstBuf == NULL || width < 0 ||
  ------------------
  |  Branch (1334:7): [True: 0, False: 5.08k]
  |  Branch (1334:26): [True: 0, False: 5.08k]
  |  Branch (1334:43): [True: 0, False: 5.08k]
  |  Branch (1334:61): [True: 0, False: 5.08k]
  ------------------
 1335|  5.08k|      pitch < 0 || height < 0 || pixelFormat < 0 || pixelFormat >= TJ_NUMPF)
  ------------------
  |  |  162|  5.08k|#define TJ_NUMPF  12
  ------------------
  |  Branch (1335:7): [True: 0, False: 5.08k]
  |  Branch (1335:20): [True: 0, False: 5.08k]
  |  Branch (1335:34): [True: 0, False: 5.08k]
  |  Branch (1335:53): [True: 0, False: 5.08k]
  ------------------
 1336|  5.08k|    THROW("tjDecompress2(): Invalid argument");
  ------------------
  |  |  203|      0|#define THROW(m) { \
  |  |  204|      0|  snprintf(this->errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  ------------------
  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  ------------------
  |  |  205|      0|  this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  248|      0|#define TRUE    1
  |  |  ------------------
  |  |                 this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  195|      0|#define THROWG(m) { \
  |  |  |  |  196|      0|  snprintf(errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  |  |  ------------------
  |  |  |  |  197|      0|  retval = -1;  goto bailout; \
  |  |  |  |  198|      0|}
  |  |  ------------------
  |  |  206|      0|}
  ------------------
 1337|       |
 1338|  5.08k|#ifndef NO_PUTENV
 1339|  5.08k|  if (flags & TJFLAG_FORCEMMX) putenv("JSIMD_FORCEMMX=1");
  ------------------
  |  | 1753|  5.08k|#define TJFLAG_FORCEMMX  8
  ------------------
  |  Branch (1339:7): [True: 0, False: 5.08k]
  ------------------
 1340|  5.08k|  else if (flags & TJFLAG_FORCESSE) putenv("JSIMD_FORCESSE=1");
  ------------------
  |  | 1754|  5.08k|#define TJFLAG_FORCESSE  16
  ------------------
  |  Branch (1340:12): [True: 0, False: 5.08k]
  ------------------
 1341|  5.08k|  else if (flags & TJFLAG_FORCESSE2) putenv("JSIMD_FORCESSE2=1");
  ------------------
  |  | 1755|  5.08k|#define TJFLAG_FORCESSE2  32
  ------------------
  |  Branch (1341:12): [True: 0, False: 5.08k]
  ------------------
 1342|  5.08k|#endif
 1343|       |
 1344|  5.08k|  if (flags & TJFLAG_LIMITSCANS) {
  ------------------
  |  |  435|  5.08k|#define TJFLAG_LIMITSCANS  32768
  ------------------
  |  Branch (1344:7): [True: 5.08k, False: 0]
  ------------------
 1345|  5.08k|    MEMZERO(&progress, sizeof(struct my_progress_mgr));
  ------------------
  |  |   73|  5.08k|  memset((void *)(target), 0, (size_t)(size))
  ------------------
 1346|  5.08k|    progress.pub.progress_monitor = my_progress_monitor;
 1347|  5.08k|    progress.this = this;
 1348|  5.08k|    dinfo->progress = &progress.pub;
 1349|  5.08k|  } else
 1350|      0|    dinfo->progress = NULL;
 1351|       |
 1352|  5.08k|  if (setjmp(this->jerr.setjmp_buffer)) {
 1353|       |    /* If we get here, the JPEG code has signaled an error. */
 1354|  1.48k|    retval = -1;  goto bailout;
 1355|  1.48k|  }
 1356|       |
 1357|  3.60k|  jpeg_mem_src_tj(dinfo, jpegBuf, jpegSize);
 1358|  3.60k|  jpeg_read_header(dinfo, TRUE);
  ------------------
  |  |  248|  3.60k|#define TRUE    1
  ------------------
 1359|  3.60k|  this->dinfo.out_color_space = pf2cs[pixelFormat];
 1360|  3.73k|  if (flags & TJFLAG_FASTDCT) this->dinfo.dct_method = JDCT_FASTEST;
  ------------------
  |  |  403|  3.60k|#define TJFLAG_FASTDCT  2048
  ------------------
                if (flags & TJFLAG_FASTDCT) this->dinfo.dct_method = JDCT_FASTEST;
  ------------------
  |  |  256|  3.73k|#define JDCT_FASTEST  JDCT_IFAST
  ------------------
  |  Branch (1360:7): [True: 3.73k, False: 18.4E]
  ------------------
 1361|  3.73k|  if (flags & TJFLAG_FASTUPSAMPLE) dinfo->do_fancy_upsampling = FALSE;
  ------------------
  |  |  387|  3.60k|#define TJFLAG_FASTUPSAMPLE  256
  ------------------
                if (flags & TJFLAG_FASTUPSAMPLE) dinfo->do_fancy_upsampling = FALSE;
  ------------------
  |  |  245|  3.73k|#define FALSE   0               /* values of boolean */
  ------------------
  |  Branch (1361:7): [True: 3.73k, False: 18.4E]
  ------------------
 1362|       |
 1363|  3.60k|  jpegwidth = dinfo->image_width;  jpegheight = dinfo->image_height;
 1364|  3.60k|  if (width == 0) width = jpegwidth;
  ------------------
  |  Branch (1364:7): [True: 0, False: 3.60k]
  ------------------
 1365|  3.60k|  if (height == 0) height = jpegheight;
  ------------------
  |  Branch (1365:7): [True: 0, False: 3.60k]
  ------------------
 1366|  47.5k|  for (i = 0; i < NUMSF; i++) {
  ------------------
  |  |  149|  46.0k|#define NUMSF  16
  ------------------
  |  Branch (1366:15): [True: 47.5k, False: 18.4E]
  ------------------
 1367|  47.5k|    scaledw = TJSCALED(jpegwidth, sf[i]);
  ------------------
  |  |  680|  47.5k|  (((dimension) * scalingFactor.num + scalingFactor.denom - 1) / \
  |  |  681|  47.5k|   scalingFactor.denom)
  ------------------
 1368|  47.5k|    scaledh = TJSCALED(jpegheight, sf[i]);
  ------------------
  |  |  680|  47.5k|  (((dimension) * scalingFactor.num + scalingFactor.denom - 1) / \
  |  |  681|  47.5k|   scalingFactor.denom)
  ------------------
 1369|  47.5k|    if (scaledw <= width && scaledh <= height)
  ------------------
  |  Branch (1369:9): [True: 5.22k, False: 42.3k]
  |  Branch (1369:29): [True: 5.08k, False: 140]
  ------------------
 1370|  5.08k|      break;
 1371|  47.5k|  }
 1372|  3.60k|  if (i >= NUMSF)
  ------------------
  |  |  149|  3.60k|#define NUMSF  16
  ------------------
  |  Branch (1372:7): [True: 0, False: 3.60k]
  ------------------
 1373|  3.60k|    THROW("tjDecompress2(): Could not scale down to desired image dimensions");
  ------------------
  |  |  203|      0|#define THROW(m) { \
  |  |  204|      0|  snprintf(this->errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  ------------------
  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  ------------------
  |  |  205|      0|  this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  248|      0|#define TRUE    1
  |  |  ------------------
  |  |                 this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  195|      0|#define THROWG(m) { \
  |  |  |  |  196|      0|  snprintf(errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  |  |  ------------------
  |  |  |  |  197|      0|  retval = -1;  goto bailout; \
  |  |  |  |  198|      0|}
  |  |  ------------------
  |  |  206|      0|}
  ------------------
 1374|  3.60k|  width = scaledw;  height = scaledh;
 1375|  3.60k|  dinfo->scale_num = sf[i].num;
 1376|  3.60k|  dinfo->scale_denom = sf[i].denom;
 1377|       |
 1378|  3.60k|  jpeg_start_decompress(dinfo);
 1379|  3.60k|  if (pitch == 0) pitch = dinfo->output_width * tjPixelSize[pixelFormat];
  ------------------
  |  Branch (1379:7): [True: 3.60k, False: 0]
  ------------------
 1380|       |
 1381|  3.60k|  if ((row_pointer =
  ------------------
  |  Branch (1381:7): [True: 0, False: 3.60k]
  ------------------
 1382|  3.60k|       (JSAMPROW *)malloc(sizeof(JSAMPROW) * dinfo->output_height)) == NULL)
 1383|  3.60k|    THROW("tjDecompress2(): Memory allocation failure");
  ------------------
  |  |  203|      0|#define THROW(m) { \
  |  |  204|      0|  snprintf(this->errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  ------------------
  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  ------------------
  |  |  205|      0|  this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  248|      0|#define TRUE    1
  |  |  ------------------
  |  |                 this->isInstanceError = TRUE;  THROWG(m) \
  |  |  ------------------
  |  |  |  |  195|      0|#define THROWG(m) { \
  |  |  |  |  196|      0|  snprintf(errStr, JMSG_LENGTH_MAX, "%s", m); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  729|      0|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  |  |  |  |  ------------------
  |  |  |  |  197|      0|  retval = -1;  goto bailout; \
  |  |  |  |  198|      0|}
  |  |  ------------------
  |  |  206|      0|}
  ------------------
 1384|  3.60k|  if (setjmp(this->jerr.setjmp_buffer)) {
 1385|       |    /* If we get here, the JPEG code has signaled an error. */
 1386|    291|    retval = -1;  goto bailout;
 1387|    291|  }
 1388|  12.9M|  for (i = 0; i < (int)dinfo->output_height; i++) {
  ------------------
  |  Branch (1388:15): [True: 12.9M, False: 3.31k]
  ------------------
 1389|  12.9M|    if (flags & TJFLAG_BOTTOMUP)
  ------------------
  |  |  379|  12.9M|#define TJFLAG_BOTTOMUP  2
  ------------------
  |  Branch (1389:9): [True: 11.2M, False: 1.67M]
  ------------------
 1390|  11.2M|      row_pointer[i] = &dstBuf[(dinfo->output_height - i - 1) * (size_t)pitch];
 1391|  1.67M|    else
 1392|  1.67M|      row_pointer[i] = &dstBuf[i * (size_t)pitch];
 1393|  12.9M|  }
 1394|  6.67M|  while (dinfo->output_scanline < dinfo->output_height)
  ------------------
  |  Branch (1394:10): [True: 6.67M, False: 3.31k]
  ------------------
 1395|  6.67M|    jpeg_read_scanlines(dinfo, &row_pointer[dinfo->output_scanline],
 1396|  6.67M|                        dinfo->output_height - dinfo->output_scanline);
 1397|  3.31k|  jpeg_finish_decompress(dinfo);
 1398|       |
 1399|  5.08k|bailout:
 1400|  5.08k|  if (dinfo->global_state > DSTATE_START) jpeg_abort_decompress(dinfo);
  ------------------
  |  |   34|  5.08k|#define DSTATE_START     200    /* after create_decompress */
  ------------------
  |  Branch (1400:7): [True: 1.77k, False: 3.31k]
  ------------------
 1401|  5.08k|  free(row_pointer);
 1402|  5.08k|  if (this->jerr.warning) retval = -1;
  ------------------
  |  Branch (1402:7): [True: 3.25k, False: 1.83k]
  ------------------
 1403|  5.08k|  this->jerr.stopOnWarning = FALSE;
  ------------------
  |  |  245|  5.08k|#define FALSE   0               /* values of boolean */
  ------------------
 1404|  5.08k|  return retval;
 1405|  3.31k|}
turbojpeg.c:my_error_exit:
   77|  3.13k|{
   78|  3.13k|  my_error_ptr myerr = (my_error_ptr)cinfo->err;
   79|       |
   80|  3.13k|  (*cinfo->err->output_message) (cinfo);
   81|  3.13k|  longjmp(myerr->setjmp_buffer, 1);
   82|  3.13k|}
turbojpeg.c:my_output_message:
   87|  9.31k|{
   88|  9.31k|  (*cinfo->err->format_message) (cinfo, errStr);
   89|  9.31k|}
turbojpeg.c:my_emit_message:
   92|  9.09M|{
   93|  9.09M|  my_error_ptr myerr = (my_error_ptr)cinfo->err;
   94|       |
   95|  9.09M|  myerr->emit_message(cinfo, msg_level);
   96|  9.09M|  if (msg_level < 0) {
  ------------------
  |  Branch (96:7): [True: 7.80M, False: 1.28M]
  ------------------
   97|  7.80M|    myerr->warning = TRUE;
  ------------------
  |  |  248|  7.80M|#define TRUE    1
  ------------------
   98|  7.80M|    if (myerr->stopOnWarning) longjmp(myerr->setjmp_buffer, 1);
  ------------------
  |  Branch (98:9): [True: 0, False: 7.80M]
  ------------------
   99|  7.80M|  }
  100|  9.09M|}
turbojpeg.c:_tjInitDecompress:
 1188|  5.16k|{
 1189|  5.16k|  static unsigned char buffer[1];
 1190|       |
 1191|       |  /* This is also straight out of example.txt */
 1192|  5.16k|  this->dinfo.err = jpeg_std_error(&this->jerr.pub);
 1193|  5.16k|  this->jerr.pub.error_exit = my_error_exit;
 1194|  5.16k|  this->jerr.pub.output_message = my_output_message;
 1195|  5.16k|  this->jerr.emit_message = this->jerr.pub.emit_message;
 1196|  5.16k|  this->jerr.pub.emit_message = my_emit_message;
 1197|  5.16k|  this->jerr.pub.addon_message_table = turbojpeg_message_table;
 1198|  5.16k|  this->jerr.pub.first_addon_message = JMSG_FIRSTADDONCODE;
 1199|  5.16k|  this->jerr.pub.last_addon_message = JMSG_LASTADDONCODE;
 1200|       |
 1201|  5.16k|  if (setjmp(this->jerr.setjmp_buffer)) {
 1202|       |    /* If we get here, the JPEG code has signaled an error. */
 1203|      0|    free(this);
 1204|      0|    return NULL;
 1205|      0|  }
 1206|       |
 1207|  5.16k|  jpeg_create_decompress(&this->dinfo);
  ------------------
  |  |  904|  5.16k|  jpeg_CreateDecompress((cinfo), JPEG_LIB_VERSION, \
  |  |  ------------------
  |  |  |  |    4|  5.16k|#define JPEG_LIB_VERSION  62
  |  |  ------------------
  |  |  905|  5.16k|                        (size_t)sizeof(struct jpeg_decompress_struct))
  ------------------
 1208|       |  /* Make an initial call so it will create the source manager */
 1209|  5.16k|  jpeg_mem_src_tj(&this->dinfo, buffer, 1);
 1210|       |
 1211|  5.16k|  this->init |= DECOMPRESS;
 1212|  5.16k|  return (tjhandle)this;
 1213|  5.16k|}
turbojpeg.c:getSubsamp:
  341|  3.80k|{
  342|  3.80k|  int retval = -1, i, k;
  343|       |
  344|       |  /* The sampling factors actually have no meaning with grayscale JPEG files,
  345|       |     and in fact it's possible to generate grayscale JPEGs with sampling
  346|       |     factors > 1 (even though those sampling factors are ignored by the
  347|       |     decompressor.)  Thus, we need to treat grayscale as a special case. */
  348|  3.80k|  if (dinfo->num_components == 1 && dinfo->jpeg_color_space == JCS_GRAYSCALE)
  ------------------
  |  Branch (348:7): [True: 2.10k, False: 1.70k]
  |  Branch (348:37): [True: 2.10k, False: 0]
  ------------------
  349|  2.10k|    return TJSAMP_GRAY;
  350|       |
  351|  9.91k|  for (i = 0; i < TJ_NUMSAMP; i++) {
  ------------------
  |  |   83|  9.91k|#define TJ_NUMSAMP  6
  ------------------
  |  Branch (351:15): [True: 8.62k, False: 1.29k]
  ------------------
  352|  8.62k|    if (dinfo->num_components == pixelsize[i] ||
  ------------------
  |  Branch (352:9): [True: 7.10k, False: 1.52k]
  ------------------
  353|  8.62k|        ((dinfo->jpeg_color_space == JCS_YCCK ||
  ------------------
  |  Branch (353:11): [True: 46, False: 1.47k]
  ------------------
  354|  1.52k|          dinfo->jpeg_color_space == JCS_CMYK) &&
  ------------------
  |  Branch (354:11): [True: 132, False: 1.34k]
  ------------------
  355|  7.25k|         pixelsize[i] == 3 && dinfo->num_components == 4)) {
  ------------------
  |  Branch (355:10): [True: 150, False: 28]
  |  Branch (355:31): [True: 150, False: 0]
  ------------------
  356|  7.25k|      if (dinfo->comp_info[0].h_samp_factor == tjMCUWidth[i] / 8 &&
  ------------------
  |  Branch (356:11): [True: 2.49k, False: 4.75k]
  ------------------
  357|  7.25k|          dinfo->comp_info[0].v_samp_factor == tjMCUHeight[i] / 8) {
  ------------------
  |  Branch (357:11): [True: 1.30k, False: 1.18k]
  ------------------
  358|  1.30k|        int match = 0;
  359|       |
  360|  3.94k|        for (k = 1; k < dinfo->num_components; k++) {
  ------------------
  |  Branch (360:21): [True: 2.64k, False: 1.30k]
  ------------------
  361|  2.64k|          int href = 1, vref = 1;
  362|       |
  363|  2.64k|          if ((dinfo->jpeg_color_space == JCS_YCCK ||
  ------------------
  |  Branch (363:16): [True: 27, False: 2.61k]
  ------------------
  364|  2.64k|               dinfo->jpeg_color_space == JCS_CMYK) && k == 3) {
  ------------------
  |  Branch (364:16): [True: 63, False: 2.55k]
  |  Branch (364:56): [True: 30, False: 60]
  ------------------
  365|     30|            href = tjMCUWidth[i] / 8;  vref = tjMCUHeight[i] / 8;
  366|     30|          }
  367|  2.64k|          if (dinfo->comp_info[k].h_samp_factor == href &&
  ------------------
  |  Branch (367:15): [True: 2.08k, False: 554]
  ------------------
  368|  2.64k|              dinfo->comp_info[k].v_samp_factor == vref)
  ------------------
  |  Branch (368:15): [True: 1.32k, False: 761]
  ------------------
  369|  1.32k|            match++;
  370|  2.64k|        }
  371|  1.30k|        if (match == dinfo->num_components - 1) {
  ------------------
  |  Branch (371:13): [True: 377, False: 929]
  ------------------
  372|    377|          retval = i;  break;
  373|    377|        }
  374|  1.30k|      }
  375|       |      /* Handle 4:2:2 and 4:4:0 images whose sampling factors are specified
  376|       |         in non-standard ways. */
  377|  6.87k|      if (dinfo->comp_info[0].h_samp_factor == 2 &&
  ------------------
  |  Branch (377:11): [True: 4.01k, False: 2.85k]
  ------------------
  378|  6.87k|          dinfo->comp_info[0].v_samp_factor == 2 &&
  ------------------
  |  Branch (378:11): [True: 1.20k, False: 2.81k]
  ------------------
  379|  6.87k|          (i == TJSAMP_422 || i == TJSAMP_440)) {
  ------------------
  |  Branch (379:12): [True: 327, False: 879]
  |  Branch (379:31): [True: 194, False: 685]
  ------------------
  380|    521|        int match = 0;
  381|       |
  382|  1.58k|        for (k = 1; k < dinfo->num_components; k++) {
  ------------------
  |  Branch (382:21): [True: 1.06k, False: 521]
  ------------------
  383|  1.06k|          int href = tjMCUHeight[i] / 8, vref = tjMCUWidth[i] / 8;
  384|       |
  385|  1.06k|          if ((dinfo->jpeg_color_space == JCS_YCCK ||
  ------------------
  |  Branch (385:16): [True: 21, False: 1.04k]
  ------------------
  386|  1.06k|               dinfo->jpeg_color_space == JCS_CMYK) && k == 3) {
  ------------------
  |  Branch (386:16): [True: 42, False: 1.00k]
  |  Branch (386:56): [True: 21, False: 42]
  ------------------
  387|     21|            href = vref = 2;
  388|     21|          }
  389|  1.06k|          if (dinfo->comp_info[k].h_samp_factor == href &&
  ------------------
  |  Branch (389:15): [True: 574, False: 489]
  ------------------
  390|  1.06k|              dinfo->comp_info[k].v_samp_factor == vref)
  ------------------
  |  Branch (390:15): [True: 141, False: 433]
  ------------------
  391|    141|            match++;
  392|  1.06k|        }
  393|    521|        if (match == dinfo->num_components - 1) {
  ------------------
  |  Branch (393:13): [True: 32, False: 489]
  ------------------
  394|     32|          retval = i;  break;
  395|     32|        }
  396|    521|      }
  397|       |      /* Handle 4:4:4 images whose sampling factors are specified in
  398|       |         non-standard ways. */
  399|  6.84k|      if (dinfo->comp_info[0].h_samp_factor *
  ------------------
  |  Branch (399:11): [True: 3.94k, False: 2.89k]
  ------------------
  400|  6.84k|          dinfo->comp_info[0].v_samp_factor <=
  401|  6.84k|          D_MAX_BLOCKS_IN_MCU / pixelsize[i] && i == TJSAMP_444) {
  ------------------
  |  |   62|  6.84k|#define D_MAX_BLOCKS_IN_MCU   10 /* decompressor's limit on blocks per MCU */
  ------------------
  |  Branch (401:49): [True: 838, False: 3.10k]
  ------------------
  402|    838|        int match = 0;
  403|  2.53k|        for (k = 1; k < dinfo->num_components; k++) {
  ------------------
  |  Branch (403:21): [True: 1.69k, False: 836]
  ------------------
  404|  1.69k|          if (dinfo->comp_info[k].h_samp_factor ==
  ------------------
  |  Branch (404:15): [True: 373, False: 1.32k]
  ------------------
  405|  1.69k|              dinfo->comp_info[0].h_samp_factor &&
  406|  1.69k|              dinfo->comp_info[k].v_samp_factor ==
  ------------------
  |  Branch (406:15): [True: 89, False: 284]
  ------------------
  407|    373|              dinfo->comp_info[0].v_samp_factor)
  408|     89|            match++;
  409|  1.69k|          if (match == dinfo->num_components - 1) {
  ------------------
  |  Branch (409:15): [True: 2, False: 1.69k]
  ------------------
  410|      2|            retval = i;  break;
  411|      2|          }
  412|  1.69k|        }
  413|    838|      }
  414|  6.84k|    }
  415|  8.62k|  }
  416|  1.70k|  return retval;
  417|  3.80k|}
turbojpeg.c:my_progress_monitor:
  123|  11.0M|{
  124|  11.0M|  my_error_ptr myerr = (my_error_ptr)dinfo->err;
  125|  11.0M|  my_progress_ptr myprog = (my_progress_ptr)dinfo->progress;
  126|       |
  127|  11.0M|  if (dinfo->is_decompressor) {
  ------------------
  |  Branch (127:7): [True: 11.0M, False: 0]
  ------------------
  128|  11.0M|    int scan_no = ((j_decompress_ptr)dinfo)->input_scan_number;
  129|       |
  130|  11.0M|    if (scan_no > 500) {
  ------------------
  |  Branch (130:9): [True: 1, False: 11.0M]
  ------------------
  131|      1|      snprintf(myprog->this->errStr, JMSG_LENGTH_MAX,
  ------------------
  |  |  729|      1|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  ------------------
  132|      1|               "Progressive JPEG image has more than 500 scans");
  133|      1|      snprintf(errStr, JMSG_LENGTH_MAX,
  ------------------
  |  |  729|      1|#define JMSG_LENGTH_MAX  200    /* recommended size of format_message buffer */
  ------------------
  134|      1|               "Progressive JPEG image has more than 500 scans");
  135|      1|      myprog->this->isInstanceError = TRUE;
  ------------------
  |  |  248|      1|#define TRUE    1
  ------------------
  136|      1|      myerr->warning = FALSE;
  ------------------
  |  |  245|      1|#define FALSE   0               /* values of boolean */
  ------------------
  137|      1|      longjmp(myerr->setjmp_buffer, 1);
  138|      1|    }
  139|  11.0M|  }
  140|  11.0M|}

